Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/account-enhancements/main.js

"use strict";(self.webpackChunkaccount_enhancements=self.webpackChunkaccount_enhancements||[]).push([[792],{3813:(u,O,l)=>{var C=l(345),t=l(3953),s=l(177),_=l(7901),h=l(6381),S=l(980),y=l(6697),p=function(e){return e.name="name",e.limit="limit",e.id="id",e}(p||{}),P=l(7609),v=l(6802),T=l(6354),b=function(e){return e.module="AccountEnhancements",e.list="list_account_enhancements",e}(b||{}),R=l(4355);let M=(()=>{class e{constructor(n){this._whmApiClient=n}listAccountEnhancements(n){const o=new P.m(P.R.JsonApi,{method:b.list,arguments:[new v.e("module",b.module)],...n});return this._whmApiClient.get(o).pipe((0,T.T)(a=>{if(a.success)return a;throw a.errors}))}static#t=this.\u0275fac=function(o){return new(o||e)(t.KVO(R.gB))};static#n=this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var w=l(8391),g=l(6153);let d=(()=>{class e{constructor(){this.pagination={pageSize:20,selectedPage:1,disabled:!1,totalRecords:0,recordsBeforeFilter:0},this.sorts=[],this._loading=!1}get loading(){return this._loading}set loading(n){this._loading=n}updateSelectedPage(n){this.pagination.selectedPage=n}updatePageSize(n){this.pagination.pageSize=n}updateSearchFilter(n,o){this.filters=[new w.d(n,w.t.Contains,o)],this.pagination.selectedPage=1}changeSort(n){const o=this.sorts?.find(a=>a.column===n);o&&(o.direction=this._changeSortDirection(o.direction)),this.sorts=[new g.FU(n,o?.direction||g.UE.Ascending)]}getTableMetadata(){return{pager:{page:this.pagination.selectedPage,pageSize:this.pagination.pageSize},filters:this.filters,sorts:this.sorts}}getSortColumn(){return this.sorts[0]?.column}sortedInAscendingOrder(){return this.sorts[0]?.direction===g.UE.Ascending}_changeSortDirection(n){return n===g.UE.Ascending?g.UE.Descending:g.UE.Ascending}static#t=this.\u0275fac=function(o){return new(o||e)};static#n=this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var r=l(9490),x=l(7376);const F=e=>({width:e});function z(e,c){if(1&e&&t.nrm(0,"i",11),2&e){const n=t.XpG(2).$implicit,o=t.XpG();t.AVh("icon-arrow-up",o.tableService.sortedInAscendingOrder())("icon-arrow-down",!o.tableService.sortedInAscendingOrder()),t.BMQ("title",n.label)}}function I(e,c){if(1&e){const n=t.RV6();t.j41(0,"button",8),t.bIt("click",function(){t.eBV(n);const a=t.XpG().$implicit,i=t.XpG();return t.Njj(i.sort.emit(a.key))}),t.j41(1,"span",9),t.EFF(2),t.k0s(),t.DNE(3,z,1,5,"i",10),t.k0s()}if(2&e){const n=t.XpG(),o=n.$implicit,a=n.index,i=t.XpG();t.FCK("id","column-button__",a,"-",o.key,""),t.R7$(2),t.JRh(o.label),t.R7$(),t.Y8G("ngIf",o.key===i.tableService.getSortColumn())}}function G(e,c){if(1&e&&(t.j41(0,"span",9),t.EFF(1),t.k0s()),2&e){const n=t.XpG().$implicit;t.R7$(),t.JRh(n.label)}}function j(e,c){if(1&e&&(t.j41(0,"th",5),t.DNE(1,I,4,5,"button",6)(2,G,2,1,"span",7),t.k0s()),2&e){const n=c.$implicit,o=t.XpG();t.Y8G("ngStyle",t.eq3(3,F,100/o.columns.length+"%")),t.R7$(),t.Y8G("ngIf",n.sortable),t.R7$(),t.Y8G("ngIf",!n.sortable)}}function $(e,c){if(1&e&&(t.j41(0,"tr",12)(1,"td"),t.nrm(2,"span",13),t.EFF(3," \xa0 "),t.j41(4,"span",14),t.EFF(5),t.k0s()()()),2&e){const n=t.XpG();t.R7$(),t.BMQ("colspan",n.emptyRowColSpan),t.R7$(4),t.JRh(n.locale.maketext("Loading \u2026"))}}function B(e,c){if(1&e&&(t.j41(0,"tr",15)(1,"td"),t.EFF(2),t.k0s()()),2&e){const n=t.XpG();t.R7$(),t.BMQ("colspan",n.emptyRowColSpan),t.R7$(),t.JRh(n.noResultsReason)}}function X(e,c){if(1&e&&(t.j41(0,"td",18),t.EFF(1),t.k0s()),2&e){const n=c.$implicit,o=t.XpG(2),a=o.$implicit,i=o.index,f=t.XpG();t.BMQ("data-test",f.getId(i,a,n.key)),t.R7$(),t.SpI(" ",a[n.key]||"-"," ")}}function D(e,c){if(1&e&&(t.j41(0,"tr"),t.DNE(1,X,2,2,"td",17),t.k0s()),2&e){const n=t.XpG(),o=n.$implicit,a=n.index,i=t.XpG();t.BMQ("data-test",i.getId(a,o,"row")),t.R7$(),t.Y8G("ngForOf",i.columns)("ngForTrackBy",i.trackByFn)}}function E(e,c){if(1&e&&(t.qex(0),t.DNE(1,D,2,3,"tr",16),t.bVm()),2&e){const n=c.$implicit,o=t.XpG();t.R7$(),t.Y8G("ngIf",o.columnKeyExists(n))}}let V=(()=>{class e{constructor(n,o){this.tableService=n,this.locale=o,this.sort=new t.bkB,this.defaultConfig={stackable:!0,striped:!0},this.sortDirection=g.UE,this.config=this.defaultConfig}get noResultsReason(){const n=this.tableService.loading,o=this.rows?.length,a=this.tableService.pagination?.recordsBeforeFilter;return n||o||a?n||o||!a?null:this.noQueryResultMessage||this.locale.maketext("No results match your query."):this.noResultsMessage||this.locale.maketext("No results available.")}ngOnInit(){this.emptyRowColSpan=this.columns?.length+1}columnKeyExists(n){return this.columns.some(o=>Object.keys(n).includes(o.key))}trackByFn(n){return n}getId(n,o,a){const i=`${a}-${n}`;return this.rowKeyData?`${i}_${encodeURI(o[this.rowKeyData])}`:i}static#t=this.\u0275fac=function(o){return new(o||e)(t.rXU(d),t.rXU(h.h))};static#n=this.\u0275cmp=t.VBU({type:e,selectors:[["cp-table"]],inputs:{columns:"columns",rows:"rows",rowKeyData:"rowKeyData",noResultsMessage:"noResultsMessage",noQueryResultMessage:"noQueryResultMessage",config:"config"},outputs:{sort:"sort"},decls:8,vars:10,consts:[[1,"ui","table"],[3,"ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],["class","info empty-row","id","loadingRow",4,"ngIf"],["class","info empty-row","id","emptySearchRow",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle"],["class","column-button btn btn-link p-0",3,"id","click",4,"ngIf"],["class","column-label separator",4,"ngIf"],[1,"column-button","btn","btn-link","p-0",3,"click","id"],[1,"column-label","separator"],["ngClass","column-icon",3,"icon-arrow-up","icon-arrow-down",4,"ngIf"],["ngClass","column-icon"],["id","loadingRow",1,"info","empty-row"],[1,"fas","fa-spinner","fa-spin"],[1,"loading-text"],["id","emptySearchRow",1,"info","empty-row"],[4,"ngIf"],["class","td",4,"ngFor","ngForOf","ngForTrackBy"],[1,"td"]],template:function(o,a){1&o&&(t.j41(0,"table",0)(1,"thead")(2,"tr"),t.DNE(3,j,3,5,"th",1),t.k0s()(),t.j41(4,"tbody"),t.DNE(5,$,6,2,"tr",2)(6,B,3,2,"tr",3)(7,E,2,1,"ng-container",4),t.k0s()()),2&o&&(t.AVh("table-striped",a.config.striped)("unstackable",!a.config.stackable),t.R7$(3),t.Y8G("ngForOf",a.columns)("ngForTrackBy",a.trackByFn),t.R7$(2),t.Y8G("ngIf",a.tableService.loading),t.R7$(),t.Y8G("ngIf",a.noResultsReason),t.R7$(),t.Y8G("ngForOf",a.rows)("ngForTrackBy",a.trackByFn))},dependencies:[s.YU,s.Sq,s.bT,s.B3],styles:[".table[_ngcontent-%COMP%]{table-layout:fixed;border-collapse:separate}.column-button[_ngcontent-%COMP%]{position:relative;padding:0}.column-button[_ngcontent-%COMP%]:hover > span[_ngcontent-%COMP%]{text-decoration:underline}.column-button[_ngcontent-%COMP%]:focus{outline:none}.column-label[_ngcontent-%COMP%]{display:inline-block}html[dir=ltr][_ngcontent-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .column-label[_ngcontent-%COMP%]{margin-right:10px}html[dir=rtl][_ngcontent-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .column-label[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .column-label[_ngcontent-%COMP%]{margin-left:10px}.column-icon[_ngcontent-%COMP%]{position:absolute;top:10px}thead[_ngcontent-%COMP%]{position:sticky;top:0;background:#fff}thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{padding:0 8px;background:#fff;background-clip:content-box}@media only screen and (max-width: 767px){.ui.table[_ngcontent-%COMP%]:not(.unstackable)   thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:1px solid #323232;border-bottom:2px solid #323232;padding:0}.ui.table[_ngcontent-%COMP%]:not(.unstackable){width:100%;border-radius:.25rem}.ui.table[_ngcontent-%COMP%]:not(.unstackable)   tbody[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:auto!important;display:block!important}.ui.table[_ngcontent-%COMP%]:not(.unstackable){padding:0}.ui.table[_ngcontent-%COMP%]:not(.unstackable)   thead[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tfoot[_ngcontent-%COMP%]{display:block}.ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row){padding-top:1em;padding-bottom:1em;box-shadow:0 -1px #0000001a inset!important}.ui.table-striped.table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:nth-child(2n), .ui.table-striped.table[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#f9f9f9}.ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{border:none!important;padding-top:0;padding-bottom:0;box-shadow:none!important}html[dir=ltr][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=ltr][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:0 0}html[dir=rtl][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=rtl][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .ui.table[_ngcontent-%COMP%]:not(.unstackable)   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:100% 0}.ui.definition.table[_ngcontent-%COMP%]:not(.unstackable)   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:first-child{box-shadow:none!important}}"]})}return e})();var m=l(3151);function U(e,c){if(1&e){const n=t.RV6();t.j41(0,"ul",5)(1,"li",6)(2,"div")(3,"cp-page-size-selector",7),t.bIt("optionSelected",function(a){t.eBV(n);const i=t.XpG();return t.Njj(i.pageSizeChanged.emit(a))}),t.k0s()()(),t.nrm(4,"li",8),t.j41(5,"li",6)(6,"a",9),t.bIt("click",function(){t.eBV(n);const a=t.XpG();return t.Njj(a.refreshClicked.emit())}),t.nrm(7,"i",10),t.EFF(8),t.k0s()()()}if(2&e){const n=t.XpG();t.R7$(3),t.Y8G("pageSizeOptions",n.pageSizes)("selectedPageSize",null==n.tableService?null:n.tableService.pagination.pageSize),t.R7$(5),t.SpI(" ",n.locale.maketext("Refresh")," ")}}let Y=(()=>{class e{constructor(n,o){this.tableService=n,this.locale=o,this.pageSizes=[20,50,100],this.pageSizeChanged=new t.bkB,this.refreshClicked=new t.bkB}static#t=this.\u0275fac=function(o){return new(o||e)(t.rXU(d),t.rXU(h.h))};static#n=this.\u0275cmp=t.VBU({type:e,selectors:[["cp-page-size-selector-dropdown"]],inputs:{pageSizes:"pageSizes"},outputs:{pageSizeChanged:"pageSizeChanged",refreshClicked:"refreshClicked"},decls:5,vars:1,consts:[["dropdown","","auto-close","outsideClick",1,"btn-group"],["id","table-settings-dropdown","type","button","dropdownToggle","",1,"btn","btn-default","btn-sm","dropdown-toggle","button-bar"],[1,"fas","fa-cog"],[1,"caret"],["id","table-settings-menu","class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","table-settings-dropdown",4,"dropdownMenu"],["id","table-settings-menu","role","menu","aria-labelledby","table-settings-dropdown",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem"],["id","page-size-selector",3,"optionSelected","pageSizeOptions","selectedPageSize"],[1,"divider"],["id","page-size-selector__refresh",3,"click"],[1,"fas","fa-sync-alt"]],template:function(o,a){1&o&&(t.j41(0,"div",0)(1,"button",1),t.nrm(2,"i",2)(3,"span",3),t.k0s(),t.DNE(4,U,9,3,"ul",4),t.k0s()),2&o&&(t.R7$(),t.BMQ("aria-label",a.locale.maketext("Table Settings")))},dependencies:[m.hs,m.UL,m.Kk,r.br]})}return e})();const N=()=>["/create"];function A(e,c){if(1&e){const n=t.RV6();t.j41(0,"div",8)(1,"cp-search",9),t.bIt("valueChange",function(a){t.eBV(n);const i=t.XpG(2);return t.Njj(i.filterRows(a))}),t.k0s()()}if(2&e){const n=t.XpG(2);t.R7$(),t.Y8G("autofocus",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.autofocus)("debounce",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.debounce)("disabled",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.disabled)("id",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.id)("label",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.label)("list",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.list)("placeholder",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.placeholder)}}function K(e,c){if(1&e){const n=t.RV6();t.j41(0,"div",10)(1,"cp-pagination",11),t.bIt("pageChanged",function(a){t.eBV(n);const i=t.XpG(2);return t.Njj(i.pageChange(a))}),t.k0s()()}if(2&e){const n=t.XpG(2);t.R7$(),t.Y8G("disabled",n.tableService.pagination.disabled)("maxPagesVisible",n.tableService.pagination.maxPagesVisible||3)("pageSize",n.tableService.pagination.pageSize)("selectedPage",n.tableService.pagination.selectedPage)("totalItems",n.tableService.pagination.totalRecords)}}function L(e,c){if(1&e&&(t.j41(0,"div",5),t.DNE(1,A,2,7,"div",6)(2,K,2,5,"div",7),t.k0s()),2&e){const n=t.XpG();t.R7$(),t.Y8G("ngIf",!(null!=n.config&&null!=n.config.search&&n.config.search.hide)),t.R7$(),t.Y8G("ngIf",!(null!=n.config&&null!=n.config.pagination&&n.config.pagination.hide))}}function Q(e,c){if(1&e&&(t.j41(0,"a",12),t.nrm(1,"i",13),t.EFF(2),t.k0s()),2&e){const n=t.XpG();t.Y8G("routerLink",t.lJ4(3,N)),t.BMQ("disabled",!(null!=n.config&&null!=n.config.create&&n.config.create.disabled)),t.R7$(2),t.SpI(" ",n.locale.maketext(null==n.config?null:n.config.create.label)," ")}}function J(e,c){if(1&e){const n=t.RV6();t.j41(0,"cp-page-size-selector-dropdown",14),t.bIt("pageSizeChanged",function(a){t.eBV(n);const i=t.XpG();return t.Njj(i.pageSizeChange(a))})("refreshClicked",function(){t.eBV(n);const a=t.XpG();return t.Njj(a.updateTable())}),t.k0s()}}let H=(()=>{class e{constructor(n,o){this.locale=n,this.tableService=o,this.update=new t.bkB,this.defaultConfig={create:{disabled:!1,hide:!1,label:"Create"},search:{async:!0,column:"*",hide:!1,params:{autofocus:!1,debounce:400,disabled:!1,id:"search",label:"Search",list:"",placeholder:""}}}}set rows(n){n&&(this.rowData=n,this._initialRows=n)}static _filterValuesOfObject(n,o){return n?.filter(a=>Object.values(a).some(i=>i.toString().toLowerCase().includes(o.toLowerCase())))}ngOnInit(){this.config=x.merge({},this.defaultConfig,this.config)}pageChange(n){n.page!==this.tableService.pagination.selectedPage&&(this.tableService.updateSelectedPage(n.page),this.updateTable())}pageSizeChange(n){this.tableService.updatePageSize(n),this.updateTable()}sortChange(n){this.tableService.changeSort(n),this.updateTable()}filterRows(n){this.config?.search?.async?this._asyncFilter(n):this._syncFilter(n)}updateTable(){this.rows=[],this.update.emit()}_asyncFilter(n){this.tableService.updateSearchFilter(this.config.search.column,n),this.updateTable()}_syncFilter(n){this.rowData=n?e._filterValuesOfObject(this._initialRows,n):[...this._initialRows]}static#t=this.\u0275fac=function(o){return new(o||e)(t.rXU(h.h),t.rXU(d))};static#n=this.\u0275cmp=t.VBU({type:e,selectors:[["cp-table-template"]],inputs:{columns:"columns",config:"config",rows:"rows"},outputs:{update:"update"},decls:5,vars:6,consts:[["class","search-pagination-wrapper",4,"ngIf"],[1,"pull-right","flip","create-page-size-selector-wrapper"],["id","create","class","btn btn-primary btn-sm create-button",3,"routerLink",4,"ngIf"],["id","page-size-selector-dropdown",3,"pageSizeChanged","refreshClicked",4,"ngIf"],[3,"sort","columns","rows","rowKeyData"],[1,"search-pagination-wrapper"],["class","search-container",4,"ngIf"],["class","pagination-container",4,"ngIf"],[1,"search-container"],[3,"valueChange","autofocus","debounce","disabled","id","label","list","placeholder"],[1,"pagination-container"],["id","pagination",3,"pageChanged","disabled","maxPagesVisible","pageSize","selectedPage","totalItems"],["id","create",1,"btn","btn-primary","btn-sm","create-button",3,"routerLink"],["aria-hidden","true",1,"fas","fa-plus"],["id","page-size-selector-dropdown",3,"pageSizeChanged","refreshClicked"]],template:function(o,a){1&o&&(t.DNE(0,L,3,2,"div",0),t.j41(1,"div",1),t.DNE(2,Q,3,4,"a",2)(3,J,1,0,"cp-page-size-selector-dropdown",3),t.k0s(),t.j41(4,"cp-table",4),t.bIt("sort",function(f){return a.sortChange(f)}),t.k0s()),2&o&&(t.Y8G("ngIf",!(null!=a.config&&null!=a.config.pagination&&a.config.pagination.hide&&null!=a.config&&null!=a.config.search&&a.config.search.hide)),t.R7$(2),t.Y8G("ngIf",!(null!=a.config&&null!=a.config.create&&a.config.create.hide)),t.R7$(),t.Y8G("ngIf",!(null!=a.config&&null!=a.config.pageSizeSelector&&a.config.pageSizeSelector.hide)),t.R7$(),t.Y8G("columns",a.columns)("rows",a.rowData)("rowKeyData",null==a.config?null:a.config.rowKeyData))},dependencies:[_.Wk,s.bT,r.eK,r.Sy,V,Y],styles:[".search-pagination-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.search-container[_ngcontent-%COMP%]{min-width:100px;max-width:350px;flex-basis:350px;margin-bottom:12px;flex-grow:1}.pagination-container[_ngcontent-%COMP%]{min-width:max-content}html[dir=ltr][_ngcontent-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%]{margin-left:auto}html[dir=rtl][_ngcontent-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .pagination-container[_ngcontent-%COMP%]{margin-right:auto}html[dir=ltr][_ngcontent-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .create-button[_ngcontent-%COMP%]{margin-right:.5rem}html[dir=rtl][_ngcontent-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .create-button[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .create-button[_ngcontent-%COMP%]{margin-left:.5rem}.create-page-size-selector-wrapper[_ngcontent-%COMP%]{margin-bottom:12px}  div#pagination>p{margin-top:0}"]})}return e})(),k=(()=>{class e{constructor(n,o,a,i){this.locale=n,this._apiService=o,this._tableService=a,this._alertService=i}ngOnInit(){this._setTableColumns(),this._tableService.changeSort(p.name),this._setTableRows(),this._setTableConfig()}updateRows(){this._setTableRows()}_setTableColumns(){this.columns=[{key:p.name,label:this.locale.maketext("Name"),sortable:!0},{key:p.id,label:this.locale.maketext("Item Identifier"),sortable:!0}]}_setTableRows(){this._tableService.loading=!0,this._apiService.listAccountEnhancements(this._tableService.getTableMetadata()).pipe((0,S.j)(()=>this._tableService.loading=!1)).pipe((0,y.s)(1)).subscribe(n=>{this._tableService.pagination.totalRecords=n?.meta?.totalRecords,this._tableService.pagination.recordsBeforeFilter=n?.meta?.recordsBeforeFilter,this.rows=n.data},n=>{this._alertService.error(n.message)})}_setTableConfig(){this.tableTemplateConfig={create:{hide:!0},search:{column:p.name},rowKeyData:"name"}}static#t=this.\u0275fac=function(o){return new(o||e)(t.rXU(h.h),t.rXU(M),t.rXU(d),t.rXU(r.uE))};static#n=this.\u0275cmp=t.VBU({type:e,selectors:[["cp-account-enhancements-list"]],decls:5,vars:4,consts:[["id","description",1,"description"],["id","list"],[3,"update","config","rows","columns"]],template:function(o,a){1&o&&(t.nrm(0,"cp-alert-list"),t.j41(1,"section",0),t.EFF(2),t.k0s(),t.j41(3,"section",1)(4,"cp-table-template",2),t.bIt("update",function(){return a.updateRows()}),t.k0s()()),2&o&&(t.R7$(2),t.SpI(" ",a.locale.maketext("You can use this interface to view and manage your server\u2018s account enhancements."),"\n"),t.R7$(2),t.Y8G("config",a.tableTemplateConfig)("rows",a.rows)("columns",a.columns))},dependencies:[r.Ab,H]})}return e})();const W=[{path:"list",component:k},{path:"",redirectTo:"list",pathMatch:"full"},{path:"**",component:k,pathMatch:"full"}];let Z=(()=>{class e{static#t=this.\u0275fac=function(o){return new(o||e)};static#n=this.\u0275mod=t.$C({type:e});static#e=this.\u0275inj=t.G2t({imports:[_.iI.forRoot(W),_.iI]})}return e})(),q=(()=>{class e{constructor(){this.title="account-enhancements"}static#t=this.\u0275fac=function(o){return new(o||e)};static#n=this.\u0275cmp=t.VBU({type:e,selectors:[["cp-account-enhancements-root"]],decls:1,vars:0,template:function(o,a){1&o&&t.nrm(0,"router-outlet")},dependencies:[_.n3]})}return e})();var tt=l(1562),nt=l(8658),et=l(728);let ot=(()=>{class e{static#t=this.\u0275fac=function(o){return new(o||e)};static#n=this.\u0275mod=t.$C({type:e,bootstrap:[q]});static#e=this.\u0275inj=t.G2t({providers:[{provide:s.kB,useValue:window.PAGE.base},M,d],imports:[r.pt,r.sb,nt.B,Z,et.wb,m.zE.forRoot(),s.MD,tt.q1,r.Qg,r.x6,r.tq]})}return e})();(0,t.SmG)(),C.sG().bootstrapModule(ot).catch(e=>console.error(e))}},u=>{u.O(0,[128,996,538],()=>u(u.s=3813)),u.O()}]);
Back to Directory File Manager