@senior-gestao-pessoas/payroll-core 9.6.0 → 9.6.1-feature-hcmgdp-12319-85c558d3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms"),require("primeng/blockui"),require("primeng/progressspinner"),require("@angular/router"),require("@ngx-translate/core"),require("rxjs/operators"),require("primeng/breadcrumb"),require("@angular/common"),require("primeng/dropdown"),require("primeng/inputmask"),require("primeng/inputtext"),require("primeng/shared"),require("@seniorsistemas/angular-components"),require("moment"),require("rxjs"),require("primeng/tooltip"),require("primeng/table"),require("@angular/common/http"),require("primeng/api"),require("@senior-gestao-pessoas/angular-components"),require("ng2-img-cropper"),require("primeng/button"),require("primeng/dialog"),require("primeng/fileupload"),require("chance"),require("moment-business"),require("primeng/autocomplete"),require("primeng/splitbutton"),require("primeng/components/common/messageservice"),require("@seniorsistemas/senior-platform-data"),require("primeng/toast"),require("ng2-currency-mask"),require("primeng/fieldset"),require("primeng/panel"),require("primeng/confirmdialog")):"function"==typeof define&&define.amd?define("@senior-gestao-pessoas/payroll-core",["exports","@angular/core","@angular/forms","primeng/blockui","primeng/progressspinner","@angular/router","@ngx-translate/core","rxjs/operators","primeng/breadcrumb","@angular/common","primeng/dropdown","primeng/inputmask","primeng/inputtext","primeng/shared","@seniorsistemas/angular-components","moment","rxjs","primeng/tooltip","primeng/table","@angular/common/http","primeng/api","@senior-gestao-pessoas/angular-components","ng2-img-cropper","primeng/button","primeng/dialog","primeng/fileupload","chance","moment-business","primeng/autocomplete","primeng/splitbutton","primeng/components/common/messageservice","@seniorsistemas/senior-platform-data","primeng/toast","ng2-currency-mask","primeng/fieldset","primeng/panel","primeng/confirmdialog"],e):e(((t=t||self)["senior-gestao-pessoas"]=t["senior-gestao-pessoas"]||{},t["senior-gestao-pessoas"]["payroll-core"]={}),t.ng.core,t.ng.forms,t.blockui,t.progressspinner,t.ng.router,t.core$1,t.rxjs.operators,t.breadcrumb,t.ng.common,t.dropdown,t.inputmask,t.inputtext,t.shared,t.angularComponents,t.moment_,t.rxjs,t.tooltip,t.table,t.ng.common.http,t.api,t.angularComponents$1,t.ng2ImgCropper,t.button,t.dialog,t.fileupload,t.chance,t.business,t.autocomplete,t.splitbutton,t.messageservice,t.seniorPlatformData,t.toast,t.ng2CurrencyMask,t.fieldset,t.panel,t.confirmdialog)}(this,(function(t,e,o,n,i,r,a,s,l,p,c,u,d,m,h,y,f,g,b,v,I,_,S,k,w,C,D,T,E,F,A,P,x,M,L,O,B){"use strict";T=T&&T.hasOwnProperty("default")?T.default:T;var R=function(){return(R=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function N(t,e,o,n){var i,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,o,a):i(e,o))||a);return r>3&&a&&Object.defineProperty(e,o,a),a}function V(t,e,o,n){return new(o||(o=Promise))((function(i,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){t.done?i(t.value):new o((function(e){e(t.value)})).then(a,s)}l((n=n.apply(t,e||[])).next())}))}function j(t,e){var o,n,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(i=2&r[0]?n.return:r[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;switch(n=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,n=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],n=0}finally{o=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function q(t){var e="function"==typeof Symbol&&t[Symbol.iterator],o=0;return e?e.call(t):{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}}}function U(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,i,r=o.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}return a}function Y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(U(arguments[e]));return t}var G,H,K,W,z,$,Q,J,X,Z,tt,et,ot=function(){function t(){}return t.prototype.calcChecker1=function(t){for(var e=null,o=0;o<9;++o)e+=t.toString().charAt(o)*(10-o);var n=e%11;return n<2?0:11-n},t.prototype.calcChecker2=function(t){for(var e=null,o=0;o<10;++o)e+=t.toString().charAt(o)*(11-o);var n=e%11;return n<2?0:11-n},t.prototype.checkCPF=function(t){var e=t.replace(/\.|\-|\s/g,""),o=e.substring(0,9),n=e.substring(9,11);if(11!==e.length)return!1;for(var i=0;i<10;i++)if(""+o+n===Array(12).join(i.toString()))return!1;var r=this.calcChecker1(o),a=this.calcChecker2(o+""+r);return n.toString()===r.toString()+a.toString()},t}(),nt=new ot,it=function(){function t(){}return t.prototype.checkCNPJ=function(t){var e=t;if(e){var o=void 0,n=void 0,i=void 0,r=void 0,a=void 0;if(14!==(e=e.replace(/[^\d]+/g,"")).length)return!0;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;o=e.length-2,n=e.substring(0,o),i=e.substring(o),r=0,a=o-7;for(var s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);if((r%11<2?0:11-r%11)!==Number(i.charAt(0)))return!1;o+=1,n=e.substring(0,o),r=0,a=o-7;for(s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);return(r%11<2?0:11-r%11)===Number(i.charAt(1))}return!0},t}(),rt=new it,at=function(){function t(){this.addStringFormat()}return t.prototype.addStringFormat=function(){if(!String.prototype.hasOwnProperty("format")){var t={format:function(){for(var t=this,e=0;e<arguments.length;e++){var o=new RegExp("\\{"+e+"\\}","gi");t=t.replace(o,arguments[e])}return t}};Object.assign(String.prototype,t)}},t}(),st=new at,lt=function(){function t(){}return N([e.Input()],t.prototype,"blocked",void 0),N([e.Input()],t.prototype,"target",void 0),t=N([e.Component({selector:"block-ui",template:'<p-blockUI [blocked]="blocked">\n <p-progressSpinner [strokeWidth]="5"></p-progressSpinner>\n</p-blockUI>\n',styles:[".ui-widget-overlay{background:#ccc!important;opacity:.5!important}@-webkit-keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}@keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}p-progressspinner{position:absolute!important;top:50%!important;left:50%!important}"]})],t)}(),pt=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,n.BlockUIModule,i.ProgressSpinnerModule],declarations:[lt],exports:[lt]})],t)}(),ct=function(){function t(t,e,o){this.activatedRoute=t,this.router=e,this.translate=o,this.items=[]}return t.prototype.ngOnInit=function(){var t=this;this.router.events.pipe(s.filter((function(t){return t instanceof r.NavigationEnd}))).subscribe((function(){var e=t.activatedRoute.root;t.items=t.getBreadcrumbs(e,[])}))},t.prototype.getBreadcrumbs=function(t,e){var o=t.children;if(0===o.length)return e;this.generateBreadcrumb(o,e);var n=e.length&&e.length-1||0;return this.title=e[n]&&e[n].label,e},t.prototype.generateBreadcrumb=function(t,e){var o=this;t.forEach((function(t,n){t.snapshot.data.hasOwnProperty("breadcrumb")&&t.snapshot.data.breadcrumb.map((function(n){var i={label:o.translate.instant(n.name),queryParams:t.snapshot.queryParams,routerLink:o.getFormattedUrl(t,n.routerLink),url:o.getFormattedUrl(t,n.url)};n.routerLink&&(i.disabled=!0,i.routerLinkActiveOptions={exact:!0}),e.push(i)})),t.children&&t.children.length&&o.generateBreadcrumb(t.children,e)}))},t.prototype.getFormattedUrl=function(t,e){return e&&(Object.keys(t.snapshot.params).forEach((function(o){e=e.replace(":"+o,t.snapshot.params[o])})),e.includes(":")&&t.parent)?this.getFormattedUrl(t.parent,e):e},t.ctorParameters=function(){return[{type:r.ActivatedRoute},{type:r.Router},{type:a.TranslateService}]},t=N([e.Component({selector:"c-breadcrumb",template:'<h1 class="sds-page-title">{{title}}</h1>\n<p-breadcrumb [model]="items" ></p-breadcrumb>\n'})],t)}(),ut=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule],exports:[p.CommonModule,a.TranslateModule]})],t)}(),dt=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,l.BreadcrumbModule,ut],declarations:[ct],exports:[ct]})],t)}(),mt=function(){function t(){}return Object.defineProperty(t.prototype,"errorMessage",{get:function(){for(var t in this.control.errors)if(this.control.errors.hasOwnProperty(t)&&(this.control.touched||this.control.dirty))return this.errorList[t];return null},enumerable:!0,configurable:!0}),N([e.Input()],t.prototype,"control",void 0),N([e.Input()],t.prototype,"errorList",void 0),t=N([e.Component({selector:"control-messages-error",template:'<div class="error-message" *ngIf="errorMessage">\n {{ errorMessage | translate }}\n</div>\n',styles:[".error-message{color:#c13018;margin-top:5px;font-size:13px}"]})],t)}(),ht=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,o.ReactiveFormsModule],declarations:[mt],exports:[mt]})],t)}(),yt=function(){function t(){this.optionsBoolean=[{label:"Selecione",value:""},{label:"Sim",value:"true"},{label:"Não",value:"false"}]}return t.prototype.ngOnInit=function(){},N([e.Input()],t.prototype,"params",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"form",void 0),t=N([e.Component({selector:"custom-fields",template:'<div [ngSwitch]="params.type" [formGroup]="form" *ngIf="form" >\n <div *ngSwitchCase="\'date\'" >\n <input-date-calendar [form]="form" [name]="params.field" ></input-date-calendar>\n </div>\n <div *ngSwitchCase="\'boolean\'" >\n <p-dropdown [options]="optionsBoolean" [name]="params.field"\n [(ngModel)]="params.value" [formControlName]="params.field" [required]="required" [readonly]="readonly"\n [style]="{\'width\': \'100%\'}"\n ></p-dropdown>\n </div>\n <div *ngSwitchDefault >\n <input type="text" *ngIf="!params.mask" pInputText [formControlName]="params.field" />\n <p-inputMask *ngIf="params.mask" [(ngModel)]="params.value" [formControlName]="params.field" [mask]="params.mask" [required]="required" [name]="params.field" [readonly]="readonly" ></p-inputMask>\n </div>\n</div>\n',styles:[""]})],t)}(),ft=y,gt=function(){function t(t){this.localeService=t,this.unmask=!0,this.onBlurGetMoment=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.mask=null}return t.prototype.ngOnInit=function(){var t=this;this.localeService.get().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){if(t.mask=t.formatMask(e),t.format=t.setFormat(),t.form.get(t.name).value){var o=t.form.get(t.name).value.toString(),n=ft(o,t.format||"YYYY-MM-DD");t.form.get(t.name).setValue(n.format(t.format||"L")),t._date=n}}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},t.prototype.formatMask=function(t){this.locale=t;var e=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),(e=e.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},t.prototype.setFormat=function(){var t=this.locale.calendar.dateFormat.toString();return t=t.replace(/[y]/g,"YY"),this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),t.toUpperCase()},Object.defineProperty(t.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),t.prototype.onBlur=function(t){if(t&&t.target&&t.target.value){var e=this.form.get(this.name).value;this._date=ft(e,this.format),this.onBlurGetMoment.emit(this._date)}else this._date={},this.form.get(this.name).setValue(null),this.onBlurGetMoment.emit(null)},Object.defineProperty(t.prototype,"model",{get:function(){var t=this.form.get(this.name).value;return ft(t,this.format)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputDateElement",{get:function(){return this._inputDateElement},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:h.LocaleService}]},N([e.ViewChild("inputDateElement",{static:!1})],t.prototype,"_inputDateElement",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"unmask",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Input()],t.prototype,"withoutDay",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Output()],t.prototype,"onBlurGetMoment",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-date-calendar",template:'<div [formGroup]="form" >\n <p-inputMask *ngIf="mask" [formControlName]="name"\n [mask]="mask"\n (onBlur)="onBlur($event)"\n [placeholder]="placeholder"\n [attr.disabled]="disabled"\n [unmask]="unmask"\n [inputId]="inputId"\n [readonly]="readonly"\n #inputDateElement\n ></p-inputMask>\n</div>\n'})],t)}(),bt=function(){function t(){}return t=N([e.NgModule({imports:[u.InputMaskModule,o.FormsModule,o.ReactiveFormsModule,p.CommonModule],declarations:[gt],exports:[gt]})],t)}(),vt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,o.ReactiveFormsModule,m.SharedModule,d.InputTextModule,bt,c.DropdownModule,u.InputMaskModule],declarations:[yt],providers:[],exports:[yt]})],t)}(),It=function(){function t(t){this.elementRef=t,this.el=this.elementRef.nativeElement}return t.prototype.onBlur=function(t){this.cleanVar(t)},t.prototype.cleanVar=function(t){var e=t.trim().replace(/^\s+|\s+$|\s+(?=\s)/g,"");return t!==e&&(this.el.value=e),e},t.ctorParameters=function(){return[{type:e.ElementRef}]},N([e.HostListener("blur",["$event.target.value"])],t.prototype,"onBlur",null),t=N([e.Directive({selector:"[name-not-spaces]"})],t)}(),_t=function(){function t(t){this.el=t}return t.prototype.onKeyDown=function(t){var e=t;-1!==[46,8,9,27,13,110,190].indexOf(e.keyCode)||65===e.keyCode&&(e.ctrlKey||e.metaKey)||67===e.keyCode&&(e.ctrlKey||e.metaKey)||86===e.keyCode&&(e.ctrlKey||e.metaKey)||88===e.keyCode&&(e.ctrlKey||e.metaKey)||e.keyCode>=35&&e.keyCode<=39||(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()},t.ctorParameters=function(){return[{type:e.ElementRef}]},N([e.HostListener("keydown",["$event"])],t.prototype,"onKeyDown",null),t=N([e.Directive({selector:"[only-number]"})],t)}(),St=function(){function t(){}return t=N([e.NgModule({imports:[],declarations:[_t,It],exports:[_t,It],providers:[],schemas:[]})],t)}();(G=t.UsingType||(t.UsingType={})).TYPE_1="TYPE_1",G.TYPE_2="TYPE_2",G.TYPE_3="TYPE_3",G.TYPE_4="TYPE_4",G.TYPE_6="TYPE_6",G.TYPE_7="TYPE_7",G.TYPE_8="TYPE_8",G.TYPE_9="TYPE_9",G.TYPE_10="TYPE_10",G.TYPE_11="TYPE_11",G.TYPE_12="TYPE_12",G.TYPE_14="TYPE_14",G.TYPE_15="TYPE_15",G.TYPE_16="TYPE_16",G.TYPE_17="TYPE_17",G.TYPE_18="TYPE_18",G.TYPE_19="TYPE_19",G.TYPE_20="TYPE_20",G.TYPE_21="TYPE_21",(H=t.CompanyIndicationType||(t.CompanyIndicationType={})).USE_DEPENDENTS="USE_DEPENDENTS",H.VACCINATION_FREQUENCY="VACCINATION_FREQUENCY",H.APPORTIONMENT_CALCULATION="APPORTIONMENT_CALCULATION",H.USE_WORKSTATION_GROUP_EMPLOYEE="USE_WORKSTATION_GROUP_EMPLOYEE",H.STRUCTURE="STRUCTURE",H.PAY_ANNUITY="PAY_ANNUITY",H.USE_HISTORICAL_BANK_ACCOUNT="USE_HISTORICAL_BANK_ACCOUNT",(t.CoreFieldType||(t.CoreFieldType={})).searchValue="searchValue",(K=t.DirectionEnumeration||(t.DirectionEnumeration={})).ASC="ASC",K.DESC="DESC",(W=t.ModuleType||(t.ModuleType={})).MANAGEMENT_PANEL="MANAGEMENT_PANEL",W.PERFORMANCE_MANAGEMENT="PERFORMANCE_MANAGEMENT",W.CAREER_SUCCESSION="CAREER_SUCCESSION",W.RECRUIT_MANAGEMENT="RECRUIT_MANAGEMENT",W.REMUNERATION_MANAGEMENT="REMUNERATION_MANAGEMENT",W.DEVELOPMENT_MANAGEMENT="DEVELOPMENT_MANAGEMENT",W.PAYROLL="PAYROLL",W.APP="APP",W.MOODS="MOODS",(z=t.Operators||(t.Operators={})).EQUAL="eq",z.DIFFERENT="ne",z.LESS_THAN="it",z.GREATER_THAN="gt",z.LESS__EQUAL_THAN="le",z.GREATER_EQUAL_THAN="ge",z.CONTAINING="containing",z.LOWER="lower",z.AND="and",z.OR="or",($=t.CompareType||(t.CompareType={})).isBefore="isBefore",$.isAfter="isAfter",$.isSame="isSame",$.isSameOrAfter="isSameOrAfter",$.isSameOrBefore="isSameOrBefore",$.isNotSame="isNotSame",(Q=t.ServiceType||(t.ServiceType={})).ENTRY="entry",Q.GENERAL_REGISTER="general_register",Q.ORGANIZATION_REGISTER="organization_register",Q.PAYROLL="payroll",Q.DEPENDENT="dependent",(J=t.HttpRequestType||(t.HttpRequestType={})).POST="post",J.GET="get",(X=t.ReportFormat||(t.ReportFormat={})).PDF="Pdf",X.CSV="Csv",X.HTML="Html",X.XLS="Xls",X.XLSX="Xlsx",X.XML="Xml",X.ODT="Odt",X.RTF="Rtf",(Z=t.ParameterType||(t.ParameterType={})).STRING="String",Z.INTEGER="Integer",Z.DOUBLE="Double",Z.BOOLEAN="Boolean",Z.DATE="Date",Z.DATETIME="DateTime",Z.TIME="Time",Z.OBJECT="Object",(tt=t.MenuType||(t.MenuType={})).DEFAULT="DEFAULT",tt.ACTION="ACTION",(et=t.ReportStage||(t.ReportStage={})).STARTING="Starting",et.COMPILING="Compiling",et.FILLING="Filling",et.EXPORTING="Exporting",et.DONE="Done",et.CANCELLED="Cancelled",et.GENERATED="Generated",et.ERROR="Error";var kt=function(){function t(t){this.http=t}return t.prototype.getList=function(t,e){return this.http.post(""+t,e)},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),wt=function(){function o(t){this.dataListService=t,this.rows=10,this.paginator=!0,this.first=1,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.responsive=!0,this.scrollable=!1,this.lazyLoad=new e.EventEmitter,this.loadingChange=new e.EventEmitter,this.listDataChange=new e.EventEmitter,this.selectedDataChange=new e.EventEmitter,this.headerCheckboxToggle=new e.EventEmitter,this.ngUnsubscribe=new f.Subject}return o.prototype.ngOnInit=function(){this.lazy||this.getlistData()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.getActions=function(t,e){return this.actions(t,e)},o.prototype.pagination=function(t){this.lazy||this.getlistData(t.rows,Math.floor(t.first/t.rows))},o.prototype.onLazyLoad=function(e){var o=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){o.orderBy.push({field:e.field,direction:1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows)+1)},o.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(o.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),o.prototype.getlistData=function(t,e){var o=this;void 0===t&&(t=this.rows),void 0===e&&(e=this.first),this.endpoint?this.dataListService.getList(this.endpoint,R({page:{current:e,size:t,orderBy:this.orderBy}},this.initParameters,this._searchParameters)).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(t){return t&&t.result}))).subscribe((function(t){o.listData=t[o.keyPayload],o.totalRecords=t.countResult,o.lazy&&o.lazyLoad.emit(o.listData)})):this.lazy&&this.lazyLoad.emit(this.listData)},o.prototype.onHeaderCheckboxToggle=function(t){this.headerCheckboxToggle.emit(t)},o.prototype.getFieldValue=function(t,e){return e.field&&e.field.includes(".")?(e.field.split(".").map((function(e){return t=t&&t[e]})),t):t[e.field]},Object.defineProperty(o.prototype,"parameters",{set:function(t){t&&(this._searchParameters=R({},t),this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"loading",{get:function(){return this._loading},set:function(t){this._loading=t,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"listData",{get:function(){return this._listData},set:function(t){this._listData=t,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"selectedData",{get:function(){return this._selectedData},set:function(t){this._selectedData=t,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:kt}]},N([e.ViewChild("dataListTable",{static:!1})],o.prototype,"dataListTable",void 0),N([e.Input()],o.prototype,"id",void 0),N([e.Input()],o.prototype,"dataKey",void 0),N([e.Input()],o.prototype,"rows",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"columns",void 0),N([e.Input()],o.prototype,"paginator",void 0),N([e.Input()],o.prototype,"first",void 0),N([e.Input()],o.prototype,"alwaysShowPaginator",void 0),N([e.Input()],o.prototype,"actions",void 0),N([e.Input()],o.prototype,"actionLabel",void 0),N([e.Input()],o.prototype,"selectionMode",void 0),N([e.Input()],o.prototype,"lazy",void 0),N([e.Input()],o.prototype,"isMultipleSelection",void 0),N([e.Input()],o.prototype,"isSortable",void 0),N([e.Input()],o.prototype,"showHeaderCheckBox",void 0),N([e.Input()],o.prototype,"sortMode",void 0),N([e.Input()],o.prototype,"endpoint",void 0),N([e.Input()],o.prototype,"totalRecords",void 0),N([e.Input()],o.prototype,"orderBy",void 0),N([e.Input()],o.prototype,"singularMessageRecords",void 0),N([e.Input()],o.prototype,"pluralMessageRecords",void 0),N([e.Input()],o.prototype,"keyPayload",void 0),N([e.Input()],o.prototype,"initParameters",void 0),N([e.Input()],o.prototype,"responsive",void 0),N([e.Input()],o.prototype,"scrollable",void 0),N([e.Output()],o.prototype,"lazyLoad",void 0),N([e.Output()],o.prototype,"loadingChange",void 0),N([e.Output()],o.prototype,"listDataChange",void 0),N([e.Output()],o.prototype,"selectedDataChange",void 0),N([e.Output()],o.prototype,"headerCheckboxToggle",void 0),N([e.Input()],o.prototype,"parameters",null),N([e.Input()],o.prototype,"loading",null),N([e.Input()],o.prototype,"listData",null),N([e.Input()],o.prototype,"selectedData",null),o=N([e.Component({selector:"c-data-list-rest",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows" [first]="first"\n (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator" (onPage)="pagination($event)"\n [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey" [sortMode]="sortMode" [responsive]="responsive" [scrollable]="scrollable"\n pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)" [selectionMode]="selectionMode">\n \x3c!-- Colgroup --\x3e\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col *ngFor="let col of columns; let i = index"\n [ngClass]="\'col-\'+i+\' col-scroll-resize\'"/>\n <col [ngClass]="\'col-\'+ (columns?.length || 0) +\' col-scroll-resize\'"/>\n </colgroup>\n </ng-template>\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.field" [pSortableColumnDisabled]="!isSortable || !!col.icon"\n [style.width]="col.width" [pTooltip]="col.tooltip || col.label" tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style" aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default" [model]="getActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label" priority="default"\n (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:e.ViewEncapsulation.None,providers:[kt],styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]})],o)}(),Ct=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[wt],exports:[wt]})],t)}(),Dt=function(){function t(t){this.http=t,this.employeeBasicInformations=new f.Subject}return t.prototype.findEmployee=function(t,e){return this.http.post("hcm/payroll/queries/"+t,{employeeId:e})},t.prototype.findEmployeeAutoComplete=function(t,e){return this.http.post("hcm/payroll/queries/"+t,{valueSearch:e})},t.prototype.blobServiceRequestAccess=function(t,e){return this.http.post("hcm/payroll/actions/"+t,e)},t.prototype.setEmployeeBasicInformations=function(t){this.employeeBasicInformations.next(t)},t.prototype.getEmployeeBasicInformations=function(){return this.employeeBasicInformations.asObservable()},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),Tt=y,Et=function(){function t(t,e){this.activatedRoute=t,this.employeeService=e,this.timetrackingLabel="Status",this.hireLabel="Admissão",this.registerNumberLabel="Matrícula",this.ageLabel="Idade",this.loadingLabel="...",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.emploayeeData={name:this.loadingLabel,jobPosition:this.loadingDescription},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){e.employeeId&&t.getInformation(e.employeeId)}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},t.prototype.getInformation=function(t){var e=this;this.isLoading=!0,this.employeeService.findEmployee("employeeContractualInformations",t).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(t){return t&&t.result})),s.finalize((function(){e.isLoading=!1}))).subscribe((function(t){e.employeeService.setEmployeeBasicInformations(t),e.emploayeeData=R({},t,{timeTrackingResumeType:t.timeTrackingResumeType&&t.timeTrackingResumeType.value});var o=[];if(t.city&&o.push(t.city),t.stateAbbreviation&&o.push(t.stateAbbreviation),e.emploayeeData.location=o.join(" - "),t.hireDate&&(e.emploayeeData.hireDate=e.hireDate?e.hireDate:Tt(t.hireDate).format("L")),t.idPicture){var n={fileId:t.idPicture,ttl:2,thumbnail:!1};e.employeeService.blobServiceRequestAccess("blobServiceRequestAccess",n).pipe(s.takeUntil(e.ngUnsubscribe),s.map((function(t){return t&&t.result}))).subscribe((function(t){t&&(e.emploayeeData.photoSource=t.locationURI)}))}}))},t.ctorParameters=function(){return[{type:r.ActivatedRoute},{type:Dt}]},N([e.Input()],t.prototype,"timetrackingLabel",void 0),N([e.Input()],t.prototype,"hireDate",void 0),N([e.Input()],t.prototype,"hireLabel",void 0),N([e.Input()],t.prototype,"registerNumberLabel",void 0),N([e.Input()],t.prototype,"ageLabel",void 0),N([e.Input()],t.prototype,"loadingLabel",void 0),N([e.Input()],t.prototype,"loadingDescription",void 0),t=N([e.Component({selector:"c-employee-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="emploayeeData?.name" [description]="emploayeeData?.jobPosition" [imageSource]="emploayeeData?.photoSource"></s-object-card-main>\n <s-object-card-field [label]="emploayeeData?.employer" [description]="emploayeeData?.location"></s-object-card-field>\n <s-object-card-field [label]="timetrackingLabel" [description]="emploayeeData?.timeTrackingResumeType"></s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="emploayeeData?.hireDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="registerNumberLabel" [description]="emploayeeData?.registernumber" iconClass="fa fa-id-card"></s-object-card-field>\n <s-object-card-field [label]="ageLabel" [description]="emploayeeData?.age" iconClass="fa fa-birthday-cake"></s-object-card-field>\n</s-object-card>\n'})],t)}(),Ft=function(){function t(){}return t=N([e.NgModule({imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[Et],exports:[Et],providers:[Dt]})],t)}(),At=function(){function t(t){this.http=t,this.admissionDraftBasicInformations=new f.Subject}return t.prototype.findAdmissionDraft=function(t){return this.http.post("hcm/payroll/queries/admissionDraftQuery",{id:t})},t.prototype.blobServiceRequestAccess=function(t,e){return this.http.post("hcm/payroll/actions/"+t,e)},t.prototype.setAdmissionDraftBasicInformations=function(t){this.admissionDraftBasicInformations.next(t)},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),Pt=function(){function t(t,e,o){this.activatedRoute=t,this.admissionDraftSummaryService=e,this.translateService=o,this.hireLabel="Admissão",this.hireDate="...",this.badgeText="Rascunho",this.loadingLabel="...",this.documentNumberLabel="Documento",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.draftData={name:this.loadingLabel,hiringDate:this.hireDate,documentNumber:this.loadingLabel,companyName:this.loadingLabel,localeOfCompany:this.loadingLabel,originDraftType:this.loadingLabel},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){e.draftId&&t.getInformation(e.draftId)}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},t.prototype.getInformation=function(t){var e=this;this.isLoading=!0,this.admissionDraftSummaryService.findAdmissionDraft(t).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(t){return t&&t.result})),s.finalize((function(){e.isLoading=!1}))).subscribe((function(t){if(e.admissionDraftSummaryService.setAdmissionDraftBasicInformations(t),t.hiringDate=e.hireDate,e.draftData=R({},t),e.draftData.originDraftType=e.originType,t.attachment&&t.attachment.fileId){var o={fileId:e.draftData.attachment.fileId,ttl:2,thumbnail:!1};e.admissionDraftSummaryService.blobServiceRequestAccess("blobServiceRequestAccess",o).pipe(s.takeUntil(e.ngUnsubscribe),s.map((function(t){return t&&t.result}))).subscribe((function(t){t&&(e.draftData.photoSource=t.locationURI)}))}}))},t.ctorParameters=function(){return[{type:r.ActivatedRoute},{type:At},{type:a.TranslateService}]},N([e.Input()],t.prototype,"originType",void 0),N([e.Input()],t.prototype,"hireLabel",void 0),N([e.Input()],t.prototype,"hireDate",void 0),N([e.Input()],t.prototype,"badgeText",void 0),N([e.Input()],t.prototype,"loadingLabel",void 0),N([e.Input()],t.prototype,"documentNumberLabel",void 0),N([e.Input()],t.prototype,"loadingDescription",void 0),t=N([e.Component({selector:"c-admission-draft-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="draftData?.name"\n [imageSource]="draftData?.photoSource">\n </s-object-card-main>\n <s-object-card-field [label]="draftData.companyName" [description]="draftData.localeOfCompany"></s-object-card-field>\n <s-object-card-field [label]="draftData.originDraftType">\n <span descriptionTemplate class="sds-badge sds-semantic-orange">{{badgeText}}</span>\n </s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="draftData?.hiringDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="documentNumberLabel" [description]="draftData?.documentNumber" iconClass="fa fa-id-card"></s-object-card-field>\n</s-object-card>\n'})],t)}(),xt=function(){function t(){}return t=N([e.NgModule({imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[Pt],exports:[Pt],providers:[At]})],t)}(),Mt=function(){function t(){}return t.prototype.ngOnInit=function(){},t=N([e.Component({selector:"error-page",template:'<div class="ui-g">\n <div class="ui-sm-6 error-code">\n <span>403</span>\n </div>\n <div class="col-sm-6">\n <h4 class="error-title">​{{\'hcm.payroll.permission_error_page\'|translate}}</h4>\n <h5 class="error-description">{{\'hcm.payroll.permission_error_page_description\'|translate}}</h5>\n </div>\n</div>\n',styles:["@media (max-width:767px){.error-code{text-align:center}.error-code>span{color:#697882;font-size:80px;font-weight:300}}@media (min-width:768px){.error-code>span{color:#697882;font-size:128px;font-weight:300;float:right}}.error-title{padding-top:30px}.error-description{color:#999;margin-top:10px}"]})],t)}(),Lt=function(){function t(){}return t=N([e.NgModule({imports:[ut],declarations:[Mt],exports:[Mt],providers:[]})],t)}(),Ot=function(){function t(){this.errorMessage=""}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){var e=this,o=t.inputErrors.currentValue;this.errorMessage="",o&&Object.keys(this.errorDefs).some((function(t){if(o[t])return e.errorMessage=e.errorDefs[t],!0}))},N([e.Input()],t.prototype,"inputErrors",void 0),N([e.Input()],t.prototype,"errorDefs",void 0),N([e.Input()],t.prototype,"field",void 0),N([e.Input()],t.prototype,"onlyShowAfterTouched",void 0),t=N([e.Component({selector:"field-validator",template:'<ng-content></ng-content>\n<div style="color:#a94442;font-size: 13px"\n *ngIf="(onlyShowAfterTouched&&!field.valid&&(field.dirty || field.touched)&&errorMessage) || (!onlyShowAfterTouched&&errorMessage)">\n {{errorMessage | translate}}\n</div>\n'})],t)}(),Bt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,o.ReactiveFormsModule],declarations:[Ot],exports:[Ot],providers:[]})],t)}(),Rt=function(){function t(){this.messagesSubjectError=new f.Subject,this.messagesSubjectSuccess=new f.Subject,this.messagesSubjectWarning=new f.Subject}return t.prototype.showError=function(t,e){void 0===e&&(e=!1),this.messagesSubjectError.next({message:t,breakLine:e})},t.prototype.showSuccess=function(t,e){void 0===e&&(e=!1),this.messagesSubjectSuccess.next({message:t,breakLine:e})},t.prototype.showWarning=function(t,e){void 0===e&&(e=!1),this.messagesSubjectWarning.next({message:t,breakLine:e})},t.prototype.loadErrorMessages=function(){return this.messagesSubjectError.asObservable()},t.prototype.loadSuccessMessages=function(){return this.messagesSubjectSuccess.asObservable()},t.prototype.loadWarningMessages=function(){return this.messagesSubjectWarning.asObservable()},t}(),Nt=function(){function o(t,e,o){this.http=t,this.messageService=e,this.translateService=o}return o.prototype.query=function(e,o,n){var i=this;void 0===n&&(n=t.ServiceType.PAYROLL);var r="hcm/"+n+"/queries/"+e;return this.http.post(r,o).pipe(s.catchError((function(t){return t&&403===t.status&&i.messageService.add({severity:"error",summary:i.translateService.instant("hcm.payroll.error"),detail:i.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.enumQuery=function(t,e,o){var n=this;void 0===o&&(o="payroll");var i="hcm/"+o+"/queries/"+t;return this.http.post(i,e).pipe(s.catchError((function(t){return t&&403===t.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.action=function(t,e){var o=this,n="hcm/payroll/actions/"+t;return this.http.post(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.recruitmentAction=function(t,e){var o=this,n="hcm/recruitment/actions/"+t;return this.http.post(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.get=function(t){var e=this,o="hcm/payroll/entities/"+t;return this.http.get(o).pipe(s.catchError((function(t){return 403===t.status&&e.messageService.add({severity:"error",summary:e.translateService.instant("hcm.payroll.error"),detail:e.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.getAutoComplete=function(e,o,n){var i=this;void 0===n&&(n=t.ServiceType.PAYROLL);var r="hcm/"+n+"/entities/"+e+"?filter="+o+"&size=10&orderby=code+asc";return this.http.get(r).pipe(s.catchError((function(t){return t&&403===t.status&&i.messageService.add({severity:"error",summary:i.translateService.instant("hcm.payroll.error"),detail:i.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.patch=function(t,e){var o=this,n="hcm/payroll/entities/"+t;return this.http.patch(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.post=function(t,e){var o=this,n="hcm/payroll/"+t;return this.http.post(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.put=function(t,e){var o=this,n="hcm/payroll/entities/"+t;return this.http.put(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.delete=function(t,e){var o=this,n=e?"hcm/payroll/entities/"+t+"/"+e:"hcm/payroll/entities/"+t;return this.http.delete(n).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},o=N([e.Injectable()],o)}(),Vt=function(){function t(t){this.http=t}return t.prototype.blobServiceRequestUpload=function(t){var e={fileName:t.name,thumbnail:this.isImage(t)};return this.http.action("blobServiceRequestUpload",e)},t.prototype.blobServiceRequestAccess=function(t){var e={fileId:t,tll:2,thumbnail:!1};return this.http.action("blobServiceRequestAccess",e)},t.prototype.blobServiceFileDelete=function(t){var e={fileId:t,thumbnail:!1};return this.http.action("blobServiceDelete",e)},t.prototype.isImage=function(t){return/^image\//.test(t.type)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),jt=function(){function t(t,o,n){this.service=t,this.toastService=o,this.translate=n,this.files=[],this.onUploadFile=new e.EventEmitter,this.onRemoveFile=new e.EventEmitter}return t.prototype.uploadHandler=function(t){var e=this,o=[];if(t&&t.files.length){t.files.sort(),t.files.length>10&&t.files[10]&&delete t.files[10];for(var n=this.getFilesCountAndValidate(t.files),i=0;i<n;i++){var r=this.validateFileSize(t.files[i]);i<=9&&r.isUploaded&&!r.complete&&o.push(this.saveFile(r))}f.forkJoin.apply(void 0,Y(o)).subscribe((function(){e.onUploadFile.emit(e.files)}))}},t.prototype.validateFileSize=function(t){return t.isUploaded&&!t.complete&&t.size>5e7&&(t.complete=!0,t.error=this.translate.instant("hcm.payroll.attachments_max_mb"),this.toastService.showError(this.translate.instant("hcm.payroll.attachments_alert_error"))),t},t.prototype.getFilesCountAndValidate=function(t){var e=0;return t.length&&(t.length>10?(e=10,this.toastService.showError(this.translate.instant("hcm.payroll.attachments_max_length"))):e=t.length),e},t.prototype.saveFile=function(t){var e=this;return new f.Observable((function(o){return e.service.blobServiceRequestUpload(t).pipe(s.map((function(t){return t&&t.result}))).subscribe((function(n){return e.doUpload(n,t,o)}),(function(e){t.complete=!0,t.error=e.message,t.objectURL=void 0}))}))},t.prototype.doUpload=function(t,e,o){var n=new XMLHttpRequest;return e.id=t.fileId,e.objectURL=t.locationURI,e.version=t.version,e.progress=0,n.upload.addEventListener("progress",(function(t){e.progress=Math.round(100*t.loaded/t.total)}),!1),n.onreadystatechange=function(){4===n.readyState&&(e.complete=!0,n.status<200||n.status>=300?(e.objectURL=void 0,e.error=n.statusText||"Erro ao anexar arquivo"):e.error=!1,o.next(e),o.complete())},n.open("PUT",e.objectURL,!0),n.setRequestHeader("Translate","f"),n.send(e)},t.prototype.onCancelUpload=function(t){this.files.splice(t,1)},t.prototype.removeFile=function(){this.onRemoveFile.emit(this.files)},t.ctorParameters=function(){return[{type:Vt},{type:Rt},{type:a.TranslateService}]},N([e.Input()],t.prototype,"errorTooltip",void 0),N([e.Input()],t.prototype,"files",void 0),N([e.Output()],t.prototype,"onUploadFile",void 0),N([e.Output()],t.prototype,"onRemoveFile",void 0),t=N([e.Component({selector:"c-file-upload",template:'<s-file-upload-deprecated chooseLabel="{{\'hcm.payroll.file_upload_choose_label\'|translate}}"\n cancelLabel="{{\'hcm.payroll.file_upload_cancel_label\'|translate}}"\n removeLabel="{{\'hcm.payroll.file_upload_remove_label\'|translate}}"\n successTooltip="{{\'hcm.payroll.file_upload_success_tooltip\'|translate}}"\n [errorTooltip]="errorTooltip"\n [customUpload]="true" [accept]="\'*/*\'" [multiple]="true"\n (uploadHandler)="uploadHandler($event)" (onCancelUpload)="onCancelUpload($event)"\n (onRemoveFile)="removeFile()" [files]="files"\n></s-file-upload-deprecated>\n'})],t)}(),qt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,_.FileUploadModuleDeprecated,ut],declarations:[jt],providers:[Vt],exports:[jt]})],t)}(),Ut=function(){function t(t){this.http=t}return t.prototype.saveImage=function(t,e,o){return V(this,void 0,void 0,(function(){var n,i,r;return j(this,(function(a){switch(a.label){case 0:return t?(n=null,t?n={fileName:t.name}:e&&(n={fileName:e.split("/")[1]}),n?[4,this.blobServiceRequestUpload(o,n).toPromise()]:[3,2]):[2];case 1:return i=a.sent(),(r=new XMLHttpRequest).open("PUT",i.result.locationURI,!0),r.setRequestHeader("Translate","f"),r.send(t),[2,i.result];case 2:return[2]}}))}))},t.prototype.urltoFile=function(t,e,o){return void 0===o&&(o=null),o=o||(t.match(/^data:([^;]+);/)||"")[1],this.http.request("GET",t,{responseType:"arraybuffer"}).pipe(s.map((function(t){var n=new Blob([t],{type:o});return n.name=e,n})))},t.prototype.getImage=function(t,e,o){return V(this,void 0,void 0,(function(){return j(this,(function(n){switch(n.label){case 0:return t&&t.fileId?[4,this.blobServiceRequestAccess(e,t.fileId,o).toPromise()]:[3,2];case 1:return[2,n.sent().result.locationURI];case 2:return[2]}}))}))},t.prototype.buildUrl=function(t,e){return"hcm/"+t+"/"+e},t.prototype.query=function(t,e,o){var n="queries/"+e;return this.http.post(this.buildUrl(t,n),o)},t.prototype.blobServiceRequestUpload=function(t,e){var o={fileName:e.fileName,thumbnail:!0};return this.http.post(this.buildUrl(t,"actions/blobServiceRequestUpload"),o)},t.prototype.blobServiceRequestAccess=function(t,e,o){var n={fileId:e,tll:2,thumbnail:o};return this.http.post(this.buildUrl(t,"actions/blobServiceRequestAccess"),n)},t.prototype.blobServiceFileDelete=function(t,e){var o={fileId:e,thumbnail:!0};return this.http.post(this.buildUrl(t,"actions/blobServiceDelete"),o)},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),Yt=function(){function t(t,o){this.imageCropService=t,this.toastService=o,this.service="payroll",this.onClickSave=new e.EventEmitter,this.defaulPerson="assets/default-person.png",this.display=!1,this.imageCrop=[],this.data={},this.cropperSettings=new S.CropperSettings,this.cropperSettings.width=100,this.cropperSettings.height=100,this.cropperSettings.keepAspect=!1,this.cropperSettings.preserveSize=!0,this.cropperSettings.canvasWidth=600,this.cropperSettings.canvasHeight=450,this.cropperSettings.rounded=!0,this.cropperSettings.minWithRelativeToResolution=!1,this.cropperSettings.noFileInput=!0,this.cropperSettings.cropperDrawSettings.strokeColor="rgba(255,255,255,1)",this.cropperSettings.cropperDrawSettings.strokeWidth=1}return Object.defineProperty(t.prototype,"image",{set:function(t){var e=this;t&&t.fileId&&!this.personPhotoLink&&this.imageCropService.blobServiceRequestAccess(this.service,t.fileId,!0).subscribe((function(t){e.personPhotoLink=t.result.locationURI}))},enumerable:!0,configurable:!0}),t.prototype.onUploadHandler=function(t){var e=this;if(this.file=t.files[0],this.file&&this.file.size>5e6)return this.file=null,this.imageCrop=[],void this.toastService.showError("O tamanho máximo permitido para a imagem é de 5MB");this.display=!1;var o=new Image,n=new FileReader;n.onloadend=function(t){o.src=t.target.result,e.cropper.setImage(o)},n.readAsDataURL(this.file),this.display=!0},t.prototype.ngOnInit=function(){this.data.image=null,this.personPhotoLink=null,this.personFirstName="",this.display=!1},t.prototype.showDialog=function(){this.display=!0},t.prototype.onHide=function(){this.display=!1},t.prototype.reset=function(){this.file=null,this.data={},this.imageCrop=[],this.cropper.reset(),this.data.image=null,this.personPhotoLink=null,this.personFirstName=""},t.prototype.saveImage=function(){return V(this,void 0,void 0,(function(){var t,e,o,n=this;return j(this,(function(i){switch(i.label){case 0:return this.file?(t=this.file.name,this.cropper&&this.cropper.image?[4,this.urltoFile(this.cropper.image.image,t)]:[3,2]):(this.onClickSave.emit(null),this.onHide(),[2]);case 1:e=i.sent(),this.personPhotoLink=this.data.image,o=null,this.file?o={fileName:this.file.name}:this.data&&(o={fileName:this.data.fileId.split("/")[1]}),o&&(this,this.imageCropService.blobServiceRequestUpload(this.service,o).subscribe((function(t){var o=new XMLHttpRequest;o.open("PUT",t.result.locationURI,!0),o.setRequestHeader("Translate","f"),o.send(e),n.onClickSave.emit(t.result),n.onHide()}))),i.label=2;case 2:return[2]}}))}))},t.prototype.urltoFile=function(t,e,o){return void 0===o&&(o=null),o=o||(t.match(/^data:([^;]+);/)||"")[1],fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return new File([t],e,{type:o})}))},t.prototype.deleteImage=function(){this.imageCropService.blobServiceFileDelete(this.service,this.data&&this.data.image&&this.data.image.fileId),this.reset()},t.ctorParameters=function(){return[{type:Ut},{type:Rt}]},N([e.Input()],t.prototype,"service",void 0),N([e.Output()],t.prototype,"onClickSave",void 0),N([e.ViewChild("cropper",{static:!1})],t.prototype,"cropper",void 0),N([e.Input()],t.prototype,"image",null),t=N([e.Component({selector:"image-crop",template:'<a (click)="showDialog()">\n <span class="result rounded">\n <img class="center-block" style="max-width: 100%; height: auto"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson" [alt]="personFirstName"\n width="auto" height="140">\n </span>\n</a>\n\n<p-dialog [(visible)]="display" modal="true" [minWidth]="450" (onHide)="onHide()">\n <p-header>\n {{\'hcm.payroll.employees_image_cropper_edit\' | translate}}\n </p-header>\n\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-12 img-user-modal" *ngIf="!personPhotoLink">\n <i class="fa fa-user-circle fa-5x"></i>\n <div id="txt-select-image">{{\'hcm.payroll.employees_image_cropper_viewing\' | translate}}</div>\n <div class="ui-md-4 btn-center">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n </div>\n </div>\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\' | translate}}"></button>\n </div>\n <div class="ui-g-12 ui-md-12" *ngIf="personPhotoLink">\n <span class="result rounded">\n <img class="center-block default-image"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson"\n [alt]="personFirstName"\n width="auto"\n height="140">\n </span>\n </div>\n </div>\n <div class="ui-g" [style.display]="data.image ? \'block\' : \'none\'">\n <div class="ui-md-4 btn-left">\n <p-fileUpload chooseLabel="Selecionar foto"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\'|translate}}"></button>\n </div>\n <div class="ui-md-12">\n <img-cropper #cropper [image]="data" [settings]="cropperSettings"></img-cropper>\n </div>\n </div>\n\n <p-footer>\n <button pButton type="button" class="btn-link ui-button-link" (click)="display=false"\n label="{{\'hcm.payroll.employees_image_cropper_cancel\' | translate}}"></button>\n <button pButton type="button" (click)="saveImage()" label="{{\'hcm.payroll.employees_image_cropper_save\'|translate}}"></button>\n </p-footer>\n</p-dialog>\n',styles:[".center{float:left;position:relative;left:30%}.btn-center{float:left;position:relative;left:33%}.btn-left{float:left;position:relative}.rounded{cursor:pointer}.result.rounded>img{border-radius:50%}div.cropper{height:400px}.center-block{display:block;margin-right:auto;margin-left:auto}.ui-fileupload-choose{width:300px!important}.fa-user-circle{color:#ccc}.img-user-modal{text-align:center!important}#txt-select-image{margin:20px 0;font-weight:700;font-size:16px}"]})],t)}(),Gt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,w.DialogModule,k.ButtonModule,C.FileUploadModule,S.ImageCropperModule,S.ImageCropperModule,h.ThumbnailModule],declarations:[Yt],providers:[Ut,h.ImageCropperService],exports:[Yt]})],t)}(),Ht=y,Kt=function(){function t(t){this.localeService=t,this.onBlurGetMoment=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.mask=null}return t.prototype.ngOnInit=function(){var t=this;this.localeService.get().subscribe((function(e){if(t.mask=t.formatMask(e),t.format=t.getFormat(),t.model){var o=t.model,n=Ht(o,t.format||"YYYY-MM-DD");n.isValid()?(t.model=n.format(t.format||"L"),t._date=n):t._date=null}}))},t.prototype.formatMask=function(t){this.locale=t;var e=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),(e=e.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},t.prototype.getFormat=function(){var t=this.locale.calendar.dateFormat.toString();return t=t.replace(/[y]/g,"YY"),this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),t.toUpperCase()},Object.defineProperty(t.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),t.prototype.onBlur=function(){var t=this.model;this._date=Ht(t,this.format),this.onBlurGetMoment.emit(this._date)},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:h.LocaleService}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"withoutDay",void 0),N([e.Input()],t.prototype,"unmask",void 0),N([e.Input()],t.prototype,"style",void 0),N([e.Input()],t.prototype,"styleClass",void 0),N([e.Output()],t.prototype,"onBlurGetMoment",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-date-calendar-model",template:'<p-inputMask *ngIf="mask"\n [mask]="mask"\n (onBlur)="onBlur()"\n [unmask]="unmask"\n [placeholder]="placeholder"\n [disabled]="disabled"\n [(ngModel)]="model"\n [style]="style"\n [styleClass]="styleClass"\n></p-inputMask>\n'})],t)}(),Wt=function(){function t(){}return t=N([e.NgModule({imports:[u.InputMaskModule,o.FormsModule,o.ReactiveFormsModule,p.CommonModule],declarations:[Kt],exports:[Kt]})],t)}(),zt=y;function $t(t){return t&&"object"==typeof t&&!Array.isArray(t)}function Qt(t){return!Array.isArray(t)||!t.find((function(t){return"object"==typeof t}))}function Jt(t){return 0===t||"boolean"==typeof t||null!=t&&""!==t}function Xt(t,e){return void 0===e&&(e=!0),!t||!Zt(t,e)||(e?zt(t.replace(/[^\d]+/g,""),"DDMMYYYY").isValid():zt(t.replace(/[^\d]+/g,""),"MMYYYY").isValid())}function Zt(t,e){if(void 0===e&&(e=!0),t){var o=void 0;return o=e?8:6,t.replace(/[^\d]+/g,"").length===o}return!0}function te(t,e){return-1!==t.search("Date")?ee(e):e}function ee(t,e,o){if(void 0===e&&(e="DDMMYYYY"),void 0===o&&(o="YYYY-MM-DD"),Jt(t)){var n=oe(t,e);return zt(t.replace(/[^\d]+/g,""),n).format(o)}}function oe(t,e){return-1!==t.search("/")?"DDMMYYYY":-1!==t.search("-")?"YYYYMMDD":e}function ne(t){return void 0===t&&(t="YYYY-MM-DD"),zt().format(t)}function ie(t,e){void 0===e&&(e="DDMMYYYY");var o=oe(t,e);return zt(t.replace(/[^\d]+/g,""),o)}function re(t,e){return e?zt(t,e):zt(t)}function ae(t){var e=[];return Object.entries(t).forEach((function(t){var o=U(t,2),n=o[0],i=o[1];e.push({field:n,value:i})})),e}function se(t){var e={};return t&&t.length&&t.forEach((function(t){"date"===t.type&&t.value&&(t.value=re(t.value).format("L")),e[t.field]=t.value})),e}function le(){var t=this;Object.keys(this.controls).map((function(e){var n=t.get(e);n.markAsDirty(),(n instanceof o.FormGroup||n instanceof o.FormArray)&&le.call(n)}))}function pe(t,e,n,i){n?(t.controls[e].setValidators(o.Validators.compose(i&&i.length?i:[o.Validators.required])),t.controls[e].updateValueAndValidity()):(t.controls[e].setValidators(null),t.controls[e].updateValueAndValidity())}function ce(t,e,o,n){e?o.forEach((function(e){return t.get(e).enable()})):(o.forEach((function(e){return t.get(e).disable()})),he(t,n||o))}function ue(t,e,n){n&&n.length?(t.controls[e].setValidators(o.Validators.compose(n)),t.controls[e].updateValueAndValidity()):(t.controls[e].setValidators(null),t.controls[e].updateValueAndValidity())}function de(t,e,o,n){void 0===n&&(n=!0),e?(t.get(o).disable(),n&&t.get(o).reset()):t.get(o).enable()}function me(t,e){return void 0===e&&(e="ASC"),function(o,n){if(!o.hasOwnProperty(t)||!n.hasOwnProperty(t))return 0;var i="string"==typeof o[t]?o[t].toUpperCase():o[t],r="string"==typeof n[t]?n[t].toUpperCase():n[t],a=0;return i>r?a=1:i<r&&(a=-1),"DESC"===e?-1*a:a}}function he(t,e){e.forEach((function(e){return t.get(e).reset()}))}function ye(t){if(t){var e=t.calendar.dateFormat.toString();return(e=(e=e.replace(/[y]/g,"YY")).replace(/[/]/g,"")).toUpperCase()}}function fe(t){return t?t.toString().replace(/[&\/\\#,+()$~%.'":*?<>{}-]/g,""):null}var ge=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),be=function(){function o(o){this.service=o,this.forceSelection=!0,this.keyName="name",this.keyToExclude=[],this.usingType=[],this.minCharactersToSearch=3,this.multiple=!1,this.serviceType=t.ServiceType.PAYROLL,this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.suggestions=[]}return o.prototype.ngOnInit=function(){},o.prototype.filterQuery=function(e){var o=this,n=e.query;if(!(isNaN(n)&&n.toString().length<this.minCharactersToSearch))try{if(this.isTimetrackingSituation)return this.service.query("autocompleteTimetrackingSituation",{valueSearch:n,referenceDate:this.referenceDate}).subscribe((function(t){return o.formaterResponce(t.result)}));if(this.isDismissalReason){var i={valueSearch:n};return this.referenceDate&&(i.referenceDate=this.referenceDate),this.service.query("autocompleteDismissalReason",i,t.ServiceType.GENERAL_REGISTER).subscribe((function(t){return o.formaterResponce(t.result)}))}if(this.usingType&&this.usingType.length)return this.service.query("autocompleteOtherCompanyFilterUsingType",{searchText:n,usingType:this.usingType}).subscribe((function(t){return o.formaterResponce(t.result)}));if(this.isDepartmentFromCompany)return this.service.query("autocompleteDepartmentQuery",{searchText:n,companyId:this.companyId,referenceDate:this.referenceDate}).subscribe((function(t){return o.formaterResponce(t.result)}));if(this.isWagetype){i={searchText:n,companyId:this.companyId};return this.service.query("autocompleteWagetypeQuery",i,t.ServiceType.ENTRY).subscribe((function(t){return o.formaterResponce(t.result)}))}this.service.query("autocomplete",this.getParamsRest(n),this.serviceType).subscribe((function(t){return o.formaterResponce(t.result)}))}catch(t){console.log(t)}},o.prototype.formaterResponce=function(t){var e=this;this.suggestions=[];var o=[];return t.map((function(t){var n={tableId:t.tableId,name:""};if(e.isTimetrackingSituation||e.isDismissalReason||e.usingType&&e.usingType.length){if(e.keyToExclude.includes(t.fields&&t.fields[2]&&t.fields[2].value))return;var i="";t.fields.map((function(t){n[t.name]=t.value})),i+=t.fields.filter((function(t){return"code"===t.name.toLowerCase()})).map((function(t){return t?t.value+=" - ":""}))[0],!e.usingType||!e.usingType.length||i&&"undefined"!==i||(i=""),i+=t.fields.filter((function(t){return"name"===t.name.toLowerCase()})).map((function(t){return t?t.value:""}))[0],n.name=i,o.push(n)}else{t.fields.map((function(t){n[t.name]=t.value}));var r="";e.concatFieldsForName?(e.concatFieldsForName.map((function(t){(t.includes("date")||t.includes("Birthday"))&&(n[t]=re(n[t]).format("DD/MM/YYYY")),r+=n[t]+" - "})),r=r.slice(0,-3)):(e.keyCode&&(r+=n[e.keyCode]+" - "),e.keyName&&(r+=n[e.keyName])),n.name=r,o.push(n)}})),this.suggestions=Y(o),o},o.prototype.getParamsRest=function(t){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(t),enableEntityFilters:this.enableEntityFilters}},o.prototype.getConditionsRest=function(t){var e=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+t}];return this.conditions&&this.conditions.map((function(t){(["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(t.expression)||Jt(t.value))&&e.push(t)})),e},o.prototype.selectOption=function(t){this.onSelect.emit(t)},o.prototype.onClearItem=function(t){return V(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.onClear.emit(t)];case 1:return e.sent(),this.form.get(this.name).reset(),[2]}}))}))},o.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},o.prototype.onDropdownClick=function(){this.isDropdown=!0},Object.defineProperty(o.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObject},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:ge}]},N([e.ViewChild("autoCompleteObject",{static:!0})],o.prototype,"_autoCompleteObject",void 0),N([e.Input()],o.prototype,"name",void 0),N([e.Input()],o.prototype,"table",void 0),N([e.Input()],o.prototype,"order",void 0),N([e.Input()],o.prototype,"enableEntityFilters",void 0),N([e.Input()],o.prototype,"fields",void 0),N([e.Input()],o.prototype,"conditionsFields",void 0),N([e.Input()],o.prototype,"conditions",void 0),N([e.Input()],o.prototype,"placeholder",void 0),N([e.Input()],o.prototype,"readonly",void 0),N([e.Input()],o.prototype,"required",void 0),N([e.Input()],o.prototype,"disabled",void 0),N([e.Input()],o.prototype,"dropdown",void 0),N([e.Input()],o.prototype,"forceSelection",void 0),N([e.Input()],o.prototype,"error",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"keyCode",void 0),N([e.Input()],o.prototype,"keyName",void 0),N([e.Input()],o.prototype,"concatFieldsForName",void 0),N([e.Input()],o.prototype,"itemSelect",void 0),N([e.Input()],o.prototype,"form",void 0),N([e.Input()],o.prototype,"inputId",void 0),N([e.Input()],o.prototype,"isTimetrackingSituation",void 0),N([e.Input()],o.prototype,"isDepartmentFromCompany",void 0),N([e.Input()],o.prototype,"companyId",void 0),N([e.Input()],o.prototype,"referenceDate",void 0),N([e.Input()],o.prototype,"isDismissalReason",void 0),N([e.Input()],o.prototype,"keyToExclude",void 0),N([e.Input()],o.prototype,"usingType",void 0),N([e.Input()],o.prototype,"minCharactersToSearch",void 0),N([e.Input()],o.prototype,"isWagetype",void 0),N([e.Input()],o.prototype,"multiple",void 0),N([e.Input()],o.prototype,"serviceType",void 0),N([e.Output()],o.prototype,"onBlur",void 0),N([e.Output()],o.prototype,"onSelect",void 0),N([e.Output()],o.prototype,"onClear",void 0),o=N([e.Component({selector:"input-rest-auto-complete",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],o)}(),ve=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[be],providers:[ge],exports:[be]})],t)}(),Ie=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),_e=function(){function t(t){this.service=t,this.forceSelection=!0,this.keyName="name",this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(!(isNaN(o)&&o.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(o)).subscribe((function(t){return e.formaterResponce(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.formaterResponce=function(t){this.suggestions=[];var e=[];return t.map((function(t){var o={tableId:t.tableId,code:"",name:"",fullname:"",admission:"",document:""};t.fields&&t.fields.length&&(o.fullname=t.fields[0].value,o.admission=t.fields[1].value,o.document=t.fields[2].value,o.code=4===t.fields.length&&t.fields[3].value,o.code?o.name=o.code.concat(" - ").concat(o.fullname).concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")):o.name=o.fullname.concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")),e.push(o))})),this.suggestions=e,e},t.prototype.getParamsRest=function(t){var e={valueSearch:t,enableEntityFilters:this.enableEntityFilters};return this.company&&(e.company=this.company),this.branch&&(e.companyBranch=this.branch),this.employeeType&&(e.employeeType=this.employeeType),this.otherContractType&&(e.otherContractType=this.otherContractType),!1===this.filterEmployeeType&&(e.filterEmployeeType=this.filterEmployeeType),e},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},t.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},t.prototype.onDropdownClick=function(){this.isDropdown=!0},t.ctorParameters=function(){return[{type:Ie}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"value",void 0),N([e.Input()],t.prototype,"company",void 0),N([e.Input()],t.prototype,"branch",void 0),N([e.Input()],t.prototype,"employeeType",void 0),N([e.Input()],t.prototype,"otherContractType",void 0),N([e.Input()],t.prototype,"filterEmployeeType",void 0),N([e.Input()],t.prototype,"enableEntityFilters",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"keyCode",void 0),N([e.Input()],t.prototype,"keyName",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),t=N([e.Component({selector:"input-rest-auto-complete-employee",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],t)}(),Se=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[_e],providers:[Ie],exports:[_e]})],t)}(),ke=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),we=function(){function t(t,o){this.service=t,this.activatedRoute=o,this.forceSelection=!0,this.keyName="name",this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.suggestions=[],this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.useWorkflow=!(!e||!e.useWorkflow)}))},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(!(isNaN(o)&&o.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(o)).subscribe((function(t){return e.formaterResponce(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.formaterResponce=function(t){this.suggestions=[];var e=[];return t.map((function(t){var o={tableId:t.tableId,code:"",name:"",fullname:"",admission:"",document:""};t.fields&&t.fields.length&&(o.fullname=t.fields[0].value,o.admission=t.fields[1].value,o.document=t.fields[2].value,o.code=4===t.fields.length&&t.fields[3].value,o.code?o.name=o.code.concat(" - ").concat(o.fullname).concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")):o.name=o.fullname.concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")),e.push(o))})),this.suggestions=e,e},t.prototype.getParamsRest=function(t){var e={valueSearch:t};return this.company&&(e.company=this.company),this.branch&&(e.companyBranch=this.branch),this.employeeType&&(e.employeeType=this.employeeType),this.useWorkflow&&(e.timeTrackingResumeType={key:"FIRED"}),e},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},t.prototype.onBlurItem=function(t){this.onBlur.emit(t)},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:ke},{type:r.ActivatedRoute}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"value",void 0),N([e.Input()],t.prototype,"company",void 0),N([e.Input()],t.prototype,"branch",void 0),N([e.Input()],t.prototype,"employeeType",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"keyCode",void 0),N([e.Input()],t.prototype,"keyName",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"style",void 0),N([e.Input()],t.prototype,"inputStyle",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-rest-auto-complete-employee-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n</p-autoComplete>\n',styles:[""]})],t)}(),Ce=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,ut,v.HttpClientModule,E.AutoCompleteModule,o.ReactiveFormsModule],declarations:[we],providers:[ke],exports:[we]})],t)}(),De=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o={names:[e]};return this.http.enumQuery("enumQuery",o,t)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Te=function(){function t(t){this.service=t,this.forceSelection=!0,this.keyToExclude=[],this.keyToKeep=[],this.multiple=!1,this.onSelect=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.onClear=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){var t=this;try{this.service.query(this.server,this.enumeration).subscribe((function(e){return t.payload=e.results[0].items}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(this.suggestions=[],!(isNaN(o)&&o.toString().length<3)){this.keyToExclude&&this.keyToExclude.length?this.payload=this.payload&&this.payload.filter((function(t){return!e.keyToExclude.includes(t.key)})):this.keyToKeep&&this.keyToKeep.length&&(this.payload=this.payload&&this.payload.filter((function(t){return e.keyToKeep.includes(t.key)})));for(var n=0;n<this.payload.length;n++){var i=this.payload[n];-1!==i.value.toLowerCase().indexOf(o.toLowerCase())&&this.suggestions.push(i)}}},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},t.prototype.onDropdownClick=function(){this.isDropdown=!0},t.prototype.onClearItem=function(t){return V(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.onClear.emit(t)];case 1:return e.sent(),this.form.get(this.name).reset(),[2]}}))}))},Object.defineProperty(t.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObjectEl},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:De}]},N([e.ViewChild("autoCompleteObject",{static:!0})],t.prototype,"_autoCompleteObjectEl",void 0),N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Input()],t.prototype,"keyToExclude",void 0),N([e.Input()],t.prototype,"keyToKeep",void 0),N([e.Input()],t.prototype,"server",void 0),N([e.Input()],t.prototype,"enumeration",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"multiple",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onClear",void 0),t=N([e.Component({selector:"input-rest-auto-complete-enum",template:'<div [formGroup]="form">\n <p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],t)}(),Ee=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Te],providers:[De],exports:[Te]})],t)}(),Fe=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),Ae=function(){function o(t){this.service=t,this.forceSelection=!0,this.keyName="name",this.keysToExclude=[],this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.onFocus=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.suggestions=[]}return o.prototype.ngOnInit=function(){},o.prototype.filterQuery=function(e){var o=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{if(this.isWagetype){var i=R({searchText:n,companyId:this.companyId},this.wagetypeReferenceDates);return this.service.query("autocompleteWagetypeQuery",i,t.ServiceType.ENTRY).subscribe((function(t){return o.formaterResponce(t.result)}))}this.service.query("autocomplete",this.getParamsRest(n)).subscribe((function(t){return o.formaterResponce(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},o.prototype.formaterResponce=function(t){var e=this;this.suggestions=[];var o=[];return t.map((function(t){var n={tableId:t.tableId,name:""};if(t.fields.map((function(t){n[t.name]=t.value})),!e.keysToExclude.includes(t&&t.tableId)){var i="";e.concatFieldsForName?(e.concatFieldsForName.map((function(t){t.includes("date")&&(n[t]=re(n[t]).format("L")),i+=n[t]+" - "})),i=i.slice(0,-3)):(e.keyCode&&(i+=n[e.keyCode]+" - "),e.keyName&&(i+=n[e.keyName])),n.name=i,o.push(n)}})),this.suggestions=o,o},o.prototype.getParamsRest=function(t){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(t)}},o.prototype.getConditionsRest=function(t){var e=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+t}];return this.conditions&&this.conditions.map((function(t){!["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(t.expression)&&Jt(t.value)&&e.push(t)})),e},o.prototype.selectOption=function(t){this.onSelect.emit(t)},o.prototype.onClearItem=function(t){this.onClear.emit(t)},o.prototype.onBlurItem=function(t){this.onBlur.emit(t)},o.prototype.onFocusItem=function(t){this.onFocus.emit(t)},Object.defineProperty(o.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:Fe}]},N([e.Input()],o.prototype,"name",void 0),N([e.Input()],o.prototype,"table",void 0),N([e.Input()],o.prototype,"order",void 0),N([e.Input()],o.prototype,"fields",void 0),N([e.Input()],o.prototype,"conditionsFields",void 0),N([e.Input()],o.prototype,"conditions",void 0),N([e.Input()],o.prototype,"placeholder",void 0),N([e.Input()],o.prototype,"readonly",void 0),N([e.Input()],o.prototype,"required",void 0),N([e.Input()],o.prototype,"disabled",void 0),N([e.Input()],o.prototype,"dropdown",void 0),N([e.Input()],o.prototype,"forceSelection",void 0),N([e.Input()],o.prototype,"error",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"keyCode",void 0),N([e.Input()],o.prototype,"keyName",void 0),N([e.Input()],o.prototype,"concatFieldsForName",void 0),N([e.Input()],o.prototype,"itemSelect",void 0),N([e.Input()],o.prototype,"style",void 0),N([e.Input()],o.prototype,"inputStyle",void 0),N([e.Input()],o.prototype,"keysToExclude",void 0),N([e.Input()],o.prototype,"isWagetype",void 0),N([e.Input()],o.prototype,"companyId",void 0),N([e.Input()],o.prototype,"wagetypeReferenceDates",void 0),N([e.Output()],o.prototype,"onBlur",void 0),N([e.Output()],o.prototype,"onSelect",void 0),N([e.Output()],o.prototype,"onClear",void 0),N([e.Output()],o.prototype,"onFocus",void 0),N([e.Output()],o.prototype,"modelChange",void 0),N([e.Input()],o.prototype,"model",null),o=N([e.Component({selector:"input-rest-auto-complete-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onFocus)="onFocusItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]})],o)}(),Pe=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Ae],providers:[Fe],exports:[Ae]})],t)}(),xe=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o={names:[e]};return this.http.enumQuery("enumQuery",o,t)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Me=function(){function t(t){this.service=t,this.forceSelection=!0,this.onSelect=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.onClear=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){var t=this;try{this.service.query(this.server,this.enumeration).subscribe((function(e){return t.payload=e.results}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.filterQuery=function(t){var e=t.query;if(this.suggestions=[],!(isNaN(e)&&e.toString().length<3))for(var o=0;o<this.payload[0].items.length;o++){var n=this.payload[0].items[o];-1!==n.value.toLowerCase().indexOf(e.toLowerCase())&&this.suggestions.push(n)}},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onBlurItem=function(t){this.onBlur.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:xe}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"style",void 0),N([e.Input()],t.prototype,"inputStyle",void 0),N([e.Input()],t.prototype,"server",void 0),N([e.Input()],t.prototype,"enumeration",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-rest-auto-complete-model-enum",template:'<p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]})],t)}(),Le=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Me],providers:[xe],exports:[Me]})],t)}(),Oe=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Be=function(){function t(t){this.service=t,this.forceSelection=!0,this.minCharactersToSearch=3,this.multiple=!1,this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.onFocus=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(!(isNaN(o)&&o.toString().length<this.minCharactersToSearch))try{this.service.query("autocompleteJobpositionQuery",this.getParamsRest(o)).subscribe((function(t){return e.formaterResponse(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.formaterResponse=function(t){this.suggestions=[];var e=[];return t.map((function(t){var o={tableId:t.tableId,name:""};t.fields.map((function(t){o[t.name]=t.value})),o.name=o.Code+" - "+o.Name,e.push(o)})),this.suggestions=e,e},t.prototype.getParamsRest=function(t){return{searchText:t,companyId:this.companyId?this.replace(this.companyId):null,creationDate:this.creationDate?this.replace(this.creationDate):null,expirationDate:this.expirationDate?this.replace(this.expirationDate):null,jobpositionsFilter:this.jobpositionsFilter?this.replaceArray(this.jobpositionsFilter):null,ignoredJobpositions:this.ignoredJobpositions?this.replaceArray(this.ignoredJobpositions):null,order:this.order}},t.prototype.replace=function(t){return t.replace(new RegExp("'","g"),"")},t.prototype.replaceArray=function(t){var e=this;return t.map((function(t){return e.replace(t)}))},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},t.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},t.prototype.onDropdownClick=function(){this.isDropdown=!0},t.ctorParameters=function(){return[{type:Oe}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"value",void 0),N([e.Input()],t.prototype,"companyId",void 0),N([e.Input()],t.prototype,"creationDate",void 0),N([e.Input()],t.prototype,"expirationDate",void 0),N([e.Input()],t.prototype,"jobpositionsFilter",void 0),N([e.Input()],t.prototype,"ignoredJobpositions",void 0),N([e.Input()],t.prototype,"order",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Input()],t.prototype,"minCharactersToSearch",void 0),N([e.Input()],t.prototype,"multiple",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"onFocus",void 0),t=N([e.Component({selector:"input-rest-auto-complete-jobposition",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],t)}(),Re=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,m.SharedModule,o.ReactiveFormsModule],declarations:[Be],providers:[Oe],exports:[Be]})],t)}(),Ne=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.prototype.queryEntity=function(t,e){return this.http.get(t)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Ve=function(){function t(t,o){this.translateService=t,this.service=o,this.arguments={page:{current:1,size:"10"}},this.alwaysShowPaginator=!1,this.onLoadPayload=new e.EventEmitter,this.loadedList=new e.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){t.hasOwnProperty("arguments")&&(this.arguments=Object.assign({},t.arguments.currentValue),this.getList(1)),t.hasOwnProperty("reload")&&!0===t.reload.currentValue&&this.getList(1)},t.prototype.getList=function(t){var e=this;this.loadedList.emit(!0);try{var o=Object.assign({},this.arguments);o.page.current=t,this.isEntity?this.service.queryEntity(this.urlRest,o).subscribe((function(o){e.onResponseQuery(o,t),e.loadedList.emit(!1)})):this.service.query(this.urlRest,o).subscribe((function(o){e.onResponseQuery(o.result,t),e.loadedList.emit(!1)}))}catch(t){console.log("Erro ao tentar buscar lista no back")}},t.prototype.onResponseQuery=function(t,e){this.payload=this.filterValues?this.filterValues.bind(this.scope)(t[this.keyPayload]):t[this.keyPayload],this.onLoadPayload.emit({result:t[this.keyPayload],page:e}),this.totalRecords=this.isEntity?t.totalElements:t.countResult},t.prototype.onHandlePage=function(t){var e=t.first/t.rows+1;this.getList(e)},t.prototype.getRowActions=function(t){return this.getRowActionsFun.call(this.scope,t)},t.prototype.handleClickActions=function(t){t.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},t.ctorParameters=function(){return[{type:a.TranslateService},{type:Ne}]},N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"urlRest",void 0),N([e.Input()],t.prototype,"keyPayload",void 0),N([e.Input()],t.prototype,"columns",void 0),N([e.Input()],t.prototype,"arguments",void 0),N([e.Input()],t.prototype,"filterValues",void 0),N([e.Input()],t.prototype,"getRowActionsFun",void 0),N([e.Input()],t.prototype,"scope",void 0),N([e.Input()],t.prototype,"reload",void 0),N([e.Input()],t.prototype,"isEntity",void 0),N([e.Input()],t.prototype,"alwaysShowPaginator",void 0),N([e.Output()],t.prototype,"onLoadPayload",void 0),N([e.Output()],t.prototype,"loadedList",void 0),t=N([e.Component({selector:"list-rest",template:'<p-table [value]="payload" reorderableColumns="true" [rows]="10" [totalRecords]="totalRecords" [paginator]="true" [pageLinks]="8"\n [alwaysShowPaginator]="alwaysShowPaginator" [responsive]="true" [lazy]="true" (onPage)="onHandlePage($event)">\n <p-column *ngFor="let col of columns;" [field]="col[\'field\']" [header]="col[\'label\']|translate" [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <span>{{data[col[\'field\']]}}</span>\n </ng-template>\n </p-column>\n\n <p-column [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\', \'overflow\': \'inherit\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <p-splitButton *ngIf="getRowActions(data).length > 1" label="{{\'hcm.payroll.action\' | translate}} &#9660;" [model]="getRowActions(data)"\n (onClick)="handleClickActions(button)" #button></p-splitButton>\n <button *ngIf="getRowActions(data).length <= 1" type="button" class="sds-button-aux aux-secondary" (click)="getRowActions(data)[0].command()">\n {{getRowActions(data)[0].label}}\n </button>\n </ng-template>\n </p-column>\n\n <ng-template pTemplate="emptymessage">\n {{ emptyMessage }}\n </ng-template>\n</p-table>\n',styles:["tr{border:1px solid #ddd!important}"]})],t)}(),je=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,ut,v.HttpClientModule,b.TableModule,d.InputTextModule,k.ButtonModule,F.SplitButtonModule],declarations:[Ve],providers:[Ne],exports:[Ve]})],t)}(),qe=function(){function t(){}return t=N([e.Component({selector:"spinner-loader",template:"<p-progressSpinner></p-progressSpinner>\n"})],t)}(),Ue=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,i.ProgressSpinnerModule],declarations:[qe],exports:[qe]})],t)}(),Ye=function(){function t(){this.company={},this.contractNationality={},this.contractType={}}return t.prototype.setCompany=function(t){this.company=t},t.prototype.getCompanyId=function(){return this.company.companyId},t.prototype.setContractNationality=function(t){this.contractNationality=t},t.prototype.isBrazilianAdmission=function(){return"BR"===this.company.abbreviation&&"National"===this.contractNationality.key},t.prototype.isBrazilAndforeignContract=function(){return"BR"===this.company.abbreviation&&"National"!==this.contractNationality.key},t.prototype.isForeignAdmission=function(){return"BR"!==this.company.abbreviation&&"National"===this.contractNationality.key},t.prototype.isForeignAndforeignContract=function(){return"BR"!==this.company.abbreviation&&"National"!==this.contractNationality.key},t.prototype.isBrazilianCompany=function(){return"BR"===this.company.abbreviation},t.prototype.isNationalContract=function(){return"National"===this.contractNationality.key},t.prototype.getCountryID=function(){return this.company.id},Object.defineProperty(t.prototype,"contractNationalityKey",{get:function(){return this.contractNationality.key},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"abbreviation",{get:function(){return this.company.abbreviation},enumerable:!0,configurable:!0}),t.prototype.getCurrency=function(){return this.company.currency},t.prototype.getStructureID=function(){return this.company.structure},t.prototype.setContractType=function(t){this.contractType=t},Object.defineProperty(t.prototype,"contractTypeKey",{get:function(){return this.contractType?this.contractType.key:this.contractType},enumerable:!0,configurable:!0}),t=N([e.Injectable()],t)}(),Ge=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule],providers:[Ye]})],t)}(),He=y;function Ke(t){return/^\d*$/.test(t)}function We(t){return t||!1}function ze(t){return Ke(We(t))?Number.parseInt(t):0}var $e=function(){function t(t){this.http=t,this.companyUseWorkstationGroupSubject=new f.Subject}return t.prototype.getCompanyIndications=function(t,e){return this.http.query("companyIndicationQuery",{companyId:t,companyIndicationType:e}).pipe(s.map((function(t){return t.result})))},t.prototype.setCompanyUseWorkstationGroup=function(t){this.companyUseWorkstationGroupSubject.next(t)},t.prototype.setStructure=function(t){this.structure=t},t.prototype.getStructure=function(){return this.structure},t.prototype.getCompanyUseWorkstationGroup=function(){return this.companyUseWorkstationGroupSubject.asObservable()},t.prototype.setUseWorkstationGroup=function(t){this.useWorkstationGroup=t},t.prototype.getUseWorkstationGroup=function(){return this.useWorkstationGroup},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Qe=function(){function t(t){this.http=t}return t.prototype.hasModule=function(t){return this.http.query("hasModule",{module:t})},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Je=y,Xe=function(){function t(t,e,o){this.http=t,this.messageService=e,this.translateService=o,this._httpParams=new v.HttpParams}return t.prototype.lookupRequestPost=function(t,e,o,n){return void 0===o&&(o=null),this.httpPostParams=t,this.postConfigPageSize(t),this.lookupDisplayField=n,this.concatFields=o,this.postDataLookup(e)},t.prototype.postConfigPageSize=function(t){t&&(this.httpPostParams.page.size=t.page&&t.page.size?t.page.size:10,this.httpPostParams.page.current=t.page&&t.page.current?t.page.current:0)},t.prototype.lookupRequest=function(t,e,o,n,i,r,a,s){return void 0===a&&(a=[]),void 0===s&&(s=[]),this.searchLookupFields=o,this.endpoint=e,this.parameters=s,this.concatFields=i,this.concatOtherFields=a,this.lookupDisplayField=r,this.searchFields=n,this.generateLookupParameters(t),this.configHttpParamsPagination("10","0"),this.configHttpParamsOrderBy(t.multiSortMeta),this.getDataLookup()},t.prototype.searchRequest=function(t,e,o,n,i,r,a){return void 0===r&&(r=[]),void 0===a&&(a=[]),this.endpoint=e,this.parameters=a,this.concatFields=n,this.concatOtherFields=r,this.lookupDisplayField=i,this.searchFields=o,this.generateGridParameters(t.filterData),this.configHttpParamsPagination(t.rows.toString(),Math.floor(t.first/t.rows).toString()),this.configHttpParamsOrderBy(t.multiSortMeta),this.getDataLookup()},t.prototype.getDataLookup=function(){var t=this;return this.getUrlDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(e){var o=e.contents;return t.concatFields&&t.concatFields.length&&o.map((function(e){t.convertGridFieldValue(e),e[t.lookupDisplayField]=t.generateDisplayFieldValue(R({},e))})),e})))},t.prototype.postDataLookup=function(t){var e=this;return this.postUrlDataLookup(t,this.httpPostParams).pipe(s.map((function(t){var o=t.contents;return e.concatFields&&e.concatFields.length&&o.map((function(t){e.concatOtherFields&&e.convertGridFieldValue(t),t[e.lookupDisplayField]=e.generateDisplayFieldValue(R({},t))})),t})))},t.prototype.convertLookupFieldValue=function(t,e){if(t)switch(e.type){case h.FieldType.Date:t=Je(t).format("L");break;case h.FieldType.Enum:var o=e.options.filter((function(e){return e.value===t}))[0];t=o?o.label:t}return t},t.prototype.convertGridFieldValue=function(t){t&&this.concatOtherFields.forEach((function(e){switch(e.type){case h.FieldType.Enum:var o=e.options.filter((function(o){return o.value===t[e.name]}))[0];t[e.name]=o?o.label:t[e.name]}}))},t.prototype.generateDisplayFieldValue=function(t){var e=this,o="";return this.concatFields.forEach((function(n){var i=e.convertLookupFieldValue(t[n.name],n);i&&(o?o+=" - "+i:o=i)})),o},t.prototype.generateLookupParameters=function(t){var e=this,o="";this.searchLookupFields.forEach((function(n){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o?o+=" or "+e.getParameterByType(i.type,n,t):o=""+e.getParameterByType(i.type,n,t)})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.generateGridParameters=function(t){var e=this,o="";Object.keys(t).forEach((function(n){if(t[n]){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o+=o?" and "+e.getParameterByType(i.type,n,t[n]):e.getParameterByType(i.type,n,t[n])}})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.getParameterByType=function(t,e,o){switch(t){case h.FieldType.Date:return e+" eq '"+Je(o).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return e+" eq '"+o+"'";case h.FieldType.Integer:return e+" eq "+o;case h.FieldType.Autocomplete:return e+" eq '"+o.id+"'";default:return"containing(lower("+e+"), lower('"+o+"'))"}},t.prototype.configHttpParamsPagination=function(t,e){this.httpParams=this.httpParams.set("size",t),this.httpParams=this.httpParams.set("offset",e)},t.prototype.configHttpParamsOrderBy=function(t){if(t&&t.length){var e="";t.map((function(t){e+=e?","+t.field+"+"+(1===t.order?"asc":"desc"):t.field+"+"+(1===t.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",e)}},Object.defineProperty(t.prototype,"httpParams",{get:function(){return this._httpParams},set:function(t){this._httpParams=t},enumerable:!0,configurable:!0}),t.prototype.getUrlDataLookup=function(t,e){var o=this;return e?this.http.get(""+t,{params:e}).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)}))):this.http.get(""+t).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},t.prototype.postUrlDataLookup=function(t,e){var o=this;return e?this.http.post(""+t,R({},e)).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)}))):this.http.post(""+t,{}).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},t.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(v.HttpClient),e.ɵɵinject(A.MessageService),e.ɵɵinject(a.TranslateService))},token:t,providedIn:"root"}),t=N([e.Injectable({providedIn:"root"})],t)}(),Ze=y,to=function(){function o(t){this.httpClienteService=t}return o.prototype.getAutoComplete=function(t,e,o,n,i){var r=this.generateGridParameters(e,o,n);return this.httpClienteService.getAutoComplete(t,r,i).pipe(s.map((function(t){return t&&t.contents})))},o.prototype.getAutoCompleteQuery=function(t,e){return this.httpClienteService.query(t,e).pipe(s.map((function(t){return t&&t.result})))},o.prototype.generateGridParameters=function(e,o,n){var i=this,r="";return Object.keys(e).forEach((function(a){var s,l=o&&o.filter((function(t){return a===t.name}))[0],p="",c=l&&l.type;l||a==t.CoreFieldType.searchValue||(c=h.FieldType.String),l||a!==t.CoreFieldType.searchValue||(c=t.CoreFieldType.searchValue),r&&(p=" and "),(s=i.getParameterByType(c,a,e[a],n))&&(r+=" "+p+" "+s)})),r},o.prototype.getParameterByType=function(e,o,n,i){if(!n&&e!=t.CoreFieldType.searchValue)return o+" is null";if(n&&"not null"===n&&e!=t.CoreFieldType.searchValue)return o+" is not null";switch(e){case h.FieldType.Date:return o+" eq '"+Ze(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return o+" eq '"+n+"'";case h.FieldType.Integer:return o+" eq "+n;case h.FieldType.Autocomplete:return o+" eq '"+n.id+"'";case t.CoreFieldType.searchValue:return""+this.getParameterBySearchType(n,i);default:return this.getSearchFilterString(o,n)}},o.prototype.getParameterBySearchType=function(t,e){var o,n,i="";if(t){try{for(var r=q(Object.entries(t)),a=r.next();!a.done;a=r.next()){var s=U(a.value,2),l=s[0],p=s[1];if("code"===l&&Number(p)){var c=e?"'":"";i+=i?" or "+l+" eq "+c+p+c:l+" eq "+c+p+c}else"code"!=l&&(i+=i?" or "+this.getSearchFilterString(l,p):this.getSearchFilterString(l,p))}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}i=i?"("+i+")":""}return i},o.prototype.getSearchFilterString=function(t,e){return"containing(lower("+t+"), lower('"+e+"'))"},o.ctorParameters=function(){return[{type:Nt}]},o.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(Nt))},token:o,providedIn:"root"}),o=N([e.Injectable({providedIn:"root"})],o)}(),eo="platform/report/queries/getParameters",oo="platform/report/queries/getReportUri",no="platform/report/queries/getReportStatus",io="platform/report/queries/findReportsByName",ro="platform/report/queries/getRunningReports",ao="platform/report/actions/generateReport",so=function(){function t(t){this.http=t}return t.prototype.findReportsByName=function(t){return this.http.post(""+io,{name:t}).pipe(s.map((function(t){return t.reports?t.reports:[]})))},t.prototype.findReportByName=function(t){return t=t||"",this.findReportsByName(t).pipe(s.map((function(e){var o=e&&e.filter((function(e){return e.name&&e.name===t}));return o&&1==o.length?o[0]:null})))},t.prototype.getParameters=function(t,e){return this.http.post(""+eo,{id:t,reportFileId:e}).pipe(s.map((function(t){return t||null})))},t.prototype.getReportUri=function(t){return this.http.post(""+oo,{reportTicket:t}).pipe(s.map((function(t){return t&&t.reportUri})))},t.prototype.getReportStatus=function(t){return this.http.post(""+no,{reportTicket:t}).pipe(s.map((function(t){return t&&t.reportStatus})))},t.prototype.generateReport=function(t){return this.http.post(""+ao,t).pipe(s.map((function(t){return t||null})))},t.prototype.getRunningReports=function(t,e){return this.http.post(""+ro,{offset:t,limit:e,orderByDesc:!0,filterCancelled:!0})},t.ctorParameters=function(){return[{type:v.HttpClient}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(v.HttpClient))},token:t,providedIn:"root"}),t=N([e.Injectable({providedIn:"root"})],t)}(),lo=function(){function t(){this.useWorkflowValueChange=new f.Subject,this._draftJSON=new f.BehaviorSubject(null)}return t.prototype.setUseWorkflow=function(t){this.useWorkflowValueChange.next(t)},t.prototype.getUseWorkflow=function(){return this.useWorkflowValueChange.asObservable()},t.prototype.setDraftJSON=function(t){this._draftJSON.next(t)},t.prototype.getDraftJSON=function(){return this._draftJSON.asObservable()},t=N([e.Injectable()],t)}(),po=function(){function t(){this.resetDivergentFormData()}return t.prototype.resetDivergentFormData=function(){this._divergentFormData={}},t.prototype.checkFormDisagreements=function(t){var e=this;void 0===t&&(t=!1),this.resetDivergentFormData(),this._sanitizeEmptyStrings(),t&&this._removeIdsFromFormDatas(),this._oldFormData===this._newFormData?this._throwIdenticalMessage():(Object.keys(this._oldFormData).forEach((function(t){e._oldFormData[t]!==e._newFormData[t]&&(e._divergentFormData[t]=e._createDivergencePair(t))})),Object.keys(this._newFormData).forEach((function(t){e._newFormData[t]!==e._oldFormData[t]&&(e._divergentFormData[t]=e._createDivergencePair(t))})),this._isDivergentFormDataEmpty&&this._throwIdenticalMessage())},t.prototype._removeIdsFromFormDatas=function(){[this._oldFormData,this._newFormData].forEach((function(t){delete t.id}))},t.prototype._sanitizeEmptyStrings=function(){[this._oldFormData,this._newFormData].forEach((function(t){Object.keys(t).map((function(e){""===t[e]&&(t[e]=null)}))}))},t.prototype._createDivergencePair=function(t){var e={oldValue:null,newValue:null};return e.oldValue=this._oldFormData[t],e.newValue=this._newFormData[t],e},t.prototype._throwIdenticalMessage=function(){throw new Error("The objects oldFormData and newFormData are identical")},Object.defineProperty(t.prototype,"oldFormData",{get:function(){return this._oldFormData},set:function(t){this._oldFormData=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"newFormData",{get:function(){return this._newFormData},set:function(t){this._newFormData=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"divergentFormArray",{get:function(){var t=[];return Object.entries(this._divergentFormData).map((function(e){var o=U(e,2),n=o[0],i=o[1],r={key:null,oldValue:null,newValue:null};r.key=n,r.oldValue=i.oldValue,r.newValue=i.newValue,t.push(r)})),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isDivergentFormDataEmpty",{get:function(){return 0===Object.entries(this._divergentFormData).length},enumerable:!0,configurable:!0}),t=N([e.Injectable()],t)}(),co=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule],providers:[$e,Qe,Xe,to,so,lo,po]})],t)}(),uo=function(){function t(t){var e=this;this.http=t,this.actionUrl="platform/authorization/queries/checkAccess",this.resourceAddress="res://senior.com.br/hcm/payroll/",this.defaultActions=["Visualizar","Incluir","Editar","Excluir"],this._resources=[],this._attributes=[],P.user.getAuthHeader().then((function(t){e.httpOptions={headers:new v.HttpHeaders({"Content-Type":"application/json",Accept:"application/json",Authorization:t})}})),P.service.getRestUrl().then((function(t){return e.restUrl=t}))}return t.prototype.get=function(t){var e=this;return void 0===t&&(t=""),this.permissions?this.observable=f.Observable.of(this.permissions):this.observable||(this.observable=this.getPermissions().pipe(s.map((function(t){return e.permissions=t})))),this.observable.pipe(s.map((function(e){return t?e[t]:e})))},t.prototype.getAbac=function(t,e){return this.attributes=e,this.getAbacPermission(t)},t.prototype.getAbacPermission=function(t){return this.http.post(this.actionUrl,{includeFilters:!1,permissions:[{resource:""+this.resourceAddress+t,action:"Visualizar",attributes:this._attributes.map((function(t){return{attribute:t.name,value:t.value}}))}]},this.httpOptions)},t.prototype.getPermissions=function(){var t=this,e=[];return this._resources.forEach((function(o){return t.defaultActions.forEach((function(n){return e.push({action:n,resource:""+t.resourceAddress+o})}))})),this.http.post(this.actionUrl,{includeFilters:!1,permissions:Y(e)},this.httpOptions).pipe(s.map((function(e){var o=e.permissions,n={};return o.forEach((function(e){var o=e.resource.replace(t.resourceAddress,"");n[o]=n[o]||{},n[o][e.action.toLowerCase()]=e.authorized})),n})))},Object.defineProperty(t.prototype,"attributes",{set:function(t){this._attributes=t},enumerable:!0,configurable:!0}),t.prototype.setResources=function(t){this._resources=t},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),mo=function(){function t(t,e,o){this.toastService=t,this.messageService=e,this.translateService=o,this.key="TOAST",this.breakLine=!1,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.toastService.loadErrorMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.createErrorMessage(e&&e.message),t.breakLine=e&&e.breakLine})),this.toastService.loadSuccessMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.createSuccessMessage(e&&e.message),t.breakLine=e&&e.breakLine})),this.toastService.loadWarningMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.createWarningMessage(e&&e.message),t.breakLine=e&&e.breakLine}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},t.prototype.createErrorMessage=function(t,e){this.messageService.clear(),this.messageService.add({severity:"error",summary:e||this.translateService.instant("hcm.payroll.error"),detail:t,sticky:!0,key:this.key})},t.prototype.createSuccessMessage=function(t,e){this.messageService.add({severity:"success",summary:e||this.translateService.instant("hcm.payroll.success"),detail:t,key:this.key})},t.prototype.createWarningMessage=function(t,e){this.messageService.add({severity:"warn",summary:e||this.translateService.instant("hcm.payroll.warn"),detail:t,sticky:!0,key:this.key})},t.ctorParameters=function(){return[{type:Rt},{type:I.MessageService},{type:a.TranslateService}]},t=N([e.Component({selector:"c-toast",template:"\n <p-toast [ngClass]=\"breakLine ? 'ui-toast-break-line' : ''\" [key]=\"key\"></p-toast>\n "})],t)}(),ho=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,x.ToastModule],declarations:[mo],providers:[Rt,I.MessageService],exports:[mo]})],t)}(),yo=function(){function t(t){this.http=t}return t.prototype.getList=function(t,e){return this.http.get(""+t,{params:e})},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),fo=function(){function o(t){this.dataListService=t,this.rows=10,this.paginator=!0,this.first=0,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.lazyLoad=new e.EventEmitter,this.loadingChange=new e.EventEmitter,this.totalRecordsChange=new e.EventEmitter,this.listDataChange=new e.EventEmitter,this.selectedDataChange=new e.EventEmitter,this.headerCheckboxToggle=new e.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return o.prototype.ngOnInit=function(){this.lazy||this.getlistData()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.getActions=function(t,e){return this.actions(t,e)},o.prototype.handleClickActions=function(t){t.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},o.prototype.pagination=function(t){this.lazy||this.getlistData(t.rows,Math.floor(t.first/t.rows))},o.prototype.onLazyLoad=function(e){var o=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){o.orderBy.push({field:e.field,direction:1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows))},o.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(o.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),o.prototype.getlistData=function(t,e){var o=this;void 0===t&&(t=this.rows),void 0===e&&(e=this.first),this.endpoint?(this.configParameters(this.initParameters),this.configHttpParamsDisplayFields(),this.configHttpParamsPagination(t.toString(),e.toString()),this.configHttpParamsOrderBy(),this.dataListService.getList(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){o.listData=t.contents,o.totalRecords=t.totalElements,o.lazy&&o.lazyLoad.emit(o.listData)}))):this.lazy&&this.lazyLoad.emit(this.listData)},o.prototype.configHttpParamsPagination=function(t,e){this.httpParams=this.httpParams.set("size",t),this.httpParams=this.httpParams.set("offset",e)},o.prototype.configHttpParamsOrderBy=function(){if(this.orderBy&&this.orderBy.length){var t="";this.orderBy.map((function(e){t+=t?","+e.field+"+"+e.direction:e.field+"+"+e.direction})),this.httpParams=this.httpParams.set("orderby",t)}},o.prototype.configHttpParamsDisplayFields=function(){this.displayFields&&this.displayFields.length&&(this.httpParams=this.httpParams.set("displayfields",this.displayFields.toString()))},o.prototype.onHeaderCheckboxToggle=function(t){this.headerCheckboxToggle.emit(t)},o.prototype.getFieldValue=function(t,e){return e.field&&e.field.includes(".")?(e.field.split(".").map((function(e){return t=t&&t[e]})),t):t[e.field]},o.prototype.configParameters=function(t){var e="";t&&(t.forEach((function(t){e?e+=" and "+t.toString():e=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",e))},Object.defineProperty(o.prototype,"parameters",{set:function(t){this.configParameters(t),t&&(this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"httpParams",{get:function(){return this._httpParams},set:function(t){this._httpParams=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"loading",{get:function(){return this._loading},set:function(t){this._loading=t,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"listData",{get:function(){return this._listData},set:function(t){this._listData=t,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"selectedData",{get:function(){return this._selectedData},set:function(t){this._selectedData=t,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(t){this._totalRecords=t,this.totalRecordsChange.emit(this.totalRecords)},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:yo}]},N([e.ViewChild("dataListTable",{static:!1})],o.prototype,"dataListTable",void 0),N([e.Input()],o.prototype,"id",void 0),N([e.Input()],o.prototype,"dataKey",void 0),N([e.Input()],o.prototype,"rows",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"columns",void 0),N([e.Input()],o.prototype,"paginator",void 0),N([e.Input()],o.prototype,"first",void 0),N([e.Input()],o.prototype,"alwaysShowPaginator",void 0),N([e.Input()],o.prototype,"actions",void 0),N([e.Input()],o.prototype,"actionLabel",void 0),N([e.Input()],o.prototype,"selectionMode",void 0),N([e.Input()],o.prototype,"lazy",void 0),N([e.Input()],o.prototype,"isMultipleSelection",void 0),N([e.Input()],o.prototype,"isSortable",void 0),N([e.Input()],o.prototype,"showHeaderCheckBox",void 0),N([e.Input()],o.prototype,"sortMode",void 0),N([e.Input()],o.prototype,"endpoint",void 0),N([e.Input()],o.prototype,"displayFields",void 0),N([e.Input()],o.prototype,"orderBy",void 0),N([e.Input()],o.prototype,"singularMessageRecords",void 0),N([e.Input()],o.prototype,"pluralMessageRecords",void 0),N([e.Input()],o.prototype,"initParameters",void 0),N([e.Output()],o.prototype,"lazyLoad",void 0),N([e.Output()],o.prototype,"loadingChange",void 0),N([e.Output()],o.prototype,"totalRecordsChange",void 0),N([e.Output()],o.prototype,"listDataChange",void 0),N([e.Output()],o.prototype,"selectedDataChange",void 0),N([e.Output()],o.prototype,"headerCheckboxToggle",void 0),N([e.Input()],o.prototype,"parameters",null),N([e.Input()],o.prototype,"loading",null),N([e.Input()],o.prototype,"listData",null),N([e.Input()],o.prototype,"selectedData",null),N([e.Input()],o.prototype,"totalRecords",null),o=N([e.Component({selector:"c-data-list",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows"\n [first]="first" (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator"\n (onPage)="pagination($event)" [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey"\n [sortMode]="sortMode" [responsive]="true" pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)"\n [selectionMode]="selectionMode">\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.orderBy || col.field"\n [pSortableColumnDisabled]="!isSortable || !!col.icon" [style.width]="col.width" [pTooltip]="col.tooltip || col.label"\n tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="{{id}}-col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style"\n aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="{{id}}-col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default"\n [model]="getActions(rowData, key)" [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label"\n priority="default" (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:e.ViewEncapsulation.None,styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]})],o)}(),go=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[fo],exports:[fo],providers:[yo]})],t)}(),bo=function(){function t(t,e,o){this.http=t,this.messageService=e,this.translateService=o}return t.prototype.getDataLookup=function(t,e){var o=this;return e?this.http.get(""+t,{params:e}).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)}))):this.http.get(""+t).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},t.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},t=N([e.Injectable()],t)}(),vo=y,Io=function(){function t(t){this.lookupService=t,this.searchTotalRecordsLabel="hcm.payroll.lookup_search_total_records_label",this.filterLabel="hcm.payroll.lookup_generic_filter_label",this.clearLabel="hcm.payroll.lookup_generic_clean_filter_label",this.cancelLabel="hcm.payroll.lookup_generic_btn_cancel_label",this.selectLabel="hcm.payroll.lookup_btn_select_label",this.lookupEmptyMessage="hcm.payroll.lookup_auto_complete_empty_message",this.lookupSuggestions=[],this.searchGridFields=[],this.searchLookupFields=[],this.searchGridData=[],this.searchFields=[],this.parameters=[],this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.modelChange=new e.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},t.prototype.lookupRequest=function(t){var e=this;this.generateLookupParameters(t),this.configHttpParamsPagination("10","0"),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.lookupSuggestions=t&&Y(t.contents)}))},t.prototype.searchRequest=function(t){var e=this;this.generateGridParameters(t.filterData),this.configHttpParamsPagination(t.rows.toString(),Math.floor(t.first/t.rows).toString()),this.configHttpParamsOrderBy(t.multiSortMeta),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.searchGridData=t&&Y(t.contents)}))},t.prototype.getDataLookup=function(t,e){var o=this;return this.lookupService.getDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(t){var e=t.totalElements,n=t.contents;return o.searchTotalRecords=e,o.concatFields&&o.concatFields.length&&n.map((function(t){o.convertGridFieldValue(t),t[o.lookupDisplayField]=o.generateDisplayFieldValue(R({},t))})),t})))},t.prototype.convertLookupFieldValue=function(t,e){if(t)switch(e.type){case h.FieldType.Date:t=vo(t).format("L");break;case h.FieldType.Enum:var o=e.options.filter((function(e){return e.value===t}))[0];t=o?o.label:t}return t},t.prototype.convertGridFieldValue=function(t){t&&this.searchGridFields.forEach((function(e){switch(e.type){case h.FieldType.Enum:var o=e.options.filter((function(o){return o.value===t[e.name]}))[0];t[e.name]=o?o.label:t[e.name]}}))},t.prototype.generateDisplayFieldValue=function(t){var e=this,o="";return this.concatFields.forEach((function(n){var i=e.convertLookupFieldValue(t[n.name],n);i&&(o?o+=" - "+i:o=i)})),o},t.prototype.generateLookupParameters=function(t){var e=this,o="";this.searchLookupFields.forEach((function(n){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o?o+=" or "+e.getParameterByType(i.type,n,t):o=""+e.getParameterByType(i.type,n,t)})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.generateGridParameters=function(t){var e=this,o="";Object.keys(t).forEach((function(n){if(t[n]){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o+=o?" and "+e.getParameterByType(i.type,n,t[n]):e.getParameterByType(i.type,n,t[n])}})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.getParameterByType=function(t,e,o){switch(t){case h.FieldType.Date:return e+" eq '"+vo(o).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return e+" eq '"+o+"'";case h.FieldType.Integer:return e+" eq "+o;case h.FieldType.Autocomplete:return e+" eq "+o.id;default:return"containing(lower("+e+"), lower('"+o+"'))"}},t.prototype.configHttpParamsPagination=function(t,e){this.httpParams=this.httpParams.set("size",t),this.httpParams=this.httpParams.set("offset",e)},t.prototype.configHttpParamsOrderBy=function(t){if(t&&t.length){var e="";t.map((function(t){e+=e?","+t.field+"+"+(1===t.order?"asc":"desc"):t.field+"+"+(1===t.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",e)}},Object.defineProperty(t.prototype,"httpParams",{get:function(){return this._httpParams},set:function(t){this._httpParams=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(t)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:bo}]},N([e.Input()],t.prototype,"id",void 0),N([e.Input()],t.prototype,"dataKey",void 0),N([e.Input()],t.prototype,"concatFields",void 0),N([e.Input()],t.prototype,"searchTitle",void 0),N([e.Input()],t.prototype,"formGroup",void 0),N([e.Input()],t.prototype,"controlName",void 0),N([e.Input()],t.prototype,"multiple",void 0),N([e.Input()],t.prototype,"endpoint",void 0),N([e.Input()],t.prototype,"lookupDisplayField",void 0),N([e.Input()],t.prototype,"searchTotalRecordsLabel",void 0),N([e.Input()],t.prototype,"filterLabel",void 0),N([e.Input()],t.prototype,"clearLabel",void 0),N([e.Input()],t.prototype,"cancelLabel",void 0),N([e.Input()],t.prototype,"selectLabel",void 0),N([e.Input()],t.prototype,"lookupEmptyMessage",void 0),N([e.Input()],t.prototype,"searchTotalRecords",void 0),N([e.Input()],t.prototype,"lookupSuggestions",void 0),N([e.Input()],t.prototype,"searchGridFields",void 0),N([e.Input()],t.prototype,"searchLookupFields",void 0),N([e.Input()],t.prototype,"searchGridData",void 0),N([e.Input()],t.prototype,"searchFields",void 0),N([e.Input()],t.prototype,"parameters",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"c-lookup",template:'<div *ngIf="formGroup;else noForm" [formGroup]="formGroup">\n <s-lookup [id]="id" [dataKey]="dataKey" [formControlName]="controlName" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</div>\n\n<ng-template #noForm>\n <s-lookup [id]="id" [dataKey]="dataKey" [(ngModel)]="model" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</ng-template>\n'})],t)}(),_o=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,h.DynamicFormModule,o.ReactiveFormsModule,a.TranslateModule],declarations:[Io],exports:[Io],providers:[bo]})],t)}(),So=y,ko=function(){function o(t){this.httpClienteService=t}return o.prototype.getAutoComplete=function(t,e,o,n,i){var r=this.generateGridParameters(e,o,n);return this.httpClienteService.getAutoComplete(t,r,i).pipe(s.map((function(t){return t&&t.contents})))},o.prototype.getAutoCompleteQuery=function(t,e){return this.httpClienteService.query(t,e).pipe(s.map((function(t){return t&&t.result})))},o.prototype.generateGridParameters=function(e,o,n){var i=this,r="";return Object.keys(e).forEach((function(a){var s,l=o&&o.filter((function(t){return a===t.name}))[0],p="",c=l&&l.type;l||a==t.CoreFieldType.searchValue||(c=h.FieldType.String),l||a!==t.CoreFieldType.searchValue||(c=t.CoreFieldType.searchValue),r&&(p=" and "),(s=i.getParameterByType(c,a,e[a],n))&&(r+=" "+p+" "+s)})),r},o.prototype.getParameterByType=function(e,o,n,i){if(!n&&e!=t.CoreFieldType.searchValue)return o+" is null";if(n&&"not null"===n&&e!=t.CoreFieldType.searchValue)return o+" is not null";switch(e){case h.FieldType.Date:return o+" eq '"+So(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return o+" eq '"+n+"'";case h.FieldType.Integer:return o+" eq "+n;case h.FieldType.Autocomplete:return o+" eq '"+n.id+"'";case t.CoreFieldType.searchValue:return""+this.getParameterBySearchType(n,i);default:return this.getSearchFilterString(o,n)}},o.prototype.getParameterBySearchType=function(t,e){var o,n,i="";if(t){try{for(var r=q(Object.entries(t)),a=r.next();!a.done;a=r.next()){var s=U(a.value,2),l=s[0],p=s[1];if("code"===l&&Number(p)){var c=e?"'":"";i+=i?" or "+l+" eq "+c+p+c:l+" eq "+c+p+c}else"code"!=l&&(i+=i?" or "+this.getSearchFilterString(l,p):this.getSearchFilterString(l,p))}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}i=i?"("+i+")":""}return i},o.prototype.getSearchFilterString=function(t,e){return"containing(lower("+t+"), lower('"+e+"'))"},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),wo=y,Co=function(){function t(t,e,o){this.http=t,this.messageService=e,this.translateService=o}return t.prototype.lookupRequestPost=function(t,e,o,n){return void 0===o&&(o=null),this.httpPostParams=t,this.postConfigPageSize(t),this.lookupDisplayField=n,this.concatFields=o,this.postDataLookup(e)},t.prototype.postConfigPageSize=function(t){t&&(this.httpPostParams.page.size=t.page&&t.page.size?t.page.size:10,this.httpPostParams.page.current=t.page&&t.page.current?t.page.current:0)},t.prototype.postDataLookup=function(t){var e=this;return this.postUrlDataLookup(t,this.httpPostParams).pipe(s.map((function(t){var o=t.contents;return e.concatFields&&e.concatFields.length&&o.map((function(t){e.concatOtherFields&&e.convertGridFieldValue(t),t[e.lookupDisplayField]=e.generateDisplayFieldValue(R({},t))})),t})))},t.prototype.convertLookupFieldValue=function(t,e){if(t)switch(e.type){case h.FieldType.Date:t=wo(t).format("L");break;case h.FieldType.Enum:var o=e.options.filter((function(e){return e.value===t}))[0];t=o?o.label:t}return t},t.prototype.convertGridFieldValue=function(t){t&&this.concatOtherFields.forEach((function(e){switch(e.type){case h.FieldType.Enum:var o=e.options.filter((function(o){return o.value===t[e.name]}))[0];t[e.name]=o?o.label:t[e.name]}}))},t.prototype.generateDisplayFieldValue=function(t){var e=this,o="";return this.concatFields.forEach((function(n){var i=e.convertLookupFieldValue(t[n.name],n);i&&(o?o+=" - "+i:o=i)})),o},t.prototype.postUrlDataLookup=function(t,e){var o=this;return e?this.http.post(""+t,R({},e)).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)}))):this.http.post(""+t,{}).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},t.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},t=N([e.Injectable()],t)}(),Do=function(){function t(t,e){var o=t.filterData;this.name=o.name||null,this.code=o.code||null,this.searchText=o.searchText||null,this.companyId=o.headoffice||null,this.companyBranchId=o.branchoffice&&o.branchoffice.id||null,this.departmentId=o.department&&o.department.tableId||null,this.costcenterId=o.costcenter&&o.costcenter.id||null,this.jobpositionIds=o.jobposition||null,this.syndicateId=o.syndicate&&o.syndicate.id||null,this.shiftId=o.workshiftScale||null,this.workshiftId=o.workshiftId&&o.workshiftId.id||null,this.workshiftGroupId=o.workshiftGroupId&&o.workshiftGroupId.id||null,this.intervalGroupId=o.intervalGroupId&&o.intervalGroupId.is||null,this.scaleTeamId=o.scaleTeamId&&o.scaleTeamId.id||null,this.scaleCategoryId=o.scaleCategoryId&&o.scaleCategoryId.id||null,this.employmentRelationshipId=o.employmentRelationshipId&&o.employmentRelationshipId.id||null,this.contractType=o.contractType||null,this.expenseNatureId=o.expenseNatureId&&o.expenseNatureId.id||null,this.allowDeficient=o.allowDeficient||null,this.disabilityIds=o.disabilityIds||null,this.listExpired=!!o.hasOwnProperty("listExpired")&&o.listExpired,this.manager=o.manager?o.manager.tableId:null,this.referenceDate=e||null,this.page={current:t.first?t.first:0,size:t.rows?t.rows:10}||null}return t.prototype.getToFilter=function(){return this.jobpositionIds=this.convertListIds(this.jobpositionIds),this.disabilityIds=this.convertListIds(this.disabilityIds),this},t.prototype.convertListIds=function(t){if(t)return t.map((function(t){return t.tableId?t.tableId:t.id}))},t}(),To=y,Eo=function(){function o(o,n,i,r){var a=this;this.translate=o,this.cd=n,this.autocompleteParametersService=i,this.lookupParametersService=r,this.currentCompanyId=null,this.currentCompanyName=null,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.companyBranchId=null,this.lookupSuggestions=[],this.searchGridData=[],this.suggestionsObservable=new f.BehaviorSubject([]),this.totalRecords=0,this.valueEnumShift=[{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FIRST_SHIFT"),value:"0",enum:"FIRST_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_SECOND_SHIFT"),value:"1",enum:"SECOND_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_THIRD_SHIFT"),value:"2",enum:"THIRD_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FOURTH_SHIFT"),value:"3",enum:"FOURTH_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_MIXED"),value:"4",enum:"MIXED"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_GENERAL"),value:"5",enum:"GENERAL"}],this.concatFieldsName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String}),new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String})],this.concatName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String})],this.gridFields=[new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String}),new h.FormField({name:"manager",label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),type:h.FieldType.String})],this.searchFields=Y(this.concatName,[{name:"name",label:this.translate.instant("hcm.payroll.movimentation_name"),type:h.FieldType.String},{name:"headoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_company"),dataKey:"id",appendTo:"body",fullWidth:!0,suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"branchoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_branch"),dataKey:"id",appendTo:"body",fullWidth:!0,onRemove:function(){return a.companyBranchId=null},onSelect:function(t){var e=t.id;return a.companyBranchId=e},onSearch:function(t){a.getAutocomplete("company",t?{companyname:t,code:t}:null,"code","companyname",{headquarter:a.currentCompanyId?a.currentCompanyId:"not null"})},suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"manager",type:h.FieldType.Autocomplete,multiple:!1,label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocompleteQuery("autocompleteManager",{valueSearch:t||"",companyId:{tableId:a.currentCompanyId},companyBranchId:{tableId:a.companyBranchId?a.companyBranchId:""}})},suggestionsObservable:this.suggestionsObservable,displayField:"manager"},{name:"department",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.movimentation_historical_department_tab"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocompleteQuery("autocompleteDepartmentQuery",{searchText:t||"",companyId:a.currentCompanyId,referenceDate:To(y.now()).format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"costcenter",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_cost_center"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("costcenter",e?{name:e,code:e}:null,"code","name",a.currentCompanyId?{company:a.currentCompanyId}:null,!0,t.ServiceType.ORGANIZATION_REGISTER)},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"jobposition",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.movimentation_historical_job_position_tab"),dataKey:"tableId",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocompleteQuery("autocompleteJobpositionQuery",{searchText:t||"",companyId:a.currentCompanyId,creationDate:To().format("YYYY-MM-DD"),expirationDate:To().format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"syndicate",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_syndicate"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("syndicate",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"workshiftScale",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.SHIFT"),showClear:!0,size:{md:12},onChange:function(){a.resetDependenciesOfShift(!0)},options:this.valueEnumShift},{name:"workshiftId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("workshift",t?{description:t,code:t}:null,"code","description",a.workstationFilterForm.get("workshiftScale").value?{workshiftScale:a.valueEnumShift[a.workstationFilterForm.get("workshiftScale").value].enum}:null)},onSelect:function(){a.resetDependenciesOfShift()},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"workshiftGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_workshift-group"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("workshiftGroup",t?{code:t}:null,"code","baseDate",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"baseDate"},{name:"intervalGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_class_interval"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("intervalGroup",t?{description:t,code:t}:null,"code","description",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"scaleTeamId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_team"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("scaleTeam",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"scaleCategoryId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_category"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("scaleCategory",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"employmentRelationshipId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_employment_relationship"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("employmentRelationship",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"contractType",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.employees_temporary_contract_temporary_contract_type"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Employee"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Manager"),value:1},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FarmWorker"),value:2},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Retired"),value:3},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Trainee"),value:4},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Apprentice"),value:5},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FixedDueDate"),value:6},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_RetiredManager"),value:7},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_PublicAgent"),value:8},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Teacher"),value:9},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_CooperativeWorker"),value:10},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_DomesticWorker"),value:11},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_TeacherFixedDueDate"),value:12}]},{name:"expenseNatureId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_expense_nature"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("expenseNature",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"allowDeficient",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.allow_deficient"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_No"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Also"),value:1},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Only"),value:2}]},{name:"disabilityIds",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.employees_addition_disability"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("disability",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"}]),this.ngUnsubscribe=new f.Subject}return o.prototype.ngOnInit=function(){},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges();var t=this.workstationFilterForm.get("headoffice");t.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),t.disable()},Object.defineProperty(o.prototype,"workstationFilterForm",{get:function(){return this.workstationgroupEl&&this.workstationgroupEl.formGroupDialog},enumerable:!0,configurable:!0}),o.prototype.selectOption=function(t){this.onSelect.emit(t)},o.prototype.onClearItem=function(t){return V(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.onClear.emit(t)];case 1:return e.sent(),this.form.get(this.name).reset(),[2]}}))}))},o.prototype.resetDependenciesOfShift=function(t){void 0===t&&(t=!1),t&&this.workstationFilterForm.get("workshiftId").reset(),this.workstationFilterForm.get("workshiftGroupId").reset(),this.workstationFilterForm.get("intervalGroupId").reset()},o.prototype.searchRequest=function(t){var e=this,o=this.workstationFilterForm.get("headoffice"),n=t&&t.filterData;o.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),t=R({},this.getValueEvent(t,n));var i=this.getHireDate().replace(/\'/g,""),r=new Do(t,i);this.lookupParametersService.lookupRequestPost(r.getToFilter(),"hcm/payroll/queries/workstationgroupFilterQuery",Y(this.concatFieldsName),"name").pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){n?e.searchGridData=t&&Y(t.contents):e.lookupSuggestions=t&&Y(t.contents),e.totalRecords=t&&t.totalPages}))},o.prototype.getValueEvent=function(t,e){return e?t.filterData.headoffice=this.currentCompanyId:t={filterData:{headoffice:this.currentCompanyId,searchText:t}},t},o.prototype.getAutocompleteQuery=function(t,e){var o=this;this.autocompleteParametersService.getAutoCompleteQuery(t,e).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){"autocompleteDepartmentQuery"===t?e.filter((function(t){t.fields&&t.fields[0]&&(t.name=t.fields[1].value+" - "+t.fields[0].value)})):"autocompleteJobpositionQuery"===t?e.filter((function(t){t.fields&&t.fields[0]&&t.fields[1]&&(t.name=t.fields[0].value+" - "+t.fields[1].value)})):"autocompleteManager"===t&&e.map((function(t){t.manager=t.fields[0].value?t.fields[0].value:t.fields[3].value})),o.suggestionsObservable.next(e)}))},o.prototype.getAutocomplete=function(e,o,n,i,r,a,l){var p=this;void 0===r&&(r=null),void 0===a&&(a=!1),void 0===l&&(l=t.ServiceType.PAYROLL),this.autocompleteParametersService.getAutoComplete(e,R({},r,{searchValue:R({},o)}),this.searchFields,a,l).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){"workshiftGroup"===e&&t.filter((function(t){if(t.baseDate){var e=To(t.baseDate,"YYYY-MM-DD");if(e.isValid())return t.baseDate=e.format(p.dateFormat)}})),p.suggestionsObservable.next(p.getConcatFields(t,n,i))}))},o.prototype.getConcatFields=function(t,e,o){return o&&e&&t.filter((function(t){t[o]=t[e]+" - "+t[o]})),t},o.prototype.getHireDate=function(){var t=To(this.hireDate).format(this.dateFormat);return t?"'"+ee(t,this.dateFormat)+"'":"'"+ne()+"'"},o.ctorParameters=function(){return[{type:a.TranslateService},{type:e.ChangeDetectorRef},{type:ko},{type:Co}]},N([e.ViewChild("workstationgroupEl",{static:!1})],o.prototype,"workstationgroupEl",void 0),N([e.Input()],o.prototype,"currentCompanyId",void 0),N([e.Input()],o.prototype,"currentCompanyName",void 0),N([e.Input()],o.prototype,"hireDate",void 0),N([e.Input()],o.prototype,"dateFormat",void 0),N([e.Input()],o.prototype,"required",void 0),N([e.Input()],o.prototype,"disabled",void 0),N([e.Input()],o.prototype,"form",void 0),N([e.Input()],o.prototype,"name",void 0),N([e.Output()],o.prototype,"onSelect",void 0),N([e.Output()],o.prototype,"onClear",void 0),N([e.Output()],o.prototype,"onBlur",void 0),o=N([e.Component({selector:"c-workstationgroup-lookup",template:'<div [formGroup]="form">\n <s-lookup\n #workstationgroupEl\n id="workstationGroup"\n dataKey="code"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n [formControlName]="name"\n (onLookupRequest)="searchRequest($event)"\n (onSearchRequest)="searchRequest($event)"\n filterTitle="{{ \'hcm.payroll.filters\' | translate }}"\n filterLabel="{{ \'hcm.payroll.filter\' | translate }}"\n clearLabel="{{ \'hcm.payroll.lookup_generic_clean_filter_label\' | translate }}"\n cancelLabel="{{ \'hcm.payroll.cancel\' | translate }}"\n selectLabel="{{ \'hcm.payroll.lookup_btn_select_label\' | translate }}"\n [disabled]="disabled"\n [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{ \'hcm.payroll.lookup_auto_complete_empty_message\' | translate }}"\n [searchGridData]="searchGridData"\n [searchFields]="searchFields"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n [searchTotalRecords]="totalRecords"\n searchTotalRecordsLabel="{{ totalRecords }} {{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [searchGridFields]="gridFields"\n searchTitle="{{ \'hcm.payroll.employees_addition_workstation\' | translate }}"\n lookupDisplayField="name"\n ></s-lookup>\n\n</div>\n'})],o)}(),Fo=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,h.DynamicFormModule,o.ReactiveFormsModule,p.CommonModule,a.TranslateModule],declarations:[Eo],exports:[Eo],providers:[ko,Co]})],t)}(),Ao=function(){function n(o,n,i,r,a){var s=this;this.confirmationService=o,this.translateService=n,this.activatedRoute=i,this.cd=r,this.formBuilder=a,this.recordByRow=1,this.showDateWhen=!1,this.isEditMode=!1,this.isViewMode=!1,this.withSideBar=!0,this.visibleChange=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.orderBy={field:"displayDateWhen",direction:t.DirectionEnumeration.DESC},this.bankAccountItemInput={},this.totalRecords=0,this.actionLabel=this.translateService.instant("hcm.payroll.entries_query_actions_total_title"),this.loading=!0,this.listData=[],this.listDataNoPage=[],this.cols=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"displayDateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account_type"),field:"accountType"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_digit"),field:"digit"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"}],this.actions=function(t,e){return void 0===t&&(t={}),[{visible:s.isEditMode,label:s.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){t.index=e,s.bankAccountItemInput={currentItem:t,listData:s.listDataNoPage,isEditMode:!1},s.visible=!0}},{visible:!(s.isEditMode||!s.withSideBar),label:s.translateService.instant("hcm.payroll.edit"),command:function(){t.index=e,s.bankAccountItemInput={currentItem:t,listData:s.listDataNoPage,isEditMode:!0},s.visible=!0}},{visible:!s.isEditMode,label:s.translateService.instant("hcm.payroll.delete"),command:function(){s.loading=!0,s.deleteAnnuityItem(e)}}]},this.createFormGroup()}return n.prototype.ngOnInit=function(){this.formGroup.setControl(this.fieldFormGroup,this.historicalBankAccountList)},n.prototype.createFormGroup=function(){this.historicalBankAccountList=this.formBuilder.group({historicalBankAccountList:this.formBuilder.control(null)})},n.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},n.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},n.prototype.onLazyLoad=function(e){var o=this,n=e&&e.first?e.first:0,i=e&&e.rows?e.rows:this.recordByRow,r=this.getHistoricalBankAccountList();this.listData=[],this.totalRecords=null,e&&e.multiSortMeta&&e.multiSortMeta.length&&e.multiSortMeta.map((function(e){o.orderBy.field=e.field,o.orderBy.direction=1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})),r&&r.length?(this.totalRecords=r.length,this.listData=r,this.listDataNoPage=Y(r),this.listData.sort(me(this.orderBy.field,this.orderBy.direction)),this.listData=this.listData.slice(n,n+i)):this.listDataNoPage=[],(this.isEditMode||r&&1===r.length)&&this.refreshCssInIE11(),this.loading=!1},n.prototype.refreshCssInIE11=function(){/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&setTimeout((function(){var t=document.getElementsByClassName("row0");t&&t[0]&&(t[0].className="refresh")}),1)},n.prototype.add=function(){this.bankAccountItemInput={},this.visible=!0},n.prototype.deleteAnnuityItem=function(t){var e=Y(this.getHistoricalBankAccountList());e.sort(me(this.orderBy.field,this.orderBy.direction)),delete e[t],e=e.filter((function(t){return t})),this.historicalBankAccountList.get("historicalBankAccountList").setValue(e),this.verifyTotalPercentage(),this.onLazyLoad()},n.prototype.getHistoricalBankAccountList=function(){return this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value&&this.historicalBankAccountList.get("historicalBankAccountList").value.length?this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value:[]},n.prototype.addItemInList=function(t){var e=t&&t.index>=0?t.index:null,o=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[];if(null!=e)o[e]=t,delete t.index;else{if(Jt(t.customFields)&&Object.keys(t.customFields).length){var n=ae(t.customFields);t.customFields=Y(n)}t.dateWhen=this.dateWhen,o.push(t)}this.historicalBankAccountList.get("historicalBankAccountList").setValue(o),this.verifyTotalPercentage(),this.onLazyLoad({first:this.getNumberPageByIndex(e,o)})},n.prototype.getNumberPageByIndex=function(t,e){if(t){var o=e.length,n=this.recordByRow-1;return Math.ceil(o/this.recordByRow)*this.recordByRow-n-1}return null},n.prototype.verifyTotalPercentage=function(){var t=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[],e=[];if(!t.length)return this.msgTotalLimitByPercentage=null;t.filter((function(t){return e.push(t&&t.percentage)}));var o=e.reduce((function(t,e){return t+e}),0);this.msgTotalLimitByPercentage=100===o?this.translateService.instant("hcm.payroll.historical_bank_account_msg_limit_total_by_percentage"):null},Object.defineProperty(n.prototype,"scopedActions",{get:function(){return this.actions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.translateService.instant("hcm.payroll.admission_register"):this.translateService.instant("hcm.payroll.admission_registers"))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"getTooltipAndDisableButtonAdd",{get:function(){return this.dateWhen?null:this.msgTooltipAdd},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dateWhen",{get:function(){return this._dateWhen},set:function(t){var e=this;this._dateWhen=t,this._dateWhen&&this.listData.filter((function(t){return t.dateWhen=e._dateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayDateWhen",{get:function(){return this._displayDateWhen},set:function(t){var e=this;this._displayDateWhen=t,this._displayDateWhen&&this.listData.filter((function(t){return t.displayDateWhen=e._displayDateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"addListData",{set:function(t){this.loading=!0,this.historicalBankAccountList.get("historicalBankAccountList").patchValue(t),this.verifyTotalPercentage(),this.onLazyLoad()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),n.prototype.close=function(){this.visible=!1},n.ctorParameters=function(){return[{type:I.ConfirmationService},{type:a.TranslateService},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef},{type:o.FormBuilder}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],n.prototype,"customFields",void 0),N([e.Input()],n.prototype,"formGroup",void 0),N([e.Input()],n.prototype,"fieldFormGroup",void 0),N([e.Input()],n.prototype,"_dateWhen",void 0),N([e.Input()],n.prototype,"_displayDateWhen",void 0),N([e.Input()],n.prototype,"recordByRow",void 0),N([e.Input()],n.prototype,"showDateWhen",void 0),N([e.Input()],n.prototype,"msgTooltipAdd",void 0),N([e.Input()],n.prototype,"isEditMode",void 0),N([e.Input()],n.prototype,"isViewMode",void 0),N([e.Input()],n.prototype,"currency",void 0),N([e.Input()],n.prototype,"customEntity",void 0),N([e.Input()],n.prototype,"customService",void 0),N([e.Input()],n.prototype,"withSideBar",void 0),N([e.Input()],n.prototype,"dateWhen",null),N([e.Input()],n.prototype,"displayDateWhen",null),N([e.Input()],n.prototype,"addListData",null),N([e.Input()],n.prototype,"visible",null),n=N([e.Component({selector:"c-historical-bank-account",template:'<s-sidebar *ngIf="withSideBar" [visible]="visible" (visibleChange)="close()"\n header="{{\'hcm.payroll.historical_bank_account_title_form\'|translate}}">\n<bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</s-sidebar>\n\n<div *ngIf="!withSideBar">\n <bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n [withSideBar]="false"\n [isViewMode]="isViewMode"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</div>\n\n<div class="ui-g-1" *ngIf="withSideBar && !isEditMode">\n <div class="form-group ">\n <s-button id="ta-addPayAnnuity"\n [disabled]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n (onClick)="add()"\n [pTooltip]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n tooltipPosition="top"\n label="{{\'hcm.payroll.historical_bank_account_add\'|translate}}"></s-button>\n </div>\n</div>\n<div class="ui-g-12">\n <p-table\n id="table-annuity"\n [value]="listData"\n [columns]="cols"\n (onLazyLoad)="onLazyLoad($event)"\n [lazy]="true"\n [scrollable]="true"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [sortMode]="\'multiple\'"\n *sLoadingState="loading"\n [rows]="recordByRow"\n dataKey="id">\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col [ngClass]="\'col-default-s\'" *ngIf="showDateWhen">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-m\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-s\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-action\'">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th\n *ngIf="showDateWhen"\n [pSortableColumn]="\'displayDateWhen\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header" id="table-0">\n <span\n id="table-annuity-s-0">{{ \'hcm.payroll.historical_bank_account_label_date_when\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bank\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankBranch\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank_branch\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'accountType\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account_type\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankAccount\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'digit\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_digit\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'percentage\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"></p-sortIcon>\n </div>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n\n <tr [ngClass]="\'row\'+key" [pSelectableRow]="rowData">\n <td *ngIf="showDateWhen" [pTooltip]="rowData?.displayDateWhen" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.displayDateWhen }}</span>\n </td>\n <td [pTooltip]="rowData?.bank?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bank?.name }}</span>\n </td>\n <td [pTooltip]="rowData?.bankBranch?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankBranch?.name }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.accountType?.value" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.accountType?.value }}</span>\n </td>\n <td [pTooltip]="rowData?.bankAccount" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankAccount }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.digit" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.digit }}</span>\n </td>\n <td [pTooltip]="rowData?.percentage" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.percentage }}</span>\n </td>\n <td id="col-actions-{{key}}" class="col-actions "\n *ngIf="actions && actions(rowData, key)?.length">\n <s-button id="table-admission-btn-actions-{{key}}"\n *ngIf="actions(rowData, key).length > 1" [label]="actionLabel"\n priority="default" [model]="scopedActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="table-admission-btn-action-{{key}}"\n *ngIf="actions(rowData, key).length <= 1"\n [label]="scopedActions(rowData, key)[0].label"\n priority="default"\n (click)="scopedActions(rowData, key)[0].command()"\n [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td [attr.colspan]="columns.length +2">\n {{\'hcm.payroll.admission_empty_message\'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span *ngIf="totalRecords">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],n)}(),Po=function(){function t(t,n,i,r){this.translate=t,this.formBuilder=n,this.route=i,this.cd=r,this.withSideBar=!0,this.isEditMode=!1,this.visibleChange=new e.EventEmitter,this.bankAccountItemToList=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.initialValidatorOfPercentage=[o.Validators.required,o.Validators.min(.01)],this.initialValidatorOfBankAccount=[o.Validators.required,o.Validators.maxLength(12)],this.labelBtnAdd="hcm.payroll.employees_add",this.maxValuePercentage=100,this.visibleBtnSave=!0,this.isView=!1,this.createFormGroup(),this.registerSubjects()}return t.prototype.validateDuplicateBankAccount=function(t,e,o,n){return function(i){var r=i&&i.value,a=!1;return t.filter((function(t,i){if(i!=t.index&&r&&t.bank&&t.bank.tableId===o&&t.bankBranch&&t.bankBranch.tableId===n&&t.accountType&&t.accountType.key===e&&Number(t.bankAccount)===Number(r))return a=!0})),a?{bankAccountDuplicate:!0}:null}},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.unsubscribe()},t.prototype.registerSubjects=function(){},t.prototype.createFormGroup=function(){this.bankAccountFormGroup=this.formBuilder.group({id:this.formBuilder.control(null),index:this.formBuilder.control(null),employee:this.formBuilder.control({value:{tableId:null},disabled:!0}),dateWhen:this.formBuilder.control(null),displayDateWhen:this.formBuilder.control(null),bank:this.formBuilder.control(null,o.Validators.required),bankBranch:this.formBuilder.control(null,o.Validators.required),accountType:this.formBuilder.control(null,o.Validators.required),bankAccount:this.formBuilder.control(null,o.Validators.compose(Y(this.initialValidatorOfBankAccount))),digit:this.formBuilder.control(null,o.Validators.maxLength(3)),percentage:this.formBuilder.control(null,o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),customFields:this.formBuilder.control(null)})},t.prototype.onSelectBank=function(){this.cleanBankInformation(),this.beforeSetBankAccountValidator()},t.prototype.onClearBank=function(){this.bankAccountFormGroup.get("bank").reset(),this.cleanBankInformation(),this.beforeSetBankAccountValidator()},t.prototype.cleanBankInformation=function(){he(this.bankAccountFormGroup,["bankBranch"])},t.prototype.onClearBankBranch=function(){this.bankAccountFormGroup.get("bankBranch").reset(),this.beforeSetBankAccountValidator()},t.prototype.onClearAccountType=function(){this.bankAccountFormGroup.get("accountType").reset(),this.beforeSetBankAccountValidator()},Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEditAndViewValue",{set:function(t){this.resetForm(),this.visibleBtnSave=!0,t&&t.currentItem&&Object.keys(t.currentItem).length?(this.bankAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(R({},t.currentItem))),this.labelBtnAdd="hcm.payroll.employees_update",this.setValidatorsAccordingList(t.listData,t.currentItem.index),this.isView||this.configEnableFields(t&&t.isEditMode)):this.labelBtnAdd="hcm.payroll.employees_add"},enumerable:!0,configurable:!0}),t.prototype.convertDTOToShowWithCustomFields=function(t){var e=R({},t);return e.customFields=se(e.customFields),e},t.prototype.configEnableFields=function(t){this.visibleBtnSave=t,ce(this.bankAccountFormGroup,t,["bank","bankBranch","accountType","bankAccount","digit","percentage","customFields"],[])},t.prototype.close=function(){this.resetForm(),this.visible=!1},t.prototype.addItem=function(){this.bankAccountFormGroup.updateValueAndValidity(),le.call(this.bankAccountFormGroup),this.bankAccountFormGroup.valid&&(this.employeeId&&this.bankAccountFormGroup.get("employee").setValue({tableId:this.employeeId,name:""}),this.bankAccountItemToList.emit(this.bankAccountFormGroup.getRawValue()),this.visible=!1,this.resetForm())},t.prototype.resetForm=function(){this.bankAccountFormGroup.reset(),this.labelBtnAdd="hcm.payroll.employees_add",this.customFields&&this.customFields.formGroup&&this.customFields.formGroup.reset()},t.prototype.getBankTableId=function(){return this.bankAccountFormGroup.controls.bank.value?"'"+this.bankAccountFormGroup.controls.bank.value.tableId+"'":null},Object.defineProperty(t.prototype,"percentagePlaceholder",{get:function(){return"0"+(this.currency&&this.currency.decimalSeparator)+"00"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optionsPercentage",{get:function(){return R({},this.getOptions(),{precision:2})},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return{prefix:"",thousands:this.currency.thousandsSeparator,decimal:this.currency.decimalSeparator}},Object.defineProperty(t.prototype,"getListBankAccount",{set:function(t){t?this.setValidatorsAccordingList(t):this.resetForm()},enumerable:!0,configurable:!0}),t.prototype.setValidatorsAccordingList=function(t,e){void 0===e&&(e=null),this.bankAccountList=t&&t.length?Y(t):[];var o=[];this.bankAccountList&&this.bankAccountList.length&&this.bankAccountList.filter((function(t,n){t.percentage&&n!=e&&o.push(t.percentage)})),this.beforeSetBankAccountValidator(),this.validatePercentageValid(o)},t.prototype.beforeSetBankAccountValidator=function(){var t=this.bankAccountFormGroup.get("bankAccount"),e=this.bankAccountFormGroup.get("accountType")&&this.bankAccountFormGroup.get("accountType").value&&this.bankAccountFormGroup.get("accountType").value.key,n=this.bankAccountFormGroup.get("bank")&&this.bankAccountFormGroup.get("bank").value&&this.bankAccountFormGroup.get("bank").value.tableId,i=this.bankAccountFormGroup.get("bankBranch")&&this.bankAccountFormGroup.get("bankBranch").value&&this.bankAccountFormGroup.get("bankBranch").value.tableId;n&&i&&e&&this.bankAccountList&&this.bankAccountList.length?(t.setValidators(o.Validators.compose(Y(this.initialValidatorOfBankAccount,[this.validateDuplicateBankAccount(this.bankAccountList,e,n,i)]))),t.updateValueAndValidity()):t.setValidators(o.Validators.compose(Y(this.initialValidatorOfBankAccount)))},t.prototype.validatePercentageValid=function(t){var e=this.bankAccountFormGroup.get("percentage");this.maxValuePercentage=t.reduce((function(t,e){return t-e}),100),e.setValidators(o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),e.updateValueAndValidity()},Object.defineProperty(t.prototype,"isViewMode",{set:function(t){this.isView=!(!t||this.withSideBar),this.configEnableFields(!this.isView),this.isView||this.resetForm()},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:a.TranslateService},{type:o.FormBuilder},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!0})],t.prototype,"customFields",void 0),N([e.Input()],t.prototype,"currency",void 0),N([e.Input()],t.prototype,"customEntity",void 0),N([e.Input()],t.prototype,"customService",void 0),N([e.Input()],t.prototype,"withSideBar",void 0),N([e.Input()],t.prototype,"isEditMode",void 0),N([e.Output()],t.prototype,"visibleChange",void 0),N([e.Output()],t.prototype,"bankAccountItemToList",void 0),N([e.Input()],t.prototype,"visible",null),N([e.Input()],t.prototype,"isEditAndViewValue",null),N([e.Input()],t.prototype,"getListBankAccount",null),N([e.Input()],t.prototype,"isViewMode",null),t=N([e.Component({selector:"bank-account",template:'<div id="main">\n <form [formGroup]="bankAccountFormGroup" autocomplete="off">\n <div class="ui-fluid">\n <div class="ui-g">\n \x3c!-- Banco --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank\' | translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="Bank"\n [order]="[\'BankCode\',\'BankNameI18n\']"\n [fields]="[\'BankCode\',\'BankNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankCode" keyName="BankNameI18n"\n itemSelect="bank" name="bank"\n [form]="bankAccountFormGroup"\n (onSelect)="onSelectBank()"\n (onClear)="onClearBank()"\n id="ta-bankName"></input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bank\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Agência--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank_branch\'|translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="BankBranch"\n [order]="[\'BankBranchCode\']"\n [fields]="[\'BankBranchCode\',\'BankBranchNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankBranchCode" keyName="BankBranchNameI18n"\n itemSelect="bankBranch" name="bankBranch"\n [conditions]="[{ \'fields\': [\'BankBranchBank\'], \'expression\' : \'EQUAL\', \'value\': getBankTableId() }]"\n [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-bankBranch">\n </input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankBranch\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!-- Tipo conta --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.employees_addition_account_type\'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]="true" server="payroll"\n enumeration="AccountType"\n placeholder="{{\'hcm.payroll.select\' | translate}}"\n name="accountType" [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-accountType"></input-rest-auto-complete-enum>\n <s-control-errors [control]="bankAccountFormGroup.get(\'accountType\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Número conta--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_account_form\' |\n translate}}</label>\n <input pInputText id="ta-bankAccount" name="bankAccount" only-number\n formControlName="bankAccount"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankAccount\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n bankAccountDuplicate: \'hcm.payroll.historical_bank_account_label_bank_account_duplicate\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'12\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12">\n <label>{{\'hcm.payroll.historical_bank_account_label_digit\'|translate}}</label>\n \x3c!--Dígito--\x3e\n <input pInputText id="ta-digit" name="digit" only-number formControlName="digit"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'digit\')"\n [errorMessages]="{ maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'3\' } }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12 required">\n <label id="lb-percentage"\n for="ff-percentage">{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input pInputText id="ff-percentage" name="percentage"\n formControlName="percentage"\n currencyMask\n [options]="optionsPercentage"\n [placeholder]="percentagePlaceholder"/>\n </div>\n <s-control-errors [control]="bankAccountFormGroup.get(\'percentage\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'6\' },\n max: \'hcm.payroll.error_max_value_number\' | translate: { value: maxValuePercentage },\n min: \'hcm.payroll.error_min_value_number\' | translate: { value: \'0,01\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12">\n <p-fieldset\n legend="{{ \'hcm.payroll.custom_fields\' | translate }}"\n [attr.data-hidden]="!customFields || !customFields.fields.length"\n >\n <s-custom-fields\n domain="hcm"\n service="{{customService}}"\n entity="{{customEntity}}"\n formControlName="customFields"\n [invalidErrorLabel]="\'hcm.payroll.employees_invalid_field\' | translate"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]="withSideBar ? \'footer\' : \'footer-s-border\'">\n <div class="form-group">\n <s-button id="btn-save" label="{{ labelBtnAdd | translate}}" priority="primary"\n (onClick)="addItem()" *ngIf="visibleBtnSave && !this.isView"></s-button>\n <s-button *ngIf="withSideBar" id="btn-close" label="{{\'hcm.payroll.cancel\'|translate}}" priority="secondary"\n priority="link" (onClick)="close()"></s-button>\n </div>\n </div>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],t)}(),xo=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),Mo=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,h.SidebarModule,bt,h.ControlErrorsModule,Ee,M.CurrencyMaskModule,ve,d.InputTextModule,St,L.FieldsetModule,h.CustomFieldsModule,O.PanelModule],declarations:[Ao,Po],providers:[xo,I.ConfirmationService],exports:[Ao]})],t)}(),Lo=function(){function o(t,e){this.http=t,this.httpClient=e}return o.prototype.remove=function(e,o,n,i){return void 0===n&&(n=t.ServiceType.PAYROLL),n===t.ServiceType.DEPENDENT?this.httpClient.post("hcm/dependent/queries/historicalJudicialPensionBankAccountDelete",{dependentId:i,dateWhen:o}):this.http.post("actions/historicalEmployeeBankAccountDelete",{employeeId:e,dateWhen:o})},o.ctorParameters=function(){return[{type:Nt},{type:v.HttpClient}]},o=N([e.Injectable()],o)}(),Oo=y,Bo=function(){function o(t,o,n,i,r,a,s){this.confirmationService=t,this.translateService=o,this.activatedRoute=n,this.cd=i,this.router=r,this.messageService=a,this.historicalBankAccountListService=s,this.endPoint="hcm/payroll/queries/historicalEmployeeBankAccountQuery",this.keyPayload="historicalEmployeeBankAccount",this.withSidebar=!0,this.enableView=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.loading=!0,this.columns=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"dateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_qtd_account"),field:"numberOfBankAccount"}]}return o.prototype.ngOnInit=function(){this.initParameters={employeeId:this.employeeId,dependentId:this.dependentId}},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},o.prototype.onLazyLoad=function(t){var e=this;t.forEach((function(t){t.dateWhen=Oo(t.dateWhen).format(e.dateFormat)})),this.onGridLoad(t),this.loading=!1},o.prototype.getMenuActions=function(t){var e=this;return[{label:this.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){var o=t&&t.dateWhen&&Oo(t.dateWhen,e.dateFormat).format("YYYY-MM-DD");e.withSidebar?e.router.navigate(["historical-bank-account/"+o],{relativeTo:e.activatedRoute}):e.enableView.emit(o)}},{label:this.translateService.instant("hcm.payroll.delete"),command:function(){e.isAllowToDeleteHistorical&&t?e.delete(t.id,t.dateWhen):e.messageService.add({severity:"error",summary:e.translateService.instant("hcm.payroll.error"),detail:e.translateService.instant("hcm.payroll.permission_error_not_allowed")})}}]},o.prototype.delete=function(e,o){var n=this;if(e===this.lastRecord.id){var i=Oo(o,this.dateFormat).format("YYYY-MM-DD");this.confirmationService.confirm({message:this.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_question_confirm_delete")+"?",accept:function(){n.loading=!0;var e=n.withSidebar?t.ServiceType.PAYROLL:t.ServiceType.DEPENDENT;n.historicalBankAccountListService.remove(n.employeeId,i,e,n.dependentId).pipe(s.takeUntil(n.ngUnsubscribe)).subscribe((function(){n.messageService.add({severity:"success",summary:n.translateService.instant("hcm.payroll.success"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_remove")}),n.parameters=n.parameters&&R({},n.parameters)||{}}),(function(){n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_error_remove")}),n.loading=!1}))}})}else this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.not_allowed_delete_last")})},o.prototype.add=function(){this.isAllowToAddHistorical?this.router.navigate(["historical-irrf-new"],{relativeTo:this.activatedRoute}):this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},o.prototype.onGridLoad=function(t){t&&t.length&&(this.lastRecord=t[0])},Object.defineProperty(o.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"scopedActions",{get:function(){return this.getMenuActions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"reloadList",{set:function(t){t&&(this.loading=!0,this.parameters=this.parameters&&R({},this.parameters)||{})},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:I.ConfirmationService},{type:a.TranslateService},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef},{type:r.Router},{type:I.MessageService},{type:Lo}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],o.prototype,"customFields",void 0),N([e.Input()],o.prototype,"permission",void 0),N([e.Input()],o.prototype,"employeeId",void 0),N([e.Input()],o.prototype,"dependentId",void 0),N([e.Input()],o.prototype,"dateFormat",void 0),N([e.Input()],o.prototype,"endPoint",void 0),N([e.Input()],o.prototype,"keyPayload",void 0),N([e.Input()],o.prototype,"withSidebar",void 0),N([e.Output()],o.prototype,"enableView",void 0),N([e.Input()],o.prototype,"reloadList",null),o=N([e.Component({selector:"c-historical-bank-account-list",template:'<div class="ui-g">\n <div class="ui-g-12">\n <c-data-list-rest\n id="ta-irrf"\n [columns]="columns"\n actionLabel="{{ \'hcm.payroll.movimentation_generic_action\' | translate }}"\n emptyMessage="{{ \'hcm.payroll.admission_empty_message\' | translate }}"\n [endpoint]="endPoint"\n singularMessageRecords="{{\n \'hcm.payroll.admission_register\' | translate\n }}"\n [actions]="scopedActions"\n pluralMessageRecords="{{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [keyPayload]="keyPayload"\n [lazy]="true"\n (lazyLoad)="onLazyLoad($event)"\n [(loading)]="loading"\n [initParameters]="initParameters"\n [parameters]="parameters"\n [isSortable]="false"\n ></c-data-list-rest>\n </div>\n</div>\n\n',styles:[""]})],o)}(),Ro=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,Ct,B.ConfirmDialogModule],declarations:[Bo],providers:[Lo],exports:[Bo]})],t)}(),No=function(){function e(t){this.field=t.field,this.value=t.value,this.operation=t.operation}return Object.defineProperty(e.prototype,"field",{get:function(){return this._field},set:function(t){this._field=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operation",{get:function(){return this._operation},set:function(t){this._operation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.operation===t.Operators.CONTAINING?this.operation+"(lower("+this.field+"), lower("+this.value+"))":this.field+" "+(this.operation||"")+" "+this.value},e}(),Vo=y,jo=Vo("31/12/1900","DD/MM/YYYY"),qo=Vo("04/06/2080","DD/MM/YYYY"),Uo=function(){function e(){}return e.isValidDate=function(t,e){return function(o){var n=!e||!e.hasOwnProperty("useG5DateRange")||e.useG5DateRange,i=fe(o.value);if(t=fe(t),i&&t&&i.length===t.length&&!o.value.includes("_")){var r=Vo(i,t),a=r.isValid(),s=!n||r.isBetween(jo,qo,null,"[]");return a&&s?null:{invalidDate:!0}}return null}},e.isDateLower=function(e,o,n){void 0===n&&(n="day");var i={compareName:"lowerDate",granularity:n};return this.isValidDateCompare(e,o,t.CompareType.isBefore,i)},e.isValidDateCompare=function(t,e,o,n){var i=this;return function(r){var a=fe(r.value);if(e=fe(e),a&&e&&a.length===e.length&&!r.value.includes("_")){var s=Vo(a,e),l=Vo(t,e);return i.dateCompare(s,l,o,n)}return null}},e.getDateFormatFromLocale=function(t,e){var o=t&&t.dateFormat;if(o){var n=o.replace(/[y]/g,"YY").replace(/[^a-zA-Z]/g,"").toUpperCase();return e&&(n=n.replace("DD","")),n}return null},e.getDateTimeFormatFromLocale=function(t){if(t){var e=t.dateFormat.toString();return e=e.replace(/[y]/g,"YY").toUpperCase(),e+=" HH:mm:ss"}return null},e.getDateFormatFromCalendar=function(t){if(t&&t.dateFormat){var e=t.dateFormat.toString();return e=e.replace(/[y]/g,"YY").toUpperCase()}return null},e.dateCompare=function(e,o,n,i){var r=n===t.CompareType.isNotSame?t.CompareType.isSame:n,a=i&&i.granularity?i.granularity:"day",s=e[r](o,a);if(s=n===t.CompareType.isNotSame?!s:s){var l={};return l[i&&i.compareName?i.compareName:n]=!0,l}return null},e.getFormatDateWithBar=function(t){if(t&&t.dateFormat){var e=t.dateFormat.toString();return e=e.replace("dd","DD").replace("mm","MM").replace("yy","YYYY")}return null},e}(),Yo=function(){function t(){this._processVariables={},this._workflowPayload={},this.processInstanceId=new f.BehaviorSubject(null),this.resetActions()}return t.prototype.init=function(){var t=this;this.workflowCockpit=workflowCockpit({init:function(e,o){return V(t,void 0,void 0,(function(){var t,n,i;return j(this,(function(r){switch(r.label){case 0:return this._isRequestNew=o&&o.isRequestNew(),t=this,(n=o)?[4,o.getTaskData()]:[3,2];case 1:n=r.sent(),r.label=2;case 2:return t._taskData=n,this._isRequestNew?[3,4]:[4,o.getInfoFromProcessVariables()];case 3:i=r.sent(),this.addProcessVariable("processVariablesFromWorkflow",i),r.label=4;case 4:return this.processInstanceId.next(e.processInstanceId),[4,this._onLoadWorkflow(e,o)];case 5:return[2,r.sent()]}}))}))},onSubmit:function(e,o){return V(t,void 0,void 0,(function(){var t,n;return j(this,(function(i){switch(i.label){case 0:return t=this,(n=e)?[4,e.nextAction]:[3,2];case 1:n=i.sent(),i.label=2;case 2:return t._nextAction=n,this._isFinishing=this._nextAction.finish,this._nextActionName=this._nextAction.name,[4,this._onSubmitWorkflow(e,o)];case 3:return i.sent(),[2,this._workflowPayload]}}))}))},onError:function(e,o){return V(t,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._onRollbackWorkflow(e,o)];case 1:return t.sent(),[2]}}))}))}})},t.prototype._onLoadWorkflow=function(t,e){return V(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._runActions(this.onLoadActions)];case 1:return[2,t.sent()]}}))}))},t.prototype._onSubmitWorkflow=function(t,e){return V(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._runActions(this.onSubmitActions)];case 1:return[2,t.sent()]}}))}))},t.prototype._onRollbackWorkflow=function(t,e){return V(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._runActions(this.onRollbackActions)];case 1:return[2,t.sent()]}}))}))},t.prototype.resetActions=function(){this.onLoadActions={},this.onSubmitActions={},this.onRollbackActions={}},t.prototype._runActions=function(t){return V(this,void 0,void 0,(function(){var e,o=this;return j(this,(function(n){switch(n.label){case 0:return e={},[4,Promise.all(Object.entries(t).map((function(t){var n=U(t,2),i=n[0],r=n[1];return V(o,void 0,void 0,(function(){var t,o,n;return j(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=e,o=i,[4,r()];case 1:return t[o]=a.sent(),[2];case 2:throw n=a.sent(),Error(n);case 3:return[2]}}))}))})))];case 1:return n.sent(),[2,e]}}))}))},t.prototype.addOnLoadAction=function(t,e){this.onLoadActions[t]=e},t.prototype.addOnSubmitAction=function(t,e){this.onSubmitActions[t]=e},t.prototype.addOnRollbackAction=function(t,e){this.onRollbackActions[t]=e},t.prototype.addProcessVariable=function(t,e){try{this._processVariables[t]=e}catch(e){throw{erro:e,message:"Não foi possível adicionar a variável "+t+" às variáveis do processo."}}},t.prototype.setWorkflowPayload=function(t){this._workflowPayload=t},Object.defineProperty(t.prototype,"loadActions",{get:function(){return this.onLoadActions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"submitActions",{get:function(){return this.onSubmitActions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rollbackActions",{get:function(){return this.onRollbackActions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRequestNew",{get:function(){return this._isRequestNew},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFinishing",{get:function(){return this._isFinishing},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextActionName",{get:function(){return this._nextActionName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"taskData",{get:function(){return this._taskData},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"processVariables",{get:function(){var t=this;return new Promise((function(e,o){t._processVariables?e(t._processVariables):o("Não foram encontradas variáveis para o processo")})).then((function(e){t._processVariables=e})).catch((function(t){throw t})),this._processVariables},enumerable:!0,configurable:!0}),t=N([e.Injectable()],t)}(),Go=function(){function t(t,e,o){this.router=t,this.activatedRoute=e,this.workflowDataService=o,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){this.registerSubscribers()},t.prototype.registerSubscribers=function(){var t=this;this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.useWorkflow=!(!e||!e.useWorkflow),t.routeEndpoint=e&&e.routeEndpoint,t.useWorkflow&&t.workflowDataService.setUseWorkflow(t.useWorkflow)}))},t.prototype.onSelectEmployee=function(){var t=this.employeeSelected.tableId;t&&this.navigate(t)},t.prototype.navigate=function(t){this.router.navigate(["workflow/"+t+"/"+this._routeEndpoint])},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},Object.defineProperty(t.prototype,"useWorkflow",{get:function(){return this._useWorkflow},set:function(t){this._useWorkflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"routeEndpoint",{get:function(){return this._routeEndpoint},set:function(t){this._routeEndpoint=t},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:r.Router},{type:r.ActivatedRoute},{type:lo}]},t=N([e.Component({selector:"lib-employee-selector",template:'<p-panel header="{{ \'hcm.payroll.employee_selector_panel_header\' | translate }}">\n <div class="ui-g ui-fluid">\n <div class="ui-md-6 ui-g-6">\n <label for="ff-employee" id="lb-employee">{{\n "hcm.payroll.employee" | translate\n }}</label>\n <input-rest-auto-complete-employee-model\n id="ff-employee"\n [dropdown]="true"\n placeholder="{{\n \'hcm.payroll.employees_company_placeholder\' | translate\n }}"\n name="employee"\n emptyMessage="{{ \'hcm.payroll.not_suggestions\'|translate }}"\n [(model)]="employeeSelected"\n (onSelect)="onSelectEmployee()"\n >\n </input-rest-auto-complete-employee-model>\n </div>\n </div>\n</p-panel>\n',styles:[""]})],t)}(),Ho=function(){function t(){}return t=N([e.NgModule({imports:[ut,O.PanelModule,Ce],declarations:[Go],exports:[Go]})],t)}(),Ko=function(){function t(){}return N([e.Input()],t.prototype,"divergentFormData",void 0),t=N([e.Component({selector:"from-to",template:'<div id="from-to" class="ui-g ui-fluid" *ngIf="divergentFormData">\n <div class="ui-g-12">\n \x3c!-- Painel Collapsable --\x3e\n <p-panel\n class="ui-g-12 ui-fluid form-group"\n header="{{ \'hcm.payroll.disagreements\' | translate }}"\n [toggleable]="true"\n [collapsed]="false"\n >\n <section id="from-to-content" class="ui-g ui-fluid form-group">\n \x3c!-- INICIO DE SEÇÃO: DE (ANTES): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.from\' | translate }}">\n <section id="from-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-from">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-from"\n id="{{divergence.key}}-from"\n value="{{ divergence.oldValue }}"\n />\n\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: DE (ANTES): --\x3e\n\n \x3c!-- INICIO DE SEÇÃO: PARA (DEPOIS): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.to\' | translate }}">\n <section id="to-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-to">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-to"\n id="{{divergence.key}}-to"\n value="{{ divergence.newValue }}"\n />\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: PARA (DEPOIS): --\x3e\n </section>\n </p-panel>\n </div>\n</div>\n'})],t)}(),Wo=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,O.PanelModule,a.TranslateModule,o.ReactiveFormsModule,d.InputTextModule],declarations:[Ko],exports:[Ko]})],t)}(),zo=function(){function t(){}return t.getFormattedCpf=function(t){return t?t.replace(/\D/g,"").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1-$2"):null},t.getFormattedCnpj=function(t){return t?t.replace(/\D/g,"").replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2"):null},t.getCpfCnpjMask=function(t){switch(t){case"CPF":return"999.999.999-99";case"CNPJ":return"99.999.999/9999-99";default:return""}},t.getFormattedTelephoneNumber=function(t){var e=t.replace(/\D/g,"");return(e=e.replace(/^0/,"")).length>10?e=e.replace(/^(\d{2})?(\d{5})?(\d{4}).*/,"($1) $2-$3"):e.length>9?e=e.replace(/^(\d{2})?(\d{4})?(\d{4}).*/,"($1) $2-$3"):e.length>5?e=e.replace(/^(\d{2})?(\d{4})?(\d{0,4}).*/,"($1) $2-$3"):e.length>1?e=e.replace(/^(\d{2})?(\d{0,5}).*/,"($1) $2"):""!==e&&(e=e.replace(/^(\d*)/,"($1")),e},t.formatTelephoneInputEvent=function(e){var o=e.target.value;(8!==e.keyCode||9!==o.length&&4!==o.length&&3!==o.length)&&(e.target.value=t.getFormattedTelephoneNumber(o))},t.getFormattedPercentage=function(t){return parseFloat(t).toFixed(2).replace(".",",")+"%"},t}(),$o=function(){function t(){}return t.isValidCei=function(t){var e=t.value;if(!e)return null;if(11!=e.length)return null;var o=0,n=0;if(11!==e.length||"00000000000"===e||"11111111111"===e||"22222222222"===e||"33333333333"===e||"44444444444"===e||"55555555555"===e||"66666666666"===e||"77777777777"===e||"88888888888"===e||"99999999999"===e)return{invalidCei:!0};for(var i=0;i<10;i++)o+=parseInt(e.substring(i,i+1),10)*parseInt("3298765432".substring(i,i+1),10);return(n=10===(n=11-o%11)||11===n?0:n)===parseInt(""+e.charAt(10),10)?null:{invalidCei:!0}},t.isValidCpf=function(t){var e=t.value;if(e){var o=void 0,n=void 0,i=void 0,r=void 0,a=void 0;if(a=1,e.length<11)return null;for(r=0;r<e.length-1;r++)if(e.charAt(r)!==e.charAt(r+1)){a=0;break}if(a)return{cpfNotValid:!0};for(o=e.substring(0,9),n=e.substring(9),i=0,r=10;r>1;r--)i+=o.charAt(10-r)*r;if((i%11<2?0:11-i%11)!==Number(n.charAt(0)))return{cpfNotValid:!0};for(o=e.substring(0,10),i=0,r=11;r>1;r--)i+=o.charAt(11-r)*r;return(i%11<2?0:11-i%11)!==Number(n.charAt(1))?{cpfNotValid:!0}:null}return null},t.isValidCnpj=function(t){var e=t.value;if(e){var o=void 0,n=void 0,i=void 0,r=void 0,a=void 0;if(14!==(e=e.replace(/[^\d]+/g,"")).length)return null;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return{cnpjNotValid:!0};o=e.length-2,n=e.substring(0,o),i=e.substring(o),r=0,a=o-7;for(var s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);if((r%11<2?0:11-r%11)!==Number(i.charAt(0)))return{cnpjNotValid:!0};o+=1,n=e.substring(0,o),r=0,a=o-7;for(s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);return(r%11<2?0:11-r%11)!==Number(i.charAt(1))?{cnpjNotValid:!0}:null}return null},t.isValidPhoneNumber=function(t){var e=t.value||"";e=e.replace(/[\s()-]/g,"");return/^[1-9][\d]{1,2}\d{8,10}$/.test(e)?null:{invalidPhoneNumber:!0}},t.isValidEmail=function(t){var e=t.value;return/^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/.test(e)?null:{invalidEmail:!0}},t}(),Qo=function(){function t(t,n){this.formBuilder=t,this.cd=n,this.withSideBar=!0,this.isEditMode=!1,this.paramsForm=new o.FormGroup({}),this.defaultCpfNumber=null,this.permitsEditBankAccountForm=!1,this.visibleChange=new e.EventEmitter,this.pixAccountItemToList=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.initialValidatorOfPercentage=[o.Validators.required,o.Validators.min(.01)],this.labelBtnAdd="hcm.payroll.employees_add",this.maxValuePercentage=100,this.visibleBtnSave=!0,this.isView=!1,this.isShowPixKeyFieldValidatorMessage=!1,this.createFormGroup(),this.registerSubjects()}return t.prototype.ngOnInit=function(){},t.prototype.ngDoCheck=function(){if(this.pixAccountFormGroup&&"BANK_ACCOUNT"===this.pixKeyType){var t=this.pixAccountFormGroup.get("pixKey");t&&!t.disabled&&t.disable()}},t.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.unsubscribe()},t.prototype.registerSubjects=function(){},t.prototype.createFormGroup=function(){this.pixAccountFormGroup=this.formBuilder.group({id:this.formBuilder.control(null),index:this.formBuilder.control(null),employee:this.formBuilder.control({value:{tableId:null},disabled:!0}),dateChange:this.formBuilder.control(null),pixKeyType:this.formBuilder.control(null,o.Validators.required),pixKey:this.formBuilder.control(null),percentage:this.formBuilder.control(null,o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),externalId:this.formBuilder.control(null),customFields:this.formBuilder.control(null)})},t.prototype.onChangePixKeyType=function(t){t.key&&(this.pixKeyType=t.key,this.isShowPixKeyFieldValidatorMessage=!0,this.pixAccountFormGroup.get("pixKey").reset(),this.setPixKeyValidators(!0),"CPF"===t.key&&this.setDefaultCpfPixKey())},t.prototype.onClearPixKeyType=function(){this.isShowPixKeyFieldValidatorMessage=!1,this.pixAccountFormGroup.get("pixKey").reset()},Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEditAndViewValue",{set:function(t){this.resetForm(),this.visibleBtnSave=!0,t&&t.permitsEditBankAccount&&(this.permitsEditBankAccountForm=!0),t&&t.currentItem&&Object.keys(t.currentItem).length?(this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(R({},t.currentItem))),this.labelBtnAdd="hcm.payroll.employees_update",this.setValidatorsAccordingList(t.listData,t.currentItem.index,t&&t.isEditMode),this.isView?this.pixAccountFormGroup.get("pixKeyType").value&&(this.pixKeyType=this.pixAccountFormGroup.get("pixKeyType").value.key,this.formatPixKeyTelephoneNumber()):this.configEnableFields(t&&t.isEditMode)):this.labelBtnAdd="hcm.payroll.employees_add"},enumerable:!0,configurable:!0}),t.prototype.formatPixKeyTelephoneNumber=function(){"TELEPHONE"===this.pixKeyType&&this.pixAccountFormGroup.get("pixKey").setValue(zo.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value))},t.prototype.convertDTOToShowWithCustomFields=function(t){var e=R({},t);return e.customFields=se(e.customFields),e},t.prototype.configEnableFields=function(t){this.visibleBtnSave=t,this.pixAccountFormGroup.get("pixKeyType").value&&(this.pixKeyType=this.pixAccountFormGroup.get("pixKeyType").value.key,this.setPixKeyValidators(t),this.formatPixKeyTelephoneNumber()),ce(this.pixAccountFormGroup,t,["pixKeyType","pixKey","percentage","customFields"],[])},t.prototype.close=function(){this.resetForm(),this.visible=!1},t.prototype.addItem=function(){this.pixAccountFormGroup.updateValueAndValidity(),le.call(this.pixAccountFormGroup),this.pixAccountFormGroup.valid&&(this.employeeId&&this.pixAccountFormGroup.get("employee").setValue({tableId:this.employeeId,name:""}),this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue()),this.visible=!1,this.resetForm())},t.prototype.resetForm=function(){this.pixAccountFormGroup.reset(),this.labelBtnAdd="hcm.payroll.employees_add",this.customFields&&this.customFields.formGroup&&this.customFields.formGroup.reset()},Object.defineProperty(t.prototype,"percentagePlaceholder",{get:function(){return"0"+(this.currency&&this.currency.decimalSeparator)+"00"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optionsPercentage",{get:function(){return R({},this.getOptions(),{precision:2})},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return{prefix:"",thousands:this.currency.thousandsSeparator,decimal:this.currency.decimalSeparator}},Object.defineProperty(t.prototype,"getListPixAccount",{set:function(t){t?this.setValidatorsAccordingList(t,null,!1):this.resetForm()},enumerable:!0,configurable:!0}),t.prototype.setValidatorsAccordingList=function(t,e,o){void 0===e&&(e=null),void 0===o&&(o=!0),this.pixAccountList=t&&t.length?Y(t):[];var n=[];this.pixAccountList&&this.pixAccountList.length&&this.pixAccountList.filter((function(t,o){t.percentage&&o!=e&&n.push(t.percentage)})),this.beforeSetPixKeyTypeValidator(),this.setPixKeyValidators(o),this.validatePercentageValid(n)},t.prototype.setPixKeyValidators=function(t){var e=this.pixAccountFormGroup.get("pixKey");if(this.pixKeyType){switch(this.pixKeyType){case"TELEPHONE":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidPhoneNumber]));break;case"EMAIL":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidEmail]));break;case"CPF":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidCpf]));break;case"CNPJ":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidCnpj]));break;case"RANDOM_KEY":e.setValidators(o.Validators.required);break;default:e.setValidators(null)}t&&e.enable(),e.updateValueAndValidity()}},t.prototype.validatePercentageValid=function(t){var e=this.pixAccountFormGroup.get("percentage");this.maxValuePercentage=t.reduce((function(t,e){return t-e}),100),e.setValidators(o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),e.updateValueAndValidity()},Object.defineProperty(t.prototype,"isViewMode",{set:function(t){this.isView=!(!t||this.withSideBar),this.configEnableFields(!this.isView),this.isView||this.resetForm()},enumerable:!0,configurable:!0}),t.prototype.phoneMask=function(t){zo.formatTelephoneInputEvent(t)},t.prototype.setDefaultCpfPixKey=function(){if(this.defaultCpfNumber)this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);else{var t=this.paramsForm.get("sheetDocument");if(t){var e=t.get("cpfNumber").value;e&&this.pixAccountFormGroup.get("pixKey").setValue(e)}}},t.prototype.beforeSetPixKeyTypeValidator=function(){var t=this.pixAccountFormGroup.get("pixKeyType");this.pixAccountList&&this.pixAccountList.length&&t?t.setValidators(o.Validators.compose([o.Validators.required,this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList)])):t.setValidators(o.Validators.required)},t.prototype.validateDuplicatePixKeyTypeBankAccount=function(t){var e=this;return function(o){var n=o&&o.value,i=!1;return t.filter((function(t){if(n&&"BANK_ACCOUNT"===t.pixKeyType.key&&n.key===t.pixKeyType.key)return i=!0})),i&&!e.permitsEditBankAccountForm?{pixKeyTypeBankAccountDuplicate:!0}:null}},t.ctorParameters=function(){return[{type:o.FormBuilder},{type:e.ChangeDetectorRef}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!0})],t.prototype,"customFields",void 0),N([e.Input()],t.prototype,"currency",void 0),N([e.Input()],t.prototype,"customEntity",void 0),N([e.Input()],t.prototype,"customService",void 0),N([e.Input()],t.prototype,"withSideBar",void 0),N([e.Input()],t.prototype,"isEditMode",void 0),N([e.Input()],t.prototype,"paramsForm",void 0),N([e.Input()],t.prototype,"defaultCpfNumber",void 0),N([e.Input()],t.prototype,"permitsEditBankAccountForm",void 0),N([e.Output()],t.prototype,"visibleChange",void 0),N([e.Output()],t.prototype,"pixAccountItemToList",void 0),N([e.Input()],t.prototype,"visible",null),N([e.Input()],t.prototype,"isEditAndViewValue",null),N([e.Input()],t.prototype,"getListPixAccount",null),N([e.Input()],t.prototype,"isViewMode",null),t=N([e.Component({selector:"pix-account",template:'<div id="main">\n <form [formGroup]="pixAccountFormGroup" autocomplete="off">\n <div class="ui-fluid">\n <div class="ui-g">\n \x3c!-- Tipo de chave --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.employees_addition_pix_key_type\'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]="true" server="payroll"\n enumeration="PixKeyType"\n placeholder="{{\'hcm.payroll.select\' | translate}}"\n name="pixKeyType" [form]="pixAccountFormGroup"\n (onSelect)="onChangePixKeyType($event)"\n (onClear)="onClearPixKeyType()"\n id="ta-pixKeyType"></input-rest-auto-complete-enum>\n <s-control-errors [control]="pixAccountFormGroup.get(\'pixKeyType\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n pixKeyTypeBankAccountDuplicate: \'hcm.payroll.historical_pix_key_type_bank_account_duplicate\' | translate\n }">\n </s-control-errors>\n </div>\n \x3c!--Chave Pix--\x3e\n <div class="ui-md-6 ui-sm-12" [ngClass]="{\'required\': pixKeyType !== \'BANK_ACCOUNT\'}">\n <label>{{\'hcm.payroll.employees_addition_pix_key\' | translate}}</label>\n <ng-container [ngSwitch]="pixKeyType">\n <input *ngSwitchCase="\'TELEPHONE\'" only-number\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey"\n (keyup)="phoneMask($event)" maxlength="15"\n placeholder="(__) ____-____">\n <p-inputMask *ngSwitchCase="\'CPF\'"\n id="ta-pixKey" name="pixKey" formControlName="pixKey"\n placeholder="___.___.___-__"\n mask="999.999.999-99" [unmask]="true"></p-inputMask>\n <p-inputMask *ngSwitchCase="\'CNPJ\'"\n id="ta-pixKey" name="pixKey" formControlName="pixKey"\n placeholder="__.___.___/____-__"\n mask="99.999.999/9999-99" [unmask]="true"></p-inputMask>\n <input *ngSwitchCase="\'EMAIL\'"\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey"\n placeholder="{{\'hcm.payroll.employees_addition_email\'|translate}}"/>\n <input *ngSwitchCase="\'BANK_ACCOUNT\'" disabled\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey"/>\n <input *ngSwitchDefault\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey" maxlength="100" />\n </ng-container>\n <s-control-errors *ngIf="isShowPixKeyFieldValidatorMessage" id="er-pix-key"\n [control]="pixAccountFormGroup.get(\'pixKey\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n invalidPhoneNumber: \'hcm.payroll.employees_addition_invalid_phone_number\' | translate: { value: pixAccountFormGroup.get(\'pixKey\').value },\n invalidEmail: \'hcm.payroll.employees_addition_email_invalid\' | translate,\n cpfNotValid: \'hcm.payroll.employees_addition_cpf_error\' | translate,\n cnpjNotValid: \'hcm.payroll.employees_addition_cnpj_error\' | translate\n }">\n </s-control-errors>\n </div>\n \x3c!--Percentual--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label id="lb-percentage"\n for="ff-percentage">{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input pInputText id="ff-percentage" name="percentage"\n formControlName="percentage"\n currencyMask\n [options]="optionsPercentage"\n [placeholder]="percentagePlaceholder"/>\n </div>\n <s-control-errors [control]="pixAccountFormGroup.get(\'percentage\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'6\' },\n max: \'hcm.payroll.error_max_value_number\' | translate: { value: maxValuePercentage },\n min: \'hcm.payroll.error_min_value_number\' | translate: { value: \'0,01\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12">\n <p-fieldset\n legend="{{ \'hcm.payroll.custom_fields\' | translate }}"\n [attr.data-hidden]="!customFields || !customFields.fields.length"\n >\n <s-custom-fields\n domain="hcm"\n service="{{customService}}"\n entity="{{customEntity}}"\n formControlName="customFields"\n [invalidErrorLabel]="\'hcm.payroll.employees_invalid_field\' | translate"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]="withSideBar ? \'footer\' : \'footer-s-border\'">\n <div class="form-group">\n <s-button id="btn-save" label="{{ labelBtnAdd | translate}}" priority="primary"\n (onClick)="addItem()" *ngIf="visibleBtnSave && !this.isView"></s-button>\n <s-button *ngIf="withSideBar" id="btn-close" label="{{\'hcm.payroll.cancel\'|translate}}" priority="secondary"\n priority="link" (onClick)="close()"></s-button>\n </div>\n </div>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],t)}(),Jo=function(){function n(o,n,i,r){var a=this;this.translateService=o,this.cd=n,this.formBuilder=i,this.messageService=r,this.recordByRow=1,this.showDateChange=!1,this.isEditMode=!1,this.isViewMode=!1,this.withSideBar=!0,this.defaultCpfNumber=null,this.listDataReciever=[],this.showButtonEdit=!1,this.isViewModeActive=new e.EventEmitter,this.isEditModeActive=new e.EventEmitter,this.isDeleteModeActive=new e.EventEmitter,this.listFromApp=[],this.visibleChange=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.orderBy={field:"dateChange",direction:t.DirectionEnumeration.DESC},this.pixAccountItemInput={},this.totalRecords=0,this.actionLabel=this.translateService.instant("hcm.payroll.entries_query_actions_total_title"),this.loading=!0,this.listData=[],this.listDataNoPage=[],this.permitsEditBankAccount=!1,this.cols=[{label:this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),field:"pixKeyType"},{label:this.translateService.instant("hcm.payroll.employees_addition_pix_key"),field:"pixKey"},{label:this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),field:"percentage"}],this.actions=function(t,e){return void 0===t&&(t={}),[{visible:a.isEditMode,label:a.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){a.isAllowToViewHistorical?(t.index=e,a.pixAccountItemInput={currentItem:t,listData:a.listDataNoPage,isEditMode:!1},a.visible=!0):a.isViewModeActive.emit(!0)}},{visible:!!(!a.isEditMode&&a.withSideBar||a.showButtonEdit),label:a.translateService.instant("hcm.payroll.edit"),command:function(){a.permitsEditBankAccount=!0,a.isAllowToEditHistorical?(t.index=e,a.pixAccountItemInput={currentItem:t,listData:a.listDataNoPage,isEditMode:!0,permitsEditBankAccount:!0},a.visible=!0):(a.isEditModeActive.emit(!0),0==a.listFromApp.length&&(t.index=e,a.pixAccountItemInput={currentItem:t,listData:a.listDataNoPage,isEditMode:!0,permitsEditBankAccount:!0}))}},{visible:!a.isEditMode,label:a.translateService.instant("hcm.payroll.delete"),command:function(){a.isAllowToDeleteHistorical?(a.loading=!0,a.deleteAnnuityItem(e)):(a.isDeleteModeActive.emit(!0),0==a.listFromApp.length&&(a.loading=!0,a.deleteAnnuityItem(e)))}}]},this.createFormGroup()}return n.prototype.ngOnInit=function(){this.formGroup.setControl(this.fieldFormGroup,this.historicalPixAccountList)},n.prototype.ngOnChanges=function(t){t.listDataReciever&&t.listDataReciever.currentValue&&(this.listFromApp=t.listDataReciever.currentValue),t.showButtonEdit&&t.showButtonEdit.currentValue&&(this.permitsEditBankAccount=t.showButtonEdit.currentValue)},n.prototype.createFormGroup=function(){this.historicalPixAccountList=this.formBuilder.group({historicalPixAccountList:this.formBuilder.control(null)})},n.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},n.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},n.prototype.onLazyLoad=function(e){var o=this,n=e&&e.first?e.first:0,i=e&&e.rows?e.rows:this.recordByRow,r=this.getHistoricalPixAccountList();this.listData=[],this.totalRecords=null,e&&e.multiSortMeta&&e.multiSortMeta.length&&e.multiSortMeta.map((function(e){o.orderBy.field=e.field,o.orderBy.direction=1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})),r&&r.length?(this.totalRecords=r.length,this.listData=r,this.listDataNoPage=Y(r),this.listData.sort(me(this.orderBy.field,this.orderBy.direction)),this.listData=this.listData.slice(n,n+i)):this.listDataNoPage=[],(this.isEditMode||r&&1===r.length)&&this.refreshCssInIE11(),this.loading=!1},n.prototype.refreshCssInIE11=function(){/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&setTimeout((function(){var t=document.getElementsByClassName("row0");t&&t[0]&&(t[0].className="refresh")}),1)},n.prototype.add=function(){this.pixAccountItemInput={},this.visible=!0},n.prototype.isNotAllowMessage=function(){this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},n.prototype.deleteAnnuityItem=function(t){var e=Y(this.getHistoricalPixAccountList());e.sort(me(this.orderBy.field,this.orderBy.direction)),delete e[t],e=e.filter((function(t){return t})),this.historicalPixAccountList.get("historicalPixAccountList").setValue(e),this.verifyTotalPercentage(),this.onLazyLoad()},n.prototype.getHistoricalPixAccountList=function(){return this.historicalPixAccountList.get("historicalPixAccountList")&&this.historicalPixAccountList.get("historicalPixAccountList").value&&this.historicalPixAccountList.get("historicalPixAccountList").value.length?this.historicalPixAccountList.get("historicalPixAccountList")&&this.historicalPixAccountList.get("historicalPixAccountList").value:[]},n.prototype.addItemInList=function(t){var e=t&&t.index>=0?t.index:null,o=this.getHistoricalPixAccountList()?this.getHistoricalPixAccountList():[];if(null!=e)o[e]=t,delete t.index;else{if(Jt(t.customFields)&&Object.keys(t.customFields).length){var n=ae(t.customFields);t.customFields=Y(n)}t.dateChange=this.dateChange,o.push(t)}this.formComponent&&(this.formComponent.permitsEditBankAccountForm=!1,this.cd.detectChanges()),this.historicalPixAccountList.get("historicalPixAccountList").setValue(o),this.verifyTotalPercentage(),this.onLazyLoad({first:this.getNumberPageByIndex(e,o)})},n.prototype.getNumberPageByIndex=function(t,e){if(t){var o=e.length,n=this.recordByRow-1;return Math.ceil(o/this.recordByRow)*this.recordByRow-n-1}return null},n.prototype.verifyTotalPercentage=function(){var t=this.getHistoricalPixAccountList()?this.getHistoricalPixAccountList():[],e=[];if(!t.length)return this.msgTotalLimitByPercentage=null;t.filter((function(t){return e.push(t&&t.percentage)}));var o=e.reduce((function(t,e){return t+e}),0);this.msgTotalLimitByPercentage=100===o?this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage"):null},Object.defineProperty(n.prototype,"scopedActions",{get:function(){return this.actions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.translateService.instant("hcm.payroll.admission_register"):this.translateService.instant("hcm.payroll.admission_registers"))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"getTooltipAndDisableButtonAdd",{get:function(){return this.dateChange?null:this.msgTooltipAdd},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dateChange",{get:function(){return this._dateChange},set:function(t){var e=this;this._dateChange=t,this._dateChange&&this.listData.filter((function(t){return t.dateChange=e._dateChange}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayDateChange",{get:function(){return this._displayDateChange},set:function(t){var e=this;this._displayDateChange=t,this._displayDateChange&&this.listData.filter((function(t){return t.displayDateChange=e._displayDateChange}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"addListData",{set:function(t){this.loading=!0,this.historicalPixAccountList.get("historicalPixAccountList").patchValue(t),this.verifyTotalPercentage(),this.onLazyLoad()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible),t||(this.pixAccountItemInput={})},enumerable:!0,configurable:!0}),n.prototype.close=function(){this.visible=!1},n.prototype.getFormattedTelephoneNumber=function(t){return zo.getFormattedTelephoneNumber(t)},n.prototype.getFormattedCpf=function(t){return zo.getFormattedCpf(t)},n.prototype.getFormattedCnpj=function(t){return zo.getFormattedCnpj(t)},n.prototype.getFormattedPercentage=function(t){return zo.getFormattedPercentage(t)},Object.defineProperty(n.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isAllowToEditHistorical",{get:function(){return this.permission.editar},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isAllowToViewHistorical",{get:function(){return this.permission.visualizar},enumerable:!0,configurable:!0}),n.ctorParameters=function(){return[{type:a.TranslateService},{type:e.ChangeDetectorRef},{type:o.FormBuilder},{type:I.MessageService}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],n.prototype,"customFields",void 0),N([e.ViewChild(Qo,{static:!1})],n.prototype,"formComponent",void 0),N([e.Input()],n.prototype,"formGroup",void 0),N([e.Input()],n.prototype,"fieldFormGroup",void 0),N([e.Input()],n.prototype,"_dateChange",void 0),N([e.Input()],n.prototype,"_displayDateChange",void 0),N([e.Input()],n.prototype,"recordByRow",void 0),N([e.Input()],n.prototype,"showDateChange",void 0),N([e.Input()],n.prototype,"msgTooltipAdd",void 0),N([e.Input()],n.prototype,"isEditMode",void 0),N([e.Input()],n.prototype,"isViewMode",void 0),N([e.Input()],n.prototype,"currency",void 0),N([e.Input()],n.prototype,"customEntity",void 0),N([e.Input()],n.prototype,"customService",void 0),N([e.Input()],n.prototype,"withSideBar",void 0),N([e.Input()],n.prototype,"paramsForm",void 0),N([e.Input()],n.prototype,"defaultCpfNumber",void 0),N([e.Input()],n.prototype,"permission",void 0),N([e.Input()],n.prototype,"listDataReciever",void 0),N([e.Input()],n.prototype,"showButtonEdit",void 0),N([e.Output()],n.prototype,"isViewModeActive",void 0),N([e.Output()],n.prototype,"isEditModeActive",void 0),N([e.Output()],n.prototype,"isDeleteModeActive",void 0),N([e.Input()],n.prototype,"dateChange",null),N([e.Input()],n.prototype,"displayDateChange",null),N([e.Input()],n.prototype,"addListData",null),N([e.Input()],n.prototype,"visible",null),n=N([e.Component({selector:"c-historical-pix-account",template:'<s-sidebar *ngIf="withSideBar" [visible]="visible" (visibleChange)="close()"\n header="{{\'hcm.payroll.historical_pix_account_title_form\'|translate}}">\n<pix-account [(visible)]="visible"\n [isEditAndViewValue]="pixAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListPixAccount]="listDataNoPage"\n [paramsForm]="paramsForm"\n (pixAccountItemToList)="addItemInList($event)"\n [defaultCpfNumber]="defaultCpfNumber"></pix-account>\n</s-sidebar>\n\n<div *ngIf="!withSideBar && !isViewMode">\n <pix-account [(visible)]="visible"\n [isEditAndViewValue]="pixAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListPixAccount]="listDataNoPage"\n [withSideBar]="false"\n [isViewMode]="isViewMode"\n [paramsForm]="paramsForm"\n [permitsEditBankAccountForm]="permitsEditBankAccount"\n (pixAccountItemToList)="addItemInList($event)"\n [defaultCpfNumber]="defaultCpfNumber"></pix-account>\n</div>\n\n<div class="ui-g-1" *ngIf="withSideBar && !isEditMode">\n <div class="form-group ">\n <s-button id="ta-addPayAnnuity"\n [disabled]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n (onClick)="add()"\n [pTooltip]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n tooltipPosition="top"\n label="{{\'hcm.payroll.historical_pix_account_add\'|translate}}"></s-button>\n </div>\n</div>\n<div class="ui-g-12">\n <p-table\n id="table-annuity"\n [value]="listData"\n [columns]="cols"\n (onLazyLoad)="onLazyLoad($event)"\n [lazy]="true"\n [scrollable]="true"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [sortMode]="\'multiple\'"\n *sLoadingState="loading"\n [rows]="recordByRow"\n dataKey="id">\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-s\'">\n <col *ngIf="!isViewMode" [ngClass]="\'col-action\'">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th\n [pSortableColumn]="\'pixKeyType\'"\n [pTooltip]="\'hcm.payroll.employees_addition_pix_key_type\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header" id="table-0">\n <span\n id="table-annuity-s-0">{{ \'hcm.payroll.employees_addition_pix_key_type\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.employees_addition_pix_key_type\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'pixKey\'"\n [pTooltip]="\'hcm.payroll.employees_addition_pix_key\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.employees_addition_pix_key\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.employees_addition_pix_key\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'percentage\'"\n [pTooltip]="\'hcm.payroll.historical_pix_account_label_percentage\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_pix_account_label_percentage\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_pix_account_label_percentage\' | translate"></p-sortIcon>\n </div>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th *ngIf="!isViewMode" id="col-actions"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n\n <tr [ngClass]="\'row\'+key" [pSelectableRow]="rowData">\n <td [pTooltip]="rowData?.pixKeyType.value" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]="rowData?.pixKeyType.key">\n <td *ngSwitchCase="\'TELEPHONE\'"\n [pTooltip]="getFormattedTelephoneNumber(rowData?.pixKey)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase="\'CPF\'"\n [pTooltip]="getFormattedCpf(rowData?.pixKey)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase="\'CNPJ\'"\n [pTooltip]="getFormattedCnpj(rowData?.pixKey)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]="rowData?.pixKey" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]="getFormattedPercentage(rowData?.percentage)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id="col-actions-{{key}}" class="col-actions "\n *ngIf="actions && actions(rowData, key)?.length && !isViewMode">\n <s-button id="table-admission-btn-actions-{{key}}"\n *ngIf="actions(rowData, key).length > 1" [label]="actionLabel"\n priority="default" [model]="scopedActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="table-admission-btn-action-{{key}}"\n *ngIf="actions(rowData, key).length <= 1"\n [label]="scopedActions(rowData, key)[0].label"\n priority="default"\n (click)="scopedActions(rowData, key)[0].command()"\n [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td [attr.colspan]="columns.length +2">\n {{\'hcm.payroll.admission_empty_message\'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span *ngIf="totalRecords">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],n)}(),Xo=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),Zo=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,h.SidebarModule,bt,h.ControlErrorsModule,Ee,M.CurrencyMaskModule,ve,d.InputTextModule,St,L.FieldsetModule,h.CustomFieldsModule,O.PanelModule,u.InputMaskModule],declarations:[Jo,Qo],providers:[Xo,I.ConfirmationService],exports:[Jo]})],t)}(),tn=function(){function o(t,e){this.http=t,this.httpClient=e}return o.prototype.remove=function(e,o,n,i){return void 0===n&&(n=t.ServiceType.PAYROLL),n===t.ServiceType.DEPENDENT?this.httpClient.post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete",{dependentId:i,dateWhen:o}):this.http.post("actions/historicalEmployeePixDelete",{employeeId:e,dateWhen:o})},o.ctorParameters=function(){return[{type:Nt},{type:v.HttpClient}]},o=N([e.Injectable()],o)}(),en=y,on=function(){function o(t,o,n,i,r,a,s){this.confirmationService=t,this.translateService=o,this.activatedRoute=n,this.cd=i,this.router=r,this.messageService=a,this.historicalPixAccountListService=s,this.endPoint="hcm/payroll/queries/historicalEmployeePixQuery",this.keyPayload="historicalEmployeePix",this.withSidebar=!0,this.isOnlyView=new e.EventEmitter,this.isOnlyEdit=new e.EventEmitter,this.enableView=new e.EventEmitter,this.enableEdit=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.loading=!0,this.columns=[{label:this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),field:"dateChange"},{label:this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),field:"numberOfPixAccount"}]}return o.prototype.ngOnInit=function(){this.initParameters={employeeId:this.employeeId,dependentId:this.dependentId}},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},o.prototype.onLazyLoad=function(t){var e=this;t.forEach((function(t){t.dateChange=en(t.dateChange).format(e.dateFormat)})),this.onGridLoad(t),this.loading=!1},o.prototype.getMenuActions=function(t){var e=this;return[{label:this.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){if(e.isAllowToViewHistorical){var o=t&&t.dateChange&&en(t.dateChange,e.dateFormat).format("YYYY-MM-DD");e.withSidebar?(e.isOnlyView.emit(!0),e.router.navigate(["historical-pix-account/"+o],{relativeTo:e.activatedRoute})):e.enableView.emit(o)}else e.isNotAllowMessage()}},{label:this.translateService.instant("hcm.payroll.edit"),command:function(){if(e.isAllowToEditHistorical){var o=t&&t.dateChange&&en(t.dateChange,e.dateFormat).format("YYYY-MM-DD");e.withSidebar?(e.isOnlyView.emit(!1),e.isOnlyEdit.emit(!0),e.router.navigate(["historical-pix-account/"+o],{relativeTo:e.activatedRoute})):e.enableEdit.emit(o)}else e.isNotAllowMessage()}},{label:this.translateService.instant("hcm.payroll.delete"),command:function(){e.isAllowToDeleteHistorical&&t?e.delete(t.id,t.dateChange):e.isNotAllowMessage()}}]},o.prototype.delete=function(e,o){var n=this;if(e===this.lastRecord.id){var i=en(o,this.dateFormat).format("YYYY-MM-DD");this.confirmationService.confirm({message:this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete")+"?",accept:function(){n.loading=!0;var e=n.withSidebar?t.ServiceType.PAYROLL:t.ServiceType.DEPENDENT;n.historicalPixAccountListService.remove(n.employeeId,i,e,n.dependentId).pipe(s.takeUntil(n.ngUnsubscribe)).subscribe((function(){n.messageService.add({severity:"success",summary:n.translateService.instant("hcm.payroll.success"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove")}),n.parameters=n.parameters&&R({},n.parameters)||{}}),(function(){n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove")}),n.loading=!1}))}})}else this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.not_allowed_delete_last")})},o.prototype.add=function(){this.isAllowToAddHistorical?this.router.navigate(["historical-pix-account-new"],{relativeTo:this.activatedRoute}):this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},o.prototype.isNotAllowMessage=function(){this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},o.prototype.onGridLoad=function(t){t&&t.length&&(this.lastRecord=t[0])},Object.defineProperty(o.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToViewHistorical",{get:function(){return this.permission.visualizar},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToEditHistorical",{get:function(){return this.permission.editar},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"scopedActions",{get:function(){return this.getMenuActions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"reloadList",{set:function(t){t&&(this.loading=!0,this.parameters=this.parameters&&R({},this.parameters)||{})},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:I.ConfirmationService},{type:a.TranslateService},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef},{type:r.Router},{type:I.MessageService},{type:tn}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],o.prototype,"customFields",void 0),N([e.Input()],o.prototype,"permission",void 0),N([e.Input()],o.prototype,"employeeId",void 0),N([e.Input()],o.prototype,"dependentId",void 0),N([e.Input()],o.prototype,"dateFormat",void 0),N([e.Input()],o.prototype,"endPoint",void 0),N([e.Input()],o.prototype,"keyPayload",void 0),N([e.Input()],o.prototype,"withSidebar",void 0),N([e.Output()],o.prototype,"isOnlyView",void 0),N([e.Output()],o.prototype,"isOnlyEdit",void 0),N([e.Output()],o.prototype,"enableView",void 0),N([e.Output()],o.prototype,"enableEdit",void 0),N([e.Input()],o.prototype,"reloadList",null),o=N([e.Component({selector:"c-historical-pix-account-list",template:'<div class="ui-g">\n <div class="ui-g-12">\n <c-data-list-rest\n id="ta-historical-pix-account-list"\n [columns]="columns"\n actionLabel="{{ \'hcm.payroll.movimentation_generic_action\' | translate }}"\n emptyMessage="{{ \'hcm.payroll.admission_empty_message\' | translate }}"\n [endpoint]="endPoint"\n singularMessageRecords="{{\n \'hcm.payroll.admission_register\' | translate\n }}"\n [actions]="scopedActions"\n pluralMessageRecords="{{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [keyPayload]="keyPayload"\n [lazy]="true"\n (lazyLoad)="onLazyLoad($event)"\n [(loading)]="loading"\n [initParameters]="initParameters"\n [parameters]="parameters"\n [isSortable]="false"\n ></c-data-list-rest>\n </div>\n</div>\n\n',styles:[""]})],o)}(),nn=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,Ct,B.ConfirmDialogModule],declarations:[on],providers:[tn],exports:[on]})],t)}();t.AdmissionDraftSummaryComponent=Pt,t.AdmissionDraftSummaryModule=xt,t.AdmissionDraftSummaryService=At,t.AutocompleteParametersService=to,t.BlockUiComponent=lt,t.BlockUiModule=pt,t.BreadcrumbComponent=ct,t.BreadcrumbSDSModule=dt,t.CNPJValidator=it,t.CPFValidator=ot,t.CompanyIndicationsService=$e,t.ControlMessagesErrorComponent=mt,t.ControlMessagesErrorModule=ht,t.CoreDirectives=St,t.CustomFieldsComponent=yt,t.CustomFieldsModule=vt,t.DataListModule=go,t.DataListRestModule=Ct,t.DateValidator=Uo,t.EmployeeSelectorComponent=Go,t.EmployeeSelectorModule=Ho,t.EmployeeSummaryComponent=Et,t.EmployeeSummaryModule=Ft,t.EmployeeSummaryService=Dt,t.EntityODataParameter=No,t.ErrorPageComponent=Mt,t.ErrorPageModule=Lt,t.FieldValidatorComponent=Ot,t.FieldValidatorModule=Bt,t.FileUploadComponent=jt,t.FileUploadCoreModule=qt,t.FormComparatorService=po,t.FromToComponent=Ko,t.FromToModule=Wo,t.HistoricalBankAccountComponent=Ao,t.HistoricalBankAccountListComponent=Bo,t.HistoricalBankAccountListModule=Ro,t.HistoricalBankAccountListService=Lo,t.HistoricalBankAccountModule=Mo,t.HistoricalBankAccountService=xo,t.HistoricalPixAccountComponent=Jo,t.HistoricalPixAccountListComponent=on,t.HistoricalPixAccountListModule=nn,t.HistoricalPixAccountListService=tn,t.HistoricalPixAccountModule=Zo,t.HistoricalPixAccountService=Xo,t.HttpClientService=Nt,t.ImageCropComponent=Yt,t.ImageCropModule=Gt,t.ImageCropService=Ut,t.InputDateComponent=gt,t.InputDateModelComponent=Kt,t.InputDateModelModule=Wt,t.InputDateModule=bt,t.InputRestAutoCompleteComponent=be,t.InputRestAutoCompleteEmployeeModelModule=Ce,t.InputRestAutoCompleteEmployeeModelService=ke,t.InputRestAutoCompleteEmployeeModule=Se,t.InputRestAutoCompleteEmployeeService=Ie,t.InputRestAutoCompleteEnumComponent=Te,t.InputRestAutoCompleteEnumModule=Ee,t.InputRestAutoCompleteEnumService=De,t.InputRestAutoCompleteJobpositionComponent=Be,t.InputRestAutoCompleteJobpositionModule=Re,t.InputRestAutoCompleteJobpositionService=Oe,t.InputRestAutoCompleteModelEnumModule=Le,t.InputRestAutoCompleteModelEnumService=xe,t.InputRestAutoCompleteModelModule=Pe,t.InputRestAutoCompleteModelService=Fe,t.InputRestAutoCompleteModule=ve,t.InputRestAutoCompleteService=ge,t.IntegrationService=Qe,t.ListRestComponent=Ve,t.ListRestModule=je,t.LookupModule=_o,t.LookupParametersService=Xe,t.NameNotSpacesDirective=It,t.OnlyNumberDirective=_t,t.PermissionService=uo,t.ReportService=so,t.ServicesModule=co,t.SpinnerLoaderComponent=qe,t.SpinnerLoaderModule=Ue,t.StringMethods=at,t.ToastComponent=mo,t.ToastModule=ho,t.ToastService=Rt,t.TypeAdmissionModule=Ge,t.TypeAdmissionServices=Ye,t.WorkflowDataService=lo,t.WorkflowIntegrator=Yo,t.WorkstationgroupLookupDto=Do,t.WorkstationgroupLookupModule=Fo,t._moment=re,t.assign=function t(e){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];if(!o.length)return e;var i=o.shift();if($t(e)&&$t(i)){var r=function(o){var n,r,a,s;$t(i[o])?(e[o]||Object.assign(e,((n={})[o]={},n)),t(e[o],i[o])):Qt(i[o])?Object.assign(e,((r={})[o]=i[o],r)):(e[o]||Object.assign(e,((a={})[o]=[],a)),Object.assign(e,((s={})[o]=i[o].map((function(n,i){return t(e[o][i]||{},n)})),s)))};for(var a in i)r(a)}return t.apply(void 0,Y([e],o))},t.autoCompleteObjectForIdObject=function(t){return $t(t)?(t.hasOwnProperty("tableId")&&console.error("Paramentro não é um objeto Auto Complete válido, falta tableId"),Jt(t.tableId)||console.error("tableId esta vazio"),{id:t.tableId}):(console.error("Paramentro não é um objeto"),!1)},t.clearValues=he,t.cnpjValidator=rt,t.compareValues=me,t.configEnabledFields=ce,t.containsMoreThanOneConsecutiveAbbreviation=function(t){return!/(\b.\s)(.\s)(.\b)\1?/g.test(t)},t.containsMoreThanOneConsecutiveBlankSpace=function(t){return!/(\w[ ]{2,}\w)/.test(t)},t.containsMoreThanTwoRepeatedCharacters=function(t){return!/([a-zA-Z])\1{2}/g.test(t)},t.containsSpecialCharacters=function(t){return!/[[\]!@#$%&*_+=`´{}^~<>.,:;?|()\/\\-]/.test(t)},t.convertBooleanString=function(t){return"boolean"==typeof t?!0===t?"true":"false":t},t.convertStringToBoolean=function(t){return!0===t||"true"===t.toLowerCase()},t.cpfValidator=nt,t.firstNameIsValid=function(t){var e=t.split(" ");return e.length>=2&&e[1].length>=1},t.firstNameLengthIsValid=function(t){var e=t.split(" ");return!(e[0].trim().length>0)||e[0].trim().length>=2},t.formatMoney=function(t,e){switch(void 0===e&&(e="EN"),e){case"EN":return Jt(t)?t.toString().replace(".","").replace(",","."):"";case"BR":return Jt(t)?t.toString().replace(".",",").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1."):"";default:return Jt(t)?t.toString().replace(".","").replace(",","."):""}},t.fullNameLengthIsValid=function(t){return t.length<=70},t.getAddWeekDaysBusiness=function(t,e){return T.addWeekDays(ie(t),e).format("DD/MM/YYYY")},t.getFormat=ye,t.getFormatDate=oe,t.getMoment=ie,t.getNowDate=ne,t.getObjValids=function(t){var e=Object.assign({},t),o={};return Object.keys(e).map((function(t){Jt(e[t])&&(o[t]=te(t,e[t]))})),o},t.getQueryParams=function(t){t=t.split("+").join(" ");for(var e,o={},n=/[?&]?([^=]+)=([^&]*)/g;e=n.exec(t);)o[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return o},t.getWeekDaysBusiness=function(t,e){var o=e?ie(e):ie(t).endOf("month");return T.weekDays(ie(t),o)},t.getYears=function(t){return zt().diff(t,"years",!1)},t.invertFieldDate=ee,t.isBirthDayValid=function(t,e){if(t&&e)return e.isSameOrAfter(t)},t.isDateCompare=function(t,e,o){return!(t&&t.isValid()&&e&&o)||t[o](e)},t.isDateExpirationBeforeExpeditionDate=function(t,e){if(t&&e)return e.isSameOrAfter(t)},t.isDateField=te,t.isDateSameOrAfterCurrentDate=function(t){if(t){var e=He();return t.isSameOrAfter(e)}},t.isFullDate=Zt,t.isMax=function(t,e){return t.length<=e},t.isNumber=Ke,t.isObject=$t,t.isRequired=function(t){return null!=t&&t.length>0},t.isShallow=Qt,t.isValid=Jt,t.isValidDate=Xt,t.isValidPIS=function(t){var e=0,o=0,n=t.replace(/[^\d]+/g,"");if(11!==n.length||"00000000000"===n||"11111111111"===n||"22222222222"===n||"33333333333"===n||"44444444444"===n||"55555555555"===n||"66666666666"===n||"77777777777"===n||"88888888888"===n||"99999999999"===n)return!1;for(var i=0;i<10;i++)e+=parseInt(n.substring(i,i+1))*parseInt("3298765432".substring(i,i+1));return(o=10===(o=11-e%11)||11===o?0:o)===parseInt(""+n.charAt(10))},t.mountCustomForSave=function(t,e,o){void 0===e&&(e=null),void 0===o&&(o=null);var n=[];return e&&t.length&&e.map((function(e,i){var r=Object.keys(t[i]).toString(),a=Jt(t[i][r])?t[i][r]:null,s="date"===e.type&&o&&Jt(a)?zt(a,ye(o)).format("YYYY-MM-DD"):a;n.push({field:r,value:s})})),n.length?n:null},t.mountCustomForShow=function(t){var e=[];return Object.keys(t||{}).forEach((function(o){"date"===t[o].type&&t[o].value&&(t[o].value=re(t[o].value).format("L")),e.push(t[o])})),e},t.mountCustomToSave=ae,t.mountCustomToShow=se,t.mountGeneratedCustomToSave=function(t){return Object.entries(t).forEach((function(e){var o=U(e,2),n=o[0];o[1]||delete t[n]})),t},t.ngCalendarFormat=function(t,e){if(void 0===e&&(e="DD/MM/YYYY"),Xt(t))return"string"==typeof t?t:re(t).format(e)},t.notEmpty=We,t.numberOrZero=ze,t.removeCharacteresSpecials=fe,t.removeEmpty=function t(e){return Object.keys(e).forEach((function(o){return e[o]&&"object"==typeof e[o]&&t(e[o])||!e[o]&&void 0!==e[o]&&delete e[o]})),e},t.removeWhiteSpaces=function(t){return t&&String(t)?String(t).replace(/\s/g,""):String(t)},t.setCustonFields=function(t){var e=this;return t.map((function(t){var n={},i=t.value||null;"boolean"==typeof i&&(i=i?"true":"false"),n[t.field]=new o.FormControl(i),e.push(new o.FormGroup(n))})),t},t.setDisableField=de,t.setErrors=function(t,e,o){var n=this;setTimeout((function(){var i;o?((i=Object.assign({},n.get(t).errors))[e]=o,n.get(t).setErrors(i)):(i=n.get(t).errors)&&Object.keys(i).length&&(delete i[e],Object.keys(i).length||n.get(t).setErrors(null))}),0)},t.setRequired=pe,t.setRequiredFields=function(t,e,n){e?n.forEach((function(e){return pe(t,e,!0,[o.Validators.required])})):n.forEach((function(e){return pe(t,e,!1)}))},t.setValidator=ue,t.setValidatorsAndDisableFields=function(t,e){e.forEach((function(e){ue(t,e.field,e.validators),de(t,e.disabled,e.field,e.clearValue)}))},t.setValueCustom=function(t,e){var o=e?Object.keys(e).length:0;return t.map((function(t){t.value=o>0?e[t.field]:null})),t},t.stringMethods=st,t.sun=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return ze(e)+t}),0)},t.uiid=function(){return(new D).guid().replace(/[^a-zA-Z0-9.]/g,"").toUpperCase()},t.validateBirthDate=function(t,e){if(t&&e){var o=He("string"==typeof t?t.replace(/[^\d]+/g,""):t,"DDMMYYYY").format("YYYY-MM-DD").toString(),n=He(e.replace(/[^\d]+/g,""),"DDMMYYYY").format("YYYY-MM-DD").toString();return He(n).isSameOrAfter(o)}},t.verifyValidationsForm=le,t.ɵa=ut,t.ɵb=wt,t.ɵc=kt,t.ɵd=Vt,t.ɵe=_e,t.ɵf=we,t.ɵg=Ae,t.ɵh=Me,t.ɵi=Ne,t.ɵj=fo,t.ɵk=yo,t.ɵl=Io,t.ɵm=bo,t.ɵn=Eo,t.ɵo=ko,t.ɵp=Co,t.ɵq=Po,t.ɵr=Qo,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms"),require("primeng/blockui"),require("primeng/progressspinner"),require("@angular/router"),require("@ngx-translate/core"),require("rxjs/operators"),require("primeng/breadcrumb"),require("@angular/common"),require("primeng/dropdown"),require("primeng/inputmask"),require("primeng/inputtext"),require("primeng/shared"),require("@seniorsistemas/angular-components"),require("moment"),require("rxjs"),require("primeng/tooltip"),require("primeng/table"),require("@angular/common/http"),require("primeng/api"),require("@senior-gestao-pessoas/angular-components"),require("ng2-img-cropper"),require("primeng/button"),require("primeng/dialog"),require("primeng/fileupload"),require("chance"),require("moment-business"),require("primeng/autocomplete"),require("primeng/splitbutton"),require("primeng/components/common/messageservice"),require("@seniorsistemas/senior-platform-data"),require("primeng/toast"),require("ng2-currency-mask"),require("primeng/fieldset"),require("primeng/panel"),require("primeng/confirmdialog")):"function"==typeof define&&define.amd?define("@senior-gestao-pessoas/payroll-core",["exports","@angular/core","@angular/forms","primeng/blockui","primeng/progressspinner","@angular/router","@ngx-translate/core","rxjs/operators","primeng/breadcrumb","@angular/common","primeng/dropdown","primeng/inputmask","primeng/inputtext","primeng/shared","@seniorsistemas/angular-components","moment","rxjs","primeng/tooltip","primeng/table","@angular/common/http","primeng/api","@senior-gestao-pessoas/angular-components","ng2-img-cropper","primeng/button","primeng/dialog","primeng/fileupload","chance","moment-business","primeng/autocomplete","primeng/splitbutton","primeng/components/common/messageservice","@seniorsistemas/senior-platform-data","primeng/toast","ng2-currency-mask","primeng/fieldset","primeng/panel","primeng/confirmdialog"],e):e(((t=t||self)["senior-gestao-pessoas"]=t["senior-gestao-pessoas"]||{},t["senior-gestao-pessoas"]["payroll-core"]={}),t.ng.core,t.ng.forms,t.blockui,t.progressspinner,t.ng.router,t.core$1,t.rxjs.operators,t.breadcrumb,t.ng.common,t.dropdown,t.inputmask,t.inputtext,t.shared,t.angularComponents,t.moment_,t.rxjs,t.tooltip,t.table,t.ng.common.http,t.api,t.angularComponents$1,t.ng2ImgCropper,t.button,t.dialog,t.fileupload,t.chance,t.business,t.autocomplete,t.splitbutton,t.messageservice,t.seniorPlatformData,t.toast,t.ng2CurrencyMask,t.fieldset,t.panel,t.confirmdialog)}(this,(function(t,e,o,n,i,r,a,s,l,p,c,u,d,m,h,y,f,g,b,v,I,S,_,k,w,C,D,T,E,F,A,P,x,M,L,O,B){"use strict";T=T&&T.hasOwnProperty("default")?T.default:T;var R=function(){return(R=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function N(t,e,o,n){var i,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,o,a):i(e,o))||a);return r>3&&a&&Object.defineProperty(e,o,a),a}function V(t,e,o,n){return new(o||(o=Promise))((function(i,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){t.done?i(t.value):new o((function(e){e(t.value)})).then(a,s)}l((n=n.apply(t,e||[])).next())}))}function j(t,e){var o,n,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(i=2&r[0]?n.return:r[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;switch(n=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,n=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],n=0}finally{o=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function q(t){var e="function"==typeof Symbol&&t[Symbol.iterator],o=0;return e?e.call(t):{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}}}function U(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,i,r=o.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}return a}function Y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(U(arguments[e]));return t}var G,H,K,W,z,$,Q,J,X,Z,tt,et,ot=function(){function t(){}return t.prototype.calcChecker1=function(t){for(var e=null,o=0;o<9;++o)e+=t.toString().charAt(o)*(10-o);var n=e%11;return n<2?0:11-n},t.prototype.calcChecker2=function(t){for(var e=null,o=0;o<10;++o)e+=t.toString().charAt(o)*(11-o);var n=e%11;return n<2?0:11-n},t.prototype.checkCPF=function(t){var e=t.replace(/\.|\-|\s/g,""),o=e.substring(0,9),n=e.substring(9,11);if(11!==e.length)return!1;for(var i=0;i<10;i++)if(""+o+n===Array(12).join(i.toString()))return!1;var r=this.calcChecker1(o),a=this.calcChecker2(o+""+r);return n.toString()===r.toString()+a.toString()},t}(),nt=new ot,it=function(){function t(){}return t.prototype.checkCNPJ=function(t){var e=t;if(e){var o=void 0,n=void 0,i=void 0,r=void 0,a=void 0;if(14!==(e=e.replace(/[^\d]+/g,"")).length)return!0;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;o=e.length-2,n=e.substring(0,o),i=e.substring(o),r=0,a=o-7;for(var s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);if((r%11<2?0:11-r%11)!==Number(i.charAt(0)))return!1;o+=1,n=e.substring(0,o),r=0,a=o-7;for(s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);return(r%11<2?0:11-r%11)===Number(i.charAt(1))}return!0},t}(),rt=new it,at=function(){function t(){this.addStringFormat()}return t.prototype.addStringFormat=function(){if(!String.prototype.hasOwnProperty("format")){var t={format:function(){for(var t=this,e=0;e<arguments.length;e++){var o=new RegExp("\\{"+e+"\\}","gi");t=t.replace(o,arguments[e])}return t}};Object.assign(String.prototype,t)}},t}(),st=new at,lt=function(){function t(){}return N([e.Input()],t.prototype,"blocked",void 0),N([e.Input()],t.prototype,"target",void 0),t=N([e.Component({selector:"block-ui",template:'<p-blockUI [blocked]="blocked">\n <p-progressSpinner [strokeWidth]="5"></p-progressSpinner>\n</p-blockUI>\n',styles:[".ui-widget-overlay{background:#ccc!important;opacity:.5!important}@-webkit-keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}@keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}p-progressspinner{position:absolute!important;top:50%!important;left:50%!important}"]})],t)}(),pt=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,n.BlockUIModule,i.ProgressSpinnerModule],declarations:[lt],exports:[lt]})],t)}(),ct=function(){function t(t,e,o){this.activatedRoute=t,this.router=e,this.translate=o,this.items=[]}return t.prototype.ngOnInit=function(){var t=this;this.router.events.pipe(s.filter((function(t){return t instanceof r.NavigationEnd}))).subscribe((function(){var e=t.activatedRoute.root;t.items=t.getBreadcrumbs(e,[])}))},t.prototype.getBreadcrumbs=function(t,e){var o=t.children;if(0===o.length)return e;this.generateBreadcrumb(o,e);var n=e.length&&e.length-1||0;return this.title=e[n]&&e[n].label,e},t.prototype.generateBreadcrumb=function(t,e){var o=this;t.forEach((function(t,n){t.snapshot.data.hasOwnProperty("breadcrumb")&&t.snapshot.data.breadcrumb.map((function(n){var i={label:o.translate.instant(n.name),queryParams:t.snapshot.queryParams,routerLink:o.getFormattedUrl(t,n.routerLink),url:o.getFormattedUrl(t,n.url)};n.routerLink&&(i.disabled=!0,i.routerLinkActiveOptions={exact:!0}),e.push(i)})),t.children&&t.children.length&&o.generateBreadcrumb(t.children,e)}))},t.prototype.getFormattedUrl=function(t,e){return e&&(Object.keys(t.snapshot.params).forEach((function(o){e=e.replace(":"+o,t.snapshot.params[o])})),e.includes(":")&&t.parent)?this.getFormattedUrl(t.parent,e):e},t.ctorParameters=function(){return[{type:r.ActivatedRoute},{type:r.Router},{type:a.TranslateService}]},t=N([e.Component({selector:"c-breadcrumb",template:'<h1 class="sds-page-title">{{title}}</h1>\n<p-breadcrumb [model]="items" ></p-breadcrumb>\n'})],t)}(),ut=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule],exports:[p.CommonModule,a.TranslateModule]})],t)}(),dt=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,l.BreadcrumbModule,ut],declarations:[ct],exports:[ct]})],t)}(),mt=function(){function t(){}return Object.defineProperty(t.prototype,"errorMessage",{get:function(){for(var t in this.control.errors)if(this.control.errors.hasOwnProperty(t)&&(this.control.touched||this.control.dirty))return this.errorList[t];return null},enumerable:!0,configurable:!0}),N([e.Input()],t.prototype,"control",void 0),N([e.Input()],t.prototype,"errorList",void 0),t=N([e.Component({selector:"control-messages-error",template:'<div class="error-message" *ngIf="errorMessage">\n {{ errorMessage | translate }}\n</div>\n',styles:[".error-message{color:#c13018;margin-top:5px;font-size:13px}"]})],t)}(),ht=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,o.ReactiveFormsModule],declarations:[mt],exports:[mt]})],t)}(),yt=function(){function t(){this.optionsBoolean=[{label:"Selecione",value:""},{label:"Sim",value:"true"},{label:"Não",value:"false"}]}return t.prototype.ngOnInit=function(){},N([e.Input()],t.prototype,"params",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"form",void 0),t=N([e.Component({selector:"custom-fields",template:'<div [ngSwitch]="params.type" [formGroup]="form" *ngIf="form" >\n <div *ngSwitchCase="\'date\'" >\n <input-date-calendar [form]="form" [name]="params.field" ></input-date-calendar>\n </div>\n <div *ngSwitchCase="\'boolean\'" >\n <p-dropdown [options]="optionsBoolean" [name]="params.field"\n [(ngModel)]="params.value" [formControlName]="params.field" [required]="required" [readonly]="readonly"\n [style]="{\'width\': \'100%\'}"\n ></p-dropdown>\n </div>\n <div *ngSwitchDefault >\n <input type="text" *ngIf="!params.mask" pInputText [formControlName]="params.field" />\n <p-inputMask *ngIf="params.mask" [(ngModel)]="params.value" [formControlName]="params.field" [mask]="params.mask" [required]="required" [name]="params.field" [readonly]="readonly" ></p-inputMask>\n </div>\n</div>\n',styles:[""]})],t)}(),ft=y,gt=function(){function t(t){this.localeService=t,this.unmask=!0,this.onBlurGetMoment=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.mask=null}return t.prototype.ngOnInit=function(){var t=this;this.localeService.get().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){if(t.mask=t.formatMask(e),t.format=t.setFormat(),t.form.get(t.name).value){var o=t.form.get(t.name).value.toString(),n=ft(o,t.format||"YYYY-MM-DD");t.form.get(t.name).setValue(n.format(t.format||"L")),t._date=n}}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},t.prototype.formatMask=function(t){this.locale=t;var e=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),(e=e.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},t.prototype.setFormat=function(){var t=this.locale.calendar.dateFormat.toString();return t=t.replace(/[y]/g,"YY"),this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),t.toUpperCase()},Object.defineProperty(t.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),t.prototype.onBlur=function(t){if(t&&t.target&&t.target.value){var e=this.form.get(this.name).value;this._date=ft(e,this.format),this.onBlurGetMoment.emit(this._date)}else this._date={},this.form.get(this.name).setValue(null),this.onBlurGetMoment.emit(null)},Object.defineProperty(t.prototype,"model",{get:function(){var t=this.form.get(this.name).value;return ft(t,this.format)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputDateElement",{get:function(){return this._inputDateElement},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:h.LocaleService}]},N([e.ViewChild("inputDateElement",{static:!1})],t.prototype,"_inputDateElement",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"unmask",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Input()],t.prototype,"withoutDay",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Output()],t.prototype,"onBlurGetMoment",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-date-calendar",template:'<div [formGroup]="form" >\n <p-inputMask *ngIf="mask" [formControlName]="name"\n [mask]="mask"\n (onBlur)="onBlur($event)"\n [placeholder]="placeholder"\n [attr.disabled]="disabled"\n [unmask]="unmask"\n [inputId]="inputId"\n [readonly]="readonly"\n #inputDateElement\n ></p-inputMask>\n</div>\n'})],t)}(),bt=function(){function t(){}return t=N([e.NgModule({imports:[u.InputMaskModule,o.FormsModule,o.ReactiveFormsModule,p.CommonModule],declarations:[gt],exports:[gt]})],t)}(),vt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,o.ReactiveFormsModule,m.SharedModule,d.InputTextModule,bt,c.DropdownModule,u.InputMaskModule],declarations:[yt],providers:[],exports:[yt]})],t)}(),It=function(){function t(t){this.elementRef=t,this.el=this.elementRef.nativeElement}return t.prototype.onBlur=function(t){this.cleanVar(t)},t.prototype.cleanVar=function(t){var e=t.trim().replace(/^\s+|\s+$|\s+(?=\s)/g,"");return t!==e&&(this.el.value=e),e},t.ctorParameters=function(){return[{type:e.ElementRef}]},N([e.HostListener("blur",["$event.target.value"])],t.prototype,"onBlur",null),t=N([e.Directive({selector:"[name-not-spaces]"})],t)}(),St=function(){function t(t){this.el=t}return t.prototype.onKeyDown=function(t){var e=t;-1!==[46,8,9,27,13,110,190].indexOf(e.keyCode)||65===e.keyCode&&(e.ctrlKey||e.metaKey)||67===e.keyCode&&(e.ctrlKey||e.metaKey)||86===e.keyCode&&(e.ctrlKey||e.metaKey)||88===e.keyCode&&(e.ctrlKey||e.metaKey)||e.keyCode>=35&&e.keyCode<=39||(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()},t.ctorParameters=function(){return[{type:e.ElementRef}]},N([e.HostListener("keydown",["$event"])],t.prototype,"onKeyDown",null),t=N([e.Directive({selector:"[only-number]"})],t)}(),_t=function(){function t(){}return t=N([e.NgModule({imports:[],declarations:[St,It],exports:[St,It],providers:[],schemas:[]})],t)}();(G=t.UsingType||(t.UsingType={})).TYPE_1="TYPE_1",G.TYPE_2="TYPE_2",G.TYPE_3="TYPE_3",G.TYPE_4="TYPE_4",G.TYPE_6="TYPE_6",G.TYPE_7="TYPE_7",G.TYPE_8="TYPE_8",G.TYPE_9="TYPE_9",G.TYPE_10="TYPE_10",G.TYPE_11="TYPE_11",G.TYPE_12="TYPE_12",G.TYPE_14="TYPE_14",G.TYPE_15="TYPE_15",G.TYPE_16="TYPE_16",G.TYPE_17="TYPE_17",G.TYPE_18="TYPE_18",G.TYPE_19="TYPE_19",G.TYPE_20="TYPE_20",G.TYPE_21="TYPE_21",(H=t.CompanyIndicationType||(t.CompanyIndicationType={})).USE_DEPENDENTS="USE_DEPENDENTS",H.VACCINATION_FREQUENCY="VACCINATION_FREQUENCY",H.APPORTIONMENT_CALCULATION="APPORTIONMENT_CALCULATION",H.USE_WORKSTATION_GROUP_EMPLOYEE="USE_WORKSTATION_GROUP_EMPLOYEE",H.STRUCTURE="STRUCTURE",H.PAY_ANNUITY="PAY_ANNUITY",H.USE_HISTORICAL_BANK_ACCOUNT="USE_HISTORICAL_BANK_ACCOUNT",(t.CoreFieldType||(t.CoreFieldType={})).searchValue="searchValue",(K=t.DirectionEnumeration||(t.DirectionEnumeration={})).ASC="ASC",K.DESC="DESC",(W=t.ModuleType||(t.ModuleType={})).MANAGEMENT_PANEL="MANAGEMENT_PANEL",W.PERFORMANCE_MANAGEMENT="PERFORMANCE_MANAGEMENT",W.CAREER_SUCCESSION="CAREER_SUCCESSION",W.RECRUIT_MANAGEMENT="RECRUIT_MANAGEMENT",W.REMUNERATION_MANAGEMENT="REMUNERATION_MANAGEMENT",W.DEVELOPMENT_MANAGEMENT="DEVELOPMENT_MANAGEMENT",W.PAYROLL="PAYROLL",W.APP="APP",W.MOODS="MOODS",(z=t.Operators||(t.Operators={})).EQUAL="eq",z.DIFFERENT="ne",z.LESS_THAN="it",z.GREATER_THAN="gt",z.LESS__EQUAL_THAN="le",z.GREATER_EQUAL_THAN="ge",z.CONTAINING="containing",z.LOWER="lower",z.AND="and",z.OR="or",($=t.CompareType||(t.CompareType={})).isBefore="isBefore",$.isAfter="isAfter",$.isSame="isSame",$.isSameOrAfter="isSameOrAfter",$.isSameOrBefore="isSameOrBefore",$.isNotSame="isNotSame",(Q=t.ServiceType||(t.ServiceType={})).ENTRY="entry",Q.GENERAL_REGISTER="general_register",Q.ORGANIZATION_REGISTER="organization_register",Q.PAYROLL="payroll",Q.DEPENDENT="dependent",(J=t.HttpRequestType||(t.HttpRequestType={})).POST="post",J.GET="get",(X=t.ReportFormat||(t.ReportFormat={})).PDF="Pdf",X.CSV="Csv",X.HTML="Html",X.XLS="Xls",X.XLSX="Xlsx",X.XML="Xml",X.ODT="Odt",X.RTF="Rtf",(Z=t.ParameterType||(t.ParameterType={})).STRING="String",Z.INTEGER="Integer",Z.DOUBLE="Double",Z.BOOLEAN="Boolean",Z.DATE="Date",Z.DATETIME="DateTime",Z.TIME="Time",Z.OBJECT="Object",(tt=t.MenuType||(t.MenuType={})).DEFAULT="DEFAULT",tt.ACTION="ACTION",(et=t.ReportStage||(t.ReportStage={})).STARTING="Starting",et.COMPILING="Compiling",et.FILLING="Filling",et.EXPORTING="Exporting",et.DONE="Done",et.CANCELLED="Cancelled",et.GENERATED="Generated",et.ERROR="Error";var kt=function(){function t(t){this.http=t}return t.prototype.getList=function(t,e){return this.http.post(""+t,e)},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),wt=function(){function o(t){this.dataListService=t,this.rows=10,this.paginator=!0,this.first=1,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.responsive=!0,this.scrollable=!1,this.lazyLoad=new e.EventEmitter,this.loadingChange=new e.EventEmitter,this.listDataChange=new e.EventEmitter,this.selectedDataChange=new e.EventEmitter,this.headerCheckboxToggle=new e.EventEmitter,this.ngUnsubscribe=new f.Subject}return o.prototype.ngOnInit=function(){this.lazy||this.getlistData()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.getActions=function(t,e){return this.actions(t,e)},o.prototype.pagination=function(t){this.lazy||this.getlistData(t.rows,Math.floor(t.first/t.rows))},o.prototype.onLazyLoad=function(e){var o=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){o.orderBy.push({field:e.field,direction:1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows)+1)},o.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(o.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),o.prototype.getlistData=function(t,e){var o=this;void 0===t&&(t=this.rows),void 0===e&&(e=this.first),this.endpoint?this.dataListService.getList(this.endpoint,R({page:{current:e,size:t,orderBy:this.orderBy}},this.initParameters,this._searchParameters)).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(t){return t&&t.result}))).subscribe((function(t){o.listData=t[o.keyPayload],o.totalRecords=t.countResult,o.lazy&&o.lazyLoad.emit(o.listData)})):this.lazy&&this.lazyLoad.emit(this.listData)},o.prototype.onHeaderCheckboxToggle=function(t){this.headerCheckboxToggle.emit(t)},o.prototype.getFieldValue=function(t,e){return e.field&&e.field.includes(".")?(e.field.split(".").map((function(e){return t=t&&t[e]})),t):t[e.field]},Object.defineProperty(o.prototype,"parameters",{set:function(t){t&&(this._searchParameters=R({},t),this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"loading",{get:function(){return this._loading},set:function(t){this._loading=t,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"listData",{get:function(){return this._listData},set:function(t){this._listData=t,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"selectedData",{get:function(){return this._selectedData},set:function(t){this._selectedData=t,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:kt}]},N([e.ViewChild("dataListTable",{static:!1})],o.prototype,"dataListTable",void 0),N([e.Input()],o.prototype,"id",void 0),N([e.Input()],o.prototype,"dataKey",void 0),N([e.Input()],o.prototype,"rows",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"columns",void 0),N([e.Input()],o.prototype,"paginator",void 0),N([e.Input()],o.prototype,"first",void 0),N([e.Input()],o.prototype,"alwaysShowPaginator",void 0),N([e.Input()],o.prototype,"actions",void 0),N([e.Input()],o.prototype,"actionLabel",void 0),N([e.Input()],o.prototype,"selectionMode",void 0),N([e.Input()],o.prototype,"lazy",void 0),N([e.Input()],o.prototype,"isMultipleSelection",void 0),N([e.Input()],o.prototype,"isSortable",void 0),N([e.Input()],o.prototype,"showHeaderCheckBox",void 0),N([e.Input()],o.prototype,"sortMode",void 0),N([e.Input()],o.prototype,"endpoint",void 0),N([e.Input()],o.prototype,"totalRecords",void 0),N([e.Input()],o.prototype,"orderBy",void 0),N([e.Input()],o.prototype,"singularMessageRecords",void 0),N([e.Input()],o.prototype,"pluralMessageRecords",void 0),N([e.Input()],o.prototype,"keyPayload",void 0),N([e.Input()],o.prototype,"initParameters",void 0),N([e.Input()],o.prototype,"responsive",void 0),N([e.Input()],o.prototype,"scrollable",void 0),N([e.Output()],o.prototype,"lazyLoad",void 0),N([e.Output()],o.prototype,"loadingChange",void 0),N([e.Output()],o.prototype,"listDataChange",void 0),N([e.Output()],o.prototype,"selectedDataChange",void 0),N([e.Output()],o.prototype,"headerCheckboxToggle",void 0),N([e.Input()],o.prototype,"parameters",null),N([e.Input()],o.prototype,"loading",null),N([e.Input()],o.prototype,"listData",null),N([e.Input()],o.prototype,"selectedData",null),o=N([e.Component({selector:"c-data-list-rest",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows" [first]="first"\n (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator" (onPage)="pagination($event)"\n [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey" [sortMode]="sortMode" [responsive]="responsive" [scrollable]="scrollable"\n pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)" [selectionMode]="selectionMode">\n \x3c!-- Colgroup --\x3e\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col *ngFor="let col of columns; let i = index"\n [ngClass]="\'col-\'+i+\' col-scroll-resize\'"/>\n <col [ngClass]="\'col-\'+ (columns?.length || 0) +\' col-scroll-resize\'"/>\n </colgroup>\n </ng-template>\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.field" [pSortableColumnDisabled]="!isSortable || !!col.icon"\n [style.width]="col.width" [pTooltip]="col.tooltip || col.label" tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style" aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default" [model]="getActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label" priority="default"\n (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:e.ViewEncapsulation.None,providers:[kt],styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]})],o)}(),Ct=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[wt],exports:[wt]})],t)}(),Dt=function(){function t(t){this.http=t,this.employeeBasicInformations=new f.Subject}return t.prototype.findEmployee=function(t,e){return this.http.post("hcm/payroll/queries/"+t,{employeeId:e})},t.prototype.findEmployeeAutoComplete=function(t,e){return this.http.post("hcm/payroll/queries/"+t,{valueSearch:e})},t.prototype.getEmployeeDocuments=function(t,e){return this.http.post("hcm/payroll/queries/"+t,{employeeId:e})},t.prototype.blobServiceRequestAccess=function(t,e){return this.http.post("hcm/payroll/actions/"+t,e)},t.prototype.setEmployeeBasicInformations=function(t){this.employeeBasicInformations.next(t)},t.prototype.getEmployeeBasicInformations=function(){return this.employeeBasicInformations.asObservable()},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),Tt=y,Et=function(){function t(t,e){this.activatedRoute=t,this.employeeService=e,this.timetrackingLabel="Status",this.hireLabel="Admissão",this.registerNumberLabel="Matrícula",this.ageLabel="Idade",this.loadingLabel="...",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.emploayeeData={name:this.loadingLabel,jobPosition:this.loadingDescription},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){e.employeeId&&t.getInformation(e.employeeId)}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},t.prototype.getInformation=function(t){var e=this;this.isLoading=!0,this.employeeService.findEmployee("employeeContractualInformations",t).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(t){return t&&t.result})),s.finalize((function(){e.isLoading=!1}))).subscribe((function(t){e.employeeService.setEmployeeBasicInformations(t),e.emploayeeData=R({},t,{timeTrackingResumeType:t.timeTrackingResumeType&&t.timeTrackingResumeType.value});var o=[];if(t.city&&o.push(t.city),t.stateAbbreviation&&o.push(t.stateAbbreviation),e.emploayeeData.location=o.join(" - "),t.hireDate&&(e.emploayeeData.hireDate=e.hireDate?e.hireDate:Tt(t.hireDate).format("L")),t.idPicture){var n={fileId:t.idPicture,ttl:2,thumbnail:!1};e.employeeService.blobServiceRequestAccess("blobServiceRequestAccess",n).pipe(s.takeUntil(e.ngUnsubscribe),s.map((function(t){return t&&t.result}))).subscribe((function(t){t&&(e.emploayeeData.photoSource=t.locationURI)}))}}))},t.ctorParameters=function(){return[{type:r.ActivatedRoute},{type:Dt}]},N([e.Input()],t.prototype,"timetrackingLabel",void 0),N([e.Input()],t.prototype,"hireDate",void 0),N([e.Input()],t.prototype,"hireLabel",void 0),N([e.Input()],t.prototype,"registerNumberLabel",void 0),N([e.Input()],t.prototype,"ageLabel",void 0),N([e.Input()],t.prototype,"loadingLabel",void 0),N([e.Input()],t.prototype,"loadingDescription",void 0),t=N([e.Component({selector:"c-employee-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="emploayeeData?.name" [description]="emploayeeData?.jobPosition" [imageSource]="emploayeeData?.photoSource"></s-object-card-main>\n <s-object-card-field [label]="emploayeeData?.employer" [description]="emploayeeData?.location"></s-object-card-field>\n <s-object-card-field [label]="timetrackingLabel" [description]="emploayeeData?.timeTrackingResumeType"></s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="emploayeeData?.hireDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="registerNumberLabel" [description]="emploayeeData?.registernumber" iconClass="fa fa-id-card"></s-object-card-field>\n <s-object-card-field [label]="ageLabel" [description]="emploayeeData?.age" iconClass="fa fa-birthday-cake"></s-object-card-field>\n</s-object-card>\n'})],t)}(),Ft=function(){function t(){}return t=N([e.NgModule({imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[Et],exports:[Et],providers:[Dt]})],t)}(),At=function(){function t(t){this.http=t,this.admissionDraftBasicInformations=new f.Subject}return t.prototype.findAdmissionDraft=function(t){return this.http.post("hcm/payroll/queries/admissionDraftQuery",{id:t})},t.prototype.blobServiceRequestAccess=function(t,e){return this.http.post("hcm/payroll/actions/"+t,e)},t.prototype.setAdmissionDraftBasicInformations=function(t){this.admissionDraftBasicInformations.next(t)},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),Pt=function(){function t(t,e,o){this.activatedRoute=t,this.admissionDraftSummaryService=e,this.translateService=o,this.hireLabel="Admissão",this.hireDate="...",this.badgeText="Rascunho",this.loadingLabel="...",this.documentNumberLabel="Documento",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.draftData={name:this.loadingLabel,hiringDate:this.hireDate,documentNumber:this.loadingLabel,companyName:this.loadingLabel,localeOfCompany:this.loadingLabel,originDraftType:this.loadingLabel},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){e.draftId&&t.getInformation(e.draftId)}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},t.prototype.getInformation=function(t){var e=this;this.isLoading=!0,this.admissionDraftSummaryService.findAdmissionDraft(t).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(t){return t&&t.result})),s.finalize((function(){e.isLoading=!1}))).subscribe((function(t){if(e.admissionDraftSummaryService.setAdmissionDraftBasicInformations(t),t.hiringDate=e.hireDate,e.draftData=R({},t),e.draftData.originDraftType=e.originType,t.attachment&&t.attachment.fileId){var o={fileId:e.draftData.attachment.fileId,ttl:2,thumbnail:!1};e.admissionDraftSummaryService.blobServiceRequestAccess("blobServiceRequestAccess",o).pipe(s.takeUntil(e.ngUnsubscribe),s.map((function(t){return t&&t.result}))).subscribe((function(t){t&&(e.draftData.photoSource=t.locationURI)}))}}))},t.ctorParameters=function(){return[{type:r.ActivatedRoute},{type:At},{type:a.TranslateService}]},N([e.Input()],t.prototype,"originType",void 0),N([e.Input()],t.prototype,"hireLabel",void 0),N([e.Input()],t.prototype,"hireDate",void 0),N([e.Input()],t.prototype,"badgeText",void 0),N([e.Input()],t.prototype,"loadingLabel",void 0),N([e.Input()],t.prototype,"documentNumberLabel",void 0),N([e.Input()],t.prototype,"loadingDescription",void 0),t=N([e.Component({selector:"c-admission-draft-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="draftData?.name"\n [imageSource]="draftData?.photoSource">\n </s-object-card-main>\n <s-object-card-field [label]="draftData.companyName" [description]="draftData.localeOfCompany"></s-object-card-field>\n <s-object-card-field [label]="draftData.originDraftType">\n <span descriptionTemplate class="sds-badge sds-semantic-orange">{{badgeText}}</span>\n </s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="draftData?.hiringDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="documentNumberLabel" [description]="draftData?.documentNumber" iconClass="fa fa-id-card"></s-object-card-field>\n</s-object-card>\n'})],t)}(),xt=function(){function t(){}return t=N([e.NgModule({imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[Pt],exports:[Pt],providers:[At]})],t)}(),Mt=function(){function t(){}return t.prototype.ngOnInit=function(){},t=N([e.Component({selector:"error-page",template:'<div class="ui-g">\n <div class="ui-sm-6 error-code">\n <span>403</span>\n </div>\n <div class="col-sm-6">\n <h4 class="error-title">​{{\'hcm.payroll.permission_error_page\'|translate}}</h4>\n <h5 class="error-description">{{\'hcm.payroll.permission_error_page_description\'|translate}}</h5>\n </div>\n</div>\n',styles:["@media (max-width:767px){.error-code{text-align:center}.error-code>span{color:#697882;font-size:80px;font-weight:300}}@media (min-width:768px){.error-code>span{color:#697882;font-size:128px;font-weight:300;float:right}}.error-title{padding-top:30px}.error-description{color:#999;margin-top:10px}"]})],t)}(),Lt=function(){function t(){}return t=N([e.NgModule({imports:[ut],declarations:[Mt],exports:[Mt],providers:[]})],t)}(),Ot=function(){function t(){this.errorMessage=""}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){var e=this,o=t.inputErrors.currentValue;this.errorMessage="",o&&Object.keys(this.errorDefs).some((function(t){if(o[t])return e.errorMessage=e.errorDefs[t],!0}))},N([e.Input()],t.prototype,"inputErrors",void 0),N([e.Input()],t.prototype,"errorDefs",void 0),N([e.Input()],t.prototype,"field",void 0),N([e.Input()],t.prototype,"onlyShowAfterTouched",void 0),t=N([e.Component({selector:"field-validator",template:'<ng-content></ng-content>\n<div style="color:#a94442;font-size: 13px"\n *ngIf="(onlyShowAfterTouched&&!field.valid&&(field.dirty || field.touched)&&errorMessage) || (!onlyShowAfterTouched&&errorMessage)">\n {{errorMessage | translate}}\n</div>\n'})],t)}(),Bt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,o.ReactiveFormsModule],declarations:[Ot],exports:[Ot],providers:[]})],t)}(),Rt=function(){function t(){this.messagesSubjectError=new f.Subject,this.messagesSubjectSuccess=new f.Subject,this.messagesSubjectWarning=new f.Subject}return t.prototype.showError=function(t,e){void 0===e&&(e=!1),this.messagesSubjectError.next({message:t,breakLine:e})},t.prototype.showSuccess=function(t,e){void 0===e&&(e=!1),this.messagesSubjectSuccess.next({message:t,breakLine:e})},t.prototype.showWarning=function(t,e){void 0===e&&(e=!1),this.messagesSubjectWarning.next({message:t,breakLine:e})},t.prototype.loadErrorMessages=function(){return this.messagesSubjectError.asObservable()},t.prototype.loadSuccessMessages=function(){return this.messagesSubjectSuccess.asObservable()},t.prototype.loadWarningMessages=function(){return this.messagesSubjectWarning.asObservable()},t}(),Nt=function(){function o(t,e,o){this.http=t,this.messageService=e,this.translateService=o}return o.prototype.query=function(e,o,n){var i=this;void 0===n&&(n=t.ServiceType.PAYROLL);var r="hcm/"+n+"/queries/"+e;return this.http.post(r,o).pipe(s.catchError((function(t){return t&&403===t.status&&i.messageService.add({severity:"error",summary:i.translateService.instant("hcm.payroll.error"),detail:i.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.enumQuery=function(t,e,o){var n=this;void 0===o&&(o="payroll");var i="hcm/"+o+"/queries/"+t;return this.http.post(i,e).pipe(s.catchError((function(t){return t&&403===t.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.action=function(t,e){var o=this,n="hcm/payroll/actions/"+t;return this.http.post(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.recruitmentAction=function(t,e){var o=this,n="hcm/recruitment/actions/"+t;return this.http.post(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.get=function(t){var e=this,o="hcm/payroll/entities/"+t;return this.http.get(o).pipe(s.catchError((function(t){return 403===t.status&&e.messageService.add({severity:"error",summary:e.translateService.instant("hcm.payroll.error"),detail:e.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.getAutoComplete=function(e,o,n){var i=this;void 0===n&&(n=t.ServiceType.PAYROLL);var r="hcm/"+n+"/entities/"+e+"?filter="+o+"&size=10&orderby=code+asc";return this.http.get(r).pipe(s.catchError((function(t){return t&&403===t.status&&i.messageService.add({severity:"error",summary:i.translateService.instant("hcm.payroll.error"),detail:i.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},o.prototype.patch=function(t,e){var o=this,n="hcm/payroll/entities/"+t;return this.http.patch(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.post=function(t,e){var o=this,n="hcm/payroll/"+t;return this.http.post(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.put=function(t,e){var o=this,n="hcm/payroll/entities/"+t;return this.http.put(n,e).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.prototype.delete=function(t,e){var o=this,n=e?"hcm/payroll/entities/"+t+"/"+e:"hcm/payroll/entities/"+t;return this.http.delete(n).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},o.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},o=N([e.Injectable()],o)}(),Vt=function(){function t(t){this.http=t}return t.prototype.blobServiceRequestUpload=function(t){var e={fileName:t.name,thumbnail:this.isImage(t)};return this.http.action("blobServiceRequestUpload",e)},t.prototype.blobServiceRequestAccess=function(t){var e={fileId:t,tll:2,thumbnail:!1};return this.http.action("blobServiceRequestAccess",e)},t.prototype.blobServiceFileDelete=function(t){var e={fileId:t,thumbnail:!1};return this.http.action("blobServiceDelete",e)},t.prototype.isImage=function(t){return/^image\//.test(t.type)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),jt=function(){function t(t,o,n){this.service=t,this.toastService=o,this.translate=n,this.files=[],this.onUploadFile=new e.EventEmitter,this.onRemoveFile=new e.EventEmitter}return t.prototype.uploadHandler=function(t){var e=this,o=[];if(t&&t.files.length){t.files.sort(),t.files.length>10&&t.files[10]&&delete t.files[10];for(var n=this.getFilesCountAndValidate(t.files),i=0;i<n;i++){var r=this.validateFileSize(t.files[i]);i<=9&&r.isUploaded&&!r.complete&&o.push(this.saveFile(r))}f.forkJoin.apply(void 0,Y(o)).subscribe((function(){e.onUploadFile.emit(e.files)}))}},t.prototype.validateFileSize=function(t){return t.isUploaded&&!t.complete&&t.size>5e7&&(t.complete=!0,t.error=this.translate.instant("hcm.payroll.attachments_max_mb"),this.toastService.showError(this.translate.instant("hcm.payroll.attachments_alert_error"))),t},t.prototype.getFilesCountAndValidate=function(t){var e=0;return t.length&&(t.length>10?(e=10,this.toastService.showError(this.translate.instant("hcm.payroll.attachments_max_length"))):e=t.length),e},t.prototype.saveFile=function(t){var e=this;return new f.Observable((function(o){return e.service.blobServiceRequestUpload(t).pipe(s.map((function(t){return t&&t.result}))).subscribe((function(n){return e.doUpload(n,t,o)}),(function(e){t.complete=!0,t.error=e.message,t.objectURL=void 0}))}))},t.prototype.doUpload=function(t,e,o){var n=new XMLHttpRequest;return e.id=t.fileId,e.objectURL=t.locationURI,e.version=t.version,e.progress=0,n.upload.addEventListener("progress",(function(t){e.progress=Math.round(100*t.loaded/t.total)}),!1),n.onreadystatechange=function(){4===n.readyState&&(e.complete=!0,n.status<200||n.status>=300?(e.objectURL=void 0,e.error=n.statusText||"Erro ao anexar arquivo"):e.error=!1,o.next(e),o.complete())},n.open("PUT",e.objectURL,!0),n.setRequestHeader("Translate","f"),n.send(e)},t.prototype.onCancelUpload=function(t){this.files.splice(t,1)},t.prototype.removeFile=function(){this.onRemoveFile.emit(this.files)},t.ctorParameters=function(){return[{type:Vt},{type:Rt},{type:a.TranslateService}]},N([e.Input()],t.prototype,"errorTooltip",void 0),N([e.Input()],t.prototype,"files",void 0),N([e.Output()],t.prototype,"onUploadFile",void 0),N([e.Output()],t.prototype,"onRemoveFile",void 0),t=N([e.Component({selector:"c-file-upload",template:'<s-file-upload-deprecated chooseLabel="{{\'hcm.payroll.file_upload_choose_label\'|translate}}"\n cancelLabel="{{\'hcm.payroll.file_upload_cancel_label\'|translate}}"\n removeLabel="{{\'hcm.payroll.file_upload_remove_label\'|translate}}"\n successTooltip="{{\'hcm.payroll.file_upload_success_tooltip\'|translate}}"\n [errorTooltip]="errorTooltip"\n [customUpload]="true" [accept]="\'*/*\'" [multiple]="true"\n (uploadHandler)="uploadHandler($event)" (onCancelUpload)="onCancelUpload($event)"\n (onRemoveFile)="removeFile()" [files]="files"\n></s-file-upload-deprecated>\n'})],t)}(),qt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,S.FileUploadModuleDeprecated,ut],declarations:[jt],providers:[Vt],exports:[jt]})],t)}(),Ut=function(){function t(t){this.http=t}return t.prototype.saveImage=function(t,e,o){return V(this,void 0,void 0,(function(){var n,i,r;return j(this,(function(a){switch(a.label){case 0:return t?(n=null,t?n={fileName:t.name}:e&&(n={fileName:e.split("/")[1]}),n?[4,this.blobServiceRequestUpload(o,n).toPromise()]:[3,2]):[2];case 1:return i=a.sent(),(r=new XMLHttpRequest).open("PUT",i.result.locationURI,!0),r.setRequestHeader("Translate","f"),r.send(t),[2,i.result];case 2:return[2]}}))}))},t.prototype.urltoFile=function(t,e,o){return void 0===o&&(o=null),o=o||(t.match(/^data:([^;]+);/)||"")[1],this.http.request("GET",t,{responseType:"arraybuffer"}).pipe(s.map((function(t){var n=new Blob([t],{type:o});return n.name=e,n})))},t.prototype.getImage=function(t,e,o){return V(this,void 0,void 0,(function(){return j(this,(function(n){switch(n.label){case 0:return t&&t.fileId?[4,this.blobServiceRequestAccess(e,t.fileId,o).toPromise()]:[3,2];case 1:return[2,n.sent().result.locationURI];case 2:return[2]}}))}))},t.prototype.buildUrl=function(t,e){return"hcm/"+t+"/"+e},t.prototype.query=function(t,e,o){var n="queries/"+e;return this.http.post(this.buildUrl(t,n),o)},t.prototype.blobServiceRequestUpload=function(t,e){var o={fileName:e.fileName,thumbnail:!0};return this.http.post(this.buildUrl(t,"actions/blobServiceRequestUpload"),o)},t.prototype.blobServiceRequestAccess=function(t,e,o){var n={fileId:e,tll:2,thumbnail:o};return this.http.post(this.buildUrl(t,"actions/blobServiceRequestAccess"),n)},t.prototype.blobServiceFileDelete=function(t,e){var o={fileId:e,thumbnail:!0};return this.http.post(this.buildUrl(t,"actions/blobServiceDelete"),o)},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),Yt=function(){function t(t,o){this.imageCropService=t,this.toastService=o,this.service="payroll",this.onClickSave=new e.EventEmitter,this.defaulPerson="assets/default-person.png",this.display=!1,this.imageCrop=[],this.data={},this.cropperSettings=new _.CropperSettings,this.cropperSettings.width=100,this.cropperSettings.height=100,this.cropperSettings.keepAspect=!1,this.cropperSettings.preserveSize=!0,this.cropperSettings.canvasWidth=600,this.cropperSettings.canvasHeight=450,this.cropperSettings.rounded=!0,this.cropperSettings.minWithRelativeToResolution=!1,this.cropperSettings.noFileInput=!0,this.cropperSettings.cropperDrawSettings.strokeColor="rgba(255,255,255,1)",this.cropperSettings.cropperDrawSettings.strokeWidth=1}return Object.defineProperty(t.prototype,"image",{set:function(t){var e=this;t&&t.fileId&&!this.personPhotoLink&&this.imageCropService.blobServiceRequestAccess(this.service,t.fileId,!0).subscribe((function(t){e.personPhotoLink=t.result.locationURI}))},enumerable:!0,configurable:!0}),t.prototype.onUploadHandler=function(t){var e=this;if(this.file=t.files[0],this.file&&this.file.size>5e6)return this.file=null,this.imageCrop=[],void this.toastService.showError("O tamanho máximo permitido para a imagem é de 5MB");this.display=!1;var o=new Image,n=new FileReader;n.onloadend=function(t){o.src=t.target.result,e.cropper.setImage(o)},n.readAsDataURL(this.file),this.display=!0},t.prototype.ngOnInit=function(){this.data.image=null,this.personPhotoLink=null,this.personFirstName="",this.display=!1},t.prototype.showDialog=function(){this.display=!0},t.prototype.onHide=function(){this.display=!1},t.prototype.reset=function(){this.file=null,this.data={},this.imageCrop=[],this.cropper.reset(),this.data.image=null,this.personPhotoLink=null,this.personFirstName=""},t.prototype.saveImage=function(){return V(this,void 0,void 0,(function(){var t,e,o,n=this;return j(this,(function(i){switch(i.label){case 0:return this.file?(t=this.file.name,this.cropper&&this.cropper.image?[4,this.urltoFile(this.cropper.image.image,t)]:[3,2]):(this.onClickSave.emit(null),this.onHide(),[2]);case 1:e=i.sent(),this.personPhotoLink=this.data.image,o=null,this.file?o={fileName:this.file.name}:this.data&&(o={fileName:this.data.fileId.split("/")[1]}),o&&(this,this.imageCropService.blobServiceRequestUpload(this.service,o).subscribe((function(t){var o=new XMLHttpRequest;o.open("PUT",t.result.locationURI,!0),o.setRequestHeader("Translate","f"),o.send(e),n.onClickSave.emit(t.result),n.onHide()}))),i.label=2;case 2:return[2]}}))}))},t.prototype.urltoFile=function(t,e,o){return void 0===o&&(o=null),o=o||(t.match(/^data:([^;]+);/)||"")[1],fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return new File([t],e,{type:o})}))},t.prototype.deleteImage=function(){this.imageCropService.blobServiceFileDelete(this.service,this.data&&this.data.image&&this.data.image.fileId),this.reset()},t.ctorParameters=function(){return[{type:Ut},{type:Rt}]},N([e.Input()],t.prototype,"service",void 0),N([e.Output()],t.prototype,"onClickSave",void 0),N([e.ViewChild("cropper",{static:!1})],t.prototype,"cropper",void 0),N([e.Input()],t.prototype,"image",null),t=N([e.Component({selector:"image-crop",template:'<a (click)="showDialog()">\n <span class="result rounded">\n <img class="center-block" style="max-width: 100%; height: auto"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson" [alt]="personFirstName"\n width="auto" height="140">\n </span>\n</a>\n\n<p-dialog [(visible)]="display" modal="true" [minWidth]="450" (onHide)="onHide()">\n <p-header>\n {{\'hcm.payroll.employees_image_cropper_edit\' | translate}}\n </p-header>\n\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-12 img-user-modal" *ngIf="!personPhotoLink">\n <i class="fa fa-user-circle fa-5x"></i>\n <div id="txt-select-image">{{\'hcm.payroll.employees_image_cropper_viewing\' | translate}}</div>\n <div class="ui-md-4 btn-center">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n </div>\n </div>\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\' | translate}}"></button>\n </div>\n <div class="ui-g-12 ui-md-12" *ngIf="personPhotoLink">\n <span class="result rounded">\n <img class="center-block default-image"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson"\n [alt]="personFirstName"\n width="auto"\n height="140">\n </span>\n </div>\n </div>\n <div class="ui-g" [style.display]="data.image ? \'block\' : \'none\'">\n <div class="ui-md-4 btn-left">\n <p-fileUpload chooseLabel="Selecionar foto"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\'|translate}}"></button>\n </div>\n <div class="ui-md-12">\n <img-cropper #cropper [image]="data" [settings]="cropperSettings"></img-cropper>\n </div>\n </div>\n\n <p-footer>\n <button pButton type="button" class="btn-link ui-button-link" (click)="display=false"\n label="{{\'hcm.payroll.employees_image_cropper_cancel\' | translate}}"></button>\n <button pButton type="button" (click)="saveImage()" label="{{\'hcm.payroll.employees_image_cropper_save\'|translate}}"></button>\n </p-footer>\n</p-dialog>\n',styles:[".center{float:left;position:relative;left:30%}.btn-center{float:left;position:relative;left:33%}.btn-left{float:left;position:relative}.rounded{cursor:pointer}.result.rounded>img{border-radius:50%}div.cropper{height:400px}.center-block{display:block;margin-right:auto;margin-left:auto}.ui-fileupload-choose{width:300px!important}.fa-user-circle{color:#ccc}.img-user-modal{text-align:center!important}#txt-select-image{margin:20px 0;font-weight:700;font-size:16px}"]})],t)}(),Gt=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,w.DialogModule,k.ButtonModule,C.FileUploadModule,_.ImageCropperModule,_.ImageCropperModule,h.ThumbnailModule],declarations:[Yt],providers:[Ut,h.ImageCropperService],exports:[Yt]})],t)}(),Ht=y,Kt=function(){function t(t){this.localeService=t,this.onBlurGetMoment=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.mask=null}return t.prototype.ngOnInit=function(){var t=this;this.localeService.get().subscribe((function(e){if(t.mask=t.formatMask(e),t.format=t.getFormat(),t.model){var o=t.model,n=Ht(o,t.format||"YYYY-MM-DD");n.isValid()?(t.model=n.format(t.format||"L"),t._date=n):t._date=null}}))},t.prototype.formatMask=function(t){this.locale=t;var e=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),(e=e.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},t.prototype.getFormat=function(){var t=this.locale.calendar.dateFormat.toString();return t=t.replace(/[y]/g,"YY"),this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),t.toUpperCase()},Object.defineProperty(t.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),t.prototype.onBlur=function(){var t=this.model;this._date=Ht(t,this.format),this.onBlurGetMoment.emit(this._date)},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:h.LocaleService}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"withoutDay",void 0),N([e.Input()],t.prototype,"unmask",void 0),N([e.Input()],t.prototype,"style",void 0),N([e.Input()],t.prototype,"styleClass",void 0),N([e.Output()],t.prototype,"onBlurGetMoment",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-date-calendar-model",template:'<p-inputMask *ngIf="mask"\n [mask]="mask"\n (onBlur)="onBlur()"\n [unmask]="unmask"\n [placeholder]="placeholder"\n [disabled]="disabled"\n [(ngModel)]="model"\n [style]="style"\n [styleClass]="styleClass"\n></p-inputMask>\n'})],t)}(),Wt=function(){function t(){}return t=N([e.NgModule({imports:[u.InputMaskModule,o.FormsModule,o.ReactiveFormsModule,p.CommonModule],declarations:[Kt],exports:[Kt]})],t)}(),zt=y;function $t(t){return t&&"object"==typeof t&&!Array.isArray(t)}function Qt(t){return!Array.isArray(t)||!t.find((function(t){return"object"==typeof t}))}function Jt(t){return 0===t||"boolean"==typeof t||null!=t&&""!==t}function Xt(t,e){return void 0===e&&(e=!0),!t||!Zt(t,e)||(e?zt(t.replace(/[^\d]+/g,""),"DDMMYYYY").isValid():zt(t.replace(/[^\d]+/g,""),"MMYYYY").isValid())}function Zt(t,e){if(void 0===e&&(e=!0),t){var o=void 0;return o=e?8:6,t.replace(/[^\d]+/g,"").length===o}return!0}function te(t,e){return-1!==t.search("Date")?ee(e):e}function ee(t,e,o){if(void 0===e&&(e="DDMMYYYY"),void 0===o&&(o="YYYY-MM-DD"),Jt(t)){var n=oe(t,e);return zt(t.replace(/[^\d]+/g,""),n).format(o)}}function oe(t,e){return-1!==t.search("/")?"DDMMYYYY":-1!==t.search("-")?"YYYYMMDD":e}function ne(t){return void 0===t&&(t="YYYY-MM-DD"),zt().format(t)}function ie(t,e){void 0===e&&(e="DDMMYYYY");var o=oe(t,e);return zt(t.replace(/[^\d]+/g,""),o)}function re(t,e){return e?zt(t,e):zt(t)}function ae(t){var e=[];return Object.entries(t).forEach((function(t){var o=U(t,2),n=o[0],i=o[1];e.push({field:n,value:i})})),e}function se(t){var e={};return t&&t.length&&t.forEach((function(t){"date"===t.type&&t.value&&(t.value=re(t.value).format("L")),e[t.field]=t.value})),e}function le(){var t=this;Object.keys(this.controls).map((function(e){var n=t.get(e);n.markAsDirty(),(n instanceof o.FormGroup||n instanceof o.FormArray)&&le.call(n)}))}function pe(t,e,n,i){n?(t.controls[e].setValidators(o.Validators.compose(i&&i.length?i:[o.Validators.required])),t.controls[e].updateValueAndValidity()):(t.controls[e].setValidators(null),t.controls[e].updateValueAndValidity())}function ce(t,e,o,n){e?o.forEach((function(e){return t.get(e).enable()})):(o.forEach((function(e){return t.get(e).disable()})),he(t,n||o))}function ue(t,e,n){n&&n.length?(t.controls[e].setValidators(o.Validators.compose(n)),t.controls[e].updateValueAndValidity()):(t.controls[e].setValidators(null),t.controls[e].updateValueAndValidity())}function de(t,e,o,n){void 0===n&&(n=!0),e?(t.get(o).disable(),n&&t.get(o).reset()):t.get(o).enable()}function me(t,e){return void 0===e&&(e="ASC"),function(o,n){if(!o.hasOwnProperty(t)||!n.hasOwnProperty(t))return 0;var i="string"==typeof o[t]?o[t].toUpperCase():o[t],r="string"==typeof n[t]?n[t].toUpperCase():n[t],a=0;return i>r?a=1:i<r&&(a=-1),"DESC"===e?-1*a:a}}function he(t,e){e.forEach((function(e){return t.get(e).reset()}))}function ye(t){if(t){var e=t.calendar.dateFormat.toString();return(e=(e=e.replace(/[y]/g,"YY")).replace(/[/]/g,"")).toUpperCase()}}function fe(t){return t?t.toString().replace(/[&\/\\#,+()$~%.'":*?<>{}-]/g,""):null}var ge=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),be=function(){function o(o){this.service=o,this.forceSelection=!0,this.keyName="name",this.keyToExclude=[],this.usingType=[],this.minCharactersToSearch=3,this.multiple=!1,this.serviceType=t.ServiceType.PAYROLL,this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.suggestions=[]}return o.prototype.ngOnInit=function(){},o.prototype.filterQuery=function(e){var o=this,n=e.query;if(!(isNaN(n)&&n.toString().length<this.minCharactersToSearch))try{if(this.isTimetrackingSituation)return this.service.query("autocompleteTimetrackingSituation",{valueSearch:n,referenceDate:this.referenceDate}).subscribe((function(t){return o.formaterResponce(t.result)}));if(this.isDismissalReason){var i={valueSearch:n};return this.referenceDate&&(i.referenceDate=this.referenceDate),this.service.query("autocompleteDismissalReason",i,t.ServiceType.GENERAL_REGISTER).subscribe((function(t){return o.formaterResponce(t.result)}))}if(this.usingType&&this.usingType.length)return this.service.query("autocompleteOtherCompanyFilterUsingType",{searchText:n,usingType:this.usingType}).subscribe((function(t){return o.formaterResponce(t.result)}));if(this.isDepartmentFromCompany)return this.service.query("autocompleteDepartmentQuery",{searchText:n,companyId:this.companyId,referenceDate:this.referenceDate}).subscribe((function(t){return o.formaterResponce(t.result)}));if(this.isSituationDefinition){i={searchText:n};return this.service.query("autocompleteSituationDefinitionQuery",i,t.ServiceType.PAYROLL).subscribe((function(t){return o.formaterResponce(t.result)}))}if(this.isWagetype){i={searchText:n,companyId:this.companyId};return this.service.query("autocompleteWagetypeQuery",i,t.ServiceType.ENTRY).subscribe((function(t){return o.formaterResponce(t.result)}))}this.service.query("autocomplete",this.getParamsRest(n),this.serviceType).subscribe((function(t){return o.formaterResponce(t.result)}))}catch(t){console.log(t)}},o.prototype.formaterResponce=function(t){var e=this;this.suggestions=[];var o=[];return t.map((function(t){var n={tableId:t.tableId,name:""};if(e.isTimetrackingSituation||e.isDismissalReason||e.usingType&&e.usingType.length){if(e.keyToExclude.includes(t.fields&&t.fields[2]&&t.fields[2].value))return;var i="";t.fields.map((function(t){n[t.name]=t.value})),i+=t.fields.filter((function(t){return"code"===t.name.toLowerCase()})).map((function(t){return t?t.value+=" - ":""}))[0],!e.usingType||!e.usingType.length||i&&"undefined"!==i||(i=""),i+=t.fields.filter((function(t){return"name"===t.name.toLowerCase()})).map((function(t){return t?t.value:""}))[0],n.name=i,o.push(n)}else{t.fields.map((function(t){n[t.name]=t.value}));var r="";e.concatFieldsForName?(e.concatFieldsForName.map((function(t){(t.includes("date")||t.includes("Birthday"))&&(n[t]=re(n[t]).format("DD/MM/YYYY")),r+=n[t]+" - "})),r=r.slice(0,-3)):(e.keyCode&&(r+=n[e.keyCode]+" - "),e.keyName&&(r+=n[e.keyName])),n.name=r,o.push(n)}})),this.suggestions=Y(o),o},o.prototype.getParamsRest=function(t){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(t),enableEntityFilters:this.enableEntityFilters}},o.prototype.getConditionsRest=function(t){var e=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+t}];return this.conditions&&this.conditions.map((function(t){(["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(t.expression)||Jt(t.value))&&e.push(t)})),e},o.prototype.selectOption=function(t){this.onSelect.emit(t)},o.prototype.onClearItem=function(t){return V(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.onClear.emit(t)];case 1:return e.sent(),this.form.get(this.name).reset(),[2]}}))}))},o.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},o.prototype.onDropdownClick=function(){this.isDropdown=!0},Object.defineProperty(o.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObject},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:ge}]},N([e.ViewChild("autoCompleteObject",{static:!0})],o.prototype,"_autoCompleteObject",void 0),N([e.Input()],o.prototype,"name",void 0),N([e.Input()],o.prototype,"table",void 0),N([e.Input()],o.prototype,"order",void 0),N([e.Input()],o.prototype,"enableEntityFilters",void 0),N([e.Input()],o.prototype,"fields",void 0),N([e.Input()],o.prototype,"conditionsFields",void 0),N([e.Input()],o.prototype,"conditions",void 0),N([e.Input()],o.prototype,"placeholder",void 0),N([e.Input()],o.prototype,"readonly",void 0),N([e.Input()],o.prototype,"required",void 0),N([e.Input()],o.prototype,"disabled",void 0),N([e.Input()],o.prototype,"dropdown",void 0),N([e.Input()],o.prototype,"forceSelection",void 0),N([e.Input()],o.prototype,"error",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"keyCode",void 0),N([e.Input()],o.prototype,"keyName",void 0),N([e.Input()],o.prototype,"concatFieldsForName",void 0),N([e.Input()],o.prototype,"itemSelect",void 0),N([e.Input()],o.prototype,"form",void 0),N([e.Input()],o.prototype,"inputId",void 0),N([e.Input()],o.prototype,"isTimetrackingSituation",void 0),N([e.Input()],o.prototype,"isDepartmentFromCompany",void 0),N([e.Input()],o.prototype,"companyId",void 0),N([e.Input()],o.prototype,"referenceDate",void 0),N([e.Input()],o.prototype,"isDismissalReason",void 0),N([e.Input()],o.prototype,"keyToExclude",void 0),N([e.Input()],o.prototype,"usingType",void 0),N([e.Input()],o.prototype,"minCharactersToSearch",void 0),N([e.Input()],o.prototype,"isWagetype",void 0),N([e.Input()],o.prototype,"isSituationDefinition",void 0),N([e.Input()],o.prototype,"multiple",void 0),N([e.Input()],o.prototype,"serviceType",void 0),N([e.Output()],o.prototype,"onBlur",void 0),N([e.Output()],o.prototype,"onSelect",void 0),N([e.Output()],o.prototype,"onClear",void 0),o=N([e.Component({selector:"input-rest-auto-complete",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],o)}(),ve=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[be],providers:[ge],exports:[be]})],t)}(),Ie=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Se=function(){function t(t){this.service=t,this.forceSelection=!0,this.keyName="name",this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(!(isNaN(o)&&o.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(o)).subscribe((function(t){return e.formaterResponce(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.formaterResponce=function(t){this.suggestions=[];var e=[];return t.map((function(t){var o={tableId:t.tableId,code:"",name:"",fullname:"",admission:"",document:""};t.fields&&t.fields.length&&(o.fullname=t.fields[0].value,o.admission=t.fields[1].value,o.document=t.fields[2].value,o.code=4===t.fields.length&&t.fields[3].value,o.code?o.name=o.code.concat(" - ").concat(o.fullname).concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")):o.name=o.fullname.concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")),e.push(o))})),this.suggestions=e,e},t.prototype.getParamsRest=function(t){var e={valueSearch:t,enableEntityFilters:this.enableEntityFilters};return this.company&&(e.company=this.company),this.branch&&(e.companyBranch=this.branch),this.employeeType&&(e.employeeType=this.employeeType),this.otherContractType&&(e.otherContractType=this.otherContractType),!1===this.filterEmployeeType&&(e.filterEmployeeType=this.filterEmployeeType),e},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},t.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},t.prototype.onDropdownClick=function(){this.isDropdown=!0},t.ctorParameters=function(){return[{type:Ie}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"value",void 0),N([e.Input()],t.prototype,"company",void 0),N([e.Input()],t.prototype,"branch",void 0),N([e.Input()],t.prototype,"employeeType",void 0),N([e.Input()],t.prototype,"otherContractType",void 0),N([e.Input()],t.prototype,"filterEmployeeType",void 0),N([e.Input()],t.prototype,"enableEntityFilters",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"keyCode",void 0),N([e.Input()],t.prototype,"keyName",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),t=N([e.Component({selector:"input-rest-auto-complete-employee",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],t)}(),_e=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Se],providers:[Ie],exports:[Se]})],t)}(),ke=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),we=function(){function t(t,o){this.service=t,this.activatedRoute=o,this.forceSelection=!0,this.keyName="name",this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.suggestions=[],this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.useWorkflow=!(!e||!e.useWorkflow)}))},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(!(isNaN(o)&&o.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(o)).subscribe((function(t){return e.formaterResponce(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.formaterResponce=function(t){this.suggestions=[];var e=[];return t.map((function(t){var o={tableId:t.tableId,code:"",name:"",fullname:"",admission:"",document:""};t.fields&&t.fields.length&&(o.fullname=t.fields[0].value,o.admission=t.fields[1].value,o.document=t.fields[2].value,o.code=4===t.fields.length&&t.fields[3].value,o.code?o.name=o.code.concat(" - ").concat(o.fullname).concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")):o.name=o.fullname.concat(" - ").concat(ie(o.admission).format("DD/MM/YYYY")),e.push(o))})),this.suggestions=e,e},t.prototype.getParamsRest=function(t){var e={valueSearch:t};return this.company&&(e.company=this.company),this.branch&&(e.companyBranch=this.branch),this.employeeType&&(e.employeeType=this.employeeType),this.useWorkflow&&(e.timeTrackingResumeType={key:"FIRED"}),e},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},t.prototype.onBlurItem=function(t){this.onBlur.emit(t)},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:ke},{type:r.ActivatedRoute}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"value",void 0),N([e.Input()],t.prototype,"company",void 0),N([e.Input()],t.prototype,"branch",void 0),N([e.Input()],t.prototype,"employeeType",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"keyCode",void 0),N([e.Input()],t.prototype,"keyName",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"style",void 0),N([e.Input()],t.prototype,"inputStyle",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-rest-auto-complete-employee-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n</p-autoComplete>\n',styles:[""]})],t)}(),Ce=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,ut,v.HttpClientModule,E.AutoCompleteModule,o.ReactiveFormsModule],declarations:[we],providers:[ke],exports:[we]})],t)}(),De=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o={names:[e]};return this.http.enumQuery("enumQuery",o,t)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Te=function(){function t(t){this.service=t,this.forceSelection=!0,this.keyToExclude=[],this.keyToKeep=[],this.multiple=!1,this.onSelect=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.onClear=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){var t=this;try{this.service.query(this.server,this.enumeration).subscribe((function(e){return t.payload=e.results[0].items}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(this.suggestions=[],!(isNaN(o)&&o.toString().length<3)){this.keyToExclude&&this.keyToExclude.length?this.payload=this.payload&&this.payload.filter((function(t){return!e.keyToExclude.includes(t.key)})):this.keyToKeep&&this.keyToKeep.length&&(this.payload=this.payload&&this.payload.filter((function(t){return e.keyToKeep.includes(t.key)})));for(var n=0;n<this.payload.length;n++){var i=this.payload[n];-1!==i.value.toLowerCase().indexOf(o.toLowerCase())&&this.suggestions.push(i)}}},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},t.prototype.onDropdownClick=function(){this.isDropdown=!0},t.prototype.onClearItem=function(t){return V(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.onClear.emit(t)];case 1:return e.sent(),this.form.get(this.name).reset(),[2]}}))}))},Object.defineProperty(t.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObjectEl},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:De}]},N([e.ViewChild("autoCompleteObject",{static:!0})],t.prototype,"_autoCompleteObjectEl",void 0),N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Input()],t.prototype,"keyToExclude",void 0),N([e.Input()],t.prototype,"keyToKeep",void 0),N([e.Input()],t.prototype,"server",void 0),N([e.Input()],t.prototype,"enumeration",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"multiple",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onClear",void 0),t=N([e.Component({selector:"input-rest-auto-complete-enum",template:'<div [formGroup]="form">\n <p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],t)}(),Ee=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Te],providers:[De],exports:[Te]})],t)}(),Fe=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),Ae=function(){function o(t){this.service=t,this.forceSelection=!0,this.keyName="name",this.keysToExclude=[],this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.onFocus=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.suggestions=[]}return o.prototype.ngOnInit=function(){},o.prototype.filterQuery=function(e){var o=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{if(this.isWagetype){var i=R({searchText:n,companyId:this.companyId},this.wagetypeReferenceDates);return this.service.query("autocompleteWagetypeQuery",i,t.ServiceType.ENTRY).subscribe((function(t){return o.formaterResponce(t.result)}))}this.service.query("autocomplete",this.getParamsRest(n)).subscribe((function(t){return o.formaterResponce(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},o.prototype.formaterResponce=function(t){var e=this;this.suggestions=[];var o=[];return t.map((function(t){var n={tableId:t.tableId,name:""};if(t.fields.map((function(t){n[t.name]=t.value})),!e.keysToExclude.includes(t&&t.tableId)){var i="";e.concatFieldsForName?(e.concatFieldsForName.map((function(t){t.includes("date")&&(n[t]=re(n[t]).format("L")),i+=n[t]+" - "})),i=i.slice(0,-3)):(e.keyCode&&(i+=n[e.keyCode]+" - "),e.keyName&&(i+=n[e.keyName])),n.name=i,o.push(n)}})),this.suggestions=o,o},o.prototype.getParamsRest=function(t){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(t)}},o.prototype.getConditionsRest=function(t){var e=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+t}];return this.conditions&&this.conditions.map((function(t){!["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(t.expression)&&Jt(t.value)&&e.push(t)})),e},o.prototype.selectOption=function(t){this.onSelect.emit(t)},o.prototype.onClearItem=function(t){this.onClear.emit(t)},o.prototype.onBlurItem=function(t){this.onBlur.emit(t)},o.prototype.onFocusItem=function(t){this.onFocus.emit(t)},Object.defineProperty(o.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:Fe}]},N([e.Input()],o.prototype,"name",void 0),N([e.Input()],o.prototype,"table",void 0),N([e.Input()],o.prototype,"order",void 0),N([e.Input()],o.prototype,"fields",void 0),N([e.Input()],o.prototype,"conditionsFields",void 0),N([e.Input()],o.prototype,"conditions",void 0),N([e.Input()],o.prototype,"placeholder",void 0),N([e.Input()],o.prototype,"readonly",void 0),N([e.Input()],o.prototype,"required",void 0),N([e.Input()],o.prototype,"disabled",void 0),N([e.Input()],o.prototype,"dropdown",void 0),N([e.Input()],o.prototype,"forceSelection",void 0),N([e.Input()],o.prototype,"error",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"keyCode",void 0),N([e.Input()],o.prototype,"keyName",void 0),N([e.Input()],o.prototype,"concatFieldsForName",void 0),N([e.Input()],o.prototype,"itemSelect",void 0),N([e.Input()],o.prototype,"style",void 0),N([e.Input()],o.prototype,"inputStyle",void 0),N([e.Input()],o.prototype,"keysToExclude",void 0),N([e.Input()],o.prototype,"isWagetype",void 0),N([e.Input()],o.prototype,"companyId",void 0),N([e.Input()],o.prototype,"wagetypeReferenceDates",void 0),N([e.Output()],o.prototype,"onBlur",void 0),N([e.Output()],o.prototype,"onSelect",void 0),N([e.Output()],o.prototype,"onClear",void 0),N([e.Output()],o.prototype,"onFocus",void 0),N([e.Output()],o.prototype,"modelChange",void 0),N([e.Input()],o.prototype,"model",null),o=N([e.Component({selector:"input-rest-auto-complete-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onFocus)="onFocusItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]})],o)}(),Pe=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Ae],providers:[Fe],exports:[Ae]})],t)}(),xe=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o={names:[e]};return this.http.enumQuery("enumQuery",o,t)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Me=function(){function t(t){this.service=t,this.forceSelection=!0,this.onSelect=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.onClear=new e.EventEmitter,this.modelChange=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){var t=this;try{this.service.query(this.server,this.enumeration).subscribe((function(e){return t.payload=e.results}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.filterQuery=function(t){var e=t.query;if(this.suggestions=[],!(isNaN(e)&&e.toString().length<3))for(var o=0;o<this.payload[0].items.length;o++){var n=this.payload[0].items[o];-1!==n.value.toLowerCase().indexOf(e.toLowerCase())&&this.suggestions.push(n)}},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onBlurItem=function(t){this.onBlur.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:xe}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"style",void 0),N([e.Input()],t.prototype,"inputStyle",void 0),N([e.Input()],t.prototype,"server",void 0),N([e.Input()],t.prototype,"enumeration",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"input-rest-auto-complete-model-enum",template:'<p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]})],t)}(),Le=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule],declarations:[Me],providers:[xe],exports:[Me]})],t)}(),Oe=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Be=function(){function t(t){this.service=t,this.forceSelection=!0,this.minCharactersToSearch=3,this.multiple=!1,this.onBlur=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.onFocus=new e.EventEmitter,this.suggestions=[]}return t.prototype.ngOnInit=function(){},t.prototype.filterQuery=function(t){var e=this,o=t.query;if(!(isNaN(o)&&o.toString().length<this.minCharactersToSearch))try{this.service.query("autocompleteJobpositionQuery",this.getParamsRest(o)).subscribe((function(t){return e.formaterResponse(t.result)}))}catch(t){console.log("Erro ao buscar no back")}},t.prototype.formaterResponse=function(t){this.suggestions=[];var e=[];return t.map((function(t){var o={tableId:t.tableId,name:""};t.fields.map((function(t){o[t.name]=t.value})),o.name=o.Code+" - "+o.Name,e.push(o)})),this.suggestions=e,e},t.prototype.getParamsRest=function(t){return{searchText:t,companyId:this.companyId?this.replace(this.companyId):null,creationDate:this.creationDate?this.replace(this.creationDate):null,expirationDate:this.expirationDate?this.replace(this.expirationDate):null,jobpositionsFilter:this.jobpositionsFilter?this.replaceArray(this.jobpositionsFilter):null,ignoredJobpositions:this.ignoredJobpositions?this.replaceArray(this.ignoredJobpositions):null,order:this.order}},t.prototype.replace=function(t){return t.replace(new RegExp("'","g"),"")},t.prototype.replaceArray=function(t){var e=this;return t.map((function(t){return e.replace(t)}))},t.prototype.selectOption=function(t){this.onSelect.emit(t)},t.prototype.onClearItem=function(t){this.onClear.emit(t)},t.prototype.onBlurItem=function(t){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(t))},t.prototype.onDropdownClick=function(){this.isDropdown=!0},t.ctorParameters=function(){return[{type:Oe}]},N([e.Input()],t.prototype,"name",void 0),N([e.Input()],t.prototype,"value",void 0),N([e.Input()],t.prototype,"companyId",void 0),N([e.Input()],t.prototype,"creationDate",void 0),N([e.Input()],t.prototype,"expirationDate",void 0),N([e.Input()],t.prototype,"jobpositionsFilter",void 0),N([e.Input()],t.prototype,"ignoredJobpositions",void 0),N([e.Input()],t.prototype,"order",void 0),N([e.Input()],t.prototype,"placeholder",void 0),N([e.Input()],t.prototype,"readonly",void 0),N([e.Input()],t.prototype,"required",void 0),N([e.Input()],t.prototype,"disabled",void 0),N([e.Input()],t.prototype,"dropdown",void 0),N([e.Input()],t.prototype,"forceSelection",void 0),N([e.Input()],t.prototype,"error",void 0),N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"itemSelect",void 0),N([e.Input()],t.prototype,"form",void 0),N([e.Input()],t.prototype,"inputId",void 0),N([e.Input()],t.prototype,"minCharactersToSearch",void 0),N([e.Input()],t.prototype,"multiple",void 0),N([e.Output()],t.prototype,"onBlur",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"onFocus",void 0),t=N([e.Component({selector:"input-rest-auto-complete-jobposition",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]})],t)}(),Re=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,m.SharedModule,o.ReactiveFormsModule],declarations:[Be],providers:[Oe],exports:[Be]})],t)}(),Ne=function(){function t(t){this.http=t}return t.prototype.query=function(t,e){var o="queries/"+t;return this.http.post(o,e)},t.prototype.queryEntity=function(t,e){return this.http.get(t)},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Ve=function(){function t(t,o){this.translateService=t,this.service=o,this.arguments={page:{current:1,size:"10"}},this.alwaysShowPaginator=!1,this.onLoadPayload=new e.EventEmitter,this.loadedList=new e.EventEmitter}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){t.hasOwnProperty("arguments")&&(this.arguments=Object.assign({},t.arguments.currentValue),this.getList(1)),t.hasOwnProperty("reload")&&!0===t.reload.currentValue&&this.getList(1)},t.prototype.getList=function(t){var e=this;this.loadedList.emit(!0);try{var o=Object.assign({},this.arguments);o.page.current=t,this.isEntity?this.service.queryEntity(this.urlRest,o).subscribe((function(o){e.onResponseQuery(o,t),e.loadedList.emit(!1)})):this.service.query(this.urlRest,o).subscribe((function(o){e.onResponseQuery(o.result,t),e.loadedList.emit(!1)}))}catch(t){console.log("Erro ao tentar buscar lista no back")}},t.prototype.onResponseQuery=function(t,e){this.payload=this.filterValues?this.filterValues.bind(this.scope)(t[this.keyPayload]):t[this.keyPayload],this.onLoadPayload.emit({result:t[this.keyPayload],page:e}),this.totalRecords=this.isEntity?t.totalElements:t.countResult},t.prototype.onHandlePage=function(t){var e=t.first/t.rows+1;this.getList(e)},t.prototype.getRowActions=function(t){return this.getRowActionsFun.call(this.scope,t)},t.prototype.handleClickActions=function(t){t.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},t.ctorParameters=function(){return[{type:a.TranslateService},{type:Ne}]},N([e.Input()],t.prototype,"emptyMessage",void 0),N([e.Input()],t.prototype,"urlRest",void 0),N([e.Input()],t.prototype,"keyPayload",void 0),N([e.Input()],t.prototype,"columns",void 0),N([e.Input()],t.prototype,"arguments",void 0),N([e.Input()],t.prototype,"filterValues",void 0),N([e.Input()],t.prototype,"getRowActionsFun",void 0),N([e.Input()],t.prototype,"scope",void 0),N([e.Input()],t.prototype,"reload",void 0),N([e.Input()],t.prototype,"isEntity",void 0),N([e.Input()],t.prototype,"alwaysShowPaginator",void 0),N([e.Output()],t.prototype,"onLoadPayload",void 0),N([e.Output()],t.prototype,"loadedList",void 0),t=N([e.Component({selector:"list-rest",template:'<p-table [value]="payload" reorderableColumns="true" [rows]="10" [totalRecords]="totalRecords" [paginator]="true" [pageLinks]="8"\n [alwaysShowPaginator]="alwaysShowPaginator" [responsive]="true" [lazy]="true" (onPage)="onHandlePage($event)">\n <p-column *ngFor="let col of columns;" [field]="col[\'field\']" [header]="col[\'label\']|translate" [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <span>{{data[col[\'field\']]}}</span>\n </ng-template>\n </p-column>\n\n <p-column [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\', \'overflow\': \'inherit\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <p-splitButton *ngIf="getRowActions(data).length > 1" label="{{\'hcm.payroll.action\' | translate}} &#9660;" [model]="getRowActions(data)"\n (onClick)="handleClickActions(button)" #button></p-splitButton>\n <button *ngIf="getRowActions(data).length <= 1" type="button" class="sds-button-aux aux-secondary" (click)="getRowActions(data)[0].command()">\n {{getRowActions(data)[0].label}}\n </button>\n </ng-template>\n </p-column>\n\n <ng-template pTemplate="emptymessage">\n {{ emptyMessage }}\n </ng-template>\n</p-table>\n',styles:["tr{border:1px solid #ddd!important}"]})],t)}(),je=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,ut,v.HttpClientModule,b.TableModule,d.InputTextModule,k.ButtonModule,F.SplitButtonModule],declarations:[Ve],providers:[Ne],exports:[Ve]})],t)}(),qe=function(){function t(){}return t=N([e.Component({selector:"spinner-loader",template:"<p-progressSpinner></p-progressSpinner>\n"})],t)}(),Ue=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,i.ProgressSpinnerModule],declarations:[qe],exports:[qe]})],t)}(),Ye=function(){function t(){this.company={},this.contractNationality={},this.contractType={}}return t.prototype.setCompany=function(t){this.company=t},t.prototype.getCompanyId=function(){return this.company.companyId},t.prototype.setContractNationality=function(t){this.contractNationality=t},t.prototype.isBrazilianAdmission=function(){return"BR"===this.company.abbreviation&&"National"===this.contractNationality.key},t.prototype.isBrazilAndforeignContract=function(){return"BR"===this.company.abbreviation&&"National"!==this.contractNationality.key},t.prototype.isForeignAdmission=function(){return"BR"!==this.company.abbreviation&&"National"===this.contractNationality.key},t.prototype.isForeignAndforeignContract=function(){return"BR"!==this.company.abbreviation&&"National"!==this.contractNationality.key},t.prototype.isBrazilianCompany=function(){return"BR"===this.company.abbreviation},t.prototype.isNationalContract=function(){return"National"===this.contractNationality.key},t.prototype.getCountryID=function(){return this.company.id},Object.defineProperty(t.prototype,"contractNationalityKey",{get:function(){return this.contractNationality.key},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"abbreviation",{get:function(){return this.company.abbreviation},enumerable:!0,configurable:!0}),t.prototype.getCurrency=function(){return this.company.currency},t.prototype.getStructureID=function(){return this.company.structure},t.prototype.setContractType=function(t){this.contractType=t},Object.defineProperty(t.prototype,"contractTypeKey",{get:function(){return this.contractType?this.contractType.key:this.contractType},enumerable:!0,configurable:!0}),t=N([e.Injectable()],t)}(),Ge=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule],providers:[Ye]})],t)}(),He=y;function Ke(t){return/^\d*$/.test(t)}function We(t){return t||!1}function ze(t){return Ke(We(t))?Number.parseInt(t):0}var $e=function(){function t(t){this.http=t,this.companyUseWorkstationGroupSubject=new f.Subject}return t.prototype.getCompanyIndications=function(t,e){return this.http.query("companyIndicationQuery",{companyId:t,companyIndicationType:e}).pipe(s.map((function(t){return t.result})))},t.prototype.setCompanyUseWorkstationGroup=function(t){this.companyUseWorkstationGroupSubject.next(t)},t.prototype.setStructure=function(t){this.structure=t},t.prototype.getStructure=function(){return this.structure},t.prototype.getCompanyUseWorkstationGroup=function(){return this.companyUseWorkstationGroupSubject.asObservable()},t.prototype.setUseWorkstationGroup=function(t){this.useWorkstationGroup=t},t.prototype.getUseWorkstationGroup=function(){return this.useWorkstationGroup},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Qe=function(){function t(t){this.http=t}return t.prototype.hasModule=function(t){return this.http.query("hasModule",{module:t})},t.ctorParameters=function(){return[{type:Nt}]},t=N([e.Injectable()],t)}(),Je=y,Xe=function(){function t(t,e,o){this.http=t,this.messageService=e,this.translateService=o,this._httpParams=new v.HttpParams}return t.prototype.lookupRequestPost=function(t,e,o,n){return void 0===o&&(o=null),this.httpPostParams=t,this.postConfigPageSize(t),this.lookupDisplayField=n,this.concatFields=o,this.postDataLookup(e)},t.prototype.postConfigPageSize=function(t){t&&(this.httpPostParams.page.size=t.page&&t.page.size?t.page.size:10,this.httpPostParams.page.current=t.page&&t.page.current?t.page.current:0)},t.prototype.lookupRequest=function(t,e,o,n,i,r,a,s){return void 0===a&&(a=[]),void 0===s&&(s=[]),this.searchLookupFields=o,this.endpoint=e,this.parameters=s,this.concatFields=i,this.concatOtherFields=a,this.lookupDisplayField=r,this.searchFields=n,this.generateLookupParameters(t),this.configHttpParamsPagination("10","0"),this.configHttpParamsOrderBy(t.multiSortMeta),this.getDataLookup()},t.prototype.searchRequest=function(t,e,o,n,i,r,a){return void 0===r&&(r=[]),void 0===a&&(a=[]),this.endpoint=e,this.parameters=a,this.concatFields=n,this.concatOtherFields=r,this.lookupDisplayField=i,this.searchFields=o,this.generateGridParameters(t.filterData),this.configHttpParamsPagination(t.rows.toString(),Math.floor(t.first/t.rows).toString()),this.configHttpParamsOrderBy(t.multiSortMeta),this.getDataLookup()},t.prototype.getDataLookup=function(){var t=this;return this.getUrlDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(e){var o=e.contents;return t.concatFields&&t.concatFields.length&&o.map((function(e){t.convertGridFieldValue(e),e[t.lookupDisplayField]=t.generateDisplayFieldValue(R({},e))})),e})))},t.prototype.postDataLookup=function(t){var e=this;return this.postUrlDataLookup(t,this.httpPostParams).pipe(s.map((function(t){var o=t.contents;return e.concatFields&&e.concatFields.length&&o.map((function(t){e.concatOtherFields&&e.convertGridFieldValue(t),t[e.lookupDisplayField]=e.generateDisplayFieldValue(R({},t))})),t})))},t.prototype.convertLookupFieldValue=function(t,e){if(t)switch(e.type){case h.FieldType.Date:t=Je(t).format("L");break;case h.FieldType.Enum:var o=e.options.filter((function(e){return e.value===t}))[0];t=o?o.label:t}return t},t.prototype.convertGridFieldValue=function(t){t&&this.concatOtherFields.forEach((function(e){switch(e.type){case h.FieldType.Enum:var o=e.options.filter((function(o){return o.value===t[e.name]}))[0];t[e.name]=o?o.label:t[e.name]}}))},t.prototype.generateDisplayFieldValue=function(t){var e=this,o="";return this.concatFields.forEach((function(n){var i=e.convertLookupFieldValue(t[n.name],n);i&&(o?o+=" - "+i:o=i)})),o},t.prototype.generateLookupParameters=function(t){var e=this,o="";this.searchLookupFields.forEach((function(n){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o?o+=" or "+e.getParameterByType(i.type,n,t):o=""+e.getParameterByType(i.type,n,t)})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.generateGridParameters=function(t){var e=this,o="";Object.keys(t).forEach((function(n){if(t[n]){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o+=o?" and "+e.getParameterByType(i.type,n,t[n]):e.getParameterByType(i.type,n,t[n])}})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.getParameterByType=function(t,e,o){switch(t){case h.FieldType.Date:return e+" eq '"+Je(o).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return e+" eq '"+o+"'";case h.FieldType.Integer:return e+" eq "+o;case h.FieldType.Autocomplete:return e+" eq '"+o.id+"'";default:return"containing(lower("+e+"), lower('"+o+"'))"}},t.prototype.configHttpParamsPagination=function(t,e){this.httpParams=this.httpParams.set("size",t),this.httpParams=this.httpParams.set("offset",e)},t.prototype.configHttpParamsOrderBy=function(t){if(t&&t.length){var e="";t.map((function(t){e+=e?","+t.field+"+"+(1===t.order?"asc":"desc"):t.field+"+"+(1===t.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",e)}},Object.defineProperty(t.prototype,"httpParams",{get:function(){return this._httpParams},set:function(t){this._httpParams=t},enumerable:!0,configurable:!0}),t.prototype.getUrlDataLookup=function(t,e){var o=this;return e?this.http.get(""+t,{params:e}).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)}))):this.http.get(""+t).pipe(s.catchError((function(t){return t&&403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(t)})))},t.prototype.postUrlDataLookup=function(t,e){var o=this;return e?this.http.post(""+t,R({},e)).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)}))):this.http.post(""+t,{}).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},t.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(v.HttpClient),e.ɵɵinject(A.MessageService),e.ɵɵinject(a.TranslateService))},token:t,providedIn:"root"}),t=N([e.Injectable({providedIn:"root"})],t)}(),Ze=y,to=function(){function o(t){this.httpClienteService=t}return o.prototype.getAutoComplete=function(t,e,o,n,i){var r=this.generateGridParameters(e,o,n);return this.httpClienteService.getAutoComplete(t,r,i).pipe(s.map((function(t){return t&&t.contents})))},o.prototype.getAutoCompleteQuery=function(t,e){return this.httpClienteService.query(t,e).pipe(s.map((function(t){return t&&t.result})))},o.prototype.generateGridParameters=function(e,o,n){var i=this,r="";return Object.keys(e).forEach((function(a){var s,l=o&&o.filter((function(t){return a===t.name}))[0],p="",c=l&&l.type;l||a==t.CoreFieldType.searchValue||(c=h.FieldType.String),l||a!==t.CoreFieldType.searchValue||(c=t.CoreFieldType.searchValue),r&&(p=" and "),(s=i.getParameterByType(c,a,e[a],n))&&(r+=" "+p+" "+s)})),r},o.prototype.getParameterByType=function(e,o,n,i){if(!n&&e!=t.CoreFieldType.searchValue)return o+" is null";if(n&&"not null"===n&&e!=t.CoreFieldType.searchValue)return o+" is not null";switch(e){case h.FieldType.Date:return o+" eq '"+Ze(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return o+" eq '"+n+"'";case h.FieldType.Integer:return o+" eq "+n;case h.FieldType.Autocomplete:return o+" eq '"+n.id+"'";case t.CoreFieldType.searchValue:return""+this.getParameterBySearchType(n,i);default:return this.getSearchFilterString(o,n)}},o.prototype.getParameterBySearchType=function(t,e){var o,n,i="";if(t){try{for(var r=q(Object.entries(t)),a=r.next();!a.done;a=r.next()){var s=U(a.value,2),l=s[0],p=s[1];if("code"===l&&Number(p)){var c=e?"'":"";i+=i?" or "+l+" eq "+c+p+c:l+" eq "+c+p+c}else"code"!=l&&(i+=i?" or "+this.getSearchFilterString(l,p):this.getSearchFilterString(l,p))}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}i=i?"("+i+")":""}return i},o.prototype.getSearchFilterString=function(t,e){return"containing(lower("+t+"), lower('"+e+"'))"},o.ctorParameters=function(){return[{type:Nt}]},o.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(Nt))},token:o,providedIn:"root"}),o=N([e.Injectable({providedIn:"root"})],o)}(),eo="platform/report/queries/getParameters",oo="platform/report/queries/getReportUri",no="platform/report/queries/getReportStatus",io="platform/report/queries/findReportsByName",ro="platform/report/queries/getRunningReports",ao="platform/report/actions/generateReport",so=function(){function t(t){this.http=t}return t.prototype.findReportsByName=function(t){return this.http.post(""+io,{name:t}).pipe(s.map((function(t){return t.reports?t.reports:[]})))},t.prototype.findReportByName=function(t){return t=t||"",this.findReportsByName(t).pipe(s.map((function(e){var o=e&&e.filter((function(e){return e.name&&e.name===t}));return o&&1==o.length?o[0]:null})))},t.prototype.getParameters=function(t,e){return this.http.post(""+eo,{id:t,reportFileId:e}).pipe(s.map((function(t){return t||null})))},t.prototype.getReportUri=function(t){return this.http.post(""+oo,{reportTicket:t}).pipe(s.map((function(t){return t&&t.reportUri})))},t.prototype.getReportStatus=function(t){return this.http.post(""+no,{reportTicket:t}).pipe(s.map((function(t){return t&&t.reportStatus})))},t.prototype.generateReport=function(t){return this.http.post(""+ao,t).pipe(s.map((function(t){return t||null})))},t.prototype.getRunningReports=function(t,e){return this.http.post(""+ro,{offset:t,limit:e,orderByDesc:!0,filterCancelled:!0})},t.ctorParameters=function(){return[{type:v.HttpClient}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(v.HttpClient))},token:t,providedIn:"root"}),t=N([e.Injectable({providedIn:"root"})],t)}(),lo=function(){function t(){this.useWorkflowValueChange=new f.Subject,this._draftJSON=new f.BehaviorSubject(null)}return t.prototype.setUseWorkflow=function(t){this.useWorkflowValueChange.next(t)},t.prototype.getUseWorkflow=function(){return this.useWorkflowValueChange.asObservable()},t.prototype.setDraftJSON=function(t){this._draftJSON.next(t)},t.prototype.getDraftJSON=function(){return this._draftJSON.asObservable()},t=N([e.Injectable()],t)}(),po=function(){function t(){this.resetDivergentFormData()}return t.prototype.resetDivergentFormData=function(){this._divergentFormData={}},t.prototype.checkFormDisagreements=function(t){var e=this;void 0===t&&(t=!1),this.resetDivergentFormData(),this._sanitizeEmptyStrings(),t&&this._removeIdsFromFormDatas(),this._oldFormData===this._newFormData?this._throwIdenticalMessage():(Object.keys(this._oldFormData).forEach((function(t){e._oldFormData[t]!==e._newFormData[t]&&(e._divergentFormData[t]=e._createDivergencePair(t))})),Object.keys(this._newFormData).forEach((function(t){e._newFormData[t]!==e._oldFormData[t]&&(e._divergentFormData[t]=e._createDivergencePair(t))})),this._isDivergentFormDataEmpty&&this._throwIdenticalMessage())},t.prototype._removeIdsFromFormDatas=function(){[this._oldFormData,this._newFormData].forEach((function(t){delete t.id}))},t.prototype._sanitizeEmptyStrings=function(){[this._oldFormData,this._newFormData].forEach((function(t){Object.keys(t).map((function(e){""===t[e]&&(t[e]=null)}))}))},t.prototype._createDivergencePair=function(t){var e={oldValue:null,newValue:null};return e.oldValue=this._oldFormData[t],e.newValue=this._newFormData[t],e},t.prototype._throwIdenticalMessage=function(){throw new Error("The objects oldFormData and newFormData are identical")},Object.defineProperty(t.prototype,"oldFormData",{get:function(){return this._oldFormData},set:function(t){this._oldFormData=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"newFormData",{get:function(){return this._newFormData},set:function(t){this._newFormData=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"divergentFormArray",{get:function(){var t=[];return Object.entries(this._divergentFormData).map((function(e){var o=U(e,2),n=o[0],i=o[1],r={key:null,oldValue:null,newValue:null};r.key=n,r.oldValue=i.oldValue,r.newValue=i.newValue,t.push(r)})),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isDivergentFormDataEmpty",{get:function(){return 0===Object.entries(this._divergentFormData).length},enumerable:!0,configurable:!0}),t=N([e.Injectable()],t)}(),co=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule],providers:[$e,Qe,Xe,to,so,lo,po]})],t)}(),uo=function(){function t(t){var e=this;this.http=t,this.actionUrl="platform/authorization/queries/checkAccess",this.resourceAddress="res://senior.com.br/hcm/payroll/",this.defaultActions=["Visualizar","Incluir","Editar","Excluir"],this._resources=[],this._attributes=[],P.user.getAuthHeader().then((function(t){e.httpOptions={headers:new v.HttpHeaders({"Content-Type":"application/json",Accept:"application/json",Authorization:t})}})),P.service.getRestUrl().then((function(t){return e.restUrl=t}))}return t.prototype.get=function(t){var e=this;return void 0===t&&(t=""),this.permissions?this.observable=f.Observable.of(this.permissions):this.observable||(this.observable=this.getPermissions().pipe(s.map((function(t){return e.permissions=t})))),this.observable.pipe(s.map((function(e){return t?e[t]:e})))},t.prototype.getAbac=function(t,e){return this.attributes=e,this.getAbacPermission(t)},t.prototype.getAbacPermission=function(t){return this.http.post(this.actionUrl,{includeFilters:!1,permissions:[{resource:""+this.resourceAddress+t,action:"Visualizar",attributes:this._attributes.map((function(t){return{attribute:t.name,value:t.value}}))}]},this.httpOptions)},t.prototype.getPermissions=function(){var t=this,e=[];return this._resources.forEach((function(o){return t.defaultActions.forEach((function(n){return e.push({action:n,resource:""+t.resourceAddress+o})}))})),this.http.post(this.actionUrl,{includeFilters:!1,permissions:Y(e)},this.httpOptions).pipe(s.map((function(e){var o=e.permissions,n={};return o.forEach((function(e){var o=e.resource.replace(t.resourceAddress,"");n[o]=n[o]||{},n[o][e.action.toLowerCase()]=e.authorized})),n})))},Object.defineProperty(t.prototype,"attributes",{set:function(t){this._attributes=t},enumerable:!0,configurable:!0}),t.prototype.setResources=function(t){this._resources=t},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),mo=function(){function t(t,e,o){this.toastService=t,this.messageService=e,this.translateService=o,this.key="TOAST",this.breakLine=!1,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){var t=this;this.toastService.loadErrorMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.createErrorMessage(e&&e.message),t.breakLine=e&&e.breakLine})),this.toastService.loadSuccessMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.createSuccessMessage(e&&e.message),t.breakLine=e&&e.breakLine})),this.toastService.loadWarningMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.createWarningMessage(e&&e.message),t.breakLine=e&&e.breakLine}))},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},t.prototype.createErrorMessage=function(t,e){this.messageService.clear(),this.messageService.add({severity:"error",summary:e||this.translateService.instant("hcm.payroll.error"),detail:t,sticky:!0,key:this.key})},t.prototype.createSuccessMessage=function(t,e){this.messageService.add({severity:"success",summary:e||this.translateService.instant("hcm.payroll.success"),detail:t,key:this.key})},t.prototype.createWarningMessage=function(t,e){this.messageService.add({severity:"warn",summary:e||this.translateService.instant("hcm.payroll.warn"),detail:t,sticky:!0,key:this.key})},t.ctorParameters=function(){return[{type:Rt},{type:I.MessageService},{type:a.TranslateService}]},t=N([e.Component({selector:"c-toast",template:"\n <p-toast [ngClass]=\"breakLine ? 'ui-toast-break-line' : ''\" [key]=\"key\"></p-toast>\n "})],t)}(),ho=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,ut,x.ToastModule],declarations:[mo],providers:[Rt,I.MessageService],exports:[mo]})],t)}(),yo=function(){function t(t){this.http=t}return t.prototype.getList=function(t,e){return this.http.get(""+t,{params:e})},t.ctorParameters=function(){return[{type:v.HttpClient}]},t=N([e.Injectable()],t)}(),fo=function(){function o(t){this.dataListService=t,this.rows=10,this.paginator=!0,this.first=0,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.lazyLoad=new e.EventEmitter,this.loadingChange=new e.EventEmitter,this.totalRecordsChange=new e.EventEmitter,this.listDataChange=new e.EventEmitter,this.selectedDataChange=new e.EventEmitter,this.headerCheckboxToggle=new e.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return o.prototype.ngOnInit=function(){this.lazy||this.getlistData()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.getActions=function(t,e){return this.actions(t,e)},o.prototype.handleClickActions=function(t){t.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},o.prototype.pagination=function(t){this.lazy||this.getlistData(t.rows,Math.floor(t.first/t.rows))},o.prototype.onLazyLoad=function(e){var o=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){o.orderBy.push({field:e.field,direction:1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows))},o.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(o.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),o.prototype.getlistData=function(t,e){var o=this;void 0===t&&(t=this.rows),void 0===e&&(e=this.first),this.endpoint?(this.configParameters(this.initParameters),this.configHttpParamsDisplayFields(),this.configHttpParamsPagination(t.toString(),e.toString()),this.configHttpParamsOrderBy(),this.dataListService.getList(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){o.listData=t.contents,o.totalRecords=t.totalElements,o.lazy&&o.lazyLoad.emit(o.listData)}))):this.lazy&&this.lazyLoad.emit(this.listData)},o.prototype.configHttpParamsPagination=function(t,e){this.httpParams=this.httpParams.set("size",t),this.httpParams=this.httpParams.set("offset",e)},o.prototype.configHttpParamsOrderBy=function(){if(this.orderBy&&this.orderBy.length){var t="";this.orderBy.map((function(e){t+=t?","+e.field+"+"+e.direction:e.field+"+"+e.direction})),this.httpParams=this.httpParams.set("orderby",t)}},o.prototype.configHttpParamsDisplayFields=function(){this.displayFields&&this.displayFields.length&&(this.httpParams=this.httpParams.set("displayfields",this.displayFields.toString()))},o.prototype.onHeaderCheckboxToggle=function(t){this.headerCheckboxToggle.emit(t)},o.prototype.getFieldValue=function(t,e){return e.field&&e.field.includes(".")?(e.field.split(".").map((function(e){return t=t&&t[e]})),t):t[e.field]},o.prototype.configParameters=function(t){var e="";t&&(t.forEach((function(t){e?e+=" and "+t.toString():e=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",e))},Object.defineProperty(o.prototype,"parameters",{set:function(t){this.configParameters(t),t&&(this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"httpParams",{get:function(){return this._httpParams},set:function(t){this._httpParams=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"loading",{get:function(){return this._loading},set:function(t){this._loading=t,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"listData",{get:function(){return this._listData},set:function(t){this._listData=t,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"selectedData",{get:function(){return this._selectedData},set:function(t){this._selectedData=t,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(t){this._totalRecords=t,this.totalRecordsChange.emit(this.totalRecords)},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:yo}]},N([e.ViewChild("dataListTable",{static:!1})],o.prototype,"dataListTable",void 0),N([e.Input()],o.prototype,"id",void 0),N([e.Input()],o.prototype,"dataKey",void 0),N([e.Input()],o.prototype,"rows",void 0),N([e.Input()],o.prototype,"emptyMessage",void 0),N([e.Input()],o.prototype,"columns",void 0),N([e.Input()],o.prototype,"paginator",void 0),N([e.Input()],o.prototype,"first",void 0),N([e.Input()],o.prototype,"alwaysShowPaginator",void 0),N([e.Input()],o.prototype,"actions",void 0),N([e.Input()],o.prototype,"actionLabel",void 0),N([e.Input()],o.prototype,"selectionMode",void 0),N([e.Input()],o.prototype,"lazy",void 0),N([e.Input()],o.prototype,"isMultipleSelection",void 0),N([e.Input()],o.prototype,"isSortable",void 0),N([e.Input()],o.prototype,"showHeaderCheckBox",void 0),N([e.Input()],o.prototype,"sortMode",void 0),N([e.Input()],o.prototype,"endpoint",void 0),N([e.Input()],o.prototype,"displayFields",void 0),N([e.Input()],o.prototype,"orderBy",void 0),N([e.Input()],o.prototype,"singularMessageRecords",void 0),N([e.Input()],o.prototype,"pluralMessageRecords",void 0),N([e.Input()],o.prototype,"initParameters",void 0),N([e.Output()],o.prototype,"lazyLoad",void 0),N([e.Output()],o.prototype,"loadingChange",void 0),N([e.Output()],o.prototype,"totalRecordsChange",void 0),N([e.Output()],o.prototype,"listDataChange",void 0),N([e.Output()],o.prototype,"selectedDataChange",void 0),N([e.Output()],o.prototype,"headerCheckboxToggle",void 0),N([e.Input()],o.prototype,"parameters",null),N([e.Input()],o.prototype,"loading",null),N([e.Input()],o.prototype,"listData",null),N([e.Input()],o.prototype,"selectedData",null),N([e.Input()],o.prototype,"totalRecords",null),o=N([e.Component({selector:"c-data-list",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows"\n [first]="first" (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator"\n (onPage)="pagination($event)" [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey"\n [sortMode]="sortMode" [responsive]="true" pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)"\n [selectionMode]="selectionMode">\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.orderBy || col.field"\n [pSortableColumnDisabled]="!isSortable || !!col.icon" [style.width]="col.width" [pTooltip]="col.tooltip || col.label"\n tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="{{id}}-col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style"\n aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="{{id}}-col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default"\n [model]="getActions(rowData, key)" [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label"\n priority="default" (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:e.ViewEncapsulation.None,styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]})],o)}(),go=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[fo],exports:[fo],providers:[yo]})],t)}(),bo=function(){function t(t,e,o){this.http=t,this.messageService=e,this.translateService=o}return t.prototype.getDataLookup=function(t,e){var o=this;return e?this.http.get(""+t,{params:e}).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)}))):this.http.get(""+t).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},t.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},t=N([e.Injectable()],t)}(),vo=y,Io=function(){function t(t){this.lookupService=t,this.searchTotalRecordsLabel="hcm.payroll.lookup_search_total_records_label",this.filterLabel="hcm.payroll.lookup_generic_filter_label",this.clearLabel="hcm.payroll.lookup_generic_clean_filter_label",this.cancelLabel="hcm.payroll.lookup_generic_btn_cancel_label",this.selectLabel="hcm.payroll.lookup_btn_select_label",this.lookupEmptyMessage="hcm.payroll.lookup_auto_complete_empty_message",this.lookupSuggestions=[],this.searchGridFields=[],this.searchLookupFields=[],this.searchGridData=[],this.searchFields=[],this.parameters=[],this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.modelChange=new e.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},t.prototype.lookupRequest=function(t){var e=this;this.generateLookupParameters(t),this.configHttpParamsPagination("10","0"),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.lookupSuggestions=t&&Y(t.contents)}))},t.prototype.searchRequest=function(t){var e=this;this.generateGridParameters(t.filterData),this.configHttpParamsPagination(t.rows.toString(),Math.floor(t.first/t.rows).toString()),this.configHttpParamsOrderBy(t.multiSortMeta),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.searchGridData=t&&Y(t.contents)}))},t.prototype.getDataLookup=function(t,e){var o=this;return this.lookupService.getDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(t){var e=t.totalElements,n=t.contents;return o.searchTotalRecords=e,o.concatFields&&o.concatFields.length&&n.map((function(t){o.convertGridFieldValue(t),t[o.lookupDisplayField]=o.generateDisplayFieldValue(R({},t))})),t})))},t.prototype.convertLookupFieldValue=function(t,e){if(t)switch(e.type){case h.FieldType.Date:t=vo(t).format("L");break;case h.FieldType.Enum:var o=e.options.filter((function(e){return e.value===t}))[0];t=o?o.label:t}return t},t.prototype.convertGridFieldValue=function(t){t&&this.searchGridFields.forEach((function(e){switch(e.type){case h.FieldType.Enum:var o=e.options.filter((function(o){return o.value===t[e.name]}))[0];t[e.name]=o?o.label:t[e.name]}}))},t.prototype.generateDisplayFieldValue=function(t){var e=this,o="";return this.concatFields.forEach((function(n){var i=e.convertLookupFieldValue(t[n.name],n);i&&(o?o+=" - "+i:o=i)})),o},t.prototype.generateLookupParameters=function(t){var e=this,o="";this.searchLookupFields.forEach((function(n){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o?o+=" or "+e.getParameterByType(i.type,n,t):o=""+e.getParameterByType(i.type,n,t)})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.generateGridParameters=function(t){var e=this,o="";Object.keys(t).forEach((function(n){if(t[n]){var i=e.searchFields.filter((function(t){return n===t.name}))[0];o+=o?" and "+e.getParameterByType(i.type,n,t[n]):e.getParameterByType(i.type,n,t[n])}})),this.parameters.forEach((function(t){o?o+=" and "+t.toString():o=""+t.toString()})),this.httpParams=(new v.HttpParams).set("filter",o)},t.prototype.getParameterByType=function(t,e,o){switch(t){case h.FieldType.Date:return e+" eq '"+vo(o).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return e+" eq '"+o+"'";case h.FieldType.Integer:return e+" eq "+o;case h.FieldType.Autocomplete:return e+" eq "+o.id;default:return"containing(lower("+e+"), lower('"+o+"'))"}},t.prototype.configHttpParamsPagination=function(t,e){this.httpParams=this.httpParams.set("size",t),this.httpParams=this.httpParams.set("offset",e)},t.prototype.configHttpParamsOrderBy=function(t){if(t&&t.length){var e="";t.map((function(t){e+=e?","+t.field+"+"+(1===t.order?"asc":"desc"):t.field+"+"+(1===t.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",e)}},Object.defineProperty(t.prototype,"httpParams",{get:function(){return this._httpParams},set:function(t){this._httpParams=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this._model},set:function(t){this._model=t,this.modelChange.emit(t)},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:bo}]},N([e.Input()],t.prototype,"id",void 0),N([e.Input()],t.prototype,"dataKey",void 0),N([e.Input()],t.prototype,"concatFields",void 0),N([e.Input()],t.prototype,"searchTitle",void 0),N([e.Input()],t.prototype,"formGroup",void 0),N([e.Input()],t.prototype,"controlName",void 0),N([e.Input()],t.prototype,"multiple",void 0),N([e.Input()],t.prototype,"endpoint",void 0),N([e.Input()],t.prototype,"lookupDisplayField",void 0),N([e.Input()],t.prototype,"searchTotalRecordsLabel",void 0),N([e.Input()],t.prototype,"filterLabel",void 0),N([e.Input()],t.prototype,"clearLabel",void 0),N([e.Input()],t.prototype,"cancelLabel",void 0),N([e.Input()],t.prototype,"selectLabel",void 0),N([e.Input()],t.prototype,"lookupEmptyMessage",void 0),N([e.Input()],t.prototype,"searchTotalRecords",void 0),N([e.Input()],t.prototype,"lookupSuggestions",void 0),N([e.Input()],t.prototype,"searchGridFields",void 0),N([e.Input()],t.prototype,"searchLookupFields",void 0),N([e.Input()],t.prototype,"searchGridData",void 0),N([e.Input()],t.prototype,"searchFields",void 0),N([e.Input()],t.prototype,"parameters",void 0),N([e.Output()],t.prototype,"onSelect",void 0),N([e.Output()],t.prototype,"onClear",void 0),N([e.Output()],t.prototype,"modelChange",void 0),N([e.Input()],t.prototype,"model",null),t=N([e.Component({selector:"c-lookup",template:'<div *ngIf="formGroup;else noForm" [formGroup]="formGroup">\n <s-lookup [id]="id" [dataKey]="dataKey" [formControlName]="controlName" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</div>\n\n<ng-template #noForm>\n <s-lookup [id]="id" [dataKey]="dataKey" [(ngModel)]="model" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</ng-template>\n'})],t)}(),So=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,h.DynamicFormModule,o.ReactiveFormsModule,a.TranslateModule],declarations:[Io],exports:[Io],providers:[bo]})],t)}(),_o=y,ko=function(){function o(t){this.httpClienteService=t}return o.prototype.getAutoComplete=function(t,e,o,n,i){var r=this.generateGridParameters(e,o,n);return this.httpClienteService.getAutoComplete(t,r,i).pipe(s.map((function(t){return t&&t.contents})))},o.prototype.getAutoCompleteQuery=function(t,e){return this.httpClienteService.query(t,e).pipe(s.map((function(t){return t&&t.result})))},o.prototype.generateGridParameters=function(e,o,n){var i=this,r="";return Object.keys(e).forEach((function(a){var s,l=o&&o.filter((function(t){return a===t.name}))[0],p="",c=l&&l.type;l||a==t.CoreFieldType.searchValue||(c=h.FieldType.String),l||a!==t.CoreFieldType.searchValue||(c=t.CoreFieldType.searchValue),r&&(p=" and "),(s=i.getParameterByType(c,a,e[a],n))&&(r+=" "+p+" "+s)})),r},o.prototype.getParameterByType=function(e,o,n,i){if(!n&&e!=t.CoreFieldType.searchValue)return o+" is null";if(n&&"not null"===n&&e!=t.CoreFieldType.searchValue)return o+" is not null";switch(e){case h.FieldType.Date:return o+" eq '"+_o(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return o+" eq '"+n+"'";case h.FieldType.Integer:return o+" eq "+n;case h.FieldType.Autocomplete:return o+" eq '"+n.id+"'";case t.CoreFieldType.searchValue:return""+this.getParameterBySearchType(n,i);default:return this.getSearchFilterString(o,n)}},o.prototype.getParameterBySearchType=function(t,e){var o,n,i="";if(t){try{for(var r=q(Object.entries(t)),a=r.next();!a.done;a=r.next()){var s=U(a.value,2),l=s[0],p=s[1];if("code"===l&&Number(p)){var c=e?"'":"";i+=i?" or "+l+" eq "+c+p+c:l+" eq "+c+p+c}else"code"!=l&&(i+=i?" or "+this.getSearchFilterString(l,p):this.getSearchFilterString(l,p))}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}i=i?"("+i+")":""}return i},o.prototype.getSearchFilterString=function(t,e){return"containing(lower("+t+"), lower('"+e+"'))"},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),wo=y,Co=function(){function t(t,e,o){this.http=t,this.messageService=e,this.translateService=o}return t.prototype.lookupRequestPost=function(t,e,o,n){return void 0===o&&(o=null),this.httpPostParams=t,this.postConfigPageSize(t),this.lookupDisplayField=n,this.concatFields=o,this.postDataLookup(e)},t.prototype.postConfigPageSize=function(t){t&&(this.httpPostParams.page.size=t.page&&t.page.size?t.page.size:10,this.httpPostParams.page.current=t.page&&t.page.current?t.page.current:0)},t.prototype.postDataLookup=function(t){var e=this;return this.postUrlDataLookup(t,this.httpPostParams).pipe(s.map((function(t){var o=t.contents;return e.concatFields&&e.concatFields.length&&o.map((function(t){e.concatOtherFields&&e.convertGridFieldValue(t),t[e.lookupDisplayField]=e.generateDisplayFieldValue(R({},t))})),t})))},t.prototype.convertLookupFieldValue=function(t,e){if(t)switch(e.type){case h.FieldType.Date:t=wo(t).format("L");break;case h.FieldType.Enum:var o=e.options.filter((function(e){return e.value===t}))[0];t=o?o.label:t}return t},t.prototype.convertGridFieldValue=function(t){t&&this.concatOtherFields.forEach((function(e){switch(e.type){case h.FieldType.Enum:var o=e.options.filter((function(o){return o.value===t[e.name]}))[0];t[e.name]=o?o.label:t[e.name]}}))},t.prototype.generateDisplayFieldValue=function(t){var e=this,o="";return this.concatFields.forEach((function(n){var i=e.convertLookupFieldValue(t[n.name],n);i&&(o?o+=" - "+i:o=i)})),o},t.prototype.postUrlDataLookup=function(t,e){var o=this;return e?this.http.post(""+t,R({},e)).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)}))):this.http.post(""+t,{}).pipe(s.catchError((function(t){return 403===t.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(t)})))},t.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:a.TranslateService}]},t=N([e.Injectable()],t)}(),Do=function(){function t(t,e){var o=t.filterData;this.name=o.name||null,this.code=o.code||null,this.searchText=o.searchText||null,this.companyId=o.headoffice||null,this.companyBranchId=o.branchoffice&&o.branchoffice.id||null,this.departmentId=o.department&&o.department.tableId||null,this.costcenterId=o.costcenter&&o.costcenter.id||null,this.jobpositionIds=o.jobposition||null,this.syndicateId=o.syndicate&&o.syndicate.id||null,this.shiftId=o.workshiftScale||null,this.workshiftId=o.workshiftId&&o.workshiftId.id||null,this.workshiftGroupId=o.workshiftGroupId&&o.workshiftGroupId.id||null,this.intervalGroupId=o.intervalGroupId&&o.intervalGroupId.is||null,this.scaleTeamId=o.scaleTeamId&&o.scaleTeamId.id||null,this.scaleCategoryId=o.scaleCategoryId&&o.scaleCategoryId.id||null,this.employmentRelationshipId=o.employmentRelationshipId&&o.employmentRelationshipId.id||null,this.contractType=o.contractType||null,this.expenseNatureId=o.expenseNatureId&&o.expenseNatureId.id||null,this.allowDeficient=o.allowDeficient||null,this.disabilityIds=o.disabilityIds||null,this.listExpired=!!o.hasOwnProperty("listExpired")&&o.listExpired,this.manager=o.manager?o.manager.tableId:null,this.referenceDate=e||null,this.page={current:t.first?t.first:0,size:t.rows?t.rows:10}||null}return t.prototype.getToFilter=function(){return this.jobpositionIds=this.convertListIds(this.jobpositionIds),this.disabilityIds=this.convertListIds(this.disabilityIds),this},t.prototype.convertListIds=function(t){if(t)return t.map((function(t){return t.tableId?t.tableId:t.id}))},t}(),To=y,Eo=function(){function o(o,n,i,r){var a=this;this.translate=o,this.cd=n,this.autocompleteParametersService=i,this.lookupParametersService=r,this.currentCompanyId=null,this.currentCompanyName=null,this.onSelect=new e.EventEmitter,this.onClear=new e.EventEmitter,this.onBlur=new e.EventEmitter,this.companyBranchId=null,this.lookupSuggestions=[],this.searchGridData=[],this.suggestionsObservable=new f.BehaviorSubject([]),this.totalRecords=0,this.valueEnumShift=[{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FIRST_SHIFT"),value:"0",enum:"FIRST_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_SECOND_SHIFT"),value:"1",enum:"SECOND_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_THIRD_SHIFT"),value:"2",enum:"THIRD_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FOURTH_SHIFT"),value:"3",enum:"FOURTH_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_MIXED"),value:"4",enum:"MIXED"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_GENERAL"),value:"5",enum:"GENERAL"}],this.concatFieldsName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String}),new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String})],this.concatName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String})],this.gridFields=[new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String}),new h.FormField({name:"manager",label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),type:h.FieldType.String})],this.searchFields=Y(this.concatName,[{name:"name",label:this.translate.instant("hcm.payroll.movimentation_name"),type:h.FieldType.String},{name:"headoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_company"),dataKey:"id",appendTo:"body",fullWidth:!0,suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"branchoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_branch"),dataKey:"id",appendTo:"body",fullWidth:!0,onRemove:function(){return a.companyBranchId=null},onSelect:function(t){var e=t.id;return a.companyBranchId=e},onSearch:function(t){a.getAutocomplete("company",t?{companyname:t,code:t}:null,"code","companyname",{headquarter:a.currentCompanyId?a.currentCompanyId:"not null"})},suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"manager",type:h.FieldType.Autocomplete,multiple:!1,label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocompleteQuery("autocompleteManager",{valueSearch:t||"",companyId:{tableId:a.currentCompanyId},companyBranchId:{tableId:a.companyBranchId?a.companyBranchId:""}})},suggestionsObservable:this.suggestionsObservable,displayField:"manager"},{name:"department",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.movimentation_historical_department_tab"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocompleteQuery("autocompleteDepartmentQuery",{searchText:t||"",companyId:a.currentCompanyId,referenceDate:To(y.now()).format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"costcenter",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_cost_center"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("costcenter",e?{name:e,code:e}:null,"code","name",a.currentCompanyId?{company:a.currentCompanyId}:null,!0,t.ServiceType.ORGANIZATION_REGISTER)},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"jobposition",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.movimentation_historical_job_position_tab"),dataKey:"tableId",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocompleteQuery("autocompleteJobpositionQuery",{searchText:t||"",companyId:a.currentCompanyId,creationDate:To().format("YYYY-MM-DD"),expirationDate:To().format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"syndicate",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_syndicate"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("syndicate",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"workshiftScale",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.SHIFT"),showClear:!0,size:{md:12},onChange:function(){a.resetDependenciesOfShift(!0)},options:this.valueEnumShift},{name:"workshiftId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("workshift",t?{description:t,code:t}:null,"code","description",a.workstationFilterForm.get("workshiftScale").value?{workshiftScale:a.valueEnumShift[a.workstationFilterForm.get("workshiftScale").value].enum}:null)},onSelect:function(){a.resetDependenciesOfShift()},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"workshiftGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_workshift-group"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("workshiftGroup",t?{code:t}:null,"code","baseDate",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"baseDate"},{name:"intervalGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_class_interval"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("intervalGroup",t?{description:t,code:t}:null,"code","description",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"scaleTeamId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_team"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("scaleTeam",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"scaleCategoryId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_category"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("scaleCategory",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"employmentRelationshipId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_employment_relationship"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("employmentRelationship",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"contractType",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.employees_temporary_contract_temporary_contract_type"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Employee"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Manager"),value:1},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FarmWorker"),value:2},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Retired"),value:3},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Trainee"),value:4},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Apprentice"),value:5},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FixedDueDate"),value:6},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_RetiredManager"),value:7},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_PublicAgent"),value:8},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Teacher"),value:9},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_CooperativeWorker"),value:10},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_DomesticWorker"),value:11},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_TeacherFixedDueDate"),value:12}]},{name:"expenseNatureId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_expense_nature"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("expenseNature",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"allowDeficient",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.allow_deficient"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_No"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Also"),value:1},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Only"),value:2}]},{name:"disabilityIds",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.employees_addition_disability"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(t){a.getAutocomplete("disability",t?{name:t,code:t}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"}]),this.ngUnsubscribe=new f.Subject}return o.prototype.ngOnInit=function(){},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges();var t=this.workstationFilterForm.get("headoffice");t.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),t.disable()},Object.defineProperty(o.prototype,"workstationFilterForm",{get:function(){return this.workstationgroupEl&&this.workstationgroupEl.formGroupDialog},enumerable:!0,configurable:!0}),o.prototype.selectOption=function(t){this.onSelect.emit(t)},o.prototype.onClearItem=function(t){return V(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.onClear.emit(t)];case 1:return e.sent(),this.form.get(this.name).reset(),[2]}}))}))},o.prototype.resetDependenciesOfShift=function(t){void 0===t&&(t=!1),t&&this.workstationFilterForm.get("workshiftId").reset(),this.workstationFilterForm.get("workshiftGroupId").reset(),this.workstationFilterForm.get("intervalGroupId").reset()},o.prototype.searchRequest=function(t){var e=this,o=this.workstationFilterForm.get("headoffice"),n=t&&t.filterData;o.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),t=R({},this.getValueEvent(t,n));var i=this.getHireDate().replace(/\'/g,""),r=new Do(t,i);this.lookupParametersService.lookupRequestPost(r.getToFilter(),"hcm/payroll/queries/workstationgroupFilterQuery",Y(this.concatFieldsName),"name").pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){n?e.searchGridData=t&&Y(t.contents):e.lookupSuggestions=t&&Y(t.contents),e.totalRecords=t&&t.totalPages}))},o.prototype.getValueEvent=function(t,e){return e?t.filterData.headoffice=this.currentCompanyId:t={filterData:{headoffice:this.currentCompanyId,searchText:t}},t},o.prototype.getAutocompleteQuery=function(t,e){var o=this;this.autocompleteParametersService.getAutoCompleteQuery(t,e).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){"autocompleteDepartmentQuery"===t?e.filter((function(t){t.fields&&t.fields[0]&&(t.name=t.fields[1].value+" - "+t.fields[0].value)})):"autocompleteJobpositionQuery"===t?e.filter((function(t){t.fields&&t.fields[0]&&t.fields[1]&&(t.name=t.fields[0].value+" - "+t.fields[1].value)})):"autocompleteManager"===t&&e.map((function(t){t.manager=t.fields[0].value?t.fields[0].value:t.fields[3].value})),o.suggestionsObservable.next(e)}))},o.prototype.getAutocomplete=function(e,o,n,i,r,a,l){var p=this;void 0===r&&(r=null),void 0===a&&(a=!1),void 0===l&&(l=t.ServiceType.PAYROLL),this.autocompleteParametersService.getAutoComplete(e,R({},r,{searchValue:R({},o)}),this.searchFields,a,l).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){"workshiftGroup"===e&&t.filter((function(t){if(t.baseDate){var e=To(t.baseDate,"YYYY-MM-DD");if(e.isValid())return t.baseDate=e.format(p.dateFormat)}})),p.suggestionsObservable.next(p.getConcatFields(t,n,i))}))},o.prototype.getConcatFields=function(t,e,o){return o&&e&&t.filter((function(t){t[o]=t[e]+" - "+t[o]})),t},o.prototype.getHireDate=function(){var t=To(this.hireDate).format(this.dateFormat);return t?"'"+ee(t,this.dateFormat)+"'":"'"+ne()+"'"},o.ctorParameters=function(){return[{type:a.TranslateService},{type:e.ChangeDetectorRef},{type:ko},{type:Co}]},N([e.ViewChild("workstationgroupEl",{static:!1})],o.prototype,"workstationgroupEl",void 0),N([e.Input()],o.prototype,"currentCompanyId",void 0),N([e.Input()],o.prototype,"currentCompanyName",void 0),N([e.Input()],o.prototype,"hireDate",void 0),N([e.Input()],o.prototype,"dateFormat",void 0),N([e.Input()],o.prototype,"required",void 0),N([e.Input()],o.prototype,"disabled",void 0),N([e.Input()],o.prototype,"form",void 0),N([e.Input()],o.prototype,"name",void 0),N([e.Output()],o.prototype,"onSelect",void 0),N([e.Output()],o.prototype,"onClear",void 0),N([e.Output()],o.prototype,"onBlur",void 0),o=N([e.Component({selector:"c-workstationgroup-lookup",template:'<div [formGroup]="form">\n <s-lookup\n #workstationgroupEl\n id="workstationGroup"\n dataKey="code"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n [formControlName]="name"\n (onLookupRequest)="searchRequest($event)"\n (onSearchRequest)="searchRequest($event)"\n filterTitle="{{ \'hcm.payroll.filters\' | translate }}"\n filterLabel="{{ \'hcm.payroll.filter\' | translate }}"\n clearLabel="{{ \'hcm.payroll.lookup_generic_clean_filter_label\' | translate }}"\n cancelLabel="{{ \'hcm.payroll.cancel\' | translate }}"\n selectLabel="{{ \'hcm.payroll.lookup_btn_select_label\' | translate }}"\n [disabled]="disabled"\n [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{ \'hcm.payroll.lookup_auto_complete_empty_message\' | translate }}"\n [searchGridData]="searchGridData"\n [searchFields]="searchFields"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n [searchTotalRecords]="totalRecords"\n searchTotalRecordsLabel="{{ totalRecords }} {{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [searchGridFields]="gridFields"\n searchTitle="{{ \'hcm.payroll.employees_addition_workstation\' | translate }}"\n lookupDisplayField="name"\n ></s-lookup>\n\n</div>\n'})],o)}(),Fo=function(){function t(){}return t=N([e.NgModule({imports:[o.FormsModule,h.DynamicFormModule,o.ReactiveFormsModule,p.CommonModule,a.TranslateModule],declarations:[Eo],exports:[Eo],providers:[ko,Co]})],t)}(),Ao=function(){function n(o,n,i,r,a){var s=this;this.confirmationService=o,this.translateService=n,this.activatedRoute=i,this.cd=r,this.formBuilder=a,this.recordByRow=1,this.showDateWhen=!1,this.isEditMode=!1,this.isViewMode=!1,this.withSideBar=!0,this.visibleChange=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.orderBy={field:"displayDateWhen",direction:t.DirectionEnumeration.DESC},this.bankAccountItemInput={},this.totalRecords=0,this.actionLabel=this.translateService.instant("hcm.payroll.entries_query_actions_total_title"),this.loading=!0,this.listData=[],this.listDataNoPage=[],this.cols=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"displayDateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account_type"),field:"accountType"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_digit"),field:"digit"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"}],this.actions=function(t,e){return void 0===t&&(t={}),[{visible:s.isEditMode,label:s.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){t.index=e,s.bankAccountItemInput={currentItem:t,listData:s.listDataNoPage,isEditMode:!1},s.visible=!0}},{visible:!(s.isEditMode||!s.withSideBar),label:s.translateService.instant("hcm.payroll.edit"),command:function(){t.index=e,s.bankAccountItemInput={currentItem:t,listData:s.listDataNoPage,isEditMode:!0},s.visible=!0}},{visible:!s.isEditMode,label:s.translateService.instant("hcm.payroll.delete"),command:function(){s.loading=!0,s.deleteAnnuityItem(e)}}]},this.createFormGroup()}return n.prototype.ngOnInit=function(){this.formGroup.setControl(this.fieldFormGroup,this.historicalBankAccountList)},n.prototype.createFormGroup=function(){this.historicalBankAccountList=this.formBuilder.group({historicalBankAccountList:this.formBuilder.control(null)})},n.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},n.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},n.prototype.onLazyLoad=function(e){var o=this,n=e&&e.first?e.first:0,i=e&&e.rows?e.rows:this.recordByRow,r=this.getHistoricalBankAccountList();this.listData=[],this.totalRecords=null,e&&e.multiSortMeta&&e.multiSortMeta.length&&e.multiSortMeta.map((function(e){o.orderBy.field=e.field,o.orderBy.direction=1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})),r&&r.length?(this.totalRecords=r.length,this.listData=r,this.listDataNoPage=Y(r),this.listData.sort(me(this.orderBy.field,this.orderBy.direction)),this.listData=this.listData.slice(n,n+i)):this.listDataNoPage=[],(this.isEditMode||r&&1===r.length)&&this.refreshCssInIE11(),this.loading=!1},n.prototype.refreshCssInIE11=function(){/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&setTimeout((function(){var t=document.getElementsByClassName("row0");t&&t[0]&&(t[0].className="refresh")}),1)},n.prototype.add=function(){this.bankAccountItemInput={},this.visible=!0},n.prototype.deleteAnnuityItem=function(t){var e=Y(this.getHistoricalBankAccountList());e.sort(me(this.orderBy.field,this.orderBy.direction)),delete e[t],e=e.filter((function(t){return t})),this.historicalBankAccountList.get("historicalBankAccountList").setValue(e),this.verifyTotalPercentage(),this.onLazyLoad()},n.prototype.getHistoricalBankAccountList=function(){return this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value&&this.historicalBankAccountList.get("historicalBankAccountList").value.length?this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value:[]},n.prototype.addItemInList=function(t){var e=t&&t.index>=0?t.index:null,o=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[];if(null!=e)o[e]=t,delete t.index;else{if(Jt(t.customFields)&&Object.keys(t.customFields).length){var n=ae(t.customFields);t.customFields=Y(n)}t.dateWhen=this.dateWhen,o.push(t)}this.historicalBankAccountList.get("historicalBankAccountList").setValue(o),this.verifyTotalPercentage(),this.onLazyLoad({first:this.getNumberPageByIndex(e,o)})},n.prototype.getNumberPageByIndex=function(t,e){if(t){var o=e.length,n=this.recordByRow-1;return Math.ceil(o/this.recordByRow)*this.recordByRow-n-1}return null},n.prototype.verifyTotalPercentage=function(){var t=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[],e=[];if(!t.length)return this.msgTotalLimitByPercentage=null;t.filter((function(t){return e.push(t&&t.percentage)}));var o=e.reduce((function(t,e){return t+e}),0);this.msgTotalLimitByPercentage=100===o?this.translateService.instant("hcm.payroll.historical_bank_account_msg_limit_total_by_percentage"):null},Object.defineProperty(n.prototype,"scopedActions",{get:function(){return this.actions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.translateService.instant("hcm.payroll.admission_register"):this.translateService.instant("hcm.payroll.admission_registers"))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"getTooltipAndDisableButtonAdd",{get:function(){return this.dateWhen?null:this.msgTooltipAdd},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dateWhen",{get:function(){return this._dateWhen},set:function(t){var e=this;this._dateWhen=t,this._dateWhen&&this.listData.filter((function(t){return t.dateWhen=e._dateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayDateWhen",{get:function(){return this._displayDateWhen},set:function(t){var e=this;this._displayDateWhen=t,this._displayDateWhen&&this.listData.filter((function(t){return t.displayDateWhen=e._displayDateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"addListData",{set:function(t){this.loading=!0,this.historicalBankAccountList.get("historicalBankAccountList").patchValue(t),this.verifyTotalPercentage(),this.onLazyLoad()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),n.prototype.close=function(){this.visible=!1},n.ctorParameters=function(){return[{type:I.ConfirmationService},{type:a.TranslateService},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef},{type:o.FormBuilder}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],n.prototype,"customFields",void 0),N([e.Input()],n.prototype,"formGroup",void 0),N([e.Input()],n.prototype,"fieldFormGroup",void 0),N([e.Input()],n.prototype,"_dateWhen",void 0),N([e.Input()],n.prototype,"_displayDateWhen",void 0),N([e.Input()],n.prototype,"recordByRow",void 0),N([e.Input()],n.prototype,"showDateWhen",void 0),N([e.Input()],n.prototype,"msgTooltipAdd",void 0),N([e.Input()],n.prototype,"isEditMode",void 0),N([e.Input()],n.prototype,"isViewMode",void 0),N([e.Input()],n.prototype,"currency",void 0),N([e.Input()],n.prototype,"customEntity",void 0),N([e.Input()],n.prototype,"customService",void 0),N([e.Input()],n.prototype,"withSideBar",void 0),N([e.Input()],n.prototype,"dateWhen",null),N([e.Input()],n.prototype,"displayDateWhen",null),N([e.Input()],n.prototype,"addListData",null),N([e.Input()],n.prototype,"visible",null),n=N([e.Component({selector:"c-historical-bank-account",template:'<s-sidebar *ngIf="withSideBar" [visible]="visible" (visibleChange)="close()"\n header="{{\'hcm.payroll.historical_bank_account_title_form\'|translate}}">\n<bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</s-sidebar>\n\n<div *ngIf="!withSideBar">\n <bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n [withSideBar]="false"\n [isViewMode]="isViewMode"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</div>\n\n<div class="ui-g-1" *ngIf="withSideBar && !isEditMode">\n <div class="form-group ">\n <s-button id="ta-addPayAnnuity"\n [disabled]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n (onClick)="add()"\n [pTooltip]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n tooltipPosition="top"\n label="{{\'hcm.payroll.historical_bank_account_add\'|translate}}"></s-button>\n </div>\n</div>\n<div class="ui-g-12">\n <p-table\n id="table-annuity"\n [value]="listData"\n [columns]="cols"\n (onLazyLoad)="onLazyLoad($event)"\n [lazy]="true"\n [scrollable]="true"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [sortMode]="\'multiple\'"\n *sLoadingState="loading"\n [rows]="recordByRow"\n dataKey="id">\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col [ngClass]="\'col-default-s\'" *ngIf="showDateWhen">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-m\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-s\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-action\'">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th\n *ngIf="showDateWhen"\n [pSortableColumn]="\'displayDateWhen\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header" id="table-0">\n <span\n id="table-annuity-s-0">{{ \'hcm.payroll.historical_bank_account_label_date_when\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bank\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankBranch\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank_branch\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'accountType\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account_type\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankAccount\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'digit\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_digit\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'percentage\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"></p-sortIcon>\n </div>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n\n <tr [ngClass]="\'row\'+key" [pSelectableRow]="rowData">\n <td *ngIf="showDateWhen" [pTooltip]="rowData?.displayDateWhen" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.displayDateWhen }}</span>\n </td>\n <td [pTooltip]="rowData?.bank?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bank?.name }}</span>\n </td>\n <td [pTooltip]="rowData?.bankBranch?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankBranch?.name }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.accountType?.value" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.accountType?.value }}</span>\n </td>\n <td [pTooltip]="rowData?.bankAccount" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankAccount }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.digit" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.digit }}</span>\n </td>\n <td [pTooltip]="rowData?.percentage" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.percentage }}</span>\n </td>\n <td id="col-actions-{{key}}" class="col-actions "\n *ngIf="actions && actions(rowData, key)?.length">\n <s-button id="table-admission-btn-actions-{{key}}"\n *ngIf="actions(rowData, key).length > 1" [label]="actionLabel"\n priority="default" [model]="scopedActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="table-admission-btn-action-{{key}}"\n *ngIf="actions(rowData, key).length <= 1"\n [label]="scopedActions(rowData, key)[0].label"\n priority="default"\n (click)="scopedActions(rowData, key)[0].command()"\n [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td [attr.colspan]="columns.length +2">\n {{\'hcm.payroll.admission_empty_message\'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span *ngIf="totalRecords">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],n)}(),Po=function(){function t(t,n,i,r){this.translate=t,this.formBuilder=n,this.route=i,this.cd=r,this.withSideBar=!0,this.isEditMode=!1,this.visibleChange=new e.EventEmitter,this.bankAccountItemToList=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.initialValidatorOfPercentage=[o.Validators.required,o.Validators.min(.01)],this.initialValidatorOfBankAccount=[o.Validators.required,o.Validators.maxLength(12)],this.labelBtnAdd="hcm.payroll.employees_add",this.maxValuePercentage=100,this.visibleBtnSave=!0,this.isView=!1,this.createFormGroup(),this.registerSubjects()}return t.prototype.validateDuplicateBankAccount=function(t,e,o,n){return function(i){var r=i&&i.value,a=!1;return t.filter((function(t,i){if(i!=t.index&&r&&t.bank&&t.bank.tableId===o&&t.bankBranch&&t.bankBranch.tableId===n&&t.accountType&&t.accountType.key===e&&Number(t.bankAccount)===Number(r))return a=!0})),a?{bankAccountDuplicate:!0}:null}},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.unsubscribe()},t.prototype.registerSubjects=function(){},t.prototype.createFormGroup=function(){this.bankAccountFormGroup=this.formBuilder.group({id:this.formBuilder.control(null),index:this.formBuilder.control(null),employee:this.formBuilder.control({value:{tableId:null},disabled:!0}),dateWhen:this.formBuilder.control(null),displayDateWhen:this.formBuilder.control(null),bank:this.formBuilder.control(null,o.Validators.required),bankBranch:this.formBuilder.control(null,o.Validators.required),accountType:this.formBuilder.control(null,o.Validators.required),bankAccount:this.formBuilder.control(null,o.Validators.compose(Y(this.initialValidatorOfBankAccount))),digit:this.formBuilder.control(null,o.Validators.maxLength(3)),percentage:this.formBuilder.control(null,o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),customFields:this.formBuilder.control(null)})},t.prototype.onSelectBank=function(){this.cleanBankInformation(),this.beforeSetBankAccountValidator()},t.prototype.onClearBank=function(){this.bankAccountFormGroup.get("bank").reset(),this.cleanBankInformation(),this.beforeSetBankAccountValidator()},t.prototype.cleanBankInformation=function(){he(this.bankAccountFormGroup,["bankBranch"])},t.prototype.onClearBankBranch=function(){this.bankAccountFormGroup.get("bankBranch").reset(),this.beforeSetBankAccountValidator()},t.prototype.onClearAccountType=function(){this.bankAccountFormGroup.get("accountType").reset(),this.beforeSetBankAccountValidator()},Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEditAndViewValue",{set:function(t){this.resetForm(),this.visibleBtnSave=!0,t&&t.currentItem&&Object.keys(t.currentItem).length?(this.bankAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(R({},t.currentItem))),this.labelBtnAdd="hcm.payroll.employees_update",this.setValidatorsAccordingList(t.listData,t.currentItem.index),this.isView||this.configEnableFields(t&&t.isEditMode)):this.labelBtnAdd="hcm.payroll.employees_add"},enumerable:!0,configurable:!0}),t.prototype.convertDTOToShowWithCustomFields=function(t){var e=R({},t);return e.customFields=se(e.customFields),e},t.prototype.configEnableFields=function(t){this.visibleBtnSave=t,ce(this.bankAccountFormGroup,t,["bank","bankBranch","accountType","bankAccount","digit","percentage","customFields"],[])},t.prototype.close=function(){this.resetForm(),this.visible=!1},t.prototype.addItem=function(){this.bankAccountFormGroup.updateValueAndValidity(),le.call(this.bankAccountFormGroup),this.bankAccountFormGroup.valid&&(this.employeeId&&this.bankAccountFormGroup.get("employee").setValue({tableId:this.employeeId,name:""}),this.bankAccountItemToList.emit(this.bankAccountFormGroup.getRawValue()),this.visible=!1,this.resetForm())},t.prototype.resetForm=function(){this.bankAccountFormGroup.reset(),this.labelBtnAdd="hcm.payroll.employees_add",this.customFields&&this.customFields.formGroup&&this.customFields.formGroup.reset()},t.prototype.getBankTableId=function(){return this.bankAccountFormGroup.controls.bank.value?"'"+this.bankAccountFormGroup.controls.bank.value.tableId+"'":null},Object.defineProperty(t.prototype,"percentagePlaceholder",{get:function(){return"0"+(this.currency&&this.currency.decimalSeparator)+"00"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optionsPercentage",{get:function(){return R({},this.getOptions(),{precision:2})},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return{prefix:"",thousands:this.currency.thousandsSeparator,decimal:this.currency.decimalSeparator}},Object.defineProperty(t.prototype,"getListBankAccount",{set:function(t){t?this.setValidatorsAccordingList(t):this.resetForm()},enumerable:!0,configurable:!0}),t.prototype.setValidatorsAccordingList=function(t,e){void 0===e&&(e=null),this.bankAccountList=t&&t.length?Y(t):[];var o=[];this.bankAccountList&&this.bankAccountList.length&&this.bankAccountList.filter((function(t,n){t.percentage&&n!=e&&o.push(t.percentage)})),this.beforeSetBankAccountValidator(),this.validatePercentageValid(o)},t.prototype.beforeSetBankAccountValidator=function(){var t=this.bankAccountFormGroup.get("bankAccount"),e=this.bankAccountFormGroup.get("accountType")&&this.bankAccountFormGroup.get("accountType").value&&this.bankAccountFormGroup.get("accountType").value.key,n=this.bankAccountFormGroup.get("bank")&&this.bankAccountFormGroup.get("bank").value&&this.bankAccountFormGroup.get("bank").value.tableId,i=this.bankAccountFormGroup.get("bankBranch")&&this.bankAccountFormGroup.get("bankBranch").value&&this.bankAccountFormGroup.get("bankBranch").value.tableId;n&&i&&e&&this.bankAccountList&&this.bankAccountList.length?(t.setValidators(o.Validators.compose(Y(this.initialValidatorOfBankAccount,[this.validateDuplicateBankAccount(this.bankAccountList,e,n,i)]))),t.updateValueAndValidity()):t.setValidators(o.Validators.compose(Y(this.initialValidatorOfBankAccount)))},t.prototype.validatePercentageValid=function(t){var e=this.bankAccountFormGroup.get("percentage");this.maxValuePercentage=t.reduce((function(t,e){return t-e}),100),e.setValidators(o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),e.updateValueAndValidity()},Object.defineProperty(t.prototype,"isViewMode",{set:function(t){this.isView=!(!t||this.withSideBar),this.configEnableFields(!this.isView),this.isView||this.resetForm()},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:a.TranslateService},{type:o.FormBuilder},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!0})],t.prototype,"customFields",void 0),N([e.Input()],t.prototype,"currency",void 0),N([e.Input()],t.prototype,"customEntity",void 0),N([e.Input()],t.prototype,"customService",void 0),N([e.Input()],t.prototype,"withSideBar",void 0),N([e.Input()],t.prototype,"isEditMode",void 0),N([e.Output()],t.prototype,"visibleChange",void 0),N([e.Output()],t.prototype,"bankAccountItemToList",void 0),N([e.Input()],t.prototype,"visible",null),N([e.Input()],t.prototype,"isEditAndViewValue",null),N([e.Input()],t.prototype,"getListBankAccount",null),N([e.Input()],t.prototype,"isViewMode",null),t=N([e.Component({selector:"bank-account",template:'<div id="main">\n <form [formGroup]="bankAccountFormGroup" autocomplete="off">\n <div class="ui-fluid">\n <div class="ui-g">\n \x3c!-- Banco --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank\' | translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="Bank"\n [order]="[\'BankCode\',\'BankNameI18n\']"\n [fields]="[\'BankCode\',\'BankNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankCode" keyName="BankNameI18n"\n itemSelect="bank" name="bank"\n [form]="bankAccountFormGroup"\n (onSelect)="onSelectBank()"\n (onClear)="onClearBank()"\n id="ta-bankName"></input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bank\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Agência--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank_branch\'|translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="BankBranch"\n [order]="[\'BankBranchCode\']"\n [fields]="[\'BankBranchCode\',\'BankBranchNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankBranchCode" keyName="BankBranchNameI18n"\n itemSelect="bankBranch" name="bankBranch"\n [conditions]="[{ \'fields\': [\'BankBranchBank\'], \'expression\' : \'EQUAL\', \'value\': getBankTableId() }]"\n [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-bankBranch">\n </input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankBranch\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!-- Tipo conta --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.employees_addition_account_type\'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]="true" server="payroll"\n enumeration="AccountType"\n placeholder="{{\'hcm.payroll.select\' | translate}}"\n name="accountType" [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-accountType"></input-rest-auto-complete-enum>\n <s-control-errors [control]="bankAccountFormGroup.get(\'accountType\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Número conta--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_account_form\' |\n translate}}</label>\n <input pInputText id="ta-bankAccount" name="bankAccount" only-number\n formControlName="bankAccount"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankAccount\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n bankAccountDuplicate: \'hcm.payroll.historical_bank_account_label_bank_account_duplicate\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'12\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12">\n <label>{{\'hcm.payroll.historical_bank_account_label_digit\'|translate}}</label>\n \x3c!--Dígito--\x3e\n <input pInputText id="ta-digit" name="digit" only-number formControlName="digit"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'digit\')"\n [errorMessages]="{ maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'3\' } }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12 required">\n <label id="lb-percentage"\n for="ff-percentage">{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input pInputText id="ff-percentage" name="percentage"\n formControlName="percentage"\n currencyMask\n [options]="optionsPercentage"\n [placeholder]="percentagePlaceholder"/>\n </div>\n <s-control-errors [control]="bankAccountFormGroup.get(\'percentage\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'6\' },\n max: \'hcm.payroll.error_max_value_number\' | translate: { value: maxValuePercentage },\n min: \'hcm.payroll.error_min_value_number\' | translate: { value: \'0,01\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12">\n <p-fieldset\n legend="{{ \'hcm.payroll.custom_fields\' | translate }}"\n [attr.data-hidden]="!customFields || !customFields.fields.length"\n >\n <s-custom-fields\n domain="hcm"\n service="{{customService}}"\n entity="{{customEntity}}"\n formControlName="customFields"\n [invalidErrorLabel]="\'hcm.payroll.employees_invalid_field\' | translate"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]="withSideBar ? \'footer\' : \'footer-s-border\'">\n <div class="form-group">\n <s-button id="btn-save" label="{{ labelBtnAdd | translate}}" priority="primary"\n (onClick)="addItem()" *ngIf="visibleBtnSave && !this.isView"></s-button>\n <s-button *ngIf="withSideBar" id="btn-close" label="{{\'hcm.payroll.cancel\'|translate}}" priority="secondary"\n priority="link" (onClick)="close()"></s-button>\n </div>\n </div>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],t)}(),xo=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),Mo=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,h.SidebarModule,bt,h.ControlErrorsModule,Ee,M.CurrencyMaskModule,ve,d.InputTextModule,_t,L.FieldsetModule,h.CustomFieldsModule,O.PanelModule],declarations:[Ao,Po],providers:[xo,I.ConfirmationService],exports:[Ao]})],t)}(),Lo=function(){function o(t,e){this.http=t,this.httpClient=e}return o.prototype.remove=function(e,o,n,i){return void 0===n&&(n=t.ServiceType.PAYROLL),n===t.ServiceType.DEPENDENT?this.httpClient.post("hcm/dependent/queries/historicalJudicialPensionBankAccountDelete",{dependentId:i,dateWhen:o}):this.http.post("actions/historicalEmployeeBankAccountDelete",{employeeId:e,dateWhen:o})},o.ctorParameters=function(){return[{type:Nt},{type:v.HttpClient}]},o=N([e.Injectable()],o)}(),Oo=y,Bo=function(){function o(t,o,n,i,r,a,s){this.confirmationService=t,this.translateService=o,this.activatedRoute=n,this.cd=i,this.router=r,this.messageService=a,this.historicalBankAccountListService=s,this.endPoint="hcm/payroll/queries/historicalEmployeeBankAccountQuery",this.keyPayload="historicalEmployeeBankAccount",this.withSidebar=!0,this.enableView=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.loading=!0,this.columns=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"dateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_qtd_account"),field:"numberOfBankAccount"}]}return o.prototype.ngOnInit=function(){this.initParameters={employeeId:this.employeeId,dependentId:this.dependentId}},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},o.prototype.onLazyLoad=function(t){var e=this;t.forEach((function(t){t.dateWhen=Oo(t.dateWhen).format(e.dateFormat)})),this.onGridLoad(t),this.loading=!1},o.prototype.getMenuActions=function(t){var e=this;return[{label:this.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){var o=t&&t.dateWhen&&Oo(t.dateWhen,e.dateFormat).format("YYYY-MM-DD");e.withSidebar?e.router.navigate(["historical-bank-account/"+o],{relativeTo:e.activatedRoute}):e.enableView.emit(o)}},{label:this.translateService.instant("hcm.payroll.delete"),command:function(){e.isAllowToDeleteHistorical&&t?e.delete(t.id,t.dateWhen):e.messageService.add({severity:"error",summary:e.translateService.instant("hcm.payroll.error"),detail:e.translateService.instant("hcm.payroll.permission_error_not_allowed")})}}]},o.prototype.delete=function(e,o){var n=this;if(e===this.lastRecord.id){var i=Oo(o,this.dateFormat).format("YYYY-MM-DD");this.confirmationService.confirm({message:this.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_question_confirm_delete")+"?",accept:function(){n.loading=!0;var e=n.withSidebar?t.ServiceType.PAYROLL:t.ServiceType.DEPENDENT;n.historicalBankAccountListService.remove(n.employeeId,i,e,n.dependentId).pipe(s.takeUntil(n.ngUnsubscribe)).subscribe((function(){n.messageService.add({severity:"success",summary:n.translateService.instant("hcm.payroll.success"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_remove")}),n.parameters=n.parameters&&R({},n.parameters)||{}}),(function(){n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_error_remove")}),n.loading=!1}))}})}else this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.not_allowed_delete_last")})},o.prototype.add=function(){this.isAllowToAddHistorical?this.router.navigate(["historical-irrf-new"],{relativeTo:this.activatedRoute}):this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},o.prototype.onGridLoad=function(t){t&&t.length&&(this.lastRecord=t[0])},Object.defineProperty(o.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"scopedActions",{get:function(){return this.getMenuActions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"reloadList",{set:function(t){t&&(this.loading=!0,this.parameters=this.parameters&&R({},this.parameters)||{})},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:I.ConfirmationService},{type:a.TranslateService},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef},{type:r.Router},{type:I.MessageService},{type:Lo}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],o.prototype,"customFields",void 0),N([e.Input()],o.prototype,"permission",void 0),N([e.Input()],o.prototype,"employeeId",void 0),N([e.Input()],o.prototype,"dependentId",void 0),N([e.Input()],o.prototype,"dateFormat",void 0),N([e.Input()],o.prototype,"endPoint",void 0),N([e.Input()],o.prototype,"keyPayload",void 0),N([e.Input()],o.prototype,"withSidebar",void 0),N([e.Output()],o.prototype,"enableView",void 0),N([e.Input()],o.prototype,"reloadList",null),o=N([e.Component({selector:"c-historical-bank-account-list",template:'<div class="ui-g">\n <div class="ui-g-12">\n <c-data-list-rest\n id="ta-irrf"\n [columns]="columns"\n actionLabel="{{ \'hcm.payroll.movimentation_generic_action\' | translate }}"\n emptyMessage="{{ \'hcm.payroll.admission_empty_message\' | translate }}"\n [endpoint]="endPoint"\n singularMessageRecords="{{\n \'hcm.payroll.admission_register\' | translate\n }}"\n [actions]="scopedActions"\n pluralMessageRecords="{{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [keyPayload]="keyPayload"\n [lazy]="true"\n (lazyLoad)="onLazyLoad($event)"\n [(loading)]="loading"\n [initParameters]="initParameters"\n [parameters]="parameters"\n [isSortable]="false"\n ></c-data-list-rest>\n </div>\n</div>\n\n',styles:[""]})],o)}(),Ro=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,Ct,B.ConfirmDialogModule],declarations:[Bo],providers:[Lo],exports:[Bo]})],t)}(),No=function(){function e(t){this.field=t.field,this.value=t.value,this.operation=t.operation}return Object.defineProperty(e.prototype,"field",{get:function(){return this._field},set:function(t){this._field=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operation",{get:function(){return this._operation},set:function(t){this._operation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.operation===t.Operators.CONTAINING?this.operation+"(lower("+this.field+"), lower("+this.value+"))":this.field+" "+(this.operation||"")+" "+this.value},e}(),Vo=y,jo=Vo("31/12/1900","DD/MM/YYYY"),qo=Vo("04/06/2080","DD/MM/YYYY"),Uo=function(){function e(){}return e.isValidDate=function(t,e){return function(o){var n=!e||!e.hasOwnProperty("useG5DateRange")||e.useG5DateRange,i=fe(o.value);if(t=fe(t),i&&t&&i.length===t.length&&!o.value.includes("_")){var r=Vo(i,t),a=r.isValid(),s=!n||r.isBetween(jo,qo,null,"[]");return a&&s?null:{invalidDate:!0}}return null}},e.isDateLower=function(e,o,n){void 0===n&&(n="day");var i={compareName:"lowerDate",granularity:n};return this.isValidDateCompare(e,o,t.CompareType.isBefore,i)},e.isValidDateCompare=function(t,e,o,n){var i=this;return function(r){var a=fe(r.value);if(e=fe(e),a&&e&&a.length===e.length&&!r.value.includes("_")){var s=Vo(a,e),l=Vo(t,e);return i.dateCompare(s,l,o,n)}return null}},e.getDateFormatFromLocale=function(t,e){var o=t&&t.dateFormat;if(o){var n=o.replace(/[y]/g,"YY").replace(/[^a-zA-Z]/g,"").toUpperCase();return e&&(n=n.replace("DD","")),n}return null},e.getDateTimeFormatFromLocale=function(t){if(t){var e=t.dateFormat.toString();return e=e.replace(/[y]/g,"YY").toUpperCase(),e+=" HH:mm:ss"}return null},e.getDateFormatFromCalendar=function(t){if(t&&t.dateFormat){var e=t.dateFormat.toString();return e=e.replace(/[y]/g,"YY").toUpperCase()}return null},e.dateCompare=function(e,o,n,i){var r=n===t.CompareType.isNotSame?t.CompareType.isSame:n,a=i&&i.granularity?i.granularity:"day",s=e[r](o,a);if(s=n===t.CompareType.isNotSame?!s:s){var l={};return l[i&&i.compareName?i.compareName:n]=!0,l}return null},e.getFormatDateWithBar=function(t){if(t&&t.dateFormat){var e=t.dateFormat.toString();return e=e.replace("dd","DD").replace("mm","MM").replace("yy","YYYY")}return null},e}(),Yo=function(){function t(){this._processVariables={},this._workflowPayload={},this.processInstanceId=new f.BehaviorSubject(null),this.resetActions()}return t.prototype.init=function(){var t=this;this.workflowCockpit=workflowCockpit({init:function(e,o){return V(t,void 0,void 0,(function(){var t,n,i;return j(this,(function(r){switch(r.label){case 0:return this._isRequestNew=o&&o.isRequestNew(),t=this,(n=o)?[4,o.getTaskData()]:[3,2];case 1:n=r.sent(),r.label=2;case 2:return t._taskData=n,this._isRequestNew?[3,4]:[4,o.getInfoFromProcessVariables()];case 3:i=r.sent(),this.addProcessVariable("processVariablesFromWorkflow",i),r.label=4;case 4:return this.processInstanceId.next(e.processInstanceId),[4,this._onLoadWorkflow(e,o)];case 5:return[2,r.sent()]}}))}))},onSubmit:function(e,o){return V(t,void 0,void 0,(function(){var t,n;return j(this,(function(i){switch(i.label){case 0:return t=this,(n=e)?[4,e.nextAction]:[3,2];case 1:n=i.sent(),i.label=2;case 2:return t._nextAction=n,this._isFinishing=this._nextAction.finish,this._nextActionName=this._nextAction.name,[4,this._onSubmitWorkflow(e,o)];case 3:return i.sent(),[2,this._workflowPayload]}}))}))},onError:function(e,o){return V(t,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._onRollbackWorkflow(e,o)];case 1:return t.sent(),[2]}}))}))}})},t.prototype._onLoadWorkflow=function(t,e){return V(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._runActions(this.onLoadActions)];case 1:return[2,t.sent()]}}))}))},t.prototype._onSubmitWorkflow=function(t,e){return V(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._runActions(this.onSubmitActions)];case 1:return[2,t.sent()]}}))}))},t.prototype._onRollbackWorkflow=function(t,e){return V(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this._runActions(this.onRollbackActions)];case 1:return[2,t.sent()]}}))}))},t.prototype.resetActions=function(){this.onLoadActions={},this.onSubmitActions={},this.onRollbackActions={}},t.prototype._runActions=function(t){return V(this,void 0,void 0,(function(){var e,o=this;return j(this,(function(n){switch(n.label){case 0:return e={},[4,Promise.all(Object.entries(t).map((function(t){var n=U(t,2),i=n[0],r=n[1];return V(o,void 0,void 0,(function(){var t,o,n;return j(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=e,o=i,[4,r()];case 1:return t[o]=a.sent(),[2];case 2:throw n=a.sent(),Error(n);case 3:return[2]}}))}))})))];case 1:return n.sent(),[2,e]}}))}))},t.prototype.addOnLoadAction=function(t,e){this.onLoadActions[t]=e},t.prototype.addOnSubmitAction=function(t,e){this.onSubmitActions[t]=e},t.prototype.addOnRollbackAction=function(t,e){this.onRollbackActions[t]=e},t.prototype.addProcessVariable=function(t,e){try{this._processVariables[t]=e}catch(e){throw{erro:e,message:"Não foi possível adicionar a variável "+t+" às variáveis do processo."}}},t.prototype.setWorkflowPayload=function(t){this._workflowPayload=t},Object.defineProperty(t.prototype,"loadActions",{get:function(){return this.onLoadActions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"submitActions",{get:function(){return this.onSubmitActions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rollbackActions",{get:function(){return this.onRollbackActions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRequestNew",{get:function(){return this._isRequestNew},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFinishing",{get:function(){return this._isFinishing},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextActionName",{get:function(){return this._nextActionName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"taskData",{get:function(){return this._taskData},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"processVariables",{get:function(){var t=this;return new Promise((function(e,o){t._processVariables?e(t._processVariables):o("Não foram encontradas variáveis para o processo")})).then((function(e){t._processVariables=e})).catch((function(t){throw t})),this._processVariables},enumerable:!0,configurable:!0}),t=N([e.Injectable()],t)}(),Go=function(){function t(t,e,o){this.router=t,this.activatedRoute=e,this.workflowDataService=o,this.ngUnsubscribe=new f.Subject}return t.prototype.ngOnInit=function(){this.registerSubscribers()},t.prototype.registerSubscribers=function(){var t=this;this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.useWorkflow=!(!e||!e.useWorkflow),t.routeEndpoint=e&&e.routeEndpoint,t.useWorkflow&&t.workflowDataService.setUseWorkflow(t.useWorkflow)}))},t.prototype.onSelectEmployee=function(){var t=this.employeeSelected.tableId;t&&this.navigate(t)},t.prototype.navigate=function(t){this.router.navigate(["workflow/"+t+"/"+this._routeEndpoint])},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},Object.defineProperty(t.prototype,"useWorkflow",{get:function(){return this._useWorkflow},set:function(t){this._useWorkflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"routeEndpoint",{get:function(){return this._routeEndpoint},set:function(t){this._routeEndpoint=t},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:r.Router},{type:r.ActivatedRoute},{type:lo}]},t=N([e.Component({selector:"lib-employee-selector",template:'<p-panel header="{{ \'hcm.payroll.employee_selector_panel_header\' | translate }}">\n <div class="ui-g ui-fluid">\n <div class="ui-md-6 ui-g-6">\n <label for="ff-employee" id="lb-employee">{{\n "hcm.payroll.employee" | translate\n }}</label>\n <input-rest-auto-complete-employee-model\n id="ff-employee"\n [dropdown]="true"\n placeholder="{{\n \'hcm.payroll.employees_company_placeholder\' | translate\n }}"\n name="employee"\n emptyMessage="{{ \'hcm.payroll.not_suggestions\'|translate }}"\n [(model)]="employeeSelected"\n (onSelect)="onSelectEmployee()"\n >\n </input-rest-auto-complete-employee-model>\n </div>\n </div>\n</p-panel>\n',styles:[""]})],t)}(),Ho=function(){function t(){}return t=N([e.NgModule({imports:[ut,O.PanelModule,Ce],declarations:[Go],exports:[Go]})],t)}(),Ko=function(){function t(){}return N([e.Input()],t.prototype,"divergentFormData",void 0),t=N([e.Component({selector:"from-to",template:'<div id="from-to" class="ui-g ui-fluid" *ngIf="divergentFormData">\n <div class="ui-g-12">\n \x3c!-- Painel Collapsable --\x3e\n <p-panel\n class="ui-g-12 ui-fluid form-group"\n header="{{ \'hcm.payroll.disagreements\' | translate }}"\n [toggleable]="true"\n [collapsed]="false"\n >\n <section id="from-to-content" class="ui-g ui-fluid form-group">\n \x3c!-- INICIO DE SEÇÃO: DE (ANTES): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.from\' | translate }}">\n <section id="from-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-from">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-from"\n id="{{divergence.key}}-from"\n value="{{ divergence.oldValue }}"\n />\n\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: DE (ANTES): --\x3e\n\n \x3c!-- INICIO DE SEÇÃO: PARA (DEPOIS): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.to\' | translate }}">\n <section id="to-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-to">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-to"\n id="{{divergence.key}}-to"\n value="{{ divergence.newValue }}"\n />\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: PARA (DEPOIS): --\x3e\n </section>\n </p-panel>\n </div>\n</div>\n'})],t)}(),Wo=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,O.PanelModule,a.TranslateModule,o.ReactiveFormsModule,d.InputTextModule],declarations:[Ko],exports:[Ko]})],t)}(),zo=function(){function t(){}return t.getFormattedCpf=function(t){return t?t.replace(/\D/g,"").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1-$2"):null},t.getFormattedCnpj=function(t){return t?t.replace(/\D/g,"").replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2"):null},t.getCpfCnpjMask=function(t){switch(t){case"CPF":return"999.999.999-99";case"CNPJ":return"99.999.999/9999-99";default:return""}},t.getFormattedTelephoneNumber=function(t){var e=t.replace(/\D/g,"");return(e=e.replace(/^0/,"")).length>10?e=e.replace(/^(\d{2})?(\d{5})?(\d{4}).*/,"($1) $2-$3"):e.length>9?e=e.replace(/^(\d{2})?(\d{4})?(\d{4}).*/,"($1) $2-$3"):e.length>5?e=e.replace(/^(\d{2})?(\d{4})?(\d{0,4}).*/,"($1) $2-$3"):e.length>1?e=e.replace(/^(\d{2})?(\d{0,5}).*/,"($1) $2"):""!==e&&(e=e.replace(/^(\d*)/,"($1")),e},t.formatTelephoneInputEvent=function(e){var o=e.target.value;(8!==e.keyCode||9!==o.length&&4!==o.length&&3!==o.length)&&(e.target.value=t.getFormattedTelephoneNumber(o))},t.getFormattedPercentage=function(t){return parseFloat(t).toFixed(2).replace(".",",")+"%"},t}(),$o=function(){function t(){}return t.isValidCei=function(t){var e=t.value;if(!e)return null;if(11!=e.length)return null;var o=0,n=0;if(11!==e.length||"00000000000"===e||"11111111111"===e||"22222222222"===e||"33333333333"===e||"44444444444"===e||"55555555555"===e||"66666666666"===e||"77777777777"===e||"88888888888"===e||"99999999999"===e)return{invalidCei:!0};for(var i=0;i<10;i++)o+=parseInt(e.substring(i,i+1),10)*parseInt("3298765432".substring(i,i+1),10);return(n=10===(n=11-o%11)||11===n?0:n)===parseInt(""+e.charAt(10),10)?null:{invalidCei:!0}},t.isValidCpf=function(t){var e=t.value;if(e){var o=void 0,n=void 0,i=void 0,r=void 0,a=void 0;if(a=1,e.length<11)return null;for(r=0;r<e.length-1;r++)if(e.charAt(r)!==e.charAt(r+1)){a=0;break}if(a)return{cpfNotValid:!0};for(o=e.substring(0,9),n=e.substring(9),i=0,r=10;r>1;r--)i+=o.charAt(10-r)*r;if((i%11<2?0:11-i%11)!==Number(n.charAt(0)))return{cpfNotValid:!0};for(o=e.substring(0,10),i=0,r=11;r>1;r--)i+=o.charAt(11-r)*r;return(i%11<2?0:11-i%11)!==Number(n.charAt(1))?{cpfNotValid:!0}:null}return null},t.isValidCnpj=function(t){var e=t.value;if(e){var o=void 0,n=void 0,i=void 0,r=void 0,a=void 0;if(14!==(e=e.replace(/[^\d]+/g,"")).length)return null;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return{cnpjNotValid:!0};o=e.length-2,n=e.substring(0,o),i=e.substring(o),r=0,a=o-7;for(var s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);if((r%11<2?0:11-r%11)!==Number(i.charAt(0)))return{cnpjNotValid:!0};o+=1,n=e.substring(0,o),r=0,a=o-7;for(s=o;s>=1;s--)r+=n.charAt(o-s)*a--,a<2&&(a=9);return(r%11<2?0:11-r%11)!==Number(i.charAt(1))?{cnpjNotValid:!0}:null}return null},t.isValidPhoneNumber=function(t){var e=t.value||"";e=e.replace(/[\s()-]/g,"");return/^[1-9][\d]{1,2}\d{8,10}$/.test(e)?null:{invalidPhoneNumber:!0}},t.isValidEmail=function(t){var e=t.value;return/^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/.test(e)?null:{invalidEmail:!0}},t}(),Qo=function(){function t(t,n){this.formBuilder=t,this.cd=n,this.withSideBar=!0,this.isEditMode=!1,this.paramsForm=new o.FormGroup({}),this.defaultCpfNumber=null,this.permitsEditBankAccountForm=!1,this.visibleChange=new e.EventEmitter,this.pixAccountItemToList=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.initialValidatorOfPercentage=[o.Validators.required,o.Validators.min(.01)],this.labelBtnAdd="hcm.payroll.employees_add",this.maxValuePercentage=100,this.visibleBtnSave=!0,this.isView=!1,this.isShowPixKeyFieldValidatorMessage=!1,this.createFormGroup(),this.registerSubjects()}return t.prototype.ngOnInit=function(){},t.prototype.ngDoCheck=function(){if(this.pixAccountFormGroup&&"BANK_ACCOUNT"===this.pixKeyType){var t=this.pixAccountFormGroup.get("pixKey");t&&!t.disabled&&t.disable()}},t.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},t.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.unsubscribe()},t.prototype.registerSubjects=function(){},t.prototype.createFormGroup=function(){this.pixAccountFormGroup=this.formBuilder.group({id:this.formBuilder.control(null),index:this.formBuilder.control(null),employee:this.formBuilder.control({value:{tableId:null},disabled:!0}),dateChange:this.formBuilder.control(null),pixKeyType:this.formBuilder.control(null,o.Validators.required),pixKey:this.formBuilder.control(null),percentage:this.formBuilder.control(null,o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),externalId:this.formBuilder.control(null),customFields:this.formBuilder.control(null)})},t.prototype.onChangePixKeyType=function(t){t.key&&(this.pixKeyType=t.key,this.isShowPixKeyFieldValidatorMessage=!0,this.pixAccountFormGroup.get("pixKey").reset(),this.setPixKeyValidators(!0),"CPF"===t.key&&this.setDefaultCpfPixKey())},t.prototype.onClearPixKeyType=function(){this.isShowPixKeyFieldValidatorMessage=!1,this.pixAccountFormGroup.get("pixKey").reset()},Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEditAndViewValue",{set:function(t){this.resetForm(),this.visibleBtnSave=!0,t&&t.permitsEditBankAccount&&(this.permitsEditBankAccountForm=!0),t&&t.currentItem&&Object.keys(t.currentItem).length?(this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(R({},t.currentItem))),this.labelBtnAdd="hcm.payroll.employees_update",this.setValidatorsAccordingList(t.listData,t.currentItem.index,t&&t.isEditMode),this.isView?this.pixAccountFormGroup.get("pixKeyType").value&&(this.pixKeyType=this.pixAccountFormGroup.get("pixKeyType").value.key,this.formatPixKeyTelephoneNumber()):this.configEnableFields(t&&t.isEditMode)):this.labelBtnAdd="hcm.payroll.employees_add"},enumerable:!0,configurable:!0}),t.prototype.formatPixKeyTelephoneNumber=function(){"TELEPHONE"===this.pixKeyType&&this.pixAccountFormGroup.get("pixKey").setValue(zo.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value))},t.prototype.convertDTOToShowWithCustomFields=function(t){var e=R({},t);return e.customFields=se(e.customFields),e},t.prototype.configEnableFields=function(t){this.visibleBtnSave=t,this.pixAccountFormGroup.get("pixKeyType").value&&(this.pixKeyType=this.pixAccountFormGroup.get("pixKeyType").value.key,this.setPixKeyValidators(t),this.formatPixKeyTelephoneNumber()),ce(this.pixAccountFormGroup,t,["pixKeyType","pixKey","percentage","customFields"],[])},t.prototype.close=function(){this.resetForm(),this.visible=!1},t.prototype.addItem=function(){this.pixAccountFormGroup.updateValueAndValidity(),le.call(this.pixAccountFormGroup),this.pixAccountFormGroup.valid&&(this.employeeId&&this.pixAccountFormGroup.get("employee").setValue({tableId:this.employeeId,name:""}),this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue()),this.visible=!1,this.resetForm())},t.prototype.resetForm=function(){this.pixAccountFormGroup.reset(),this.labelBtnAdd="hcm.payroll.employees_add",this.customFields&&this.customFields.formGroup&&this.customFields.formGroup.reset()},Object.defineProperty(t.prototype,"percentagePlaceholder",{get:function(){return"0"+(this.currency&&this.currency.decimalSeparator)+"00"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optionsPercentage",{get:function(){return R({},this.getOptions(),{precision:2})},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return{prefix:"",thousands:this.currency.thousandsSeparator,decimal:this.currency.decimalSeparator}},Object.defineProperty(t.prototype,"getListPixAccount",{set:function(t){t?this.setValidatorsAccordingList(t,null,!1):this.resetForm()},enumerable:!0,configurable:!0}),t.prototype.setValidatorsAccordingList=function(t,e,o){void 0===e&&(e=null),void 0===o&&(o=!0),this.pixAccountList=t&&t.length?Y(t):[];var n=[];this.pixAccountList&&this.pixAccountList.length&&this.pixAccountList.filter((function(t,o){t.percentage&&o!=e&&n.push(t.percentage)})),this.beforeSetPixKeyTypeValidator(),this.setPixKeyValidators(o),this.validatePercentageValid(n)},t.prototype.setPixKeyValidators=function(t){var e=this.pixAccountFormGroup.get("pixKey");if(this.pixKeyType){switch(this.pixKeyType){case"TELEPHONE":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidPhoneNumber]));break;case"EMAIL":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidEmail]));break;case"CPF":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidCpf]));break;case"CNPJ":e.setValidators(o.Validators.compose([o.Validators.required,$o.isValidCnpj]));break;case"RANDOM_KEY":e.setValidators(o.Validators.required);break;default:e.setValidators(null)}t&&e.enable(),e.updateValueAndValidity()}},t.prototype.validatePercentageValid=function(t){var e=this.pixAccountFormGroup.get("percentage");this.maxValuePercentage=t.reduce((function(t,e){return t-e}),100),e.setValidators(o.Validators.compose(Y(this.initialValidatorOfPercentage,[o.Validators.max(this.maxValuePercentage)]))),e.updateValueAndValidity()},Object.defineProperty(t.prototype,"isViewMode",{set:function(t){this.isView=!(!t||this.withSideBar),this.configEnableFields(!this.isView),this.isView||this.resetForm()},enumerable:!0,configurable:!0}),t.prototype.phoneMask=function(t){zo.formatTelephoneInputEvent(t)},t.prototype.setDefaultCpfPixKey=function(){if(this.defaultCpfNumber)this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);else{var t=this.paramsForm.get("sheetDocument");if(t){var e=t.get("cpfNumber").value;e&&this.pixAccountFormGroup.get("pixKey").setValue(e)}}},t.prototype.beforeSetPixKeyTypeValidator=function(){var t=this.pixAccountFormGroup.get("pixKeyType");this.pixAccountList&&this.pixAccountList.length&&t?t.setValidators(o.Validators.compose([o.Validators.required,this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList)])):t.setValidators(o.Validators.required)},t.prototype.validateDuplicatePixKeyTypeBankAccount=function(t){var e=this;return function(o){var n=o&&o.value,i=!1;return t.filter((function(t){if(n&&"BANK_ACCOUNT"===t.pixKeyType.key&&n.key===t.pixKeyType.key)return i=!0})),i&&!e.permitsEditBankAccountForm?{pixKeyTypeBankAccountDuplicate:!0}:null}},t.ctorParameters=function(){return[{type:o.FormBuilder},{type:e.ChangeDetectorRef}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!0})],t.prototype,"customFields",void 0),N([e.Input()],t.prototype,"currency",void 0),N([e.Input()],t.prototype,"customEntity",void 0),N([e.Input()],t.prototype,"customService",void 0),N([e.Input()],t.prototype,"withSideBar",void 0),N([e.Input()],t.prototype,"isEditMode",void 0),N([e.Input()],t.prototype,"paramsForm",void 0),N([e.Input()],t.prototype,"defaultCpfNumber",void 0),N([e.Input()],t.prototype,"permitsEditBankAccountForm",void 0),N([e.Output()],t.prototype,"visibleChange",void 0),N([e.Output()],t.prototype,"pixAccountItemToList",void 0),N([e.Input()],t.prototype,"visible",null),N([e.Input()],t.prototype,"isEditAndViewValue",null),N([e.Input()],t.prototype,"getListPixAccount",null),N([e.Input()],t.prototype,"isViewMode",null),t=N([e.Component({selector:"pix-account",template:'<div id="main">\n <form [formGroup]="pixAccountFormGroup" autocomplete="off">\n <div class="ui-fluid">\n <div class="ui-g">\n \x3c!-- Tipo de chave --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.employees_addition_pix_key_type\'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]="true" server="payroll"\n enumeration="PixKeyType"\n placeholder="{{\'hcm.payroll.select\' | translate}}"\n name="pixKeyType" [form]="pixAccountFormGroup"\n (onSelect)="onChangePixKeyType($event)"\n (onClear)="onClearPixKeyType()"\n id="ta-pixKeyType"></input-rest-auto-complete-enum>\n <s-control-errors [control]="pixAccountFormGroup.get(\'pixKeyType\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n pixKeyTypeBankAccountDuplicate: \'hcm.payroll.historical_pix_key_type_bank_account_duplicate\' | translate\n }">\n </s-control-errors>\n </div>\n \x3c!--Chave Pix--\x3e\n <div class="ui-md-6 ui-sm-12" [ngClass]="{\'required\': pixKeyType !== \'BANK_ACCOUNT\'}">\n <label>{{\'hcm.payroll.employees_addition_pix_key\' | translate}}</label>\n <ng-container [ngSwitch]="pixKeyType">\n <input *ngSwitchCase="\'TELEPHONE\'" only-number\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey"\n (keyup)="phoneMask($event)" maxlength="15"\n placeholder="(__) ____-____">\n <p-inputMask *ngSwitchCase="\'CPF\'"\n id="ta-pixKey" name="pixKey" formControlName="pixKey"\n placeholder="___.___.___-__"\n mask="999.999.999-99" [unmask]="true"></p-inputMask>\n <p-inputMask *ngSwitchCase="\'CNPJ\'"\n id="ta-pixKey" name="pixKey" formControlName="pixKey"\n placeholder="__.___.___/____-__"\n mask="99.999.999/9999-99" [unmask]="true"></p-inputMask>\n <input *ngSwitchCase="\'EMAIL\'"\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey"\n placeholder="{{\'hcm.payroll.employees_addition_email\'|translate}}"/>\n <input *ngSwitchCase="\'BANK_ACCOUNT\'" disabled\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey"/>\n <input *ngSwitchDefault\n pInputText id="ta-pixKey" name="pixKey" formControlName="pixKey" maxlength="100" />\n </ng-container>\n <s-control-errors *ngIf="isShowPixKeyFieldValidatorMessage" id="er-pix-key"\n [control]="pixAccountFormGroup.get(\'pixKey\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n invalidPhoneNumber: \'hcm.payroll.employees_addition_invalid_phone_number\' | translate: { value: pixAccountFormGroup.get(\'pixKey\').value },\n invalidEmail: \'hcm.payroll.employees_addition_email_invalid\' | translate,\n cpfNotValid: \'hcm.payroll.employees_addition_cpf_error\' | translate,\n cnpjNotValid: \'hcm.payroll.employees_addition_cnpj_error\' | translate\n }">\n </s-control-errors>\n </div>\n \x3c!--Percentual--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label id="lb-percentage"\n for="ff-percentage">{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input pInputText id="ff-percentage" name="percentage"\n formControlName="percentage"\n currencyMask\n [options]="optionsPercentage"\n [placeholder]="percentagePlaceholder"/>\n </div>\n <s-control-errors [control]="pixAccountFormGroup.get(\'percentage\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'6\' },\n max: \'hcm.payroll.error_max_value_number\' | translate: { value: maxValuePercentage },\n min: \'hcm.payroll.error_min_value_number\' | translate: { value: \'0,01\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12">\n <p-fieldset\n legend="{{ \'hcm.payroll.custom_fields\' | translate }}"\n [attr.data-hidden]="!customFields || !customFields.fields.length"\n >\n <s-custom-fields\n domain="hcm"\n service="{{customService}}"\n entity="{{customEntity}}"\n formControlName="customFields"\n [invalidErrorLabel]="\'hcm.payroll.employees_invalid_field\' | translate"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]="withSideBar ? \'footer\' : \'footer-s-border\'">\n <div class="form-group">\n <s-button id="btn-save" label="{{ labelBtnAdd | translate}}" priority="primary"\n (onClick)="addItem()" *ngIf="visibleBtnSave && !this.isView"></s-button>\n <s-button *ngIf="withSideBar" id="btn-close" label="{{\'hcm.payroll.cancel\'|translate}}" priority="secondary"\n priority="link" (onClick)="close()"></s-button>\n </div>\n </div>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],t)}(),Jo=function(){function n(o,n,i,r){var a=this;this.translateService=o,this.cd=n,this.formBuilder=i,this.messageService=r,this.recordByRow=1,this.showDateChange=!1,this.isEditMode=!1,this.isViewMode=!1,this.withSideBar=!0,this.defaultCpfNumber=null,this.listDataReciever=[],this.showButtonEdit=!1,this.isViewModeActive=new e.EventEmitter,this.isEditModeActive=new e.EventEmitter,this.isDeleteModeActive=new e.EventEmitter,this.listFromApp=[],this.visibleChange=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.orderBy={field:"dateChange",direction:t.DirectionEnumeration.DESC},this.pixAccountItemInput={},this.totalRecords=0,this.actionLabel=this.translateService.instant("hcm.payroll.entries_query_actions_total_title"),this.loading=!0,this.listData=[],this.listDataNoPage=[],this.permitsEditBankAccount=!1,this.cols=[{label:this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),field:"pixKeyType"},{label:this.translateService.instant("hcm.payroll.employees_addition_pix_key"),field:"pixKey"},{label:this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),field:"percentage"}],this.actions=function(t,e){return void 0===t&&(t={}),[{visible:a.isEditMode,label:a.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){a.isAllowToViewHistorical?(t.index=e,a.pixAccountItemInput={currentItem:t,listData:a.listDataNoPage,isEditMode:!1},a.visible=!0):a.isViewModeActive.emit(!0)}},{visible:!!(!a.isEditMode&&a.withSideBar||a.showButtonEdit),label:a.translateService.instant("hcm.payroll.edit"),command:function(){a.permitsEditBankAccount=!0,a.isAllowToEditHistorical?(t.index=e,a.pixAccountItemInput={currentItem:t,listData:a.listDataNoPage,isEditMode:!0,permitsEditBankAccount:!0},a.visible=!0):(a.isEditModeActive.emit(!0),0==a.listFromApp.length&&(t.index=e,a.pixAccountItemInput={currentItem:t,listData:a.listDataNoPage,isEditMode:!0,permitsEditBankAccount:!0}))}},{visible:!a.isEditMode,label:a.translateService.instant("hcm.payroll.delete"),command:function(){a.isAllowToDeleteHistorical?(a.loading=!0,a.deleteAnnuityItem(e)):(a.isDeleteModeActive.emit(!0),0==a.listFromApp.length&&(a.loading=!0,a.deleteAnnuityItem(e)))}}]},this.createFormGroup()}return n.prototype.ngOnInit=function(){this.formGroup.setControl(this.fieldFormGroup,this.historicalPixAccountList)},n.prototype.ngOnChanges=function(t){t.listDataReciever&&t.listDataReciever.currentValue&&(this.listFromApp=t.listDataReciever.currentValue),t.showButtonEdit&&t.showButtonEdit.currentValue&&(this.permitsEditBankAccount=t.showButtonEdit.currentValue)},n.prototype.createFormGroup=function(){this.historicalPixAccountList=this.formBuilder.group({historicalPixAccountList:this.formBuilder.control(null)})},n.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},n.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},n.prototype.onLazyLoad=function(e){var o=this,n=e&&e.first?e.first:0,i=e&&e.rows?e.rows:this.recordByRow,r=this.getHistoricalPixAccountList();this.listData=[],this.totalRecords=null,e&&e.multiSortMeta&&e.multiSortMeta.length&&e.multiSortMeta.map((function(e){o.orderBy.field=e.field,o.orderBy.direction=1===e.order?t.DirectionEnumeration.ASC:t.DirectionEnumeration.DESC})),r&&r.length?(this.totalRecords=r.length,this.listData=r,this.listDataNoPage=Y(r),this.listData.sort(me(this.orderBy.field,this.orderBy.direction)),this.listData=this.listData.slice(n,n+i)):this.listDataNoPage=[],(this.isEditMode||r&&1===r.length)&&this.refreshCssInIE11(),this.loading=!1},n.prototype.refreshCssInIE11=function(){/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&setTimeout((function(){var t=document.getElementsByClassName("row0");t&&t[0]&&(t[0].className="refresh")}),1)},n.prototype.add=function(){this.pixAccountItemInput={},this.visible=!0},n.prototype.isNotAllowMessage=function(){this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},n.prototype.deleteAnnuityItem=function(t){var e=Y(this.getHistoricalPixAccountList());e.sort(me(this.orderBy.field,this.orderBy.direction)),delete e[t],e=e.filter((function(t){return t})),this.historicalPixAccountList.get("historicalPixAccountList").setValue(e),this.verifyTotalPercentage(),this.onLazyLoad()},n.prototype.getHistoricalPixAccountList=function(){return this.historicalPixAccountList.get("historicalPixAccountList")&&this.historicalPixAccountList.get("historicalPixAccountList").value&&this.historicalPixAccountList.get("historicalPixAccountList").value.length?this.historicalPixAccountList.get("historicalPixAccountList")&&this.historicalPixAccountList.get("historicalPixAccountList").value:[]},n.prototype.addItemInList=function(t){var e=t&&t.index>=0?t.index:null,o=this.getHistoricalPixAccountList()?this.getHistoricalPixAccountList():[];if(null!=e)o[e]=t,delete t.index;else{if(Jt(t.customFields)&&Object.keys(t.customFields).length){var n=ae(t.customFields);t.customFields=Y(n)}t.dateChange=this.dateChange,o.push(t)}this.formComponent&&(this.formComponent.permitsEditBankAccountForm=!1,this.cd.detectChanges()),this.historicalPixAccountList.get("historicalPixAccountList").setValue(o),this.verifyTotalPercentage(),this.onLazyLoad({first:this.getNumberPageByIndex(e,o)})},n.prototype.getNumberPageByIndex=function(t,e){if(t){var o=e.length,n=this.recordByRow-1;return Math.ceil(o/this.recordByRow)*this.recordByRow-n-1}return null},n.prototype.verifyTotalPercentage=function(){var t=this.getHistoricalPixAccountList()?this.getHistoricalPixAccountList():[],e=[];if(!t.length)return this.msgTotalLimitByPercentage=null;t.filter((function(t){return e.push(t&&t.percentage)}));var o=e.reduce((function(t,e){return t+e}),0);this.msgTotalLimitByPercentage=100===o?this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage"):null},Object.defineProperty(n.prototype,"scopedActions",{get:function(){return this.actions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.translateService.instant("hcm.payroll.admission_register"):this.translateService.instant("hcm.payroll.admission_registers"))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"getTooltipAndDisableButtonAdd",{get:function(){return this.dateChange?null:this.msgTooltipAdd},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dateChange",{get:function(){return this._dateChange},set:function(t){var e=this;this._dateChange=t,this._dateChange&&this.listData.filter((function(t){return t.dateChange=e._dateChange}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"displayDateChange",{get:function(){return this._displayDateChange},set:function(t){var e=this;this._displayDateChange=t,this._displayDateChange&&this.listData.filter((function(t){return t.displayDateChange=e._displayDateChange}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"addListData",{set:function(t){this.loading=!0,this.historicalPixAccountList.get("historicalPixAccountList").patchValue(t),this.verifyTotalPercentage(),this.onLazyLoad()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t,this.visibleChange.emit(this.visible),t||(this.pixAccountItemInput={})},enumerable:!0,configurable:!0}),n.prototype.close=function(){this.visible=!1},n.prototype.getFormattedTelephoneNumber=function(t){return zo.getFormattedTelephoneNumber(t)},n.prototype.getFormattedCpf=function(t){return zo.getFormattedCpf(t)},n.prototype.getFormattedCnpj=function(t){return zo.getFormattedCnpj(t)},n.prototype.getFormattedPercentage=function(t){return zo.getFormattedPercentage(t)},Object.defineProperty(n.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isAllowToEditHistorical",{get:function(){return this.permission.editar},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isAllowToViewHistorical",{get:function(){return this.permission.visualizar},enumerable:!0,configurable:!0}),n.ctorParameters=function(){return[{type:a.TranslateService},{type:e.ChangeDetectorRef},{type:o.FormBuilder},{type:I.MessageService}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],n.prototype,"customFields",void 0),N([e.ViewChild(Qo,{static:!1})],n.prototype,"formComponent",void 0),N([e.Input()],n.prototype,"formGroup",void 0),N([e.Input()],n.prototype,"fieldFormGroup",void 0),N([e.Input()],n.prototype,"_dateChange",void 0),N([e.Input()],n.prototype,"_displayDateChange",void 0),N([e.Input()],n.prototype,"recordByRow",void 0),N([e.Input()],n.prototype,"showDateChange",void 0),N([e.Input()],n.prototype,"msgTooltipAdd",void 0),N([e.Input()],n.prototype,"isEditMode",void 0),N([e.Input()],n.prototype,"isViewMode",void 0),N([e.Input()],n.prototype,"currency",void 0),N([e.Input()],n.prototype,"customEntity",void 0),N([e.Input()],n.prototype,"customService",void 0),N([e.Input()],n.prototype,"withSideBar",void 0),N([e.Input()],n.prototype,"paramsForm",void 0),N([e.Input()],n.prototype,"defaultCpfNumber",void 0),N([e.Input()],n.prototype,"permission",void 0),N([e.Input()],n.prototype,"listDataReciever",void 0),N([e.Input()],n.prototype,"showButtonEdit",void 0),N([e.Output()],n.prototype,"isViewModeActive",void 0),N([e.Output()],n.prototype,"isEditModeActive",void 0),N([e.Output()],n.prototype,"isDeleteModeActive",void 0),N([e.Input()],n.prototype,"dateChange",null),N([e.Input()],n.prototype,"displayDateChange",null),N([e.Input()],n.prototype,"addListData",null),N([e.Input()],n.prototype,"visible",null),n=N([e.Component({selector:"c-historical-pix-account",template:'<s-sidebar *ngIf="withSideBar" [visible]="visible" (visibleChange)="close()"\n header="{{\'hcm.payroll.historical_pix_account_title_form\'|translate}}">\n<pix-account [(visible)]="visible"\n [isEditAndViewValue]="pixAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListPixAccount]="listDataNoPage"\n [paramsForm]="paramsForm"\n (pixAccountItemToList)="addItemInList($event)"\n [defaultCpfNumber]="defaultCpfNumber"></pix-account>\n</s-sidebar>\n\n<div *ngIf="!withSideBar && !isViewMode">\n <pix-account [(visible)]="visible"\n [isEditAndViewValue]="pixAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListPixAccount]="listDataNoPage"\n [withSideBar]="false"\n [isViewMode]="isViewMode"\n [paramsForm]="paramsForm"\n [permitsEditBankAccountForm]="permitsEditBankAccount"\n (pixAccountItemToList)="addItemInList($event)"\n [defaultCpfNumber]="defaultCpfNumber"></pix-account>\n</div>\n\n<div class="ui-g-1" *ngIf="withSideBar && !isEditMode">\n <div class="form-group ">\n <s-button id="ta-addPayAnnuity"\n [disabled]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n (onClick)="add()"\n [pTooltip]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n tooltipPosition="top"\n label="{{\'hcm.payroll.historical_pix_account_add\'|translate}}"></s-button>\n </div>\n</div>\n<div class="ui-g-12">\n <p-table\n id="table-annuity"\n [value]="listData"\n [columns]="cols"\n (onLazyLoad)="onLazyLoad($event)"\n [lazy]="true"\n [scrollable]="true"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [sortMode]="\'multiple\'"\n *sLoadingState="loading"\n [rows]="recordByRow"\n dataKey="id">\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-s\'">\n <col *ngIf="!isViewMode" [ngClass]="\'col-action\'">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th\n [pSortableColumn]="\'pixKeyType\'"\n [pTooltip]="\'hcm.payroll.employees_addition_pix_key_type\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header" id="table-0">\n <span\n id="table-annuity-s-0">{{ \'hcm.payroll.employees_addition_pix_key_type\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.employees_addition_pix_key_type\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'pixKey\'"\n [pTooltip]="\'hcm.payroll.employees_addition_pix_key\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.employees_addition_pix_key\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.employees_addition_pix_key\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'percentage\'"\n [pTooltip]="\'hcm.payroll.historical_pix_account_label_percentage\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_pix_account_label_percentage\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_pix_account_label_percentage\' | translate"></p-sortIcon>\n </div>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th *ngIf="!isViewMode" id="col-actions"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n\n <tr [ngClass]="\'row\'+key" [pSelectableRow]="rowData">\n <td [pTooltip]="rowData?.pixKeyType.value" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]="rowData?.pixKeyType.key">\n <td *ngSwitchCase="\'TELEPHONE\'"\n [pTooltip]="getFormattedTelephoneNumber(rowData?.pixKey)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase="\'CPF\'"\n [pTooltip]="getFormattedCpf(rowData?.pixKey)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase="\'CNPJ\'"\n [pTooltip]="getFormattedCnpj(rowData?.pixKey)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]="rowData?.pixKey" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]="getFormattedPercentage(rowData?.percentage)" tooltipPosition="top"\n showDelay="500">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id="col-actions-{{key}}" class="col-actions "\n *ngIf="actions && actions(rowData, key)?.length && !isViewMode">\n <s-button id="table-admission-btn-actions-{{key}}"\n *ngIf="actions(rowData, key).length > 1" [label]="actionLabel"\n priority="default" [model]="scopedActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="table-admission-btn-action-{{key}}"\n *ngIf="actions(rowData, key).length <= 1"\n [label]="scopedActions(rowData, key)[0].label"\n priority="default"\n (click)="scopedActions(rowData, key)[0].command()"\n [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td [attr.colspan]="columns.length +2">\n {{\'hcm.payroll.admission_empty_message\'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span *ngIf="totalRecords">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]})],n)}(),Xo=function(){function o(t){this.http=t}return o.prototype.query=function(e,o,n){return void 0===n&&(n=t.ServiceType.PAYROLL),this.http.query(e,o,n)},o.ctorParameters=function(){return[{type:Nt}]},o=N([e.Injectable()],o)}(),Zo=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,h.SidebarModule,bt,h.ControlErrorsModule,Ee,M.CurrencyMaskModule,ve,d.InputTextModule,_t,L.FieldsetModule,h.CustomFieldsModule,O.PanelModule,u.InputMaskModule],declarations:[Jo,Qo],providers:[Xo,I.ConfirmationService],exports:[Jo]})],t)}(),tn=function(){function o(t,e){this.http=t,this.httpClient=e}return o.prototype.remove=function(e,o,n,i){return void 0===n&&(n=t.ServiceType.PAYROLL),n===t.ServiceType.DEPENDENT?this.httpClient.post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete",{dependentId:i,dateWhen:o}):this.http.post("actions/historicalEmployeePixDelete",{employeeId:e,dateWhen:o})},o.ctorParameters=function(){return[{type:Nt},{type:v.HttpClient}]},o=N([e.Injectable()],o)}(),en=y,on=function(){function o(t,o,n,i,r,a,s){this.confirmationService=t,this.translateService=o,this.activatedRoute=n,this.cd=i,this.router=r,this.messageService=a,this.historicalPixAccountListService=s,this.endPoint="hcm/payroll/queries/historicalEmployeePixQuery",this.keyPayload="historicalEmployeePix",this.withSidebar=!0,this.isOnlyView=new e.EventEmitter,this.isOnlyEdit=new e.EventEmitter,this.enableView=new e.EventEmitter,this.enableEdit=new e.EventEmitter,this.ngUnsubscribe=new f.Subject,this.loading=!0,this.columns=[{label:this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),field:"dateChange"},{label:this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),field:"numberOfPixAccount"}]}return o.prototype.ngOnInit=function(){this.initParameters={employeeId:this.employeeId,dependentId:this.dependentId}},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},o.prototype.onLazyLoad=function(t){var e=this;t.forEach((function(t){t.dateChange=en(t.dateChange).format(e.dateFormat)})),this.onGridLoad(t),this.loading=!1},o.prototype.getMenuActions=function(t){var e=this;return[{label:this.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){if(e.isAllowToViewHistorical){var o=t&&t.dateChange&&en(t.dateChange,e.dateFormat).format("YYYY-MM-DD");e.withSidebar?(e.isOnlyView.emit(!0),e.router.navigate(["historical-pix-account/"+o],{relativeTo:e.activatedRoute})):e.enableView.emit(o)}else e.isNotAllowMessage()}},{label:this.translateService.instant("hcm.payroll.edit"),command:function(){if(e.isAllowToEditHistorical){var o=t&&t.dateChange&&en(t.dateChange,e.dateFormat).format("YYYY-MM-DD");e.withSidebar?(e.isOnlyView.emit(!1),e.isOnlyEdit.emit(!0),e.router.navigate(["historical-pix-account/"+o],{relativeTo:e.activatedRoute})):e.enableEdit.emit(o)}else e.isNotAllowMessage()}},{label:this.translateService.instant("hcm.payroll.delete"),command:function(){e.isAllowToDeleteHistorical&&t?e.delete(t.id,t.dateChange):e.isNotAllowMessage()}}]},o.prototype.delete=function(e,o){var n=this;if(e===this.lastRecord.id){var i=en(o,this.dateFormat).format("YYYY-MM-DD");this.confirmationService.confirm({message:this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete")+"?",accept:function(){n.loading=!0;var e=n.withSidebar?t.ServiceType.PAYROLL:t.ServiceType.DEPENDENT;n.historicalPixAccountListService.remove(n.employeeId,i,e,n.dependentId).pipe(s.takeUntil(n.ngUnsubscribe)).subscribe((function(){n.messageService.add({severity:"success",summary:n.translateService.instant("hcm.payroll.success"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove")}),n.parameters=n.parameters&&R({},n.parameters)||{}}),(function(){n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove")}),n.loading=!1}))}})}else this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.not_allowed_delete_last")})},o.prototype.add=function(){this.isAllowToAddHistorical?this.router.navigate(["historical-pix-account-new"],{relativeTo:this.activatedRoute}):this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},o.prototype.isNotAllowMessage=function(){this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},o.prototype.onGridLoad=function(t){t&&t.length&&(this.lastRecord=t[0])},Object.defineProperty(o.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToViewHistorical",{get:function(){return this.permission.visualizar},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAllowToEditHistorical",{get:function(){return this.permission.editar},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"scopedActions",{get:function(){return this.getMenuActions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"reloadList",{set:function(t){t&&(this.loading=!0,this.parameters=this.parameters&&R({},this.parameters)||{})},enumerable:!0,configurable:!0}),o.ctorParameters=function(){return[{type:I.ConfirmationService},{type:a.TranslateService},{type:r.ActivatedRoute},{type:e.ChangeDetectorRef},{type:r.Router},{type:I.MessageService},{type:tn}]},N([e.ViewChild(h.CustomFieldsComponent,{static:!1})],o.prototype,"customFields",void 0),N([e.Input()],o.prototype,"permission",void 0),N([e.Input()],o.prototype,"employeeId",void 0),N([e.Input()],o.prototype,"dependentId",void 0),N([e.Input()],o.prototype,"dateFormat",void 0),N([e.Input()],o.prototype,"endPoint",void 0),N([e.Input()],o.prototype,"keyPayload",void 0),N([e.Input()],o.prototype,"withSidebar",void 0),N([e.Output()],o.prototype,"isOnlyView",void 0),N([e.Output()],o.prototype,"isOnlyEdit",void 0),N([e.Output()],o.prototype,"enableView",void 0),N([e.Output()],o.prototype,"enableEdit",void 0),N([e.Input()],o.prototype,"reloadList",null),o=N([e.Component({selector:"c-historical-pix-account-list",template:'<div class="ui-g">\n <div class="ui-g-12">\n <c-data-list-rest\n id="ta-historical-pix-account-list"\n [columns]="columns"\n actionLabel="{{ \'hcm.payroll.movimentation_generic_action\' | translate }}"\n emptyMessage="{{ \'hcm.payroll.admission_empty_message\' | translate }}"\n [endpoint]="endPoint"\n singularMessageRecords="{{\n \'hcm.payroll.admission_register\' | translate\n }}"\n [actions]="scopedActions"\n pluralMessageRecords="{{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [keyPayload]="keyPayload"\n [lazy]="true"\n (lazyLoad)="onLazyLoad($event)"\n [(loading)]="loading"\n [initParameters]="initParameters"\n [parameters]="parameters"\n [isSortable]="false"\n ></c-data-list-rest>\n </div>\n</div>\n\n',styles:[""]})],o)}(),nn=function(){function t(){}return t=N([e.NgModule({imports:[p.CommonModule,o.FormsModule,v.HttpClientModule,E.AutoCompleteModule,ut,o.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,Ct,B.ConfirmDialogModule],declarations:[on],providers:[tn],exports:[on]})],t)}();t.AdmissionDraftSummaryComponent=Pt,t.AdmissionDraftSummaryModule=xt,t.AdmissionDraftSummaryService=At,t.AutocompleteParametersService=to,t.BlockUiComponent=lt,t.BlockUiModule=pt,t.BreadcrumbComponent=ct,t.BreadcrumbSDSModule=dt,t.CNPJValidator=it,t.CPFValidator=ot,t.CompanyIndicationsService=$e,t.ControlMessagesErrorComponent=mt,t.ControlMessagesErrorModule=ht,t.CoreDirectives=_t,t.CustomFieldsComponent=yt,t.CustomFieldsModule=vt,t.DataListModule=go,t.DataListRestModule=Ct,t.DateValidator=Uo,t.EmployeeSelectorComponent=Go,t.EmployeeSelectorModule=Ho,t.EmployeeSummaryComponent=Et,t.EmployeeSummaryModule=Ft,t.EmployeeSummaryService=Dt,t.EntityODataParameter=No,t.ErrorPageComponent=Mt,t.ErrorPageModule=Lt,t.FieldValidatorComponent=Ot,t.FieldValidatorModule=Bt,t.FileUploadComponent=jt,t.FileUploadCoreModule=qt,t.FormComparatorService=po,t.FromToComponent=Ko,t.FromToModule=Wo,t.HistoricalBankAccountComponent=Ao,t.HistoricalBankAccountListComponent=Bo,t.HistoricalBankAccountListModule=Ro,t.HistoricalBankAccountListService=Lo,t.HistoricalBankAccountModule=Mo,t.HistoricalBankAccountService=xo,t.HistoricalPixAccountComponent=Jo,t.HistoricalPixAccountListComponent=on,t.HistoricalPixAccountListModule=nn,t.HistoricalPixAccountListService=tn,t.HistoricalPixAccountModule=Zo,t.HistoricalPixAccountService=Xo,t.HttpClientService=Nt,t.ImageCropComponent=Yt,t.ImageCropModule=Gt,t.ImageCropService=Ut,t.InputDateComponent=gt,t.InputDateModelComponent=Kt,t.InputDateModelModule=Wt,t.InputDateModule=bt,t.InputRestAutoCompleteComponent=be,t.InputRestAutoCompleteEmployeeModelModule=Ce,t.InputRestAutoCompleteEmployeeModelService=ke,t.InputRestAutoCompleteEmployeeModule=_e,t.InputRestAutoCompleteEmployeeService=Ie,t.InputRestAutoCompleteEnumComponent=Te,t.InputRestAutoCompleteEnumModule=Ee,t.InputRestAutoCompleteEnumService=De,t.InputRestAutoCompleteJobpositionComponent=Be,t.InputRestAutoCompleteJobpositionModule=Re,t.InputRestAutoCompleteJobpositionService=Oe,t.InputRestAutoCompleteModelEnumModule=Le,t.InputRestAutoCompleteModelEnumService=xe,t.InputRestAutoCompleteModelModule=Pe,t.InputRestAutoCompleteModelService=Fe,t.InputRestAutoCompleteModule=ve,t.InputRestAutoCompleteService=ge,t.IntegrationService=Qe,t.ListRestComponent=Ve,t.ListRestModule=je,t.LookupModule=So,t.LookupParametersService=Xe,t.NameNotSpacesDirective=It,t.OnlyNumberDirective=St,t.PermissionService=uo,t.ReportService=so,t.ServicesModule=co,t.SpinnerLoaderComponent=qe,t.SpinnerLoaderModule=Ue,t.StringMethods=at,t.ToastComponent=mo,t.ToastModule=ho,t.ToastService=Rt,t.TypeAdmissionModule=Ge,t.TypeAdmissionServices=Ye,t.WorkflowDataService=lo,t.WorkflowIntegrator=Yo,t.WorkstationgroupLookupDto=Do,t.WorkstationgroupLookupModule=Fo,t._moment=re,t.assign=function t(e){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];if(!o.length)return e;var i=o.shift();if($t(e)&&$t(i)){var r=function(o){var n,r,a,s;$t(i[o])?(e[o]||Object.assign(e,((n={})[o]={},n)),t(e[o],i[o])):Qt(i[o])?Object.assign(e,((r={})[o]=i[o],r)):(e[o]||Object.assign(e,((a={})[o]=[],a)),Object.assign(e,((s={})[o]=i[o].map((function(n,i){return t(e[o][i]||{},n)})),s)))};for(var a in i)r(a)}return t.apply(void 0,Y([e],o))},t.autoCompleteObjectForIdObject=function(t){return $t(t)?(t.hasOwnProperty("tableId")&&console.error("Paramentro não é um objeto Auto Complete válido, falta tableId"),Jt(t.tableId)||console.error("tableId esta vazio"),{id:t.tableId}):(console.error("Paramentro não é um objeto"),!1)},t.clearValues=he,t.cnpjValidator=rt,t.compareValues=me,t.configEnabledFields=ce,t.containsMoreThanOneConsecutiveAbbreviation=function(t){return!/(\b.\s)(.\s)(.\b)\1?/g.test(t)},t.containsMoreThanOneConsecutiveBlankSpace=function(t){return!/(\w[ ]{2,}\w)/.test(t)},t.containsMoreThanTwoRepeatedCharacters=function(t){return!/([a-zA-Z])\1{2}/g.test(t)},t.containsSpecialCharacters=function(t){return!/[[\]!@#$%&*_+=`´{}^~<>.,:;?|()\/\\-]/.test(t)},t.convertBooleanString=function(t){return"boolean"==typeof t?!0===t?"true":"false":t},t.convertStringToBoolean=function(t){return!0===t||"true"===t.toLowerCase()},t.cpfValidator=nt,t.firstNameIsValid=function(t){var e=t.split(" ");return e.length>=2&&e[1].length>=1},t.firstNameLengthIsValid=function(t){var e=t.split(" ");return!(e[0].trim().length>0)||e[0].trim().length>=2},t.formatMoney=function(t,e){switch(void 0===e&&(e="EN"),e){case"EN":return Jt(t)?t.toString().replace(".","").replace(",","."):"";case"BR":return Jt(t)?t.toString().replace(".",",").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1."):"";default:return Jt(t)?t.toString().replace(".","").replace(",","."):""}},t.fullNameLengthIsValid=function(t){return t.length<=70},t.getAddWeekDaysBusiness=function(t,e){return T.addWeekDays(ie(t),e).format("DD/MM/YYYY")},t.getFormat=ye,t.getFormatDate=oe,t.getMoment=ie,t.getNowDate=ne,t.getObjValids=function(t){var e=Object.assign({},t),o={};return Object.keys(e).map((function(t){Jt(e[t])&&(o[t]=te(t,e[t]))})),o},t.getQueryParams=function(t){t=t.split("+").join(" ");for(var e,o={},n=/[?&]?([^=]+)=([^&]*)/g;e=n.exec(t);)o[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return o},t.getWeekDaysBusiness=function(t,e){var o=e?ie(e):ie(t).endOf("month");return T.weekDays(ie(t),o)},t.getYears=function(t){return zt().diff(t,"years",!1)},t.invertFieldDate=ee,t.isBirthDayValid=function(t,e){if(t&&e)return e.isSameOrAfter(t)},t.isDateCompare=function(t,e,o){return!(t&&t.isValid()&&e&&o)||t[o](e)},t.isDateExpirationBeforeExpeditionDate=function(t,e){if(t&&e)return e.isSameOrAfter(t)},t.isDateField=te,t.isDateSameOrAfterCurrentDate=function(t){if(t){var e=He();return t.isSameOrAfter(e)}},t.isFullDate=Zt,t.isMax=function(t,e){return t.length<=e},t.isNumber=Ke,t.isObject=$t,t.isRequired=function(t){return null!=t&&t.length>0},t.isShallow=Qt,t.isValid=Jt,t.isValidDate=Xt,t.isValidPIS=function(t){var e=0,o=0,n=t.replace(/[^\d]+/g,"");if(11!==n.length||"00000000000"===n||"11111111111"===n||"22222222222"===n||"33333333333"===n||"44444444444"===n||"55555555555"===n||"66666666666"===n||"77777777777"===n||"88888888888"===n||"99999999999"===n)return!1;for(var i=0;i<10;i++)e+=parseInt(n.substring(i,i+1))*parseInt("3298765432".substring(i,i+1));return(o=10===(o=11-e%11)||11===o?0:o)===parseInt(""+n.charAt(10))},t.mountCustomForSave=function(t,e,o){void 0===e&&(e=null),void 0===o&&(o=null);var n=[];return e&&t.length&&e.map((function(e,i){var r=Object.keys(t[i]).toString(),a=Jt(t[i][r])?t[i][r]:null,s="date"===e.type&&o&&Jt(a)?zt(a,ye(o)).format("YYYY-MM-DD"):a;n.push({field:r,value:s})})),n.length?n:null},t.mountCustomForShow=function(t){var e=[];return Object.keys(t||{}).forEach((function(o){"date"===t[o].type&&t[o].value&&(t[o].value=re(t[o].value).format("L")),e.push(t[o])})),e},t.mountCustomToSave=ae,t.mountCustomToShow=se,t.mountGeneratedCustomToSave=function(t){return Object.entries(t).forEach((function(e){var o=U(e,2),n=o[0];o[1]||delete t[n]})),t},t.ngCalendarFormat=function(t,e){if(void 0===e&&(e="DD/MM/YYYY"),Xt(t))return"string"==typeof t?t:re(t).format(e)},t.notEmpty=We,t.numberOrZero=ze,t.removeCharacteresSpecials=fe,t.removeEmpty=function t(e){return Object.keys(e).forEach((function(o){return e[o]&&"object"==typeof e[o]&&t(e[o])||!e[o]&&void 0!==e[o]&&delete e[o]})),e},t.removeWhiteSpaces=function(t){return t&&String(t)?String(t).replace(/\s/g,""):String(t)},t.setCustonFields=function(t){var e=this;return t.map((function(t){var n={},i=t.value||null;"boolean"==typeof i&&(i=i?"true":"false"),n[t.field]=new o.FormControl(i),e.push(new o.FormGroup(n))})),t},t.setDisableField=de,t.setErrors=function(t,e,o){var n=this;setTimeout((function(){var i;o?((i=Object.assign({},n.get(t).errors))[e]=o,n.get(t).setErrors(i)):(i=n.get(t).errors)&&Object.keys(i).length&&(delete i[e],Object.keys(i).length||n.get(t).setErrors(null))}),0)},t.setRequired=pe,t.setRequiredFields=function(t,e,n){e?n.forEach((function(e){return pe(t,e,!0,[o.Validators.required])})):n.forEach((function(e){return pe(t,e,!1)}))},t.setValidator=ue,t.setValidatorsAndDisableFields=function(t,e){e.forEach((function(e){ue(t,e.field,e.validators),de(t,e.disabled,e.field,e.clearValue)}))},t.setValueCustom=function(t,e){var o=e?Object.keys(e).length:0;return t.map((function(t){t.value=o>0?e[t.field]:null})),t},t.stringMethods=st,t.sun=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return ze(e)+t}),0)},t.uiid=function(){return(new D).guid().replace(/[^a-zA-Z0-9.]/g,"").toUpperCase()},t.validateBirthDate=function(t,e){if(t&&e){var o=He("string"==typeof t?t.replace(/[^\d]+/g,""):t,"DDMMYYYY").format("YYYY-MM-DD").toString(),n=He(e.replace(/[^\d]+/g,""),"DDMMYYYY").format("YYYY-MM-DD").toString();return He(n).isSameOrAfter(o)}},t.verifyValidationsForm=le,t.ɵa=ut,t.ɵb=wt,t.ɵc=kt,t.ɵd=Vt,t.ɵe=Se,t.ɵf=we,t.ɵg=Ae,t.ɵh=Me,t.ɵi=Ne,t.ɵj=fo,t.ɵk=yo,t.ɵl=Io,t.ɵm=bo,t.ɵn=Eo,t.ɵo=ko,t.ɵp=Co,t.ɵq=Po,t.ɵr=Qo,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=senior-gestao-pessoas-payroll-core.umd.min.js.map