p3x-redis-ui-material
Version:
💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity
5 lines • 57.8 kB
JavaScript
import{a as F,d as L,i as E,r as C,u as K}from"./main-OCJB5534.js";import{Bi as ym,Cn as _T,Di as wf,Dn as _y,Dr as lo,Dt as Qe,F as HY,Fi as xi,Gn as dT,Ht as Tf,In as by,It as Sn,Kr as oT,Lt as Sy,M as Gn,P as HT,Pi as xf,Pn as bm,Pr as mc,Qn as fp,Qr as qC,Rn as co,T as Ee,V as I,Vn as cr,Wn as d0,Wr as o0,Zr as q,_ as Cf,ct as N,er as gT,gi as u0,gt as O,h as By,ii as rT,in as Wa,k as G0,lr as hy,lt as NA,mn as YQ,pn as YN,pt as Nf,rn as WC,t as $Y,ur as iT,vi as uc,vr as jy,vt as P,w as Eb,wi as vt$1,wr as lc,zn as cp}from"./chunk-CHqDEyfr.js";import{n as u,t as f}from"./chunk-DolM25Wu.js";import"./chunk-CPClUPec.js";import{n as x,t as Q}from"./chunk-CyniViPG.js";import{n as bi,t as _t$1}from"./chunk-DjVJBOYc.js";import{t as h}from"./chunk-CWEwaFv9.js";import{n as Le}from"./chunk-CyaMV1f5.js";import{a as je,t as It$1}from"./chunk-BM0xjj91.js";import{C as xn,i as Gn$1,y as on}from"./chunk-B_FU7ynV.js";import{a as se,n as ae,r as gt$1,t as Qt$1}from"./chunk-CNSP-oVC.js";import{n as wt$1,r as yt$1}from"./chunk-CGgWGJ3E.js";import"./chunk-CFyh5uM7.js";import{d as qe,i as Qt$2}from"./chunk-CLjqwtZV.js";import"./chunk-DxgAwx0L.js";import{n as S,t as U}from"./chunk-DDuYYYPc.js";import"./chunk-CaLi_qYn2.js";import"./chunk-C73tB7I62.js";import{a as qo,i as gr}from"./chunk-CARSOUZ02.js";import{i as Lt$1,n as G,r as I$1,t as Bt$1}from"./chunk-o3jniB9o2.js";import{t as h$1}from"./chunk-DzI3IEeY2.js";import{t as T}from"./chunk-CWVY7TNb.js";import{t as g}from"./chunk-xXjZMPjc.js";import{l as q$1}from"./chunk-CMQBeVtl.js";import{n as Nt$1,r as Pt$1,t as Lt$2}from"./chunk-BGkKuku6.js";import{n as b,t as P$1}from"./chunk-BTZfv3-Q.js";function ht(n,p){if(n&1){let e=dT();Wa(0,`h2`,2)(1,`a`,3),Sy(`click`,function(){ym(e);return bm(gT().goStatistics())}),HT(2),wf()()}if(n&2){let e=gT();Sn(2),Nf(` `,e.strings().intention?.main,` `)}}function ut(n,p){if(n&1&&(Wa(0,`mat-option`,11)(1,`mat-icon`,10),HT(2),wf(),HT(3),wf()),n&2){let e=p.$implicit,t=gT(3);by(`value`,e),Sn(2),jy(t.hasKeys(e)?`radio_button_checked`:`radio_button_unchecked`),Sn(),Nf(` `,e,` `)}}function _t(n,p){if(n&1){let e=dT();Wa(0,`div`,4)(1,`span`,7),HT(2,`DB:`),wf(),Wa(3,`mat-form-field`,8)(4,`mat-select`,9),Sy(`selectionChange`,function(i){ym(e);return bm(gT(2).selectDatabase(i.value))}),Wa(5,`mat-select-trigger`)(6,`mat-icon`,10),HT(7),wf(),HT(8),wf(),oT(9,ut,4,3,`mat-option`,11,rT),wf()()()}if(n&2){let e=gT(2);Sn(4),by(`value`,e.currentDatabase),xi(`aria-label`,e.strings().form?.main?.label?.database),Sn(3),jy(e.hasKeys(e.currentDatabase)?`radio_button_checked`:`radio_button_unchecked`),Sn(),Nf(` `,e.currentDatabase,` `),Sn(),iT(e.databaseIndexes)}}function xt(n,p){if(n&1){let e=dT();Wa(0,`button`,12),Sy(`click`,function(){ym(e);return bm(gT(3).save())}),Wa(1,`mat-icon`),HT(2,`save`),wf(),Wa(3,`span`),HT(4),wf()()}if(n&2){let e=gT(3);Sn(4),jy(e.strings().intention?.save)}}function bt(n,p){if(n&1){let e=dT();Wa(0,`button`,13),Sy(`click`,function(){ym(e);return bm(gT(3).save())}),Wa(1,`mat-icon`),HT(2,`save`),wf()()}if(n&2)by(`matTooltip`,gT(3).strings().intention?.save)}function ft(n,p){if(n&1&&co(0,xt,5,1,`button`,5)(1,bt,3,1,`button`,6),n&2)lo(gT(2).isWide?0:1)}function gt(n,p){if(n&1){let e=dT();Wa(0,`button`,12),Sy(`click`,function(){ym(e);return bm(gT(2).goStatistics())}),Wa(1,`mat-icon`),HT(2,`show_chart`),wf(),Wa(3,`span`),HT(4),wf()()}if(n&2){let e=gT(2);Sn(4),jy(e.strings().intention?.statistics)}}function vt(n,p){if(n&1){let e=dT();Wa(0,`button`,13),Sy(`click`,function(){ym(e);return bm(gT(2).goStatistics())}),Wa(1,`mat-icon`),HT(2,`show_chart`),wf()()}if(n&2)by(`matTooltip`,gT(2).strings().intention?.statistics)}function Ct(n,p){if(n&1){let e=dT();Wa(0,`button`,12),Sy(`click`,function(){ym(e);return bm(gT(2).refresh())}),Wa(1,`mat-icon`),HT(2,`refresh`),wf(),Wa(3,`span`),HT(4),wf()()}if(n&2){let e=gT(2);Sn(4),jy(e.strings().intention?.refresh)}}function yt(n,p){if(n&1){let e=dT();Wa(0,`button`,13),Sy(`click`,function(){ym(e);return bm(gT(2).refresh())}),Wa(1,`mat-icon`),HT(2,`refresh`),wf()()}if(n&2)by(`matTooltip`,gT(2).strings().intention?.refresh)}function Tt(n,p){if(n&1&&(co(0,_t,11,4,`div`,4),co(1,ft,2,1),co(2,gt,5,1,`button`,5)(3,vt,3,1,`button`,6),co(4,Ct,5,1,`button`,5)(5,yt,3,1,`button`,6)),n&2){let e=gT();lo(e.isCluster?-1:0),Sn(),lo(e.isReadonly?-1:1),Sn(),lo(e.isWide?2:3),Sn(2),lo(e.isWide?4:5)}}var rt=(()=>{class n{breakpointObserver;i18n;cmd;socket;cdr;state;strings;isXs=!1;isWide=!0;hasConnection=!1;isCluster=!1;isReadonly=!1;currentDatabase=0;databaseIndexes=[];keyspaceDatabases={};unsubs=[];constructor(e,t,i,r,c,_){this.breakpointObserver=e,this.i18n=t,this.cmd=i,this.socket=r,this.cdr=c,this.state=_,this.strings=this.i18n.strings}ngOnInit(){this.syncFromGlobal();let e=this.socket.connections$.subscribe(()=>this.syncFromGlobal()),t=this.socket.redisDisconnected$.subscribe(()=>this.syncFromGlobal()),i=this.socket.stateChanged$.subscribe(()=>this.syncFromGlobal());this.unsubs.push(()=>{e.unsubscribe(),t.unsubscribe(),i.unsubscribe()});let r=this.breakpointObserver.observe(`(max-width: 599px)`).subscribe(_=>{this.isXs=_.matches,this.cdr.markForCheck()});this.unsubs.push(()=>r.unsubscribe());let c=this.breakpointObserver.observe(`(min-width: 720px)`).subscribe(_=>{this.isWide=_.matches,this.cdr.markForCheck()});this.unsubs.push(()=>c.unsubscribe())}ngOnDestroy(){this.unsubs.forEach(e=>e())}hasKeys(e){return!!this.keyspaceDatabases[e]}selectDatabase(e){this.currentDatabase=e,this.cmd.selectDatabase(e).then(()=>{this.syncFromGlobal()}),setTimeout(()=>this.cdr.detectChanges())}save(){this.cmd.save()}goStatistics(){this.cmd.statistics()}refresh(){this.cmd.refresh({withoutParent:!1})}syncFromGlobal(){let e=this.state.connection();this.hasConnection=e!==void 0,this.isCluster=e?.cluster===!0,this.isReadonly=e?.readonly===!0,this.databaseIndexes=this.state.databaseIndexes()??[],this.keyspaceDatabases=this.state.info()?.keyspaceDatabases??{},this.currentDatabase=this.cmd.currentDatabase,this.cdr.detectChanges()}static ɵfac=function(t){return new(t||n)(Qe(cp),Qe(YQ),Qe(P$1),Qe(bi),Qe(mc),Qe(Q))};static ɵcmp=Ee({type:n,selectors:[[`p3xr-database-header`]],decls:4,vars:2,consts:[[`id`,`p3xr-database-header`,1,`p3xr-accordion-toolbar`,`p3xr-database-header-toolbar`],[1,`p3xr-database-header-tools`],[1,`p3xr-database-header-title`],[1,`p3xr-database-header-link`,3,`click`],[1,`p3xr-database-header-db-selector`],[`mat-button`,``],[`mat-icon-button`,``,`matTooltipPosition`,`below`,3,`matTooltip`],[1,`p3xr-database-header-db-label`],[`subscriptSizing`,`dynamic`,1,`p3xr-database-header-db-field`],[`panelClass`,`p3xr-database-db-select-container`,3,`selectionChange`,`value`],[1,`p3xr-db-indicator`],[3,`value`],[`mat-button`,``,3,`click`],[`mat-icon-button`,``,`matTooltipPosition`,`below`,3,`click`,`matTooltip`]],template:function(t,i){t&1&&(Wa(0,`mat-toolbar`,0)(1,`div`,1),co(2,ht,3,1,`h2`,2),co(3,Tt,6,4),wf()()),t&2&&(Sn(2),lo(i.isXs?-1:2),Sn(),lo(i.hasConnection?3:-1))},dependencies:[Eb,Gn$1,ae,se,$Y,HY,G0,yt$1,wt$1,Qt$1,gt$1,Pt$1,qe,Nt$1,Lt$2,q$1,Qt$2],styles:[`[_nghost-%COMP%]{display:block}.p3xr-database-header-toolbar[_ngcontent-%COMP%]{height:48px;min-height:48px;max-height:48px;padding:0 8px 0 16px;border-radius:4px 4px 0 0}.p3xr-database-header-tools[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:48px}.p3xr-database-header-title[_ngcontent-%COMP%]{flex:1;font-size:20px;font-weight:400;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p3xr-database-header-link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:none;color:inherit}.p3xr-database-header-db-selector[_ngcontent-%COMP%]{display:flex;align-items:center;margin:0;padding:0}.p3xr-database-header-db-label[_ngcontent-%COMP%]{font-size:14px;font-weight:700;margin-right:2px}.p3xr-database-header-db-field[_ngcontent-%COMP%]{width:80px;position:relative;top:1px}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mdc-text-field{background:transparent!important;padding:0 8px!important}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mat-mdc-form-field-subscript-wrapper{display:none}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mdc-line-ripple{display:none}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mat-mdc-select-arrow-wrapper{padding-left:0}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mat-mdc-select-trigger{display:flex;align-items:center}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mat-mdc-select-value{display:flex;align-items:center}.p3xr-database-header-db-field[_ngcontent-%COMP%] .mat-mdc-select-value-text{display:flex;align-items:center}.p3xr-database-header-db-field[_ngcontent-%COMP%] mat-select-trigger{display:flex;align-items:center;gap:4px}.p3xr-database-header-db-field[_ngcontent-%COMP%] mat-select-trigger .p3xr-db-indicator{font-size:18px!important;width:18px!important;height:18px!important;line-height:18px!important;overflow:hidden;flex-shrink:0}`]})}return n})();var at=(()=>{class n{dialog;constructor(e){this.dialog=e}show(e){return L(this,null,function*(){let{KeyImportDialogComponent:t}=yield import(`./chunk-6kHEQaIM.js`),i=this.dialog.open(t,h({data:e.data,disableClose:!1,width:`700px`,maxWidth:`95vw`,maxHeight:`90vh`}));return new Promise((r,c)=>{i.afterClosed().subscribe(_=>{_?r(_):c()})})})}static ɵfac=function(t){return new(t||n)(N(Le))};static ɵprov=P({token:n,factory:n.ɵfac,providedIn:`root`})}return n})();function kt(n,p){if(n&1){let e=dT();Wa(0,`button`,22),Sy(`click`,function(){let i=ym(e).$implicit;return bm(gT(2).setDivider(i))}),Wa(1,`span`,23),HT(2),wf()()}if(n&2){let e=p.$implicit;Sn(2),jy(e===``?`(empty)`:e)}}function wt(n,p){if(n&1&&(Wa(0,`button`,19)(1,`span`,5),HT(2,`arrow_drop_down`),wf()(),Wa(3,`mat-menu`,20,2),oT(5,kt,3,1,`button`,21,rT),wf()),n&2){let e=_T(4),t=gT();by(`matMenuTriggerFor`,e)(`matTooltip`,t.strings().form?.treeSettings?.field?.treeSeparatorSelector),Sn(5),iT(t.treeDividers)}}function St(n,p){if(n&1){let e=dT();Wa(0,`span`,10)(1,`button`,24),Sy(`click`,function(){ym(e);return bm(gT().pageAction(`first`))}),Wa(2,`span`,5),HT(3,`skip_previous`),wf()(),Wa(4,`button`,25),Sy(`click`,function(){ym(e);return bm(gT().pageAction(`prev`))}),Wa(5,`span`,5),HT(6,`keyboard_arrow_left`),wf()(),Wa(7,`p3xr-ng-input`,26),Sy(`ngModelChange`,function(i){ym(e);return bm(gT().onPageInputChange(i))}),wf(),WC(),Wa(8,`span`,27),HT(9),wf(),Wa(10,`button`,25),Sy(`click`,function(){ym(e);return bm(gT().pageAction(`next`))}),Wa(11,`span`,5),HT(12,`keyboard_arrow_right`),wf()(),Wa(13,`button`,24),Sy(`click`,function(){ym(e);return bm(gT().pageAction(`last`))}),Wa(14,`span`,5),HT(15,`skip_next`),wf()()()}if(n&2){let e=gT();by(`matTooltip`,e.keyCountText()),Sn(),by(`matTooltip`,e.strings().page?.treeControls?.pager?.first),Sn(3),by(`matTooltip`,e.strings().page?.treeControls?.pager?.prev),Sn(3),by(`max`,``+e.pages)(`ngModel`,e.page),qC(),Sn(2),Nf(`/ `,e.pages),Sn(),by(`matTooltip`,e.strings().page?.treeControls?.pager?.next),Sn(3),by(`matTooltip`,e.strings().page?.treeControls?.pager?.last)}}function Et(n,p){if(n&1&&(Wa(0,`span`,11),HT(1),wf()),n&2){let e=gT();Sn(),Nf(` `,e.keyCountText(),`\xA0 `)}}function Dt(n,p){if(n&1){let e=dT();Wa(0,`button`,14),Sy(`click`,function(){ym(e);return bm(gT().clearSearch())}),Wa(1,`span`,5),HT(2,`clear`),wf()()}if(n&2)by(`matTooltip`,gT().strings().page?.treeControls?.search?.clear)}function Mt(n,p){if(n&1){let e=dT();Wa(0,`span`,28),Sy(`click`,function(i){ym(e);return bm(gT().addRootKey(i))}),HT(1,`add`),wf()}if(n&2)by(`matTooltip`,gT().strings().intention?.addKeyRoot)}function It(n,p){if(n&1&&(Wa(0,`div`,18),HT(1),wf()),n&2){let e=gT();Sn(),jy(e.strings().label?.exportSearchHint)}}function zt(n,p){if(n&1&&(Wa(0,`div`,18),HT(1),wf()),n&2){let e=gT(2);Sn(),jy(e.strings().label?.importSearchHint)}}function Rt(n,p){if(n&1){let e=dT();Wa(0,`button`,6),Sy(`click`,function(){ym(e);return bm(gT().importKeys())}),Wa(1,`mat-icon`),HT(2,`file_upload`),wf(),Wa(3,`span`),HT(4),wf()(),co(5,zt,2,1,`div`,18)}if(n&2){let e=gT();Sn(4),jy(e.strings().intention?.importKeys),Sn(),lo(e.search.length>0?5:-1)}}function Vt(n,p){if(n&1&&(Wa(0,`div`,18),HT(1),wf()),n&2){let e=gT(2);Sn(),jy(e.strings().label?.deleteSearchHint)}}function Nt(n,p){if(n&1){let e=dT();_y(0,`mat-divider`),Wa(1,`button`,6),Sy(`click`,function(){ym(e);return bm(gT().deleteSearchKeys())}),Wa(2,`mat-icon`),HT(3,`delete_sweep`),wf(),Wa(4,`span`),HT(5),wf()(),co(6,Vt,2,1,`div`,18)}if(n&2){let e=gT();Sn(2),uc(`color`,`var(--p3xr-btn-warn-bg)`),Sn(3),jy(e.deleteSearchLabel()),Sn(),lo(e.search.length>0?6:-1)}}var st=(()=>{class n{ngZone;elementRef;i18n;common;cmd;treeSettingsDialog;keyImportDialog;socket;cdr;state;settings;overlay;p3xrMainRef;page=1;pages=0;search=``;keyCount=0;redisTreeDivider=`:`;treeDividers=[];searchClientSide=!1;isReadonly=!1;strings;unsubs=[];dividerChange$=new I;constructor(e,t,i,r,c,_,k,b,x,w,D,I){this.ngZone=e,this.elementRef=t,this.i18n=i,this.common=r,this.cmd=c,this.treeSettingsDialog=_,this.keyImportDialog=k,this.socket=b,this.cdr=x,this.state=w,this.settings=D,this.overlay=I,this.strings=this.i18n.strings}ngOnInit(){this.syncFromGlobal(),this.search&&this.onSearchChange();let e=this.dividerChange$.pipe(Gn(666)).subscribe(i=>{this.applyDivider(i)});this.unsubs.push(()=>e.unsubscribe());let t=this.cmd.treeRefresh$.subscribe(()=>{this.ngZone.run(()=>{this.syncFromGlobal(),this.requestViewRefresh()})});this.unsubs.push(()=>t.unsubscribe())}ngOnDestroy(){this.unsubs.forEach(e=>e())}keyCountText(){let e=this.strings()?.status?.keyCount;return typeof e==`function`?e({keyCount:this.keyCount}):String(this.keyCount)}searchPlaceholder(){let e=this.strings()?.page?.treeControls?.search;return this.searchClientSide?e?.placeholderClient:e?.placeholderServer}treeExpandAll(){this.common.treeExpandAll$.next()}treeExpandToLevel(e){this.common.treeExpandToLevel$.next(e)}treeCollapseAll(){this.common.treeCollapseAll$.next()}refreshTree(){return L(this,null,function*(){yield this.cmd.refresh(),this.ngZone.run(()=>{this.syncFromGlobal(),this.requestViewRefresh()})})}openTreeSettingDialog(e){return L(this,null,function*(){yield this.treeSettingsDialog.show({$event:e}),this.syncFromGlobal(),this.requestViewRefresh()})}onDividerInputChange(e){this.redisTreeDivider=e??``,this.settings.redisTreeDivider.set(this.redisTreeDivider),this.dividerChange$.next(this.redisTreeDivider)}setDivider(e){this.redisTreeDivider=e??``,this.applyDivider(this.redisTreeDivider)}applyDivider(e){this.settings.redisTreeDivider.set(e),this.state.redisChanged.set(!0),this.cmd.treeRefresh$.next(),this.syncFromGlobal()}pageAction(e){let t=this.state.page()??1,i=this.pages;switch(e){case`prev`:t-1>=1&&this.state.page.set(t-1);break;case`next`:t+1<=i&&this.state.page.set(t+1);break;case`last`:this.state.page.set(i);break;case`first`:this.state.page.set(1);break}this.syncFromGlobal()}onPageInputChange(e){let t=parseInt(e,10),i=isNaN(t)?1:t;this.state.page.set(i),this.pageChange()}pageChange(){let e=this.state.page()??1,t=this.pages;e<1?e=1:e>t&&(e=t),this.state.page.set(e),this.syncFromGlobal()}onSearchModelChange(e){this.search=e??``,this.state.search.set(this.search)}onSearchChange(){return L(this,null,function*(){this.state.search.set(this.search),this.state.page.set(1),this.settings.searchClientSide()&&this.state.redisChanged.set(!0),yield this.cmd.refresh(),this.syncFromGlobal(),this.requestViewRefresh(),this.socket.tick()})}clearSearch(){return L(this,null,function*(){this.search=``,yield this.onSearchChange()})}exportKeys(){return L(this,null,function*(){let e=this.state.keysRaw();if(!Array.isArray(e)||e.length===0){this.common.toast({message:this.strings().label?.noKeysToExport});return}try{this.overlay.show({message:this.strings().label?.exportProgress});let t=yield this.socket.request({action:`key/export`,payload:{keys:e}}),i=JSON.stringify(t.data,null,2),r=new Blob([i],{type:`application/json`}),c=URL.createObjectURL(r),_=document.createElement(`a`);_.href=c;_.download=`${this.state.connection()?.name||`redis`}-db${this.state.currentDatabase()??0}-export.json`,_.click(),URL.revokeObjectURL(c),this.common.toast({message:this.strings().status?.exportDone})}catch(t){this.common.generalHandleError(t)}finally{this.overlay.hide()}})}importKeys(){return L(this,null,function*(){let e=document.createElement(`input`);e.type=`file`,e.accept=`.json`,e.onchange=()=>L(this,null,function*(){let t=e.files?.[0];if(!t)return;let i=new FileReader;i.onerror=()=>this.common.generalHandleError(i.error),i.onload=r=>L(this,null,function*(){try{let c=JSON.parse(r.target.result);if(!c?.keys||!Array.isArray(c.keys)||c.keys.length===0){this.common.toast({message:this.strings().label?.importNoKeys});return}let _=yield this.keyImportDialog.show({data:c});if(_?.pending){try{this.overlay.show({message:this.strings().label?.importProgress});let b=(yield this.socket.request({action:`key/import`,payload:{keys:_.keys,conflictMode:_.conflictMode}})).data,x=this.strings().status?.importDone,w=typeof x==`function`?x(b):`Import complete: ${b.created} created, ${b.skipped} skipped, ${b.errors} errors`;this.common.toast({message:w})}finally{this.overlay.hide()}yield this.cmd.refresh(),this.ngZone.run(()=>{this.syncFromGlobal(),this.requestViewRefresh()})}}catch(c){c!=null&&this.common.generalHandleError(c)}}),i.readAsText(t)}),e.click()})}deleteSearchLabel(){let e=this.strings();if(this.search.length>0){let i=e.intention?.deleteSearchKeys;return typeof i==`function`?i({count:this.keyCount}):`Delete ${this.keyCount} matching keys`}let t=e.intention?.deleteAllKeysMenu;return typeof t==`function`?t({count:this.keyCount}):`Delete all ${this.keyCount} keys`}deleteSearchKeys(){return L(this,null,function*(){let e;this.search.length>0?this.settings.searchStartsWith()?e=this.search+`*`:e=`*`+this.search+`*`:e=`*`;try{let t=this.strings().confirm?.deleteSearchKeys,i=typeof t==`function`?t({count:this.keyCount,pattern:e}):`Are you sure to delete all keys matching "${e}"? Found ${this.keyCount} keys.`;yield this.common.confirm({message:i}),this.overlay.show({message:this.strings().label?.deletingSearchKeys});let c=(yield this.socket.request({action:`key/delete-search-keys`,payload:{match:e}})).deletedCount||0,_=this.strings().status?.deletedSearchKeys,k=typeof _==`function`?_({count:c}):`Deleted ${c} keys`;this.common.toast({message:k}),yield this.cmd.refresh(),this.ngZone.run(()=>{this.syncFromGlobal(),this.requestViewRefresh()})}catch(t){t!=null&&this.common.generalHandleError(t)}finally{this.overlay.hide()}})}searchInputClass(){let e=this.search.length>0;return this.isReadonly?e?`search-readonly-clear`:`search-readonly`:e?`search-full-clear`:`search-full`}exportLabel(){let e=this.strings();if(this.search.length>0){let i=e.intention?.exportSearchResults;return typeof i==`function`?i({count:this.keyCount}):`Export ${this.keyCount} results`}let t=e.intention?.exportAllKeys;return typeof t==`function`?t({count:this.keyCount}):`Export all ${this.keyCount} keys`}addRootKey(e){this.cmd.addKey({event:e})}syncFromGlobal(){this.state.filteredKeys();this.page=Number(this.state.page()??1),this.pages=Number(this.state.pages()??0),this.search=this.state.search()??``;let t=this.state.keysRaw();this.keyCount=Array.isArray(t)?t.length:0,this.redisTreeDivider=this.settings.redisTreeDivider()??`:`,this.treeDividers=Array.isArray(this.state.cfg()?.treeDividers)?this.state.cfg().treeDividers.slice():[],this.searchClientSide=!!this.settings.searchClientSide(),this.isReadonly=this.state.connection()?.readonly===!0}requestViewRefresh(){setTimeout(()=>{try{this.cdr.detectChanges()}catch(e){}})}static ɵfac=function(t){return new(t||n)(Qe(O),Qe(q),Qe(YQ),Qe(It$1),Qe(P$1),Qe(g),Qe(at),Qe(bi),Qe(mc),Qe(Q),Qe(x),Qe(_t$1))};static ɵcmp=Ee({type:n,selectors:[[`p3xr-database-treecontrol-controls`]],inputs:{p3xrMainRef:`p3xrMainRef`},decls:52,vars:28,consts:[[`expandMenu`,`matMenu`],[`actionsMenu`,`matMenu`],[`dividerMenu`,`matMenu`],[1,`p3xr-database-treecontrol-controls-leading`],[`type`,`button`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-icon-button`,`p3xr-database-treecontrol-icon-primary`,3,`matMenuTriggerFor`,`matTooltip`],[`aria-hidden`,`true`,1,`material-icons`],[`mat-menu-item`,``,3,`click`],[`type`,`button`,`id`,`p3xr-database-treecontrol-controls-collapse-all`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-icon-button`,3,`click`,`matTooltip`],[`type`,`button`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-icon-button`,3,`click`,`matTooltip`],[`id`,`p3xr-database-treecontrol-controls-tree-divider-input`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-divider-input`,3,`ngModelChange`,`ngModel`,`matTooltip`],[1,`p3xr-database-treecontrol-controls-pager`,3,`matTooltip`],[1,`p3xr-database-treecontrol-controls-keycount`],[1,`p3xr-database-treecontrol-controls-search`],[`matTooltipPosition`,`right`,`matTooltipClass`,`p3xr-tree-node-tooltip`,3,`ngModelChange`,`enterPressed`,`placeholder`,`ngModel`,`matTooltip`],[`type`,`button`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-icon-button`,`p3xr-database-treecontrol-icon-primary`,3,`click`,`matTooltip`],[`type`,`button`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-icon-button`,`p3xr-database-treecontrol-icon-primary`,3,`matTooltip`],[`matTooltipPosition`,`above`,1,`material-icons`,`p3xr-database-treecontrol-root-add`,3,`matTooltip`],[`type`,`button`,1,`p3xr-database-treecontrol-icon-button`,3,`matMenuTriggerFor`],[1,`p3xr-menu-hint`],[`type`,`button`,`matTooltipPosition`,`above`,1,`p3xr-database-treecontrol-divider-trigger`,3,`matMenuTriggerFor`,`matTooltip`],[1,`p3xr-divider-menu`],[`mat-menu-item`,``,`type`,`button`],[`mat-menu-item`,``,`type`,`button`,3,`click`],[1,`p3xr-database-treecontrol-divider-menu-label`],[`type`,`button`,1,`p3xr-database-treecontrol-icon-button`,`p3xr-database-treecontrol-icon-primary`,3,`click`,`matTooltip`],[`type`,`button`,1,`p3xr-database-treecontrol-icon-button`,3,`click`,`matTooltip`],[`type`,`number`,`step`,`1`,`min`,`1`,1,`p3xr-database-treecontrol-page-input`,3,`ngModelChange`,`max`,`ngModel`],[1,`p3xr-database-treecontrol-pager-text`],[`matTooltipPosition`,`above`,1,`material-icons`,`p3xr-database-treecontrol-root-add`,3,`click`,`matTooltip`]],template:function(t,i){if(t&1&&(Wa(0,`div`,3)(1,`button`,4)(2,`span`,5),HT(3,`keyboard_arrow_down`),wf()(),Wa(4,`mat-menu`,null,0)(6,`button`,6),Sy(`click`,function(){return i.treeExpandToLevel(1)}),HT(7),wf(),Wa(8,`button`,6),Sy(`click`,function(){return i.treeExpandToLevel(2)}),HT(9),wf(),Wa(10,`button`,6),Sy(`click`,function(){return i.treeExpandToLevel(3)}),HT(11),wf(),Wa(12,`button`,6),Sy(`click`,function(){return i.treeExpandToLevel(4)}),HT(13),wf(),Wa(14,`button`,6),Sy(`click`,function(){return i.treeExpandToLevel(5)}),HT(15),wf(),_y(16,`mat-divider`),Wa(17,`button`,6),Sy(`click`,function(){return i.treeExpandAll()}),HT(18),wf()(),Wa(19,`button`,7),Sy(`click`,function(){return i.treeCollapseAll()}),Wa(20,`span`,5),HT(21,`keyboard_arrow_up`),wf()(),Wa(22,`button`,8),Sy(`click`,function(){return i.refreshTree()}),Wa(23,`span`,5),HT(24,`refresh`),wf()(),Wa(25,`button`,8),Sy(`click`,function(c){return i.openTreeSettingDialog(c)}),Wa(26,`span`,5),HT(27,`settings`),wf()(),Wa(28,`p3xr-ng-input`,9),Sy(`ngModelChange`,function(c){return i.onDividerInputChange(c)}),wf(),WC(),co(29,wt,7,2),wf(),co(30,St,16,8,`span`,10)(31,Et,2,1,`span`,11),Wa(32,`div`,12)(33,`p3xr-ng-input`,13),Sy(`ngModelChange`,function(c){return i.onSearchModelChange(c)})(`enterPressed`,function(){return i.onSearchChange()}),wf(),WC(),Wa(34,`button`,14),Sy(`click`,function(){return i.onSearchChange()}),Wa(35,`span`,5),HT(36,`search`),wf()(),co(37,Dt,3,1,`button`,15),co(38,Mt,2,1,`span`,16),Wa(39,`button`,17)(40,`span`,5),HT(41,`more_vert`),wf()(),Wa(42,`mat-menu`,null,1)(44,`button`,6),Sy(`click`,function(){return i.exportKeys()}),Wa(45,`mat-icon`),HT(46,`file_download`),wf(),Wa(47,`span`),HT(48),wf()(),co(49,It,2,1,`div`,18),co(50,Rt,6,2),co(51,Nt,7,4),wf()()),t&2){let r=_T(5),c=_T(43);Sn(),by(`matMenuTriggerFor`,r)(`matTooltip`,i.strings().intention?.extend),Sn(6),Nf(``,i.strings().page?.treeControls?.level,` 1`),Sn(2),Nf(``,i.strings().page?.treeControls?.level,` 2`),Sn(2),Nf(``,i.strings().page?.treeControls?.level,` 3`),Sn(2),Nf(``,i.strings().page?.treeControls?.level,` 4`),Sn(2),Nf(``,i.strings().page?.treeControls?.level,` 5`),Sn(3),jy(i.strings().page?.treeControls?.expandAll),Sn(),by(`matTooltip`,i.strings().page?.treeControls?.collapseAll),Sn(3),by(`matTooltip`,i.strings().intention?.refresh),Sn(3),by(`matTooltip`,i.strings().form?.treeSettings?.label?.formName),Sn(3),by(`ngModel`,i.redisTreeDivider)(`matTooltip`,i.strings().form?.treeSettings?.field?.treeSeparator),qC(),Sn(),lo(i.treeDividers.length>0?29:-1),Sn(),lo(i.pages>1?30:31),Sn(3),Tf(`p3xr-database-treecontrol-search-input `+i.searchInputClass()),by(`placeholder`,i.searchPlaceholder())(`ngModel`,i.search)(`matTooltip`,i.strings().page?.treeControls?.search?.infoDetails),qC(),Sn(),by(`matTooltip`,i.strings().page?.treeControls?.search?.search),Sn(3),lo(i.search.length>0?37:-1),Sn(),lo(i.isReadonly?-1:38),Sn(),by(`matMenuTriggerFor`,c),Sn(9),jy(i.exportLabel()),Sn(),lo(i.search.length>0?49:-1),Sn(),lo(i.isReadonly?-1:50),Sn(),lo(i.isReadonly?-1:51)}},dependencies:[Eb,Gn$1,xn,on,Qt$1,gt$1,Lt$1,I$1,G,Bt$1,yt$1,wt$1,f,u,S],styles:[`:host{display:block;margin-top:2px;min-height:24px;text-align:center}#p3xr-database-treecontrol-controls-container{display:inline-block}.p3xr-database-treecontrol-controls-leading{float:left;line-height:31px}.p3xr-database-treecontrol-controls-search{clear:both;padding:5px;text-align:left;line-height:24px}.p3xr-database-treecontrol-controls-pager{display:inline-block;position:relative;top:2px;vertical-align:middle;line-height:24px}.p3xr-database-treecontrol-controls-keycount{float:right;line-height:26px;margin-top:6px;opacity:.5}.p3xr-database-treecontrol-divider-menu-label{font-family:Roboto Mono,monospace;font-size:14px;font-weight:500}.p3xr-divider-menu.mat-mdc-menu-panel{min-width:20px!important;max-width:40px!important;transform:translate(-20px)}.p3xr-divider-menu.mat-mdc-menu-panel .mat-mdc-menu-content{padding:0!important}.p3xr-divider-menu.mat-mdc-menu-panel .mat-mdc-menu-item{min-height:28px;height:28px;padding:0!important;min-width:0;text-align:center;justify-content:center}.p3xr-divider-menu.mat-mdc-menu-panel .mat-mdc-menu-item .mdc-list-item__primary-text{width:100%;text-align:center}.p3xr-divider-menu.mat-mdc-menu-panel .p3xr-database-treecontrol-divider-menu-label{display:block;text-align:center;width:100%}.p3xr-database-treecontrol-icon-button{align-items:center;background:none;border:0;border-radius:50%;color:var(--%NS%p3xr-treecontrol-icon-color);cursor:pointer;display:inline-flex;height:24px;justify-content:center;line-height:24px;margin:0;min-height:24px;min-width:24px;padding:0;vertical-align:middle;width:24px}.p3xr-database-treecontrol-icon-button:focus{outline:none}.p3xr-database-treecontrol-icon-button .material-icons{display:block;font-size:24px;height:24px;line-height:24px;width:24px}.p3xr-database-treecontrol-root-add{color:var(--%NS%p3xr-common-warn-color);cursor:pointer;display:inline-block;font-size:24px;height:24px;line-height:24px;vertical-align:middle;width:24px}.p3xr-database-treecontrol-icon-primary{color:var(--%NS%p3xr-btn-primary-bg)}p3xr-ng-input.p3xr-database-treecontrol-divider-input{font-family:Roboto Mono,monospace;font-size:14px;font-weight:500;text-align:center;vertical-align:middle!important;width:23px}p3xr-ng-input.p3xr-database-treecontrol-divider-input input.p3xr-input{text-align:center}.p3xr-database-treecontrol-divider-trigger{background:none;border:0;color:var(--%NS%p3xr-treecontrol-icon-color);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;height:24px;margin:0;padding:0;vertical-align:middle;width:14px}.p3xr-database-treecontrol-divider-trigger .material-icons{font-size:18px;height:18px;width:18px}p3xr-ng-input.p3xr-database-treecontrol-page-input{vertical-align:middle!important;width:48px}.p3xr-database-treecontrol-pager-text{vertical-align:middle}.p3xr-menu-hint{padding:0 16px 8px;font-size:11px;opacity:.5;font-style:italic;pointer-events:none;line-height:1.3}p3xr-ng-input.p3xr-database-treecontrol-search-input{vertical-align:middle!important;width:auto}.p3xr-database-treecontrol-search-input.search-full{width:calc(100% - 73px)}.p3xr-database-treecontrol-search-input.search-full-clear{width:calc(100% - 98px)}.p3xr-database-treecontrol-search-input.search-readonly{width:calc(100% - 48px)}.p3xr-database-treecontrol-search-input.search-readonly-clear{width:calc(100% - 73px)}
`],encapsulation:2})}return n})();var _e=K(C());var lt=K(U());function Ft(n,p){if(n&1){let e=dT();Wa(0,`span`,12),Sy(`click`,function(i){ym(e);let r=gT().$implicit;return gT(2).toggleExpand(r),bm(i.stopPropagation())}),wf()}if(n&2){let e=gT().$implicit,t=gT(2);vt$1(`tree-expanded`,t.isExpanded(e))(`tree-collapsed`,!t.isExpanded(e))}}function Pt(n,p){n&1&&_y(0,`i`,14)}function Kt(n,p){n&1&&_y(0,`i`,15)}function jt(n,p){n&1&&_y(0,`i`,16)}function Lt(n,p){n&1&&_y(0,`i`,17)}function $t(n,p){n&1&&_y(0,`i`,18)}function Ht(n,p){n&1&&_y(0,`i`,19)}function At(n,p){n&1&&_y(0,`i`,20)}function Bt(n,p){n&1&&_y(0,`i`,21)}function Gt(n,p){n&1&&_y(0,`i`,22)}function Wt(n,p){n&1&&_y(0,`i`,22)}function Zt(n,p){n&1&&_y(0,`i`,23)}function qt(n,p){n&1&&_y(0,`i`,24)}function Xt(n,p){n&1&&_y(0,`i`,25)}function Ut(n,p){n&1&&_y(0,`i`,26)}function Jt(n,p){n&1&&_y(0,`i`,27)}function Qt(n,p){if(n&1){let e=dT();Wa(0,`span`,13),Sy(`click`,function(){ym(e);let i=gT().$implicit;return bm(gT(2).selectNode(i))}),co(1,Pt,1,0,`i`,14)(2,Kt,1,0,`i`,15)(3,jt,1,0,`i`,16)(4,Lt,1,0,`i`,17)(5,$t,1,0,`i`,18)(6,Ht,1,0,`i`,19)(7,At,1,0,`i`,20)(8,Bt,1,0,`i`,21)(9,Gt,1,0,`i`,22)(10,Wt,1,0,`i`,22)(11,Zt,1,0,`i`,23)(12,qt,1,0,`i`,24)(13,Xt,1,0,`i`,25)(14,Ut,1,0,`i`,26)(15,Jt,1,0,`i`,27),wf()}if(n&2){let e,t=gT().$implicit;Sn(),lo((e=t.keysInfo.type)===`hash`?1:e===`list`?2:e===`set`?3:e===`string`?4:e===`zset`?5:e===`stream`?6:e===`json`?7:e===`timeseries`?8:e===`bloom`?9:e===`cuckoo`?10:e===`topk`?11:e===`cms`?12:e===`tdigest`?13:e===`vectorset`?14:e===`array`?15:-1)}}function Yt(n,p){if(n&1&&(Wa(0,`span`,9),HT(1),wf()),n&2){let e=gT().$implicit,t=gT(2);Sn(),By(``,t.divider,`* (`,e.childCount,`)`)}}function ei(n,p){if(n&1&&(Wa(0,`span`,9),HT(1),wf()),n&2){let e=gT().$implicit;Sn(),Nf(`(`,e.keysInfo.length,`)`)}}function ti(n,p){if(n&1&&(Wa(0,`span`,28)(1,`span`,29),HT(2,`schedule`),wf()()),n&2){let e=gT().$implicit,t=gT(2);Tf(t.getTtlClass(e)),by(`matTooltip`,`TTL: `+t.formatTtl(e))}}function ii(n,p){if(n&1){let e=dT();Wa(0,`span`,30)(1,`span`,32),Sy(`click`,function(i){ym(e);let r=gT(2).$implicit;return bm(gT(2).deleteTree(i,r))}),HT(2,`delete`),wf()()}if(n&2){let e=gT(2).$implicit;by(`matTooltip`,gT(2).deleteTreeTooltip(e))}}function ni(n,p){if(n&1){let e=dT();Wa(0,`span`,30)(1,`span`,32),Sy(`click`,function(i){ym(e);let r=gT(2).$implicit;return bm(gT(2).deleteKey(i,r.key))}),HT(2,`delete`),wf()()}if(n&2)by(`matTooltip`,gT(4).strings()?.intention?.delete)}function oi(n,p){if(n&1){let e=dT();Wa(0,`span`,11),co(1,ii,3,1,`span`,30)(2,ni,3,1,`span`,30),Wa(3,`span`,30)(4,`span`,31),Sy(`click`,function(i){ym(e);let r=gT().$implicit;return bm(gT(2).addKey(i,r))}),HT(5,`add`),wf()()()}if(n&2){let e=gT().$implicit,t=gT(2);Sn(),lo(e.type===`folder`?1:2),Sn(2),by(`matTooltip`,t.strings()?.intention?.addKey)}}function ri(n,p){if(n&1){let e=dT();Wa(0,`div`,3),co(1,Ft,1,4,`span`,4)(2,Qt,16,1,`span`,5),Wa(3,`span`,6)(4,`label`,7),Sy(`click`,function(){let i=ym(e).$implicit,r=gT(2);return bm(i.expandable?r.toggleExpand(i):r.selectNode(i))}),Wa(5,`span`,8),HT(6),wf(),co(7,Yt,2,2,`span`,9),co(8,ei,2,1,`span`,9),wf(),co(9,ti,3,3,`span`,10),wf(),co(10,oi,6,2,`span`,11),wf()}if(n&2){let e=p.$implicit,t=gT(2);uc(`padding-left`,e.level*20+4,`px`),Sn(),lo(e.expandable?1:e.keysInfo?2:-1),Sn(2),xi(`data-p3xr-tree-key`,e.type===`folder`?``:e.key),Sn(),by(`matTooltip`,t.extractNodeTooltip(e)),Sn(2),jy(e.label),Sn(),lo(e.type===`folder`?7:-1),Sn(),lo(e.type!==`folder`&&e.keysInfo?.type!==`string`&&e.keysInfo?.type!==`json`&&e.keysInfo?8:-1),Sn(),lo(e.type!==`folder`&&t.getRemainingTtl(e)>0?9:-1),Sn(),lo(t.isReadonly?-1:10)}}function ai(n,p){if(n&1&&(Wa(0,`cdk-virtual-scroll-viewport`,1),hy(1,ri,11,10,`div`,2),wf()),n&2){let e=gT();by(`itemSize`,28),Sn(),by(`cdkVirtualForOf`,e.dataSource)(`cdkVirtualForTrackBy`,e.trackByKey)}}var ct=(()=>{class n{ngZone;elementRef;i18n;common;theme;socket;keyNewOrSetDialog;nav;cmd;cdr;treeBuilder;state;settingsService;p3xrResize;p3xrMainRef;viewport;dataSource=[];isEnabled=!1;isReadonly=!1;divider=`:`;strings;expandedKeys=new Set;expandedNodeObjects=[];hierarchicalNodes=[];get expansionStorageKey(){return`p3xr-tree-expanded-${this.state.connection()?.id||`none`}-${this.state.currentDatabase()??0}`}saveExpansion(){try{sessionStorage.setItem(this.expansionStorageKey,JSON.stringify([...this.expandedKeys]))}catch(e){}}restoreExpansion(){try{let e=sessionStorage.getItem(this.expansionStorageKey);e&&(this.expandedKeys=new Set(JSON.parse(e)))}catch(e){}}unsubs=[];constructor(e,t,i,r,c,_,k,b,x,w,D,I,z){this.ngZone=e,this.elementRef=t,this.i18n=i,this.common=r,this.theme=c,this.socket=_,this.keyNewOrSetDialog=k,this.nav=b,this.cmd=x,this.cdr=w,this.treeBuilder=D,this.state=I,this.settingsService=z,this.strings=this.i18n.strings,cr(()=>{this.i18n.currentLang(),this.cdr.markForCheck()})}ngOnInit(){this.syncGlobalState(),this.attachWindowFocusListener(),this.startPolling(),this.startTtlRepaint();let e=this.cmd.keyDelete$.subscribe(x=>{this.ngZone.run(()=>this.deleteKey(x.event,x.key))});this.unsubs.push(()=>e.unsubscribe());let t=this.cmd.keyRename$.subscribe(x=>{this.ngZone.run(()=>this.renameKey(x.event,x.key))});this.unsubs.push(()=>t.unsubscribe());let i=this.cmd.keyNew$.subscribe(x=>{this.ngZone.run(()=>this.addKey(x.event,x.node?F(E({},x),{_sourceNode:x.node}):x))});this.unsubs.push(()=>i.unsubscribe());let r=this.cmd.treeControlEnabled$.subscribe(x=>{this.ngZone.run(()=>{this.isEnabled=x})});this.unsubs.push(()=>r.unsubscribe());let c=this.cmd.treeRefresh$.subscribe(()=>{this.ngZone.run(()=>{this.syncGlobalState(),this.rebuildTree()})});this.unsubs.push(()=>c.unsubscribe());let _=this.common.treeExpandAll$.subscribe(()=>this.ngZone.run(()=>{let x=new Set,w=D=>{for(let I of D)I.type===`folder`&&(x.add(I.key),w(I.children??[]))};w(this.hierarchicalNodes),this.expandedKeys=x,this.flattenVisibleNodes(),this.syncExpandedNodesToGlobal(),this.saveExpansion(),this.cdr.markForCheck()}));this.unsubs.push(()=>_.unsubscribe());let k=this.common.treeCollapseAll$.subscribe(()=>this.ngZone.run(()=>{this.expandedKeys=new Set,this.flattenVisibleNodes(),this.syncExpandedNodesToGlobal(),this.saveExpansion(),this.cdr.markForCheck()}));this.unsubs.push(()=>k.unsubscribe());let b=this.common.treeExpandToLevel$.subscribe(x=>this.ngZone.run(()=>{let w=new Set,D=(I,z)=>{for(let j of I)j.type===`folder`&&(z<x&&w.add(j.key),D(j.children??[],z+1))};D(this.hierarchicalNodes,0),this.expandedKeys=w,this.flattenVisibleNodes(),this.syncExpandedNodesToGlobal(),this.saveExpansion(),this.cdr.markForCheck()}));this.unsubs.push(()=>b.unsubscribe()),setTimeout(()=>{this.isEnabled=!0,this.cdr.markForCheck()},50)}ngOnDestroy(){this.unsubs.forEach(e=>e())}ttlRepaintTimer;startTtlRepaint(){let e=()=>{this.cdr.markForCheck();let t=Infinity,i=!1;for(let c of this.dataSource){if(c.type===`folder`)continue;let _=c.keysInfo?.ttl;if(!_||_<=0)continue;let k=this.getRemainingTtl(c);k<=0?i=!0:k<t&&(t=k)}if(i){this.cmd.refresh(),this.ttlRepaintTimer=setTimeout(e,3e3);return}let r;t<=30?r=1e3:t<=300?r=5e3:r=3e4,this.ttlRepaintTimer=setTimeout(e,r)};this.ttlRepaintTimer=setTimeout(e,3e4),this.unsubs.push(()=>clearTimeout(this.ttlRepaintTimer))}getRemainingTtl(e){let t=e.keysInfo?.ttl;if(!t||t<=0)return-1;let i=this.state.keysInfoFetchedAt()??Date.now(),c=t-Math.floor((Date.now()-i)/1e3);return c>0?c:-1}formatTtl(e){let t=this.getRemainingTtl(e);if(t<=0)return``;let i=this.settingsService.getHumanizeDurationOptions();return(0,lt.default)(t*1e3,F(E({},i),{largest:2,round:!0,delimiter:` `}))}getTtlClass(e){let t=this.getRemainingTtl(e);return t<=0?``:t<30?`p3xr-tree-ttl-red p3xr-tree-ttl-pulse`:t<300?`p3xr-tree-ttl-red`:t<3600?`p3xr-tree-ttl-yellow`:`p3xr-tree-ttl-green`}trackByKey(e,t){return t.key}isExpanded(e){return this.expandedKeys.has(e.key)}toggleExpand(e){this.expandedKeys.has(e.key)?this.expandedKeys.delete(e.key):this.expandedKeys.add(e.key),this.flattenVisibleNodes(),this.syncExpandedNodesToGlobal(),this.saveExpansion()}selectNode(e){this.navigateTo(`database.key`,{key:e.key})}deleteKey(e,t){return L(this,null,function*(){try{e.preventDefault(),e.stopPropagation(),yield this.common.confirm({message:this.i18n.strings().confirm.deleteKey}),yield this.socket.request({action:`key/delete`,payload:{key:t}}),typeof window.gtag==`function`&&window.gtag(`config`,this.settingsService.googleAnalytics,{page_path:`/delete`}),this.navigateTo(`database.statistics`),this.common.toast(this.i18n.strings().status.deletedKey({key:t})),yield this.cmd.refresh(),this.rebuildTree()}catch(i){this.common.generalHandleError(i)}})}renameKey(e,t){return L(this,null,function*(){try{e?.stopPropagation?.();let i=yield this.common.prompt({title:this.i18n.strings().confirm.rename.title,placeholder:this.i18n.strings().confirm.rename.placeholder,initialValue:t,ok:this.i18n.strings().intention.rename,cancel:this.i18n.strings().intention.cancel});yield this.socket.request({action:`key/rename`,payload:{key:t,keyNew:i}}),typeof window.gtag==`function`&&window.gtag(`config`,this.settingsService.googleAnalytics,{page_path:`/rename`}),this.navigateTo(`database.key`,{key:i}),this.common.toast(this.i18n.strings().status.renamedKey),yield this.cmd.refresh(),this.rebuildTree()}catch(i){this.common.generalHandleError(i)}})}deleteTree(e,t){return L(this,null,function*(){try{e.stopPropagation(),yield this.common.confirm({message:this.i18n.strings().confirm.deleteAllKeys({key:t.key})});let i=this.settingsService.redisTreeDivider();yield this.socket.request({action:`key/del-tree`,payload:{key:t.key,redisTreeDivider:i}}),this.common.toast(this.i18n.strings().status.treeDeleted({key:t.key}));let r=location.pathname;r.startsWith(`/database/key/`)&&decodeURIComponent(r.slice(14).replace(/~/g,`%`)).startsWith(t.key+i)&&this.navigateTo(`database.statistics`),yield this.cmd.refresh(),this.rebuildTree()}catch(i){this.common.generalHandleError(i)}})}addKey(e,t){return L(this,null,function*(){try{e.stopPropagation();let i=yield this.keyNewOrSetDialog.show({type:`add`,$event:e,node:t._sourceNode??{key:t.key}});yield this.cmd.refresh(),this.rebuildTree(),this.navigateTo(`database.key`,{key:i.key})}catch(i){this.common.generalHandleError(i)}})}extractNodeTooltip(e){if(e.type!==`folder`&&e.keysInfo){let t=this.i18n.strings();return(0,_e.htmlEncode)((t.redisTypes?.[e.keysInfo.type]??e.keysInfo.type)+` - `+e.key)}return(0,_e.htmlEncode)(e.key)}deleteTreeTooltip(e){return this.i18n.strings().confirm?.deleteAllKeys?.({key:e.key})??``}rebuildTree(){this.divider=this.settingsService.redisTreeDivider()??`:`,this.isReadonly=this.state.connection()?.readonly===!0;let e=this.state.paginatedKeys()??[],t=this.state.keysInfo()??{};this.expandedKeys.size===0&&this.restoreExpansion(),this.treeBuilder.keysToTreeControl({keys:e,divider:this.divider,keysInfo:t}).then(({nodes:i})=>{this.hierarchicalNodes=i,this.flattenVisibleNodes(),this.requestViewRefresh()})}flattenVisibleNodes(){let e=[],t=(i,r)=>{for(let c of i)e.push({label:c.label,key:c.key,level:r,expandable:c.type===`folder`,type:c.type,childCount:c.childCount??0,keysInfo:c.keysInfo,_sourceNode:c}),c.type===`folder`&&this.expandedKeys.has(c.key)&&c.children?.length>0&&t(c.children,r+1)};t(this.hierarchicalNodes,0),this.dataSource=e}syncExpandedNodesToGlobal(){let e=[],t=i=>{for(let r of i)r.type===`folder`&&this.expandedKeys.has(r.key)&&e.push(r),r.children?.length>0&&t(r.children)};t(this.hierarchicalNodes),this.expandedNodeObjects=e}syncGlobalState(){this.divider=this.settingsService.redisTreeDivider()??`:`,this.isReadonly=this.state.connection()?.readonly===!0}startPolling(){let e=``,t=setInterval(()=>{let i=JSON.stringify({keysLength:this.state.paginatedKeys()?.length,page:this.state.page(),divider:this.settingsService.redisTreeDivider(),readonly:this.state.connection()?.readonly});i!==e&&(e=i,this.ngZone.run(()=>{this.syncGlobalState(),this.rebuildTree()}))},300);this.unsubs.push(()=>clearInterval(t)),this.ngZone.run(()=>this.rebuildTree())}attachWindowFocusListener(){let e=()=>{this.isEnabled&&this.ngZone.run(()=>{this.isEnabled=!1,setTimeout(()=>{this.isEnabled=!0,this.rebuildTree()})})};window.addEventListener(`focus`,e),this.unsubs.push(()=>window.removeEventListener(`focus`,e))}navigateTo(e,t){this.nav.navigateTo(e,t)}requestViewRefresh(){setTimeout(()=>{try{this.cdr.detectChanges(),this.viewport?.checkViewportSize()}catch(e){}})}static ɵfac=function(t){return new(t||n)(Qe(O),Qe(q),Qe(YQ),Qe(It$1),Qe(T),Qe(bi),Qe(h$1),Qe(b),Qe(P$1),Qe(mc),Qe(je),Qe(Q),Qe(x))};static ɵcmp=Ee({type:n,selectors:[[`p3xr-database-tree`]],viewQuery:function(t,i){if(t&1&&lc(u0,5),t&2){let r;Cf(r=xf())&&(i.viewport=r.first)}},inputs:{p3xrResize:`p3xrResize`,p3xrMainRef:`p3xrMainRef`},decls:1,vars:1,consts:[[`class`,`p3xr-database-tree-viewport`,3,`itemSize`,4,`ngIf`],[1,`p3xr-database-tree-viewport`,3,`itemSize`],[`class`,`p3xr-database-tree-row`,3,`padding-left`,4,`cdkVirtualFor`,`cdkVirtualForOf`,`cdkVirtualForTrackBy`],[1,`p3xr-database-tree-row`],[1,`p3xr-tree-branch-head`,3,`tree-expanded`,`tree-collapsed`],[2,`cursor`,`pointer`],[2,`display`,`inline-flex`,`align-items`,`center`],[`matTooltipPosition`,`right`,`matTooltipClass`,`p3xr-tree-node-tooltip`,1,`p3xr-database-tree-node`,3,`click`,`matTooltip`],[1,`p3xr-database-tree-node-label`],[1,`p3xr-database-tree-node-count`],[`matTooltipPosition`,`right`,`matTooltipClass`,`p3xr-tree-node-tooltip`,1,`p3xr-tree-ttl-badge`,3,`class`,`matTooltip`],[1,`p3xr-database-tree-actions`],[1,`p3xr-tree-branch-head`,3,`click`],[2,`cursor`,`pointer`,3,`click`],[`aria-hidden`,`true`,1,`fas`,`fa-hashtag`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-list-ol`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-list`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-ellipsis-h`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-chart-line`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-stream`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-code`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-chart-area`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-filter`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-trophy`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-chart-simple`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-chart-bar`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-brain`,`p3xr-tree-type-icon`],[`aria-hidden`,`true`,1,`fas`,`fa-layer-group`,`p3xr-tree-type-icon`],[`matTooltipPosition`,`right`,`matTooltipClass`,`p3xr-tree-node-tooltip`,1,`p3xr-tree-ttl-badge`,3,`matTooltip`],[1,`material-icons`,`p3xr-tree-ttl-icon`],[`matTooltipPosition`,`after`,`matTooltipClass`,`p3xr-tree-node-tooltip`,3,`matTooltip`],[1,`material-icons`,`p3xr-database-treecontrol-folder-icon`,3,`click`],[1,`material-icons`,`p3xr-database-treecontrol-delete-icon`,3,`click`]],template:function(t,i){t&1&&hy(0,ai,2,3,`cdk-virtual-scroll-viewport`,0),t&2&&by(`ngIf`,i.dataSource.length>0&&i.isEnabled)},dependencies:[Eb,YN,fp,o0,d0,u0,Qt$1,gt$1],styles:[`p3xr-database-tree{display:block;height:100%;width:100%;overflow:hidden}.p3xr-database-tree-viewport{height:100%;width:100%;scrollbar-width:none;-ms-overflow-style:none}.p3xr-database-tree-viewport::-webkit-scrollbar{width:0;height:0;display:none}.p3xr-database-tree-row{display:flex;align-items:center;height:28px;line-height:28px;white-space:nowrap;cursor:default}.p3xr-tree-branch-head{display:inline-block;font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-size:24px;line-height:28px;width:28px;text-align:center;margin-right:4px;cursor:pointer;color:var(--%NS%p3xr-tree-branch-color)}.p3xr-tree-branch-head.tree-collapsed:before{content:"\\f07b"}.p3xr-tree-branch-head.tree-expanded:before{content:"\\f07c"}.p3xr-tree-type-icon{display:inline-block!important;font-size:14px!important;line-height:28px!important;width:28px!important;text-align:center!important;margin-left:0!important;margin-right:4px!important}.p3xr-database-tree-node{cursor:pointer;display:inline-flex;align-items:center;height:28px;white-space:nowrap}.p3xr-database-tree-node-count{opacity:.5;margin-left:4px}.p3xr-database-treecontrol-folder-icon,.p3xr-database-treecontrol-delete-icon{font-size:18px!important;height:18px!important;width:18px!important;min-width:18px!important;min-height:18px!important;line-height:18px!important;cursor:pointer;vertical-align:middle}.p3xr-database-treecontrol-folder-icon{color:var(--%NS%p3xr-common-warn-color)}.p3xr-database-treecontrol-delete-icon{color:var(--%NS%p3xr-btn-warn-bg)}.p3xr-tree-ttl-badge{display:inline-flex;align-items:center;vertical-align:middle;margin-left:4px;cursor:default;height:28px}.p3xr-tree-ttl-icon{font-size:16px!important;width:16px!important;height:16px!important;vertical-align:middle!important}.p3xr-tree-ttl-green .p3xr-tree-ttl-icon{color:var(--%NS%mat-sys-primary, #4caf50)}.p3xr-tree-ttl-yellow .p3xr-tree-ttl-icon{color:var(--%NS%mat-sys-tertiary, #ff9800)}.p3xr-tree-ttl-red .p3xr-tree-ttl-icon{color:var(--%NS%mat-sys-error, #f44336)}.p3xr-tree-ttl-pulse{animation:p3xr-ttl-pulse 1s infinite}@keyframes p3xr-ttl-pulse{0%,to{opacity:.7}50%{opacity:1}}.p3xr-database-tree-actions{display:inline-flex;align-items:center;position:relative;top:-1px;visibility:hidden}.p3xr-database-tree-row:hover .p3xr-database-tree-actions{visibility:visible}@media(max-width:599px){.p3xr-database-tree-node{display:inline-block}p3xr-database-tree{height:auto;min-height:100px}.p3xr-database-tree-viewport{height:20vh;min-height:100px}}
`],encapsulation:2})}return n})();function si(n,p){if(n&1&&(Wa(0,`div`),_y(1,`p3xr-database-treecontrol-controls`,6)(2,`p3xr-database-tree`,7)(3,`div`,8),Wa(4,`div`,9),_y(5,`router-outlet`),wf()()),n&2){let e=gT(2);Sn(3),vt$1(`p3xr-resizer-active`,e.resizeClicked)}}function li(n,p){n&1&&(Wa(0,`div`,10),_y(1,`p3xr-database-treecontrol-controls`,11)(2,`p3xr-database-tree`,12),Wa(3,`div`,11),_y(4,`router-outlet`),wf()())}function ci(n,p){if(n&1&&(Wa(0,`div`,3),hy(1,si,6,2,`div`,4)(2,li,5,0,`div`,5),wf()),n&2){let e=gT();Sn(),by(`ngIf`,!e.isXs),Sn(),by(`ngIf`,e.isXs)}}var oo=(()=>{class n{ngZone;breakpointObserver;i18n;cmd;nav;socket;cdr;state;settings;strings;isXs=!1;hasConnection=!1;hasConnections=!1;resizerActive=!1;resizeClicked=!1;resizerMouseoverOn=!1;resizeLeft=void 0;static PANEL_WIDTH_KEY=`p3xr-database-panel-width`;screenSizeIsSmall=!1;containerEl;headerEl;footerEl;consoleHeaderEl;resizerEl;resizeObserver;observedElement=null;resizeTimeoutId;unsubs=[];resizeMinWidth;constructor(e,t,i,r,c,_,k,b,x){this.ngZone=e,this.breakpointObserver=t,this.i18n=i,this.cmd=r,this.nav=c,this.socket=_,this.cdr=k,this.state=b,this.settings=x,this.strings=this.i18n.strings,this.resizeMinWidth=this.settings.resizeMinWidth,cr(()=>{this.state.consoleDrawerOpen(),setTimeout(()=>this.rawResize(),160)})}ngOnInit(){this.state.currentPage.set(`database`),this.syncFromGlobal();let e=this.socket.connections$.subscribe(()=>this.syncFromGlobal()),t=this.socket.redisDisconnected$.subscribe(()=>{this.syncFromGlobal(),this.nav.navigateTo(`settings`)}),i=this.socket.configuration$.subscribe(()=>this.syncFromGlobal()),r=this.socket.stateChanged$.subscribe(()=>{this.syncFromGlobal(),setTimeout(()=>this.rawResize(),50)});this.unsubs.push(()=>{e.unsubscribe(),t.unsubscribe(),i.unsubscribe(),r.unsubscribe()});let c=this.breakpointObserver.observe(`(max-width: 599px)`).subscribe(_=>{let k=this.isXs;this.isXs=_.matches,!this.isXs&&k&&(clearTimeout(this.resizeTimeoutId),this.resizeTimeoutId=setTimeout(()=>this.rawResize(),4*this.settings.debounce)),this.screenSizeIsSmall=this.isXs,this.cdr.markForCheck()});this.unsubs.push(()=>c.unsubscribe()),this.ngZone.runOutsideAngular(()=>{setTimeout(()=>this.initDom(),0)})}ngOnDestroy(){this.unsubs.forEach(e=>e()),window.removeEventListener(`resize`,this.boundRawResize),document.removeEventListener(`mousedown`,this.boundOnDocumentMouseDown),this.destroyResizer(),this.resizeObserver?.disconnect()}goSettings(){this.nav.navigateTo(`settings`)}resize=NA(()=>{this.resizeLeft=void 0,this.rawResize()},100);boundRawResize=()=>this.rawResize();boundOnDocumentMouseDown=e=>this.onDocumentMouseDown(e);initDom(){this.containerEl=document.getElementById(`p3xr-database-content`),this.headerEl=document.getElementById(`p3xr-layout-header-container`),this.footerEl=document.getElementById(`p3xr-layout-footer-container`),this.consoleHeaderEl=document.querySelector(`p3xr-database-header`);let e=localStorage.getItem(n.PANEL_WIDTH_KEY);if(e&&this.containerEl){let i=parseInt(e,10);if(!isNaN(i)&&i>=this.resizeMinWidth){let r=this.containerEl.getBoundingClientRect().left;this.resizeLeft=r+i}}this.rawResize(),window.addEventListener(`resize`,this.boundRawResize),document.addEventListener(`mousedown`,this.boundOnDocumentMouseDown),(this.nav.currentUrl===`/database`||this.nav.currentUrl===`/database/`)&&this.nav.navigateTo(`database.statistics`),this.state.redisChanged()&&(this.state.redisChanged.set(!1),this.state.connection()&&this.cmd.refresh()),this.state.page.set(1),setTimeout(()=>this.rawResize(),250),this.resizeObserver=new ResizeObserver(i=>{this.resizeClicked||window.requestAnimationFrame(()=>{!Array.isArray(i)||!i.length||this.rawResize()})}),this.watchResizeObserver();let t=this.socket.stateChanged$.subscribe(()=>this.watchResizeObserver());this.unsubs.push(()=>{t.unsubscribe()})}rawResize(){if(!this.containerEl||!this.headerEl||!this.footerEl||!this.consoleHeaderEl)return;let e=0;for(let D of[this.headerEl,this.footerEl,this.consoleHeaderEl])e+=D.offsetHeight;let t=window.innerHeight,i=11,r=getComputedStyle(document.documentElement).getPropertyValue(`--p3xr-console-drawer-height-active`).trim(),c=0;r.endsWith(`vh`)?c=Math.round(parseFloat(r)/100*t):r.endsWith(`px`)&&(c=parseFloat(r));let _=Math.max(t-e-i-c,100),k=Math.max(_,0);this.containerEl.style.height=k+`px`,this.containerEl.style.maxHeight=k+`px`;let b=this.containerEl.getBoundingClientRect();if(!b||!Number.isFinite(b.height)||!Number.isFinite(b.width))return;let x=Math.max(b.height,0),w=document.getElementById(`p3xr-database-treecontrol-container`);if(w){let D=document.getElementById(`p3xr-database-treecontrol-controls-container`);if(!D){this.destroyResizer();return}let I=D.getBoundingClientRect();w.style.top=b.top+I.height+`px`,w.style.left=b.left+`px`,w.style.height=x-I.height+`px`,w.style.maxHeight=x+`px`,this.resizeLeft!==void 0?w.style.width=this.resizeLeft-b.left+`px`:w.style.width=this.resizeMinWidth+`px`,w.style.minWidth=this.resizeMinWidth+`px`;let z=w.getBoundingClientRect();this.resizerEl||this.decorateResizer();let j=5;this.resizerEl&&(this.resizerEl=document.getElementById(`p3xr-database-content-sizer`),this.resizerEl&&(this.resizerEl.addEventListener(`mouseover`,this.boundResizerMouseover),this.resizerEl.addEventListener(`mouseout`,this.boundResizerMouseout),this.resizerEl.style.top=b.top+`px`,this.resizerEl.style.height=Math.max(x,0)+`px`,this.resizerEl.style.left=b.left+z.width+`px`,this.resizerEl.style.width=`5px`,D.style.width=b.left+z.width+`px`));let G=document.getElementById(`p3xr-database-content-container`);G&&(G.style.top=b.top+`px`,G.style.height=x+`px`,G.style.left=b.left+z.width+j+`px`,G.style.width=b.width-z.width-j+`px`),D.style.width=z.width+`px`}else this.destroyResizer()}boundResizerMouseover=()=>{this.resizerMouseoverOn=!0,this.updateResizerColor()};boundResizerMouseout=()=>{this.resizerMouseoverOn=!1,this.updateResizerColor()};boundResizeClick=e=>this.resizeClick(e);boundDocumentMousemove=e=>this.documentMousemove(e);updateResizerColor(){this.resizerActive=this.resizeClicked||this.resizerMouseoverOn}resizeClick(e){if(!(e.type===`mousedown`&&e.target.id!==`p3xr-database-content-sizer`)){if(e.type===`mousedown`)this.resizeClicked=!0,this.applyDragCursor(`ew-resize`),document.body.classList.add(`p3xr-not-selectable`);else if(e.type===`mouseup`&&(this.clearDragCursor(),this.resizeClicked=!1,document.body.classList.remove(`p3xr-not-selectable`),this.resizeLeft!==void 0&&this.containerEl)){let t=this.containerEl.getBoundingClientRect().left,i=this.resizeLeft-t;i>=this.resizeMinWidth&&localStorage.setItem(n.PANEL_WIDTH_KEY,String(i))}this.resizeClicked||this.rawResize(),e.stopPropagation(),this.updateResizerColor()}}documentMousemove(e){if(!this.resizeClicked||!this.containerEl)return;let t=this.containerEl.getBoundingClientRect();e.clientX<t.left+this.resizeMinWidth||e.clientX>window.innerWidth-this.resizeMinWidth?this.applyDragCursor(`not-allowed`):(this.applyDragCursor(`ew-resize`),this.resizerEl&&(this.resizerEl.style.left=e.clientX+`px`),this.resizeLeft=e.clientX,this.rawResize())}dragStyleEl=null;applyDragCursor(e){this.dragStyleEl||(this.dragStyleEl=document.createElement(`style`),this.dragStyleEl.setAttribute(`data-p3xr-database-drag`,``),document.head.appendChild(this.dragStyleEl)),this.dragStyleEl.textContent=`*, *::before, *::after { cursor: ${e} !important; }`}clearDragCursor(){this.dragStyleEl?.remove(),this.dragStyleEl=null}decorateResizer(){this.resizerEl=document.getElementById(`p3xr-database-content-sizer`)??void 0,this.resizerEl&&(this.resizerEl.addEventListener(`mouseover`,this.boundResizerMouseover),this.resizerEl.addEventListener(`mouseout`,this.boundResizerMouseout),document.addEventListener(`mousemove`,this.boundDocumentMousemove),document.addEventListener(`mousedown`,this.boundResizeClick),document.addEventListener(`mouseup`,this.boundResizeClick))}destroyResizer(){this.resizerEl&&(this.resizerEl.removeEventListener(`mouseover`,this.boundResizerMouseover),this.resizerEl.removeEventListener(`mouseout`,this.boundResizerMouseout),this.resizerEl=void 0),document.removeEventListener(`mousedown`,this.boundResizeClick),document.removeEventListener(`mouseup`,this.boundResizeClick),document.removeEventListener(`mousemove`,this.boundDocumentMousemove)}onDocumentMouseDown(e){}watchResizeObserver(){return L(this,null,function*(){if(this.observedElement&&this.resizeObserver.unobserve(this.observedElement),!this.state.connection())return;if(this.isXs){this.rawResize();return}let e=null;for(;e===null;)e=document.getElementById(`p3xr-database-treecontrol-controls-container`),e||(yield new Promise(t=>setTimeout(t)));this.observedElement=e,this.resizeObserver.observe(this.observedElement)})}syncFromGlobal(){this.hasConnection=this.state.connection()!==void 0,this.hasConnections=(this.state.connections()?.list?.length??0)>0}static ɵfac=function(t){return new(t||n)(Qe(O),Qe(cp),Qe(YQ),Qe(P$1),Qe(b),Qe(bi),Qe(mc),Qe(Q),Qe(x))};static ɵcmp=Ee({type:n,selectors:[[`p3xr-database`]],decls:4,vars:1,consts:[[1,`p3xr-content-border`],[`id`,`p3xr-database-content`,1,`p3xr-database-content-area`,2,`background-color`,`var(--p3xr-content-bg)`,`color`,`var(--mat-app-text-color, inherit)`],[`class`,`p3xr-database-has-connection`,4,`ngIf`],[1,`p3xr-database-has-connection`],[4,`ngIf`],[`style`,`display: flex; flex-direction: column;`,4,`ngIf`],[`id`,`p3xr-database-treecontrol-controls-container`],[`id`,`p3xr-database-treecontrol-container`],[`id`,`p3xr-database-content-sizer`,`role`,`separator`,`aria-orientation`,`vertical`,`aria-label`,`Resize panels`],[`id`,`p3xr-database-content-container`],[2,`display`,`flex`,`flex-direction`,`column`],[2,`flex`,`1`],[`id`,`p3xr-database-treecontrol-container-directive-small`,2,`flex`,`1`]],template:function(t,i){t&1&&(Wa(0,`div`,0),_y(1,`p3xr-database-header`),Wa(2,`div`,1),hy(3,ci,3,2,`div`,2),wf()()),t&2&&(Sn(3),by(`ngIf`,i.hasConnection))},dependencies:[Eb,YN,qo,gr,rt,st,ct],styles:[`@media(max-width:350px){p3xr-database .p3xr-database-toolbar-button-hide-on-small{display:none}}p3xr-database p3xr-database-header,p3xr-database .p3xr-content-border{border-top-left-radius:4px;border-top-right-radius:4px}p3xr-database .p3xr-content-border{border:1px solid var(--%NS%p3xr-accordion-bg);border-bottom-left-radius:4px;border-bottom-right-radius:4px;overflow:hidden}p3xr-database #p3xr-database-treecontrol-container{position:fixed;overflow:auto}p3xr-database #p3xr-database-treecontrol-container-directive-small{display:block;flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overflow-x:auto}p3xr-database .p3xr-database-treecontrol-folder-icon{transform:scale(.75)}p3xr-database #p3xr-database-content-container{position:fixed;overflow:auto;display:block}@media(max-width:959px){p3xr-database #p3xr-database-content{overflow-x:hidden}p3xr-database .p3xr-database-has-connection{display:flex;flex-direction:column;min-height:100%}}#p3xr-database-content-sizer{position:fixed;display:block;cursor:ew-resize;z-index:8;background-color:var(--%NS%p3xr-accordion-bg);transition:background-color .15s ease}body.p3xr-theme-dark #p3xr-database-content-sizer:hover{filter:brightness(1.3)}body.p3xr-theme-dark #p3xr-database-content-sizer.p3xr-resizer-active{filter:brightness(1.6)}body.p3xr-theme-light #p3xr-database-content-sizer:hover{filter:brightness(.85)}body.p3xr-theme-light #p3xr-database-content-sizer.p3xr-resizer-active{filter:brightness(.7)}
`,`:host{display:block}
`],encapsulation:2,changeDetection:1})}return n})();export{oo as DatabaseComponent};