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
1 lines • 7.04 kB
JavaScript
import{t as e}from"./i18n.store-B4krJCIS.js";import"./_plugin-vue_export-helper-67n0yneU.js";import{n as t}from"./redis-state.store-DPDs81ZS.js";import{t as n}from"./common.store-C_dWn4yG.js";import"./index-CBO402jT.js";function r(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return t.length<4?{ext:`bin`,mime:`application/octet-stream`}:t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71?{ext:`png`,mime:`image/png`}:t[0]===255&&t[1]===216&&t[2]===255?{ext:`jpg`,mime:`image/jpeg`}:t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56?{ext:`gif`,mime:`image/gif`}:t[0]===66&&t[1]===77?{ext:`bmp`,mime:`image/bmp`}:t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t.length>=12&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80?{ext:`webp`,mime:`image/webp`}:t[0]===73&&t[1]===73&&t[2]===42&&t[3]===0||t[0]===77&&t[1]===77&&t[2]===0&&t[3]===42?{ext:`tiff`,mime:`image/tiff`}:t[0]===0&&t[1]===0&&t[2]===1&&t[3]===0?{ext:`ico`,mime:`image/x-icon`}:t[0]===37&&t[1]===80&&t[2]===68&&t[3]===70?{ext:`pdf`,mime:`application/pdf`}:t[0]===80&&t[1]===75&&t[2]===3&&t[3]===4?{ext:`zip`,mime:`application/zip`}:t[0]===31&&t[1]===139?{ext:`gz`,mime:`application/gzip`}:t[0]===66&&t[1]===90&&t[2]===104?{ext:`bz2`,mime:`application/x-bzip2`}:t[0]===253&&t[1]===55&&t[2]===122&&t[3]===88&&t.length>=6&&t[4]===90&&t[5]===0?{ext:`xz`,mime:`application/x-xz`}:t[0]===40&&t[1]===181&&t[2]===47&&t[3]===253?{ext:`zst`,mime:`application/zstd`}:t[0]===4&&t[1]===34&&t[2]===77&&t[3]===24?{ext:`lz4`,mime:`application/x-lz4`}:t[0]===55&&t[1]===122&&t[2]===188&&t[3]===175&&t.length>=6&&t[4]===39&&t[5]===28?{ext:`7z`,mime:`application/x-7z-compressed`}:t[0]===82&&t[1]===97&&t[2]===114&&t[3]===33?{ext:`rar`,mime:`application/x-rar-compressed`}:t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t.length>=12&&t[8]===87&&t[9]===65&&t[10]===86&&t[11]===69?{ext:`wav`,mime:`audio/wav`}:t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t.length>=12&&t[8]===65&&t[9]===86&&t[10]===73&&t[11]===32?{ext:`avi`,mime:`video/x-msvideo`}:t[0]===255&&(t[1]===251||t[1]===243||t[1]===242)||t[0]===73&&t[1]===68&&t[2]===51?{ext:`mp3`,mime:`audio/mpeg`}:t[0]===102&&t[1]===76&&t[2]===97&&t[3]===67?{ext:`flac`,mime:`audio/flac`}:t[0]===79&&t[1]===103&&t[2]===103&&t[3]===83?{ext:`ogg`,mime:`audio/ogg`}:t[0]===26&&t[1]===69&&t[2]===223&&t[3]===163?{ext:`webm`,mime:`video/webm`}:t.length>=8&&t[4]===102&&t[5]===116&&t[6]===121&&t[7]===112?{ext:`mp4`,mime:`video/mp4`}:t[0]===0&&t[1]===97&&t[2]===115&&t[3]===109?{ext:`wasm`,mime:`application/wasm`}:t[0]===127&&t[1]===69&&t[2]===76&&t[3]===70?{ext:`elf`,mime:`application/x-elf`}:t.length>=6&&t[0]===83&&t[1]===81&&t[2]===76&&t[3]===105&&t[4]===116&&t[5]===101?{ext:`sqlite`,mime:`application/x-sqlite3`}:t[0]===56&&t[1]===66&&t[2]===80&&t[3]===83?{ext:`psd`,mime:`image/vnd.adobe.photoshop`}:i(t)||{ext:`bin`,mime:`application/octet-stream`}}function i(e){let t=e[0];if(t===123||t===91)return{ext:`json`,mime:`application/json`};if(t===60){let t=new TextDecoder(`utf-8`,{fatal:!1}).decode(e.slice(0,Math.min(e.length,256))).toLowerCase();if(t.includes(`<svg`))return{ext:`svg`,mime:`image/svg+xml`};if(t.includes(`<!doctype html`)||t.includes(`<html`))return{ext:`html`,mime:`text/html`};if(t.includes(`<?xml`))return{ext:`xml`,mime:`application/xml`}}if(e[0]===239&&e[1]===187&&e[2]===191){if(e.length>3){if(e[3]===123||e[3]===91)return{ext:`json`,mime:`application/json`};if(e[3]===60)return{ext:`xml`,mime:`application/xml`}}return{ext:`txt`,mime:`text/plain`}}return null}function a(e,n=!1){let r=t().keyPageCount||5,i=n?Math.ceil(e/2):e;return{page:1,pages:Math.max(1,Math.ceil(i/r)),pageCount:r,startIndex:0,endIndex:r}}function o(e,t,n=!1){let r=n?Math.ceil(t/2):t,i=Math.max(1,Math.ceil(r/e.pageCount)),a=e.page;a>i&&(a=i),a<1&&(a=1);let o=(a-1)*e.pageCount,s=a*e.pageCount;return{...e,page:a,pages:i,startIndex:o,endIndex:s}}function s(e,t){let n=e.page;t===`first`?n=1:t===`prev`?n=Math.max(1,n-1):t===`next`?n=Math.min(e.pages,n+1):t===`last`&&(n=e.pages);let r=(n-1)*e.pageCount,i=n*e.pageCount;return{...e,page:n,startIndex:r,endIndex:i}}function c(e,t){let n=t;n<1&&(n=1),n>e.pages&&(n=e.pages);let r=(n-1)*e.pageCount,i=n*e.pageCount;return{...e,page:n,startIndex:r,endIndex:i}}function l(e){return e?e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.type===`Buffer`&&Array.isArray(e.data)?new Uint8Array(e.data):new TextEncoder().encode(String(e)):new Uint8Array}var u=new TextDecoder(`utf-8`,{fatal:!1});function d(e){return e?u.decode(l(e)):``}function f(e,t,n){if(!t)return{value:e,valueBuffer:t};if(n===`string`)return{value:d(t),valueBuffer:t};if(n===`list`||n===`set`)return{value:Array.isArray(t)?t.map(e=>d(e)):e,valueBuffer:t};if(n===`hash`){if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=d(r);return{value:e,valueBuffer:t}}return{value:e,valueBuffer:t}}if(n===`zset`){if(Array.isArray(t)){let e=[];for(let n=0;n<t.length;n+=2)e.push(d(t[n])),e.push(d(t[n+1]));return{value:e,valueBuffer:t}}return{value:e,valueBuffer:t}}if(n===`ReJSON-RL`||n===`json`){let e=d(t);try{let n=JSON.parse(e);return Array.isArray(n)&&n.length===1&&(n=n[0]),{value:n,valueBuffer:t}}catch{return{value:e,valueBuffer:t}}}if(n===`stream`){let e=t=>t&&(Array.isArray(t)?t.map(e):d(t));return{value:e(t),valueBuffer:t}}try{let e=d(t);return{value:JSON.parse(e),valueBuffer:t}}catch{return{value:e,valueBuffer:t}}}function p(e){return e?e instanceof Uint8Array||e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:e.type===`Buffer`&&Array.isArray(e.data)?e.data.length:typeof e==`string`?new TextEncoder().encode(e).byteLength:0:0}function m(e){let{type:t,valueBuffer:n}=e;if(!n)return 0;if(t!==`stream`){let e=p(n);if(e>0)return e;if(typeof n==`object`&&!Array.isArray(n)){let e=0;for(let t of Object.keys(n))e+=p(n[t]);return e}if(Array.isArray(n)){let e=0;for(let t of n)e+=p(t);return e}return 0}let r=0,i=e=>{let t=p(e);if(t>0){r+=t;return}Array.isArray(e)&&e.forEach(i)};return(n??[]).forEach(i),r}function h(e,t){if(t===`json`)try{let t=typeof e==`string`?JSON.parse(e):e;return JSON.stringify(t,null,2)}catch{return String(e??``)}if(t===`base64`)try{let t=new TextEncoder().encode(String(e??``)),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}catch{return String(e??``)}return String(e??``)}function g(e){let n=t().maxValueDisplay,r=String(e??``);return n<=0?r:n===-1?``:r.length>n?r.substring(0,n):r}function _(e){let n=t().maxValueDisplay;return n<=0||n===-1?!1:String(e??``).length>n}function v(t){let r=e(),i=n();navigator.clipboard.writeText(t).then(()=>{let e=r.strings?.status?.dataCopied;i.toast(typeof e==`function`?e():e)}).catch(()=>{})}function y(e,t,n){let i=l(e),{ext:a,mime:o}=r(i),s=new Blob([i],{type:o}),c=URL.createObjectURL(s),u=document.createElement(`a`);u.href=c,u.download=`${n||t}.${a}`,u.click(),URL.revokeObjectURL(c)}function b(e,t){return typeof e==`function`?e(t):e||``}export{y as a,c,b as d,l as f,f as i,s as l,v as n,h as o,g as p,a as r,_ as s,m as t,o as u};