UNPKG

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

3 lines (2 loc) • 31.6 kB
import{a as Le,b as Ae}from"./chunk-YNMELUG5.js";import{a as je}from"./chunk-N6B7O7YA.js";import{a as Pe,c as Fe}from"./chunk-EPMRI4P6.js";import"./chunk-KLZILXP3.js";import{d as Be}from"./chunk-CYCQOADG.js";import"./chunk-DCOXSL4B.js";import"./chunk-IDORGLM3.js";import"./chunk-VQDF6UGR.js";import"./chunk-OTFMRDKW.js";import{a as Ke,b as Ne}from"./chunk-W7VPRHTK.js";import"./chunk-YBLUFXNR.js";import{a as be,c as Ee}from"./chunk-3QQZQR3D.js";import{e as Oe}from"./chunk-TEXSADK3.js";import{a as Me,b as ve}from"./chunk-AN7C4JCR.js";import{c as Ve,d as We}from"./chunk-5ONGW7JF.js";import{a as ne,b as ie,c as le,i as oe,j as ae}from"./chunk-AN3YSLKY.js";import"./chunk-6J2GCUHA.js";import{b as se,f as de,g as ue,h as ce,j as pe,k as _e,l as ge,r as ye,s as fe,t as xe,u as Ce,v as we}from"./chunk-ICUC3WIE.js";import"./chunk-YA4NX3C4.js";import{a as De}from"./chunk-R73GSFUT.js";import{b as re,c as me,d as Te,e as Ie}from"./chunk-VMTBY4VN.js";import{b as he,c as Se}from"./chunk-HFDIHHHN.js";import{a as Y,b as Q,d as Z,e as $,f as ee,g as te}from"./chunk-7JNYLOAK.js";import{$a as j,Bb as m,Cb as d,Da as v,Db as E,Eb as R,Hb as _,Ia as F,Ib as g,Jb as y,Jc as H,Lb as J,Ld as G,Nd as U,Pd as X,Rd as ke,Xa as x,Ya as C,Zb as q,_a as L,ab as A,ba as c,bb as M,ca as p,cb as a,db as o,jb as w,lb as T,nb as s,oc as z,xa as l,xb as I}from"./chunk-KQUCMSSK.js";import"./chunk-FCVD6SGJ.js";import{h as N}from"./chunk-O7S4L63H.js";var Re=r=>({maxValueAsBuffer:r});function Je(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s();l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.key)}}function qe(r,u){if(r&1&&(a(0,"mat-option",10),m(1),o()),r&2){let e,n=u.$implicit,t=s();M("value",n),l(),d(((e=t.strings().redisTypes)==null?null:e[n])||n)}}function ze(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",19),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.index,t)||(i.model.index=t),p(t)}),o()(),a(4,"div",20),m(5),o()}if(r&2){let e,n,t=s();l(2),d((e=t.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.index),l(),_("ngModel",t.model.index),l(2),d((n=t.strings().label)==null?null:n.redisListIndexInfo)}}function He(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.hashKey)}}function Ge(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",21),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.hashKey,t)||(i.model.hashKey=t),p(t)}),o(),x(4,He,2,1,"mat-error"),o()}if(r&2){let e,n=s(),t=I(1);l(2),d((e=n.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.hashKey),l(),_("ngModel",n.model.hashKey),l(),C(t.controls.hashKey!=null&&t.controls.hashKey.invalid&&(t.controls.hashKey!=null&&t.controls.hashKey.touched)?4:-1)}}function Ue(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.score)}}function Xe(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",22),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.score,t)||(i.model.score=t),p(t)}),o(),x(4,Ue,2,1,"mat-error"),o()}if(r&2){let e,n=s(),t=I(1);l(2),d((e=n.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.score),l(),_("ngModel",n.model.score),l(),C(t.controls.score!=null&&t.controls.score.invalid&&(t.controls.score!=null&&t.controls.score.touched)?4:-1)}}function Ye(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.streamTimestamp)}}function Qe(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",23),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.streamTimestamp,t)||(i.model.streamTimestamp=t),p(t)}),o(),x(4,Ye,2,1,"mat-error"),o(),a(5,"div",20),m(6),o()}if(r&2){let e,n,t=s(),i=I(1);l(2),d((e=t.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.streamTimestamp),l(),_("ngModel",t.model.streamTimestamp),l(),C(i.controls.streamTimestamp!=null&&i.controls.streamTimestamp.invalid&&(i.controls.streamTimestamp!=null&&i.controls.streamTimestamp.touched)?4:-1),l(2),d((n=t.strings().label)==null?null:n.streamTimestampId)}}function Ze(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",26),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsRetention,t)||(i.model.tsRetention=t),p(t)}),o(),a(4,"mat-hint"),m(5),o()(),a(6,"mat-form-field",7)(7,"mat-label"),m(8),o(),a(9,"mat-select",27),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsDuplicatePolicy,t)||(i.model.tsDuplicatePolicy=t),p(t)}),a(10,"mat-option",28),m(11,"LAST"),o(),a(12,"mat-option",29),m(13,"FIRST"),o(),a(14,"mat-option",30),m(15,"MIN"),o(),a(16,"mat-option",31),m(17,"MAX"),o(),a(18,"mat-option",32),m(19,"SUM"),o(),a(20,"mat-option",33),m(21,"BLOCK"),o()()()}if(r&2){let e,n,t,i=s(2);l(2),E("",(e=i.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.retention," (ms)"),l(),_("ngModel",i.model.tsRetention),l(2),d((n=i.strings().page)==null||n.key==null||n.key.timeseries==null?null:n.key.timeseries.retentionHint),l(3),d((t=i.strings().page)==null||t.key==null||t.key.timeseries==null?null:t.key.timeseries.duplicatePolicy),l(),_("ngModel",i.model.tsDuplicatePolicy)}}function $e(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",34),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsTimestamp,t)||(i.model.tsTimestamp=t),p(t)}),o(),a(4,"mat-hint"),m(5),o()()}if(r&2){let e,n,t=s(2);l(2),d((e=t.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.timestamp),l(),_("ngModel",t.model.tsTimestamp),M("disabled",t.model.originalTimestamp!==void 0),l(2),d((n=t.strings().page)==null||n.key==null||n.key.timeseries==null?null:n.key.timeseries.timestampHint)}}function et(r,u){if(r&1){let e=w();a(0,"mat-slide-toggle",35),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsBulkMode,t)||(i.model.tsBulkMode=t),p(t)}),m(1),o()}if(r&2){let e,n=s(2);_("ngModel",n.model.tsBulkMode),l(),E(" ",(e=n.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.bulkMode," ")}}function tt(r,u){if(r&1){let e=w();x(0,Ze,22,5),a(1,"mat-form-field",7)(2,"mat-label"),m(3),o(),a(4,"input",24),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.tsLabels,t)||(i.model.tsLabels=t),p(t)}),o(),a(5,"mat-hint"),m(6),o()(),x(7,$e,6,4,"mat-form-field",7),x(8,et,2,2,"mat-slide-toggle",25)}if(r&2){let e,n,t=s();C(t.options.type==="add"?0:-1),l(3),d((e=t.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.labels),l(),_("ngModel",t.model.tsLabels),l(2),d((n=t.strings().page)==null||n.key==null||n.key.timeseries==null?null:n.key.timeseries.labelsHint),l(),C(t.model.tsBulkMode?-1:7),l(),C(t.model.originalTimestamp===void 0?8:-1)}}function nt(r,u){if(r&1){let e=w();a(0,"div",11)(1,"mat-form-field",36)(2,"mat-label"),m(3),o(),a(4,"input",37),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.bloomErrorRate,t)||(i.model.bloomErrorRate=t),p(t)}),o()(),a(5,"mat-form-field",36)(6,"mat-label"),m(7),o(),a(8,"input",38),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.bloomCapacity,t)||(i.model.bloomCapacity=t),p(t)}),o()()()}if(r&2){let e,n,t=s();l(3),d((e=t.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.errorRate),l(),_("ngModel",t.model.bloomErrorRate),l(3),d((n=t.strings().form)==null||n.key==null||n.key.field==null?null:n.key.field.capacity),l(),_("ngModel",t.model.bloomCapacity)}}function it(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",39),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.cuckooCapacity,t)||(i.model.cuckooCapacity=t),p(t)}),o()()}if(r&2){let e,n=s();l(2),d((e=n.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.capacity),l(),_("ngModel",n.model.cuckooCapacity)}}function lt(r,u){if(r&1){let e=w();a(0,"div",11)(1,"mat-form-field",40)(2,"mat-label"),m(3,"Top K"),o(),a(4,"input",41),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.topkK,t)||(i.model.topkK=t),p(t)}),o()(),a(5,"mat-form-field",40)(6,"mat-label"),m(7),o(),a(8,"input",42),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.topkWidth,t)||(i.model.topkWidth=t),p(t)}),o()(),a(9,"mat-form-field",40)(10,"mat-label"),m(11),o(),a(12,"input",43),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.topkDepth,t)||(i.model.topkDepth=t),p(t)}),o()(),a(13,"mat-form-field",40)(14,"mat-label"),m(15),o(),a(16,"input",44),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.topkDecay,t)||(i.model.topkDecay=t),p(t)}),o()()()}if(r&2){let e,n,t,i=s();l(4),_("ngModel",i.model.topkK),l(3),d((e=i.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.width),l(),_("ngModel",i.model.topkWidth),l(3),d((n=i.strings().form)==null||n.key==null||n.key.field==null?null:n.key.field.depth),l(),_("ngModel",i.model.topkDepth),l(3),d((t=i.strings().form)==null||t.key==null||t.key.field==null?null:t.key.field.decay),l(),_("ngModel",i.model.topkDecay)}}function ot(r,u){if(r&1){let e=w();a(0,"div",11)(1,"mat-form-field",36)(2,"mat-label"),m(3),o(),a(4,"input",45),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.cmsWidth,t)||(i.model.cmsWidth=t),p(t)}),o()(),a(5,"mat-form-field",36)(6,"mat-label"),m(7),o(),a(8,"input",46),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.cmsDepth,t)||(i.model.cmsDepth=t),p(t)}),o()()()}if(r&2){let e,n,t=s();l(3),d((e=t.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.width),l(),_("ngModel",t.model.cmsWidth),l(3),d((n=t.strings().form)==null||n.key==null||n.key.field==null?null:n.key.field.depth),l(),_("ngModel",t.model.cmsDepth)}}function at(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",47),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.tdigestCompression,t)||(i.model.tdigestCompression=t),p(t)}),o()()}if(r&2){let e,n=s();l(2),d((e=n.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.compression),l(),_("ngModel",n.model.tdigestCompression)}}function rt(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",48),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.vectorElement,t)||(i.model.vectorElement=t),p(t)}),o()(),a(4,"mat-form-field",7)(5,"mat-label"),m(6),o(),a(7,"input",49),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.vectorValues,t)||(i.model.vectorValues=t),p(t)}),o()()}if(r&2){let e,n,t=s();l(2),d((e=t.strings().page)==null||e.key==null||e.key.vectorset==null?null:e.key.vectorset.elementName),l(),_("ngModel",t.model.vectorElement),l(3),d((n=t.strings().page)==null||n.key==null||n.key.vectorset==null?null:n.key.vectorset.vectorValues),l(),_("ngModel",t.model.vectorValues)}}function mt(r,u){if(r&1&&(a(0,"span"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().intention)==null?null:e.setBuffer)}}function st(r,u){if(r&1){let e=w();a(0,"button",50),T("click",function(){c(e),s();let t=I(32);return p(t.click())}),a(1,"mat-icon"),m(2,"upload"),o(),x(3,mt,2,1,"span"),o()}if(r&2){let e,n=s();M("matTooltip",n.isWide?"":(e=n.strings().intention)==null?null:e.setBuffer),l(3),C(n.isWide?3:-1)}}function dt(r,u){if(r&1&&(a(0,"span"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().intention)==null?null:e.jsonViewEditor)}}function ut(r,u){if(r&1&&(a(0,"span"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().intention)==null?null:e.formatJson)}}function ct(r,u){if(r&1&&(a(0,"span"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().intention)==null?null:e.jsonViewShow)}}function pt(r,u){if(r&1){let e=w();a(0,"button",50),T("click",function(){c(e);let t=s();return p(t.openJsonEditor())}),a(1,"mat-icon"),m(2,"description"),o(),x(3,dt,2,1,"span"),o(),a(4,"button",50),T("click",function(){c(e);let t=s();return p(t.formatJson())}),a(5,"mat-icon"),m(6,"format_line_spacing"),o(),x(7,ut,2,1,"span"),o(),a(8,"button",15),T("click",function(){c(e);let t=s();return p(t.openJsonViewer())}),a(9,"mat-icon"),m(10,"account_tree"),o(),x(11,ct,2,1,"span"),o()}if(r&2){let e,n,t,i=s();M("matTooltip",i.isWide?"":(e=i.strings().intention)==null?null:e.jsonViewEditor),l(3),C(i.isWide?3:-1),l(),M("matTooltip",i.isWide?"":(n=i.strings().intention)==null?null:n.formatJson),l(3),C(i.isWide?7:-1),l(),M("matTooltip",i.isWide?"":(t=i.strings().intention)==null?null:t.jsonViewShow),l(3),C(i.isWide?11:-1)}}function _t(r,u){if(r&1&&(a(0,"span"),m(1),o()),r&2){let e,n=s();l(),d((e=n.strings().intention)==null?null:e.copy)}}function gt(r,u){if(r&1&&(a(0,"div",20),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().label)==null?null:e.streamValue)}}function yt(r,u){if(r&1&&(a(0,"div",20),m(1),o()),r&2){let e,n=s(2);l(),R(" ",(e=n.strings().label)==null||e.isBuffer==null?null:e.isBuffer(J(2,Re,n.getMaxValueAsBufferText()))," ",n.bufferDisplay(n.model.value)," ")}}function ft(r,u){if(r&1){let e=w();a(0,"mat-slide-toggle",51),y("ngModelChange",function(t){c(e);let i=s();return g(i.validateJson,t)||(i.validateJson=t),p(t)}),m(1),o(),x(2,gt,2,1,"div",20),x(3,yt,2,4,"div",20)}if(r&2){let e,n=s();_("ngModel",n.validateJson),l(),E(" ",(e=n.strings().label)==null?null:e.validateJson," "),l(),C(n.model.type==="stream"?2:-1),l(),C(n.isBuffer?3:-1)}}function xt(r,u){if(r&1&&(a(0,"span"),m(1),o()),r&2){let e,n=s(3);l(),d((e=n.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.generate)}}function Ct(r,u){if(r&1){let e=w();a(0,"div",52)(1,"mat-form-field",64)(2,"mat-label"),m(3),o(),a(4,"input",65),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsFormulaPoints,t)||(i.model.tsFormulaPoints=t),p(t)}),o()(),a(5,"mat-form-field",64)(6,"mat-label"),m(7),o(),a(8,"input",66),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsFormulaAmplitude,t)||(i.model.tsFormulaAmplitude=t),p(t)}),o()(),a(9,"mat-form-field",64)(10,"mat-label"),m(11),o(),a(12,"input",67),y("ngModelChange",function(t){c(e);let i=s(2);return g(i.model.tsFormulaOffset,t)||(i.model.tsFormulaOffset=t),p(t)}),o()(),a(13,"button",68),T("click",function(){c(e);let t=s(2);return p(t.generateFormula())}),a(14,"mat-icon"),m(15,"auto_graph"),o(),x(16,xt,2,1,"span"),o()()}if(r&2){let e,n,t,i=s(2);l(3),d((e=i.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.formulaPoints),l(),_("ngModel",i.model.tsFormulaPoints),l(3),d((n=i.strings().page)==null||n.key==null||n.key.timeseries==null?null:n.key.timeseries.formulaAmplitude),l(),_("ngModel",i.model.tsFormulaAmplitude),l(3),d((t=i.strings().page)==null||t.key==null||t.key.timeseries==null?null:t.key.timeseries.formulaOffset),l(),_("ngModel",i.model.tsFormulaOffset),l(4),C(i.isWide?16:-1)}}function wt(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.value)}}function ht(r,u){if(r&1){let e=w();a(0,"div",52)(1,"mat-form-field",53)(2,"mat-label"),m(3),o(),a(4,"mat-select",54),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.tsSpread,t)||(i.model.tsSpread=t),p(t)}),a(5,"mat-option",10),m(6),o(),a(7,"mat-option",10),m(8),o(),a(9,"mat-option",10),m(10),o(),a(11,"mat-option",10),m(12),o(),a(13,"mat-option",10),m(14),o(),a(15,"mat-option",10),m(16),o()()(),a(17,"mat-form-field",55)(18,"mat-label"),m(19),o(),a(20,"mat-select",56),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.tsFormula,t)||(i.model.tsFormula=t),p(t)}),a(21,"mat-option",57),m(22),o(),a(23,"mat-option",58),m(24,"sin"),o(),a(25,"mat-option",59),m(26,"cos"),o(),a(27,"mat-option",60),m(28),o(),a(29,"mat-option",61),m(30),o(),a(31,"mat-option",62),m(32),o()()()(),x(33,Ct,17,7,"div",52),a(34,"mat-form-field",7)(35,"mat-label"),m(36),o(),a(37,"textarea",63),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.value,t)||(i.model.value=t),p(t)}),o(),a(38,"mat-hint"),m(39),o(),x(40,wt,2,1,"mat-error"),o()}if(r&2){let e,n,t,i,h,f,b,S,D,V,W,O,K,B,k=s(),P=I(1);l(3),d((e=k.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.autoSpread),l(),_("ngModel",k.model.tsSpread),l(),M("value",1e3),l(),E("1 ",(n=k.strings().time)==null?null:n.second),l(),M("value",3e4),l(),E("30 ",(t=k.strings().time)==null?null:t.seconds),l(),M("value",6e4),l(),E("1 ",(i=k.strings().time)==null?null:i.minute),l(),M("value",18e5),l(),E("30 ",(h=k.strings().time)==null?null:h.minutes),l(),M("value",36e5),l(),E("1 ",(f=k.strings().time)==null?null:f.hour),l(),M("value",864e5),l(),E("24 ",(b=k.strings().time)==null?null:b.hours),l(3),d((S=k.strings().page)==null||S.key==null||S.key.timeseries==null?null:S.key.timeseries.formula),l(),_("ngModel",k.model.tsFormula),l(2),d((D=k.strings().page)==null||D.key==null||D.key.timeseries==null?null:D.key.timeseries.none),l(6),d((V=k.strings().page)==null||V.key==null||V.key.timeseries==null?null:V.key.timeseries.formulaLinear),l(2),d((W=k.strings().page)==null||W.key==null||W.key.timeseries==null?null:W.key.timeseries.formulaRandom),l(2),d((O=k.strings().page)==null||O.key==null||O.key.timeseries==null?null:O.key.timeseries.formulaSawtooth),l(),C(k.model.tsFormula?33:-1),l(3),d((K=k.strings().page)==null||K.key==null||K.key.timeseries==null?null:K.key.timeseries.dataPoints),l(),_("ngModel",k.model.value),l(2),d((B=k.strings().page)==null||B.key==null||B.key.timeseries==null?null:B.key.timeseries.editAllHint),l(),C(P.controls.value!=null&&P.controls.value.invalid&&(P.controls.value!=null&&P.controls.value.touched)?40:-1)}}function St(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.value)}}function kt(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"input",69),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.value,t)||(i.model.value=t),p(t)}),o(),x(4,St,2,1,"mat-error"),o()}if(r&2){let e,n=s(),t=I(1);l(2),d((e=n.strings().page)==null||e.key==null||e.key.timeseries==null?null:e.key.timeseries.value),l(),_("ngModel",n.model.value),l(),C(t.controls.value!=null&&t.controls.value.invalid&&(t.controls.value!=null&&t.controls.value.touched)?4:-1)}}function Mt(r,u){if(r&1&&(a(0,"mat-error"),m(1),o()),r&2){let e,n=s(2);l(),d((e=n.strings().form)==null||e.key==null||e.key.error==null?null:e.key.error.value)}}function vt(r,u){if(r&1){let e=w();a(0,"mat-form-field",7)(1,"mat-label"),m(2),o(),a(3,"textarea",70),y("ngModelChange",function(t){c(e);let i=s();return g(i.model.value,t)||(i.model.value=t),p(t)}),o(),x(4,Mt,2,1,"mat-error"),o()}if(r&2){let e,n=s(),t=I(1);l(2),d((e=n.strings().form)==null||e.key==null||e.key.field==null?null:e.key.field.value),l(),_("ngModel",n.model.value),l(),C(t.controls.value!=null&&t.controls.value.invalid&&(t.controls.value!=null&&t.controls.value.touched)?4:-1)}}function bt(r,u){if(r&1&&(a(0,"button",18)(1,"mat-icon"),m(2),o(),m(3),o()),r&2){let e,n=s();l(2),d(n.options.type==="edit"?"edit":"add"),l(),E(" ",n.options.type==="edit"?(e=n.strings().intention)==null?null:e.save:(e=n.strings().intention)==null?null:e.add," ")}}var un=(()=>{class r{dialogRef;data;i18n;common;socket;jsonViewDialog;jsonEditorDialog;breakpointObserver;cdr;state;settings;overlay;diffDialog;model={};options;get types(){let e=["string","list","hash","set","zset","stream"];return this.state.hasTimeSeries()&&e.push("timeseries"),this.state.hasReJSON()&&e.push("json"),this.state.hasBloom()&&e.push("bloom","cuckoo","topk","cms","tdigest"),e.push("vectorset"),e}static PROBABILISTIC_TYPES=["bloom","cuckoo","topk","cms","tdigest"];isProbabilisticType(){return r.PROBABILISTIC_TYPES.includes(this.model.type)||this.model.type==="vectorset"}validateJson=!1;isReadonly=!1;isBuffer=!1;isWide=window.innerWidth>=720;strings;constructor(e,n,t,i,h,f,b,S,D,V,W,O,K){this.dialogRef=e,this.data=n,this.i18n=t,this.common=i,this.socket=h,this.jsonViewDialog=f,this.jsonEditorDialog=b,this.breakpointObserver=S,this.cdr=D,this.state=V,this.settings=W,this.overlay=O,this.diffDialog=K,this.strings=this.i18n.strings,this.options=n}ngOnInit(){this.isReadonly=this.state.connection()?.readonly===!0,this.breakpointObserver.observe("(min-width: 720px)").subscribe(e=>{this.isWide=e.matches,this.cdr.markForCheck()}),this.model={type:"string",key:this.data.node?.key?this.data.node.key+(this.settings.redisTreeDivider()??":"):"",value:void 0,score:void 0,streamTimestamp:void 0,tsTimestamp:void 0,tsRetention:0,tsDuplicatePolicy:"LAST",tsLabels:"",tsBulkMode:!1,tsSpread:6e4,tsFormula:"",tsFormulaPoints:25,tsFormulaAmplitude:100,tsFormulaOffset:0,hashKey:void 0,index:void 0,bloomErrorRate:.01,bloomCapacity:100,cuckooCapacity:1024,topkK:10,topkWidth:2e3,topkDepth:7,topkDecay:.9,cmsWidth:2e3,cmsDepth:7,tdigestCompression:100,vectorElement:"",vectorValues:""},this.data.model&&Object.assign(this.model,this.data.model),this.isBuffer=typeof this.model.value=="object"&&this.model.value!==null}getTitle(){let e=this.strings();return this.options.type==="edit"?e.form?.key?.label?.formName?.edit:this.options.type==="append"?e.form?.key?.label?.formName?.append:e.form?.key?.label?.formName?.add}getMaxValueAsBufferText(){try{return this.settings.prettyBytes(this.settings.maxValueAsBuffer)}catch(e){return`${this.settings.maxValueAsBuffer} bytes`}}bufferDisplay(e){return e?.byteLength!==void 0?"("+this.settings.prettyBytes(e.byteLength)+")":""}copy(){return N(this,null,function*(){let e=this.model.value;this.model.type==="timeseries"&&(e=`TS.ADD ${this.model.key} ${this.model.tsTimestamp||"*"} ${this.model.value}`),yield this.settings.clipboard(e),this.common.toast(this.strings().status?.dataCopied)})}openJsonViewer(){return N(this,null,function*(){yield this.jsonViewDialog.show({value:this.model.value})})}openJsonEditor(){return N(this,null,function*(){try{let e=yield this.jsonEditorDialog.show({value:this.model.value});this.model.value=e.obj}catch(e){}})}formatJson(){try{this.model.value=JSON.stringify(JSON.parse(this.model.value),null,this.settings.jsonFormat()??2)}catch(e){this.common.toast(this.strings().label?.jsonViewNotParsable)}}onFileSelected(e){return N(this,null,function*(){let n=e.target,t=n.files?.[0];if(t){try{yield this.common.confirm({message:this.strings().confirm?.uploadBuffer});let i=yield t.arrayBuffer();this.model.value=i,this.isBuffer=!0,this.common.toast(this.strings().confirm?.uploadBufferDone)}catch(i){}n.value=""}})}submit(){return N(this,null,function*(){if(!this.model.key||this.model.key.trim().length===0){this.common.toast(this.strings().form?.key?.error?.key);return}if(this.validateJson)try{JSON.parse(this.model.value)}catch(e){this.common.toast(this.strings().label?.jsonViewNotParsable);return}try{if(this.data.model?.value!==void 0&&this.data.model.value!==this.model.value&&!(yield this.diffDialog.show({keyName:this.model.key,fieldName:this.model.hashKey||void 0,oldValue:String(this.data.model.value),newValue:String(this.model.value)})))return;this.overlay.show();let e=yield this.socket.request({action:"key/new-or-set",payload:{type:this.options.type,originalValue:this.data.model?.value,originalHashKey:this.data.model?.hashKey,model:structuredClone(this.model)}});typeof window.gtag=="function"&&window.gtag("config",this.settings.googleAnalytics,{page_path:"/key-new-or-set"}),this.common.toast(this.strings().status?.set),this.dialogRef.close(e)}catch(e){this.common.generalHandleError(e)}finally{this.overlay.hide()}})}generateFormula(){let e=Math.min(Math.max(parseInt(this.model.tsFormulaPoints)||25,1),1e4),n=parseFloat(this.model.tsFormulaAmplitude)||100,t=parseFloat(this.model.tsFormulaOffset)||0,i=this.model.tsFormula,h=[];for(let f=0;f<e;f++){let b=f/e,S;switch(i){case"sin":S=Math.sin(b*Math.PI*2)*n+t;break;case"cos":S=Math.cos(b*Math.PI*2)*n+t;break;case"linear":S=b*n+t;break;case"random":S=Math.random()*n+t;break;case"sawtooth":S=b%.25*4*n+t;break;default:S=t}h.push(`* ${parseFloat(S.toFixed(4))}`)}this.model.value=h.join(` `)}cancel(){this.dialogRef.close(void 0)}static \u0275fac=function(n){return new(n||r)(v(Y),v(Q),v(ke),v(Oe),v(Ee),v(Le),v(Ae),v(H),v(q),v(ve),v(Me),v(be),v(je))};static \u0275cmp=F({type:r,selectors:[["p3xr-key-new-or-set-dialog"]],decls:47,vars:16,consts:[["keyForm","ngForm"],["fileInput",""],["novalidate","",3,"ngSubmit"],[1,"p3xr-dialog-toolbar","p3xr-mat-layout-strong"],["mat-dialog-title","",1,"p3xr-dialog-title"],["mat-icon-button","","type","button",3,"click"],[1,"p3xr-dialog-content"],[1,"full-width"],["matInput","","required","","minlength","1","name","key",3,"ngModelChange","ngModel","disabled"],["name","type",3,"ngModelChange","ngModel","disabled"],[3,"value"],[2,"display","flex","gap","16px","flex-wrap","wrap"],["type","file",2,"display","none",3,"change"],["mat-raised-button","","type","button",1,"btn-primary","p3xr-action-btn",3,"matTooltip"],[2,"margin","8px 0"],["mat-raised-button","","type","button",1,"btn-accent","p3xr-action-btn",3,"click","matTooltip"],[1,"p3xr-dialog-actions"],[3,"cancel"],["mat-raised-button","","type","submit",1,"btn-primary"],["matInput","","type","number","step","1","name","index",3,"ngModelChange","ngModel"],[1,"info-text"],["matInput","","required","","minlength","1","name","hashKey",3,"ngModelChange","ngModel"],["matInput","","type","number","required","","name","score",3,"ngModelChange","ngModel"],["matInput","","required","","name","streamTimestamp",3,"ngModelChange","ngModel"],["matInput","","name","tsLabels",3,"ngModelChange","ngModel"],["name","tsBulkMode",2,"display","block","margin","8px 0",3,"ngModel"],["matInput","","type","number","name","tsRetention",3,"ngModelChange","ngModel"],["name","tsDuplicatePolicy",3,"ngModelChange","ngModel"],["value","LAST"],["value","FIRST"],["value","MIN"],["value","MAX"],["value","SUM"],["value","BLOCK"],["matInput","","name","tsTimestamp",3,"ngModelChange","ngModel","disabled"],["name","tsBulkMode",2,"display","block","margin","8px 0",3,"ngModelChange","ngModel"],[2,"flex","1","min-width","140px"],["matInput","","type","number","step","0.001","name","bloomErrorRate","placeholder","0.01 = 1%",3,"ngModelChange","ngModel"],["matInput","","type","number","name","bloomCapacity",3,"ngModelChange","ngModel"],["matInput","","type","number","name","cuckooCapacity",3,"ngModelChange","ngModel"],[2,"flex","1","min-width","100px"],["matInput","","type","number","name","topkK",3,"ngModelChange","ngModel"],["matInput","","type","number","name","topkWidth",3,"ngModelChange","ngModel"],["matInput","","type","number","name","topkDepth",3,"ngModelChange","ngModel"],["matInput","","type","number","step","0.1","name","topkDecay",3,"ngModelChange","ngModel"],["matInput","","type","number","name","cmsWidth",3,"ngModelChange","ngModel"],["matInput","","type","number","name","cmsDepth",3,"ngModelChange","ngModel"],["matInput","","type","number","name","tdigestCompression",3,"ngModelChange","ngModel"],["matInput","","name","vectorElement",3,"ngModelChange","ngModel"],["matInput","","name","vectorValues","placeholder","0.1, 0.2, 0.3",3,"ngModelChange","ngModel"],["mat-raised-button","","type","button",1,"btn-primary","p3xr-action-btn",3,"click","matTooltip"],["name","validateJson",2,"display","block","margin","8px 0",3,"ngModelChange","ngModel"],[2,"display","flex","flex-wrap","wrap","gap","12px","align-items","center","margin-bottom","8px"],["subscriptSizing","dynamic",2,"min-width","140px","flex","1"],["name","tsSpread",3,"ngModelChange","ngModel"],["subscriptSizing","dynamic",2,"min-width","120px","flex","1"],["name","tsFormula",3,"ngModelChange","ngModel"],["value",""],["value","sin"],["value","cos"],["value","linear"],["value","random"],["value","sawtooth"],["matInput","","required","","name","value","rows","10",2,"font-family","'Roboto Mono', monospace","font-size","13px",3,"ngModelChange","ngModel"],["subscriptSizing","dynamic",2,"min-width","80px","flex","1"],["matInput","","type","number","name","tsFormulaPoints","min","1","max","10000",3,"ngModelChange","ngModel"],["matInput","","type","number","name","tsFormulaAmplitude",3,"ngModelChange","ngModel"],["matInput","","type","number","name","tsFormulaOffset",3,"ngModelChange","ngModel"],["mat-raised-button","","type","button",1,"btn-accent","p3xr-action-btn",3,"click"],["matInput","","type","number","required","","name","value",3,"ngModelChange","ngModel"],["matInput","","required","","name","value","rows","5",3,"ngModelChange","ngModel"]],template:function(n,t){if(n&1){let i=w();a(0,"form",2,0),T("ngSubmit",function(){return t.submit()}),a(2,"mat-toolbar",3)(3,"span",4),m(4),o(),a(5,"button",5),T("click",function(){return t.cancel()}),a(6,"mat-icon"),m(7,"close"),o()()(),a(8,"mat-dialog-content",6)(9,"mat-form-field",7)(10,"mat-label"),m(11),o(),a(12,"input",8),y("ngModelChange",function(f){return c(i),g(t.model.key,f)||(t.model.key=f),p(f)}),o(),x(13,Je,2,1,"mat-error"),o(),a(14,"mat-form-field",7)(15,"mat-label"),m(16),o(),a(17,"mat-select",9),y("ngModelChange",function(f){return c(i),g(t.model.type,f)||(t.model.type=f),p(f)}),j(18,qe,2,2,"mat-option",10,L),o()(),x(20,ze,6,3)(21,Ge,5,3,"mat-form-field",7)(22,Xe,5,3,"mat-form-field",7)(23,Qe,7,4)(24,tt,9,6)(25,nt,9,4,"div",11)(26,it,4,2,"mat-form-field",7)(27,lt,17,7,"div",11)(28,ot,9,4,"div",11)(29,at,4,2,"mat-form-field",7)(30,rt,8,4),a(31,"input",12,1),T("change",function(f){return t.onFileSelected(f)}),o(),x(33,st,4,2,"button",13),x(34,pt,12,6),a(35,"div",14)(36,"button",15),T("click",function(){return t.copy()}),a(37,"mat-icon"),m(38,"content_copy"),o(),x(39,_t,2,1,"span"),o()(),x(40,ft,4,4),x(41,ht,41,25)(42,kt,5,3,"mat-form-field",7)(43,vt,5,3,"mat-form-field",7),o(),a(44,"mat-dialog-actions",16)(45,"p3xr-dialog-cancel",17),T("cancel",function(){return t.cancel()}),o(),x(46,bt,4,2,"button",18),o()()}if(n&2){let i,h,f,b,S=I(1);l(4),E(" ",t.getTitle()," "),l(7),d((i=t.strings().form)==null||i.key==null||i.key.field==null?null:i.key.field.key),l(),_("ngModel",t.model.key),M("disabled",t.options.type!=="add"),l(),C(S.controls.key!=null&&S.controls.key.invalid&&(S.controls.key!=null&&S.controls.key.touched)?13:-1),l(3),d((h=t.strings().form)==null||h.key==null||h.key.field==null?null:h.key.field.type),l(),_("ngModel",t.model.type),M("disabled",t.options.type!=="add"),l(),A(t.types),l(2),C((f=t.model.type)==="list"?20:f==="hash"?21:f==="zset"?22:f==="stream"?23:f==="timeseries"?24:f==="bloom"?25:f==="cuckoo"?26:f==="topk"?27:f==="cms"?28:f==="tdigest"?29:f==="vectorset"?30:-1),l(13),C(t.model.type!=="stream"&&t.model.type!=="timeseries"&&!t.isProbabilisticType()?33:-1),l(),C(t.model.type!=="timeseries"&&!t.isProbabilisticType()?34:-1),l(2),M("matTooltip",t.isWide?"":(b=t.strings().intention)==null?null:b.copy),l(3),C(t.isWide?39:-1),l(),C(t.model.type!=="timeseries"&&!t.isProbabilisticType()?40:-1),l(),C(t.model.type==="timeseries"&&(t.model.tsEditAll||t.model.tsBulkMode)?41:t.model.type==="timeseries"&&!t.model.tsBulkMode?42:t.isProbabilisticType()?-1:43),l(5),C(t.isReadonly?-1:46)}},dependencies:[z,we,_e,se,ge,de,ue,xe,Ce,fe,ye,pe,ce,te,Z,ee,$,ae,oe,ne,le,ie,We,Ve,Fe,Pe,Be,Ne,Ke,X,U,G,Se,he,Ie,Te,me,re,De],styles:[".full-width[_ngcontent-%COMP%]{width:100%}.info-text[_ngcontent-%COMP%]{opacity:.5;font-size:12px;margin-bottom:8px}.hide-sm[_ngcontent-%COMP%]{display:inline}@media(max-width:959px){.hide-sm[_ngcontent-%COMP%]{display:none}}"]})}return r})();export{un as KeyNewOrSetDialogComponent};