🔧:build SSR dist and deploy

This commit is contained in:
NEO 2024-04-28 00:48:29 +08:00
parent 76c26901d7
commit c59ad6aedb
465 changed files with 214127 additions and 2 deletions

134
dist/server/chunks/chunk-000e277f.js vendored Normal file
View file

@ -0,0 +1,134 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as _sfc_main$2 } from './chunk-8109fd17.js';
import { _ as _sfc_main$1 } from './chunk-bb5bb4f6.js';
import { defineComponent, toRefs, computed, mergeProps, withCtx, unref, createTextVNode, toDisplayString, createVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
import { useVModel } from '@vueuse/core';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-buttons-select",
__ssrInlineRender: true,
props: {
options: { default: () => [] },
value: { default: void 0 },
size: { default: "medium" },
label: {},
labelFor: {},
labelPosition: { default: "left" },
labelWidth: {},
labelAlign: {}
},
emits: ["update:value"],
setup(__props, { emit: emits }) {
const props = __props;
const { options: rawOptions, size } = toRefs(props);
const options = computed(() => {
if (_.isArray(rawOptions.value)) {
return rawOptions.value.map((option) => {
if (typeof option === "string") {
return { label: option, value: option };
}
return option;
});
}
return _.map(rawOptions.value, (value2, label) => ({ label, value: value2 }));
});
const value = useVModel(props, "value", emits);
function selectOption(option) {
value.value = option.value;
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_label = _sfc_main$1;
const _component_c_tooltip = _sfc_main$2;
const _component_c_button = __unplugin_components_0;
_push(ssrRenderComponent(_component_c_label, mergeProps(props, _attrs), {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div class="flex gap-2"${_scopeId}><!--[-->`);
ssrRenderList(unref(options), (option) => {
_push2(ssrRenderComponent(_component_c_tooltip, {
key: option.value,
tooltip: option.tooltip
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_button, {
"test-id": option.value,
size: unref(size),
type: option.value === unref(value) ? "primary" : "default",
onClick: ($event) => selectOption(option)
}, {
default: withCtx((_4, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(option.label)}`);
} else {
return [
createTextVNode(toDisplayString(option.label), 1)
];
}
}),
_: 2
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_button, {
"test-id": option.value,
size: unref(size),
type: option.value === unref(value) ? "primary" : "default",
onClick: ($event) => selectOption(option)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(option.label), 1)
]),
_: 2
}, 1032, ["test-id", "size", "type", "onClick"])
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]--></div>`);
} else {
return [
createVNode("div", { class: "flex gap-2" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(options), (option) => {
return openBlock(), createBlock(_component_c_tooltip, {
key: option.value,
tooltip: option.tooltip
}, {
default: withCtx(() => [
createVNode(_component_c_button, {
"test-id": option.value,
size: unref(size),
type: option.value === unref(value) ? "primary" : "default",
onClick: ($event) => selectOption(option)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(option.label), 1)
]),
_: 2
}, 1032, ["test-id", "size", "type", "onClick"])
]),
_: 2
}, 1032, ["tooltip"]);
}), 128))
])
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-buttons-select/c-buttons-select.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

355
dist/server/chunks/chunk-035eaf88.js vendored Normal file
View file

@ -0,0 +1,355 @@
import { defineComponent, toRefs, mergeProps, unref, withCtx, createVNode, useSSRContext, isRef } from 'vue';
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderList } from 'vue/server-renderer';
import { format } from 'prettier';
import htmlParser from 'prettier/plugins/html';
import { useVModel, tryOnBeforeUnmount, useStorage, asyncComputed } from '@vueuse/core';
import { NIcon, NDivider, useThemeVars } from 'naive-ui';
import { _ as _sfc_main$4, a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { Editor as Editor$1, EditorContent } from '@tiptap/vue-3';
import StarterKit from '@tiptap/starter-kit';
import { Bold, Italic, Strikethrough, Code, H1, H2, H3, H4, List, ListNumbers, CodePlus, Blockquote, TextWrap, ClearFormatting, ArrowBack, ArrowForwardUp } from '@vicons/tabler';
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import 'pinia';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
__name: "menu-bar-item",
__ssrInlineRender: true,
props: {
icon: {},
title: {},
action: { type: Function },
isActive: { type: Function }
},
setup(__props) {
const props = __props;
const { icon, title, action, isActive } = toRefs(props);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_tooltip = _sfc_main$4;
const _component_c_button = __unplugin_components_0;
const _component_n_icon = NIcon;
_push(ssrRenderComponent(_component_c_tooltip, mergeProps({ tooltip: unref(title) }, _attrs), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_button, {
circle: "",
variant: "text",
type: unref(isActive)?.() ? "primary" : "default",
onClick: unref(action)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_icon, { component: unref(icon) }, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_icon, { component: unref(icon) }, null, 8, ["component"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_button, {
circle: "",
variant: "text",
type: unref(isActive)?.() ? "primary" : "default",
onClick: unref(action)
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { component: unref(icon) }, null, 8, ["component"])
]),
_: 1
}, 8, ["type", "onClick"])
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue");
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "menu-bar",
__ssrInlineRender: true,
props: {
editor: {}
},
setup(__props) {
const props = __props;
const { editor } = toRefs(props);
const items = [
{
type: "button",
icon: Bold,
title: "Bold",
action: () => editor.value.chain().focus().toggleBold().run(),
isActive: () => editor.value.isActive("bold")
},
{
type: "button",
icon: Italic,
title: "Italic",
action: () => editor.value.chain().focus().toggleItalic().run(),
isActive: () => editor.value.isActive("italic")
},
{
type: "button",
icon: Strikethrough,
title: "Strike",
action: () => editor.value.chain().focus().toggleStrike().run(),
isActive: () => editor.value.isActive("strike")
},
{
type: "button",
icon: Code,
title: "Inline code",
action: () => editor.value.chain().focus().toggleCode().run(),
isActive: () => editor.value.isActive("code")
},
{
type: "divider"
},
{
type: "button",
icon: H1,
title: "Heading 1",
action: () => editor.value.chain().focus().toggleHeading({ level: 1 }).run(),
isActive: () => editor.value.isActive("heading", { level: 1 })
},
{
type: "button",
icon: H2,
title: "Heading 2",
action: () => editor.value.chain().focus().toggleHeading({ level: 2 }).run(),
isActive: () => editor.value.isActive("heading", { level: 2 })
},
{
type: "button",
icon: H3,
title: "Heading 3",
action: () => editor.value.chain().focus().toggleHeading({ level: 4 }).run(),
isActive: () => editor.value.isActive("heading", { level: 4 })
},
{
type: "button",
icon: H4,
title: "Heading 4",
action: () => editor.value.chain().focus().toggleHeading({ level: 4 }).run(),
isActive: () => editor.value.isActive("heading", { level: 4 })
},
{
type: "divider"
},
{
type: "button",
icon: List,
title: "Bullet list",
action: () => editor.value.chain().focus().toggleBulletList().run(),
isActive: () => editor.value.isActive("bulletList")
},
{
type: "button",
icon: ListNumbers,
title: "Ordered list",
action: () => editor.value.chain().focus().toggleOrderedList().run(),
isActive: () => editor.value.isActive("orderedList")
},
{
type: "button",
icon: CodePlus,
title: "Code block",
action: () => editor.value.chain().focus().toggleCodeBlock().run(),
isActive: () => editor.value.isActive("codeBlock")
},
{
type: "button",
icon: Blockquote,
title: "Blockquote",
action: () => editor.value.chain().focus().toggleBlockquote().run(),
isActive: () => editor.value.isActive("blockquote")
},
{
type: "divider"
},
{
type: "button",
icon: TextWrap,
title: "Hard break",
action: () => editor.value.chain().focus().setHardBreak().run()
},
{
type: "button",
icon: ClearFormatting,
title: "Clear format",
action: () => editor.value.chain().focus().clearNodes().unsetAllMarks().run()
},
{
type: "button",
icon: ArrowBack,
title: "Undo",
action: () => editor.value.chain().focus().undo().run()
},
{
type: "button",
icon: ArrowForwardUp,
title: "Redo",
action: () => editor.value.chain().focus().redo().run()
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_n_divider = NDivider;
_push(`<div${ssrRenderAttrs(mergeProps({
flex: "",
"items-center": ""
}, _attrs))}><!--[-->`);
ssrRenderList(items, (item, index) => {
_push(`<!--[-->`);
if (item.type === "divider") {
_push(ssrRenderComponent(_component_n_divider, {
key: `divider${index}`,
vertical: ""
}, null, _parent));
} else if (item.type === "button") {
_push(ssrRenderComponent(_sfc_main$3, mergeProps({ key: index }, item), null, _parent));
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/html-wysiwyg-editor/editor/menu-bar.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "editor",
__ssrInlineRender: true,
props: {
html: {}
},
emits: ["update:html"],
setup(__props, { emit }) {
const props = __props;
const themeVars = useThemeVars();
const html = useVModel(props, "html", emit);
const editor = new Editor$1({
content: html.value,
extensions: [StarterKit]
});
editor.on("update", ({ editor: editor2 }) => emit("update:html", editor2.getHTML()));
tryOnBeforeUnmount(() => {
editor.destroy();
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_divider = NDivider;
const _cssVars = { style: {
"--99251dac": unref(themeVars).codeColor
} };
if (unref(editor)) {
_push(ssrRenderComponent(_component_c_card, mergeProps({ "important:p0": "" }, _attrs, _cssVars), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_sfc_main$2, {
class: "editor-header",
editor: unref(editor)
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_divider, { style: { "margin-top": "0" } }, null, _parent2, _scopeId));
_push2(`<div px8 pb6 data-v-3bc77d7d${_scopeId}>`);
_push2(ssrRenderComponent(unref(EditorContent), {
class: "editor-content",
editor: unref(editor)
}, null, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_sfc_main$2, {
class: "editor-header",
editor: unref(editor)
}, null, 8, ["editor"]),
createVNode(_component_n_divider, { style: { "margin-top": "0" } }),
createVNode("div", {
px8: "",
pb6: ""
}, [
createVNode(unref(EditorContent), {
class: "editor-content",
editor: unref(editor)
}, null, 8, ["editor"])
])
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
};
}
});
/* unplugin-vue-components disabled */const editor_vue_vue_type_style_index_0_scoped_3bc77d7d_lang = '';
/* unplugin-vue-components disabled */const editor_vue_vue_type_style_index_1_scoped_3bc77d7d_lang = '';
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/html-wysiwyg-editor/editor/editor.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const Editor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3bc77d7d"]]);
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "html-wysiwyg-editor",
__ssrInlineRender: true,
setup(__props) {
const html = useStorage("html-wysiwyg-editor--html", "<h1>Hey!</h1><p>Welcome to this html wysiwyg editor</p>");
const formattedHtml = asyncComputed(() => format(html.value, { parser: "html", plugins: [htmlParser] }), "");
return (_ctx, _push, _parent, _attrs) => {
_push(`<!--[-->`);
_push(ssrRenderComponent(Editor, {
html: unref(html),
"onUpdate:html": ($event) => isRef(html) ? html.value = $event : null
}, null, _parent));
_push(ssrRenderComponent(TextareaCopyable, {
value: unref(formattedHtml),
language: "html"
}, null, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

113
dist/server/chunks/chunk-054f233d.js vendored Normal file
View file

@ -0,0 +1,113 @@
import { defineComponent, toRefs, ref, watch, onMounted, mergeProps, useSSRContext, withCtx, createVNode } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import * as monaco from 'monaco-editor';
import { u as useStyleStore, _ as _export_sfc } from './chunk-6003391e.js';
import { useResizeObserver } from '@vueuse/core';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import 'pinia';
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "c-diff-editor",
__ssrInlineRender: true,
props: {
options: { default: () => ({}) }
},
setup(__props) {
const props = __props;
const { options } = toRefs(props);
const editorContainer = ref(null);
let editor = null;
monaco.editor.defineTheme("it-tools-dark", {
base: "vs-dark",
inherit: true,
rules: [],
colors: {
"editor.background": "#00000000"
}
});
monaco.editor.defineTheme("it-tools-light", {
base: "vs",
inherit: true,
rules: [],
colors: {
"editor.background": "#00000000"
}
});
const styleStore = useStyleStore();
watch(
() => styleStore.isDarkTheme,
(isDarkTheme) => monaco.editor.setTheme(isDarkTheme ? "it-tools-dark" : "it-tools-light"),
{ immediate: true }
);
watch(
() => options.value,
(options2) => editor?.updateOptions(options2),
{ immediate: true, deep: true }
);
useResizeObserver(editorContainer, () => {
editor?.layout();
});
onMounted(() => {
if (!editorContainer.value) {
return;
}
editor = monaco.editor.createDiffEditor(editorContainer.value, {
originalEditable: true,
minimap: {
enabled: false
}
});
editor.setModel({
original: monaco.editor.createModel("original text", "txt"),
modified: monaco.editor.createModel("modified text", "txt")
});
});
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({
ref_key: "editorContainer",
ref: editorContainer,
"h-600px": ""
}, _attrs))}></div>`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-diff-editor/c-diff-editor.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = {};
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
const _component_c_card = __unplugin_components_1;
const _component_c_diff_editor = _sfc_main$1;
_push(ssrRenderComponent(_component_c_card, mergeProps({
"w-full": "",
"important:flex-1": "",
"important:pa-0": ""
}, _attrs), {
default: withCtx((_, _push, _parent, _scopeId) => {
if (_push) {
_push(ssrRenderComponent(_component_c_diff_editor, null, null, _parent, _scopeId));
} else {
return [
createVNode(_component_c_diff_editor)
]
}
}),
_: 1
}, _parent));
}
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext()
;(ssrContext.modules || (ssrContext.modules = new Set())).add("src/tools/text-diff/text-diff.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : undefined
};
const textDiff = /*#__PURE__*/_export_sfc(_sfc_main, [['ssrRender',_sfc_ssrRender]]);
export { textDiff as default };

59
dist/server/chunks/chunk-05626d31.js vendored Normal file
View file

@ -0,0 +1,59 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { stringify } from 'yaml';
import JSON5 from 'json5';
import { i as isNotThrowing } from './chunk-5697d061.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "json-to-yaml",
__ssrInlineRender: true,
setup(__props) {
const transformer = (value) => withDefaultOnError(() => stringify(JSON5.parse(value)), "");
const rules = [
{
validator: (value) => value === "" || isNotThrowing(() => stringify(JSON5.parse(value))),
message: "Provided JSON is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your JSON",
"input-placeholder": "Paste your JSON here...",
"output-label": "YAML from your JSON",
"output-language": "yaml",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/json-to-yaml-converter/json-to-yaml.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

393
dist/server/chunks/chunk-086ce3b7.js vendored Normal file
View file

@ -0,0 +1,393 @@
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { NForm, NFormItem, NSwitch, NSlider } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, withCtx, unref, isRef, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { c as createToken } from './chunk-264f08b8.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import { u as useQueryParam } from './chunk-bc09e76f.js';
import { c as computedRefreshable } from './chunk-cc665c88.js';
import { useI18n } from 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import '@vueuse/router';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "token-generator.tool",
__ssrInlineRender: true,
setup(__props) {
const length = useQueryParam({ name: "length", defaultValue: 64 });
const withUppercase = useQueryParam({ name: "uppercase", defaultValue: true });
const withLowercase = useQueryParam({ name: "lowercase", defaultValue: true });
const withNumbers = useQueryParam({ name: "numbers", defaultValue: true });
const withSymbols = useQueryParam({ name: "symbols", defaultValue: false });
const { t } = useI18n();
const [token, refreshToken] = computedRefreshable(
() => createToken({
length: length.value,
withUppercase: withUppercase.value,
withLowercase: withLowercase.value,
withNumbers: withNumbers.value,
withSymbols: withSymbols.value
})
);
const { copy } = useCopy({ source: token, text: t("tools.token-generator.copied") });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_form = NForm;
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_n_slider = NSlider;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-1b0e7f55>`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_form, {
"label-placement": "left",
"label-width": "140"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div flex justify-center data-v-1b0e7f55${_scopeId2}><div data-v-1b0e7f55${_scopeId2}>`);
_push3(ssrRenderComponent(_component_n_form_item, {
label: unref(t)("tools.token-generator.uppercase")
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(withUppercase),
"onUpdate:value": ($event) => isRef(withUppercase) ? withUppercase.value = $event : null
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(withUppercase),
"onUpdate:value": ($event) => isRef(withUppercase) ? withUppercase.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, {
label: unref(t)("tools.token-generator.lowercase")
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(withLowercase),
"onUpdate:value": ($event) => isRef(withLowercase) ? withLowercase.value = $event : null
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(withLowercase),
"onUpdate:value": ($event) => isRef(withLowercase) ? withLowercase.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div><div data-v-1b0e7f55${_scopeId2}>`);
_push3(ssrRenderComponent(_component_n_form_item, {
label: unref(t)("tools.token-generator.numbers")
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(withNumbers),
"onUpdate:value": ($event) => isRef(withNumbers) ? withNumbers.value = $event : null
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(withNumbers),
"onUpdate:value": ($event) => isRef(withNumbers) ? withNumbers.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, {
label: unref(t)("tools.token-generator.symbols")
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(withSymbols),
"onUpdate:value": ($event) => isRef(withSymbols) ? withSymbols.value = $event : null
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(withSymbols),
"onUpdate:value": ($event) => isRef(withSymbols) ? withSymbols.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div></div>`);
} else {
return [
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode("div", null, [
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.uppercase")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withUppercase),
"onUpdate:value": ($event) => isRef(withUppercase) ? withUppercase.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"]),
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.lowercase")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withLowercase),
"onUpdate:value": ($event) => isRef(withLowercase) ? withLowercase.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"])
]),
createVNode("div", null, [
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.numbers")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withNumbers),
"onUpdate:value": ($event) => isRef(withNumbers) ? withNumbers.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"]),
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.symbols")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withSymbols),
"onUpdate:value": ($event) => isRef(withSymbols) ? withSymbols.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"])
])
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: `${unref(t)("tools.token-generator.length")} (${unref(length)})`,
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_slider, {
value: unref(length),
"onUpdate:value": ($event) => isRef(length) ? length.value = $event : null,
step: 1,
min: 1,
max: 512
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_slider, {
value: unref(length),
"onUpdate:value": ($event) => isRef(length) ? length.value = $event : null,
step: 1,
min: 1,
max: 512
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(__unplugin_components_3, {
value: unref(token),
"onUpdate:value": ($event) => isRef(token) ? token.value = $event : null,
multiline: "",
placeholder: unref(t)("tools.token-generator.tokenPlaceholder"),
readonly: "",
rows: "3",
autosize: "",
class: "token-display"
}, null, _parent2, _scopeId));
_push2(`<div mt-5 flex justify-center gap-3 data-v-1b0e7f55${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(t)("tools.token-generator.button.copy"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(t)("tools.token-generator.button.copy")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_button, { onClick: unref(refreshToken) }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(t)("tools.token-generator.button.refresh"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(t)("tools.token-generator.button.refresh")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_n_form, {
"label-placement": "left",
"label-width": "140"
}, {
default: withCtx(() => [
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode("div", null, [
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.uppercase")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withUppercase),
"onUpdate:value": ($event) => isRef(withUppercase) ? withUppercase.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"]),
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.lowercase")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withLowercase),
"onUpdate:value": ($event) => isRef(withLowercase) ? withLowercase.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"])
]),
createVNode("div", null, [
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.numbers")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withNumbers),
"onUpdate:value": ($event) => isRef(withNumbers) ? withNumbers.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"]),
createVNode(_component_n_form_item, {
label: unref(t)("tools.token-generator.symbols")
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(withSymbols),
"onUpdate:value": ($event) => isRef(withSymbols) ? withSymbols.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"])
])
])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: `${unref(t)("tools.token-generator.length")} (${unref(length)})`,
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_slider, {
value: unref(length),
"onUpdate:value": ($event) => isRef(length) ? length.value = $event : null,
step: 1,
min: 1,
max: 512
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["label"]),
createVNode(__unplugin_components_3, {
value: unref(token),
"onUpdate:value": ($event) => isRef(token) ? token.value = $event : null,
multiline: "",
placeholder: unref(t)("tools.token-generator.tokenPlaceholder"),
readonly: "",
rows: "3",
autosize: "",
class: "token-display"
}, null, 8, ["value", "onUpdate:value", "placeholder"]),
createVNode("div", {
"mt-5": "",
flex: "",
"justify-center": "",
"gap-3": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("tools.token-generator.button.copy")), 1)
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_c_button, { onClick: unref(refreshToken) }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("tools.token-generator.button.refresh")), 1)
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const tokenGenerator_tool_vue_vue_type_style_index_0_scoped_1b0e7f55_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/token-generator/token-generator.tool.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const tokenGenerator_tool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1b0e7f55"]]);
export { tokenGenerator_tool as default };

79
dist/server/chunks/chunk-10381e64.js vendored Normal file
View file

@ -0,0 +1,79 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { defineComponent, computed, resolveComponent, mergeProps, unref, withCtx, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
import { d as demoRoutes } from '../entries/src_ui_demo_demo-home-page.mjs';
import { useRoute } from 'vue-router';
import '@vueuse/core';
import 'pinia';
import './chunk-28375bc9.js';
import './chunk-95ec8cf7.js';
import './chunk-000e277f.js';
import './chunk-8109fd17.js';
import './chunk-bb5bb4f6.js';
import './chunk-83cdd9a0.js';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'marked';
import 'dompurify';
import './chunk-6ba26b76.js';
import './chunk-77c5cc16.js';
import 'naive-ui';
import './chunk-89a4876c.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import './chunk-aab02bfe.js';
import './chunk-aff50618.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "demo-wrapper",
__ssrInlineRender: true,
setup(__props) {
const route = useRoute();
const componentName = computed(() => _.startCase(String(route.name).replace(/^c-/, "")));
return (_ctx, _push, _parent, _attrs) => {
const _component_c_button = __unplugin_components_0;
const _component_router_view = resolveComponent("router-view");
_push(`<div${ssrRenderAttrs(mergeProps({
"mt-2": "",
"w-full": "",
"p-8": ""
}, _attrs))}><h1>c-lib components</h1><div flex><div w-200px b-r b-gray b-op-10 b-r-solid pr-4><!--[-->`);
ssrRenderList(unref(demoRoutes), ({ name }) => {
_push(ssrRenderComponent(_component_c_button, {
key: name,
variant: "text",
to: { name },
"w-full": "",
"important:justify-start": "",
"important:text-left": "",
type: unref(route).name === name ? "primary" : "default"
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(name)}`);
} else {
return [
createTextVNode(toDisplayString(name), 1)
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]--></div><div flex-1 pl-4><h1>${ssrInterpolate(unref(componentName))}</h1>`);
_push(ssrRenderComponent(_component_router_view, null, null, _parent));
_push(`</div></div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/demo/demo-wrapper.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

14
dist/server/chunks/chunk-11f44f81.js vendored Normal file
View file

@ -0,0 +1,14 @@
const random = () => Math.random();
const randFromArray = (array) => array[Math.floor(random() * array.length)];
const randIntFromInterval = (min, max) => Math.floor(random() * (max - min) + min);
function shuffleArrayMutate(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
const shuffleString = (str, delimiter = "") => shuffleArrayMutate(str.split(delimiter)).join(delimiter);
const generateRandomId = () => `id-${random().toString(36).substring(2, 12)}`;
export { randIntFromInterval as a, generateRandomId as g, randFromArray as r, shuffleString as s };

500
dist/server/chunks/chunk-130b7c32.js vendored Normal file
View file

@ -0,0 +1,500 @@
import { NInputGroup, NInputGroupLabel, NDynamicInput, NFormItem } from 'naive-ui';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, watch, computed, unref, withCtx, createTextVNode, toDisplayString, createVNode, openBlock, createBlock, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderList, ssrRenderStyle, ssrInterpolate, ssrRenderComponent } from 'vue/server-renderer';
import { generateMeta } from '@it-tools/oggen';
import _ from 'lodash';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import { _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import '@vueuse/core';
import 'fuse.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'pinia';
const article = {
name: "Article",
elements: [
{
type: "input",
label: "Publishing date",
key: "article:published_time",
placeholder: "When the article was first published..."
},
{
type: "input",
label: "Modification date",
key: "article:modified_time",
placeholder: "When the article was last changed..."
},
{
type: "input",
label: "Expiration date",
key: "article:expiration_time",
placeholder: "When the article is out of date after..."
},
{ type: "input", label: "Author", key: "article:author", placeholder: "Writers of the article..." },
{
type: "input",
label: "Section",
key: "article:section",
placeholder: "A high-level section name. E.g. Technology.."
},
{ type: "input", label: "Tag", key: "article:tag", placeholder: "Tag words associated with this article..." }
]
};
const book = {
name: "Book",
elements: [
{ type: "input", label: "Author", key: "book:author", placeholder: "Who wrote this book..." },
{ type: "input", label: "ISBN", key: "book:isbn", placeholder: "The International Standard Book Number..." },
{
type: "input",
label: "Release date",
key: "book:release_date",
placeholder: "The date the book was released..."
},
{ type: "input", label: "Tag", key: "book:tag", placeholder: "Tag words associated with this book..." }
]
};
const musicAlbum = {
name: "Album details",
elements: [
{ type: "input", label: "Song", key: "music:song", placeholder: "The song on this album..." },
{
type: "input",
label: "Disc",
key: "music:song:disc",
placeholder: "The same as music:album:disc but in reverse..."
},
{
type: "input",
label: "Track",
key: "music:song:track",
placeholder: "The same as music:album:track but in reverse..."
},
{ type: "input", label: "Musician", key: "music:musician", placeholder: "The musician that made this song..." },
{
type: "input",
label: "Release date",
key: "music:release_date",
placeholder: "The date the album was released..."
}
]
};
const musicPlaylist = {
name: "Playlist details",
elements: [
{ type: "input", label: "Song", key: "music:song", placeholder: "The song on this album..." },
{
type: "input",
label: "Disc",
key: "music:song:disc",
placeholder: "The same as music:album:disc but in reverse..."
},
{
type: "input",
label: "Track",
key: "music:song:track",
placeholder: "The same as music:album:track but in reverse..."
},
{ type: "input", label: "Creator", key: "music:creator", placeholder: "The creator of this playlist..." }
]
};
const musicRadioStation = {
name: "Radio station details",
elements: [
{ type: "input", label: "Creator", key: "music:creator", placeholder: "The creator of this radio station..." }
]
};
const musicSong = {
name: "Song details",
elements: [
{ type: "input", label: "Duration", placeholder: "The duration of the song...", key: "music:duration" },
{ type: "input", label: "Album", placeholder: "The album this song is from...", key: "music:album" },
{
type: "input",
label: "Disc",
placeholder: "Which disc of the album this song is on...",
key: "music:album:disk"
},
{ type: "input", label: "Track", placeholder: " Which track this song is...", key: "music:album:track" },
{
type: "input-multiple",
label: "Musician",
placeholder: "The musician that made this song...",
key: "music:musician"
}
]
};
const profile = {
name: "Profile",
elements: [
{
type: "input",
label: "First name",
placeholder: "Enter the first name of the person...",
key: "profile:first_name"
},
{
type: "input",
label: "Last name",
placeholder: "Enter the last name of the person...",
key: "profile:last_name"
},
{ type: "input", label: "Username", placeholder: "Enter the username of the person...", key: "profile:username" },
{ type: "input", label: "Gender", placeholder: "Enter the gender of the person...", key: "profile:gender" }
]
};
const videoMovie = {
name: "Movie details",
elements: [
{
type: "input-multiple",
label: "Actor",
key: "video:actor",
placeholder: "Name of the actress/actor..."
},
// { type: 'input', label: 'Actor role', key: 'video:actor:role', placeholder: 'The role they played...' },
{
type: "input-multiple",
label: "Director",
key: "video:director",
placeholder: "Name of the director..."
},
{ type: "input-multiple", label: "Writer", key: "video:writer", placeholder: "Writers of the movie..." },
{ type: "input", label: "Duration", key: "video:duration", placeholder: "The movie's length in seconds..." },
{
type: "input",
label: "Release date",
key: "video:release_date",
placeholder: "The date the movie was released..."
},
{ type: "input", label: "Tag", key: "video:tag", placeholder: "Tag words associated with this movie..." }
]
};
const videoEpisode = {
name: "Video episode details",
elements: [
...videoMovie.elements,
{ type: "input", label: "Series", key: "video:series", placeholder: "Which series this episode belongs to..." }
]
};
const videoOther = {
name: "Other video details",
elements: [...videoMovie.elements]
};
const videoTVShow = {
name: "TV show details",
elements: [...videoMovie.elements]
};
const image = {
name: "Image",
elements: [
{
type: "input",
label: "Image url",
placeholder: "The url of your website social image...",
key: "image"
},
{
type: "input",
label: "Image alt",
placeholder: "The alternative text of your website social image...",
key: "image:alt"
},
{
type: "input",
label: "Width",
placeholder: "Width in px of your website social image...",
key: "image:width"
},
{
type: "input",
label: "Height",
placeholder: "Height in px of your website social image...",
key: "image:height"
}
]
};
const twitter = {
name: "Twitter",
elements: [
{
type: "select",
options: [
{ label: "Summary", value: "summary" },
{ label: "Summary with large image", value: "summary_large_image" },
{ label: "Application", value: "app" },
{ label: "Player", value: "player" }
],
label: "Card type",
placeholder: "The Twitter card type...",
key: "twitter:card"
},
{
type: "input",
label: "Site account",
placeholder: "The name of the Twitter account of the site (ex: @ittoolsdottech)...",
key: "twitter:site"
},
{
type: "input",
label: "Creator acc.",
placeholder: "The name of the Twitter account of the creator (ex: @cthmsst)...",
key: "twitter:creator"
}
]
};
const typeOptions = [
{ label: "Website", value: "website" },
{ label: "Article", value: "article" },
{ label: "Book", value: "book" },
{ label: "Profile", value: "profile" },
{
type: "group",
label: "Music",
key: "Music",
children: [
{ label: "Song", value: "music.song" },
{ label: "Music album", value: "music.album" },
{ label: "Playlist", value: "music.playlist" },
{ label: "Radio station", value: "music.radio_station" }
]
},
{
type: "group",
label: "Video",
key: "Video",
children: [
{ label: "Movie", value: "video.movie" },
{ label: "Episode", value: "video.episode" },
{ label: "TV show", value: "video.tv_show" },
{ label: "Other video", value: "video.other" }
]
}
];
const website = {
name: "General information",
elements: [
{
type: "select",
label: "Page type",
placeholder: "Select the type of your website...",
key: "type",
options: typeOptions
},
{ type: "input", label: "Title", placeholder: "Enter the title of your website...", key: "title" },
{
type: "input",
label: "Description",
placeholder: "Enter the description of your website...",
key: "description"
},
{
type: "input",
label: "Page URL",
placeholder: "Enter the url of your website...",
key: "url"
}
]
};
const ogSchemas = {
"music.song": musicSong,
"music.album": musicAlbum,
"music.playlist": musicPlaylist,
"music.radio_station": musicRadioStation,
"video.movie": videoMovie,
"video.episode": videoEpisode,
"video.tv_show": videoTVShow,
"video.other": videoOther,
profile,
article,
book
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "meta-tag-generator",
__ssrInlineRender: true,
setup(__props) {
const metadata = ref({
"type": "website",
"twitter:card": "summary_large_image"
});
watch(
() => ref(metadata.value.type),
(_ignored, prevSection) => {
const section = ogSchemas[prevSection.value];
if (!section) {
return;
}
section.elements.forEach(({ key }) => {
metadata.value[key] = "";
});
}
);
const sections = computed(() => {
const secs = [website, image, twitter];
const additionalSchema = ogSchemas[metadata.value.type];
if (additionalSchema) {
secs.push(additionalSchema);
}
return secs;
});
const metaTags = computed(() => {
const twitterMeta = _.chain(metadata.value).pickBy((_value, k) => k.startsWith("twitter:")).mapKeys((_value, k) => k.replace(/^twitter:/, "")).value();
const otherMeta = _.pickBy(metadata.value, (_value, k) => !k.startsWith("twitter:"));
return generateMeta({ ...otherMeta, twitter: twitterMeta }, { generateTwitterCompatibleMeta: true });
});
return (_ctx, _push, _parent, _attrs) => {
const _component_n_input_group = NInputGroup;
const _component_n_input_group_label = NInputGroupLabel;
const _component_c_input_text = __unplugin_components_3;
const _component_n_dynamic_input = NDynamicInput;
const _component_c_select = __unplugin_components_0;
const _component_n_form_item = NFormItem;
_push(`<!--[--><div data-v-63153b5c><!--[-->`);
ssrRenderList(unref(sections), ({ name, elements }) => {
_push(`<div style="${ssrRenderStyle({ "margin-bottom": "15px" })}" data-v-63153b5c><div mb-5px data-v-63153b5c>${ssrInterpolate(name)}</div><!--[-->`);
ssrRenderList(elements, ({ key, type, label, placeholder, ...element }) => {
_push(ssrRenderComponent(_component_n_input_group, { key }, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_group_label, { style: { "flex": "0 0 110px" } }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(label)}`);
} else {
return [
createTextVNode(toDisplayString(label), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
if (type === "input") {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(metadata)[key],
"onUpdate:value": ($event) => unref(metadata)[key] = $event,
placeholder,
clearable: ""
}, null, _parent2, _scopeId));
} else if (type === "input-multiple") {
_push2(ssrRenderComponent(_component_n_dynamic_input, {
value: unref(metadata)[key],
"onUpdate:value": ($event) => unref(metadata)[key] = $event,
min: 1,
placeholder,
"default-value": [""],
"show-sort-button": true
}, null, _parent2, _scopeId));
} else if (type === "select") {
_push2(ssrRenderComponent(_component_c_select, {
value: unref(metadata)[key],
"onUpdate:value": ($event) => unref(metadata)[key] = $event,
"w-full": "",
placeholder,
options: element.options
}, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
} else {
return [
createVNode(_component_n_input_group_label, { style: { "flex": "0 0 110px" } }, {
default: withCtx(() => [
createTextVNode(toDisplayString(label), 1)
]),
_: 2
}, 1024),
type === "input" ? (openBlock(), createBlock(_component_c_input_text, {
key: 0,
value: unref(metadata)[key],
"onUpdate:value": ($event) => unref(metadata)[key] = $event,
placeholder,
clearable: ""
}, null, 8, ["value", "onUpdate:value", "placeholder"])) : type === "input-multiple" ? (openBlock(), createBlock(_component_n_dynamic_input, {
key: 1,
value: unref(metadata)[key],
"onUpdate:value": ($event) => unref(metadata)[key] = $event,
min: 1,
placeholder,
"default-value": [""],
"show-sort-button": true
}, null, 8, ["value", "onUpdate:value", "placeholder"])) : type === "select" ? (openBlock(), createBlock(_component_c_select, {
key: 2,
value: unref(metadata)[key],
"onUpdate:value": ($event) => unref(metadata)[key] = $event,
"w-full": "",
placeholder,
options: element.options
}, null, 8, ["value", "onUpdate:value", "placeholder", "options"])) : createCommentVNode("", true)
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]--></div>`);
});
_push(`<!--]--></div><div data-v-63153b5c>`);
_push(ssrRenderComponent(_component_n_form_item, { label: "Your meta tags" }, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(TextareaCopyable, {
value: unref(metaTags),
language: "html"
}, null, _parent2, _scopeId));
} else {
return [
createVNode(TextareaCopyable, {
value: unref(metaTags),
language: "html"
}, null, 8, ["value"])
];
}
}),
_: 1
}, _parent));
_push(`</div><!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const metaTagGenerator_vue_vue_type_style_index_0_scoped_63153b5c_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/meta-tag-generator/meta-tag-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const metaTagGenerator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-63153b5c"]]);
export { metaTagGenerator as default };

63
dist/server/chunks/chunk-1af8c142.js vendored Normal file
View file

@ -0,0 +1,63 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { parse } from 'yaml';
import { i as isNotThrowing } from './chunk-5697d061.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "yaml-to-json",
__ssrInlineRender: true,
setup(__props) {
function transformer(value) {
return withDefaultOnError(() => {
const obj = parse(value);
return obj ? JSON.stringify(obj, null, 3) : "";
}, "");
}
const rules = [
{
validator: (value) => isNotThrowing(() => parse(value)),
message: "Provided YAML is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your YAML",
"input-placeholder": "Paste your yaml here...",
"output-label": "JSON from your YAML",
"output-language": "json",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/yaml-to-json-converter/yaml-to-json.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

159
dist/server/chunks/chunk-1bb82fcb.js vendored Normal file
View file

@ -0,0 +1,159 @@
import { _ as _sfc_main$2 } from './chunk-aff50618.js';
import { _ as _sfc_main$1 } from './chunk-ab9bd3df.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { ValidationErrorsIBAN, validateIBAN, extractIBAN, isQRIBAN, friendlyFormatIBAN } from 'ibantools';
import './chunk-95ec8cf7.js';
import './chunk-77c5cc16.js';
import '@vueuse/core';
import 'naive-ui';
import 'lodash';
import './chunk-6003391e.js';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
const ibanErrorToMessage = {
[ValidationErrorsIBAN.NoIBANProvided]: "No IBAN provided",
[ValidationErrorsIBAN.NoIBANCountry]: "No IBAN country",
[ValidationErrorsIBAN.WrongBBANLength]: "Wrong BBAN length",
[ValidationErrorsIBAN.WrongBBANFormat]: "Wrong BBAN format",
[ValidationErrorsIBAN.ChecksumNotNumber]: "Checksum is not a number",
[ValidationErrorsIBAN.WrongIBANChecksum]: "Wrong IBAN checksum",
[ValidationErrorsIBAN.WrongAccountBankBranchChecksum]: "Wrong account bank branch checksum",
[ValidationErrorsIBAN.QRIBANNotAllowed]: "QR-IBAN not allowed"
};
function getFriendlyErrors(errorCodes) {
return errorCodes.map((errorCode) => ibanErrorToMessage[errorCode]).filter(Boolean);
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "iban-validator-and-parser",
__ssrInlineRender: true,
setup(__props) {
const rawIban = ref("");
const ibanInfo = computed(() => {
const iban = rawIban.value.toUpperCase().replace(/\s/g, "").replace(/-/g, "");
if (iban === "") {
return [];
}
const { valid: isIbanValid, errorCodes } = validateIBAN(iban);
const { countryCode, bban } = extractIBAN(iban);
const errors = getFriendlyErrors(errorCodes);
return [
{
label: "Is IBAN valid ?",
value: isIbanValid,
showCopyButton: false
},
{
label: "IBAN errors",
value: errors.length === 0 ? void 0 : errors,
hideOnNil: true,
showCopyButton: false
},
{
label: "Is IBAN a QR-IBAN ?",
value: isQRIBAN(iban),
showCopyButton: false
},
{
label: "Country code",
value: countryCode
},
{
label: "BBAN",
value: bban
},
{
label: "IBAN friendly format",
value: friendlyFormatIBAN(iban)
}
];
});
const ibanExamples = [
"FR7630006000011234567890189",
"DE89370400440532013000",
"GB29NWBK60161331926819"
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_key_value_list = _sfc_main$1;
const _component_c_text_copyable = _sfc_main$2;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(__unplugin_components_3, {
value: unref(rawIban),
"onUpdate:value": ($event) => isRef(rawIban) ? rawIban.value = $event : null,
placeholder: "Enter an IBAN to check for validity...",
"test-id": "iban-input"
}, null, _parent));
if (unref(ibanInfo).length > 0) {
_push(ssrRenderComponent(_component_c_card, { "mt-5": "" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_key_value_list, {
items: unref(ibanInfo),
"data-test-id": "iban-info"
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_key_value_list, {
items: unref(ibanInfo),
"data-test-id": "iban-info"
}, null, 8, ["items"])
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
_push(ssrRenderComponent(_component_c_card, {
title: "Valid IBAN examples",
"mt-5": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<!--[-->`);
ssrRenderList(ibanExamples, (iban) => {
_push2(`<div${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_text_copyable, {
value: iban,
"font-mono": "",
"displayed-value": unref(friendlyFormatIBAN)(iban)
}, null, _parent2, _scopeId));
_push2(`</div>`);
});
_push2(`<!--]-->`);
} else {
return [
(openBlock(), createBlock(Fragment, null, renderList(ibanExamples, (iban) => {
return createVNode("div", { key: iban }, [
createVNode(_component_c_text_copyable, {
value: iban,
"font-mono": "",
"displayed-value": unref(friendlyFormatIBAN)(iban)
}, null, 8, ["value", "displayed-value"])
]);
}), 64))
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/iban-validator-and-parser/iban-validator-and-parser.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

448
dist/server/chunks/chunk-1c86d472.js vendored Normal file
View file

@ -0,0 +1,448 @@
import { useThemeVars, NProgress, NImage } from 'naive-ui';
import { openBlock, createElementBlock, createElementVNode, defineComponent, toRefs, unref, withCtx, createTextVNode, toDisplayString, createVNode, withModifiers, useSSRContext, computed, ref, isRef } from 'vue';
import { a as __unplugin_components_0, u as useStyleStore, _ as _export_sfc } from './chunk-6003391e.js';
import { _ as _sfc_main$2 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_3$1 } from './chunk-4e7a6a8d.js';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderStyle } from 'vue/server-renderer';
import { useTimestamp } from '@vueuse/core';
import { u as useQRCode } from './chunk-aa632c49.js';
import { HmacSHA1, enc } from 'crypto-js';
import _ from 'lodash';
import { c as createToken } from './chunk-264f08b8.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import { _ as _sfc_main$3 } from './chunk-de61ec1c.js';
import { c as computedRefreshable } from './chunk-cc665c88.js';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'qrcode';
import './chunk-95ec8cf7.js';
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M17.65 6.35A7.958 7.958 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_3 = { name: 'mdi-refresh', render };
/* vite-plugin-components disabled */
function hexToBytes(hex) {
return (hex.match(/.{1,2}/g) ?? []).map((char) => Number.parseInt(char, 16));
}
function computeHMACSha1(message, key) {
return HmacSHA1(enc.Hex.parse(message), enc.Hex.parse(base32toHex(key))).toString(enc.Hex);
}
function base32toHex(base32) {
const base32Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
const bits = base32.toUpperCase().replace(/=+$/, "").split("").map((value) => base32Chars.indexOf(value).toString(2).padStart(5, "0")).join("");
const hex = (bits.match(/.{1,8}/g) ?? []).map((chunk) => Number.parseInt(chunk, 2).toString(16).padStart(2, "0")).join("");
return hex;
}
function generateHOTP({ key, counter = 0 }) {
const digest = computeHMACSha1(counter.toString(16).padStart(16, "0"), key);
const bytes = hexToBytes(digest);
const offset = bytes[19] & 15;
const v = (bytes[offset] & 127) << 24 | (bytes[offset + 1] & 255) << 16 | (bytes[offset + 2] & 255) << 8 | bytes[offset + 3] & 255;
const code = String(v % 1e6).padStart(6, "0");
return code;
}
function getCounterFromTime({ now, timeStep }) {
return Math.floor(now / 1e3 / timeStep);
}
function generateTOTP({ key, now = Date.now(), timeStep = 30 }) {
const counter = getCounterFromTime({ now, timeStep });
return generateHOTP({ key, counter });
}
function buildKeyUri({
secret,
app = "IT-Tools",
account = "demo-user",
algorithm = "SHA1",
digits = 6,
period = 30
}) {
const params = {
issuer: app,
secret,
algorithm,
digits,
period
};
const paramsString = _(params).map((value, key) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&");
return `otpauth://totp/${encodeURIComponent(app)}:${encodeURIComponent(account)}?${paramsString}`;
}
function generateSecret() {
return createToken({ length: 16, alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" });
}
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "token-display",
__ssrInlineRender: true,
props: {
tokens: {}
},
setup(__props) {
const props = __props;
const { copy: copyPrevious, isJustCopied: previousCopied } = useCopy({ createToast: false });
const { copy: copyCurrent, isJustCopied: currentCopied } = useCopy({ createToast: false });
const { copy: copyNext, isJustCopied: nextCopied } = useCopy({ createToast: false });
const { tokens } = toRefs(props);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_tooltip = _sfc_main$2;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)}><div mb-5px w-full flex items-center><div flex-1 text-left> Previous </div><div flex-1 text-center> Current OTP </div><div flex-1 text-right> Next </div></div><div flex items-center>`);
_push(ssrRenderComponent(_component_c_tooltip, {
tooltip: unref(previousCopied) ? "Copied !" : "Copy previous OTP",
position: "bottom",
"flex-1": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_button, {
"data-test-id": "previous-otp",
"w-full": "",
"important:h-12": "",
"important:rounded-r-none": "",
"important:font-mono": "",
onClick: ($event) => unref(copyPrevious)(unref(tokens).previous)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(tokens).previous)}`);
} else {
return [
createTextVNode(toDisplayString(unref(tokens).previous), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_button, {
"data-test-id": "previous-otp",
"w-full": "",
"important:h-12": "",
"important:rounded-r-none": "",
"important:font-mono": "",
onClick: withModifiers(($event) => unref(copyPrevious)(unref(tokens).previous), ["prevent"])
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(tokens).previous), 1)
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_tooltip, {
tooltip: unref(currentCopied) ? "Copied !" : "Copy current OTP",
position: "bottom",
"flex-1": "",
"flex-basis-5xl": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_button, {
"data-test-id": "current-otp",
"w-full": "",
"important:border-x": "1px solid gray op-40",
"important:h-12": "",
"important:rounded-0": "",
"important:text-22px": "",
onClick: ($event) => unref(copyCurrent)(unref(tokens).current)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(tokens).current)}`);
} else {
return [
createTextVNode(toDisplayString(unref(tokens).current), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_button, {
"data-test-id": "current-otp",
"w-full": "",
"important:border-x": "1px solid gray op-40",
"important:h-12": "",
"important:rounded-0": "",
"important:text-22px": "",
onClick: withModifiers(($event) => unref(copyCurrent)(unref(tokens).current), ["prevent"])
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(tokens).current), 1)
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_tooltip, {
tooltip: unref(nextCopied) ? "Copied !" : "Copy next OTP",
position: "bottom",
"flex-1": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_button, {
"data-test-id": "next-otp",
"w-full": "",
"important:h-12": "",
"important:rounded-l-none": "",
onClick: ($event) => unref(copyNext)(unref(tokens).next)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(tokens).next)}`);
} else {
return [
createTextVNode(toDisplayString(unref(tokens).next), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_button, {
"data-test-id": "next-otp",
"w-full": "",
"important:h-12": "",
"important:rounded-l-none": "",
onClick: withModifiers(($event) => unref(copyNext)(unref(tokens).next), ["prevent"])
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(tokens).next), 1)
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/otp-code-generator-and-validator/token-display.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "otp-code-generator-and-validator",
__ssrInlineRender: true,
setup(__props) {
const now = useTimestamp();
const interval = computed(() => now.value / 1e3 % 30);
const theme = useThemeVars();
const styleStore = useStyleStore();
const secret = ref(generateSecret());
function refreshSecret() {
secret.value = generateSecret();
}
const [tokens] = computedRefreshable(
() => ({
previous: generateTOTP({ key: secret.value, now: now.value - 3e4 }),
current: generateTOTP({ key: secret.value, now: now.value }),
next: generateTOTP({ key: secret.value, now: now.value + 3e4 })
}),
{ throttle: 500 }
);
const keyUri = computed(() => buildKeyUri({ secret: secret.value }));
const { qrcode } = useQRCode({
text: keyUri,
color: {
background: computed(() => styleStore.isDarkTheme ? "#ffffff" : "#00000000"),
foreground: "#000000"
},
options: { width: 210 }
});
const secretValidationRules = [
{
message: "Secret should be a base32 string",
validator: (value) => value.toUpperCase().match(/^[A-Z234567]+$/)
},
{
message: "Please set a secret",
validator: (value) => value !== ""
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3$1;
const _component_c_tooltip = _sfc_main$2;
const _component_c_button = __unplugin_components_0;
const _component_icon_mdi_refresh = __unplugin_components_3;
const _component_n_progress = NProgress;
const _component_n_image = NImage;
_push(`<!--[--><div style="${ssrRenderStyle({ "max-width": "350px" })}" data-v-388f1b9b>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(secret),
"onUpdate:value": ($event) => isRef(secret) ? secret.value = $event : null,
label: "Secret",
placeholder: "Paste your TOTP secret...",
"mb-5": "",
"validation-rules": secretValidationRules
}, {
suffix: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_tooltip, { tooltip: "Generate a new random secret" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_button, {
circle: "",
variant: "text",
size: "small",
onClick: refreshSecret
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_icon_mdi_refresh, null, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_icon_mdi_refresh)
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_button, {
circle: "",
variant: "text",
size: "small",
onClick: refreshSecret
}, {
default: withCtx(() => [
createVNode(_component_icon_mdi_refresh)
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_tooltip, { tooltip: "Generate a new random secret" }, {
default: withCtx(() => [
createVNode(_component_c_button, {
circle: "",
variant: "text",
size: "small",
onClick: refreshSecret
}, {
default: withCtx(() => [
createVNode(_component_icon_mdi_refresh)
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`<div data-v-388f1b9b>`);
_push(ssrRenderComponent(_sfc_main$1, { tokens: unref(tokens) }, null, _parent));
_push(ssrRenderComponent(_component_n_progress, {
percentage: 100 * unref(interval) / 30,
color: unref(theme).primaryColor,
"show-indicator": false
}, null, _parent));
_push(`<div style="${ssrRenderStyle({ "text-align": "center" })}" data-v-388f1b9b> Next in ${ssrInterpolate(String(Math.floor(30 - unref(interval))).padStart(2, "0"))}s </div></div><div mt-4 flex flex-col items-center justify-center gap-3 data-v-388f1b9b>`);
_push(ssrRenderComponent(_component_n_image, { src: unref(qrcode) }, null, _parent));
_push(ssrRenderComponent(_component_c_button, {
href: unref(keyUri),
target: "_blank"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Open Key URI in new tab `);
} else {
return [
createTextVNode(" Open Key URI in new tab ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div><div style="${ssrRenderStyle({ "max-width": "350px" })}" data-v-388f1b9b>`);
_push(ssrRenderComponent(_sfc_main$3, {
label: "Secret in hexadecimal",
value: unref(base32toHex)(unref(secret)),
readonly: "",
placeholder: "Secret in hex will be displayed here",
"mb-5": ""
}, null, _parent));
_push(ssrRenderComponent(_sfc_main$3, {
label: "Epoch",
value: Math.floor(unref(now) / 1e3).toString(),
readonly: "",
"mb-5": "",
placeholder: "Epoch in sec will be displayed here"
}, null, _parent));
_push(`<p data-v-388f1b9b>Iteration</p>`);
_push(ssrRenderComponent(_sfc_main$3, {
value: String(unref(getCounterFromTime)({ now: unref(now), timeStep: 30 })),
readonly: "",
label: "Count:",
"label-position": "left",
"label-width": "90px",
"label-align": "right",
placeholder: "Iteration count will be displayed here"
}, null, _parent));
_push(ssrRenderComponent(_sfc_main$3, {
value: unref(getCounterFromTime)({ now: unref(now), timeStep: 30 }).toString(16).padStart(16, "0"),
readonly: "",
placeholder: "Iteration count in hex will be displayed here",
"label-position": "left",
"label-width": "90px",
"label-align": "right",
label: "Padded hex:"
}, null, _parent));
_push(`</div><!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const otpCodeGeneratorAndValidator_vue_vue_type_style_index_0_scoped_388f1b9b_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const otpCodeGeneratorAndValidator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-388f1b9b"]]);
export { otpCodeGeneratorAndValidator as default };

1559
dist/server/chunks/chunk-1c9c06f6.js vendored Normal file

File diff suppressed because it is too large Load diff

409
dist/server/chunks/chunk-1de3d145.js vendored Normal file
View file

@ -0,0 +1,409 @@
import { _ as _sfc_main$1 } from './chunk-aab02bfe.js';
import { NDivider, NForm, NFormItem, NSwitch } from 'naive-ui';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, reactive, computed, withCtx, unref, isRef, createVNode, toDisplayString, createTextVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
import cronstrue from 'cronstrue';
import { isValidCron } from 'cron-validator';
import { u as useStyleStore, _ as _export_sfc } from './chunk-6003391e.js';
import 'lodash';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import '@vueuse/core';
import 'pinia';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "crontab-generator",
__ssrInlineRender: true,
setup(__props) {
function isCronValid(v) {
return isValidCron(v, { allowBlankDay: true, alias: true, seconds: true });
}
const styleStore = useStyleStore();
const cron = ref("40 * * * *");
const cronstrueConfig = reactive({
verbose: true,
dayOfWeekStartIndexZero: true,
use24HourTimeFormat: true,
throwExceptionOnParseError: true
});
const helpers = [
{
symbol: "*",
meaning: "Any value",
example: "* * * *",
equivalent: "Every minute"
},
{
symbol: "-",
meaning: "Range of values",
example: "1-10 * * *",
equivalent: "Minutes 1 through 10"
},
{
symbol: ",",
meaning: "List of values",
example: "1,10 * * *",
equivalent: "At minutes 1 and 10"
},
{
symbol: "/",
meaning: "Step values",
example: "*/10 * * *",
equivalent: "Every 10 minutes"
},
{
symbol: "@yearly",
meaning: "Once every year at midnight of 1 January",
example: "@yearly",
equivalent: "0 0 1 1 *"
},
{
symbol: "@annually",
meaning: "Same as @yearly",
example: "@annually",
equivalent: "0 0 1 1 *"
},
{
symbol: "@monthly",
meaning: "Once a month at midnight on the first day",
example: "@monthly",
equivalent: "0 0 1 * *"
},
{
symbol: "@weekly",
meaning: "Once a week at midnight on Sunday morning",
example: "@weekly",
equivalent: "0 0 * * 0"
},
{
symbol: "@daily",
meaning: "Once a day at midnight",
example: "@daily",
equivalent: "0 0 * * *"
},
{
symbol: "@midnight",
meaning: "Same as @daily",
example: "@midnight",
equivalent: "0 0 * * *"
},
{
symbol: "@hourly",
meaning: "Once an hour at the beginning of the hour",
example: "@hourly",
equivalent: "0 * * * *"
},
{
symbol: "@reboot",
meaning: "Run at startup",
example: "",
equivalent: ""
}
];
const cronString = computed(() => {
if (isCronValid(cron.value)) {
return cronstrue.toString(cron.value, cronstrueConfig);
}
return " ";
});
const cronValidationRules = [
{
validator: (value) => isCronValid(value),
message: "This cron is invalid"
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_n_divider = NDivider;
const _component_n_form = NForm;
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_c_table = _sfc_main$1;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div mx-auto max-w-sm data-v-b6cbd7a9${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(cron),
"onUpdate:value": ($event) => isRef(cron) ? cron.value = $event : null,
size: "large",
placeholder: "* * * * *",
"validation-rules": cronValidationRules,
"mb-3": ""
}, null, _parent2, _scopeId));
_push2(`</div><div class="cron-string" data-v-b6cbd7a9${_scopeId}>${ssrInterpolate(unref(cronString))}</div>`);
_push2(ssrRenderComponent(_component_n_divider, null, null, _parent2, _scopeId));
_push2(`<div flex justify-center data-v-b6cbd7a9${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_form, {
"show-feedback": false,
"label-width": "170",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_form_item, { label: "Verbose" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(cronstrueConfig).verbose,
"onUpdate:value": ($event) => unref(cronstrueConfig).verbose = $event
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).verbose,
"onUpdate:value": ($event) => unref(cronstrueConfig).verbose = $event
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, { label: "Use 24 hour time format" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(cronstrueConfig).use24HourTimeFormat,
"onUpdate:value": ($event) => unref(cronstrueConfig).use24HourTimeFormat = $event
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).use24HourTimeFormat,
"onUpdate:value": ($event) => unref(cronstrueConfig).use24HourTimeFormat = $event
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, { label: "Days start at 0" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_switch, {
value: unref(cronstrueConfig).dayOfWeekStartIndexZero,
"onUpdate:value": ($event) => unref(cronstrueConfig).dayOfWeekStartIndexZero = $event
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).dayOfWeekStartIndexZero,
"onUpdate:value": ($event) => unref(cronstrueConfig).dayOfWeekStartIndexZero = $event
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_form_item, { label: "Verbose" }, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).verbose,
"onUpdate:value": ($event) => unref(cronstrueConfig).verbose = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, { label: "Use 24 hour time format" }, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).use24HourTimeFormat,
"onUpdate:value": ($event) => unref(cronstrueConfig).use24HourTimeFormat = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, { label: "Days start at 0" }, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).dayOfWeekStartIndexZero,
"onUpdate:value": ($event) => unref(cronstrueConfig).dayOfWeekStartIndexZero = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode("div", {
"mx-auto": "",
"max-w-sm": ""
}, [
createVNode(_component_c_input_text, {
value: unref(cron),
"onUpdate:value": ($event) => isRef(cron) ? cron.value = $event : null,
size: "large",
placeholder: "* * * * *",
"validation-rules": cronValidationRules,
"mb-3": ""
}, null, 8, ["value", "onUpdate:value"])
]),
createVNode("div", { class: "cron-string" }, toDisplayString(unref(cronString)), 1),
createVNode(_component_n_divider),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_n_form, {
"show-feedback": false,
"label-width": "170",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_form_item, { label: "Verbose" }, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).verbose,
"onUpdate:value": ($event) => unref(cronstrueConfig).verbose = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, { label: "Use 24 hour time format" }, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).use24HourTimeFormat,
"onUpdate:value": ($event) => unref(cronstrueConfig).use24HourTimeFormat = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, { label: "Days start at 0" }, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(cronstrueConfig).dayOfWeekStartIndexZero,
"onUpdate:value": ($event) => unref(cronstrueConfig).dayOfWeekStartIndexZero = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<pre data-v-b6cbd7a9${_scopeId}>┌──────────── [optional] seconds (0 - 59)
| minute (0 - 59)
| | hour (0 - 23)
| | | day of month (1 - 31)
| | | | month (1 - 12) OR jan,feb,mar,apr ...
| | | | | day of week (0 - 6, sunday=0) OR sun,mon ...
| | | | | |
* * * * * * command</pre>`);
if (unref(styleStore).isSmallScreen) {
_push2(`<div data-v-b6cbd7a9${_scopeId}><!--[-->`);
ssrRenderList(helpers, ({ symbol, meaning, example, equivalent }) => {
_push2(ssrRenderComponent(_component_c_card, {
key: symbol,
"mb-3": "",
"important:border-none": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div data-v-b6cbd7a9${_scopeId2}> Symbol: <strong data-v-b6cbd7a9${_scopeId2}>${ssrInterpolate(symbol)}</strong></div><div data-v-b6cbd7a9${_scopeId2}> Meaning: <strong data-v-b6cbd7a9${_scopeId2}>${ssrInterpolate(meaning)}</strong></div><div data-v-b6cbd7a9${_scopeId2}> Example: <strong data-v-b6cbd7a9${_scopeId2}><code data-v-b6cbd7a9${_scopeId2}>${ssrInterpolate(example)}</code></strong></div><div data-v-b6cbd7a9${_scopeId2}> Equivalent: <strong data-v-b6cbd7a9${_scopeId2}>${ssrInterpolate(equivalent)}</strong></div>`);
} else {
return [
createVNode("div", null, [
createTextVNode(" Symbol: "),
createVNode("strong", null, toDisplayString(symbol), 1)
]),
createVNode("div", null, [
createTextVNode(" Meaning: "),
createVNode("strong", null, toDisplayString(meaning), 1)
]),
createVNode("div", null, [
createTextVNode(" Example: "),
createVNode("strong", null, [
createVNode("code", null, toDisplayString(example), 1)
])
]),
createVNode("div", null, [
createTextVNode(" Equivalent: "),
createVNode("strong", null, toDisplayString(equivalent), 1)
])
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]--></div>`);
} else {
_push2(ssrRenderComponent(_component_c_table, { data: helpers }, null, _parent2, _scopeId));
}
} else {
return [
createVNode("pre", null, "┌──────────── [optional] seconds (0 - 59)\n| ┌────────── minute (0 - 59)\n| | ┌──────── hour (0 - 23)\n| | | ┌────── day of month (1 - 31)\n| | | | ┌──── month (1 - 12) OR jan,feb,mar,apr ...\n| | | | | ┌── day of week (0 - 6, sunday=0) OR sun,mon ...\n| | | | | |\n* * * * * * command"),
unref(styleStore).isSmallScreen ? (openBlock(), createBlock("div", { key: 0 }, [
(openBlock(), createBlock(Fragment, null, renderList(helpers, ({ symbol, meaning, example, equivalent }) => {
return createVNode(_component_c_card, {
key: symbol,
"mb-3": "",
"important:border-none": ""
}, {
default: withCtx(() => [
createVNode("div", null, [
createTextVNode(" Symbol: "),
createVNode("strong", null, toDisplayString(symbol), 1)
]),
createVNode("div", null, [
createTextVNode(" Meaning: "),
createVNode("strong", null, toDisplayString(meaning), 1)
]),
createVNode("div", null, [
createTextVNode(" Example: "),
createVNode("strong", null, [
createVNode("code", null, toDisplayString(example), 1)
])
]),
createVNode("div", null, [
createTextVNode(" Equivalent: "),
createVNode("strong", null, toDisplayString(equivalent), 1)
])
]),
_: 2
}, 1024);
}), 64))
])) : (openBlock(), createBlock(_component_c_table, {
key: 1,
data: helpers
}))
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const crontabGenerator_vue_vue_type_style_index_0_scoped_b6cbd7a9_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/crontab-generator/crontab-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const crontabGenerator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b6cbd7a9"]]);
export { crontabGenerator as default };

96
dist/server/chunks/chunk-1eb3c783.js vendored Normal file
View file

@ -0,0 +1,96 @@
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, withCtx, unref, createTextVNode, createVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { a as randIntFromInterval } from './chunk-11f44f81.js';
import { c as computedRefreshable } from './chunk-cc665c88.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import 'naive-ui';
const generatePort = () => randIntFromInterval(1024, 65535);
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "random-port-generator",
__ssrInlineRender: true,
setup(__props) {
const [port, refreshPort] = computedRefreshable(() => String(generatePort()));
const { copy } = useCopy({ source: port, text: "Port copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_button = __unplugin_components_0;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div class="port" data-v-9a5a7fb0${_scopeId}>${ssrInterpolate(unref(port))}</div><div flex justify-center gap-3 data-v-9a5a7fb0${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_button, { onClick: unref(refreshPort) }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Refresh `);
} else {
return [
createTextVNode(" Refresh ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode("div", { class: "port" }, toDisplayString(unref(port)), 1),
createVNode("div", {
flex: "",
"justify-center": "",
"gap-3": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_c_button, { onClick: unref(refreshPort) }, {
default: withCtx(() => [
createTextVNode(" Refresh ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
};
}
});
/* unplugin-vue-components disabled */const randomPortGenerator_vue_vue_type_style_index_0_scoped_9a5a7fb0_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/random-port-generator/random-port-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const randomPortGenerator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9a5a7fb0"]]);
export { randomPortGenerator as default };

327
dist/server/chunks/chunk-20591126.js vendored Normal file
View file

@ -0,0 +1,327 @@
import { NTable } from 'naive-ui';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, openBlock, createBlock, Fragment, renderList, toDisplayString, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import jwtDecode from 'jwt-decode';
import _ from 'lodash';
import { u as useValidation } from './chunk-35c3d701.js';
import { i as isNotThrowing } from './chunk-5697d061.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-11f44f81.js';
import '@vueuse/core';
import 'pinia';
const ALGORITHM_DESCRIPTIONS = {
HS256: "HMAC using SHA-256",
HS384: "HMAC using SHA-384",
HS512: "HMAC using SHA-512",
RS256: "RSASSA-PKCS1-v1_5 using SHA-256",
RS384: "RSASSA-PKCS1-v1_5 using SHA-384",
RS512: "RSASSA-PKCS1-v1_5 using SHA-512",
ES256: "ECDSA using P-256 and SHA-256",
ES384: "ECDSA using P-384 and SHA-384",
ES512: "ECDSA using P-521 and SHA-512",
PS256: "RSASSA-PSS using SHA-256 and MGF1 with SHA-256",
PS384: "RSASSA-PSS using SHA-384 and MGF1 with SHA-384",
PS512: "RSASSA-PSS using SHA-512 and MGF1 with SHA-512",
none: "No digital signature or MAC performed"
};
const CLAIM_DESCRIPTIONS = {
typ: "Type",
alg: "Algorithm",
iss: "Issuer",
sub: "Subject",
aud: "Audience",
exp: "Expiration Time",
nbf: "Not Before",
iat: "Issued At",
jti: "JWT ID",
name: "Full name",
given_name: "Given name(s) or first name(s)",
family_name: "Surname(s) or last name(s)",
middle_name: "Middle name(s)",
nickname: "Casual name",
preferred_username: "Shorthand name by which the End-User wishes to be referred to",
profile: "Profile page URL",
picture: "Profile picture URL",
website: "Web page or blog URL",
email: "Preferred e-mail address",
email_verified: "True if the e-mail address has been verified; otherwise false",
gender: "Gender",
birthdate: "Birthday",
zoneinfo: "Time zone",
locale: "Locale",
phone_number: "Preferred telephone number",
phone_number_verified: "True if the phone number has been verified; otherwise false",
address: "Preferred postal address",
updated_at: "Time the information was last updated",
azp: "Authorized party - the party to which the ID Token was issued",
nonce: "Value used to associate a Client session with an ID Token",
auth_time: "Time when the authentication occurred",
at_hash: "Access Token hash value",
c_hash: "Code hash value",
acr: "Authentication Context Class Reference",
amr: "Authentication Methods References",
sub_jwk: "Public key used to check the signature of an ID Token",
cnf: "Confirmation",
sip_from_tag: "SIP From tag header field parameter value",
sip_date: "SIP Date header field value",
sip_callid: "SIP Call-Id header field value",
sip_cseq_num: "SIP CSeq numeric header field parameter value",
sip_via_branch: "SIP Via branch header field parameter value",
orig: "Originating Identity String",
dest: "Destination Identity String",
mky: "Media Key Fingerprint String",
events: "Security Events",
toe: "Time of Event",
txn: "Transaction Identifier",
rph: "Resource Priority Header Authorization",
sid: "Session ID",
vot: "Vector of Trust value",
vtm: "Vector of Trust trustmark URL",
attest: "Attestation level as defined in SHAKEN framework",
origid: "Originating Identifier as defined in SHAKEN framework",
act: "Actor",
scope: "Scope Values",
client_id: "Client Identifier",
may_act: "Authorized Actor - the party that is authorized to become the actor",
jcard: "jCard data",
at_use_nbr: "Number of API requests for which the access token can be used",
div: "Diverted Target of a Call",
opt: "Original PASSporT (in Full Form)",
vc: "Verifiable Credential as specified in the W3C Recommendation",
vp: "Verifiable Presentation as specified in the W3C Recommendation",
sph: "SIP Priority header field",
ace_profile: "ACE profile a token is supposed to be used with.",
cnonce: "Client nonce",
exi: "Expires in",
roles: "Roles",
groups: "Groups",
entitlements: "Entitlements",
token_introspection: "Token introspection response"
};
function decodeJwt({ jwt }) {
const rawHeader = jwtDecode(jwt, { header: true });
const rawPayload = jwtDecode(jwt);
const header = _.map(rawHeader, (value, claim) => parseClaims({ claim, value }));
const payload = _.map(rawPayload, (value, claim) => parseClaims({ claim, value }));
return {
header,
payload
};
}
function parseClaims({ claim, value }) {
const claimDescription = CLAIM_DESCRIPTIONS[claim];
const formattedValue = _.isPlainObject(value) || _.isArray(value) ? JSON.stringify(value, null, 3) : _.toString(value);
const friendlyValue = getFriendlyValue({ claim, value });
return {
value: formattedValue,
friendlyValue,
claim,
claimDescription
};
}
function getFriendlyValue({ claim, value }) {
if (["exp", "nbf", "iat"].includes(claim)) {
return dateFormatter(value);
}
if (claim === "alg" && _.isString(value)) {
return ALGORITHM_DESCRIPTIONS[value];
}
return void 0;
}
function dateFormatter(value) {
if (_.isNil(value)) {
return void 0;
}
const date = new Date(Number(value) * 1e3);
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "jwt-parser",
__ssrInlineRender: true,
setup(__props) {
const rawJwt = ref(
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
);
const decodedJWT = computed(
() => withDefaultOnError(() => decodeJwt({ jwt: rawJwt.value }), { header: [], payload: [] })
);
const sections = [
{ key: "header", title: "Header" },
{ key: "payload", title: "Payload" }
];
const validation = useValidation({
source: rawJwt,
rules: [
{
validator: (value) => value.length > 0 && isNotThrowing(() => decodeJwt({ jwt: rawJwt.value })),
message: "Invalid JWT"
}
]
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_n_table = NTable;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(rawJwt),
"onUpdate:value": ($event) => isRef(rawJwt) ? rawJwt.value = $event : null,
label: "JWT to decode",
validation: unref(validation),
placeholder: "Put your token here...",
rows: "5",
multiline: "",
"raw-text": "",
autofocus: "",
"mb-3": ""
}, null, _parent2, _scopeId));
if (unref(validation).isValid) {
_push2(ssrRenderComponent(_component_n_table, null, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<tbody data-v-a66f36d1${_scopeId2}><!--[-->`);
ssrRenderList(sections, (section) => {
_push3(`<!--[--><th colspan="2" class="table-header" data-v-a66f36d1${_scopeId2}>${ssrInterpolate(section.title)}</th><!--[-->`);
ssrRenderList(unref(decodedJWT)[section.key], ({ claim, claimDescription, friendlyValue, value }) => {
_push3(`<tr data-v-a66f36d1${_scopeId2}><td class="claims" data-v-a66f36d1${_scopeId2}><span font-bold data-v-a66f36d1${_scopeId2}>${ssrInterpolate(claim)}</span>`);
if (claimDescription) {
_push3(`<span ml-2 op-70 data-v-a66f36d1${_scopeId2}> (${ssrInterpolate(claimDescription)}) </span>`);
} else {
_push3(`<!---->`);
}
_push3(`</td><td data-v-a66f36d1${_scopeId2}><span data-v-a66f36d1${_scopeId2}>${ssrInterpolate(value)}</span>`);
if (friendlyValue) {
_push3(`<span ml-2 op-70 data-v-a66f36d1${_scopeId2}> (${ssrInterpolate(friendlyValue)}) </span>`);
} else {
_push3(`<!---->`);
}
_push3(`</td></tr>`);
});
_push3(`<!--]--><!--]-->`);
});
_push3(`<!--]--></tbody>`);
} else {
return [
createVNode("tbody", null, [
(openBlock(), createBlock(Fragment, null, renderList(sections, (section) => {
return openBlock(), createBlock(Fragment, {
key: section.key
}, [
createVNode("th", {
colspan: "2",
class: "table-header"
}, toDisplayString(section.title), 1),
(openBlock(true), createBlock(Fragment, null, renderList(unref(decodedJWT)[section.key], ({ claim, claimDescription, friendlyValue, value }) => {
return openBlock(), createBlock("tr", {
key: claim + value
}, [
createVNode("td", { class: "claims" }, [
createVNode("span", { "font-bold": "" }, toDisplayString(claim), 1),
claimDescription ? (openBlock(), createBlock("span", {
key: 0,
"ml-2": "",
"op-70": ""
}, " (" + toDisplayString(claimDescription) + ") ", 1)) : createCommentVNode("", true)
]),
createVNode("td", null, [
createVNode("span", null, toDisplayString(value), 1),
friendlyValue ? (openBlock(), createBlock("span", {
key: 0,
"ml-2": "",
"op-70": ""
}, " (" + toDisplayString(friendlyValue) + ") ", 1)) : createCommentVNode("", true)
])
]);
}), 128))
], 64);
}), 64))
])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
} else {
return [
createVNode(_component_c_input_text, {
value: unref(rawJwt),
"onUpdate:value": ($event) => isRef(rawJwt) ? rawJwt.value = $event : null,
label: "JWT to decode",
validation: unref(validation),
placeholder: "Put your token here...",
rows: "5",
multiline: "",
"raw-text": "",
autofocus: "",
"mb-3": ""
}, null, 8, ["value", "onUpdate:value", "validation"]),
unref(validation).isValid ? (openBlock(), createBlock(_component_n_table, { key: 0 }, {
default: withCtx(() => [
createVNode("tbody", null, [
(openBlock(), createBlock(Fragment, null, renderList(sections, (section) => {
return openBlock(), createBlock(Fragment, {
key: section.key
}, [
createVNode("th", {
colspan: "2",
class: "table-header"
}, toDisplayString(section.title), 1),
(openBlock(true), createBlock(Fragment, null, renderList(unref(decodedJWT)[section.key], ({ claim, claimDescription, friendlyValue, value }) => {
return openBlock(), createBlock("tr", {
key: claim + value
}, [
createVNode("td", { class: "claims" }, [
createVNode("span", { "font-bold": "" }, toDisplayString(claim), 1),
claimDescription ? (openBlock(), createBlock("span", {
key: 0,
"ml-2": "",
"op-70": ""
}, " (" + toDisplayString(claimDescription) + ") ", 1)) : createCommentVNode("", true)
]),
createVNode("td", null, [
createVNode("span", null, toDisplayString(value), 1),
friendlyValue ? (openBlock(), createBlock("span", {
key: 0,
"ml-2": "",
"op-70": ""
}, " (" + toDisplayString(friendlyValue) + ") ", 1)) : createCommentVNode("", true)
])
]);
}), 128))
], 64);
}), 64))
])
]),
_: 1
})) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
};
}
});
/* unplugin-vue-components disabled */const jwtParser_vue_vue_type_style_index_0_scoped_a66f36d1_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/jwt-parser/jwt-parser.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const jwtParser = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a66f36d1"]]);
export { jwtParser as default };

148
dist/server/chunks/chunk-214b1f37.js vendored Normal file
View file

@ -0,0 +1,148 @@
import { a as __unplugin_components_0$1 } from './chunk-6003391e.js';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, mergeProps, unref, isRef, withCtx, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import { HmacMD5, HmacRIPEMD160, HmacSHA1, HmacSHA3, HmacSHA224, HmacSHA256, HmacSHA384, HmacSHA512, enc } from 'crypto-js';
import { c as convertHexToBin } from './chunk-915ca1f7.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import './chunk-95ec8cf7.js';
import './chunk-8109fd17.js';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import 'naive-ui';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "hmac-generator",
__ssrInlineRender: true,
setup(__props) {
const algos = {
MD5: HmacMD5,
RIPEMD160: HmacRIPEMD160,
SHA1: HmacSHA1,
SHA3: HmacSHA3,
SHA224: HmacSHA224,
SHA256: HmacSHA256,
SHA384: HmacSHA384,
SHA512: HmacSHA512
};
function formatWithEncoding(words, encoding2) {
if (encoding2 === "Bin") {
return convertHexToBin(words.toString(enc.Hex));
}
return words.toString(enc[encoding2]);
}
const plainText = ref("");
const secret = ref("");
const hashFunction = ref("SHA256");
const encoding = ref("Hex");
const hmac = computed(
() => formatWithEncoding(algos[hashFunction.value](plainText.value, secret.value), encoding.value)
);
const { copy } = useCopy({ source: hmac });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_select = __unplugin_components_0;
const _component_input_copyable = _sfc_main$1;
const _component_c_button = __unplugin_components_0$1;
_push(`<div${ssrRenderAttrs(mergeProps({
flex: "",
"flex-col": "",
"gap-4": ""
}, _attrs))}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(plainText),
"onUpdate:value": ($event) => isRef(plainText) ? plainText.value = $event : null,
multiline: "",
"raw-text": "",
placeholder: "Plain text to compute the hash...",
rows: "3",
autosize: "",
autofocus: "",
label: "Plain text to compute the hash"
}, null, _parent));
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(secret),
"onUpdate:value": ($event) => isRef(secret) ? secret.value = $event : null,
"raw-text": "",
placeholder: "Enter the secret key...",
label: "Secret key",
clearable: ""
}, null, _parent));
_push(`<div flex gap-2>`);
_push(ssrRenderComponent(_component_c_select, {
value: unref(hashFunction),
"onUpdate:value": ($event) => isRef(hashFunction) ? hashFunction.value = $event : null,
label: "Hashing function",
"flex-1": "",
placeholder: "Select an hashing function...",
options: Object.keys(algos).map((label) => ({ label, value: label }))
}, null, _parent));
_push(ssrRenderComponent(_component_c_select, {
value: unref(encoding),
"onUpdate:value": ($event) => isRef(encoding) ? encoding.value = $event : null,
label: "Output encoding",
"flex-1": "",
placeholder: "Select the result encoding...",
options: [
{
label: "Binary (base 2)",
value: "Bin"
},
{
label: "Hexadecimal (base 16)",
value: "Hex"
},
{
label: "Base64 (base 64)",
value: "Base64"
},
{
label: "Base64-url (base 64 with url safe chars)",
value: "Base64url"
}
]
}, null, _parent));
_push(`</div>`);
_push(ssrRenderComponent(_component_input_copyable, {
value: unref(hmac),
"onUpdate:value": ($event) => isRef(hmac) ? hmac.value = $event : null,
type: "textarea",
placeholder: "The result of the HMAC...",
label: "HMAC of your text"
}, null, _parent));
_push(`<div flex justify-center>`);
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy HMAC `);
} else {
return [
createTextVNode(" Copy HMAC ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/hmac-generator/hmac-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

181
dist/server/chunks/chunk-219cdc41.js vendored Normal file
View file

@ -0,0 +1,181 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as _sfc_main$1 } from './chunk-000e277f.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NInputNumber } from 'naive-ui';
import { defineComponent, ref, mergeProps, unref, isRef, withCtx, createVNode, toDisplayString, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
import { c as computedRefreshable } from './chunk-cc665c88.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import { u as usePartialMacAddressValidation } from './chunk-65bb8b4f.js';
import { useStorage } from '@vueuse/core';
import 'pinia';
import './chunk-bb5bb4f6.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
function splitPrefix(prefix) {
const base = prefix.match(/[^0-9a-f]/i) === null ? prefix.match(/.{1,2}/g) ?? [] : prefix.split(/[^0-9a-f]/i);
return base.filter(Boolean).map((byte) => byte.padStart(2, "0"));
}
function generateRandomMacAddress({ prefix: rawPrefix = "", separator = ":", getRandomByte = () => _.random(0, 255).toString(16).padStart(2, "0") } = {}) {
const prefix = splitPrefix(rawPrefix);
const randomBytes = _.times(6 - prefix.length, getRandomByte);
const bytes = [...prefix, ...randomBytes];
return bytes.join(separator);
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "mac-address-generator",
__ssrInlineRender: true,
setup(__props) {
const amount = useStorage("mac-address-generator-amount", 1);
const macAddressPrefix = useStorage("mac-address-generator-prefix", "64:16:7F");
const prefixValidation = usePartialMacAddressValidation(macAddressPrefix);
const casesTransformers = [
{ label: "Uppercase", value: (value) => value.toUpperCase() },
{ label: "Lowercase", value: (value) => value.toLowerCase() }
];
const caseTransformer = ref(casesTransformers[0].value);
const separators = [
{
label: ":",
value: ":"
},
{
label: "-",
value: "-"
},
{
label: ".",
value: "."
},
{
label: "None",
value: ""
}
];
const separator = useStorage("mac-address-generator-separator", separators[0].value);
const [macAddresses, refreshMacAddresses] = computedRefreshable(() => {
if (!prefixValidation.isValid) {
return "";
}
const ids = _.times(amount.value, () => caseTransformer.value(generateRandomMacAddress({
prefix: macAddressPrefix.value,
separator: separator.value
})));
return ids.join("\n");
});
const { copy } = useCopy({ source: macAddresses, text: "MAC addresses copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_n_input_number = NInputNumber;
const _component_c_input_text = __unplugin_components_3;
const _component_c_buttons_select = _sfc_main$1;
const _component_c_card = __unplugin_components_1;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(mergeProps({
flex: "",
"flex-col": "",
"justify-center": "",
"gap-2": ""
}, _attrs))}><div flex items-center><label w-150px pr-12px text-right> Quantity:</label>`);
_push(ssrRenderComponent(_component_n_input_number, {
value: unref(amount),
"onUpdate:value": ($event) => isRef(amount) ? amount.value = $event : null,
min: "1",
max: "100",
"flex-1": ""
}, null, _parent));
_push(`</div>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(macAddressPrefix),
"onUpdate:value": ($event) => isRef(macAddressPrefix) ? macAddressPrefix.value = $event : null,
label: "MAC address prefix:",
placeholder: "Set a prefix, e.g. 64:16:7F",
clearable: "",
"label-position": "left",
spellcheck: "false",
validation: unref(prefixValidation),
"raw-text": "",
"label-width": "150px",
"label-align": "right"
}, null, _parent));
_push(ssrRenderComponent(_component_c_buttons_select, {
value: unref(caseTransformer),
"onUpdate:value": ($event) => isRef(caseTransformer) ? caseTransformer.value = $event : null,
options: casesTransformers,
label: "Case:",
"label-width": "150px",
"label-align": "right"
}, null, _parent));
_push(ssrRenderComponent(_component_c_buttons_select, {
value: unref(separator),
"onUpdate:value": ($event) => isRef(separator) ? separator.value = $event : null,
options: separators,
label: "Separator:",
"label-width": "150px",
"label-align": "right"
}, null, _parent));
_push(ssrRenderComponent(_component_c_card, {
"mt-5": "",
flex: "",
"data-test-id": "ulids"
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<pre m-0 m-x-auto${_scopeId}>${ssrInterpolate(unref(macAddresses))}</pre>`);
} else {
return [
createVNode("pre", {
"m-0": "",
"m-x-auto": ""
}, toDisplayString(unref(macAddresses)), 1)
];
}
}),
_: 1
}, _parent));
_push(`<div flex justify-center gap-2>`);
_push(ssrRenderComponent(_component_c_button, {
"data-test-id": "refresh",
onClick: ($event) => unref(refreshMacAddresses)()
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Refresh `);
} else {
return [
createTextVNode(" Refresh ")
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/mac-address-generator/mac-address-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

72
dist/server/chunks/chunk-257ded60.js vendored Normal file
View file

@ -0,0 +1,72 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import slugify from '@sindresorhus/slugify';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import 'naive-ui';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "slugify-string",
__ssrInlineRender: true,
setup(__props) {
const input = ref("");
const slug = computed(() => withDefaultOnError(() => slugify(input.value), ""));
const { copy } = useCopy({ source: slug, text: "Slug copied to clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
multiline: "",
placeholder: "Put your string here (ex: My file path)",
label: "Your string to slugify",
autofocus: "",
"raw-text": "",
"mb-5": ""
}, null, _parent));
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(slug),
multiline: "",
readonly: "",
placeholder: "You slug will be generated here (ex: my-file-path)",
label: "Your slug",
"mb-5": ""
}, null, _parent));
_push(`<div flex justify-center>`);
_push(ssrRenderComponent(_component_c_button, {
disabled: unref(slug).length === 0,
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy slug `);
} else {
return [
createTextVNode(" Copy slug ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/slugify-string/slugify-string.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

20
dist/server/chunks/chunk-264f08b8.js vendored Normal file
View file

@ -0,0 +1,20 @@
import { s as shuffleString } from './chunk-11f44f81.js';
function createToken({
withUppercase = true,
withLowercase = true,
withNumbers = true,
withSymbols = false,
length = 64,
alphabet
}) {
const allAlphabet = alphabet ?? [
withUppercase ? "ABCDEFGHIJKLMOPQRSTUVWXYZ" : "",
withLowercase ? "abcdefghijklmopqrstuvwxyz" : "",
withNumbers ? "0123456789" : "",
withSymbols ? `.,;:!?./-"'#{([-|\\@)]=}*+` : ""
].join("");
return shuffleString(allAlphabet.repeat(length)).substring(0, length);
}
export { createToken as c };

405
dist/server/chunks/chunk-271a1e8d.js vendored Normal file
View file

@ -0,0 +1,405 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { createVNode, Fragment, createTextVNode, defineComponent, ref, toRefs, computed, unref, mergeProps, withCtx, isRef, openBlock, createBlock, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import JSON5 from 'json5';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { NFormItem, NSwitch } from 'naive-ui';
import _ from 'lodash';
import { u as useCopy } from './chunk-77c5cc16.js';
import { c as useAppTheme, _ as _export_sfc } from './chunk-6003391e.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { i as isNotThrowing } from './chunk-5697d061.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import '@vueuse/core';
import 'pinia';
function diff(obj, newObj, { onlyShowDifferences = false } = {}) {
if (_.isArray(obj) && _.isArray(newObj)) {
return {
key: "",
type: "array",
children: diffArrays(obj, newObj, { onlyShowDifferences }),
oldValue: obj,
value: newObj,
status: getStatus(obj, newObj)
};
}
if (_.isObject(obj) && _.isObject(newObj)) {
return {
key: "",
type: "object",
children: diffObjects(obj, newObj, { onlyShowDifferences }),
oldValue: obj,
value: newObj,
status: getStatus(obj, newObj)
};
}
return {
key: "",
type: "value",
oldValue: obj,
value: newObj,
status: getStatus(obj, newObj)
};
}
function diffObjects(obj, newObj, { onlyShowDifferences = false } = {}) {
const keys = Object.keys({ ...obj, ...newObj });
return keys.map((key) => createDifference(obj?.[key], newObj?.[key], key, { onlyShowDifferences })).filter((diff2) => !onlyShowDifferences || diff2.status !== "unchanged");
}
function createDifference(value, newValue, key, { onlyShowDifferences = false } = {}) {
const type = getType(value);
if (type === "object") {
return {
key,
type,
children: diffObjects(value, newValue, {
onlyShowDifferences
}),
oldValue: value,
value: newValue,
status: getStatus(value, newValue)
};
}
if (type === "array") {
return {
key,
type,
children: diffArrays(value, newValue, { onlyShowDifferences }),
value: newValue,
oldValue: value,
status: getStatus(value, newValue)
};
}
return {
key,
type,
value: newValue,
oldValue: value,
status: getStatus(value, newValue)
};
}
function diffArrays(arr, newArr, { onlyShowDifferences = false } = {}) {
const maxLength = Math.max(0, arr?.length, newArr?.length);
return Array.from(
{ length: maxLength },
(_2, i) => createDifference(arr?.[i], newArr?.[i], i, { onlyShowDifferences })
).filter((diff2) => !onlyShowDifferences || diff2.status !== "unchanged");
}
function getType(value) {
if (value === null) {
return "value";
}
if (Array.isArray(value)) {
return "array";
}
if (typeof value === "object") {
return "object";
}
return "value";
}
function getStatus(value, newValue) {
if (value === void 0) {
return "added";
}
if (newValue === void 0) {
return "removed";
}
const bothAreObjects = getType(value) === "object" && getType(newValue) === "object";
const bothAreArrays = getType(value) === "array" && getType(newValue) === "array";
const bothAreDeepEqual = _.isEqual(value, newValue);
if (bothAreDeepEqual) {
return "unchanged";
}
if (bothAreObjects || bothAreArrays) {
return "children-updated";
}
return "updated";
}
function DiffRootViewer({
diff
}) {
return createVNode("div", {
"class": 'diffs-viewer'
}, [createVNode("ul", null, [DiffViewer({
diff,
showKeys: false
})])]);
}
function DiffViewer({
diff,
showKeys = true
}) {
const {
type,
status
} = diff;
if (status === 'updated') {
return ComparisonViewer({
diff,
showKeys
});
}
if (type === 'array') {
return ChildrenViewer({
diff,
showKeys,
showChildrenKeys: false,
openTag: '[',
closeTag: ']'
});
}
if (type === 'object') {
return ChildrenViewer({
diff,
showKeys,
openTag: '{',
closeTag: '}'
});
}
return LineDiffViewer({
diff,
showKeys
});
}
function LineDiffViewer({
diff,
showKeys
}) {
const {
value,
key,
status,
oldValue
} = diff;
const valueToDisplay = status === 'removed' ? oldValue : value;
return createVNode("li", null, [createVNode("span", {
"class": [status, 'result']
}, [showKeys && createVNode(Fragment, null, [createVNode("span", {
"class": 'key'
}, [key]), ': ']), Value({
value: valueToDisplay,
status
})]), createTextVNode(",")]);
}
function ComparisonViewer({
diff,
showKeys
}) {
const {
value,
key,
oldValue
} = diff;
return createVNode("li", {
"class": 'updated-line'
}, [showKeys && createVNode(Fragment, null, [createVNode("span", {
"class": 'key'
}, [key]), ': ']), Value({
value: oldValue,
status: 'removed'
}), Value({
value,
status: 'added'
}), createTextVNode(",")]);
}
function ChildrenViewer({
diff,
openTag,
closeTag,
showKeys,
showChildrenKeys = true
}) {
const {
children,
key,
status,
type
} = diff;
return createVNode("li", null, [createVNode("div", {
"class": [type, status],
"style": {
display: 'inline-block'
}
}, [showKeys && createVNode(Fragment, null, [createVNode("span", {
"class": 'key'
}, [key]), ': ']), openTag, children.length > 0 && createVNode("ul", null, [children.map(diff => DiffViewer({
diff,
showKeys: showChildrenKeys
}))]), `${closeTag},`])]);
}
function formatValue(value) {
if (_.isNull(value)) {
return 'null';
}
return JSON.stringify(value);
}
function Value({
value,
status
}) {
const formatedValue = formatValue(value);
const {
copy
} = useCopy({
source: formatedValue
});
return createVNode("span", {
"class": ['value', status],
"onClick": () => copy()
}, [formatedValue]);
}
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "diff-viewer",
__ssrInlineRender: true,
props: {
leftJson: {},
rightJson: {}
},
setup(__props) {
const props = __props;
const onlyShowDifferences = ref(false);
const { leftJson, rightJson } = toRefs(props);
const appTheme = useAppTheme();
const result = computed(
() => diff(leftJson.value, rightJson.value, { onlyShowDifferences: onlyShowDifferences.value })
);
const jsonAreTheSame = computed(() => _.isEqual(leftJson.value, rightJson.value));
const showResults = computed(() => !_.isUndefined(leftJson.value) && !_.isUndefined(rightJson.value));
return (_ctx, _push, _parent, _attrs) => {
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_c_card = __unplugin_components_1;
const _cssVars = { style: {
"--7a613f80": unref(appTheme).text.mutedColor,
"--ed7825ee": unref(appTheme).success.colorFaded,
"--31e3079f": unref(appTheme).success.color,
"--8956bfb8": unref(appTheme).error.colorFaded,
"--3a20e0b8": unref(appTheme).error.color,
"--29d2da8a": unref(appTheme).text.baseColor
} };
if (unref(showResults)) {
_push(`<div${ssrRenderAttrs(mergeProps(_attrs, _cssVars))} data-v-d84bb557><div flex justify-center data-v-d84bb557>`);
_push(ssrRenderComponent(_component_n_form_item, {
label: "Only show differences",
"label-placement": "left"
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_switch, {
value: unref(onlyShowDifferences),
"onUpdate:value": ($event) => isRef(onlyShowDifferences) ? onlyShowDifferences.value = $event : null
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_switch, {
value: unref(onlyShowDifferences),
"onUpdate:value": ($event) => isRef(onlyShowDifferences) ? onlyShowDifferences.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
_push(ssrRenderComponent(_component_c_card, { "data-test-id": "diff-result" }, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
if (unref(jsonAreTheSame)) {
_push2(`<div text-center op-70 data-v-d84bb557${_scopeId}> The provided JSONs are the same </div>`);
} else {
_push2(ssrRenderComponent(unref(DiffRootViewer), { diff: unref(result) }, null, _parent2, _scopeId));
}
} else {
return [
unref(jsonAreTheSame) ? (openBlock(), createBlock("div", {
key: 0,
"text-center": "",
"op-70": ""
}, " The provided JSONs are the same ")) : (openBlock(), createBlock(unref(DiffRootViewer), {
key: 1,
diff: unref(result)
}, null, 8, ["diff"]))
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
};
}
});
/* unplugin-vue-components disabled */const diffViewer_vue_vue_type_style_index_0_scoped_d84bb557_lang = '';
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/json-diff/diff-viewer/diff-viewer.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const DiffsViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d84bb557"]]);
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "json-diff",
__ssrInlineRender: true,
setup(__props) {
const rawLeftJson = ref("");
const rawRightJson = ref("");
const leftJson = computed(() => withDefaultOnError(() => JSON5.parse(rawLeftJson.value), void 0));
const rightJson = computed(() => withDefaultOnError(() => JSON5.parse(rawRightJson.value), void 0));
const jsonValidationRules = [
{
validator: (value) => value === "" || isNotThrowing(() => JSON5.parse(value)),
message: "Invalid JSON format"
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(rawLeftJson),
"onUpdate:value": ($event) => isRef(rawLeftJson) ? rawLeftJson.value = $event : null,
"validation-rules": jsonValidationRules,
label: "Your first JSON",
placeholder: "Paste your first JSON here...",
rows: "20",
multiline: "",
"test-id": "leftJson",
"raw-text": "",
monospace: ""
}, null, _parent));
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(rawRightJson),
"onUpdate:value": ($event) => isRef(rawRightJson) ? rawRightJson.value = $event : null,
"validation-rules": jsonValidationRules,
label: "Your JSON to compare",
placeholder: "Paste your JSON to compare here...",
rows: "20",
multiline: "",
"test-id": "rightJson",
"raw-text": "",
monospace: ""
}, null, _parent));
_push(ssrRenderComponent(DiffsViewer, {
"left-json": unref(leftJson),
"right-json": unref(rightJson)
}, null, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/json-diff/json-diff.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

125
dist/server/chunks/chunk-28375bc9.js vendored Normal file
View file

@ -0,0 +1,125 @@
import { openBlock, createElementBlock, createElementVNode, defineComponent, toRefs, computed, unref, mergeProps, createVNode, resolveDynamicComponent, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderVNode, ssrInterpolate } from 'vue/server-renderer';
import { d as defineThemes, b as appThemes, e as darken, _ as _export_sfc } from './chunk-6003391e.js';
const _hoisted_1$1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$1 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M11 15h2v2h-2v-2m0-8h2v6h-2V7m1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8Z"
}, null, -1);
const _hoisted_3$1 = [
_hoisted_2$1
];
function render$1(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1))
}
const WarningIcon = { name: 'mdi-alert-circle-outline', render: render$1 };
/* vite-plugin-components disabled */
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M12 20c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m0-18C6.47 2 2 6.47 2 12s4.47 10 10 10s10-4.47 10-10S17.53 2 12 2m2.59 6L12 10.59L9.41 8L8 9.41L10.59 12L8 14.59L9.41 16L12 13.41L14.59 16L16 14.59L13.41 12L16 9.41L14.59 8Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const ErrorIcon = { name: 'mdi-close-circle-outline', render };
/* vite-plugin-components disabled */
const { useTheme } = defineThemes({
dark: {
warning: {
backgroundColor: appThemes.dark.warning.colorFaded,
borderColor: appThemes.dark.warning.color,
textColor: appThemes.dark.warning.color,
icon: WarningIcon
},
error: {
backgroundColor: appThemes.dark.error.colorFaded,
borderColor: appThemes.dark.error.color,
textColor: appThemes.dark.error.color,
icon: ErrorIcon
}
},
light: {
warning: {
backgroundColor: appThemes.light.warning.colorFaded,
borderColor: appThemes.light.warning.color,
textColor: darken(appThemes.light.warning.color, 40),
icon: WarningIcon
},
error: {
backgroundColor: appThemes.light.error.colorFaded,
borderColor: appThemes.light.error.color,
textColor: darken(appThemes.light.error.color, 40),
icon: ErrorIcon
}
}
});
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-alert",
__ssrInlineRender: true,
props: {
type: { default: "warning" },
title: { default: void 0 }
},
setup(__props) {
const props = __props;
const { type, title } = toRefs(props);
const theme = useTheme();
const variantTheme = computed(() => theme.value[type.value]);
return (_ctx, _push, _parent, _attrs) => {
const _cssVars = { style: {
"--2d6e05b1": unref(variantTheme).backgroundColor,
"--a966dbdc": unref(variantTheme).textColor
} };
_push(`<div${ssrRenderAttrs(mergeProps({
class: "c-alert",
flex: "",
"items-center": "",
"b-rd-4px": "",
"pa-5": ""
}, _attrs, _cssVars))} data-v-d1c7f863><div class="c-alert--icon" mr-4 text-40px op-60 data-v-d1c7f863>`);
ssrRenderSlot(_ctx.$slots, "icon", {}, () => {
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(variantTheme).icon), null, null), _parent);
}, _push, _parent);
_push(`</div><div class="c-alert--content" data-v-d1c7f863>`);
if (unref(title)) {
_push(`<div class="c-alert--title" text-15px fw-600 data-v-d1c7f863>${ssrInterpolate(unref(title))}</div>`);
} else {
_push(`<!---->`);
}
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(`</div></div>`);
};
}
});
/* unplugin-vue-components disabled */const cAlert_vue_vue_type_style_index_0_scoped_d1c7f863_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-alert/c-alert.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __unplugin_components_3 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d1c7f863"]]);
export { __unplugin_components_3 as _ };

69
dist/server/chunks/chunk-2c92509b.js vendored Normal file
View file

@ -0,0 +1,69 @@
import { mergeProps, useSSRContext, defineComponent, unref } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import { useThemeVars } from 'naive-ui';
import { _ as _export_sfc } from './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
const _sfc_main$1 = {
__name: 'git-memo.content',
__ssrInlineRender: true,
setup(__props, { expose: __expose }) {
const frontmatter = {};
__expose({ frontmatter });
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({ class: "markdown-body" }, _attrs))}><h2>Configuration</h2><p>Set the global config</p><pre><code class="language-shell">git config --global user.name &quot;[name]&quot;
git config --global user.email &quot;[email]&quot;
</code></pre><h2>Get started</h2><p>Create a git repository</p><pre><code class="language-shell">git init
</code></pre><p>Clone an existing git repository</p><pre><code class="language-shell">git clone [url]
</code></pre><h2>Commit</h2><p>Commit all tracked changes</p><pre><code class="language-shell">git commit -am &quot;[commit message]&quot;
</code></pre><p>Add new modifications to the last commit</p><pre><code class="language-shell">git commit --amend --no-edit
</code></pre><h2>Ive made a mistake</h2><p>Change last commit message</p><pre><code class="language-shell">git commit --amend
</code></pre><p>Undo most recent commit and keep changes</p><pre><code class="language-shell">git reset HEAD~1
</code></pre><p>Undo the <code>N</code> most recent commit and keep changes</p><pre><code class="language-shell">git reset HEAD~N
</code></pre><p>Undo most recent commit and get rid of changes</p><pre><code class="language-shell">git reset HEAD~1 --hard
</code></pre><p>Reset branch to remote state</p><pre><code class="language-shell">git fetch origin
git reset --hard origin/[branch-name]
</code></pre><h2>Miscellaneous</h2><p>Renaming the local master branch to main</p><pre><code class="language-shell">git branch -m master main
</code></pre></div>`);
}
}
};
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext()
;(ssrContext.modules || (ssrContext.modules = new Set())).add("src/tools/git-memo/git-memo.content.md");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : undefined
};
const Memo = _sfc_main$1;
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "git-memo",
__ssrInlineRender: true,
setup(__props) {
const themeVars = useThemeVars();
return (_ctx, _push, _parent, _attrs) => {
const _cssVars = { style: {
"--8cb22b3c": unref(themeVars).cardColor
} };
_push(`<div${ssrRenderAttrs(mergeProps(_attrs, _cssVars))} data-v-c7dbeca3>`);
_push(ssrRenderComponent(unref(Memo), null, null, _parent));
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const gitMemo_vue_vue_type_style_index_0_scoped_c7dbeca3_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/git-memo/git-memo.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const gitMemo = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c7dbeca3"]]);
export { gitMemo as default };

22
dist/server/chunks/chunk-2ce6ed5e.js vendored Normal file
View file

@ -0,0 +1,22 @@
import { get } from '@vueuse/core';
import Fuse from 'fuse.js';
import { computed } from 'vue';
function useFuzzySearch({
search,
data,
options = {}
}) {
const fuse = new Fuse(data, options);
const filterEmpty = options.filterEmpty ?? true;
const searchResult = computed(() => {
const query = get(search);
if (!filterEmpty && query === "") {
return data;
}
return fuse.search(query).map(({ item }) => item);
});
return { searchResult };
}
export { useFuzzySearch as u };

61
dist/server/chunks/chunk-2e7c6ce5.js vendored Normal file
View file

@ -0,0 +1,61 @@
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import { defineComponent, toRefs, ref, computed, unref, isRef, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "FormatTransformer",
__ssrInlineRender: true,
props: {
transformer: { type: Function, default: _.identity },
inputValidationRules: { default: () => [] },
inputLabel: { default: "Input" },
inputPlaceholder: { default: "Input..." },
inputDefault: { default: "" },
outputLabel: { default: "Output" },
outputLanguage: { default: "" }
},
setup(__props) {
const props = __props;
const { transformer, inputValidationRules, inputLabel, outputLabel, outputLanguage, inputPlaceholder, inputDefault } = toRefs(props);
const inputElement = ref();
const input = ref(inputDefault.value);
const output = computed(() => transformer.value(input.value));
return (_ctx, _push, _parent, _attrs) => {
const _component_textarea_copyable = TextareaCopyable;
_push(`<!--[-->`);
_push(ssrRenderComponent(__unplugin_components_3, {
ref_key: "inputElement",
ref: inputElement,
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
placeholder: unref(inputPlaceholder),
label: unref(inputLabel),
rows: "20",
autosize: "",
"raw-text": "",
multiline: "",
"test-id": "input",
"validation-rules": unref(inputValidationRules),
monospace: ""
}, null, _parent));
_push(`<div><div mb-5px>${ssrInterpolate(unref(outputLabel))}</div>`);
_push(ssrRenderComponent(_component_textarea_copyable, {
value: unref(output),
language: unref(outputLanguage),
"follow-height-of": unref(inputElement)?.inputWrapperRef
}, null, _parent));
_push(`</div><!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FormatTransformer.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

175
dist/server/chunks/chunk-30657e05.js vendored Normal file
View file

@ -0,0 +1,175 @@
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NInputNumber } from 'naive-ui';
import { _ as _sfc_main$1 } from './chunk-000e277f.js';
import { defineComponent, ref, unref, isRef, withCtx, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import { NIL, v1, v3, v4, v5 } from 'uuid';
import { u as useCopy } from './chunk-77c5cc16.js';
import { c as computedRefreshable } from './chunk-cc665c88.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { useStorage } from '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-8109fd17.js';
import './chunk-bb5bb4f6.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "uuid-generator",
__ssrInlineRender: true,
setup(__props) {
const versions = ["NIL", "v1", "v3", "v4", "v5"];
const version = useStorage("uuid-generator:version", "v4");
const count = useStorage("uuid-generator:quantity", 1);
const v35Args = ref({ namespace: "6ba7b811-9dad-11d1-80b4-00c04fd430c8", name: "" });
const validUuidRules = [
{
message: "Invalid UUID",
validator: (value) => {
if (value === NIL) {
return true;
}
return Boolean(value.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/));
}
}
];
const generators = {
NIL: () => NIL,
v1: (index) => v1({
clockseq: index,
msecs: Date.now(),
nsecs: Math.floor(Math.random() * 1e4),
node: Array.from({ length: 6 }, () => Math.floor(Math.random() * 256))
}),
v3: () => v3(v35Args.value.name, v35Args.value.namespace),
v4: () => v4(),
v5: () => v5(v35Args.value.name, v35Args.value.namespace)
};
const [uuids, refreshUUIDs] = computedRefreshable(() => withDefaultOnError(() => Array.from({ length: count.value }, (_ignored, index) => {
const generator = generators[version.value] ?? generators.NIL;
return generator(index);
}).join("\n"), ""));
const { copy } = useCopy({ source: uuids, text: "UUIDs copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_buttons_select = _sfc_main$1;
const _component_n_input_number = NInputNumber;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-8623cf81>`);
_push(ssrRenderComponent(_component_c_buttons_select, {
value: unref(version),
"onUpdate:value": ($event) => isRef(version) ? version.value = $event : null,
options: versions,
label: "UUID version",
"label-width": "100px",
"mb-2": ""
}, null, _parent));
_push(`<div mb-2 flex items-center data-v-8623cf81><span w-100px data-v-8623cf81>Quantity </span>`);
_push(ssrRenderComponent(_component_n_input_number, {
value: unref(count),
"onUpdate:value": ($event) => isRef(count) ? count.value = $event : null,
"flex-1": "",
min: 1,
max: 50,
placeholder: "UUID quantity"
}, null, _parent));
_push(`</div>`);
if (unref(version) === "v3" || unref(version) === "v5") {
_push(`<div data-v-8623cf81><div data-v-8623cf81>`);
_push(ssrRenderComponent(_component_c_buttons_select, {
value: unref(v35Args).namespace,
"onUpdate:value": ($event) => unref(v35Args).namespace = $event,
options: {
DNS: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
URL: "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
OID: "6ba7b812-9dad-11d1-80b4-00c04fd430c8",
X500: "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
},
label: "Namespace",
"label-width": "100px",
"mb-2": ""
}, null, _parent));
_push(`</div><div flex-1 data-v-8623cf81>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(v35Args).namespace,
"onUpdate:value": ($event) => unref(v35Args).namespace = $event,
placeholder: "Namespace",
"label-width": "100px",
"label-position": "left",
label: " ",
"validation-rules": validUuidRules,
"mb-2": ""
}, null, _parent));
_push(`</div>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(v35Args).name,
"onUpdate:value": ($event) => unref(v35Args).name = $event,
placeholder: "Name",
label: "Name",
"label-width": "100px",
"label-position": "left",
"mb-2": ""
}, null, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(ssrRenderComponent(_component_c_input_text, {
style: { "text-align": "center", "font-family": "monospace" },
value: unref(uuids),
multiline: "",
placeholder: "Your uuids",
autosize: "",
rows: "1",
readonly: "",
"raw-text": "",
monospace: "",
"my-3": "",
class: "uuid-display"
}, null, _parent));
_push(`<div flex justify-center gap-3 data-v-8623cf81>`);
_push(ssrRenderComponent(_component_c_button, {
autofocus: "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_button, { onClick: unref(refreshUUIDs) }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Refresh `);
} else {
return [
createTextVNode(" Refresh ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
/* unplugin-vue-components disabled */const uuidGenerator_vue_vue_type_style_index_0_scoped_8623cf81_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/uuid-generator/uuid-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const uuidGenerator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8623cf81"]]);
export { uuidGenerator as default };

50
dist/server/chunks/chunk-35c3d701.js vendored Normal file
View file

@ -0,0 +1,50 @@
import { get } from '@vueuse/core';
import _ from 'lodash';
import { reactive, watch } from 'vue';
function isFalsyOrHasThrown(cb) {
try {
const returnValue = cb();
if (_.isNil(returnValue)) {
return true;
}
return returnValue === false;
} catch (_2) {
return true;
}
}
function useValidation({
source,
rules,
watch: watchRefs = []
}) {
const state = reactive({
message: "",
status: void 0,
isValid: false,
attrs: {
validationStatus: void 0,
feedback: ""
}
});
watch(
[source, ...watchRefs],
() => {
state.message = "";
state.status = void 0;
for (const rule of get(rules)) {
if (isFalsyOrHasThrown(() => rule.validator(source.value))) {
state.message = rule.message;
state.status = "error";
}
}
state.isValid = state.status !== "error";
state.attrs.feedback = state.message;
state.attrs.validationStatus = state.status;
},
{ immediate: true }
);
return state;
}
export { useValidation as u };

59
dist/server/chunks/chunk-36ed2c8c.js vendored Normal file
View file

@ -0,0 +1,59 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import JSON5 from 'json5';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
const defaultValue = '{\n "hello": [\n "world"\n ]\n}';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "json-minify",
__ssrInlineRender: true,
setup(__props) {
const transformer = (value) => withDefaultOnError(() => JSON.stringify(JSON5.parse(value), null, 0), "");
const rules = [
{
validator: (v) => v === "" || JSON5.parse(v),
message: "Provided JSON is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your raw JSON",
"input-default": defaultValue,
"input-placeholder": "Paste your raw JSON here...",
"output-label": "Minified version of your JSON",
"output-language": "json",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/json-minify/json-minify.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

308
dist/server/chunks/chunk-384f9967.js vendored Normal file
View file

@ -0,0 +1,308 @@
import { NFormItem, NInputNumber, NAlert, NDivider, NInputGroup, NInputGroupLabel } from 'naive-ui';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, createTextVNode, toDisplayString, mergeProps, openBlock, createBlock, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { c as convertBase } from './chunk-5f44352e.js';
import _ from 'lodash';
import { _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import '@vueuse/core';
import './chunk-95ec8cf7.js';
import './chunk-77c5cc16.js';
import 'pinia';
function getErrorMessageIfThrows(cb) {
try {
cb();
return void 0;
} catch (err) {
if (_.isString(err)) {
return err;
}
if (_.isError(err)) {
return err.message;
}
if (_.isObject(err) && _.has(err, "message")) {
return err.message;
}
return "An error as occurred.";
}
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "integer-base-converter",
__ssrInlineRender: true,
setup(__props) {
const inputProps = {
"labelPosition": "left",
"labelWidth": "170px",
"labelAlign": "right",
"readonly": true,
"mb-2": ""
};
const input = ref("42");
const inputBase = ref(10);
const outputBase = ref(42);
function errorlessConvert(...args) {
try {
return convertBase(...args);
} catch (err) {
return "";
}
}
const error = computed(
() => getErrorMessageIfThrows(
() => convertBase({ value: input.value, fromBase: inputBase.value, toBase: outputBase.value })
)
);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_n_form_item = NFormItem;
const _component_n_input_number = NInputNumber;
const _component_n_alert = NAlert;
const _component_n_divider = NDivider;
const _component_n_input_group = NInputGroup;
const _component_n_input_group_label = NInputGroupLabel;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-4b84bbcf>`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
label: "Input number",
placeholder: "Put your number here (ex: 42)",
"label-position": "left",
"label-width": "110px",
"mb-2": "",
"label-align": "right"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Input base",
"label-placement": "left",
"label-width": "110",
"show-feedback": false
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_input_number, {
value: unref(inputBase),
"onUpdate:value": ($event) => isRef(inputBase) ? inputBase.value = $event : null,
max: "64",
min: "2",
placeholder: "Put your input base here (ex: 10)",
"w-full": ""
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(inputBase),
"onUpdate:value": ($event) => isRef(inputBase) ? inputBase.value = $event : null,
max: "64",
min: "2",
placeholder: "Put your input base here (ex: 10)",
"w-full": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(error)) {
_push2(ssrRenderComponent(_component_n_alert, {
style: { "margin-top": "25px" },
type: "error"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(error))}`);
} else {
return [
createTextVNode(toDisplayString(unref(error)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(ssrRenderComponent(_component_n_divider, null, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({ label: "Binary (2)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 2 }),
placeholder: "Binary version will be here..."
}), null, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({ label: "Octal (8)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 8 }),
placeholder: "Octal version will be here..."
}), null, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({ label: "Decimal (10)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 10 }),
placeholder: "Decimal version will be here..."
}), null, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({ label: "Hexadecimal (16)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 16 }),
placeholder: "Hexadecimal version will be here..."
}), null, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({ label: "Base64 (64)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 64 }),
placeholder: "Base64 version will be here..."
}), null, _parent2, _scopeId));
_push2(`<div flex items-baseline data-v-4b84bbcf${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_input_group, { style: { "width": "160px", "margin-right": "10px" } }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_input_group_label, null, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(` Custom: `);
} else {
return [
createTextVNode(" Custom: ")
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_input_number, {
value: unref(outputBase),
"onUpdate:value": ($event) => isRef(outputBase) ? outputBase.value = $event : null,
max: "64",
min: "2"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_input_group_label, null, {
default: withCtx(() => [
createTextVNode(" Custom: ")
]),
_: 1
}),
createVNode(_component_n_input_number, {
value: unref(outputBase),
"onUpdate:value": ($event) => isRef(outputBase) ? outputBase.value = $event : null,
max: "64",
min: "2"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({ "flex-1": "" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: unref(outputBase) }),
placeholder: `Base ${unref(outputBase)} will be here...`
}), null, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
label: "Input number",
placeholder: "Put your number here (ex: 42)",
"label-position": "left",
"label-width": "110px",
"mb-2": "",
"label-align": "right"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_form_item, {
label: "Input base",
"label-placement": "left",
"label-width": "110",
"show-feedback": false
}, {
default: withCtx(() => [
createVNode(_component_n_input_number, {
value: unref(inputBase),
"onUpdate:value": ($event) => isRef(inputBase) ? inputBase.value = $event : null,
max: "64",
min: "2",
placeholder: "Put your input base here (ex: 10)",
"w-full": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
unref(error) ? (openBlock(), createBlock(_component_n_alert, {
key: 0,
style: { "margin-top": "25px" },
type: "error"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(error)), 1)
]),
_: 1
})) : createCommentVNode("", true),
createVNode(_component_n_divider),
createVNode(_sfc_main$1, mergeProps({ label: "Binary (2)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 2 }),
placeholder: "Binary version will be here..."
}), null, 16, ["value"]),
createVNode(_sfc_main$1, mergeProps({ label: "Octal (8)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 8 }),
placeholder: "Octal version will be here..."
}), null, 16, ["value"]),
createVNode(_sfc_main$1, mergeProps({ label: "Decimal (10)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 10 }),
placeholder: "Decimal version will be here..."
}), null, 16, ["value"]),
createVNode(_sfc_main$1, mergeProps({ label: "Hexadecimal (16)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 16 }),
placeholder: "Hexadecimal version will be here..."
}), null, 16, ["value"]),
createVNode(_sfc_main$1, mergeProps({ label: "Base64 (64)" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: 64 }),
placeholder: "Base64 version will be here..."
}), null, 16, ["value"]),
createVNode("div", {
flex: "",
"items-baseline": ""
}, [
createVNode(_component_n_input_group, { style: { "width": "160px", "margin-right": "10px" } }, {
default: withCtx(() => [
createVNode(_component_n_input_group_label, null, {
default: withCtx(() => [
createTextVNode(" Custom: ")
]),
_: 1
}),
createVNode(_component_n_input_number, {
value: unref(outputBase),
"onUpdate:value": ($event) => isRef(outputBase) ? outputBase.value = $event : null,
max: "64",
min: "2"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_sfc_main$1, mergeProps({ "flex-1": "" }, inputProps, {
value: errorlessConvert({ value: unref(input), fromBase: unref(inputBase), toBase: unref(outputBase) }),
placeholder: `Base ${unref(outputBase)} will be here...`
}), null, 16, ["value", "placeholder"])
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const integerBaseConverter_vue_vue_type_style_index_0_scoped_4b84bbcf_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/integer-base-converter/integer-base-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const integerBaseConverter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4b84bbcf"]]);
export { integerBaseConverter as default };

277
dist/server/chunks/chunk-3ce8424c.js vendored Normal file
View file

@ -0,0 +1,277 @@
import { NTable, NAlert, NIcon } from 'naive-ui';
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, toRefs, computed, unref, useSSRContext, isRef, withCtx, createVNode, openBlock, createBlock, Fragment, renderList, createTextVNode } from 'vue';
import { ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { Exchange } from '@vicons/tabler';
import { i as ipv4ToInt, a as isValidIpv4 } from './chunk-7b2d32fe.js';
import { c as convertBase } from './chunk-5f44352e.js';
import _ from 'lodash';
import { _ as _sfc_main$2 } from './chunk-588e4d58.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { useStorage } from '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-8109fd17.js';
import './chunk-77c5cc16.js';
function bits2ip(ipInt) {
return `${ipInt >>> 24}.${ipInt >> 16 & 255}.${ipInt >> 8 & 255}.${ipInt & 255}`;
}
function getRangesize(start, end) {
if (start == null || end == null) {
return -1;
}
return 1 + Number.parseInt(end, 2) - Number.parseInt(start, 2);
}
function getCidr(start, end) {
if (start == null || end == null) {
return null;
}
const range = getRangesize(start, end);
if (range < 1) {
return null;
}
let mask = 32;
for (let i = 0; i < 32; i++) {
if (start[i] !== end[i]) {
mask = i;
break;
}
}
const newStart = start.substring(0, mask) + "0".repeat(32 - mask);
const newEnd = end.substring(0, mask) + "1".repeat(32 - mask);
return { start: newStart, end: newEnd, mask };
}
function calculateCidr({ startIp, endIp }) {
const start = convertBase({
value: ipv4ToInt({ ip: startIp }).toString(),
fromBase: 10,
toBase: 2
}).padStart(32, "0");
const end = convertBase({
value: ipv4ToInt({ ip: endIp }).toString(),
fromBase: 10,
toBase: 2
}).padStart(32, "0");
const cidr = getCidr(start, end);
if (cidr != null) {
const result = {};
result.newEnd = bits2ip(Number.parseInt(cidr.end, 2));
result.newStart = bits2ip(Number.parseInt(cidr.start, 2));
result.newCidr = `${result.newStart}/${cidr.mask}`;
result.newSize = getRangesize(cidr.start, cidr.end);
result.oldSize = getRangesize(start, end);
return result;
}
return void 0;
}
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "result-row",
__ssrInlineRender: true,
props: {
label: { default: "" },
oldValue: { default: "" },
newValue: { default: "" }
},
setup(__props) {
const props = __props;
const { label, oldValue, newValue } = toRefs(props);
const testId = computed(() => _.kebabCase(label.value));
return (_ctx, _push, _parent, _attrs) => {
_push(`<tr${ssrRenderAttrs(_attrs)}><td font-bold>${ssrInterpolate(unref(label))}</td><td${ssrRenderAttr("data-test-id", `${unref(testId)}.old`)}>`);
_push(ssrRenderComponent(_sfc_main$2, {
value: unref(oldValue),
class: "monospace"
}, null, _parent));
_push(`</td><td${ssrRenderAttr("data-test-id", `${unref(testId)}.new`)}>`);
_push(ssrRenderComponent(_sfc_main$2, { value: unref(newValue) }, null, _parent));
_push(`</td></tr>`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/ipv4-range-expander/result-row.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ipv4-range-expander",
__ssrInlineRender: true,
setup(__props) {
const rawStartAddress = useStorage("ipv4-range-expander:startAddress", "192.168.1.1");
const rawEndAddress = useStorage("ipv4-range-expander:endAddress", "192.168.6.255");
const result = computed(() => calculateCidr({ startIp: rawStartAddress.value, endIp: rawEndAddress.value }));
const calculatedValues = [
{
label: "Start address",
getOldValue: () => rawStartAddress.value,
getNewValue: (result2) => result2?.newStart
},
{
label: "End address",
getOldValue: () => rawEndAddress.value,
getNewValue: (result2) => result2?.newEnd
},
{
label: "Addresses in range",
getOldValue: (result2) => result2?.oldSize?.toLocaleString(),
getNewValue: (result2) => result2?.newSize?.toLocaleString()
},
{
label: "CIDR",
getOldValue: () => "",
getNewValue: (result2) => result2?.newCidr
}
];
const startIpValidation = useValidation({
source: rawStartAddress,
rules: [{ message: "Invalid ipv4 address", validator: (ip) => isValidIpv4({ ip }) }]
});
const endIpValidation = useValidation({
source: rawEndAddress,
rules: [{ message: "Invalid ipv4 address", validator: (ip) => isValidIpv4({ ip }) }]
});
const showResult = computed(() => endIpValidation.isValid && startIpValidation.isValid && result.value !== void 0);
function onSwitchStartEndClicked() {
const tmpStart = rawStartAddress.value;
rawStartAddress.value = rawEndAddress.value;
rawEndAddress.value = tmpStart;
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_n_table = NTable;
const _component_n_alert = NAlert;
const _component_c_button = __unplugin_components_0;
const _component_n_icon = NIcon;
_push(`<div${ssrRenderAttrs(_attrs)}><div mb-4 flex gap-4>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(rawStartAddress),
"onUpdate:value": ($event) => isRef(rawStartAddress) ? rawStartAddress.value = $event : null,
label: "Start address",
placeholder: "Start IPv4 address...",
validation: unref(startIpValidation),
clearable: ""
}, null, _parent));
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(rawEndAddress),
"onUpdate:value": ($event) => isRef(rawEndAddress) ? rawEndAddress.value = $event : null,
label: "End address",
placeholder: "End IPv4 address...",
validation: unref(endIpValidation),
clearable: ""
}, null, _parent));
_push(`</div>`);
if (unref(showResult)) {
_push(ssrRenderComponent(_component_n_table, { "data-test-id": "result" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<thead${_scopeId}><tr${_scopeId}><th scope="col"${_scopeId}>   </th><th scope="col"${_scopeId}> old value </th><th scope="col"${_scopeId}> new value </th></tr></thead><tbody${_scopeId}><!--[-->`);
ssrRenderList(calculatedValues, ({ label, getOldValue, getNewValue }) => {
_push2(ssrRenderComponent(_sfc_main$1, {
key: label,
label,
"old-value": getOldValue(unref(result)),
"new-value": getNewValue(unref(result))
}, null, _parent2, _scopeId));
});
_push2(`<!--]--></tbody>`);
} else {
return [
createVNode("thead", null, [
createVNode("tr", null, [
createVNode("th", { scope: "col" }, "   "),
createVNode("th", { scope: "col" }, " old value "),
createVNode("th", { scope: "col" }, " new value ")
])
]),
createVNode("tbody", null, [
(openBlock(), createBlock(Fragment, null, renderList(calculatedValues, ({ label, getOldValue, getNewValue }) => {
return createVNode(_sfc_main$1, {
key: label,
label,
"old-value": getOldValue(unref(result)),
"new-value": getNewValue(unref(result))
}, null, 8, ["label", "old-value", "new-value"]);
}), 64))
])
];
}
}),
_: 1
}, _parent));
} else if (unref(startIpValidation).isValid && unref(endIpValidation).isValid) {
_push(ssrRenderComponent(_component_n_alert, {
title: "Invalid combination of start and end IPv4 address",
type: "error"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div my-3 op-70${_scopeId}> The end IPv4 address is lower than the start IPv4 address. This is not valid and no result could be calculated. In the most cases the solution to solve this problem is to change start and end address. </div>`);
_push2(ssrRenderComponent(_component_c_button, { onClick: onSwitchStartEndClicked }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_icon, {
"mr-2": "",
component: unref(Exchange),
depth: "3",
size: "22"
}, null, _parent3, _scopeId2));
_push3(` Switch start and end IPv4 address `);
} else {
return [
createVNode(_component_n_icon, {
"mr-2": "",
component: unref(Exchange),
depth: "3",
size: "22"
}, null, 8, ["component"]),
createTextVNode(" Switch start and end IPv4 address ")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode("div", {
"my-3": "",
"op-70": ""
}, " The end IPv4 address is lower than the start IPv4 address. This is not valid and no result could be calculated. In the most cases the solution to solve this problem is to change start and end address. "),
createVNode(_component_c_button, { onClick: onSwitchStartEndClicked }, {
default: withCtx(() => [
createVNode(_component_n_icon, {
"mr-2": "",
component: unref(Exchange),
depth: "3",
size: "22"
}, null, 8, ["component"]),
createTextVNode(" Switch start and end IPv4 address ")
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/ipv4-range-expander/ipv4-range-expander.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

11
dist/server/chunks/chunk-3e99c6bf.js vendored Normal file
View file

@ -0,0 +1,11 @@
function formatBytes(bytes, decimals = 2) {
if (bytes === 0) {
return "0 Bytes";
}
const k = 1024;
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return `${Number.parseFloat((bytes / k ** i).toFixed(decimals))} ${sizes[i]}`;
}
export { formatBytes as f };

223
dist/server/chunks/chunk-410ee76f.js vendored Normal file
View file

@ -0,0 +1,223 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createTextVNode, createVNode, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { i as isNotThrowing } from './chunk-5697d061.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import 'naive-ui';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "url-encoder",
__ssrInlineRender: true,
setup(__props) {
const encodeInput = ref("Hello world :)");
const encodeOutput = computed(() => withDefaultOnError(() => encodeURIComponent(encodeInput.value), ""));
const encodedValidation = useValidation({
source: encodeInput,
rules: [
{
validator: (value) => isNotThrowing(() => encodeURIComponent(value)),
message: "Impossible to parse this string"
}
]
});
const { copy: copyEncoded } = useCopy({ source: encodeOutput, text: "Encoded string copied to the clipboard" });
const decodeInput = ref("Hello%20world%20%3A)");
const decodeOutput = computed(() => withDefaultOnError(() => decodeURIComponent(decodeInput.value), ""));
const decodeValidation = useValidation({
source: encodeInput,
rules: [
{
validator: (value) => isNotThrowing(() => decodeURIComponent(value)),
message: "Impossible to parse this string"
}
]
});
const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: "Decoded string copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, { title: "Encode" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(encodeInput),
"onUpdate:value": ($event) => isRef(encodeInput) ? encodeInput.value = $event : null,
label: "Your string :",
validation: unref(encodedValidation),
multiline: "",
autosize: "",
placeholder: "The string to encode",
rows: "2",
"mb-3": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
label: "Your string encoded :",
value: unref(encodeOutput),
multiline: "",
autosize: "",
readonly: "",
placeholder: "Your string encoded",
rows: "2",
"mb-3": ""
}, null, _parent2, _scopeId));
_push2(`<div flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyEncoded)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(encodeInput),
"onUpdate:value": ($event) => isRef(encodeInput) ? encodeInput.value = $event : null,
label: "Your string :",
validation: unref(encodedValidation),
multiline: "",
autosize: "",
placeholder: "The string to encode",
rows: "2",
"mb-3": ""
}, null, 8, ["value", "onUpdate:value", "validation"]),
createVNode(_component_c_input_text, {
label: "Your string encoded :",
value: unref(encodeOutput),
multiline: "",
autosize: "",
readonly: "",
placeholder: "Your string encoded",
rows: "2",
"mb-3": ""
}, null, 8, ["value"]),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copyEncoded)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, { title: "Decode" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(decodeInput),
"onUpdate:value": ($event) => isRef(decodeInput) ? decodeInput.value = $event : null,
label: "Your encoded string :",
validation: unref(decodeValidation),
multiline: "",
autosize: "",
placeholder: "The string to decode",
rows: "2",
"mb-3": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
label: "Your string decoded :",
value: unref(decodeOutput),
multiline: "",
autosize: "",
readonly: "",
placeholder: "Your string decoded",
rows: "2",
"mb-3": ""
}, null, _parent2, _scopeId));
_push2(`<div flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyDecoded)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(decodeInput),
"onUpdate:value": ($event) => isRef(decodeInput) ? decodeInput.value = $event : null,
label: "Your encoded string :",
validation: unref(decodeValidation),
multiline: "",
autosize: "",
placeholder: "The string to decode",
rows: "2",
"mb-3": ""
}, null, 8, ["value", "onUpdate:value", "validation"]),
createVNode(_component_c_input_text, {
label: "Your string decoded :",
value: unref(decodeOutput),
multiline: "",
autosize: "",
readonly: "",
placeholder: "Your string decoded",
rows: "2",
"mb-3": ""
}, null, 8, ["value"]),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copyDecoded)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/url-encoder/url-encoder.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

198
dist/server/chunks/chunk-43df7213.js vendored Normal file
View file

@ -0,0 +1,198 @@
import { NDivider, NFormItem, NInputNumber, NDatePicker, NStatistic } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { formatDuration, formatRelative, addMilliseconds } from 'date-fns';
import { enGB } from 'date-fns/locale';
import { _ as _export_sfc } from './chunk-6003391e.js';
import '@vueuse/core';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import 'pinia';
function formatMsDuration(duration) {
const ms = Math.floor(duration % 1e3);
const secs = Math.floor((duration - ms) / 1e3 % 60);
const mins = Math.floor(((duration - ms) / 1e3 - secs) / 60 % 60);
const hrs = Math.floor((((duration - ms) / 1e3 - secs) / 60 - mins) / 60);
return formatDuration({
hours: hrs,
minutes: mins,
seconds: secs
}) + (ms > 0 ? ` ${ms} ms` : "");
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "eta-calculator",
__ssrInlineRender: true,
setup(__props) {
const unitCount = ref(3 * 62);
const unitPerTimeSpan = ref(3);
const timeSpan = ref(5);
const timeSpanUnitMultiplier = ref(6e4);
const startedAt = ref(Date.now());
const durationMs = computed(() => {
const timeSpanMs = timeSpan.value * timeSpanUnitMultiplier.value;
return unitCount.value / (unitPerTimeSpan.value / timeSpanMs);
});
const endAt = computed(
() => formatRelative(addMilliseconds(startedAt.value, durationMs.value), Date.now(), { locale: enGB })
);
return (_ctx, _push, _parent, _attrs) => {
const _component_n_divider = NDivider;
const _component_n_form_item = NFormItem;
const _component_n_input_number = NInputNumber;
const _component_n_date_picker = NDatePicker;
const _component_c_select = __unplugin_components_0;
const _component_c_card = __unplugin_components_1;
const _component_n_statistic = NStatistic;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-d93763ac><div text-justify op-70 data-v-d93763ac> With a concrete example, if you wash 5 plates in 3 minutes and you have 500 plates to wash, it will take you 5 hours to wash them all. </div>`);
_push(ssrRenderComponent(_component_n_divider, null, null, _parent));
_push(`<div flex gap-2 data-v-d93763ac>`);
_push(ssrRenderComponent(_component_n_form_item, {
label: "Amount of element to consume",
"flex-1": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_number, {
value: unref(unitCount),
"onUpdate:value": ($event) => isRef(unitCount) ? unitCount.value = $event : null,
min: 1
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(unitCount),
"onUpdate:value": ($event) => isRef(unitCount) ? unitCount.value = $event : null,
min: 1
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_n_form_item, {
label: "The consumption started at",
"flex-1": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_date_picker, {
value: unref(startedAt),
"onUpdate:value": ($event) => isRef(startedAt) ? startedAt.value = $event : null,
type: "datetime"
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_date_picker, {
value: unref(startedAt),
"onUpdate:value": ($event) => isRef(startedAt) ? startedAt.value = $event : null,
type: "datetime"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(`</div><p data-v-d93763ac>Amount of unit consumed by time span</p><div flex flex-col items-baseline gap-y-2 md:flex-row data-v-d93763ac>`);
_push(ssrRenderComponent(_component_n_input_number, {
value: unref(unitPerTimeSpan),
"onUpdate:value": ($event) => isRef(unitPerTimeSpan) ? unitPerTimeSpan.value = $event : null,
min: 1
}, null, _parent));
_push(`<div flex items-baseline gap-2 data-v-d93763ac><span ml-2 data-v-d93763ac>in</span>`);
_push(ssrRenderComponent(_component_n_input_number, {
value: unref(timeSpan),
"onUpdate:value": ($event) => isRef(timeSpan) ? timeSpan.value = $event : null,
"min-w-130px": "",
min: 1
}, null, _parent));
_push(ssrRenderComponent(_component_c_select, {
value: unref(timeSpanUnitMultiplier),
"onUpdate:value": ($event) => isRef(timeSpanUnitMultiplier) ? timeSpanUnitMultiplier.value = $event : null,
"min-w-130px": "",
options: [
{ label: "milliseconds", value: 1 },
{ label: "seconds", value: 1e3 },
{ label: "minutes", value: 1e3 * 60 },
{ label: "hours", value: 1e3 * 60 * 60 },
{ label: "days", value: 1e3 * 60 * 60 * 24 }
]
}, null, _parent));
_push(`</div></div>`);
_push(ssrRenderComponent(_component_n_divider, null, null, _parent));
_push(ssrRenderComponent(_component_c_card, { "mb-2": "" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_statistic, { label: "Total duration" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(formatMsDuration)(unref(durationMs)))}`);
} else {
return [
createTextVNode(toDisplayString(unref(formatMsDuration)(unref(durationMs))), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_statistic, { label: "Total duration" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(formatMsDuration)(unref(durationMs))), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_statistic, { label: "It will end " }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(endAt))}`);
} else {
return [
createTextVNode(toDisplayString(unref(endAt)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_statistic, { label: "It will end " }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(endAt)), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const etaCalculator_vue_vue_type_style_index_0_scoped_d93763ac_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/eta-calculator/eta-calculator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const etaCalculator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d93763ac"]]);
export { etaCalculator as default };

90
dist/server/chunks/chunk-47a11764.js vendored Normal file
View file

@ -0,0 +1,90 @@
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import { a as codesByCategories } from '../entries/src_pages_Home-page.mjs';
import { u as useFuzzySearch } from './chunk-2ce6ed5e.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import 'naive-ui';
import '@vicons/tabler';
import '@vueuse/head';
import 'date-fns';
import 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js';
import '@vicons/material';
import 'figue';
import 'fuse.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "http-status-codes",
__ssrInlineRender: true,
setup(__props) {
const search = ref("");
const { searchResult } = useFuzzySearch({
search,
data: codesByCategories.flatMap(({ codes, category }) => codes.map((code) => ({ ...code, category }))),
options: {
keys: [{ name: "code", weight: 3 }, { name: "name", weight: 2 }, "description", "category"]
}
});
const codesByCategoryFiltered = computed(() => {
if (!search.value) {
return codesByCategories;
}
return [{ category: "Search results", codes: searchResult.value }];
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_card = __unplugin_components_1;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(search),
"onUpdate:value": ($event) => isRef(search) ? search.value = $event : null,
placeholder: "Search http status...",
autofocus: "",
"raw-text": "",
"mb-10": ""
}, null, _parent));
_push(`<!--[-->`);
ssrRenderList(unref(codesByCategoryFiltered), ({ codes, category }) => {
_push(`<div mb-8><div mb-2 text-xl>${ssrInterpolate(category)}</div><!--[-->`);
ssrRenderList(codes, ({ code, description, name, type }) => {
_push(ssrRenderComponent(_component_c_card, {
key: code,
"mb-2": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div text-lg font-bold${_scopeId}>${ssrInterpolate(code)} ${ssrInterpolate(name)}</div><div op-70${_scopeId}>${ssrInterpolate(description)} ${ssrInterpolate(type !== "HTTP" ? `For ${type}.` : "")}</div>`);
} else {
return [
createVNode("div", {
"text-lg": "",
"font-bold": ""
}, toDisplayString(code) + " " + toDisplayString(name), 1),
createVNode("div", { "op-70": "" }, toDisplayString(description) + " " + toDisplayString(type !== "HTTP" ? `For ${type}.` : ""), 1)
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]--></div>`);
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/http-status-codes/http-status-codes.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

226
dist/server/chunks/chunk-4e314b83.js vendored Normal file
View file

@ -0,0 +1,226 @@
import { NFormItem, NColorPicker } from 'naive-ui';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { ref, defineComponent, withCtx, createVNode, openBlock, createBlock, Fragment, renderList, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { colord, extend } from 'colord';
import _ from 'lodash';
import cmykPlugin from 'colord/plugins/cmyk';
import hwbPlugin from 'colord/plugins/hwb';
import namesPlugin from 'colord/plugins/names';
import lchPlugin from 'colord/plugins/lch';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { u as useValidation } from './chunk-35c3d701.js';
import './chunk-95ec8cf7.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-77c5cc16.js';
function buildColorFormat({
label,
parse = (value) => colord(value),
format,
placeholder,
invalidMessage = `Invalid ${label.toLowerCase()} format.`,
type = "text"
}) {
const value = ref("");
return {
type,
label,
parse: (v) => withDefaultOnError(() => parse(v), void 0),
format,
placeholder,
value,
validation: useValidation({
source: value,
rules: [
{
message: invalidMessage,
validator: (v) => withDefaultOnError(() => {
if (v === "") {
return true;
}
return parse(v).isValid();
}, false)
}
]
})
};
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "color-converter",
__ssrInlineRender: true,
setup(__props) {
extend([cmykPlugin, hwbPlugin, namesPlugin, lchPlugin]);
const formats = {
picker: buildColorFormat({
label: "color picker",
format: (v) => v.toHex(),
type: "color-picker"
}),
hex: buildColorFormat({
label: "hex",
format: (v) => v.toHex(),
placeholder: "e.g. #ff0000"
}),
rgb: buildColorFormat({
label: "rgb",
format: (v) => v.toRgbString(),
placeholder: "e.g. rgb(255, 0, 0)"
}),
hsl: buildColorFormat({
label: "hsl",
format: (v) => v.toHslString(),
placeholder: "e.g. hsl(0, 100%, 50%)"
}),
hwb: buildColorFormat({
label: "hwb",
format: (v) => v.toHwbString(),
placeholder: "e.g. hwb(0, 0%, 0%)"
}),
lch: buildColorFormat({
label: "lch",
format: (v) => v.toLchString(),
placeholder: "e.g. lch(53.24, 104.55, 40.85)"
}),
cmyk: buildColorFormat({
label: "cmyk",
format: (v) => v.toCmykString(),
placeholder: "e.g. cmyk(0, 100%, 100%, 0)"
}),
name: buildColorFormat({
label: "name",
format: (v) => v.toName({ closest: true }) ?? "Unknown",
placeholder: "e.g. red"
})
};
updateColorValue(colord("#1ea54c"));
function updateColorValue(value, omitLabel) {
if (value === void 0) {
return;
}
if (!value.isValid()) {
return;
}
_.forEach(formats, ({ value: valueRef, format }, key) => {
if (key !== omitLabel) {
valueRef.value = format(value);
}
});
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_input_copyable = _sfc_main$1;
const _component_n_form_item = NFormItem;
const _component_n_color_picker = NColorPicker;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<!--[-->`);
ssrRenderList(formats, ({ label, parse, placeholder, validation, type }, key) => {
_push2(`<!--[-->`);
if (type === "text") {
_push2(ssrRenderComponent(_component_input_copyable, {
value: formats[key].value.value,
"onUpdate:value": [($event) => formats[key].value.value = $event, (v) => updateColorValue(parse(v), key)],
"test-id": `input-${key}`,
label: `${label}:`,
"label-position": "left",
"label-width": "100px",
"label-align": "right",
placeholder,
validation,
"raw-text": "",
clearable: "",
"mt-2": ""
}, null, _parent2, _scopeId));
} else if (type === "color-picker") {
_push2(ssrRenderComponent(_component_n_form_item, {
label: `${label}:`,
"label-width": "100",
"label-placement": "left",
"show-feedback": false
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_color_picker, {
value: formats[key].value.value,
"onUpdate:value": [($event) => formats[key].value.value = $event, (v) => updateColorValue(parse(v), key)],
placement: "bottom-end"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_color_picker, {
value: formats[key].value.value,
"onUpdate:value": [($event) => formats[key].value.value = $event, (v) => updateColorValue(parse(v), key)],
placement: "bottom-end"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`<!--]-->`);
});
_push2(`<!--]-->`);
} else {
return [
(openBlock(), createBlock(Fragment, null, renderList(formats, ({ label, parse, placeholder, validation, type }, key) => {
return openBlock(), createBlock(Fragment, { key }, [
type === "text" ? (openBlock(), createBlock(_component_input_copyable, {
key: 0,
value: formats[key].value.value,
"onUpdate:value": [($event) => formats[key].value.value = $event, (v) => updateColorValue(parse(v), key)],
"test-id": `input-${key}`,
label: `${label}:`,
"label-position": "left",
"label-width": "100px",
"label-align": "right",
placeholder,
validation,
"raw-text": "",
clearable: "",
"mt-2": ""
}, null, 8, ["value", "onUpdate:value", "test-id", "label", "placeholder", "validation"])) : type === "color-picker" ? (openBlock(), createBlock(_component_n_form_item, {
key: 1,
label: `${label}:`,
"label-width": "100",
"label-placement": "left",
"show-feedback": false
}, {
default: withCtx(() => [
createVNode(_component_n_color_picker, {
value: formats[key].value.value,
"onUpdate:value": [($event) => formats[key].value.value = $event, (v) => updateColorValue(parse(v), key)],
placement: "bottom-end"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 2
}, 1032, ["label"])) : createCommentVNode("", true)
], 64);
}), 64))
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/color-converter/color-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

289
dist/server/chunks/chunk-4e7a6a8d.js vendored Normal file
View file

@ -0,0 +1,289 @@
import { openBlock, createElementBlock, createElementVNode, defineComponent, ref, toRefs, watch, nextTick, computed, onMounted, unref, mergeProps, withCtx, createVNode, createBlock, createCommentVNode, useSSRContext } from 'vue';
import { d as defineThemes, c as useAppTheme, a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrRenderSlot, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderDynamicModel, ssrRenderComponent } from 'vue/server-renderer';
import { g as generateRandomId } from './chunk-11f44f81.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { useVModel } from '@vueuse/core';
const _hoisted_1$2 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M11.83 9L15 12.16V12a3 3 0 0 0-3-3h-.17m-4.3.8l1.55 1.55c-.05.21-.08.42-.08.65a3 3 0 0 0 3 3c.22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53a5 5 0 0 1-5-5c0-.79.2-1.53.53-2.2M2 4.27l2.28 2.28l.45.45C3.08 8.3 1.78 10 1 12c1.73 4.39 6 7.5 11 7.5c1.55 0 3.03-.3 4.38-.84l.43.42L19.73 22L21 20.73L3.27 3M12 7a5 5 0 0 1 5 5c0 .64-.13 1.26-.36 1.82l2.93 2.93c1.5-1.25 2.7-2.89 3.43-4.75c-1.73-4.39-6-7.5-11-7.5c-1.4 0-2.74.25-4 .7l2.17 2.15C10.74 7.13 11.35 7 12 7Z"
}, null, -1);
const _hoisted_3$2 = [
_hoisted_2$2
];
function render$2(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2))
}
const __unplugin_components_3$1 = { name: 'mdi-eye-off', render: render$2 };
/* vite-plugin-components disabled */
const _hoisted_1$1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$1 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M12 9a3 3 0 0 0-3 3a3 3 0 0 0 3 3a3 3 0 0 0 3-3a3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5a5 5 0 0 1 5-5a5 5 0 0 1 5 5a5 5 0 0 1-5 5m0-12.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5Z"
}, null, -1);
const _hoisted_3$1 = [
_hoisted_2$1
];
function render$1(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1))
}
const __unplugin_components_2 = { name: 'mdi-eye', render: render$1 };
/* vite-plugin-components disabled */
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_1 = { name: 'mdi-close', render };
/* vite-plugin-components disabled */
const { useTheme } = defineThemes({
dark: {
backgroundColor: "#333333",
borderColor: "#333333",
focus: {
backgroundColor: "#1ea54c1a"
}
},
light: {
backgroundColor: "#ffffff",
borderColor: "#e0e0e69e",
focus: {
backgroundColor: "#ffffff"
}
}
});
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-input-text",
__ssrInlineRender: true,
props: {
value: { default: "" },
id: { default: generateRandomId },
placeholder: { default: "Input text" },
label: { default: void 0 },
readonly: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
validationRules: { default: () => [] },
validationWatch: { default: void 0 },
validation: { default: void 0 },
labelPosition: { default: "top" },
labelWidth: { default: "auto" },
labelAlign: { default: "left" },
clearable: { type: Boolean, default: false },
testId: { default: void 0 },
autocapitalize: { default: void 0 },
autocomplete: { default: void 0 },
autocorrect: { default: void 0 },
spellcheck: { type: [String, Boolean], default: void 0 },
rawText: { type: Boolean, default: false },
type: { default: "text" },
multiline: { type: Boolean, default: false },
rows: { default: 3 },
autosize: { type: Boolean, default: false },
autofocus: { type: Boolean, default: false },
monospace: { type: Boolean, default: false }
},
emits: ["update:value"],
setup(__props, { expose: __expose, emit }) {
const props = __props;
const value = useVModel(props, "value", emit);
const showPassword = ref(false);
const { id, placeholder, label, validationRules, labelPosition, labelWidth, labelAlign, autosize, readonly, disabled, clearable, type, multiline, rows, rawText, autofocus, monospace } = toRefs(props);
const validation = props.validation ?? useValidation({
rules: validationRules,
source: value,
watch: props.validationWatch
});
const theme = useTheme();
const appTheme = useAppTheme();
const textareaRef = ref();
const inputRef = ref();
const inputWrapperRef = ref();
watch(
[value, autosize, multiline, inputWrapperRef, textareaRef],
() => nextTick(() => {
if (props.multiline && autosize.value) {
resizeTextarea();
}
}),
{ immediate: true }
);
function resizeTextarea() {
if (!textareaRef.value || !inputWrapperRef.value) {
return;
}
const scrollHeight = textareaRef.value.scrollHeight + 2;
inputWrapperRef.value.style.height = `${scrollHeight}px`;
}
const htmlInputType = computed(() => {
if (props.type === "password" && !showPassword.value) {
return "password";
}
return "text";
});
function focus() {
if (textareaRef.value) {
textareaRef.value.focus();
}
if (inputRef.value) {
inputRef.value.focus();
}
}
function blur() {
if (textareaRef.value) {
textareaRef.value.blur?.();
}
if (inputRef.value) {
inputRef.value.blur?.();
}
}
onMounted(() => {
if (autofocus.value) {
focus();
}
});
__expose({
inputWrapperRef,
focus,
blur
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_button = __unplugin_components_0;
const _component_icon_mdi_close = __unplugin_components_1;
const _component_icon_mdi_eye = __unplugin_components_2;
const _component_icon_mdi_eye_off = __unplugin_components_3$1;
const _cssVars = { style: {
"--1578999c": unref(appTheme).error.color,
"--b18512fa": unref(appTheme).error.color + 22,
"--15951ced": unref(labelWidth),
"--1460862c": unref(labelAlign),
"--e1b5bfd6": unref(theme).backgroundColor,
"--e9ed6052": unref(theme).borderColor,
"--1728643c": unref(appTheme).text.baseColor,
"--ffa9e664": unref(appTheme).text.mutedColor,
"--ac68db28": unref(appTheme).primary.color,
"--0ab89a02": unref(theme).focus.backgroundColor
} };
_push(`<div${ssrRenderAttrs(mergeProps({
class: ["c-input-text", { disabled: unref(disabled), "error": !unref(validation).isValid, "label-left": unref(labelPosition) === "left", multiline: unref(multiline) }]
}, _attrs, _cssVars))} data-v-c4df69f5>`);
if (unref(label)) {
_push(`<label${ssrRenderAttr("for", unref(id))} class="label" data-v-c4df69f5>${ssrInterpolate(unref(label))}</label>`);
} else {
_push(`<!---->`);
}
_push(`<div class="feedback-wrapper" data-v-c4df69f5><div class="input-wrapper" data-v-c4df69f5>`);
ssrRenderSlot(_ctx.$slots, "prefix", {}, null, _push, _parent);
if (unref(multiline)) {
_push(`<textarea${ssrRenderAttr("id", unref(id))} class="${ssrRenderClass([{
"leading-5 !font-mono": unref(monospace)
}, "input"])}"${ssrRenderAttr("placeholder", unref(placeholder))}${ssrIncludeBooleanAttr(unref(readonly)) ? " readonly" : ""}${ssrIncludeBooleanAttr(unref(disabled)) ? " disabled" : ""}${ssrRenderAttr("data-test-id", _ctx.testId)}${ssrRenderAttr("autocapitalize", _ctx.autocapitalize ?? (unref(rawText) ? "off" : void 0))}${ssrRenderAttr("autocomplete", _ctx.autocomplete ?? (unref(rawText) ? "off" : void 0))}${ssrRenderAttr("autocorrect", _ctx.autocorrect ?? (unref(rawText) ? "off" : void 0))}${ssrRenderAttr("spellcheck", _ctx.spellcheck ?? (unref(rawText) ? false : void 0))}${ssrRenderAttr("rows", unref(rows))} data-v-c4df69f5>${ssrInterpolate(unref(value))}</textarea>`);
} else {
_push(`<input${ssrRenderAttr("id", unref(id))}${ssrRenderDynamicModel(unref(htmlInputType), unref(value), null)}${ssrRenderAttr("type", unref(htmlInputType))} class="${ssrRenderClass([{
"leading-5 !font-mono": unref(monospace)
}, "input"])}" size="1"${ssrRenderAttr("placeholder", unref(placeholder))}${ssrIncludeBooleanAttr(unref(readonly)) ? " readonly" : ""}${ssrIncludeBooleanAttr(unref(disabled)) ? " disabled" : ""}${ssrRenderAttr("data-test-id", _ctx.testId)}${ssrRenderAttr("autocapitalize", _ctx.autocapitalize ?? (unref(rawText) ? "off" : void 0))}${ssrRenderAttr("autocomplete", _ctx.autocomplete ?? (unref(rawText) ? "off" : void 0))}${ssrRenderAttr("autocorrect", _ctx.autocorrect ?? (unref(rawText) ? "off" : void 0))}${ssrRenderAttr("spellcheck", _ctx.spellcheck ?? (unref(rawText) ? false : void 0))} data-v-c4df69f5>`);
}
if (unref(clearable) && unref(value)) {
_push(ssrRenderComponent(_component_c_button, {
variant: "text",
circle: "",
size: "small",
onClick: ($event) => value.value = ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_icon_mdi_close, null, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_icon_mdi_close)
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
if (unref(type) === "password") {
_push(ssrRenderComponent(_component_c_button, {
variant: "text",
circle: "",
size: "small",
onClick: ($event) => showPassword.value = !unref(showPassword)
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
if (!unref(showPassword)) {
_push2(ssrRenderComponent(_component_icon_mdi_eye, null, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(showPassword)) {
_push2(ssrRenderComponent(_component_icon_mdi_eye_off, null, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
} else {
return [
!unref(showPassword) ? (openBlock(), createBlock(_component_icon_mdi_eye, { key: 0 })) : createCommentVNode("", true),
unref(showPassword) ? (openBlock(), createBlock(_component_icon_mdi_eye_off, { key: 1 })) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
ssrRenderSlot(_ctx.$slots, "suffix", {}, null, _push, _parent);
_push(`</div>`);
if (!unref(validation).isValid) {
_push(`<span class="feedback" data-v-c4df69f5>${ssrInterpolate(unref(validation).message)}</span>`);
} else {
_push(`<!---->`);
}
_push(`</div></div>`);
};
}
});
/* unplugin-vue-components disabled */const cInputText_vue_vue_type_style_index_0_scoped_c4df69f5_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-input-text/c-input-text.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __unplugin_components_3 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c4df69f5"]]);
export { __unplugin_components_3 as _ };

151
dist/server/chunks/chunk-4f157b7b.js vendored Normal file
View file

@ -0,0 +1,151 @@
import { NInputGroup, NInputGroupLabel } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, openBlock, createBlock, toDisplayString, createCommentVNode, createVNode, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
import { useEventListener } from '@vueuse/core';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import './chunk-6003391e.js';
import 'pinia';
import './chunk-95ec8cf7.js';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-77c5cc16.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "keycode-info",
__ssrInlineRender: true,
setup(__props) {
const event = ref();
useEventListener(document, "keydown", (e) => {
event.value = e;
});
const fields = computed(() => {
if (!event.value) {
return [];
}
return [
{
label: "Key :",
value: event.value.key,
placeholder: "Key name..."
},
{
label: "Keycode :",
value: String(event.value.keyCode),
placeholder: "Keycode..."
},
{
label: "Code :",
value: event.value.code,
placeholder: "Code..."
},
{
label: "Location :",
value: String(event.value.location),
placeholder: "Code..."
},
{
label: "Modifiers :",
value: [
event.value.metaKey && "Meta",
event.value.shiftKey && "Shift",
event.value.ctrlKey && "Ctrl",
event.value.altKey && "Alt"
].filter(Boolean).join(" + "),
placeholder: "None"
}
];
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_input_group = NInputGroup;
const _component_n_input_group_label = NInputGroupLabel;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_card, {
"mb-5": "",
"text-center": "",
"important:py-12": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
if (unref(event)) {
_push2(`<div mb-2 text-3xl${_scopeId}>${ssrInterpolate(unref(event).key)}</div>`);
} else {
_push2(`<!---->`);
}
_push2(`<span lh-1 op-70${_scopeId}> Press the key on your keyboard you want to get info about this key </span>`);
} else {
return [
unref(event) ? (openBlock(), createBlock("div", {
key: 0,
"mb-2": "",
"text-3xl": ""
}, toDisplayString(unref(event).key), 1)) : createCommentVNode("", true),
createVNode("span", {
"lh-1": "",
"op-70": ""
}, " Press the key on your keyboard you want to get info about this key ")
];
}
}),
_: 1
}, _parent));
_push(`<!--[-->`);
ssrRenderList(unref(fields), ({ label, value, placeholder }, i) => {
_push(ssrRenderComponent(_component_n_input_group, {
key: i,
style: { "margin-bottom": "5px" }
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_group_label, { style: { "flex": "0 0 150px" } }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(label)}`);
} else {
return [
createTextVNode(toDisplayString(label), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, {
value,
readonly: "",
placeholder
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_group_label, { style: { "flex": "0 0 150px" } }, {
default: withCtx(() => [
createTextVNode(toDisplayString(label), 1)
]),
_: 2
}, 1024),
createVNode(_sfc_main$1, {
value,
readonly: "",
placeholder
}, null, 8, ["value", "placeholder"])
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/keycode-info/keycode-info.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

120
dist/server/chunks/chunk-4f40cbf2.js vendored Normal file
View file

@ -0,0 +1,120 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import 'naive-ui';
const natoAlphabet = [
"Alpha",
"Bravo",
"Charlie",
"Delta",
"Echo",
"Foxtrot",
"Golf",
"Hotel",
"India",
"Juliet",
"Kilo",
"Lima",
"Mike",
"November",
"Oscar",
"Papa",
"Quebec",
"Romeo",
"Sierra",
"Tango",
"Uniform",
"Victor",
"Whiskey",
"X-ray",
"Yankee",
"Zulu"
];
function getLetterPositionInAlphabet({ letter }) {
return letter.toLowerCase().charCodeAt(0) - "a".charCodeAt(0);
}
function textToNatoAlphabet({ text }) {
return text.split("").map((character) => {
const alphabetIndex = getLetterPositionInAlphabet({ letter: character });
const natoWord = natoAlphabet[alphabetIndex];
return natoWord ?? character;
}).join(" ");
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "text-to-nato-alphabet",
__ssrInlineRender: true,
setup(__props) {
const input = ref("");
const natoText = computed(() => textToNatoAlphabet({ text: input.value }));
const { copy } = useCopy({ source: natoText, text: "NATO alphabet string copied." });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_card = __unplugin_components_1;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
label: "Your text to convert to NATO phonetic alphabet",
placeholder: "Put your text here...",
clearable: "",
"mb-5": ""
}, null, _parent));
if (unref(natoText)) {
_push(`<div><div mb-2> Your text in NATO phonetic alphabet </div>`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(unref(natoText))}`);
} else {
return [
createTextVNode(toDisplayString(unref(natoText)), 1)
];
}
}),
_: 1
}, _parent));
_push(`<div mt-3 flex justify-center>`);
_push(ssrRenderComponent(_component_c_button, {
autofocus: "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy NATO string `);
} else {
return [
createTextVNode(" Copy NATO string ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

191
dist/server/chunks/chunk-5176a2b9.js vendored Normal file
View file

@ -0,0 +1,191 @@
import { NDivider, NAlert } from 'naive-ui';
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createTextVNode, createVNode, openBlock, createBlock, Fragment, renderList, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import { MessageType, composerize } from 'composerize-ts';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { u as useDownloadFileFromBase64 } from './chunk-cce4ae69.js';
import { t as textToBase64 } from './chunk-72fc6fca.js';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import 'mime-types';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "docker-run-to-docker-compose-converter",
__ssrInlineRender: true,
setup(__props) {
const dockerRun = ref(
"docker run -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --restart always --log-opt max-size=1g nginx"
);
const conversionResult = computed(
() => withDefaultOnError(() => composerize(dockerRun.value.trim()), { yaml: "", messages: [] })
);
const dockerCompose = computed(() => conversionResult.value.yaml);
const notImplemented = computed(
() => conversionResult.value.messages.filter((msg) => msg.type === MessageType.notImplemented).map((msg) => msg.value)
);
const notComposable = computed(
() => conversionResult.value.messages.filter((msg) => msg.type === MessageType.notTranslatable).map((msg) => msg.value)
);
const errors = computed(
() => conversionResult.value.messages.filter((msg) => msg.type === MessageType.errorDuringConversion).map((msg) => msg.value)
);
const dockerComposeBase64 = computed(() => `data:application/yaml;base64,${textToBase64(dockerCompose.value)}`);
const { download } = useDownloadFileFromBase64({ source: dockerComposeBase64, filename: "docker-compose.yml" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_n_divider = NDivider;
const _component_c_button = __unplugin_components_0;
const _component_n_alert = NAlert;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(dockerRun),
"onUpdate:value": ($event) => isRef(dockerRun) ? dockerRun.value = $event : null,
label: "Your docker run command:",
style: { "font-family": "monospace" },
multiline: "",
"raw-text": "",
monospace: "",
placeholder: "Your docker run command to convert...",
rows: "3"
}, null, _parent));
_push(ssrRenderComponent(_component_n_divider, null, null, _parent));
_push(ssrRenderComponent(TextareaCopyable, {
value: unref(dockerCompose),
language: "yaml"
}, null, _parent));
_push(`<div mt-5 flex justify-center>`);
_push(ssrRenderComponent(_component_c_button, {
disabled: unref(dockerCompose) === "",
secondary: "",
onClick: unref(download)
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Download docker-compose.yml `);
} else {
return [
createTextVNode(" Download docker-compose.yml ")
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
if (unref(notComposable).length > 0) {
_push(`<div>`);
_push(ssrRenderComponent(_component_n_alert, {
title: "This options are not translatable to docker-compose",
type: "info",
"mt-5": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<ul${_scopeId}><!--[-->`);
ssrRenderList(unref(notComposable), (message, index) => {
_push2(`<li${_scopeId}>${ssrInterpolate(message)}</li>`);
});
_push2(`<!--]--></ul>`);
} else {
return [
createVNode("ul", null, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(notComposable), (message, index) => {
return openBlock(), createBlock("li", { key: index }, toDisplayString(message), 1);
}), 128))
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
if (unref(notImplemented).length > 0) {
_push(`<div>`);
_push(ssrRenderComponent(_component_n_alert, {
title: "This options are not yet implemented and therefore haven't been translated to docker-compose",
type: "warning",
"mt-5": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<ul${_scopeId}><!--[-->`);
ssrRenderList(unref(notImplemented), (message, index) => {
_push2(`<li${_scopeId}>${ssrInterpolate(message)}</li>`);
});
_push2(`<!--]--></ul>`);
} else {
return [
createVNode("ul", null, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(notImplemented), (message, index) => {
return openBlock(), createBlock("li", { key: index }, toDisplayString(message), 1);
}), 128))
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
if (unref(errors).length > 0) {
_push(`<div>`);
_push(ssrRenderComponent(_component_n_alert, {
title: "The following errors occured",
type: "error",
"mt-5": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<ul${_scopeId}><!--[-->`);
ssrRenderList(unref(errors), (message, index) => {
_push2(`<li${_scopeId}>${ssrInterpolate(message)}</li>`);
});
_push2(`<!--]--></ul>`);
} else {
return [
createVNode("ul", null, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(errors), (message, index) => {
return openBlock(), createBlock("li", { key: index }, toDisplayString(message), 1);
}), 128))
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

452
dist/server/chunks/chunk-5244d744.js vendored Normal file
View file

@ -0,0 +1,452 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { NFormItem, NSwitch } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, withCtx, unref, createVNode, useSSRContext } from 'vue';
import { ssrRenderStyle, ssrRenderComponent } from 'vue/server-renderer';
import { useStorage } from '@vueuse/core';
import _ from 'lodash';
import './chunk-727cc0fb.js';
import './chunk-6003391e.js';
import 'pinia';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
function byOrder({ order }) {
return (a, b) => {
return order === "asc" ? a.localeCompare(b) : b.localeCompare(a);
};
}
function whenever(condition, fn) {
return (value) => condition ? fn(value) : value;
}
function convert(list, options) {
const lineBreak = options.keepLineBreaks ? "\n" : "";
return _.chain(list).thru(whenever(options.lowerCase, (text) => text.toLowerCase())).split("\n").thru(whenever(options.removeDuplicates, _.uniq)).thru(whenever(options.reverseList, _.reverse)).thru(whenever(!_.isNull(options.sortList), (parts) => parts.sort(byOrder({ order: options.sortList })))).map(whenever(options.trimItems, _.trim)).without("").map((p) => options.itemPrefix + p + options.itemSuffix).join(options.separator + lineBreak).thru((text) => [options.listPrefix, text, options.listSuffix].join(lineBreak)).value();
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "list-converter",
__ssrInlineRender: true,
setup(__props) {
const sortOrderOptions = [
{
label: "Sort ascending",
value: "asc",
disabled: false
},
{
label: "Sort descending",
value: "desc",
disabled: false
}
];
const conversionConfig = useStorage("list-converter:conversionConfig", {
lowerCase: false,
trimItems: true,
removeDuplicates: true,
keepLineBreaks: false,
itemPrefix: "",
itemSuffix: "",
listPrefix: "",
listSuffix: "",
reverseList: false,
sortList: null,
separator: ", "
});
function transformer(value) {
return convert(value, conversionConfig.value);
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_c_select = __unplugin_components_0;
const _component_c_input_text = __unplugin_components_3;
const _component_format_transformer = _sfc_main$1;
_push(`<!--[--><div style="${ssrRenderStyle({ "flex": "0 0 100%" })}"><div style="${ssrRenderStyle({ "margin": "0 auto", "max-width": "600px" })}">`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex${_scopeId}><div${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Trim list items",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(conversionConfig).trimItems,
"onUpdate:value": ($event) => unref(conversionConfig).trimItems = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(conversionConfig).trimItems,
"onUpdate:value": ($event) => unref(conversionConfig).trimItems = $event
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Remove duplicates",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(conversionConfig).removeDuplicates,
"onUpdate:value": ($event) => unref(conversionConfig).removeDuplicates = $event,
"data-test-id": "removeDuplicates"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(conversionConfig).removeDuplicates,
"onUpdate:value": ($event) => unref(conversionConfig).removeDuplicates = $event,
"data-test-id": "removeDuplicates"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Convert to lowercase",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(conversionConfig).lowerCase,
"onUpdate:value": ($event) => unref(conversionConfig).lowerCase = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(conversionConfig).lowerCase,
"onUpdate:value": ($event) => unref(conversionConfig).lowerCase = $event
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Keep line breaks",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(conversionConfig).keepLineBreaks,
"onUpdate:value": ($event) => unref(conversionConfig).keepLineBreaks = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(conversionConfig).keepLineBreaks,
"onUpdate:value": ($event) => unref(conversionConfig).keepLineBreaks = $event
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div><div flex-1${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_select, {
value: unref(conversionConfig).sortList,
"onUpdate:value": ($event) => unref(conversionConfig).sortList = $event,
label: "Sort list",
"label-position": "left",
"label-width": "120px",
"label-align": "right",
"mb-2": "",
options: sortOrderOptions,
"w-full": "",
disabled: unref(conversionConfig).reverseList,
"data-test-id": "sortList",
placeholder: "Sort alphabetically"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(conversionConfig).separator,
"onUpdate:value": ($event) => unref(conversionConfig).separator = $event,
label: "Separator",
"label-position": "left",
"label-width": "120px",
"label-align": "right",
"mb-2": "",
placeholder: ","
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Wrap item",
"label-placement": "left",
"label-width": "120",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_input_text, {
value: unref(conversionConfig).itemPrefix,
"onUpdate:value": ($event) => unref(conversionConfig).itemPrefix = $event,
placeholder: "Item prefix",
"test-id": "itemPrefix"
}, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_c_input_text, {
value: unref(conversionConfig).itemSuffix,
"onUpdate:value": ($event) => unref(conversionConfig).itemSuffix = $event,
placeholder: "Item suffix",
"test-id": "itemSuffix"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_input_text, {
value: unref(conversionConfig).itemPrefix,
"onUpdate:value": ($event) => unref(conversionConfig).itemPrefix = $event,
placeholder: "Item prefix",
"test-id": "itemPrefix"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(conversionConfig).itemSuffix,
"onUpdate:value": ($event) => unref(conversionConfig).itemSuffix = $event,
placeholder: "Item suffix",
"test-id": "itemSuffix"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Wrap list",
"label-placement": "left",
"label-width": "120",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_input_text, {
value: unref(conversionConfig).listPrefix,
"onUpdate:value": ($event) => unref(conversionConfig).listPrefix = $event,
placeholder: "List prefix",
"test-id": "listPrefix"
}, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_c_input_text, {
value: unref(conversionConfig).listSuffix,
"onUpdate:value": ($event) => unref(conversionConfig).listSuffix = $event,
placeholder: "List suffix",
"test-id": "listSuffix"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_input_text, {
value: unref(conversionConfig).listPrefix,
"onUpdate:value": ($event) => unref(conversionConfig).listPrefix = $event,
placeholder: "List prefix",
"test-id": "listPrefix"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(conversionConfig).listSuffix,
"onUpdate:value": ($event) => unref(conversionConfig).listSuffix = $event,
placeholder: "List suffix",
"test-id": "listSuffix"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div></div>`);
} else {
return [
createVNode("div", { flex: "" }, [
createVNode("div", null, [
createVNode(_component_n_form_item, {
label: "Trim list items",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(conversionConfig).trimItems,
"onUpdate:value": ($event) => unref(conversionConfig).trimItems = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Remove duplicates",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(conversionConfig).removeDuplicates,
"onUpdate:value": ($event) => unref(conversionConfig).removeDuplicates = $event,
"data-test-id": "removeDuplicates"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Convert to lowercase",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(conversionConfig).lowerCase,
"onUpdate:value": ($event) => unref(conversionConfig).lowerCase = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Keep line breaks",
"label-placement": "left",
"label-width": "150",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(conversionConfig).keepLineBreaks,
"onUpdate:value": ($event) => unref(conversionConfig).keepLineBreaks = $event
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
createVNode("div", { "flex-1": "" }, [
createVNode(_component_c_select, {
value: unref(conversionConfig).sortList,
"onUpdate:value": ($event) => unref(conversionConfig).sortList = $event,
label: "Sort list",
"label-position": "left",
"label-width": "120px",
"label-align": "right",
"mb-2": "",
options: sortOrderOptions,
"w-full": "",
disabled: unref(conversionConfig).reverseList,
"data-test-id": "sortList",
placeholder: "Sort alphabetically"
}, null, 8, ["value", "onUpdate:value", "disabled"]),
createVNode(_component_c_input_text, {
value: unref(conversionConfig).separator,
"onUpdate:value": ($event) => unref(conversionConfig).separator = $event,
label: "Separator",
"label-position": "left",
"label-width": "120px",
"label-align": "right",
"mb-2": "",
placeholder: ","
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_form_item, {
label: "Wrap item",
"label-placement": "left",
"label-width": "120",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(conversionConfig).itemPrefix,
"onUpdate:value": ($event) => unref(conversionConfig).itemPrefix = $event,
placeholder: "Item prefix",
"test-id": "itemPrefix"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(conversionConfig).itemSuffix,
"onUpdate:value": ($event) => unref(conversionConfig).itemSuffix = $event,
placeholder: "Item suffix",
"test-id": "itemSuffix"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Wrap list",
"label-placement": "left",
"label-width": "120",
"show-feedback": false,
"mb-2": ""
}, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(conversionConfig).listPrefix,
"onUpdate:value": ($event) => unref(conversionConfig).listPrefix = $event,
placeholder: "List prefix",
"test-id": "listPrefix"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(conversionConfig).listSuffix,
"onUpdate:value": ($event) => unref(conversionConfig).listSuffix = $event,
placeholder: "List suffix",
"test-id": "listSuffix"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
])
])
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
_push(ssrRenderComponent(_component_format_transformer, {
"input-label": "Your input data",
"input-placeholder": "Paste your input data here...",
"output-label": "Your transformed data",
transformer
}, null, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/list-converter/list-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

59
dist/server/chunks/chunk-5640c0ea.js vendored Normal file
View file

@ -0,0 +1,59 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { stringify } from 'iarna-toml-esm';
import JSON5 from 'json5';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "json-to-toml",
__ssrInlineRender: true,
setup(__props) {
const convertJsonToToml = (value) => [stringify(JSON5.parse(value))].flat().join("\n").trim();
const transformer = (value) => value.trim() === "" ? "" : withDefaultOnError(() => convertJsonToToml(value), "");
const rules = [
{
validator: (v) => v === "" || JSON5.parse(v),
message: "Provided JSON is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your JSON",
"input-placeholder": "Paste your JSON here...",
"output-label": "TOML from your JSON",
"output-language": "toml",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/json-to-toml/json-to-toml.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

13
dist/server/chunks/chunk-5697d061.js vendored Normal file
View file

@ -0,0 +1,13 @@
function isNotThrowing(cb) {
try {
cb();
return true;
} catch (_) {
return false;
}
}
function booleanToHumanReadable(value) {
return value ? "Yes" : "No";
}
export { booleanToHumanReadable as b, isNotThrowing as i };

127
dist/server/chunks/chunk-578e2d23.js vendored Normal file
View file

@ -0,0 +1,127 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { NFormItem, NInputNumber } from 'naive-ui';
import { defineComponent, ref, mergeProps, unref, withCtx, isRef, createVNode, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderStyle, ssrRenderComponent } from 'vue/server-renderer';
import { pki } from 'node-forge';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import { a as withDefaultOnErrorAsync } from './chunk-f1b4cc24.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { a as computedRefreshableAsync } from './chunk-cc665c88.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
const workerScript = "/assets/static/prime.worker.min.e367bd53.js";
function generateRawPairs({ bits = 2048 }) {
return new Promise(
(resolve, reject) => pki.rsa.generateKeyPair({ bits, workerScript }, (err, keyPair) => {
if (err) {
reject(err);
return;
}
resolve(keyPair);
})
);
}
async function generateKeyPair(config = {}) {
const { privateKey, publicKey } = await generateRawPairs(config);
return {
publicKeyPem: pki.publicKeyToPem(publicKey),
privateKeyPem: pki.privateKeyToPem(privateKey)
};
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "rsa-key-pair-generator",
__ssrInlineRender: true,
setup(__props) {
const bits = ref(2048);
const emptyCerts = { publicKeyPem: "", privateKeyPem: "" };
const { attrs: bitsValidationAttrs } = useValidation({
source: bits,
rules: [
{
message: "Bits should be 256 <= bits <= 16384 and be a multiple of 8",
validator: (value) => value >= 256 && value <= 16384 && value % 8 === 0
}
]
});
const [certs, refreshCerts] = computedRefreshableAsync(
() => withDefaultOnErrorAsync(() => generateKeyPair({ bits: bits.value }), emptyCerts),
emptyCerts
);
return (_ctx, _push, _parent, _attrs) => {
const _component_n_form_item = NFormItem;
const _component_n_input_number = NInputNumber;
const _component_c_button = __unplugin_components_0;
_push(`<!--[--><div style="${ssrRenderStyle({ "flex": "0 0 100%" })}"><div item-style="flex: 1 1 0" style="${ssrRenderStyle({ "max-width": "600px" })}" mx-auto flex gap-3>`);
_push(ssrRenderComponent(_component_n_form_item, mergeProps({ label: "Bits :" }, unref(bitsValidationAttrs), {
"label-placement": "left",
"label-width": "100"
}), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_number, {
value: unref(bits),
"onUpdate:value": ($event) => isRef(bits) ? bits.value = $event : null,
min: "256",
max: "16384",
step: "8"
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(bits),
"onUpdate:value": ($event) => isRef(bits) ? bits.value = $event : null,
min: "256",
max: "16384",
step: "8"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_button, { onClick: unref(refreshCerts) }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Refresh key-pair `);
} else {
return [
createTextVNode(" Refresh key-pair ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div><div><h3>Public key</h3>`);
_push(ssrRenderComponent(TextareaCopyable, {
value: unref(certs).publicKeyPem
}, null, _parent));
_push(`</div><div><h3>Private key</h3>`);
_push(ssrRenderComponent(TextareaCopyable, {
value: unref(certs).privateKeyPem
}, null, _parent));
_push(`</div><!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

528
dist/server/chunks/chunk-57f69d1c.js vendored Normal file
View file

@ -0,0 +1,528 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NFormItem, NSlider, NSwitch } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { r as randFromArray, a as randIntFromInterval } from './chunk-11f44f81.js';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import './chunk-35c3d701.js';
import 'lodash';
const vocabulary = [
"a",
"ac",
"accumsan",
"ad",
"adipiscing",
"aenean",
"aliquam",
"aliquet",
"amet",
"ante",
"aptent",
"arcu",
"at",
"auctor",
"bibendum",
"blandit",
"class",
"commodo",
"condimentum",
"congue",
"consectetur",
"consequat",
"conubia",
"convallis",
"cras",
"cubilia",
"cum",
"curabitur",
"curae",
"dapibus",
"diam",
"dictum",
"dictumst",
"dignissim",
"dolor",
"donec",
"dui",
"duis",
"egestas",
"eget",
"eleifend",
"elementum",
"elit",
"enim",
"erat",
"eros",
"est",
"et",
"etiam",
"eu",
"euismod",
"facilisi",
"faucibus",
"felis",
"fermentum",
"feugiat",
"fringilla",
"fusce",
"gravida",
"habitant",
"habitasse",
"hac",
"hendrerit",
"himenaeos",
"iaculis",
"id",
"imperdiet",
"in",
"inceptos",
"integer",
"interdum",
"ipsum",
"justo",
"lacinia",
"lacus",
"laoreet",
"lectus",
"leo",
"ligula",
"litora",
"lobortis",
"lorem",
"luctus",
"maecenas",
"magna",
"magnis",
"malesuada",
"massa",
"mattis",
"mauris",
"metus",
"mi",
"molestie",
"mollis",
"montes",
"morbi",
"mus",
"nam",
"nascetur",
"natoque",
"nec",
"neque",
"netus",
"nisi",
"nisl",
"non",
"nostra",
"nulla",
"nullam",
"nunc",
"odio",
"orci",
"ornare",
"parturient",
"pellentesque",
"penatibus",
"per",
"pharetra",
"phasellus",
"placerat",
"platea",
"porta",
"porttitor",
"posuere",
"potenti",
"praesent",
"pretium",
"primis",
"proin",
"pulvinar",
"purus",
"quam",
"quis",
"quisque",
"rhoncus",
"ridiculus",
"risus",
"rutrum",
"sagittis",
"sapien",
"scelerisque",
"sed",
"sem",
"semper",
"senectus",
"sit",
"sociis",
"sociosqu",
"sodales",
"sollicitudin",
"suscipit",
"suspendisse",
"taciti",
"tellus",
"tempor",
"tempus",
"tincidunt",
"torquent",
"tortor",
"turpis",
"ullamcorper",
"ultrices",
"ultricies",
"urna",
"varius",
"vehicula",
"vel",
"velit",
"venenatis",
"vestibulum",
"vitae",
"vivamus",
"viverra",
"volutpat",
"vulputate"
];
const firstSentence = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
function generateSentence(length) {
const sentence = Array.from({ length }).map(() => randFromArray(vocabulary)).join(" ");
return `${sentence.charAt(0).toUpperCase() + sentence.slice(1)}.`;
}
function generateLoremIpsum({
paragraphCount = 1,
sentencePerParagraph = 3,
wordCount = 10,
startWithLoremIpsum = true,
asHTML = false
}) {
const paragraphs = Array.from({ length: paragraphCount }).map(
() => Array.from({ length: sentencePerParagraph }).map(() => generateSentence(wordCount))
);
if (startWithLoremIpsum) {
paragraphs[0][0] = firstSentence;
}
if (asHTML) {
return `<p>${paragraphs.map((s) => s.join(" ")).join("</p>\n\n<p>")}</p>`;
}
return paragraphs.map((s) => s.join(" ")).join("\n\n");
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "lorem-ipsum-generator",
__ssrInlineRender: true,
setup(__props) {
const paragraphs = ref(1);
const sentences = ref([3, 8]);
const words = ref([8, 15]);
const startWithLoremIpsum = ref(true);
const asHTML = ref(false);
const loremIpsumText = computed(
() => generateLoremIpsum({
paragraphCount: paragraphs.value,
asHTML: asHTML.value,
sentencePerParagraph: randIntFromInterval(sentences.value[0], sentences.value[1]),
wordCount: randIntFromInterval(words.value[0], words.value[1]),
startWithLoremIpsum: startWithLoremIpsum.value
})
);
const { copy } = useCopy({ source: loremIpsumText, text: "Lorem ipsum copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_form_item = NFormItem;
const _component_n_slider = NSlider;
const _component_n_switch = NSwitch;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Paragraphs",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_slider, {
value: unref(paragraphs),
"onUpdate:value": ($event) => isRef(paragraphs) ? paragraphs.value = $event : null,
step: 1,
min: 1,
max: 20
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_slider, {
value: unref(paragraphs),
"onUpdate:value": ($event) => isRef(paragraphs) ? paragraphs.value = $event : null,
step: 1,
min: 1,
max: 20
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Sentences per paragraph",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_slider, {
value: unref(sentences),
"onUpdate:value": ($event) => isRef(sentences) ? sentences.value = $event : null,
range: "",
step: 1,
min: 1,
max: 50
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_slider, {
value: unref(sentences),
"onUpdate:value": ($event) => isRef(sentences) ? sentences.value = $event : null,
range: "",
step: 1,
min: 1,
max: 50
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Words per sentence",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_slider, {
value: unref(words),
"onUpdate:value": ($event) => isRef(words) ? words.value = $event : null,
range: "",
step: 1,
min: 1,
max: 50
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_slider, {
value: unref(words),
"onUpdate:value": ($event) => isRef(words) ? words.value = $event : null,
range: "",
step: 1,
min: 1,
max: 50
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Start with lorem ipsum ?",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(startWithLoremIpsum),
"onUpdate:value": ($event) => isRef(startWithLoremIpsum) ? startWithLoremIpsum.value = $event : null
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(startWithLoremIpsum),
"onUpdate:value": ($event) => isRef(startWithLoremIpsum) ? startWithLoremIpsum.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "As html ?",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(asHTML),
"onUpdate:value": ($event) => isRef(asHTML) ? asHTML.value = $event : null
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(asHTML),
"onUpdate:value": ($event) => isRef(asHTML) ? asHTML.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(loremIpsumText),
multiline: "",
placeholder: "Your lorem ipsum...",
readonly: "",
"mt-5": "",
rows: "5"
}, null, _parent2, _scopeId));
_push2(`<div mt-5 flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
autofocus: "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_n_form_item, {
label: "Paragraphs",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_slider, {
value: unref(paragraphs),
"onUpdate:value": ($event) => isRef(paragraphs) ? paragraphs.value = $event : null,
step: 1,
min: 1,
max: 20
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Sentences per paragraph",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_slider, {
value: unref(sentences),
"onUpdate:value": ($event) => isRef(sentences) ? sentences.value = $event : null,
range: "",
step: 1,
min: 1,
max: 50
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Words per sentence",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_slider, {
value: unref(words),
"onUpdate:value": ($event) => isRef(words) ? words.value = $event : null,
range: "",
step: 1,
min: 1,
max: 50
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Start with lorem ipsum ?",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(startWithLoremIpsum),
"onUpdate:value": ($event) => isRef(startWithLoremIpsum) ? startWithLoremIpsum.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "As html ?",
"show-feedback": false,
"label-width": "200",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(asHTML),
"onUpdate:value": ($event) => isRef(asHTML) ? asHTML.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_c_input_text, {
value: unref(loremIpsumText),
multiline: "",
placeholder: "Your lorem ipsum...",
readonly: "",
"mt-5": "",
rows: "5"
}, null, 8, ["value"]),
createVNode("div", {
"mt-5": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
autofocus: "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

280
dist/server/chunks/chunk-58246ec6.js vendored Normal file
View file

@ -0,0 +1,280 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NFormItem, NSwitch } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
import { t as textToBase64, b as base64ToText, i as isValidBase64 } from './chunk-72fc6fca.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { useStorage } from '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "base64-string-converter",
__ssrInlineRender: true,
setup(__props) {
const encodeUrlSafe = useStorage("base64-string-converter--encode-url-safe", false);
const decodeUrlSafe = useStorage("base64-string-converter--decode-url-safe", false);
const textInput = ref("");
const base64Output = computed(() => textToBase64(textInput.value, { makeUrlSafe: encodeUrlSafe.value }));
const { copy: copyTextBase64 } = useCopy({ source: base64Output, text: "Base64 string copied to the clipboard" });
const base64Input = ref("");
const textOutput = computed(
() => withDefaultOnError(() => base64ToText(base64Input.value.trim(), { makeUrlSafe: decodeUrlSafe.value }), "")
);
const { copy: copyText } = useCopy({ source: textOutput, text: "String copied to the clipboard" });
const b64ValidationRules = [
{
message: "Invalid base64 string",
validator: (value) => isValidBase64(value.trim(), { makeUrlSafe: decodeUrlSafe.value })
}
];
const b64ValidationWatch = [decodeUrlSafe];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, { title: "String to base64" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Encode URL safe",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(encodeUrlSafe),
"onUpdate:value": ($event) => isRef(encodeUrlSafe) ? encodeUrlSafe.value = $event : null
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(encodeUrlSafe),
"onUpdate:value": ($event) => isRef(encodeUrlSafe) ? encodeUrlSafe.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(textInput),
"onUpdate:value": ($event) => isRef(textInput) ? textInput.value = $event : null,
multiline: "",
placeholder: "Put your string here...",
rows: "5",
label: "String to encode",
"raw-text": "",
"mb-5": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
label: "Base64 of string",
value: unref(base64Output),
multiline: "",
readonly: "",
placeholder: "The base64 encoding of your string will be here",
rows: "5",
"mb-5": ""
}, null, _parent2, _scopeId));
_push2(`<div flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyTextBase64)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy base64 `);
} else {
return [
createTextVNode(" Copy base64 ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_n_form_item, {
label: "Encode URL safe",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(encodeUrlSafe),
"onUpdate:value": ($event) => isRef(encodeUrlSafe) ? encodeUrlSafe.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_c_input_text, {
value: unref(textInput),
"onUpdate:value": ($event) => isRef(textInput) ? textInput.value = $event : null,
multiline: "",
placeholder: "Put your string here...",
rows: "5",
label: "String to encode",
"raw-text": "",
"mb-5": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
label: "Base64 of string",
value: unref(base64Output),
multiline: "",
readonly: "",
placeholder: "The base64 encoding of your string will be here",
rows: "5",
"mb-5": ""
}, null, 8, ["value"]),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copyTextBase64)()
}, {
default: withCtx(() => [
createTextVNode(" Copy base64 ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, { title: "Base64 to string" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Decode URL safe",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_switch, {
value: unref(decodeUrlSafe),
"onUpdate:value": ($event) => isRef(decodeUrlSafe) ? decodeUrlSafe.value = $event : null
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_switch, {
value: unref(decodeUrlSafe),
"onUpdate:value": ($event) => isRef(decodeUrlSafe) ? decodeUrlSafe.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(base64Input),
"onUpdate:value": ($event) => isRef(base64Input) ? base64Input.value = $event : null,
multiline: "",
placeholder: "Your base64 string...",
rows: "5",
"validation-rules": b64ValidationRules,
"validation-watch": b64ValidationWatch,
label: "Base64 string to decode",
"mb-5": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(textOutput),
"onUpdate:value": ($event) => isRef(textOutput) ? textOutput.value = $event : null,
label: "Decoded string",
placeholder: "The decoded string will be here",
multiline: "",
rows: "5",
readonly: "",
"mb-5": ""
}, null, _parent2, _scopeId));
_push2(`<div flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyText)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy decoded string `);
} else {
return [
createTextVNode(" Copy decoded string ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_n_form_item, {
label: "Decode URL safe",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_switch, {
value: unref(decodeUrlSafe),
"onUpdate:value": ($event) => isRef(decodeUrlSafe) ? decodeUrlSafe.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_c_input_text, {
value: unref(base64Input),
"onUpdate:value": ($event) => isRef(base64Input) ? base64Input.value = $event : null,
multiline: "",
placeholder: "Your base64 string...",
rows: "5",
"validation-rules": b64ValidationRules,
"validation-watch": b64ValidationWatch,
label: "Base64 string to decode",
"mb-5": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(textOutput),
"onUpdate:value": ($event) => isRef(textOutput) ? textOutput.value = $event : null,
label: "Decoded string",
placeholder: "The decoded string will be here",
multiline: "",
rows: "5",
readonly: "",
"mb-5": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copyText)()
}, {
default: withCtx(() => [
createTextVNode(" Copy decoded string ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/base64-string-converter/base64-string-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

47
dist/server/chunks/chunk-588e4d58.js vendored Normal file
View file

@ -0,0 +1,47 @@
import { _ as _sfc_main$1 } from './chunk-8109fd17.js';
import { defineComponent, toRefs, computed, mergeProps, unref, withCtx, createVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
const initialText = "Copy to clipboard";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "SpanCopyable",
__ssrInlineRender: true,
props: {
value: { default: "" }
},
setup(__props) {
const props = __props;
const { value } = toRefs(props);
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? "Copied!" : initialText);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_tooltip = _sfc_main$1;
_push(ssrRenderComponent(_component_c_tooltip, mergeProps({ tooltip: unref(tooltipText) }, _attrs), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<span cursor-pointer font-mono${_scopeId}>${ssrInterpolate(unref(value))}</span>`);
} else {
return [
createVNode("span", {
"cursor-pointer": "",
"font-mono": "",
onClick: ($event) => unref(copy)()
}, toDisplayString(unref(value)), 9, ["onClick"])
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SpanCopyable.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

193
dist/server/chunks/chunk-599c1e6a.js vendored Normal file
View file

@ -0,0 +1,193 @@
import { _ as _sfc_main$1 } from './chunk-83cdd9a0.js';
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, withCtx, unref, isRef, createTextVNode, createVNode, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { useBase64 } from '@vueuse/core';
import { u as useCopy } from './chunk-77c5cc16.js';
import { u as useDownloadFileFromBase64 } from './chunk-cce4ae69.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { i as isValidBase64 } from './chunk-72fc6fca.js';
import 'lodash';
import 'pinia';
import './chunk-11f44f81.js';
import 'naive-ui';
import 'mime-types';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "base64-file-converter",
__ssrInlineRender: true,
setup(__props) {
const base64Input = ref("");
const { download } = useDownloadFileFromBase64({ source: base64Input });
const base64InputValidation = useValidation({
source: base64Input,
rules: [
{
message: "Invalid base 64 string",
validator: (value) => isValidBase64(value.trim())
}
]
});
function downloadFile() {
if (!base64InputValidation.isValid) {
return;
}
try {
download();
} catch (_) {
}
}
const fileInput = ref();
const { base64: fileBase64 } = useBase64(fileInput);
const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: "Base64 string copied to the clipboard" });
async function onUpload(file) {
if (file) {
fileInput.value = file;
}
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
const _component_c_file_upload = _sfc_main$1;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, { title: "Base64 to file" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(base64Input),
"onUpdate:value": ($event) => isRef(base64Input) ? base64Input.value = $event : null,
multiline: "",
placeholder: "Put your base64 file string here...",
rows: "5",
validation: unref(base64InputValidation),
"mb-2": ""
}, null, _parent2, _scopeId));
_push2(`<div flex justify-center data-v-7721e582${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
disabled: unref(base64Input) === "" || !unref(base64InputValidation).isValid,
onClick: ($event) => downloadFile()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Download file `);
} else {
return [
createTextVNode(" Download file ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(base64Input),
"onUpdate:value": ($event) => isRef(base64Input) ? base64Input.value = $event : null,
multiline: "",
placeholder: "Put your base64 file string here...",
rows: "5",
validation: unref(base64InputValidation),
"mb-2": ""
}, null, 8, ["value", "onUpdate:value", "validation"]),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
disabled: unref(base64Input) === "" || !unref(base64InputValidation).isValid,
onClick: ($event) => downloadFile()
}, {
default: withCtx(() => [
createTextVNode(" Download file ")
]),
_: 1
}, 8, ["disabled", "onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, { title: "File to base64" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_file_upload, {
title: "Drag and drop a file here, or click to select a file",
onFileUpload: onUpload
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(fileBase64),
multiline: "",
readonly: "",
placeholder: "File in base64 will be here",
rows: "5",
"my-2": ""
}, null, _parent2, _scopeId));
_push2(`<div flex justify-center data-v-7721e582${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyFileBase64)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_file_upload, {
title: "Drag and drop a file here, or click to select a file",
onFileUpload: onUpload
}),
createVNode(_component_c_input_text, {
value: unref(fileBase64),
multiline: "",
readonly: "",
placeholder: "File in base64 will be here",
rows: "5",
"my-2": ""
}, null, 8, ["value"]),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copyFileBase64)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const base64FileConverter_vue_vue_type_style_index_0_scoped_7721e582_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/base64-file-converter/base64-file-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const base64FileConverter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7721e582"]]);
export { base64FileConverter as default };

8
dist/server/chunks/chunk-5c0cc9d1.js vendored Normal file
View file

@ -0,0 +1,8 @@
import { parse } from 'iarna-toml-esm';
import { i as isNotThrowing } from './chunk-5697d061.js';
function isValidToml(toml) {
return isNotThrowing(() => parse(toml));
}
export { isValidToml as i };

89
dist/server/chunks/chunk-5d166488.js vendored Normal file
View file

@ -0,0 +1,89 @@
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { NDivider } from 'naive-ui';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, computed, unref, isRef, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { c as convertBase } from './chunk-5f44352e.js';
import { i as ipv4ToInt, b as ipv4ToIpv6, a as isValidIpv4 } from './chunk-7b2d32fe.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { useStorage } from '@vueuse/core';
import './chunk-95ec8cf7.js';
import './chunk-6003391e.js';
import 'pinia';
import './chunk-8109fd17.js';
import './chunk-77c5cc16.js';
import './chunk-11f44f81.js';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ipv4-address-converter",
__ssrInlineRender: true,
setup(__props) {
const rawIpAddress = useStorage("ipv4-converter:ip", "192.168.1.1");
const convertedSections = computed(() => {
const ipInDecimal = ipv4ToInt({ ip: rawIpAddress.value });
return [
{
label: "Decimal: ",
value: String(ipInDecimal)
},
{
label: "Hexadecimal: ",
value: convertBase({ fromBase: 10, toBase: 16, value: String(ipInDecimal) }).toUpperCase()
},
{
label: "Binary: ",
value: convertBase({ fromBase: 10, toBase: 2, value: String(ipInDecimal) })
},
{
label: "Ipv6: ",
value: ipv4ToIpv6({ ip: rawIpAddress.value })
},
{
label: "Ipv6 (short): ",
value: ipv4ToIpv6({ ip: rawIpAddress.value, prefix: "::ffff:" })
}
];
});
const { attrs: validationAttrs } = useValidation({
source: rawIpAddress,
rules: [{ message: "Invalid ipv4 address", validator: (ip) => isValidIpv4({ ip }) }]
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_n_divider = NDivider;
const _component_input_copyable = _sfc_main$1;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(rawIpAddress),
"onUpdate:value": ($event) => isRef(rawIpAddress) ? rawIpAddress.value = $event : null,
label: "The ipv4 address:",
placeholder: "The ipv4 address..."
}, null, _parent));
_push(ssrRenderComponent(_component_n_divider, null, null, _parent));
_push(`<!--[-->`);
ssrRenderList(unref(convertedSections), ({ label, value }) => {
_push(ssrRenderComponent(_component_input_copyable, {
key: label,
label,
"label-position": "left",
"label-width": "100px",
"label-align": "right",
"mb-2": "",
value: unref(validationAttrs).validationStatus === "error" ? "" : value,
placeholder: "Set a correct ipv4 address"
}, null, _parent));
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/ipv4-address-converter/ipv4-address-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

19
dist/server/chunks/chunk-5f44352e.js vendored Normal file
View file

@ -0,0 +1,19 @@
function convertBase({ value, fromBase, toBase }) {
const range = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/".split("");
const fromRange = range.slice(0, fromBase);
const toRange = range.slice(0, toBase);
let decValue = value.split("").reverse().reduce((carry, digit, index) => {
if (!fromRange.includes(digit)) {
throw new Error(`Invalid digit "${digit}" for base ${fromBase}.`);
}
return carry += fromRange.indexOf(digit) * fromBase ** index;
}, 0);
let newValue = "";
while (decValue > 0) {
newValue = toRange[decValue % toBase] + newValue;
decValue = (decValue - decValue % toBase) / toBase;
}
return newValue || "0";
}
export { convertBase as c };

170
dist/server/chunks/chunk-5f7f0b39.js vendored Normal file
View file

@ -0,0 +1,170 @@
import { NInputGroup, NInputGroupLabel, NInputNumber } from 'naive-ui';
import { defineComponent, reactive, unref, withCtx, createTextVNode, toDisplayString, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
const convertCelsiusToKelvin = (temperature) => temperature + 273.15;
const convertKelvinToCelsius = (temperature) => temperature - 273.15;
const convertFahrenheitToKelvin = (temperature) => (temperature + 459.67) * (5 / 9);
const convertKelvinToFahrenheit = (temperature) => temperature * (9 / 5) - 459.67;
const convertRankineToKelvin = (temperature) => temperature * (5 / 9);
const convertKelvinToRankine = (temperature) => temperature * (9 / 5);
const convertDelisleToKelvin = (temperature) => 373.15 - 2 / 3 * temperature;
const convertKelvinToDelisle = (temperature) => 3 / 2 * (373.15 - temperature);
const convertNewtonToKelvin = (temperature) => temperature * (100 / 33) + 273.15;
const convertKelvinToNewton = (temperature) => (temperature - 273.15) * (33 / 100);
const convertReaumurToKelvin = (temperature) => temperature * (5 / 4) + 273.15;
const convertKelvinToReaumur = (temperature) => (temperature - 273.15) * (4 / 5);
const convertRomerToKelvin = (temperature) => (temperature - 7.5) * (40 / 21) + 273.15;
const convertKelvinToRomer = (temperature) => (temperature - 273.15) * (21 / 40) + 7.5;
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "temperature-converter",
__ssrInlineRender: true,
setup(__props) {
const units = reactive({
kelvin: {
title: "Kelvin",
unit: "K",
ref: 0,
toKelvin: _.identity,
fromKelvin: _.identity
},
celsius: {
title: "Celsius",
unit: "°C",
ref: 0,
toKelvin: convertCelsiusToKelvin,
fromKelvin: convertKelvinToCelsius
},
fahrenheit: {
title: "Fahrenheit",
unit: "°F",
ref: 0,
toKelvin: convertFahrenheitToKelvin,
fromKelvin: convertKelvinToFahrenheit
},
rankine: {
title: "Rankine",
unit: "°R",
ref: 0,
toKelvin: convertRankineToKelvin,
fromKelvin: convertKelvinToRankine
},
delisle: {
title: "Delisle",
unit: "°De",
ref: 0,
toKelvin: convertDelisleToKelvin,
fromKelvin: convertKelvinToDelisle
},
newton: {
title: "Newton",
unit: "°N",
ref: 0,
toKelvin: convertNewtonToKelvin,
fromKelvin: convertKelvinToNewton
},
reaumur: {
title: "Réaumur",
unit: "°Ré",
ref: 0,
toKelvin: convertReaumurToKelvin,
fromKelvin: convertKelvinToReaumur
},
romer: {
title: "Rømer",
unit: "°Rø",
ref: 0,
toKelvin: convertRomerToKelvin,
fromKelvin: convertKelvinToRomer
}
});
function update(key) {
const { ref: value, toKelvin } = units[key];
const kelvins = toKelvin(value) ?? 0;
_.chain(units).omit(key).forEach(({ fromKelvin }, index) => {
units[index].ref = Math.floor((fromKelvin(kelvins) ?? 0) * 100) / 100;
}).value();
}
update("kelvin");
return (_ctx, _push, _parent, _attrs) => {
const _component_n_input_group = NInputGroup;
const _component_n_input_group_label = NInputGroupLabel;
const _component_n_input_number = NInputNumber;
_push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
ssrRenderList(Object.entries(unref(units)), ([key, { title, unit }]) => {
_push(ssrRenderComponent(_component_n_input_group, {
key,
"mb-3": "",
"w-full": ""
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_group_label, { style: { "width": "100px" } }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(title)}`);
} else {
return [
createTextVNode(toDisplayString(title), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_input_number, {
value: unref(units)[key].ref,
"onUpdate:value": [($event) => unref(units)[key].ref = $event, () => update(key)],
style: { "flex": "1" }
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_input_group_label, { style: { "width": "50px" } }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unit)}`);
} else {
return [
createTextVNode(toDisplayString(unit), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_group_label, { style: { "width": "100px" } }, {
default: withCtx(() => [
createTextVNode(toDisplayString(title), 1)
]),
_: 2
}, 1024),
createVNode(_component_n_input_number, {
value: unref(units)[key].ref,
"onUpdate:value": [($event) => unref(units)[key].ref = $event, () => update(key)],
style: { "flex": "1" }
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_input_group_label, { style: { "width": "50px" } }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unit), 1)
]),
_: 2
}, 1024)
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/temperature-converter/temperature-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

295
dist/server/chunks/chunk-6003391e.js vendored Normal file
View file

@ -0,0 +1,295 @@
import { watch, computed, defineComponent, toRefs, unref, createVNode, resolveDynamicComponent, mergeProps, withCtx, renderSlot, useSSRContext } from 'vue';
import { ssrRenderVNode, ssrRenderSlot } from 'vue/server-renderer';
import { useDark, useToggle, useMediaQuery, useStorage } from '@vueuse/core';
import { defineStore } from 'pinia';
const useStyleStore = defineStore("style", {
state: () => {
const isDarkTheme = useDark();
const toggleDark = useToggle(isDarkTheme);
const isSmallScreen = useMediaQuery("(max-width: 700px)");
const isMenuCollapsed = useStorage("isMenuCollapsed", isSmallScreen.value);
watch(isSmallScreen, (v) => isMenuCollapsed.value = v);
return {
isDarkTheme,
toggleDark,
isMenuCollapsed,
isSmallScreen
};
}
});
function defineThemes(themes) {
return {
themes,
useTheme() {
const styleStore = useStyleStore();
return computed(() => themes[styleStore.isDarkTheme ? "dark" : "light"]);
}
};
}
const { themes: appThemes, useTheme: useAppTheme } = defineThemes({
light: {
background: "#ffffff",
text: {
baseColor: "#333639",
mutedColor: "#767c82"
},
default: {
color: "rgba(46, 51, 56, 0.05)",
colorHover: "rgba(46, 51, 56, 0.09)",
colorPressed: "rgba(46, 51, 56, 0.22)"
},
primary: {
color: "#18a058",
colorHover: "#1ea54c",
colorPressed: "#0C7A43",
colorFaded: "#18a0582f"
},
warning: {
color: "#f59e0b",
colorHover: "#f59e0b",
colorPressed: "#f59e0b",
colorFaded: "#f59e0b2f"
},
success: {
color: "#18a058",
colorHover: "#36ad6a",
colorPressed: "#0c7a43",
colorFaded: "#18a0582f"
},
error: {
color: "#d03050",
colorHover: "#de576d",
colorPressed: "#ab1f3f",
colorFaded: "#d030502a"
}
},
dark: {
background: "#1e1e1e",
text: {
baseColor: "#ffffffd1",
mutedColor: "#ffffff80"
},
default: {
color: "rgba(255, 255, 255, 0.08)",
colorHover: "rgba(255, 255, 255, 0.12)",
colorPressed: "rgba(255, 255, 255, 0.24)"
},
primary: {
color: "#1ea54c",
colorHover: "#36AD6A",
colorPressed: "#0C7A43",
colorFaded: "#18a0582f"
},
warning: {
color: "#f59e0b",
colorHover: "#f59e0b",
colorPressed: "#f59e0b",
colorFaded: "#f59e0b2f"
},
success: {
color: "#18a058",
colorHover: "#36ad6a",
colorPressed: "#0c7a43",
colorFaded: "#18a0582f"
},
error: {
color: "#e88080",
colorHover: "#e98b8b",
colorPressed: "#e57272",
colorFaded: "#e8808029"
}
}
});
const clampHex = (value) => Math.max(0, Math.min(255, Math.round(value)));
function lighten(color, amount) {
const alpha = color.length === 9 ? color.slice(7) : "";
const num = Number.parseInt(color.slice(1, 7), 16);
const r = clampHex((num >> 16 & 255) + amount);
const g = clampHex((num >> 8 & 255) + amount);
const b = clampHex((num & 255) + amount);
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}${alpha}`;
}
function darken(color, amount) {
return lighten(color, -amount);
}
function createState({
textColor,
backgroundColor,
hoverBackground,
hoveredTextColor = textColor,
pressedBackground,
pressedTextColor = textColor
}) {
return {
textColor,
backgroundColor,
hover: { textColor: hoveredTextColor, backgroundColor: hoverBackground },
pressed: { textColor: pressedTextColor, backgroundColor: pressedBackground }
};
}
function createTheme({ style }) {
const theme = appThemes[style];
return {
size: {
small: {
width: "28px",
fontSize: "12px"
},
medium: {
width: "34px",
fontSize: "14px"
},
large: {
width: "40px",
fontSize: "16px"
}
},
basic: {
default: createState({
textColor: theme.text.baseColor,
backgroundColor: theme.default.color,
hoverBackground: theme.default.colorHover,
pressedBackground: theme.default.colorPressed
}),
primary: createState({
textColor: theme.primary.color,
backgroundColor: theme.primary.colorFaded,
hoverBackground: lighten(theme.primary.colorFaded, 30),
pressedBackground: darken(theme.primary.colorFaded, 30)
}),
warning: createState({
textColor: theme.warning.color,
backgroundColor: theme.warning.colorFaded,
hoverBackground: lighten(theme.warning.colorFaded, 30),
pressedBackground: darken(theme.warning.colorFaded, 30)
}),
error: createState({
textColor: theme.error.color,
backgroundColor: theme.error.colorFaded,
hoverBackground: lighten(theme.error.colorFaded, 30),
pressedBackground: darken(theme.error.colorFaded, 30)
})
},
text: {
default: createState({
textColor: theme.text.baseColor,
backgroundColor: "transparent",
hoverBackground: theme.default.colorHover,
pressedBackground: theme.default.colorPressed
}),
primary: createState({
textColor: theme.primary.color,
backgroundColor: "transparent",
hoverBackground: theme.primary.colorFaded,
pressedBackground: darken(theme.primary.colorFaded, 30)
}),
warning: createState({
textColor: darken(theme.warning.color, 20),
backgroundColor: "transparent",
hoverBackground: theme.warning.colorFaded,
pressedBackground: darken(theme.warning.colorFaded, 30)
}),
error: createState({
textColor: darken(theme.error.color, 20),
backgroundColor: "transparent",
hoverBackground: theme.error.colorFaded,
pressedBackground: darken(theme.error.colorFaded, 30)
})
}
};
}
const { useTheme } = defineThemes({
dark: createTheme({ style: "dark" }),
light: createTheme({ style: "light" })
});
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-button",
__ssrInlineRender: true,
props: {
type: { default: "default" },
variant: { default: "basic" },
disabled: { type: Boolean, default: false },
round: { type: Boolean, default: false },
circle: { type: Boolean, default: false },
href: { default: void 0 },
to: { default: void 0 },
size: { default: "medium" }
},
emits: ["click"],
setup(__props, { emit: emits }) {
const props = __props;
const { variant, disabled, round, circle, href, type, to, size: sizeName } = toRefs(props);
function handleClick(event) {
if (!disabled.value) {
emits("click", event);
}
}
const theme = useTheme();
const variantTheme = computed(() => theme.value[variant.value][type.value]);
const tag = computed(() => {
if (href.value) {
return "a";
}
if (to.value) {
return "router-link";
}
return "button";
});
const appTheme = useAppTheme();
const size = computed(() => theme.value.size[sizeName.value]);
return (_ctx, _push, _parent, _attrs) => {
const _cssVars = { style: {
"--9a468bfe": unref(size).fontSize,
"--09441655": unref(size).width,
"--e1cab870": unref(variantTheme).textColor,
"--645976e7": unref(variantTheme).backgroundColor,
"--cea95e96": unref(variantTheme).hover.backgroundColor,
"--369e4b1b": unref(variantTheme).pressed.backgroundColor,
"--c8f65826": unref(appTheme).primary.color
} };
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(tag)), mergeProps({
href: unref(href) ?? unref(to),
class: ["c-button", { disabled: unref(disabled), round: unref(round), circle: unref(circle) }],
to: unref(to),
onClick: handleClick
}, _attrs, _cssVars), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
} else {
return [
renderSlot(_ctx.$slots, "default", {}, void 0, true)
];
}
}),
_: 3
}), _parent);
};
}
});
/* unplugin-vue-components disabled */const cButton_vue_vue_type_style_index_0_scoped_147876cf_lang = '';
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-button/c-button.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-147876cf"]]);
export { _export_sfc as _, __unplugin_components_0 as a, appThemes as b, useAppTheme as c, defineThemes as d, darken as e, useStyleStore as u };

85
dist/server/chunks/chunk-6055f263.js vendored Normal file
View file

@ -0,0 +1,85 @@
import { NDivider, NFormItem } from 'naive-ui';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
function decodeSafeLinksURL(safeLinksUrl) {
if (!safeLinksUrl.match(/\.safelinks\.protection\.outlook\.com/)) {
throw new Error("Invalid SafeLinks URL provided");
}
return new URL(safeLinksUrl).searchParams.get("url");
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "safelink-decoder",
__ssrInlineRender: true,
setup(__props) {
const inputSafeLinkUrl = ref("");
const outputDecodedUrl = computed(() => {
try {
return decodeSafeLinksURL(inputSafeLinkUrl.value);
} catch (e) {
return e.toString();
}
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_n_divider = NDivider;
const _component_n_form_item = NFormItem;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(inputSafeLinkUrl),
"onUpdate:value": ($event) => isRef(inputSafeLinkUrl) ? inputSafeLinkUrl.value = $event : null,
"raw-text": "",
placeholder: "Your input Outlook SafeLink Url...",
autofocus: "",
label: "Your input Outlook SafeLink Url:"
}, null, _parent));
_push(ssrRenderComponent(_component_n_divider, null, null, _parent));
_push(ssrRenderComponent(_component_n_form_item, { label: "Output decoded URL:" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(TextareaCopyable, {
value: unref(outputDecodedUrl),
"word-wrap": true
}, null, _parent2, _scopeId));
} else {
return [
createVNode(TextareaCopyable, {
value: unref(outputDecodedUrl),
"word-wrap": true
}, null, 8, ["value"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/safelink-decoder/safelink-decoder.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

28
dist/server/chunks/chunk-65bb8b4f.js vendored Normal file
View file

@ -0,0 +1,28 @@
import { u as useValidation } from './chunk-35c3d701.js';
const macAddressValidationRules = [
{
message: "Invalid MAC address",
validator: (value) => value.trim().match(/^([0-9A-Fa-f]{2}[:-]){2,5}([0-9A-Fa-f]{2})$/)
}
];
function macAddressValidation(value) {
return useValidation({
source: value,
rules: macAddressValidationRules
});
}
const partialMacAddressValidationRules = [
{
message: "Invalid partial MAC address",
validator: (value) => value.trim().match(/^([0-9a-f]{2}[:\-. ]){0,5}([0-9a-f]{0,2})$/i)
}
];
function usePartialMacAddressValidation(value) {
return useValidation({
source: value,
rules: partialMacAddressValidationRules
});
}
export { macAddressValidationRules as a, macAddressValidation as m, usePartialMacAddressValidation as u };

520
dist/server/chunks/chunk-671791a3.js vendored Normal file
View file

@ -0,0 +1,520 @@
import { _ as _sfc_main$3 } from './chunk-aab02bfe.js';
import { NInputNumber, NIcon, NScrollbar, NDivider, NFormItem } from 'naive-ui';
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { _ as _sfc_main$2, a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, unref, withCtx, createVNode, createTextVNode, nextTick, useSSRContext, computed, openBlock, createBlock, Fragment, renderList, createCommentVNode, isRef } from 'vue';
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrRenderStyle } from 'vue/server-renderer';
import { Trash, Plus } from '@vicons/tabler';
import { useTemplateRefsList, useVModel, useStorage } from '@vueuse/core';
import _ from 'lodash';
import { u as useCopy } from './chunk-77c5cc16.js';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
function computeAverage({ data }) {
if (data.length === 0) {
return 0;
}
return _.sum(data) / data.length;
}
function computeVariance({ data }) {
const mean = computeAverage({ data });
const squaredDiffs = data.map((value) => (value - mean) ** 2);
return computeAverage({ data: squaredDiffs });
}
function arrayToMarkdownTable({ data, headerMap = {} }) {
if (!Array.isArray(data) || data.length === 0) {
return "";
}
const headers = Object.keys(data[0]);
const rows = data.map((obj) => Object.values(obj));
const headerRow = `| ${headers.map((header) => headerMap[header] ?? header).join(" | ")} |`;
const separatorRow = `| ${headers.map(() => "---").join(" | ")} |`;
const dataRows = rows.map((row) => `| ${row.join(" | ")} |`).join("\n");
return `${headerRow}
${separatorRow}
${dataRows}`;
}
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "dynamic-values",
__ssrInlineRender: true,
props: {
values: {}
},
emits: ["update:values"],
setup(__props, { emit }) {
const props = __props;
const refs = useTemplateRefsList();
const values = useVModel(props, "values", emit);
async function addValue() {
values.value.push(null);
await nextTick();
refs.value.at(-1)?.focus();
}
function onInputEnter(index) {
if (index === values.value.length - 1) {
addValue();
return;
}
refs.value.at(index + 1)?.focus();
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_tooltip = _sfc_main$2;
const _component_c_button = __unplugin_components_0;
const _component_n_icon = NIcon;
_push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
ssrRenderList(unref(values), (value, index) => {
_push(`<div mb-2 flex flex-nowrap gap-2>`);
_push(ssrRenderComponent(unref(NInputNumber), {
ref_for: true,
ref: unref(refs).set,
value: unref(values)[index],
"onUpdate:value": ($event) => unref(values)[index] = $event,
"show-button": false,
placeholder: "Set your measure...",
autofocus: "",
onKeydown: ($event) => onInputEnter(index)
}, null, _parent));
_push(ssrRenderComponent(_component_c_tooltip, { tooltip: "Delete this value" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_button, {
circle: "",
variant: "text",
onClick: ($event) => unref(values).splice(index, 1)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_icon, {
component: unref(Trash),
depth: "3",
size: "18"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_icon, {
component: unref(Trash),
depth: "3",
size: "18"
}, null, 8, ["component"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_button, {
circle: "",
variant: "text",
onClick: ($event) => unref(values).splice(index, 1)
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
component: unref(Trash),
depth: "3",
size: "18"
}, null, 8, ["component"])
]),
_: 2
}, 1032, ["onClick"])
];
}
}),
_: 2
}, _parent));
_push(`</div>`);
});
_push(`<!--]-->`);
_push(ssrRenderComponent(_component_c_button, { onClick: addValue }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_icon, {
component: unref(Plus),
depth: "3",
"mr-2": "",
size: "18"
}, null, _parent2, _scopeId));
_push2(` Add a measure `);
} else {
return [
createVNode(_component_n_icon, {
component: unref(Plus),
depth: "3",
"mr-2": "",
size: "18"
}, null, 8, ["component"]),
createTextVNode(" Add a measure ")
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/benchmark-builder/dynamic-values.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "benchmark-builder",
__ssrInlineRender: true,
setup(__props) {
const suites = useStorage("benchmark-builder:suites", [
{ title: "Suite 1", data: [5, 10] },
{ title: "Suite 2", data: [8, 12] }
]);
const unit = useStorage("benchmark-builder:unit", "");
const round = (v) => Math.round(v * 1e3) / 1e3;
const results = computed(() => {
return suites.value.map(({ data: dirtyData, title }) => {
const data = dirtyData.filter(_.isNumber);
return {
title,
size: data.length,
mean: computeAverage({ data }),
variance: computeVariance({ data })
};
}).sort((a, b) => a.mean - b.mean).map(({ mean, variance, size, title }, index, suites2) => {
const cleanUnit = unit.value.trim();
const bestMean = suites2[0].mean;
const deltaWithBestMean = mean - bestMean;
const ratioWithBestMean = bestMean === 0 ? "∞" : round(mean / bestMean);
const comparisonValues = index !== 0 && bestMean !== mean ? ` (+${round(deltaWithBestMean)}${cleanUnit} ; x${ratioWithBestMean})` : "";
return {
position: index + 1,
title,
mean: `${round(mean)}${cleanUnit}${comparisonValues}`,
variance: `${round(variance)}${cleanUnit}${cleanUnit ? "²" : ""}`,
size
};
});
});
const { copy } = useCopy({ createToast: false });
const header = {
position: "Position",
title: "Suite",
size: "Samples",
mean: "Mean",
variance: "Variance"
};
function copyAsMarkdown() {
copy(arrayToMarkdownTable({ data: results.value, headerMap: header }));
}
function copyAsBulletList() {
const bulletList = results.value.flatMap(({ title, ...sections }) => {
return [
` - ${title}`,
...Object.entries(sections).map(
([key, value]) => ` - ${header[key] ?? key}: ${value}`
)
];
}).join("\n");
copy(bulletList);
}
return (_ctx, _push, _parent, _attrs) => {
const _component_n_scrollbar = NScrollbar;
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_n_divider = NDivider;
const _component_n_form_item = NFormItem;
const _component_c_button = __unplugin_components_0;
const _component_n_icon = NIcon;
const _component_c_table = _sfc_main$3;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_n_scrollbar, {
style: { "flex": "1" },
"x-scrollable": ""
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div mb-5 flex flex-1 flex-nowrap justify-center gap-12px${_scopeId}><!--[-->`);
ssrRenderList(unref(suites), (suite, index) => {
_push2(`<div${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_card, { style: { "width": "294px" } }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_input_text, {
value: suite.title,
"onUpdate:value": ($event) => suite.title = $event,
"label-position": "left",
label: "Suite name",
placeholder: "Suite name...",
clearable: ""
}, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_divider, null, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, {
label: "Suite values",
"show-feedback": false
}, {
default: withCtx((_4, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_sfc_main$1, {
values: suite.data,
"onUpdate:values": ($event) => suite.data = $event
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_sfc_main$1, {
values: suite.data,
"onUpdate:values": ($event) => suite.data = $event
}, null, 8, ["values", "onUpdate:values"])
];
}
}),
_: 2
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_input_text, {
value: suite.title,
"onUpdate:value": ($event) => suite.title = $event,
"label-position": "left",
label: "Suite name",
placeholder: "Suite name...",
clearable: ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_divider),
createVNode(_component_n_form_item, {
label: "Suite values",
"show-feedback": false
}, {
default: withCtx(() => [
createVNode(_sfc_main$1, {
values: suite.data,
"onUpdate:values": ($event) => suite.data = $event
}, null, 8, ["values", "onUpdate:values"])
]),
_: 2
}, 1024)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`<div flex justify-center${_scopeId}>`);
if (unref(suites).length > 1) {
_push2(ssrRenderComponent(_component_c_button, {
variant: "text",
onClick: ($event) => unref(suites).splice(index, 1)
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_icon, {
component: unref(Trash),
depth: "3",
"mr-2": "",
size: "18"
}, null, _parent3, _scopeId2));
_push3(` Delete suite `);
} else {
return [
createVNode(_component_n_icon, {
component: unref(Trash),
depth: "3",
"mr-2": "",
size: "18"
}, null, 8, ["component"]),
createTextVNode(" Delete suite ")
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(ssrRenderComponent(_component_c_button, {
variant: "text",
onClick: ($event) => unref(suites).splice(index + 1, 0, { data: [0], title: `Suite ${unref(suites).length + 1}` })
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_icon, {
component: unref(Plus),
depth: "3",
"mr-2": "",
size: "18"
}, null, _parent3, _scopeId2));
_push3(` Add suite `);
} else {
return [
createVNode(_component_n_icon, {
component: unref(Plus),
depth: "3",
"mr-2": "",
size: "18"
}, null, 8, ["component"]),
createTextVNode(" Add suite ")
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div></div>`);
});
_push2(`<!--]--></div>`);
} else {
return [
createVNode("div", {
"mb-5": "",
flex: "",
"flex-1": "",
"flex-nowrap": "",
"justify-center": "",
"gap-12px": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(suites), (suite, index) => {
return openBlock(), createBlock("div", { key: index }, [
createVNode(_component_c_card, { style: { "width": "294px" } }, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: suite.title,
"onUpdate:value": ($event) => suite.title = $event,
"label-position": "left",
label: "Suite name",
placeholder: "Suite name...",
clearable: ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_divider),
createVNode(_component_n_form_item, {
label: "Suite values",
"show-feedback": false
}, {
default: withCtx(() => [
createVNode(_sfc_main$1, {
values: suite.data,
"onUpdate:values": ($event) => suite.data = $event
}, null, 8, ["values", "onUpdate:values"])
]),
_: 2
}, 1024)
]),
_: 2
}, 1024),
createVNode("div", {
flex: "",
"justify-center": ""
}, [
unref(suites).length > 1 ? (openBlock(), createBlock(_component_c_button, {
key: 0,
variant: "text",
onClick: ($event) => unref(suites).splice(index, 1)
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
component: unref(Trash),
depth: "3",
"mr-2": "",
size: "18"
}, null, 8, ["component"]),
createTextVNode(" Delete suite ")
]),
_: 2
}, 1032, ["onClick"])) : createCommentVNode("", true),
createVNode(_component_c_button, {
variant: "text",
onClick: ($event) => unref(suites).splice(index + 1, 0, { data: [0], title: `Suite ${unref(suites).length + 1}` })
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
component: unref(Plus),
depth: "3",
"mr-2": "",
size: "18"
}, null, 8, ["component"]),
createTextVNode(" Add suite ")
]),
_: 2
}, 1032, ["onClick"])
])
]);
}), 128))
])
];
}
}),
_: 1
}, _parent));
_push(`<div style="${ssrRenderStyle({ "flex": "0 0 100%" })}"><div style="${ssrRenderStyle({ "max-width": "600px", "margin": "0 auto" })}"><div mx-auto max-w-sm flex justify-center gap-3>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(unit),
"onUpdate:value": ($event) => isRef(unit) ? unit.value = $event : null,
placeholder: "Unit (eg: ms)",
label: "Unit",
"label-position": "left",
"mb-4": ""
}, null, _parent));
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => suites.value = [
{ title: "Suite 1", data: [] },
{ title: "Suite 2", data: [] }
]
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Reset suites `);
} else {
return [
createTextVNode(" Reset suites ")
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
_push(ssrRenderComponent(_component_c_table, {
data: unref(results),
headers: header
}, null, _parent));
_push(`<div mt-5 flex justify-center gap-3>`);
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => copyAsMarkdown()
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy as markdown table `);
} else {
return [
createTextVNode(" Copy as markdown table ")
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => copyAsBulletList()
}, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy as bullet list `);
} else {
return [
createTextVNode(" Copy as bullet list ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div></div><!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/benchmark-builder/benchmark-builder.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

209
dist/server/chunks/chunk-6ba26b76.js vendored Normal file
View file

@ -0,0 +1,209 @@
import { defineComponent, toRefs, ref, unref, mergeProps, useSSRContext, withCtx, createTextVNode, toDisplayString, isRef, renderSlot, createVNode } from 'vue';
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { d as defineThemes, b as appThemes, _ as _export_sfc, a as __unplugin_components_0 } from './chunk-6003391e.js';
import { useVModel, onClickOutside, useToggle } from '@vueuse/core';
import { u as useCopy } from './chunk-77c5cc16.js';
const { useTheme } = defineThemes({
dark: {
background: appThemes.dark.background
},
light: {
background: appThemes.light.background
}
});
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
...{
inheritAttrs: false
},
__name: "c-modal",
__ssrInlineRender: true,
props: {
open: { type: Boolean, default: false },
centered: { type: Boolean, default: true }
},
emits: ["update:open"],
setup(__props, { expose: __expose, emit }) {
const props = __props;
const isOpen = useVModel(props, "open", emit, { passive: true });
const { centered } = toRefs(props);
function close() {
isOpen.value = false;
}
function open() {
isOpen.value = true;
}
function toggle() {
isOpen.value = !isOpen.value;
}
__expose({
close,
open,
toggle,
isOpen
});
const theme = useTheme();
const modal = ref();
onClickOutside(modal, () => {
if (isOpen.value) {
close();
}
});
return (_ctx, _push, _parent, _attrs) => {
({ style: {
"--f6e4b4d2": unref(theme).background
} });
if (unref(isOpen)) {
_push(`<div${ssrRenderAttrs(mergeProps({
class: ["c-modal--overlay", { "items-center": unref(centered) }],
fixed: "",
"left-0": "",
"top-0": "",
"z-10": "",
"h-full": "",
"w-full": "",
flex: "",
"justify-center": "",
"px-2": ""
}, _attrs))} data-v-94793f53><div${ssrRenderAttrs(mergeProps({
ref_key: "modal",
ref: modal,
class: "c-modal--container"
}, _ctx.$attrs, {
"max-w-xl": "",
"w-full": "",
"flex-grow": "",
"rounded-md": "",
"pa-24px": ""
}))} data-v-94793f53>`);
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(`</div></div>`);
} else {
_push(`<!---->`);
}
};
}
});
/* unplugin-vue-components disabled */const cModal_vue_vue_type_style_index_0_scoped_94793f53_lang = '';
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-modal/c-modal.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-94793f53"]]);
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-modal-value",
__ssrInlineRender: true,
props: {
value: {},
label: { default: void 0 },
copyable: { type: Boolean, default: true }
},
setup(__props) {
const props = __props;
const { value, label } = toRefs(props);
const { copy, isJustCopied } = useCopy({ source: value });
const isModalOpen = ref(false);
const toggleModal = useToggle(isModalOpen);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_button = __unplugin_components_0;
const _component_c_modal = __unplugin_components_2;
_push(`<!--[-->`);
ssrRenderSlot(_ctx.$slots, "label", {
value: unref(value),
toggleModal: unref(toggleModal),
isModalOpen: unref(isModalOpen)
}, () => {
_push(ssrRenderComponent(_component_c_button, {
class: "text-left",
onClick: ($event) => isModalOpen.value = true
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(unref(label))}`);
} else {
return [
createTextVNode(toDisplayString(unref(label)), 1)
];
}
}),
_: 1
}, _parent));
}, _push, _parent);
_push(ssrRenderComponent(_component_c_modal, {
open: unref(isModalOpen),
"onUpdate:open": ($event) => isRef(isModalOpen) ? isModalOpen.value = $event : null
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
ssrRenderSlot(_ctx.$slots, "value", {
value: unref(value),
toggleModal: unref(toggleModal),
isModalOpen: unref(isModalOpen)
}, () => {
_push2(`${ssrInterpolate(unref(value))}`);
}, _push2, _parent2, _scopeId);
_push2(`<div mt-4 flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
class: "w-full",
onClick: unref(copy)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(isJustCopied) ? "Copied!" : "Copy")}`);
} else {
return [
createTextVNode(toDisplayString(unref(isJustCopied) ? "Copied!" : "Copy"), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
renderSlot(_ctx.$slots, "value", {
value: unref(value),
toggleModal: unref(toggleModal),
isModalOpen: unref(isModalOpen)
}, () => [
createTextVNode(toDisplayString(unref(value)), 1)
]),
createVNode("div", {
"mt-4": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
class: "w-full",
onClick: unref(copy)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(isJustCopied) ? "Copied!" : "Copy"), 1)
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 3
}, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-modal-value/c-modal-value.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { __unplugin_components_2 as _, _sfc_main as a };

244
dist/server/chunks/chunk-727cc0fb.js vendored Normal file
View file

@ -0,0 +1,244 @@
import { NScrollbar, NConfigProvider, NCode, NIcon } from 'naive-ui';
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { a as __unplugin_components_1, _ as _sfc_main$1 } from './chunk-8109fd17.js';
import { defineComponent, toRefs, ref, computed, mergeProps, withCtx, unref, createVNode, openBlock, createBlock, createCommentVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { Copy } from '@vicons/tabler';
import { useElementSize } from '@vueuse/core';
import hljs from 'highlight.js/lib/core';
import jsonHljs from 'highlight.js/lib/languages/json';
import sqlHljs from 'highlight.js/lib/languages/sql';
import xmlHljs from 'highlight.js/lib/languages/xml';
import yamlHljs from 'highlight.js/lib/languages/yaml';
import iniHljs from 'highlight.js/lib/languages/ini';
import { u as useCopy } from './chunk-77c5cc16.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "TextareaCopyable",
__ssrInlineRender: true,
props: {
value: {},
followHeightOf: { default: null },
language: { default: "txt" },
copyPlacement: { default: "top-right" },
copyMessage: { default: "Copy to clipboard" }
},
setup(__props) {
const props = __props;
hljs.registerLanguage("sql", sqlHljs);
hljs.registerLanguage("json", jsonHljs);
hljs.registerLanguage("html", xmlHljs);
hljs.registerLanguage("xml", xmlHljs);
hljs.registerLanguage("yaml", yamlHljs);
hljs.registerLanguage("toml", iniHljs);
const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(props);
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? "Copied!" : copyMessage.value);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_scrollbar = NScrollbar;
const _component_n_config_provider = NConfigProvider;
const _component_n_code = NCode;
const _component_c_tooltip = _sfc_main$1;
const _component_c_button = __unplugin_components_0;
const _component_n_icon = NIcon;
_push(`<div${ssrRenderAttrs(mergeProps({ style: { "overflow-x": "hidden", "width": "100%" } }, _attrs))} data-v-486e5d1f>`);
_push(ssrRenderComponent(_component_c_card, { relative: "" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_scrollbar, {
"x-scrollable": "",
trigger: "none",
style: unref(height) ? `min-height: ${unref(height) - 40 + 10}px` : ""
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_config_provider, { hljs: unref(hljs) }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_code, {
code: unref(value),
language: unref(language),
trim: false,
"data-test-id": "area-content"
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_code, {
code: unref(value),
language: unref(language),
trim: false,
"data-test-id": "area-content"
}, null, 8, ["code", "language"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_config_provider, { hljs: unref(hljs) }, {
default: withCtx(() => [
createVNode(_component_n_code, {
code: unref(value),
language: unref(language),
trim: false,
"data-test-id": "area-content"
}, null, 8, ["code", "language"])
]),
_: 1
}, 8, ["hljs"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<div absolute right-10px top-10px data-v-486e5d1f${_scopeId}>`);
if (unref(value)) {
_push2(ssrRenderComponent(_component_c_tooltip, {
tooltip: unref(tooltipText),
position: "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_button, {
circle: "",
"important:h-10": "",
"important:w-10": "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, 8, ["component"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_button, {
circle: "",
"important:h-10": "",
"important:w-10": "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, 8, ["component"])
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
} else {
return [
createVNode(_component_n_scrollbar, {
"x-scrollable": "",
trigger: "none",
style: unref(height) ? `min-height: ${unref(height) - 40 + 10}px` : ""
}, {
default: withCtx(() => [
createVNode(_component_n_config_provider, { hljs: unref(hljs) }, {
default: withCtx(() => [
createVNode(_component_n_code, {
code: unref(value),
language: unref(language),
trim: false,
"data-test-id": "area-content"
}, null, 8, ["code", "language"])
]),
_: 1
}, 8, ["hljs"])
]),
_: 1
}, 8, ["style"]),
createVNode("div", {
absolute: "",
"right-10px": "",
"top-10px": ""
}, [
unref(value) ? (openBlock(), createBlock(_component_c_tooltip, {
key: 0,
tooltip: unref(tooltipText),
position: "left"
}, {
default: withCtx(() => [
createVNode(_component_c_button, {
circle: "",
"important:h-10": "",
"important:w-10": "",
onClick: ($event) => unref(copy)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, 8, ["component"])
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}, 8, ["tooltip"])) : createCommentVNode("", true)
])
];
}
}),
_: 1
}, _parent));
if (unref(copyPlacement) === "outside") {
_push(`<div mt-4 flex justify-center data-v-486e5d1f>`);
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(unref(tooltipText))}`);
} else {
return [
createTextVNode(toDisplayString(unref(tooltipText)), 1)
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const TextareaCopyable_vue_vue_type_style_index_0_scoped_486e5d1f_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/TextareaCopyable.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const TextareaCopyable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-486e5d1f"]]);
export { TextareaCopyable as T };

46
dist/server/chunks/chunk-72fc6fca.js vendored Normal file
View file

@ -0,0 +1,46 @@
function textToBase64(str, { makeUrlSafe = false } = {}) {
const encoded = window.btoa(str);
return makeUrlSafe ? makeUriSafe(encoded) : encoded;
}
function base64ToText(str, { makeUrlSafe = false } = {}) {
if (!isValidBase64(str, { makeUrlSafe })) {
throw new Error("Incorrect base64 string");
}
let cleanStr = removePotentialDataAndMimePrefix(str);
if (makeUrlSafe) {
cleanStr = unURI(cleanStr);
}
try {
return window.atob(cleanStr);
} catch (_) {
throw new Error("Incorrect base64 string");
}
}
function removePotentialDataAndMimePrefix(str) {
return str.replace(/^data:.*?;base64,/, "");
}
function isValidBase64(str, { makeUrlSafe = false } = {}) {
let cleanStr = removePotentialDataAndMimePrefix(str);
if (makeUrlSafe) {
cleanStr = unURI(cleanStr);
}
try {
if (makeUrlSafe) {
return removePotentialPadding(window.btoa(window.atob(cleanStr))) === cleanStr;
}
return window.btoa(window.atob(cleanStr)) === cleanStr;
} catch (err) {
return false;
}
}
function makeUriSafe(encoded) {
return encoded.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
}
function unURI(encoded) {
return encoded.replace(/-/g, "+").replace(/_/g, "/").replace(/[^A-Za-z0-9+/]/g, "");
}
function removePotentialPadding(str) {
return str.replace(/=/g, "");
}
export { base64ToText as b, isValidBase64 as i, textToBase64 as t };

291
dist/server/chunks/chunk-7776bb8b.js vendored Normal file
View file

@ -0,0 +1,291 @@
import { _ as __unplugin_components_3$1 } from './chunk-28375bc9.js';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { ref, watchEffect, defineComponent, computed, withCtx, unref, isRef, createVNode, createTextVNode, toDisplayString, openBlock, createBlock, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { AES, TripleDES, Rabbit, RC4, enc } from 'crypto-js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
function computedCatch(getter, { defaultValue, defaultErrorMessage = "Unknown error" } = {}) {
const error = ref();
const value = ref();
watchEffect(() => {
try {
error.value = void 0;
value.value = getter();
} catch (err) {
error.value = err instanceof Error ? err.message : err?.toString() ?? defaultErrorMessage;
value.value = defaultValue;
}
});
return [value, error];
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "encryption",
__ssrInlineRender: true,
setup(__props) {
const algos = { AES, TripleDES, Rabbit, RC4 };
const cypherInput = ref("Lorem ipsum dolor sit amet");
const cypherAlgo = ref("AES");
const cypherSecret = ref("my secret key");
const cypherOutput = computed(() => algos[cypherAlgo.value].encrypt(cypherInput.value, cypherSecret.value).toString());
const decryptInput = ref("U2FsdGVkX1/EC3+6P5dbbkZ3e1kQ5o2yzuU0NHTjmrKnLBEwreV489Kr0DIB+uBs");
const decryptAlgo = ref("AES");
const decryptSecret = ref("my secret key");
const [decryptOutput, decryptError] = computedCatch(() => algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value).toString(enc.Utf8), {
defaultValue: "",
defaultErrorMessage: "Unable to decrypt your text"
});
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_c_select = __unplugin_components_0;
const _component_c_alert = __unplugin_components_3$1;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, { title: "Encrypt" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex gap-3${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(cypherInput),
"onUpdate:value": ($event) => isRef(cypherInput) ? cypherInput.value = $event : null,
label: "Your text:",
placeholder: "The string to cypher",
rows: "4",
multiline: "",
"raw-text": "",
monospace: "",
autosize: "",
"flex-1": ""
}, null, _parent2, _scopeId));
_push2(`<div flex flex-1 flex-col gap-2${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(cypherSecret),
"onUpdate:value": ($event) => isRef(cypherSecret) ? cypherSecret.value = $event : null,
label: "Your secret key:",
clearable: "",
"raw-text": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_select, {
value: unref(cypherAlgo),
"onUpdate:value": ($event) => isRef(cypherAlgo) ? cypherAlgo.value = $event : null,
label: "Encryption algorithm:",
options: Object.keys(algos).map((label) => ({ label, value: label }))
}, null, _parent2, _scopeId));
_push2(`</div></div>`);
_push2(ssrRenderComponent(_component_c_input_text, {
label: "Your text encrypted:",
value: unref(cypherOutput),
rows: "3",
placeholder: "Your string hash",
multiline: "",
monospace: "",
readonly: "",
autosize: "",
"mt-5": ""
}, null, _parent2, _scopeId));
} else {
return [
createVNode("div", {
flex: "",
"gap-3": ""
}, [
createVNode(_component_c_input_text, {
value: unref(cypherInput),
"onUpdate:value": ($event) => isRef(cypherInput) ? cypherInput.value = $event : null,
label: "Your text:",
placeholder: "The string to cypher",
rows: "4",
multiline: "",
"raw-text": "",
monospace: "",
autosize: "",
"flex-1": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode("div", {
flex: "",
"flex-1": "",
"flex-col": "",
"gap-2": ""
}, [
createVNode(_component_c_input_text, {
value: unref(cypherSecret),
"onUpdate:value": ($event) => isRef(cypherSecret) ? cypherSecret.value = $event : null,
label: "Your secret key:",
clearable: "",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_select, {
value: unref(cypherAlgo),
"onUpdate:value": ($event) => isRef(cypherAlgo) ? cypherAlgo.value = $event : null,
label: "Encryption algorithm:",
options: Object.keys(algos).map((label) => ({ label, value: label }))
}, null, 8, ["value", "onUpdate:value", "options"])
])
]),
createVNode(_component_c_input_text, {
label: "Your text encrypted:",
value: unref(cypherOutput),
rows: "3",
placeholder: "Your string hash",
multiline: "",
monospace: "",
readonly: "",
autosize: "",
"mt-5": ""
}, null, 8, ["value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, { title: "Decrypt" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex gap-3${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(decryptInput),
"onUpdate:value": ($event) => isRef(decryptInput) ? decryptInput.value = $event : null,
label: "Your encrypted text:",
placeholder: "The string to cypher",
rows: "4",
multiline: "",
"raw-text": "",
monospace: "",
autosize: "",
"flex-1": ""
}, null, _parent2, _scopeId));
_push2(`<div flex flex-1 flex-col gap-2${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(decryptSecret),
"onUpdate:value": ($event) => isRef(decryptSecret) ? decryptSecret.value = $event : null,
label: "Your secret key:",
clearable: "",
"raw-text": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_select, {
value: unref(decryptAlgo),
"onUpdate:value": ($event) => isRef(decryptAlgo) ? decryptAlgo.value = $event : null,
label: "Encryption algorithm:",
options: Object.keys(algos).map((label) => ({ label, value: label }))
}, null, _parent2, _scopeId));
_push2(`</div></div>`);
if (unref(decryptError)) {
_push2(ssrRenderComponent(_component_c_alert, {
type: "error",
"mt-12": "",
title: "Error while decrypting"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(decryptError))}`);
} else {
return [
createTextVNode(toDisplayString(unref(decryptError)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(ssrRenderComponent(_component_c_input_text, {
label: "Your decrypted text:",
value: unref(decryptOutput),
placeholder: "Your string hash",
rows: "3",
multiline: "",
monospace: "",
readonly: "",
autosize: "",
"mt-5": ""
}, null, _parent2, _scopeId));
}
} else {
return [
createVNode("div", {
flex: "",
"gap-3": ""
}, [
createVNode(_component_c_input_text, {
value: unref(decryptInput),
"onUpdate:value": ($event) => isRef(decryptInput) ? decryptInput.value = $event : null,
label: "Your encrypted text:",
placeholder: "The string to cypher",
rows: "4",
multiline: "",
"raw-text": "",
monospace: "",
autosize: "",
"flex-1": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode("div", {
flex: "",
"flex-1": "",
"flex-col": "",
"gap-2": ""
}, [
createVNode(_component_c_input_text, {
value: unref(decryptSecret),
"onUpdate:value": ($event) => isRef(decryptSecret) ? decryptSecret.value = $event : null,
label: "Your secret key:",
clearable: "",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_select, {
value: unref(decryptAlgo),
"onUpdate:value": ($event) => isRef(decryptAlgo) ? decryptAlgo.value = $event : null,
label: "Encryption algorithm:",
options: Object.keys(algos).map((label) => ({ label, value: label }))
}, null, 8, ["value", "onUpdate:value", "options"])
])
]),
unref(decryptError) ? (openBlock(), createBlock(_component_c_alert, {
key: 0,
type: "error",
"mt-12": "",
title: "Error while decrypting"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(decryptError)), 1)
]),
_: 1
})) : (openBlock(), createBlock(_component_c_input_text, {
key: 1,
label: "Your decrypted text:",
value: unref(decryptOutput),
placeholder: "Your string hash",
rows: "3",
multiline: "",
monospace: "",
readonly: "",
autosize: "",
"mt-5": ""
}, null, 8, ["value"]))
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/encryption/encryption.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

26
dist/server/chunks/chunk-77c5cc16.js vendored Normal file
View file

@ -0,0 +1,26 @@
import { useClipboard } from '@vueuse/core';
import { useMessage } from 'naive-ui';
function useCopy({ source, text = "Copied to the clipboard", createToast = true } = {}) {
const { copy, copied, ...rest } = useClipboard({
source,
legacy: true
});
const message = useMessage();
return {
...rest,
isJustCopied: copied,
async copy(content, { notificationMessage } = {}) {
if (source) {
await copy();
} else {
await copy(content);
}
if (createToast) {
message.success(notificationMessage ?? text);
}
}
};
}
export { useCopy as u };

497
dist/server/chunks/chunk-79281362.js vendored Normal file
View file

@ -0,0 +1,497 @@
import { NGrid, NGi, NFormItem, NInputGroup, NIcon } from 'naive-ui';
import { a as __unplugin_components_0$1 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent } from 'vue/server-renderer';
import { generateEntropy, entropyToMnemonic, englishWordList, chineseSimplifiedWordList, chineseTraditionalWordList, czechWordList, frenchWordList, italianWordList, japaneseWordList, koreanWordList, portugueseWordList, spanishWordList, mnemonicToEntropy } from '@it-tools/bip39';
import { Refresh, Copy } from '@vicons/tabler';
import { u as useCopy } from './chunk-77c5cc16.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { i as isNotThrowing } from './chunk-5697d061.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "bip39-generator",
__ssrInlineRender: true,
setup(__props) {
const languages = {
"English": englishWordList,
"Chinese simplified": chineseSimplifiedWordList,
"Chinese traditional": chineseTraditionalWordList,
"Czech": czechWordList,
"French": frenchWordList,
"Italian": italianWordList,
"Japanese": japaneseWordList,
"Korean": koreanWordList,
"Portuguese": portugueseWordList,
"Spanish": spanishWordList
};
const entropy = ref(generateEntropy());
const passphraseInput = ref("");
const language = ref("English");
const passphrase = computed({
get() {
return withDefaultOnError(() => entropyToMnemonic(entropy.value, languages[language.value]), passphraseInput.value);
},
set(value) {
passphraseInput.value = value;
entropy.value = withDefaultOnError(() => mnemonicToEntropy(value, languages[language.value]), "");
}
});
const entropyValidation = useValidation({
source: entropy,
rules: [
{
validator: (value) => value === "" || value.length <= 32 && value.length >= 16 && value.length % 4 === 0,
message: "Entropy length should be >= 16, <= 32 and be a multiple of 4"
},
{
validator: (value) => /^[a-fA-F0-9]*$/.test(value),
message: "Entropy should be an hexadecimal string"
}
]
});
const mnemonicValidation = useValidation({
source: passphrase,
rules: [
{
validator: (value) => isNotThrowing(() => mnemonicToEntropy(value, languages[language.value])),
message: "Invalid mnemonic"
}
]
});
function refreshEntropy() {
entropy.value = generateEntropy();
}
const { copy: copyEntropy } = useCopy({ source: entropy, text: "Entropy copied to the clipboard" });
const { copy: copyPassphrase } = useCopy({ source: passphrase, text: "Passphrase copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_n_grid = NGrid;
const _component_n_gi = NGi;
const _component_c_select = __unplugin_components_0;
const _component_n_form_item = NFormItem;
const _component_n_input_group = NInputGroup;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0$1;
const _component_n_icon = NIcon;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_n_grid, {
cols: "3",
"x-gap": "12"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_gi, { span: "1" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_select, {
value: unref(language),
"onUpdate:value": ($event) => isRef(language) ? language.value = $event : null,
searchable: "",
label: "Language:",
options: Object.keys(languages)
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_select, {
value: unref(language),
"onUpdate:value": ($event) => isRef(language) ? language.value = $event : null,
searchable: "",
label: "Language:",
options: Object.keys(languages)
}, null, 8, ["value", "onUpdate:value", "options"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_gi, { span: "2" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_form_item, {
label: "Entropy (seed):",
feedback: unref(entropyValidation).message,
"validation-status": unref(entropyValidation).status
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_input_group, null, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_c_input_text, {
value: unref(entropy),
"onUpdate:value": ($event) => isRef(entropy) ? entropy.value = $event : null,
placeholder: "Your string..."
}, null, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_c_button, {
onClick: ($event) => refreshEntropy()
}, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_n_icon, { size: "22" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(unref(Refresh), null, null, _parent7, _scopeId6));
} else {
return [
createVNode(unref(Refresh))
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Refresh))
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyEntropy)()
}, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_n_icon, { size: "22" }, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(unref(Copy), null, null, _parent7, _scopeId6));
} else {
return [
createVNode(unref(Copy))
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Copy))
]),
_: 1
})
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_c_input_text, {
value: unref(entropy),
"onUpdate:value": ($event) => isRef(entropy) ? entropy.value = $event : null,
placeholder: "Your string..."
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_button, {
onClick: ($event) => refreshEntropy()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Refresh))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_c_button, {
onClick: ($event) => unref(copyEntropy)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Copy))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_input_group, null, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(entropy),
"onUpdate:value": ($event) => isRef(entropy) ? entropy.value = $event : null,
placeholder: "Your string..."
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_button, {
onClick: ($event) => refreshEntropy()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Refresh))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_c_button, {
onClick: ($event) => unref(copyEntropy)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Copy))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_form_item, {
label: "Entropy (seed):",
feedback: unref(entropyValidation).message,
"validation-status": unref(entropyValidation).status
}, {
default: withCtx(() => [
createVNode(_component_n_input_group, null, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(entropy),
"onUpdate:value": ($event) => isRef(entropy) ? entropy.value = $event : null,
placeholder: "Your string..."
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_button, {
onClick: ($event) => refreshEntropy()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Refresh))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_c_button, {
onClick: ($event) => unref(copyEntropy)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Copy))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
]),
_: 1
}, 8, ["feedback", "validation-status"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_gi, { span: "1" }, {
default: withCtx(() => [
createVNode(_component_c_select, {
value: unref(language),
"onUpdate:value": ($event) => isRef(language) ? language.value = $event : null,
searchable: "",
label: "Language:",
options: Object.keys(languages)
}, null, 8, ["value", "onUpdate:value", "options"])
]),
_: 1
}),
createVNode(_component_n_gi, { span: "2" }, {
default: withCtx(() => [
createVNode(_component_n_form_item, {
label: "Entropy (seed):",
feedback: unref(entropyValidation).message,
"validation-status": unref(entropyValidation).status
}, {
default: withCtx(() => [
createVNode(_component_n_input_group, null, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(entropy),
"onUpdate:value": ($event) => isRef(entropy) ? entropy.value = $event : null,
placeholder: "Your string..."
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_button, {
onClick: ($event) => refreshEntropy()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Refresh))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_c_button, {
onClick: ($event) => unref(copyEntropy)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, { size: "22" }, {
default: withCtx(() => [
createVNode(unref(Copy))
]),
_: 1
})
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
]),
_: 1
}, 8, ["feedback", "validation-status"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_n_form_item, {
label: "Passphrase (mnemonic):",
feedback: unref(mnemonicValidation).message,
"validation-status": unref(mnemonicValidation).status
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_group, null, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_input_text, {
value: unref(passphrase),
"onUpdate:value": ($event) => isRef(passphrase) ? passphrase.value = $event : null,
placeholder: "Your mnemonic...",
"raw-text": ""
}, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copyPassphrase)()
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, 8, ["component"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_input_text, {
value: unref(passphrase),
"onUpdate:value": ($event) => isRef(passphrase) ? passphrase.value = $event : null,
placeholder: "Your mnemonic...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_button, {
onClick: ($event) => unref(copyPassphrase)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, 8, ["component"])
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_group, null, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(passphrase),
"onUpdate:value": ($event) => isRef(passphrase) ? passphrase.value = $event : null,
placeholder: "Your mnemonic...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_button, {
onClick: ($event) => unref(copyPassphrase)()
}, {
default: withCtx(() => [
createVNode(_component_n_icon, {
size: "22",
component: unref(Copy)
}, null, 8, ["component"])
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/bip39-generator/bip39-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

20
dist/server/chunks/chunk-7b2d32fe.js vendored Normal file
View file

@ -0,0 +1,20 @@
import _ from 'lodash';
function ipv4ToInt({ ip }) {
if (!isValidIpv4({ ip })) {
return 0;
}
return ip.trim().split(".").reduce((acc, part, index) => acc + Number(part) * 256 ** (3 - index), 0);
}
function ipv4ToIpv6({ ip, prefix = "0000:0000:0000:0000:0000:ffff:" }) {
if (!isValidIpv4({ ip })) {
return "";
}
return prefix + _.chain(ip).trim().split(".").map((part) => Number.parseInt(part).toString(16).padStart(2, "0")).chunk(2).map((blocks) => blocks.join("")).join(":").value();
}
function isValidIpv4({ ip }) {
const cleanIp = ip.trim();
return /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/.test(cleanIp);
}
export { isValidIpv4 as a, ipv4ToIpv6 as b, ipv4ToInt as i };

326
dist/server/chunks/chunk-7ba145c3.js vendored Normal file
View file

@ -0,0 +1,326 @@
import { a as _sfc_main$4 } from './chunk-6ba26b76.js';
import { _ as _sfc_main$3 } from './chunk-ab9bd3df.js';
import { _ as _sfc_main$2 } from './chunk-aab02bfe.js';
import { defineComponent, toRefs, computed, mergeProps, unref, withCtx, createVNode, toDisplayString, useSSRContext, ref, createTextVNode } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderStyle, ssrRenderList } from 'vue/server-renderer';
import { _ as __unplugin_components_3 } from './chunk-28375bc9.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as _sfc_main$5 } from './chunk-83cdd9a0.js';
import verifyPDF from 'pdf-signature-reader';
import { f as formatBytes } from './chunk-3e99c6bf.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-77c5cc16.js';
import 'naive-ui';
import './chunk-aff50618.js';
import './chunk-95ec8cf7.js';
import 'lodash';
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "pdf-signature-details",
__ssrInlineRender: true,
props: {
signature: {}
},
setup(__props) {
const props = __props;
const { signature } = toRefs(props);
const tableHeaders = {
validityPeriod: "Validity period",
issuedBy: "Issued by",
issuedTo: "Issued to",
pemCertificate: "PEM certificate"
};
const certs = computed(
() => signature.value.meta.certs.map((certificate, index) => ({
...certificate,
validityPeriod: {
notBefore: new Date(certificate.validityPeriod.notBefore).toLocaleString(),
notAfter: new Date(certificate.validityPeriod.notAfter).toLocaleString()
},
certificateName: `Certificate ${index + 1}`
}))
);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_table = _sfc_main$2;
const _component_c_key_value_list = _sfc_main$3;
const _component_c_modal_value = _sfc_main$4;
_push(`<div${ssrRenderAttrs(mergeProps({
flex: "",
"flex-col": "",
"gap-2": ""
}, _attrs))}>`);
_push(ssrRenderComponent(_component_c_table, {
data: unref(certs),
headers: tableHeaders
}, {
validityPeriod: withCtx(({ value }, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_key_value_list, {
items: [{
label: "Not before",
value: value.notBefore
}, {
label: "Not after",
value: value.notAfter
}]
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_key_value_list, {
items: [{
label: "Not before",
value: value.notBefore
}, {
label: "Not after",
value: value.notAfter
}]
}, null, 8, ["items"])
];
}
}),
issuedBy: withCtx(({ value }, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_key_value_list, {
items: [{
label: "Common name",
value: value.commonName
}, {
label: "Organization name",
value: value.organizationName
}, {
label: "Country name",
value: value.countryName
}, {
label: "Locality name",
value: value.localityName
}, {
label: "Organizational unit name",
value: value.organizationalUnitName
}, {
label: "State or province name",
value: value.stateOrProvinceName
}]
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_key_value_list, {
items: [{
label: "Common name",
value: value.commonName
}, {
label: "Organization name",
value: value.organizationName
}, {
label: "Country name",
value: value.countryName
}, {
label: "Locality name",
value: value.localityName
}, {
label: "Organizational unit name",
value: value.organizationalUnitName
}, {
label: "State or province name",
value: value.stateOrProvinceName
}]
}, null, 8, ["items"])
];
}
}),
issuedTo: withCtx(({ value }, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_key_value_list, {
items: [{
label: "Common name",
value: value.commonName
}, {
label: "Organization name",
value: value.organizationName
}, {
label: "Country name",
value: value.countryName
}, {
label: "Locality name",
value: value.localityName
}, {
label: "Organizational unit name",
value: value.organizationalUnitName
}, {
label: "State or province name",
value: value.stateOrProvinceName
}]
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_key_value_list, {
items: [{
label: "Common name",
value: value.commonName
}, {
label: "Organization name",
value: value.organizationName
}, {
label: "Country name",
value: value.countryName
}, {
label: "Locality name",
value: value.localityName
}, {
label: "Organizational unit name",
value: value.organizationalUnitName
}, {
label: "State or province name",
value: value.stateOrProvinceName
}]
}, null, 8, ["items"])
];
}
}),
pemCertificate: withCtx(({ value }, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_modal_value, {
value,
label: "View PEM cert"
}, {
value: withCtx((_, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div break-all text-xs${_scopeId2}>${ssrInterpolate(value)}</div>`);
} else {
return [
createVNode("div", {
"break-all": "",
"text-xs": ""
}, toDisplayString(value), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_modal_value, {
value,
label: "View PEM cert"
}, {
value: withCtx(() => [
createVNode("div", {
"break-all": "",
"text-xs": ""
}, toDisplayString(value), 1)
]),
_: 2
}, 1032, ["value"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/pdf-signature-checker/components/pdf-signature-details.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "pdf-signature-checker",
__ssrInlineRender: true,
setup(__props) {
const signatures = ref([]);
const status = ref("idle");
const file = ref(null);
async function onVerifyClicked(uploadedFile) {
file.value = uploadedFile;
const fileBuffer = await uploadedFile.arrayBuffer();
status.value = "loading";
try {
const { signatures: parsedSignatures } = verifyPDF(fileBuffer);
signatures.value = parsedSignatures;
status.value = "parsed";
} catch (e) {
signatures.value = [];
status.value = "error";
}
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_file_upload = _sfc_main$5;
const _component_c_card = __unplugin_components_1;
const _component_c_alert = __unplugin_components_3;
const _component_pdf_signature_details = _sfc_main$1;
_push(`<!--[--><div style="${ssrRenderStyle({ "flex": "0 0 100%" })}"><div mx-auto max-w-600px>`);
_push(ssrRenderComponent(_component_c_file_upload, {
title: "Drag and drop a PDF file here, or click to select a file",
accept: ".pdf",
onFileUpload: onVerifyClicked
}, null, _parent));
if (unref(file)) {
_push(ssrRenderComponent(_component_c_card, {
"mt-4": "",
flex: "",
"gap-2": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div font-bold${_scopeId}>${ssrInterpolate(unref(file).name)}</div><div${_scopeId}>${ssrInterpolate(unref(formatBytes)(unref(file).size))}</div>`);
} else {
return [
createVNode("div", { "font-bold": "" }, toDisplayString(unref(file).name), 1),
createVNode("div", null, toDisplayString(unref(formatBytes)(unref(file).size)), 1)
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
if (unref(status) === "error") {
_push(`<div>`);
_push(ssrRenderComponent(_component_c_alert, { "mt-4": "" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` No signatures found in the provided file. `);
} else {
return [
createTextVNode(" No signatures found in the provided file. ")
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(`</div></div>`);
if (unref(status) === "parsed" && unref(signatures).length) {
_push(`<div style="${ssrRenderStyle({ "flex": "0 0 100%" })}" mt-5 flex flex-col gap-4><!--[-->`);
ssrRenderList(unref(signatures), (signature, index) => {
_push(`<div><div mb-2 font-bold> Signature ${ssrInterpolate(index + 1)} certificates : </div>`);
_push(ssrRenderComponent(_component_pdf_signature_details, { signature }, null, _parent));
_push(`</div>`);
});
_push(`<!--]--></div>`);
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/pdf-signature-checker/pdf-signature-checker.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

214
dist/server/chunks/chunk-7cc99fb2.js vendored Normal file
View file

@ -0,0 +1,214 @@
import { NDivider, NInputGroup, NInputGroupLabel } from 'naive-ui';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, withCtx, unref, isRef, createTextVNode, toDisplayString, createVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrRenderStyle, ssrInterpolate } from 'vue/server-renderer';
import { MD5, SHA1, SHA256, SHA224, SHA512, SHA384, SHA3, RIPEMD160, enc } from 'crypto-js';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { c as convertHexToBin } from './chunk-915ca1f7.js';
import { u as useQueryParam } from './chunk-bc09e76f.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-95ec8cf7.js';
import './chunk-77c5cc16.js';
import '@vueuse/router';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "hash-text",
__ssrInlineRender: true,
setup(__props) {
const algos = {
MD5,
SHA1,
SHA256,
SHA224,
SHA512,
SHA384,
SHA3,
RIPEMD160
};
const algoNames = Object.keys(algos);
const encoding = useQueryParam({ defaultValue: "Hex", name: "encoding" });
const clearText = ref("");
function formatWithEncoding(words, encoding2) {
if (encoding2 === "Bin") {
return convertHexToBin(words.toString(enc.Hex));
}
return words.toString(enc[encoding2]);
}
const hashText = (algo, value) => formatWithEncoding(algos[algo](value), encoding.value);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_n_divider = NDivider;
const _component_c_select = __unplugin_components_0;
const _component_n_input_group = NInputGroup;
const _component_n_input_group_label = NInputGroupLabel;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(clearText),
"onUpdate:value": ($event) => isRef(clearText) ? clearText.value = $event : null,
multiline: "",
"raw-text": "",
placeholder: "Your string to hash...",
rows: "3",
autosize: "",
autofocus: "",
label: "Your text to hash:"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_divider, null, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_select, {
value: unref(encoding),
"onUpdate:value": ($event) => isRef(encoding) ? encoding.value = $event : null,
"mb-4": "",
label: "Digest encoding",
options: [
{
label: "Binary (base 2)",
value: "Bin"
},
{
label: "Hexadecimal (base 16)",
value: "Hex"
},
{
label: "Base64 (base 64)",
value: "Base64"
},
{
label: "Base64url (base 64 with url safe chars)",
value: "Base64url"
}
]
}, null, _parent2, _scopeId));
_push2(`<!--[-->`);
ssrRenderList(unref(algoNames), (algo) => {
_push2(`<div style="${ssrRenderStyle({ "margin": "5px 0" })}"${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_input_group, null, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_input_group_label, { style: { "flex": "0 0 120px" } }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(algo)}`);
} else {
return [
createTextVNode(toDisplayString(algo), 1)
];
}
}),
_: 2
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_sfc_main$1, {
value: hashText(algo, unref(clearText)),
readonly: ""
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_input_group_label, { style: { "flex": "0 0 120px" } }, {
default: withCtx(() => [
createTextVNode(toDisplayString(algo), 1)
]),
_: 2
}, 1024),
createVNode(_sfc_main$1, {
value: hashText(algo, unref(clearText)),
readonly: ""
}, null, 8, ["value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div>`);
});
_push2(`<!--]-->`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(clearText),
"onUpdate:value": ($event) => isRef(clearText) ? clearText.value = $event : null,
multiline: "",
"raw-text": "",
placeholder: "Your string to hash...",
rows: "3",
autosize: "",
autofocus: "",
label: "Your text to hash:"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_divider),
createVNode(_component_c_select, {
value: unref(encoding),
"onUpdate:value": ($event) => isRef(encoding) ? encoding.value = $event : null,
"mb-4": "",
label: "Digest encoding",
options: [
{
label: "Binary (base 2)",
value: "Bin"
},
{
label: "Hexadecimal (base 16)",
value: "Hex"
},
{
label: "Base64 (base 64)",
value: "Base64"
},
{
label: "Base64url (base 64 with url safe chars)",
value: "Base64url"
}
]
}, null, 8, ["value", "onUpdate:value", "options"]),
(openBlock(true), createBlock(Fragment, null, renderList(unref(algoNames), (algo) => {
return openBlock(), createBlock("div", {
key: algo,
style: { "margin": "5px 0" }
}, [
createVNode(_component_n_input_group, null, {
default: withCtx(() => [
createVNode(_component_n_input_group_label, { style: { "flex": "0 0 120px" } }, {
default: withCtx(() => [
createTextVNode(toDisplayString(algo), 1)
]),
_: 2
}, 1024),
createVNode(_sfc_main$1, {
value: hashText(algo, unref(clearText)),
readonly: ""
}, null, 8, ["value"])
]),
_: 2
}, 1024)
]);
}), 128))
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/hash-text/hash-text.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

146
dist/server/chunks/chunk-7f5f544b.js vendored Normal file
View file

@ -0,0 +1,146 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, mergeProps, unref, isRef, createVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase } from 'change-case';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-95ec8cf7.js';
import './chunk-77c5cc16.js';
import 'naive-ui';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "case-converter",
__ssrInlineRender: true,
setup(__props) {
const baseConfig = {
stripRegexp: /[^A-Za-zÀ-ÖØ-öø-ÿ]+/gi
};
const input = ref("lorem ipsum dolor sit amet");
const formats = computed(() => [
{
label: "Lowercase:",
value: input.value.toLocaleLowerCase()
},
{
label: "Uppercase:",
value: input.value.toLocaleUpperCase()
},
{
label: "Camelcase:",
value: camelCase(input.value, baseConfig)
},
{
label: "Capitalcase:",
value: capitalCase(input.value, baseConfig)
},
{
label: "Constantcase:",
value: constantCase(input.value, baseConfig)
},
{
label: "Dotcase:",
value: dotCase(input.value, baseConfig)
},
{
label: "Headercase:",
value: headerCase(input.value, baseConfig)
},
{
label: "Nocase:",
value: noCase(input.value, baseConfig)
},
{
label: "Paramcase:",
value: paramCase(input.value, baseConfig)
},
{
label: "Pascalcase:",
value: pascalCase(input.value, baseConfig)
},
{
label: "Pathcase:",
value: pathCase(input.value, baseConfig)
},
{
label: "Sentencecase:",
value: sentenceCase(input.value, baseConfig)
},
{
label: "Snakecase:",
value: snakeCase(input.value, baseConfig)
},
{
label: "Mockingcase:",
value: input.value.split("").map((char, index) => index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()).join("")
}
]);
const inputLabelAlignmentConfig = {
labelPosition: "left",
labelWidth: "120px",
labelAlign: "right"
};
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, mergeProps({
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
label: "Your string:",
placeholder: "Your string...",
"raw-text": ""
}, inputLabelAlignmentConfig), null, _parent2, _scopeId));
_push2(`<div my-16px divider${_scopeId}></div><!--[-->`);
ssrRenderList(unref(formats), (format) => {
_push2(ssrRenderComponent(_sfc_main$1, mergeProps({
key: format.label,
value: format.value,
label: format.label
}, inputLabelAlignmentConfig, { "mb-1": "" }), null, _parent2, _scopeId));
});
_push2(`<!--]-->`);
} else {
return [
createVNode(_component_c_input_text, mergeProps({
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
label: "Your string:",
placeholder: "Your string...",
"raw-text": ""
}, inputLabelAlignmentConfig), null, 16, ["value", "onUpdate:value"]),
createVNode("div", {
"my-16px": "",
divider: ""
}),
(openBlock(true), createBlock(Fragment, null, renderList(unref(formats), (format) => {
return openBlock(), createBlock(_sfc_main$1, mergeProps({
key: format.label,
value: format.value,
label: format.label
}, inputLabelAlignmentConfig, { "mb-1": "" }), null, 16, ["value", "label"]);
}), 128))
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/case-converter/case-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

105
dist/server/chunks/chunk-8109fd17.js vendored Normal file
View file

@ -0,0 +1,105 @@
import { defineComponent, toRefs, unref, mergeProps, useSSRContext, ref } from 'vue';
import { ssrRenderAttrs, ssrInterpolate, ssrRenderSlot, ssrRenderClass } from 'vue/server-renderer';
import { d as defineThemes, _ as _export_sfc } from './chunk-6003391e.js';
import { useElementHover } from '@vueuse/core';
const { useTheme } = defineThemes({
dark: {
backgroundColor: "#232323",
borderColor: "#282828"
},
light: {
backgroundColor: "#ffffff",
borderColor: "#efeff5"
}
});
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "c-card",
__ssrInlineRender: true,
props: {
title: {}
},
setup(__props) {
const props = __props;
const { title } = toRefs(props);
const theme = useTheme();
return (_ctx, _push, _parent, _attrs) => {
const _cssVars = { style: {
"--51386d66": unref(theme).backgroundColor,
"--1d9c24b0": unref(theme).borderColor
} };
_push(`<div${ssrRenderAttrs(mergeProps({ class: "c-card" }, _attrs, _cssVars))} data-v-236d2dc6>`);
if (unref(title)) {
_push(`<div class="c-card-title" data-v-236d2dc6>${ssrInterpolate(unref(title))}</div>`);
} else {
_push(`<!---->`);
}
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const cCard_vue_vue_type_style_index_0_scoped_236d2dc6_lang = '';
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-card/c-card.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const __unplugin_components_1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-236d2dc6"]]);
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-tooltip",
__ssrInlineRender: true,
props: {
tooltip: { default: void 0 },
position: { default: "top" }
},
setup(__props) {
const props = __props;
const { tooltip, position } = toRefs(props);
const targetRef = ref();
const isTargetHovered = useElementHover(targetRef);
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({
relative: "",
"inline-block": ""
}, _attrs))}><div>`);
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(`</div>`);
if (unref(tooltip) || _ctx.$slots.tooltip) {
_push(`<div class="${ssrRenderClass([{
"op-0 scale-0": unref(isTargetHovered) === false,
"op-100 scale-100": unref(isTargetHovered),
"bottom-100% left-50% -translate-x-1/2 mb-5px": unref(position) === "top",
"top-100% left-50% -translate-x-1/2 mt-5px": unref(position) === "bottom",
"right-100% top-50% -translate-y-1/2 mr-5px": unref(position) === "left",
"left-100% top-50% -translate-y-1/2 ml-5px": unref(position) === "right"
}, "absolute z-10 whitespace-nowrap rounded bg-black px-12px py-6px text-sm text-white shadow-lg transition transition transition-duration-0.2s"])}">`);
if (unref(isTargetHovered)) {
ssrRenderSlot(_ctx.$slots, "tooltip", {}, () => {
_push(`${ssrInterpolate(unref(tooltip))}`);
}, _push, _parent);
} else {
_push(`<!---->`);
}
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-tooltip/c-tooltip.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _, __unplugin_components_1 as a };

54
dist/server/chunks/chunk-83cdd9a0.js vendored Normal file
View file

@ -0,0 +1,54 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { defineComponent, toRefs, ref, mergeProps, unref, withCtx, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderSlot, ssrInterpolate, ssrRenderComponent } from 'vue/server-renderer';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-file-upload",
__ssrInlineRender: true,
props: {
multiple: { type: Boolean, default: false },
accept: { default: void 0 },
title: { default: "Drag and drop files here, or click to select files" }
},
emits: ["filesUpload", "fileUpload"],
setup(__props, { emit }) {
const props = __props;
const { multiple } = toRefs(props);
const isOverDropZone = ref(false);
ref(null);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(mergeProps({
class: ["flex flex-col cursor-pointer items-center justify-center border-2px border-gray-300 border-opacity-50 rounded-lg border-dashed p-8 transition-colors", {
"border-primary border-opacity-100": unref(isOverDropZone)
}]
}, _attrs))}><input type="file" class="hidden"${ssrIncludeBooleanAttr(unref(multiple)) ? " multiple" : ""}${ssrRenderAttr("accept", _ctx.accept)}>`);
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
_push(`<span op-70>${ssrInterpolate(_ctx.title)}</span><div my-4 w-full flex items-center justify-center op-70><div class="h-1px max-w-100px flex-1 bg-gray-300 op-50"></div><div class="mx-2 text-gray-400"> or </div><div class="h-1px max-w-100px flex-1 bg-gray-300 op-50"></div></div>`);
_push(ssrRenderComponent(_component_c_button, null, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Browse files `);
} else {
return [
createTextVNode(" Browse files ")
];
}
}),
_: 1
}, _parent));
}, _push, _parent);
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-file-upload/c-file-upload.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

247
dist/server/chunks/chunk-841da9fe.js vendored Normal file
View file

@ -0,0 +1,247 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { NFormItem, NInputNumber } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
import { u as useValidation } from './chunk-35c3d701.js';
import './chunk-11f44f81.js';
import '@vueuse/core';
import 'pinia';
import 'lodash';
const MIN_ARABIC_TO_ROMAN = 1;
const MAX_ARABIC_TO_ROMAN = 3999;
function arabicToRoman(num) {
if (num < MIN_ARABIC_TO_ROMAN || num > MAX_ARABIC_TO_ROMAN) {
return "";
}
const lookup = {
M: 1e3,
CM: 900,
D: 500,
CD: 400,
C: 100,
XC: 90,
L: 50,
XL: 40,
X: 10,
IX: 9,
V: 5,
IV: 4,
I: 1
};
let roman = "";
for (const i in lookup) {
while (num >= lookup[i]) {
roman += i;
num -= lookup[i];
}
}
return roman;
}
const ROMAN_NUMBER_REGEX = /^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/;
function isValidRomanNumber(romanNumber) {
return ROMAN_NUMBER_REGEX.test(romanNumber);
}
function romanToArabic(s) {
if (!isValidRomanNumber(s)) {
return null;
}
const map = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1e3 };
return [...s].reduce((r, c, i, s2) => map[s2[i + 1]] > map[c] ? r - map[c] : r + map[c], 0);
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "roman-numeral-converter",
__ssrInlineRender: true,
setup(__props) {
const inputNumeral = ref(42);
const outputRoman = computed(() => arabicToRoman(inputNumeral.value));
const { attrs: validationNumeral } = useValidation({
source: inputNumeral,
rules: [
{
validator: (value) => value >= MIN_ARABIC_TO_ROMAN && value <= MAX_ARABIC_TO_ROMAN,
message: `We can only convert numbers between ${MIN_ARABIC_TO_ROMAN.toLocaleString()} and ${MAX_ARABIC_TO_ROMAN.toLocaleString()}`
}
]
});
const inputRoman = ref("XLII");
const outputNumeral = computed(() => romanToArabic(inputRoman.value));
const validationRoman = useValidation({
source: inputRoman,
rules: [
{
validator: (value) => isValidRomanNumber(value),
message: "The input you entered is not a valid roman number"
}
]
});
const { copy: copyRoman } = useCopy({ source: outputRoman, text: "Roman number copied to the clipboard" });
const { copy: copyArabic } = useCopy({ source: () => String(outputNumeral), text: "Arabic number copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_form_item = NFormItem;
const _component_n_input_number = NInputNumber;
const _component_c_button = __unplugin_components_0;
const _component_c_input_text = __unplugin_components_3;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-b1e0d482>`);
_push(ssrRenderComponent(_component_c_card, { title: "Arabic to roman" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex items-center justify-between data-v-b1e0d482${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_form_item, unref(validationNumeral), {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_input_number, {
value: unref(inputNumeral),
"onUpdate:value": ($event) => isRef(inputNumeral) ? inputNumeral.value = $event : null,
min: 1,
style: { "width": "200px" },
"show-button": false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(inputNumeral),
"onUpdate:value": ($event) => isRef(inputNumeral) ? inputNumeral.value = $event : null,
min: 1,
style: { "width": "200px" },
"show-button": false
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<div class="result" data-v-b1e0d482${_scopeId}>${ssrInterpolate(unref(outputRoman))}</div>`);
_push2(ssrRenderComponent(_component_c_button, {
autofocus: "",
disabled: unref(validationNumeral).validationStatus === "error",
onClick: ($event) => unref(copyRoman)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode("div", {
flex: "",
"items-center": "",
"justify-between": ""
}, [
createVNode(_component_n_form_item, unref(validationNumeral), {
default: withCtx(() => [
createVNode(_component_n_input_number, {
value: unref(inputNumeral),
"onUpdate:value": ($event) => isRef(inputNumeral) ? inputNumeral.value = $event : null,
min: 1,
style: { "width": "200px" },
"show-button": false
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 16),
createVNode("div", { class: "result" }, toDisplayString(unref(outputRoman)), 1),
createVNode(_component_c_button, {
autofocus: "",
disabled: unref(validationNumeral).validationStatus === "error",
onClick: ($event) => unref(copyRoman)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["disabled", "onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, {
title: "Roman to arabic",
"mt-5": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex items-center justify-between data-v-b1e0d482${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(inputRoman),
"onUpdate:value": ($event) => isRef(inputRoman) ? inputRoman.value = $event : null,
style: { "width": "200px" },
validation: unref(validationRoman)
}, null, _parent2, _scopeId));
_push2(`<div class="result" data-v-b1e0d482${_scopeId}>${ssrInterpolate(unref(outputNumeral))}</div>`);
_push2(ssrRenderComponent(_component_c_button, {
disabled: !unref(validationRoman).isValid,
onClick: ($event) => unref(copyArabic)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy `);
} else {
return [
createTextVNode(" Copy ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode("div", {
flex: "",
"items-center": "",
"justify-between": ""
}, [
createVNode(_component_c_input_text, {
value: unref(inputRoman),
"onUpdate:value": ($event) => isRef(inputRoman) ? inputRoman.value = $event : null,
style: { "width": "200px" },
validation: unref(validationRoman)
}, null, 8, ["value", "onUpdate:value", "validation"]),
createVNode("div", { class: "result" }, toDisplayString(unref(outputNumeral)), 1),
createVNode(_component_c_button, {
disabled: !unref(validationRoman).isValid,
onClick: ($event) => unref(copyArabic)()
}, {
default: withCtx(() => [
createTextVNode(" Copy ")
]),
_: 1
}, 8, ["disabled", "onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const romanNumeralConverter_vue_vue_type_style_index_0_scoped_b1e0d482_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/roman-numeral-converter/roman-numeral-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const romanNumeralConverter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b1e0d482"]]);
export { romanNumeralConverter as default };

333
dist/server/chunks/chunk-89a4876c.js vendored Normal file
View file

@ -0,0 +1,333 @@
import { openBlock, createElementBlock, createElementVNode, defineComponent, toRefs, computed, ref, shallowRef, nextTick, watch, unref, mergeProps, withCtx, createVNode, renderSlot, withDirectives, createBlock, isRef, vModelText, toDisplayString, Transition, Fragment, renderList, vShow, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderClass, ssrRenderSlot, ssrRenderAttr, ssrInterpolate, ssrRenderStyle, ssrRenderList } from 'vue/server-renderer';
import { d as defineThemes, b as appThemes, c as useAppTheme, _ as _export_sfc } from './chunk-6003391e.js';
import { _ as _sfc_main$1 } from './chunk-bb5bb4f6.js';
import { u as useFuzzySearch } from './chunk-2ce6ed5e.js';
import { useMagicKeys, useVModel, whenever, onClickOutside } from '@vueuse/core';
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6l1.41-1.42Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_0$1 = { name: 'mdi-chevron-down', render };
/* vite-plugin-components disabled */
const sizes = {
small: {
height: "28px",
fontSize: "12px"
},
medium: {
height: "34px",
fontSize: "14px"
},
large: {
height: "40px",
fontSize: "16px"
}
};
const { useTheme } = defineThemes({
dark: {
sizes,
backgroundColor: "#333333",
borderColor: "#333333",
dropdownShadow: "rgba(0, 0, 0, 0.2) 0px 8px 24px",
option: {
hover: {
backgroundColor: "#444444"
},
active: {
textColor: appThemes.dark.primary.color
}
},
focus: {
backgroundColor: "#1ea54c1a"
}
},
light: {
sizes,
backgroundColor: "#ffffff",
borderColor: "#e0e0e69e",
dropdownShadow: "rgba(149, 157, 165, 0.2) 0px 8px 24px",
option: {
hover: {
backgroundColor: "#eee"
},
active: {
textColor: appThemes.light.primary.color
}
},
focus: {
backgroundColor: "#ffffff"
}
}
});
function clamp({ value, min = 0, max = 100 }) {
return Math.min(Math.max(value, min), max);
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-select",
__ssrInlineRender: true,
props: {
options: { default: () => [] },
value: { default: void 0 },
placeholder: { default: void 0 },
size: { default: "medium" },
searchable: { type: Boolean, default: false },
label: {},
labelFor: {},
labelPosition: {},
labelWidth: {},
labelAlign: {}
},
emits: ["update:value"],
setup(__props, { emit: emits }) {
const props = __props;
const { options: rawOptions, placeholder, size: sizeName, searchable } = toRefs(props);
const options = computed(() => {
return rawOptions.value.map((option) => {
if (typeof option === "string") {
return { label: option, value: option };
}
return option;
});
});
const keys = useMagicKeys();
const value = useVModel(props, "value", emits);
const theme = useTheme();
const appTheme = useAppTheme();
const isOpen = ref(false);
const selectedOption = shallowRef(options.value.find((option) => option.value === value.value));
const focusIndex = ref(0);
const elementRef = ref(null);
const size = computed(() => theme.value.sizes[sizeName.value]);
const searchQuery = ref("");
const searchInputRef = ref();
whenever(() => !isOpen.value, () => {
focusIndex.value = 0;
searchQuery.value = "";
});
whenever(() => isOpen.value, () => {
nextTick(() => searchInputRef.value?.focus());
});
onClickOutside(elementRef, close);
whenever(keys.escape, close);
watch(
value,
(newValue) => {
const option = options.value.find((option2) => option2.value === newValue);
if (option) {
selectedOption.value = option;
}
}
);
const { searchResult: filteredOptions } = useFuzzySearch({
search: searchQuery,
data: options.value,
options: {
keys: ["label"],
shouldSort: false,
threshold: 0.3,
filterEmpty: false
}
});
function close() {
isOpen.value = false;
}
function toggleOpen() {
isOpen.value = !isOpen.value;
}
function selectOption({ option }) {
selectedOption.value = option;
value.value = option.value;
isOpen.value = false;
}
function handleKeydown(event) {
const { key } = event;
const isEnter = ["Enter"].includes(key);
const isArrowUpOrDown = ["ArrowUp", "ArrowDown"].includes(key);
const isArrowDown = key === "ArrowDown";
if (isEnter) {
const valueCanBeSelected = isOpen.value && focusIndex.value !== -1;
if (valueCanBeSelected) {
selectOption({ option: filteredOptions.value[focusIndex.value] });
} else {
toggleOpen();
}
event.preventDefault();
return;
}
if (isArrowUpOrDown) {
const increment = isArrowDown ? 1 : -1;
focusIndex.value = clamp({
value: focusIndex.value + increment,
min: 0,
max: options.value.length - 1
});
event.preventDefault();
}
}
function onSearchInput() {
focusIndex.value = 0;
}
return (_ctx, _push, _parent, _attrs) => {
const _component_icon_mdi_chevron_down = __unplugin_components_0$1;
const _cssVars = { style: {
"--b681f728": unref(appTheme).text.mutedColor,
"--24b10592": unref(theme).backgroundColor,
"--7208e40e": unref(theme).borderColor,
"--0e8b7fc4": unref(size).fontSize,
"--3a8b14fb": unref(size).height,
"--4f44bdef": unref(theme).dropdownShadow,
"--094b2a09": unref(theme).option.active.textColor,
"--9f7bab70": unref(theme).option.hover.backgroundColor
} };
_push(ssrRenderComponent(_sfc_main$1, mergeProps(props, _attrs, _cssVars), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div relative class="c-select" w-full data-v-350c641a${_scopeId}><div flex flex-nowrap cursor-pointer items-center class="${ssrRenderClass([{ "is-open": unref(isOpen), "important:border-primary": unref(isOpen) }, "c-select-input"])}" tabindex="0" hover:important:border-primary data-v-350c641a${_scopeId}><div flex-1 truncate data-v-350c641a${_scopeId}>`);
ssrRenderSlot(_ctx.$slots, "displayed-value", {}, () => {
if (unref(searchable) && unref(isOpen)) {
_push2(`<input${ssrRenderAttr("value", unref(searchQuery))} type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current data-v-350c641a${_scopeId}>`);
} else if (unref(selectedOption)) {
_push2(`<span lh-normal data-v-350c641a${_scopeId}>${ssrInterpolate(unref(selectedOption).label)}</span>`);
} else {
_push2(`<span class="placeholder" lh-normal data-v-350c641a${_scopeId}>${ssrInterpolate(unref(placeholder) ?? "Select an option")}</span>`);
}
}, _push2, _parent2, _scopeId);
_push2(`</div>`);
_push2(ssrRenderComponent(_component_icon_mdi_chevron_down, { class: "chevron" }, null, _parent2, _scopeId));
_push2(`</div><div style="${ssrRenderStyle(unref(isOpen) ? null : { display: "none" })}" class="c-select-dropdown" absolute z-10 mt-1 max-h-312px w-full overflow-y-auto pretty-scrollbar data-v-350c641a${_scopeId}>`);
if (!unref(filteredOptions).length) {
ssrRenderSlot(_ctx.$slots, "empty", {}, () => {
_push2(`<div px-4 py-1 opacity-70 data-v-350c641a${_scopeId}> No results found </div>`);
}, _push2, _parent2, _scopeId);
} else {
_push2(`<!--[-->`);
ssrRenderList(unref(filteredOptions), (option, index) => {
_push2(`<div cursor-pointer px-4 py-1 class="${ssrRenderClass([{ active: unref(selectedOption)?.label === option.label, hover: unref(focusIndex) === index }, "c-select-dropdown-option"])}" data-v-350c641a${_scopeId}>${ssrInterpolate(option.label)}</div>`);
});
_push2(`<!--]-->`);
}
_push2(`</div></div>`);
} else {
return [
createVNode("div", {
ref_key: "elementRef",
ref: elementRef,
relative: "",
class: "c-select",
"w-full": ""
}, [
createVNode("div", {
flex: "",
"flex-nowrap": "",
"cursor-pointer": "",
"items-center": "",
class: [{ "is-open": unref(isOpen), "important:border-primary": unref(isOpen) }, "c-select-input"],
tabindex: "0",
"hover:important:border-primary": "",
onClick: toggleOpen,
onKeydown: handleKeydown
}, [
createVNode("div", {
"flex-1": "",
truncate: ""
}, [
renderSlot(_ctx.$slots, "displayed-value", {}, () => [
unref(searchable) && unref(isOpen) ? withDirectives((openBlock(), createBlock("input", {
key: 0,
ref_key: "searchInputRef",
ref: searchInputRef,
"onUpdate:modelValue": ($event) => isRef(searchQuery) ? searchQuery.value = $event : null,
type: "text",
placeholder: "Search...",
class: "search-input",
"w-full": "",
"lh-normal": "",
"color-current": "",
onInput: onSearchInput
}, null, 40, ["onUpdate:modelValue"])), [
[vModelText, unref(searchQuery)]
]) : unref(selectedOption) ? (openBlock(), createBlock("span", {
key: 1,
"lh-normal": ""
}, toDisplayString(unref(selectedOption).label), 1)) : (openBlock(), createBlock("span", {
key: 2,
class: "placeholder",
"lh-normal": ""
}, toDisplayString(unref(placeholder) ?? "Select an option"), 1))
], true)
]),
createVNode(_component_icon_mdi_chevron_down, { class: "chevron" })
], 34),
createVNode(Transition, { name: "dropdown" }, {
default: withCtx(() => [
withDirectives(createVNode("div", {
class: "c-select-dropdown",
absolute: "",
"z-10": "",
"mt-1": "",
"max-h-312px": "",
"w-full": "",
"overflow-y-auto": "",
"pretty-scrollbar": ""
}, [
!unref(filteredOptions).length ? renderSlot(_ctx.$slots, "empty", { key: 0 }, () => [
createVNode("div", {
"px-4": "",
"py-1": "",
"opacity-70": ""
}, " No results found ")
], true) : (openBlock(true), createBlock(Fragment, { key: 1 }, renderList(unref(filteredOptions), (option, index) => {
return openBlock(), createBlock("div", {
key: option.label,
"cursor-pointer": "",
"px-4": "",
"py-1": "",
class: [{ active: unref(selectedOption)?.label === option.label, hover: unref(focusIndex) === index }, "c-select-dropdown-option"],
onClick: ($event) => selectOption({ option })
}, toDisplayString(option.label), 11, ["onClick"]);
}), 128))
], 512), [
[vShow, unref(isOpen)]
])
]),
_: 3
})
], 512)
];
}
}),
_: 3
}, _parent));
};
}
});
/* unplugin-vue-components disabled */const cSelect_vue_vue_type_style_index_0_scoped_350c641a_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-select/c-select.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-350c641a"]]);
export { __unplugin_components_0 as _ };

23
dist/server/chunks/chunk-8daff870.js vendored Normal file
View file

@ -0,0 +1,23 @@
import { openBlock, createElementBlock, createElementVNode } from 'vue';
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_1 = { name: 'mdi-search', render };
/* vite-plugin-components disabled */
export { __unplugin_components_1 as _ };

120
dist/server/chunks/chunk-8e9a9d6c.js vendored Normal file
View file

@ -0,0 +1,120 @@
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, withCtx, unref, createVNode, toDisplayString, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { useRafFn } from '@vueuse/core';
import 'pinia';
function formatMs(msTotal) {
const ms = msTotal % 1e3;
const secs = (msTotal - ms) / 1e3 % 60;
const mins = ((msTotal - ms) / 1e3 - secs) / 60 % 60;
const hrs = (((msTotal - ms) / 1e3 - secs) / 60 - mins) / 60;
const hrsString = hrs > 0 ? `${hrs.toString().padStart(2, "0")}:` : "";
return `${hrsString}${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}.${ms.toString().padStart(3, "0")}`;
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "chronometer",
__ssrInlineRender: true,
setup(__props) {
const isRunning = ref(false);
const counter = ref(0);
let previousRafDate = Date.now();
const { pause: pauseRaf, resume: resumeRaf } = useRafFn(
() => {
const deltaMs = Date.now() - previousRafDate;
previousRafDate = Date.now();
counter.value += deltaMs;
},
{ immediate: false }
);
function resume() {
previousRafDate = Date.now();
resumeRaf();
isRunning.value = true;
}
function pause() {
pauseRaf();
isRunning.value = false;
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-3e03ad8b>`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div class="duration" data-v-3e03ad8b${_scopeId}>${ssrInterpolate(unref(formatMs)(unref(counter)))}</div>`);
} else {
return [
createVNode("div", { class: "duration" }, toDisplayString(unref(formatMs)(unref(counter))), 1)
];
}
}),
_: 1
}, _parent));
_push(`<div mt-5 flex justify-center gap-3 data-v-3e03ad8b>`);
if (!unref(isRunning)) {
_push(ssrRenderComponent(_component_c_button, {
type: "primary",
onClick: resume
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Start `);
} else {
return [
createTextVNode(" Start ")
];
}
}),
_: 1
}, _parent));
} else {
_push(ssrRenderComponent(_component_c_button, {
type: "warning",
onClick: pause
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Stop `);
} else {
return [
createTextVNode(" Stop ")
];
}
}),
_: 1
}, _parent));
}
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => counter.value = 0
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Reset `);
} else {
return [
createTextVNode(" Reset ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
/* unplugin-vue-components disabled */const chronometer_vue_vue_type_style_index_0_scoped_3e03ad8b_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/chronometer/chronometer.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const chronometer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3e03ad8b"]]);
export { chronometer as default };

5
dist/server/chunks/chunk-915ca1f7.js vendored Normal file
View file

@ -0,0 +1,5 @@
function convertHexToBin(hex) {
return hex.trim().split("").map((byte) => Number.parseInt(byte, 16).toString(2).padStart(4, "0")).join("");
}
export { convertHexToBin as c };

66
dist/server/chunks/chunk-9297eda0.js vendored Normal file
View file

@ -0,0 +1,66 @@
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { evaluate } from 'mathjs';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "math-evaluator",
__ssrInlineRender: true,
setup(__props) {
const expression = ref("");
const result = computed(() => withDefaultOnError(() => evaluate(expression.value) ?? "", ""));
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_card = __unplugin_components_1;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(expression),
"onUpdate:value": ($event) => isRef(expression) ? expression.value = $event : null,
rows: "1",
multiline: "",
placeholder: "Your math expression (ex: 2*sqrt(6) )...",
"raw-text": "",
monospace: "",
autofocus: "",
autosize: ""
}, null, _parent));
if (unref(result) !== "") {
_push(ssrRenderComponent(_component_c_card, {
title: "Result ",
"mt-5": ""
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(unref(result))}`);
} else {
return [
createTextVNode(toDisplayString(unref(result)), 1)
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/math-evaluator/math-evaluator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

87
dist/server/chunks/chunk-94015a5b.js vendored Normal file
View file

@ -0,0 +1,87 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import JSON5 from 'json5';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
function getHeaders({ array }) {
const headers = /* @__PURE__ */ new Set();
array.forEach((item) => Object.keys(item).forEach((key) => headers.add(key)));
return Array.from(headers);
}
function serializeValue(value) {
if (value === null) {
return "null";
}
if (value === void 0) {
return "";
}
const valueAsString = String(value).replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/"/g, '\\"');
if (valueAsString.includes(",")) {
return `"${valueAsString}"`;
}
return valueAsString;
}
function convertArrayToCsv({ array }) {
const headers = getHeaders({ array });
const rows = array.map((item) => headers.map((header) => serializeValue(item[header])));
return [headers.join(","), ...rows].join("\n");
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "json-to-csv",
__ssrInlineRender: true,
setup(__props) {
function transformer(value) {
return withDefaultOnError(() => {
if (value === "") {
return "";
}
return convertArrayToCsv({ array: JSON5.parse(value) });
}, "");
}
const rules = [
{
validator: (v) => v === "" || JSON5.parse(v),
message: "Provided JSON is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your raw JSON",
"input-placeholder": "Paste your raw JSON here...",
"output-label": "CSV version of your JSON",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/json-to-csv/json-to-csv.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

23
dist/server/chunks/chunk-95ec8cf7.js vendored Normal file
View file

@ -0,0 +1,23 @@
import { openBlock, createElementBlock, createElementVNode } from 'vue';
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_5 = { name: 'mdi-content-copy', render };
/* vite-plugin-components disabled */
export { __unplugin_components_5 as _ };

102
dist/server/chunks/chunk-9825a69e.js vendored Normal file
View file

@ -0,0 +1,102 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NAlert } from 'naive-ui';
import { defineComponent, ref, computed, withCtx, createTextVNode, unref, isRef, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { SHA1 } from 'crypto-js';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { m as macAddressValidation } from './chunk-65bb8b4f.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-95ec8cf7.js';
import './chunk-8109fd17.js';
import './chunk-77c5cc16.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ipv6-ula-generator",
__ssrInlineRender: true,
setup(__props) {
const macAddress = ref("20:37:06:12:34:56");
const calculatedSections = computed(() => {
const timestamp = (/* @__PURE__ */ new Date()).getTime();
const hex40bit = SHA1(timestamp + macAddress.value).toString().substring(30);
const ula = `fd${hex40bit.substring(0, 2)}:${hex40bit.substring(2, 6)}:${hex40bit.substring(6)}`;
return [
{
label: "IPv6 ULA:",
value: `${ula}::/48`
},
{
label: "First routable block:",
value: `${ula}:0::/64`
},
{
label: "Last routable block:",
value: `${ula}:ffff::/64`
}
];
});
const addressValidation = macAddressValidation(macAddress);
return (_ctx, _push, _parent, _attrs) => {
const _component_n_alert = NAlert;
const _component_c_input_text = __unplugin_components_3;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_n_alert, {
title: "Info",
type: "info"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` This tool uses the first method suggested by IETF using the current timestamp plus the mac address, sha1 hashed, and the lower 40 bits to generate your random ULA. `);
} else {
return [
createTextVNode(" This tool uses the first method suggested by IETF using the current timestamp plus the mac address, sha1 hashed, and the lower 40 bits to generate your random ULA. ")
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(macAddress),
"onUpdate:value": ($event) => isRef(macAddress) ? macAddress.value = $event : null,
placeholder: "Type a MAC address",
clearable: "",
label: "MAC address:",
"raw-text": "",
"my-8": "",
validation: unref(addressValidation)
}, null, _parent));
if (unref(addressValidation).isValid) {
_push(`<div><!--[-->`);
ssrRenderList(unref(calculatedSections), ({ label, value }) => {
_push(ssrRenderComponent(_sfc_main$1, {
key: label,
value,
label,
"label-width": "160px",
"label-align": "right",
"label-position": "left",
readonly: "",
"mb-2": ""
}, null, _parent));
});
_push(`<!--]--></div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/ipv6-ula-generator/ipv6-ula-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

215
dist/server/chunks/chunk-984c342c.js vendored Normal file
View file

@ -0,0 +1,215 @@
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { NDivider } from 'naive-ui';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { formatISO, parseISO, formatISO9075, formatRFC3339, formatRFC7231, getUnixTime, fromUnixTime, getTime, parseJSON, isDate, isValid } from 'date-fns';
import _ from 'lodash';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { useNow } from '@vueuse/core';
import './chunk-95ec8cf7.js';
import './chunk-6003391e.js';
import 'pinia';
import './chunk-8109fd17.js';
import './chunk-77c5cc16.js';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import './chunk-11f44f81.js';
const ISO8601_REGEX = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
const ISO9075_REGEX = /^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]{1,6})?(([+-])([0-9]{2}):([0-9]{2})|Z)?$/;
const RFC3339_REGEX = /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]{1,9})?(([+-])([0-9]{2}):([0-9]{2})|Z)$/;
const RFC7231_REGEX = /^[A-Za-z]{3},\s[0-9]{2}\s[A-Za-z]{3}\s[0-9]{4}\s[0-9]{2}:[0-9]{2}:[0-9]{2}\sGMT$/;
const EXCEL_FORMAT_REGEX = /^-?\d+(\.\d+)?$/;
function createRegexMatcher(regex) {
return (date) => !_.isNil(date) && regex.test(date);
}
const isISO8601DateTimeString = createRegexMatcher(ISO8601_REGEX);
const isISO9075DateString = createRegexMatcher(ISO9075_REGEX);
const isRFC3339DateString = createRegexMatcher(RFC3339_REGEX);
const isRFC7231DateString = createRegexMatcher(RFC7231_REGEX);
const isUnixTimestamp = createRegexMatcher(/^[0-9]{1,10}$/);
const isTimestamp = createRegexMatcher(/^[0-9]{1,13}$/);
const isMongoObjectId = createRegexMatcher(/^[0-9a-fA-F]{24}$/);
const isExcelFormat = createRegexMatcher(EXCEL_FORMAT_REGEX);
function isUTCDateString(date) {
if (_.isNil(date)) {
return false;
}
try {
return new Date(date).toUTCString() === date;
} catch (_ignored) {
return false;
}
}
function dateToExcelFormat(date) {
return String(date.getTime() / (1e3 * 60 * 60 * 24) + 25569);
}
function excelFormatToDate(excelFormat) {
return new Date((Number(excelFormat) - 25569) * 86400 * 1e3);
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "date-time-converter",
__ssrInlineRender: true,
setup(__props) {
const inputDate = ref("");
const toDate = (date) => new Date(date);
const formats = [
{
name: "JS locale date string",
fromDate: (date) => date.toString(),
toDate,
formatMatcher: () => false
},
{
name: "ISO 8601",
fromDate: formatISO,
toDate: parseISO,
formatMatcher: (date) => isISO8601DateTimeString(date)
},
{
name: "ISO 9075",
fromDate: formatISO9075,
toDate: parseISO,
formatMatcher: (date) => isISO9075DateString(date)
},
{
name: "RFC 3339",
fromDate: formatRFC3339,
toDate,
formatMatcher: (date) => isRFC3339DateString(date)
},
{
name: "RFC 7231",
fromDate: formatRFC7231,
toDate,
formatMatcher: (date) => isRFC7231DateString(date)
},
{
name: "Unix timestamp",
fromDate: (date) => String(getUnixTime(date)),
toDate: (sec) => fromUnixTime(+sec),
formatMatcher: (date) => isUnixTimestamp(date)
},
{
name: "Timestamp",
fromDate: (date) => String(getTime(date)),
toDate: (ms) => parseJSON(+ms),
formatMatcher: (date) => isTimestamp(date)
},
{
name: "UTC format",
fromDate: (date) => date.toUTCString(),
toDate,
formatMatcher: (date) => isUTCDateString(date)
},
{
name: "Mongo ObjectID",
fromDate: (date) => `${Math.floor(date.getTime() / 1e3).toString(16)}0000000000000000`,
toDate: (objectId) => new Date(Number.parseInt(objectId.substring(0, 8), 16) * 1e3),
formatMatcher: (date) => isMongoObjectId(date)
},
{
name: "Excel date/time",
fromDate: (date) => dateToExcelFormat(date),
toDate: excelFormatToDate,
formatMatcher: isExcelFormat
}
];
const formatIndex = ref(6);
const now = useNow();
const normalizedDate = computed(() => {
if (!inputDate.value) {
return now.value;
}
const { toDate: toDate2 } = formats[formatIndex.value];
try {
return toDate2(inputDate.value);
} catch (_ignored) {
return void 0;
}
});
function onDateInputChanged(value) {
const matchingIndex = formats.findIndex(({ formatMatcher }) => formatMatcher(value));
if (matchingIndex !== -1) {
formatIndex.value = matchingIndex;
}
}
const validation = useValidation({
source: inputDate,
watch: [formatIndex],
rules: [
{
message: "This date is invalid for this format",
validator: (value) => withDefaultOnError(() => {
if (value === "") {
return true;
}
const maybeDate = formats[formatIndex.value].toDate(value);
return isDate(maybeDate) && isValid(maybeDate);
}, false)
}
]
});
function formatDateUsingFormatter(formatter, date) {
if (!date || !validation.isValid) {
return "";
}
return withDefaultOnError(() => formatter(date), "");
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_select = __unplugin_components_0;
const _component_n_divider = NDivider;
const _component_input_copyable = _sfc_main$1;
_push(`<div${ssrRenderAttrs(_attrs)}><div flex gap-2>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(inputDate),
"onUpdate:value": [($event) => isRef(inputDate) ? inputDate.value = $event : null, onDateInputChanged],
autofocus: "",
placeholder: "Put your date string here...",
clearable: "",
"test-id": "date-time-converter-input",
validation: unref(validation)
}, null, _parent));
_push(ssrRenderComponent(_component_c_select, {
value: unref(formatIndex),
"onUpdate:value": ($event) => isRef(formatIndex) ? formatIndex.value = $event : null,
style: { "flex": "0 0 170px" },
options: formats.map(({ name }, i) => ({ label: name, value: i })),
"data-test-id": "date-time-converter-format-select"
}, null, _parent));
_push(`</div>`);
_push(ssrRenderComponent(_component_n_divider, null, null, _parent));
_push(`<!--[-->`);
ssrRenderList(formats, ({ name, fromDate }) => {
_push(ssrRenderComponent(_component_input_copyable, {
key: name,
label: name,
"label-width": "150px",
"label-position": "left",
"label-align": "right",
value: formatDateUsingFormatter(fromDate, unref(normalizedDate)),
placeholder: "Invalid date...",
"test-id": name,
readonly: "",
"mt-2": ""
}, null, _parent));
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/date-time-converter/date-time-converter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

142
dist/server/chunks/chunk-99e59118.js vendored Normal file
View file

@ -0,0 +1,142 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { NFormItem, NSwitch, NInputNumber } from 'naive-ui';
import { defineComponent, withCtx, unref, isRef, createVNode, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import xmlFormat from 'xml-formatter';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { useStorage } from '@vueuse/core';
import './chunk-727cc0fb.js';
import './chunk-6003391e.js';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
function cleanRawXml(rawXml) {
return rawXml.trim();
}
function formatXml(rawXml, options) {
return withDefaultOnError(() => xmlFormat(cleanRawXml(rawXml), options) ?? "", "");
}
function isValidXML(rawXml) {
const cleanedRawXml = cleanRawXml(rawXml);
if (cleanedRawXml === "") {
return true;
}
try {
xmlFormat(cleanedRawXml);
return true;
} catch (e) {
return false;
}
}
const defaultValue = "<hello><world>foo</world><world>bar</world></hello>";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "xml-formatter",
__ssrInlineRender: true,
setup(__props) {
const indentSize = useStorage("xml-formatter:indent-size", 2);
const collapseContent = useStorage("xml-formatter:collapse-content", true);
function transformer(value) {
return formatXml(value, {
indentation: " ".repeat(indentSize.value),
collapseContent: collapseContent.value,
lineSeparator: "\n"
});
}
const rules = [
{
validator: isValidXML,
message: "Provided XML is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_n_input_number = NInputNumber;
const _component_format_transformer = _sfc_main$1;
_push(`<!--[--><div important:flex-full important:flex-shrink-0 important:flex-grow-0><div flex justify-center>`);
_push(ssrRenderComponent(_component_n_form_item, {
label: "Collapse content:",
"label-placement": "left"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_switch, {
value: unref(collapseContent),
"onUpdate:value": ($event) => isRef(collapseContent) ? collapseContent.value = $event : null
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_switch, {
value: unref(collapseContent),
"onUpdate:value": ($event) => isRef(collapseContent) ? collapseContent.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_n_form_item, {
label: "Indent size:",
"label-placement": "left",
"label-width": "100",
"show-feedback": false
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_number, {
value: unref(indentSize),
"onUpdate:value": ($event) => isRef(indentSize) ? indentSize.value = $event : null,
min: "0",
max: "10",
"w-100px": ""
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(indentSize),
"onUpdate:value": ($event) => isRef(indentSize) ? indentSize.value = $event : null,
min: "0",
max: "10",
"w-100px": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
_push(ssrRenderComponent(_component_format_transformer, {
"input-label": "Your XML",
"input-placeholder": "Paste your XML here...",
"output-label": "Formatted XML from your XML",
"output-language": "xml",
"input-validation-rules": rules,
transformer,
"input-default": defaultValue
}, null, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/xml-formatter/xml-formatter.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

346
dist/server/chunks/chunk-9dc46b43.js vendored Normal file
View file

@ -0,0 +1,346 @@
import { useThemeVars, NFormItem, NInputNumber, NForm } from 'naive-ui';
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, unref, mergeProps, withCtx, isRef, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderClass, ssrInterpolate } from 'vue/server-renderer';
import { hashSync, compareSync } from 'bcryptjs';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "bcrypt",
__ssrInlineRender: true,
setup(__props) {
const themeVars = useThemeVars();
const input = ref("");
const saltCount = ref(10);
const hashed = computed(() => hashSync(input.value, saltCount.value));
const { copy } = useCopy({ source: hashed, text: "Hashed string copied to the clipboard" });
const compareString = ref("");
const compareHash = ref("");
const compareMatch = computed(() => compareSync(compareString.value, compareHash.value));
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_n_form_item = NFormItem;
const _component_n_input_number = NInputNumber;
const _component_c_button = __unplugin_components_0;
const _component_n_form = NForm;
const _cssVars = { style: {
"--d3350ad4": unref(themeVars).errorColor,
"--2320e6bb": unref(themeVars).successColor
} };
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, mergeProps({ title: "Hash" }, _cssVars), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
placeholder: "Your string to bcrypt...",
"raw-text": "",
label: "Your string: ",
"label-position": "left",
"label-align": "right",
"label-width": "120px",
"mb-2": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_form_item, {
label: "Salt count: ",
"label-placement": "left",
"label-width": "120"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_input_number, {
value: unref(saltCount),
"onUpdate:value": ($event) => isRef(saltCount) ? saltCount.value = $event : null,
placeholder: "Salt rounds...",
max: 100,
min: 0,
"w-full": ""
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(saltCount),
"onUpdate:value": ($event) => isRef(saltCount) ? saltCount.value = $event : null,
placeholder: "Salt rounds...",
max: 100,
min: 0,
"w-full": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(hashed),
readonly: "",
"text-center": ""
}, null, _parent2, _scopeId));
_push2(`<div mt-5 flex justify-center data-v-bb1cecfb${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy hash `);
} else {
return [
createTextVNode(" Copy hash ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(input),
"onUpdate:value": ($event) => isRef(input) ? input.value = $event : null,
placeholder: "Your string to bcrypt...",
"raw-text": "",
label: "Your string: ",
"label-position": "left",
"label-align": "right",
"label-width": "120px",
"mb-2": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_form_item, {
label: "Salt count: ",
"label-placement": "left",
"label-width": "120"
}, {
default: withCtx(() => [
createVNode(_component_n_input_number, {
value: unref(saltCount),
"onUpdate:value": ($event) => isRef(saltCount) ? saltCount.value = $event : null,
placeholder: "Salt rounds...",
max: 100,
min: 0,
"w-full": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_c_input_text, {
value: unref(hashed),
readonly: "",
"text-center": ""
}, null, 8, ["value"]),
createVNode("div", {
"mt-5": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx(() => [
createTextVNode(" Copy hash ")
]),
_: 1
}, 8, ["onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, mergeProps({ title: "Compare string with hash" }, _cssVars), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_form, { "label-width": "120" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_form_item, {
label: "Your string: ",
"label-placement": "left"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_c_input_text, {
value: unref(compareString),
"onUpdate:value": ($event) => isRef(compareString) ? compareString.value = $event : null,
placeholder: "Your string to compare...",
"raw-text": ""
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_c_input_text, {
value: unref(compareString),
"onUpdate:value": ($event) => isRef(compareString) ? compareString.value = $event : null,
placeholder: "Your string to compare...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, {
label: "Your hash: ",
"label-placement": "left"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_c_input_text, {
value: unref(compareHash),
"onUpdate:value": ($event) => isRef(compareHash) ? compareHash.value = $event : null,
placeholder: "Your hash to compare...",
"raw-text": ""
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_c_input_text, {
value: unref(compareHash),
"onUpdate:value": ($event) => isRef(compareHash) ? compareHash.value = $event : null,
placeholder: "Your hash to compare...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, {
label: "Do they match ? ",
"label-placement": "left",
"show-feedback": false
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<div class="${ssrRenderClass([{ positive: unref(compareMatch) }, "compare-result"])}" data-v-bb1cecfb${_scopeId3}>${ssrInterpolate(unref(compareMatch) ? "Yes" : "No")}</div>`);
} else {
return [
createVNode("div", {
class: ["compare-result", { positive: unref(compareMatch) }]
}, toDisplayString(unref(compareMatch) ? "Yes" : "No"), 3)
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_form_item, {
label: "Your string: ",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(compareString),
"onUpdate:value": ($event) => isRef(compareString) ? compareString.value = $event : null,
placeholder: "Your string to compare...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Your hash: ",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(compareHash),
"onUpdate:value": ($event) => isRef(compareHash) ? compareHash.value = $event : null,
placeholder: "Your hash to compare...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Do they match ? ",
"label-placement": "left",
"show-feedback": false
}, {
default: withCtx(() => [
createVNode("div", {
class: ["compare-result", { positive: unref(compareMatch) }]
}, toDisplayString(unref(compareMatch) ? "Yes" : "No"), 3)
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_form, { "label-width": "120" }, {
default: withCtx(() => [
createVNode(_component_n_form_item, {
label: "Your string: ",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(compareString),
"onUpdate:value": ($event) => isRef(compareString) ? compareString.value = $event : null,
placeholder: "Your string to compare...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Your hash: ",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_c_input_text, {
value: unref(compareHash),
"onUpdate:value": ($event) => isRef(compareHash) ? compareHash.value = $event : null,
placeholder: "Your hash to compare...",
"raw-text": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, {
label: "Do they match ? ",
"label-placement": "left",
"show-feedback": false
}, {
default: withCtx(() => [
createVNode("div", {
class: ["compare-result", { positive: unref(compareMatch) }]
}, toDisplayString(unref(compareMatch) ? "Yes" : "No"), 3)
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const bcrypt_vue_vue_type_style_index_0_scoped_bb1cecfb_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/bcrypt/bcrypt.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const bcrypt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bb1cecfb"]]);
export { bcrypt as default };

59
dist/server/chunks/chunk-9dfda8c9.js vendored Normal file
View file

@ -0,0 +1,59 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { stringify } from 'iarna-toml-esm';
import { parse } from 'yaml';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "yaml-to-toml",
__ssrInlineRender: true,
setup(__props) {
const convertYamlToToml = (value) => [stringify(parse(value))].flat().join("\n").trim();
const transformer = (value) => value.trim() === "" ? "" : withDefaultOnError(() => convertYamlToToml(value), "");
const rules = [
{
validator: (v) => v === "" || parse(v),
message: "Provided JSON is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your YAML",
"input-placeholder": "Paste your YAML here...",
"output-label": "TOML from your YAML",
"output-language": "toml",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/yaml-to-toml/yaml-to-toml.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

146
dist/server/chunks/chunk-9f6c4b83.js vendored Normal file
View file

@ -0,0 +1,146 @@
import { a as __unplugin_components_0, _ as _export_sfc } from './chunk-6003391e.js';
import { NStatistic, NScrollbar } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, unref, isRef, withCtx, createTextVNode, toDisplayString, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
import { t as textToBase64 } from './chunk-72fc6fca.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "basic-auth-generator",
__ssrInlineRender: true,
setup(__props) {
const username = ref("");
const password = ref("");
const header = computed(() => `Authorization: Basic ${textToBase64(`${username.value}:${password.value}`)}`);
const { copy } = useCopy({ source: header, text: "Header copied to the clipboard" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_card = __unplugin_components_1;
const _component_n_statistic = NStatistic;
const _component_n_scrollbar = NScrollbar;
const _component_c_button = __unplugin_components_0;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-981b0cc5>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(username),
"onUpdate:value": ($event) => isRef(username) ? username.value = $event : null,
label: "Username",
placeholder: "Your username...",
clearable: "",
"raw-text": "",
"mb-5": ""
}, null, _parent));
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(password),
"onUpdate:value": ($event) => isRef(password) ? password.value = $event : null,
label: "Password",
placeholder: "Your password...",
clearable: "",
"raw-text": "",
"mb-2": "",
type: "password"
}, null, _parent));
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_statistic, {
label: "Authorization header:",
class: "header"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_scrollbar, {
"x-scrollable": "",
style: { "max-width": "550px", "margin-bottom": "-10px", "padding-bottom": "10px" },
trigger: "none"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(unref(header))}`);
} else {
return [
createTextVNode(toDisplayString(unref(header)), 1)
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_scrollbar, {
"x-scrollable": "",
style: { "max-width": "550px", "margin-bottom": "-10px", "padding-bottom": "10px" },
trigger: "none"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(header)), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_statistic, {
label: "Authorization header:",
class: "header"
}, {
default: withCtx(() => [
createVNode(_component_n_scrollbar, {
"x-scrollable": "",
style: { "max-width": "550px", "margin-bottom": "-10px", "padding-bottom": "10px" },
trigger: "none"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(header)), 1)
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`<div mt-5 flex justify-center data-v-981b0cc5>`);
_push(ssrRenderComponent(_component_c_button, {
onClick: ($event) => unref(copy)()
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Copy header `);
} else {
return [
createTextVNode(" Copy header ")
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
/* unplugin-vue-components disabled */const basicAuthGenerator_vue_vue_type_style_index_0_scoped_981b0cc5_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/basic-auth-generator/basic-auth-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const basicAuthGenerator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-981b0cc5"]]);
export { basicAuthGenerator as default };

339
dist/server/chunks/chunk-a185de73.js vendored Normal file
View file

@ -0,0 +1,339 @@
import { NH2, NTag, NTable } from 'naive-ui';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, createTextVNode, unref, isRef, toDisplayString, createVNode, openBlock, createBlock, Fragment, renderList, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderStyle, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
import { extensions, types } from 'mime-types';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "mime-types",
__ssrInlineRender: true,
setup(__props) {
const mimeInfos = Object.entries(extensions).map(([mimeType, extensions]) => ({ mimeType, extensions }));
const mimeToExtensionsOptions = Object.keys(extensions).map((label) => ({ label, value: label }));
const selectedMimeType = ref(void 0);
const extensionsFound = computed(() => selectedMimeType.value ? extensions[selectedMimeType.value] : []);
const extensionToMimeTypeOptions = Object.keys(types).map((label) => {
const extension = `.${label}`;
return { label: extension, value: label };
});
const selectedExtension = ref(void 0);
const mimeTypeFound = computed(() => selectedExtension.value ? types[selectedExtension.value] : []);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_h2 = NH2;
const _component_c_select = __unplugin_components_0;
const _component_n_tag = NTag;
const _component_n_table = NTable;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_h2, { style: { "margin-bottom": "0" } }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Mime type to extension `);
} else {
return [
createTextVNode(" Mime type to extension ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<div style="${ssrRenderStyle({ "opacity": "0.8" })}"${_scopeId}> Know which file extensions are associated to a mime-type </div>`);
_push2(ssrRenderComponent(_component_c_select, {
value: unref(selectedMimeType),
"onUpdate:value": ($event) => isRef(selectedMimeType) ? selectedMimeType.value = $event : null,
searchable: "",
"my-4": "",
options: unref(mimeToExtensionsOptions),
placeholder: "Select your mimetype here... (ex: application/pdf)"
}, null, _parent2, _scopeId));
if (unref(extensionsFound).length > 0) {
_push2(`<div${_scopeId}> Extensions of files with the `);
_push2(ssrRenderComponent(_component_n_tag, {
round: "",
bordered: false
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(selectedMimeType))}`);
} else {
return [
createTextVNode(toDisplayString(unref(selectedMimeType)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(` mime-type: <div style="${ssrRenderStyle({ "margin-top": "10px" })}"${_scopeId}><!--[-->`);
ssrRenderList(unref(extensionsFound), (extension) => {
_push2(ssrRenderComponent(_component_n_tag, {
key: extension,
round: "",
bordered: false,
type: "primary",
style: { "margin-right": "10px" }
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` .${ssrInterpolate(extension)}`);
} else {
return [
createTextVNode(" ." + toDisplayString(extension), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]--></div></div>`);
} else {
_push2(`<!---->`);
}
} else {
return [
createVNode(_component_n_h2, { style: { "margin-bottom": "0" } }, {
default: withCtx(() => [
createTextVNode(" Mime type to extension ")
]),
_: 1
}),
createVNode("div", { style: { "opacity": "0.8" } }, " Know which file extensions are associated to a mime-type "),
createVNode(_component_c_select, {
value: unref(selectedMimeType),
"onUpdate:value": ($event) => isRef(selectedMimeType) ? selectedMimeType.value = $event : null,
searchable: "",
"my-4": "",
options: unref(mimeToExtensionsOptions),
placeholder: "Select your mimetype here... (ex: application/pdf)"
}, null, 8, ["value", "onUpdate:value", "options"]),
unref(extensionsFound).length > 0 ? (openBlock(), createBlock("div", { key: 0 }, [
createTextVNode(" Extensions of files with the "),
createVNode(_component_n_tag, {
round: "",
bordered: false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(selectedMimeType)), 1)
]),
_: 1
}),
createTextVNode(" mime-type: "),
createVNode("div", { style: { "margin-top": "10px" } }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(extensionsFound), (extension) => {
return openBlock(), createBlock(_component_n_tag, {
key: extension,
round: "",
bordered: false,
type: "primary",
style: { "margin-right": "10px" }
}, {
default: withCtx(() => [
createTextVNode(" ." + toDisplayString(extension), 1)
]),
_: 2
}, 1024);
}), 128))
])
])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_h2, { style: { "margin-bottom": "0" } }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` File extension to mime type `);
} else {
return [
createTextVNode(" File extension to mime type ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<div style="${ssrRenderStyle({ "opacity": "0.8" })}"${_scopeId}> Know which mime type is associated to a file extension </div>`);
_push2(ssrRenderComponent(_component_c_select, {
value: unref(selectedExtension),
"onUpdate:value": ($event) => isRef(selectedExtension) ? selectedExtension.value = $event : null,
searchable: "",
"my-4": "",
options: unref(extensionToMimeTypeOptions),
placeholder: "Select your mimetype here... (ex: application/pdf)"
}, null, _parent2, _scopeId));
if (unref(selectedExtension)) {
_push2(`<div${_scopeId}> Mime type associated to the extension `);
_push2(ssrRenderComponent(_component_n_tag, {
round: "",
bordered: false
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(selectedExtension))}`);
} else {
return [
createTextVNode(toDisplayString(unref(selectedExtension)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(` file extension: <div style="${ssrRenderStyle({ "margin-top": "10px" })}"${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_tag, {
round: "",
bordered: false,
type: "primary",
style: { "margin-right": "10px" }
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(mimeTypeFound))}`);
} else {
return [
createTextVNode(toDisplayString(unref(mimeTypeFound)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div></div>`);
} else {
_push2(`<!---->`);
}
} else {
return [
createVNode(_component_n_h2, { style: { "margin-bottom": "0" } }, {
default: withCtx(() => [
createTextVNode(" File extension to mime type ")
]),
_: 1
}),
createVNode("div", { style: { "opacity": "0.8" } }, " Know which mime type is associated to a file extension "),
createVNode(_component_c_select, {
value: unref(selectedExtension),
"onUpdate:value": ($event) => isRef(selectedExtension) ? selectedExtension.value = $event : null,
searchable: "",
"my-4": "",
options: unref(extensionToMimeTypeOptions),
placeholder: "Select your mimetype here... (ex: application/pdf)"
}, null, 8, ["value", "onUpdate:value", "options"]),
unref(selectedExtension) ? (openBlock(), createBlock("div", { key: 0 }, [
createTextVNode(" Mime type associated to the extension "),
createVNode(_component_n_tag, {
round: "",
bordered: false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(selectedExtension)), 1)
]),
_: 1
}),
createTextVNode(" file extension: "),
createVNode("div", { style: { "margin-top": "10px" } }, [
createVNode(_component_n_tag, {
round: "",
bordered: false,
type: "primary",
style: { "margin-right": "10px" }
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(mimeTypeFound)), 1)
]),
_: 1
})
])
])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(`<div>`);
_push(ssrRenderComponent(_component_n_table, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<thead${_scopeId}><tr${_scopeId}><th${_scopeId}>Mime types</th><th${_scopeId}>Extensions</th></tr></thead><tbody${_scopeId}><!--[-->`);
ssrRenderList(unref(mimeInfos), ({ mimeType, extensions }) => {
_push2(`<tr${_scopeId}><td${_scopeId}>${ssrInterpolate(mimeType)}</td><td${_scopeId}><!--[-->`);
ssrRenderList(extensions, (extension) => {
_push2(ssrRenderComponent(_component_n_tag, {
key: extension,
round: "",
bordered: false,
style: { "margin-right": "10px" }
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` .${ssrInterpolate(extension)}`);
} else {
return [
createTextVNode(" ." + toDisplayString(extension), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]--></td></tr>`);
});
_push2(`<!--]--></tbody>`);
} else {
return [
createVNode("thead", null, [
createVNode("tr", null, [
createVNode("th", null, "Mime types"),
createVNode("th", null, "Extensions")
])
]),
createVNode("tbody", null, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(mimeInfos), ({ mimeType, extensions }) => {
return openBlock(), createBlock("tr", { key: mimeType }, [
createVNode("td", null, toDisplayString(mimeType), 1),
createVNode("td", null, [
(openBlock(true), createBlock(Fragment, null, renderList(extensions, (extension) => {
return openBlock(), createBlock(_component_n_tag, {
key: extension,
round: "",
bordered: false,
style: { "margin-right": "10px" }
}, {
default: withCtx(() => [
createTextVNode(" ." + toDisplayString(extension), 1)
]),
_: 2
}, 1024);
}), 128))
])
]);
}), 128))
])
];
}
}),
_: 1
}, _parent));
_push(`</div><!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/mime-types/mime-types.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

451
dist/server/chunks/chunk-a3bb6eee.js vendored Normal file
View file

@ -0,0 +1,451 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, toRefs, withCtx, unref, createTextVNode, toDisplayString, createVNode, openBlock, createBlock, Fragment, renderList, createCommentVNode, useSSRContext, ref, computed, isRef } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import { UAParser } from 'ua-parser-js';
import { Browser, Engine, Adjustments, Devices, Cpu } from '@vicons/tabler';
import { NGrid, NGi, NIcon, NTag } from 'naive-ui';
import { a as __unplugin_components_1, _ as _sfc_main$2 } from './chunk-8109fd17.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "user-agent-result-cards",
__ssrInlineRender: true,
props: {
userAgentInfo: {},
sections: {}
},
setup(__props) {
const props = __props;
const { userAgentInfo, sections } = toRefs(props);
return (_ctx, _push, _parent, _attrs) => {
const _component_n_grid = NGrid;
const _component_n_gi = NGi;
const _component_c_card = __unplugin_components_1;
const _component_n_icon = NIcon;
const _component_c_tooltip = _sfc_main$2;
const _component_n_tag = NTag;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_n_grid, {
"x-gap": 12,
"y-gap": 8,
cols: "1 s:2",
responsive: "screen"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<!--[-->`);
ssrRenderList(unref(sections), ({ heading, icon, content }) => {
_push2(ssrRenderComponent(_component_n_gi, { key: heading }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_c_card, { "h-full": "" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<div flex items-center gap-3${_scopeId3}>`);
_push4(ssrRenderComponent(_component_n_icon, {
size: "30",
component: icon,
depth: 3
}, null, _parent4, _scopeId3));
_push4(`<span text-lg${_scopeId3}>${ssrInterpolate(heading)}</span></div><div mt-5 flex gap-2${_scopeId3}><!--[-->`);
ssrRenderList(content, ({ label, getValue }) => {
_push4(`<span${_scopeId3}>`);
if (getValue(unref(userAgentInfo))) {
_push4(ssrRenderComponent(_component_c_tooltip, { tooltip: label }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_n_tag, {
type: "success",
size: "large",
round: "",
bordered: false
}, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(getValue(unref(userAgentInfo)))}`);
} else {
return [
createTextVNode(toDisplayString(getValue(unref(userAgentInfo))), 1)
];
}
}),
_: 2
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_n_tag, {
type: "success",
size: "large",
round: "",
bordered: false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(getValue(unref(userAgentInfo))), 1)
]),
_: 2
}, 1024)
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
_push4(`<!---->`);
}
_push4(`</span>`);
});
_push4(`<!--]--></div><div flex flex-col${_scopeId3}><!--[-->`);
ssrRenderList(content, ({ label, getValue, undefinedFallback }) => {
_push4(`<span${_scopeId3}>`);
if (getValue(unref(userAgentInfo)) === void 0) {
_push4(`<span op-70${_scopeId3}>${ssrInterpolate(undefinedFallback)}</span>`);
} else {
_push4(`<!---->`);
}
_push4(`</span>`);
});
_push4(`<!--]--></div>`);
} else {
return [
createVNode("div", {
flex: "",
"items-center": "",
"gap-3": ""
}, [
createVNode(_component_n_icon, {
size: "30",
component: icon,
depth: 3
}, null, 8, ["component"]),
createVNode("span", { "text-lg": "" }, toDisplayString(heading), 1)
]),
createVNode("div", {
"mt-5": "",
flex: "",
"gap-2": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(content, ({ label, getValue }) => {
return openBlock(), createBlock("span", { key: label }, [
getValue(unref(userAgentInfo)) ? (openBlock(), createBlock(_component_c_tooltip, {
key: 0,
tooltip: label
}, {
default: withCtx(() => [
createVNode(_component_n_tag, {
type: "success",
size: "large",
round: "",
bordered: false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(getValue(unref(userAgentInfo))), 1)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["tooltip"])) : createCommentVNode("", true)
]);
}), 128))
]),
createVNode("div", {
flex: "",
"flex-col": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(content, ({ label, getValue, undefinedFallback }) => {
return openBlock(), createBlock("span", { key: label }, [
getValue(unref(userAgentInfo)) === void 0 ? (openBlock(), createBlock("span", {
key: 0,
"op-70": ""
}, toDisplayString(undefinedFallback), 1)) : createCommentVNode("", true)
]);
}), 128))
])
];
}
}),
_: 2
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_c_card, { "h-full": "" }, {
default: withCtx(() => [
createVNode("div", {
flex: "",
"items-center": "",
"gap-3": ""
}, [
createVNode(_component_n_icon, {
size: "30",
component: icon,
depth: 3
}, null, 8, ["component"]),
createVNode("span", { "text-lg": "" }, toDisplayString(heading), 1)
]),
createVNode("div", {
"mt-5": "",
flex: "",
"gap-2": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(content, ({ label, getValue }) => {
return openBlock(), createBlock("span", { key: label }, [
getValue(unref(userAgentInfo)) ? (openBlock(), createBlock(_component_c_tooltip, {
key: 0,
tooltip: label
}, {
default: withCtx(() => [
createVNode(_component_n_tag, {
type: "success",
size: "large",
round: "",
bordered: false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(getValue(unref(userAgentInfo))), 1)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["tooltip"])) : createCommentVNode("", true)
]);
}), 128))
]),
createVNode("div", {
flex: "",
"flex-col": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(content, ({ label, getValue, undefinedFallback }) => {
return openBlock(), createBlock("span", { key: label }, [
getValue(unref(userAgentInfo)) === void 0 ? (openBlock(), createBlock("span", {
key: 0,
"op-70": ""
}, toDisplayString(undefinedFallback), 1)) : createCommentVNode("", true)
]);
}), 128))
])
]),
_: 2
}, 1024)
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`<!--]-->`);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(unref(sections), ({ heading, icon, content }) => {
return openBlock(), createBlock(_component_n_gi, { key: heading }, {
default: withCtx(() => [
createVNode(_component_c_card, { "h-full": "" }, {
default: withCtx(() => [
createVNode("div", {
flex: "",
"items-center": "",
"gap-3": ""
}, [
createVNode(_component_n_icon, {
size: "30",
component: icon,
depth: 3
}, null, 8, ["component"]),
createVNode("span", { "text-lg": "" }, toDisplayString(heading), 1)
]),
createVNode("div", {
"mt-5": "",
flex: "",
"gap-2": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(content, ({ label, getValue }) => {
return openBlock(), createBlock("span", { key: label }, [
getValue(unref(userAgentInfo)) ? (openBlock(), createBlock(_component_c_tooltip, {
key: 0,
tooltip: label
}, {
default: withCtx(() => [
createVNode(_component_n_tag, {
type: "success",
size: "large",
round: "",
bordered: false
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(getValue(unref(userAgentInfo))), 1)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["tooltip"])) : createCommentVNode("", true)
]);
}), 128))
]),
createVNode("div", {
flex: "",
"flex-col": ""
}, [
(openBlock(true), createBlock(Fragment, null, renderList(content, ({ label, getValue, undefinedFallback }) => {
return openBlock(), createBlock("span", { key: label }, [
getValue(unref(userAgentInfo)) === void 0 ? (openBlock(), createBlock("span", {
key: 0,
"op-70": ""
}, toDisplayString(undefinedFallback), 1)) : createCommentVNode("", true)
]);
}), 128))
])
]),
_: 2
}, 1024)
]),
_: 2
}, 1024);
}), 128))
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/user-agent-parser/user-agent-result-cards.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "user-agent-parser",
__ssrInlineRender: true,
setup(__props) {
const ua = ref(navigator.userAgent);
function getUserAgentInfo(userAgent) {
return userAgent.trim().length > 0 ? UAParser(userAgent.trim()) : { ua: "", browser: {}, cpu: {}, device: {}, engine: {}, os: {} };
}
const userAgentInfo = computed(() => withDefaultOnError(() => getUserAgentInfo(ua.value), void 0));
const sections = [
{
heading: "Browser",
icon: Browser,
content: [
{
label: "Name",
getValue: (block) => block?.browser.name,
undefinedFallback: "No browser name available"
},
{
label: "Version",
getValue: (block) => block?.browser.version,
undefinedFallback: "No browser version available"
}
]
},
{
heading: "Engine",
icon: Engine,
content: [
{
label: "Name",
getValue: (block) => block?.engine.name,
undefinedFallback: "No engine name available"
},
{
label: "Version",
getValue: (block) => block?.engine.version,
undefinedFallback: "No engine version available"
}
]
},
{
heading: "OS",
icon: Adjustments,
content: [
{
label: "Name",
getValue: (block) => block?.os.name,
undefinedFallback: "No OS name available"
},
{
label: "Version",
getValue: (block) => block?.os.version,
undefinedFallback: "No OS version available"
}
]
},
{
heading: "Device",
icon: Devices,
content: [
{
label: "Model",
getValue: (block) => block?.device.model,
undefinedFallback: "No device model available"
},
{
label: "Type",
getValue: (block) => block?.device.type,
undefinedFallback: "No device type available"
},
{
label: "Vendor",
getValue: (block) => block?.device.vendor,
undefinedFallback: "No device vendor available"
}
]
},
{
heading: "CPU",
icon: Cpu,
content: [
{
label: "Architecture",
getValue: (block) => block?.cpu.architecture,
undefinedFallback: "No CPU architecture available"
}
]
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(ua),
"onUpdate:value": ($event) => isRef(ua) ? ua.value = $event : null,
label: "User agent string",
multiline: "",
placeholder: "Put your user-agent here...",
clearable: "",
"raw-text": "",
rows: "2",
autosize: "",
monospace: "",
"mb-3": ""
}, null, _parent));
_push(ssrRenderComponent(_sfc_main$1, {
"user-agent-info": unref(userAgentInfo),
sections
}, null, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/user-agent-parser/user-agent-parser.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

149
dist/server/chunks/chunk-a40dae54.js vendored Normal file
View file

@ -0,0 +1,149 @@
import { useThemeVars, NTable, NCheckbox } from 'naive-ui';
import { defineComponent, ref, computed, unref, mergeProps, withCtx, createVNode, openBlock, createBlock, Fragment, renderList, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import _ from 'lodash';
import { _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-95ec8cf7.js';
import './chunk-8109fd17.js';
import '@vueuse/core';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import './chunk-77c5cc16.js';
import 'pinia';
function computeChmodOctalRepresentation({ permissions }) {
const permissionValue = { read: 4, write: 2, execute: 1 };
const getGroupPermissionValue = (permission) => _.reduce(permission, (acc, isPermSet, key) => acc + (isPermSet ? _.get(permissionValue, key, 0) : 0), 0);
return [
getGroupPermissionValue(permissions.owner),
getGroupPermissionValue(permissions.group),
getGroupPermissionValue(permissions.public)
].join("");
}
function computeChmodSymbolicRepresentation({ permissions }) {
const permissionValue = { read: "r", write: "w", execute: "x" };
const getGroupPermissionValue = (permission) => _.reduce(permission, (acc, isPermSet, key) => acc + (isPermSet ? _.get(permissionValue, key, "") : "-"), "");
return [
getGroupPermissionValue(permissions.owner),
getGroupPermissionValue(permissions.group),
getGroupPermissionValue(permissions.public)
].join("");
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "chmod-calculator",
__ssrInlineRender: true,
setup(__props) {
const themeVars = useThemeVars();
const scopes = [
{ scope: "read", title: "Read (4)" },
{ scope: "write", title: "Write (2)" },
{ scope: "execute", title: "Execute (1)" }
];
const groups = ["owner", "group", "public"];
const permissions = ref({
owner: { read: false, write: false, execute: false },
group: { read: false, write: false, execute: false },
public: { read: false, write: false, execute: false }
});
const octal = computed(() => computeChmodOctalRepresentation({ permissions: permissions.value }));
const symbolic = computed(() => computeChmodSymbolicRepresentation({ permissions: permissions.value }));
return (_ctx, _push, _parent, _attrs) => {
const _component_n_table = NTable;
const _component_n_checkbox = NCheckbox;
const _cssVars = { style: {
"--383ee3da": unref(themeVars).primaryColor
} };
_push(`<div${ssrRenderAttrs(mergeProps(_attrs, _cssVars))} data-v-55b63c39>`);
_push(ssrRenderComponent(_component_n_table, {
bordered: false,
"bottom-bordered": false,
"single-column": "",
class: "permission-table"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<thead data-v-55b63c39${_scopeId}><tr data-v-55b63c39${_scopeId}><th class="text-center" scope="col" data-v-55b63c39${_scopeId}></th><th class="text-center" scope="col" data-v-55b63c39${_scopeId}> Owner (u) </th><th class="text-center" scope="col" data-v-55b63c39${_scopeId}> Group (g) </th><th class="text-center" scope="col" data-v-55b63c39${_scopeId}> Public (o) </th></tr></thead><tbody data-v-55b63c39${_scopeId}><!--[-->`);
ssrRenderList(scopes, ({ scope, title }) => {
_push2(`<tr data-v-55b63c39${_scopeId}><td class="line-header" data-v-55b63c39${_scopeId}>${ssrInterpolate(title)}</td><!--[-->`);
ssrRenderList(groups, (group) => {
_push2(`<td class="text-center" data-v-55b63c39${_scopeId}>`);
_push2(ssrRenderComponent(_component_n_checkbox, {
checked: unref(permissions)[group][scope],
"onUpdate:checked": ($event) => unref(permissions)[group][scope] = $event,
size: "large"
}, null, _parent2, _scopeId));
_push2(`</td>`);
});
_push2(`<!--]--></tr>`);
});
_push2(`<!--]--></tbody>`);
} else {
return [
createVNode("thead", null, [
createVNode("tr", null, [
createVNode("th", {
class: "text-center",
scope: "col"
}),
createVNode("th", {
class: "text-center",
scope: "col"
}, " Owner (u) "),
createVNode("th", {
class: "text-center",
scope: "col"
}, " Group (g) "),
createVNode("th", {
class: "text-center",
scope: "col"
}, " Public (o) ")
])
]),
createVNode("tbody", null, [
(openBlock(), createBlock(Fragment, null, renderList(scopes, ({ scope, title }) => {
return createVNode("tr", { key: scope }, [
createVNode("td", { class: "line-header" }, toDisplayString(title), 1),
(openBlock(), createBlock(Fragment, null, renderList(groups, (group) => {
return createVNode("td", {
key: group,
class: "text-center"
}, [
createVNode(_component_n_checkbox, {
checked: unref(permissions)[group][scope],
"onUpdate:checked": ($event) => unref(permissions)[group][scope] = $event,
size: "large"
}, null, 8, ["checked", "onUpdate:checked"])
]);
}), 64))
]);
}), 64))
])
];
}
}),
_: 1
}, _parent));
_push(`<div class="octal-result" data-v-55b63c39>${ssrInterpolate(unref(octal))}</div><div class="octal-result" data-v-55b63c39>${ssrInterpolate(unref(symbolic))}</div>`);
_push(ssrRenderComponent(_sfc_main$1, {
value: `chmod ${unref(octal)} path`,
readonly: ""
}, null, _parent));
_push(`</div>`);
};
}
});
/* unplugin-vue-components disabled */const chmodCalculator_vue_vue_type_style_index_0_scoped_55b63c39_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/chmod-calculator/chmod-calculator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const chmodCalculator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-55b63c39"]]);
export { chmodCalculator as default };

32
dist/server/chunks/chunk-aa632c49.js vendored Normal file
View file

@ -0,0 +1,32 @@
import { get } from '@vueuse/core';
import QRCode from 'qrcode';
import { ref, watch, isRef } from 'vue';
function useQRCode({
text,
color: { background, foreground },
errorCorrectionLevel,
options
}) {
const qrcode = ref("");
watch(
[text, background, foreground, errorCorrectionLevel].filter(isRef),
async () => {
if (get(text)) {
qrcode.value = await QRCode.toDataURL(get(text).trim(), {
color: {
dark: get(foreground),
light: get(background),
...options?.color
},
errorCorrectionLevel: get(errorCorrectionLevel) ?? "M",
...options
});
}
},
{ immediate: true }
);
return { qrcode };
}
export { useQRCode as u };

79
dist/server/chunks/chunk-aab02bfe.js vendored Normal file
View file

@ -0,0 +1,79 @@
import { defineComponent, toRefs, computed, mergeProps, unref, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderAttr, ssrRenderList, ssrInterpolate, ssrRenderClass, ssrRenderSlot } from 'vue/server-renderer';
import _ from 'lodash';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-table",
__ssrInlineRender: true,
props: {
data: { default: () => [] },
headers: { default: void 0 },
hideHeaders: { type: Boolean, default: false },
description: { default: "Data table" }
},
setup(__props) {
const props = __props;
const { data, headers: rawHeaders, hideHeaders } = toRefs(props);
const headers = computed(() => {
if (rawHeaders.value) {
if (Array.isArray(rawHeaders.value)) {
return rawHeaders.value.map((value) => {
if (typeof value === "string") {
return { key: value, label: value };
}
const { key, label } = value;
return {
key,
label: label ?? key
};
});
}
return _.map(rawHeaders.value, (value, key) => ({
key,
label: value
}));
}
return _.chain(data.value).map((row) => Object.keys(row)).flatten().uniq().map((key) => ({ key, label: key })).value();
});
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({ class: "relative overflow-x-auto rounded" }, _attrs))}><table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400" role="table"${ssrRenderAttr("aria-label", _ctx.description)}>`);
if (!unref(hideHeaders)) {
_push(`<thead class="bg-#ffffff uppercase text-gray-700 dark:bg-#333333 dark:text-gray-400" border-b="1px solid dark:transparent #efeff5"><tr><!--[-->`);
ssrRenderList(unref(headers), (header) => {
_push(`<th scope="col" class="px-6 py-3 text-xs">${ssrInterpolate(header.label)}</th>`);
});
_push(`<!--]--></tr></thead>`);
} else {
_push(`<!---->`);
}
_push(`<tbody><!--[-->`);
ssrRenderList(unref(data), (row, i) => {
_push(`<tr border-b="1px solid dark:#282828 #efeff5" class="${ssrRenderClass([{
"important:border-b-none": i === unref(data).length - 1
}, "bg-white dark:bg-#232323"])}"><!--[-->`);
ssrRenderList(unref(headers), (header) => {
_push(`<td class="px-6 py-4">`);
ssrRenderSlot(_ctx.$slots, header.key, {
row,
headers: unref(headers),
value: row[header.key]
}, () => {
_push(`${ssrInterpolate(row[header.key])}`);
}, _push, _parent);
_push(`</td>`);
});
_push(`<!--]--></tr>`);
});
_push(`<!--]--></tbody></table></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-table/c-table.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

103
dist/server/chunks/chunk-ab9bd3df.js vendored Normal file
View file

@ -0,0 +1,103 @@
import { _ as _sfc_main$2 } from './chunk-aff50618.js';
import { defineComponent, toRefs, unref, mergeProps, useSSRContext, computed } from 'vue';
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "c-key-value-list-item",
__ssrInlineRender: true,
props: {
item: {}
},
setup(__props) {
const props = __props;
const { item } = toRefs(props);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_text_copyable = _sfc_main$2;
if (unref(_).isArray(unref(item).value)) {
_push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
ssrRenderList(unref(item).value, (value) => {
_push(`<div>`);
_push(ssrRenderComponent(_component_c_text_copyable, {
value,
"show-icon": unref(item).showCopyButton ?? true
}, null, _parent));
_push(`</div>`);
});
_push(`<!--]--></div>`);
} else if (unref(_).isBoolean(unref(item).value)) {
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_text_copyable, {
value: unref(item).value ? "true" : "false",
"displayed-value": unref(item).value ? "Yes" : "No",
"show-icon": unref(item).showCopyButton ?? true
}, null, _parent));
_push(`</div>`);
} else if (unref(_).isNumber(unref(item).value)) {
_push(`<div${ssrRenderAttrs(mergeProps({ "font-mono": "" }, _attrs))}>`);
_push(ssrRenderComponent(_component_c_text_copyable, {
value: String(unref(item).value),
"show-icon": unref(item).showCopyButton ?? true
}, null, _parent));
_push(`</div>`);
} else if (unref(_).isNil(unref(item).value) || unref(item).value === "") {
_push(`<div${ssrRenderAttrs(mergeProps({ "op-70": "" }, _attrs))}>${ssrInterpolate(unref(item).placeholder ?? "N/A")}</div>`);
} else {
_push(`<div${ssrRenderAttrs(_attrs)}>`);
_push(ssrRenderComponent(_component_c_text_copyable, {
value: unref(item).value,
"show-icon": unref(item).showCopyButton ?? true
}, null, _parent));
_push(`</div>`);
}
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-key-value-list/c-key-value-list-item.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-key-value-list",
__ssrInlineRender: true,
props: {
items: { default: () => [] }
},
setup(__props) {
const props = __props;
const { items } = toRefs(props);
const formattedItems = computed(() => items.value.filter((item) => !_.isNil(item.value) || !item.hideOnNil));
return (_ctx, _push, _parent, _attrs) => {
const _component_c_key_value_list_item = _sfc_main$1;
_push(`<div${ssrRenderAttrs(mergeProps({
flex: "",
"flex-col": "",
"gap-2": ""
}, _attrs))}><!--[-->`);
ssrRenderList(unref(formattedItems), (item) => {
_push(`<div class="c-key-value-list__item"><div class="c-key-value-list__key" text-13px lh-normal>${ssrInterpolate(item.label)}</div>`);
_push(ssrRenderComponent(_component_c_key_value_list_item, {
item,
class: "c-key-value-list__value",
"font-bold": "",
"lh-normal": ""
}, null, _parent));
_push(`</div>`);
});
_push(`<!--]--></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-key-value-list/c-key-value-list.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

216
dist/server/chunks/chunk-ae8aad05.js vendored Normal file
View file

@ -0,0 +1,216 @@
import { NGrid, NGi, NEllipsis } from 'naive-ui';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, computed, withCtx, createTextVNode, toDisplayString, createVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderList, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { useWindowSize } from '@vueuse/core';
import { _ as _export_sfc } from './chunk-6003391e.js';
import 'pinia';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "device-information",
__ssrInlineRender: true,
setup(__props) {
const { width, height } = useWindowSize();
const sections = [
{
name: "Screen",
information: [
{
label: "Screen size",
value: computed(() => `${window.screen.availWidth} x ${window.screen.availHeight}`)
},
{
label: "Orientation",
value: computed(() => window.screen.orientation.type)
},
{
label: "Orientation angle",
value: computed(() => `${window.screen.orientation.angle}°`)
},
{
label: "Color depth",
value: computed(() => `${window.screen.colorDepth} bits`)
},
{
label: "Pixel ratio",
value: computed(() => `${window.devicePixelRatio} dppx`)
},
{
label: "Window size",
value: computed(() => `${width.value} x ${height.value}`)
}
]
},
{
name: "Device",
information: [
{
label: "Browser vendor",
value: computed(() => navigator.vendor)
},
{
label: "Languages",
value: computed(() => navigator.languages.join(", "))
},
{
label: "Platform",
value: computed(() => navigator.platform)
},
{
label: "User agent",
value: computed(() => navigator.userAgent)
}
]
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_n_grid = NGrid;
const _component_n_gi = NGi;
const _component_n_ellipsis = NEllipsis;
_push(`<!--[-->`);
ssrRenderList(sections, ({ name, information }) => {
_push(ssrRenderComponent(_component_c_card, {
key: name,
title: name
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_grid, {
cols: "1 400:2",
"x-gap": "12",
"y-gap": "12"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<!--[-->`);
ssrRenderList(information, ({ label, value: { value } }) => {
_push3(ssrRenderComponent(_component_n_gi, {
key: label,
class: "information"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`<div class="label" data-v-3d05d2aa${_scopeId3}>${ssrInterpolate(label)}</div><div class="value" data-v-3d05d2aa${_scopeId3}>`);
if (value) {
_push4(ssrRenderComponent(_component_n_ellipsis, null, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(value)}`);
} else {
return [
createTextVNode(toDisplayString(value), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
_push4(`<div class="undefined-value" data-v-3d05d2aa${_scopeId3}> unknown </div>`);
}
_push4(`</div>`);
} else {
return [
createVNode("div", { class: "label" }, toDisplayString(label), 1),
createVNode("div", { class: "value" }, [
value ? (openBlock(), createBlock(_component_n_ellipsis, { key: 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(value), 1)
]),
_: 2
}, 1024)) : (openBlock(), createBlock("div", {
key: 1,
class: "undefined-value"
}, " unknown "))
])
];
}
}),
_: 2
}, _parent3, _scopeId2));
});
_push3(`<!--]-->`);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(information, ({ label, value: { value } }) => {
return openBlock(), createBlock(_component_n_gi, {
key: label,
class: "information"
}, {
default: withCtx(() => [
createVNode("div", { class: "label" }, toDisplayString(label), 1),
createVNode("div", { class: "value" }, [
value ? (openBlock(), createBlock(_component_n_ellipsis, { key: 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(value), 1)
]),
_: 2
}, 1024)) : (openBlock(), createBlock("div", {
key: 1,
class: "undefined-value"
}, " unknown "))
])
]),
_: 2
}, 1024);
}), 128))
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_grid, {
cols: "1 400:2",
"x-gap": "12",
"y-gap": "12"
}, {
default: withCtx(() => [
(openBlock(true), createBlock(Fragment, null, renderList(information, ({ label, value: { value } }) => {
return openBlock(), createBlock(_component_n_gi, {
key: label,
class: "information"
}, {
default: withCtx(() => [
createVNode("div", { class: "label" }, toDisplayString(label), 1),
createVNode("div", { class: "value" }, [
value ? (openBlock(), createBlock(_component_n_ellipsis, { key: 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(value), 1)
]),
_: 2
}, 1024)) : (openBlock(), createBlock("div", {
key: 1,
class: "undefined-value"
}, " unknown "))
])
]),
_: 2
}, 1024);
}), 128))
]),
_: 2
}, 1024)
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const deviceInformation_vue_vue_type_style_index_0_scoped_3d05d2aa_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/device-information/device-information.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const deviceInformation = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3d05d2aa"]]);
export { deviceInformation as default };

218
dist/server/chunks/chunk-afe57511.js vendored Normal file
View file

@ -0,0 +1,218 @@
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { defineComponent, ref, computed, withCtx, unref, isRef, createTextVNode, createVNode, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import 'naive-ui';
function convertTextToUnicode(text) {
return text.split("").map((value) => `&#${value.charCodeAt(0)};`).join("");
}
function convertUnicodeToText(unicodeStr) {
return unicodeStr.replace(/&#(\d+);/g, (match, dec) => String.fromCharCode(dec));
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "text-to-unicode",
__ssrInlineRender: true,
setup(__props) {
const inputText = ref("");
const unicodeFromText = computed(() => inputText.value.trim() === "" ? "" : convertTextToUnicode(inputText.value));
const { copy: copyUnicode } = useCopy({ source: unicodeFromText });
const inputUnicode = ref("");
const textFromUnicode = computed(() => inputUnicode.value.trim() === "" ? "" : convertUnicodeToText(inputUnicode.value));
const { copy: copyText } = useCopy({ source: textFromUnicode });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
_push(`<!--[-->`);
_push(ssrRenderComponent(_component_c_card, { title: "Text to Unicode" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(inputText),
"onUpdate:value": ($event) => isRef(inputText) ? inputText.value = $event : null,
multiline: "",
placeholder: "e.g. 'Hello Avengers'",
label: "Enter text to convert to unicode",
autosize: "",
autofocus: "",
"raw-text": "",
"test-id": "text-to-unicode-input"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(unicodeFromText),
"onUpdate:value": ($event) => isRef(unicodeFromText) ? unicodeFromText.value = $event : null,
label: "Unicode from your text",
multiline: "",
"raw-text": "",
readonly: "",
"mt-2": "",
placeholder: "The unicode representation of your text will be here",
"test-id": "text-to-unicode-output"
}, null, _parent2, _scopeId));
_push2(`<div mt-2 flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
disabled: !unref(unicodeFromText),
onClick: ($event) => unref(copyUnicode)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy unicode to clipboard `);
} else {
return [
createTextVNode(" Copy unicode to clipboard ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(inputText),
"onUpdate:value": ($event) => isRef(inputText) ? inputText.value = $event : null,
multiline: "",
placeholder: "e.g. 'Hello Avengers'",
label: "Enter text to convert to unicode",
autosize: "",
autofocus: "",
"raw-text": "",
"test-id": "text-to-unicode-input"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(unicodeFromText),
"onUpdate:value": ($event) => isRef(unicodeFromText) ? unicodeFromText.value = $event : null,
label: "Unicode from your text",
multiline: "",
"raw-text": "",
readonly: "",
"mt-2": "",
placeholder: "The unicode representation of your text will be here",
"test-id": "text-to-unicode-output"
}, null, 8, ["value", "onUpdate:value"]),
createVNode("div", {
"mt-2": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
disabled: !unref(unicodeFromText),
onClick: ($event) => unref(copyUnicode)()
}, {
default: withCtx(() => [
createTextVNode(" Copy unicode to clipboard ")
]),
_: 1
}, 8, ["disabled", "onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, { title: "Unicode to Text" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(inputUnicode),
"onUpdate:value": ($event) => isRef(inputUnicode) ? inputUnicode.value = $event : null,
multiline: "",
placeholder: "Input Unicode",
label: "Enter unicode to convert to text",
autosize: "",
"raw-text": "",
"test-id": "unicode-to-text-input"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(textFromUnicode),
"onUpdate:value": ($event) => isRef(textFromUnicode) ? textFromUnicode.value = $event : null,
label: "Text from your Unicode",
multiline: "",
"raw-text": "",
readonly: "",
"mt-2": "",
placeholder: "The text representation of your unicode will be here",
"test-id": "unicode-to-text-output"
}, null, _parent2, _scopeId));
_push2(`<div mt-2 flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
disabled: !unref(textFromUnicode),
onClick: ($event) => unref(copyText)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Copy text to clipboard `);
} else {
return [
createTextVNode(" Copy text to clipboard ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(inputUnicode),
"onUpdate:value": ($event) => isRef(inputUnicode) ? inputUnicode.value = $event : null,
multiline: "",
placeholder: "Input Unicode",
label: "Enter unicode to convert to text",
autosize: "",
"raw-text": "",
"test-id": "unicode-to-text-input"
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_c_input_text, {
value: unref(textFromUnicode),
"onUpdate:value": ($event) => isRef(textFromUnicode) ? textFromUnicode.value = $event : null,
label: "Text from your Unicode",
multiline: "",
"raw-text": "",
readonly: "",
"mt-2": "",
placeholder: "The text representation of your unicode will be here",
"test-id": "unicode-to-text-output"
}, null, 8, ["value", "onUpdate:value"]),
createVNode("div", {
"mt-2": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
disabled: !unref(textFromUnicode),
onClick: ($event) => unref(copyText)()
}, {
default: withCtx(() => [
createTextVNode(" Copy text to clipboard ")
]),
_: 1
}, 8, ["disabled", "onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/text-to-unicode/text-to-unicode.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

65
dist/server/chunks/chunk-aff50618.js vendored Normal file
View file

@ -0,0 +1,65 @@
import { _ as __unplugin_components_5 } from './chunk-95ec8cf7.js';
import { _ as _sfc_main$1 } from './chunk-8109fd17.js';
import { defineComponent, toRefs, mergeProps, unref, withCtx, createVNode, createTextVNode, toDisplayString, openBlock, createBlock, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { u as useCopy } from './chunk-77c5cc16.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-text-copyable",
__ssrInlineRender: true,
props: {
value: { default: "" },
displayedValue: { default: void 0 },
showIcon: { type: Boolean, default: true }
},
setup(__props) {
const props = __props;
const { value, displayedValue, showIcon } = toRefs(props);
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_tooltip = _sfc_main$1;
const _component_icon_mdi_content_copy = __unplugin_components_5;
_push(ssrRenderComponent(_component_c_tooltip, mergeProps({
tooltip: unref(isJustCopied) ? "Copied!" : "Copy to clipboard",
"cursor-pointer": "",
onClick: unref(copy)
}, _attrs), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<span flex items-center gap-2${_scopeId}>${ssrInterpolate(unref(displayedValue) ?? unref(value))} `);
if (unref(showIcon)) {
_push2(ssrRenderComponent(_component_icon_mdi_content_copy, { "op-40": "" }, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</span>`);
} else {
return [
createVNode("span", {
flex: "",
"items-center": "",
"gap-2": ""
}, [
createTextVNode(toDisplayString(unref(displayedValue) ?? unref(value)) + " ", 1),
unref(showIcon) ? (openBlock(), createBlock(_component_icon_mdi_content_copy, {
key: 0,
"op-40": ""
})) : createCommentVNode("", true)
])
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-text-copyable/c-text-copyable.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

60
dist/server/chunks/chunk-b071a0d1.js vendored Normal file
View file

@ -0,0 +1,60 @@
import { _ as _sfc_main$1 } from './chunk-2e7c6ce5.js';
import { defineComponent, mergeProps, useSSRContext } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import { parse } from 'iarna-toml-esm';
import { stringify } from 'yaml';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { i as isValidToml } from './chunk-5c0cc9d1.js';
import './chunk-727cc0fb.js';
import 'naive-ui';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'lodash';
import './chunk-4e7a6a8d.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import './chunk-5697d061.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "toml-to-yaml",
__ssrInlineRender: true,
setup(__props) {
const transformer = (value) => value.trim() === "" ? "" : withDefaultOnError(() => stringify(parse(value)), "");
const rules = [
{
validator: isValidToml,
message: "Provided TOML is not valid."
}
];
return (_ctx, _push, _parent, _attrs) => {
const _component_format_transformer = _sfc_main$1;
_push(ssrRenderComponent(_component_format_transformer, mergeProps({
"input-label": "Your TOML",
"input-placeholder": "Paste your TOML here...",
"output-label": "YAML from your TOML",
"output-language": "yaml",
"input-validation-rules": rules,
transformer
}, _attrs), null, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/toml-to-yaml/toml-to-yaml.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

190
dist/server/chunks/chunk-b275374e.js vendored Normal file
View file

@ -0,0 +1,190 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NFormItem, NSwitch, NInputNumber } from 'naive-ui';
import { defineComponent, ref, computed, withCtx, unref, isRef, createVNode, useSSRContext } from 'vue';
import { ssrRenderStyle, ssrRenderComponent } from 'vue/server-renderer';
import yaml from 'yaml';
import { get, useStorage } from '@vueuse/core';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { u as useValidation } from './chunk-35c3d701.js';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import { _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-11f44f81.js';
import 'lodash';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'pinia';
function formatYaml({
rawYaml,
sortKeys = false,
indentSize = 2
}) {
const parsedYaml = yaml.parse(get(rawYaml));
const formattedYAML = yaml.stringify(parsedYaml, {
sortMapEntries: get(sortKeys),
indent: get(indentSize)
});
return formattedYAML;
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "yaml-viewer",
__ssrInlineRender: true,
setup(__props) {
const inputElement = ref();
const rawYaml = useStorage("yaml-prettify:raw-yaml", "");
const indentSize = useStorage("yaml-prettify:indent-size", 2);
const sortKeys = useStorage("yaml-prettify:sort-keys", false);
const cleanYaml = computed(() => withDefaultOnError(() => formatYaml({ rawYaml, indentSize, sortKeys }), ""));
const rawYamlValidation = useValidation({
source: rawYaml,
rules: [
{
validator: (v) => v === "" || yaml.parse(v),
message: "Provided YAML is not valid."
}
]
});
return (_ctx, _push, _parent, _attrs) => {
const _component_n_form_item = NFormItem;
const _component_n_switch = NSwitch;
const _component_n_input_number = NInputNumber;
const _component_c_input_text = __unplugin_components_3;
_push(`<!--[--><div style="${ssrRenderStyle({ "flex": "0 0 100%" })}" data-v-0baea7b2><div style="${ssrRenderStyle({ "margin": "0 auto", "max-width": "600px" })}" flex justify-center gap-3 data-v-0baea7b2>`);
_push(ssrRenderComponent(_component_n_form_item, {
label: "Sort keys :",
"label-placement": "left",
"label-width": "100"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_switch, {
value: unref(sortKeys),
"onUpdate:value": ($event) => isRef(sortKeys) ? sortKeys.value = $event : null
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_switch, {
value: unref(sortKeys),
"onUpdate:value": ($event) => isRef(sortKeys) ? sortKeys.value = $event : null
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_n_form_item, {
label: "Indent size :",
"label-placement": "left",
"label-width": "100",
"show-feedback": false
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_n_input_number, {
value: unref(indentSize),
"onUpdate:value": ($event) => isRef(indentSize) ? indentSize.value = $event : null,
min: "1",
max: "10",
style: { "width": "100px" }
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_n_input_number, {
value: unref(indentSize),
"onUpdate:value": ($event) => isRef(indentSize) ? indentSize.value = $event : null,
min: "1",
max: "10",
style: { "width": "100px" }
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
_push(ssrRenderComponent(_component_n_form_item, {
label: "Your raw YAML",
feedback: unref(rawYamlValidation).message,
"validation-status": unref(rawYamlValidation).status
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
ref_key: "inputElement",
ref: inputElement,
value: unref(rawYaml),
"onUpdate:value": ($event) => isRef(rawYaml) ? rawYaml.value = $event : null,
placeholder: "Paste your raw YAML here...",
rows: "20",
multiline: "",
autocomplete: "off",
autocorrect: "off",
autocapitalize: "off",
spellcheck: "false",
monospace: ""
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_input_text, {
ref_key: "inputElement",
ref: inputElement,
value: unref(rawYaml),
"onUpdate:value": ($event) => isRef(rawYaml) ? rawYaml.value = $event : null,
placeholder: "Paste your raw YAML here...",
rows: "20",
multiline: "",
autocomplete: "off",
autocorrect: "off",
autocapitalize: "off",
spellcheck: "false",
monospace: ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_n_form_item, { label: "Prettified version of your YAML" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(TextareaCopyable, {
value: unref(cleanYaml),
language: "yaml",
"follow-height-of": unref(inputElement)
}, null, _parent2, _scopeId));
} else {
return [
createVNode(TextareaCopyable, {
value: unref(cleanYaml),
language: "yaml",
"follow-height-of": unref(inputElement)
}, null, 8, ["value", "follow-height-of"])
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const yamlViewer_vue_vue_type_style_index_0_scoped_0baea7b2_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/yaml-viewer/yaml-viewer.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const yamlViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0baea7b2"]]);
export { yamlViewer as default };

573
dist/server/chunks/chunk-b566f85a.js vendored Normal file
View file

@ -0,0 +1,573 @@
import { a as __unplugin_components_0$1 } from './chunk-6003391e.js';
import { NCheckbox, NForm, NFormItem, NColorPicker } from 'naive-ui';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { ref, watch, isRef, defineComponent, withCtx, unref, createTextVNode, createVNode, openBlock, createBlock, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderAttr } from 'vue/server-renderer';
import { get } from '@vueuse/core';
import QRCode from 'qrcode';
import { u as useDownloadFileFromBase64 } from './chunk-cce4ae69.js';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import 'lodash';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import 'mime-types';
const EAPMethods = [
"MD5",
"POTP",
"GTC",
"TLS",
"IKEv2",
"SIM",
"AKA",
"AKA'",
"TTLS",
"PWD",
"LEAP",
"PSK",
"FAST",
"TEAP",
"EKE",
"NOOB",
"PEAP"
];
const EAPPhase2Methods = [
"None",
"MSCHAPV2"
];
function escapeString(str) {
return str.replace(/([\\;,:"])/g, "\\$1");
}
function getQrCodeText(options) {
const { ssid, password, encryption, eapMethod, isHiddenSSID, eapAnonymous, eapIdentity, eapPhase2Method } = options;
if (!ssid) {
return null;
}
if (encryption === "nopass") {
return `WIFI:S:${escapeString(ssid)};;`;
}
if (encryption !== "WPA2-EAP" && password) {
return `WIFI:S:${escapeString(ssid)};T:${encryption};P:${escapeString(password)};${isHiddenSSID ? "H:true" : ""};`;
}
if (encryption === "WPA2-EAP" && password && eapMethod) {
if (!eapIdentity && !eapAnonymous) {
return null;
}
if (eapMethod === "PEAP" && !eapPhase2Method) {
return null;
}
const identity = eapAnonymous ? "A:anon" : `I:${escapeString(eapIdentity)}`;
const phase2 = eapPhase2Method !== "None" ? `PH2:${eapPhase2Method};` : "";
return `WIFI:S:${escapeString(ssid)};T:WPA2-EAP;P:${escapeString(password)};E:${eapMethod};${phase2}${identity};${isHiddenSSID ? "H:true" : ""};`;
}
return null;
}
function useWifiQRCode({
ssid,
password,
eapMethod,
isHiddenSSID,
eapAnonymous,
eapIdentity,
eapPhase2Method,
color: { background, foreground },
options
}) {
const qrcode = ref("");
const encryption = ref("WPA");
watch(
[ssid, password, encryption, eapMethod, isHiddenSSID, eapAnonymous, eapIdentity, eapPhase2Method, background, foreground].filter(isRef),
async () => {
const text = getQrCodeText({
ssid: get(ssid),
password: get(password),
encryption: get(encryption),
eapMethod: get(eapMethod),
isHiddenSSID: get(isHiddenSSID),
eapAnonymous: get(eapAnonymous),
eapIdentity: get(eapIdentity),
eapPhase2Method: get(eapPhase2Method)
});
if (text) {
qrcode.value = await QRCode.toDataURL(get(text).trim(), {
color: {
dark: get(foreground),
light: get(background),
...options?.color
},
errorCorrectionLevel: "M",
...options
});
}
},
{ immediate: true }
);
return { qrcode, encryption };
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "wifi-qr-code-generator",
__ssrInlineRender: true,
setup(__props) {
const foreground = ref("#000000ff");
const background = ref("#ffffffff");
const ssid = ref();
const password = ref();
const eapMethod = ref();
const isHiddenSSID = ref(false);
const eapAnonymous = ref(false);
const eapIdentity = ref();
const eapPhase2Method = ref();
const { qrcode, encryption } = useWifiQRCode({
ssid,
password,
eapMethod,
isHiddenSSID,
eapAnonymous,
eapIdentity,
eapPhase2Method,
color: {
background,
foreground
},
options: { width: 1024 }
});
const { download } = useDownloadFileFromBase64({ source: qrcode, filename: "qr-code.png" });
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_select = __unplugin_components_0;
const _component_c_input_text = __unplugin_components_3;
const _component_n_checkbox = NCheckbox;
const _component_n_form = NForm;
const _component_n_form_item = NFormItem;
const _component_n_color_picker = NColorPicker;
const _component_c_button = __unplugin_components_0$1;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div grid grid-cols-1 gap-12${_scopeId}><div${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_select, {
value: unref(encryption),
"onUpdate:value": ($event) => isRef(encryption) ? encryption.value = $event : null,
"mb-4": "",
label: "Encryption method",
"default-value": "WPA",
"label-position": "left",
"label-width": "130px",
"label-align": "right",
options: [
{
label: "No password",
value: "nopass"
},
{
label: "WPA/WPA2",
value: "WPA"
},
{
label: "WEP",
value: "WEP"
},
{
label: "WPA2-EAP",
value: "WPA2-EAP"
}
]
}, null, _parent2, _scopeId));
_push2(`<div class="mb-6 flex flex-row items-center gap-2"${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(ssid),
"onUpdate:value": ($event) => isRef(ssid) ? ssid.value = $event : null,
"label-position": "left",
"label-width": "130px",
"label-align": "right",
label: "SSID:",
rows: "1",
autosize: "",
placeholder: "Your WiFi SSID...",
"mb-6": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_checkbox, {
checked: unref(isHiddenSSID),
"onUpdate:checked": ($event) => isRef(isHiddenSSID) ? isHiddenSSID.value = $event : null
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Hidden SSID `);
} else {
return [
createTextVNode(" Hidden SSID ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
if (unref(encryption) !== "nopass") {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(password),
"onUpdate:value": ($event) => isRef(password) ? password.value = $event : null,
"label-position": "left",
"label-width": "130px",
"label-align": "right",
label: "Password:",
rows: "1",
autosize: "",
type: "password",
placeholder: "Your WiFi Password...",
"mb-6": ""
}, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(encryption) === "WPA2-EAP") {
_push2(ssrRenderComponent(_component_c_select, {
value: unref(eapMethod),
"onUpdate:value": ($event) => isRef(eapMethod) ? eapMethod.value = $event : null,
label: "EAP method",
"label-position": "left",
"label-width": "130px",
"label-align": "right",
options: unref(EAPMethods).map((method) => ({ label: method, value: method })),
searchable: "",
"mb-4": ""
}, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(encryption) === "WPA2-EAP") {
_push2(`<div class="mb-6 flex flex-row items-center gap-2"${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(eapIdentity),
"onUpdate:value": ($event) => isRef(eapIdentity) ? eapIdentity.value = $event : null,
"label-position": "left",
"label-width": "130px",
"label-align": "right",
label: "Identity:",
rows: "1",
autosize: "",
placeholder: "Your EAP Identity...",
"mb-6": ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_checkbox, {
checked: unref(eapAnonymous),
"onUpdate:checked": ($event) => isRef(eapAnonymous) ? eapAnonymous.value = $event : null
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Anonymous? `);
} else {
return [
createTextVNode(" Anonymous? ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
if (unref(encryption) === "WPA2-EAP") {
_push2(ssrRenderComponent(_component_c_select, {
value: unref(eapPhase2Method),
"onUpdate:value": ($event) => isRef(eapPhase2Method) ? eapPhase2Method.value = $event : null,
label: "EAP Phase 2 method",
"label-position": "left",
"label-width": "130px",
"label-align": "right",
options: unref(EAPPhase2Methods).map((method) => ({ label: method, value: method })),
searchable: "",
"mb-4": ""
}, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(ssrRenderComponent(_component_n_form, {
"label-width": "130",
"label-placement": "left"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_n_form_item, { label: "Foreground color:" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_color_picker, {
value: unref(foreground),
"onUpdate:value": ($event) => isRef(foreground) ? foreground.value = $event : null,
modes: ["hex"]
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_color_picker, {
value: unref(foreground),
"onUpdate:value": ($event) => isRef(foreground) ? foreground.value = $event : null,
modes: ["hex"]
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_n_form_item, { label: "Background color:" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_n_color_picker, {
value: unref(background),
"onUpdate:value": ($event) => isRef(background) ? background.value = $event : null,
modes: ["hex"]
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_n_color_picker, {
value: unref(background),
"onUpdate:value": ($event) => isRef(background) ? background.value = $event : null,
modes: ["hex"]
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_n_form_item, { label: "Foreground color:" }, {
default: withCtx(() => [
createVNode(_component_n_color_picker, {
value: unref(foreground),
"onUpdate:value": ($event) => isRef(foreground) ? foreground.value = $event : null,
modes: ["hex"]
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, { label: "Background color:" }, {
default: withCtx(() => [
createVNode(_component_n_color_picker, {
value: unref(background),
"onUpdate:value": ($event) => isRef(background) ? background.value = $event : null,
modes: ["hex"]
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
if (unref(qrcode)) {
_push2(`<div${_scopeId}><div flex flex-col items-center gap-3${_scopeId}><img alt="wifi-qrcode"${ssrRenderAttr("src", unref(qrcode))} width="200"${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, { onClick: unref(download) }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Download qr-code `);
} else {
return [
createTextVNode(" Download qr-code ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div></div>`);
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
} else {
return [
createVNode("div", {
grid: "",
"grid-cols-1": "",
"gap-12": ""
}, [
createVNode("div", null, [
createVNode(_component_c_select, {
value: unref(encryption),
"onUpdate:value": ($event) => isRef(encryption) ? encryption.value = $event : null,
"mb-4": "",
label: "Encryption method",
"default-value": "WPA",
"label-position": "left",
"label-width": "130px",
"label-align": "right",
options: [
{
label: "No password",
value: "nopass"
},
{
label: "WPA/WPA2",
value: "WPA"
},
{
label: "WEP",
value: "WEP"
},
{
label: "WPA2-EAP",
value: "WPA2-EAP"
}
]
}, null, 8, ["value", "onUpdate:value"]),
createVNode("div", { class: "mb-6 flex flex-row items-center gap-2" }, [
createVNode(_component_c_input_text, {
value: unref(ssid),
"onUpdate:value": ($event) => isRef(ssid) ? ssid.value = $event : null,
"label-position": "left",
"label-width": "130px",
"label-align": "right",
label: "SSID:",
rows: "1",
autosize: "",
placeholder: "Your WiFi SSID...",
"mb-6": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_checkbox, {
checked: unref(isHiddenSSID),
"onUpdate:checked": ($event) => isRef(isHiddenSSID) ? isHiddenSSID.value = $event : null
}, {
default: withCtx(() => [
createTextVNode(" Hidden SSID ")
]),
_: 1
}, 8, ["checked", "onUpdate:checked"])
]),
unref(encryption) !== "nopass" ? (openBlock(), createBlock(_component_c_input_text, {
key: 0,
value: unref(password),
"onUpdate:value": ($event) => isRef(password) ? password.value = $event : null,
"label-position": "left",
"label-width": "130px",
"label-align": "right",
label: "Password:",
rows: "1",
autosize: "",
type: "password",
placeholder: "Your WiFi Password...",
"mb-6": ""
}, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("", true),
unref(encryption) === "WPA2-EAP" ? (openBlock(), createBlock(_component_c_select, {
key: 1,
value: unref(eapMethod),
"onUpdate:value": ($event) => isRef(eapMethod) ? eapMethod.value = $event : null,
label: "EAP method",
"label-position": "left",
"label-width": "130px",
"label-align": "right",
options: unref(EAPMethods).map((method) => ({ label: method, value: method })),
searchable: "",
"mb-4": ""
}, null, 8, ["value", "onUpdate:value", "options"])) : createCommentVNode("", true),
unref(encryption) === "WPA2-EAP" ? (openBlock(), createBlock("div", {
key: 2,
class: "mb-6 flex flex-row items-center gap-2"
}, [
createVNode(_component_c_input_text, {
value: unref(eapIdentity),
"onUpdate:value": ($event) => isRef(eapIdentity) ? eapIdentity.value = $event : null,
"label-position": "left",
"label-width": "130px",
"label-align": "right",
label: "Identity:",
rows: "1",
autosize: "",
placeholder: "Your EAP Identity...",
"mb-6": ""
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_checkbox, {
checked: unref(eapAnonymous),
"onUpdate:checked": ($event) => isRef(eapAnonymous) ? eapAnonymous.value = $event : null
}, {
default: withCtx(() => [
createTextVNode(" Anonymous? ")
]),
_: 1
}, 8, ["checked", "onUpdate:checked"])
])) : createCommentVNode("", true),
unref(encryption) === "WPA2-EAP" ? (openBlock(), createBlock(_component_c_select, {
key: 3,
value: unref(eapPhase2Method),
"onUpdate:value": ($event) => isRef(eapPhase2Method) ? eapPhase2Method.value = $event : null,
label: "EAP Phase 2 method",
"label-position": "left",
"label-width": "130px",
"label-align": "right",
options: unref(EAPPhase2Methods).map((method) => ({ label: method, value: method })),
searchable: "",
"mb-4": ""
}, null, 8, ["value", "onUpdate:value", "options"])) : createCommentVNode("", true),
createVNode(_component_n_form, {
"label-width": "130",
"label-placement": "left"
}, {
default: withCtx(() => [
createVNode(_component_n_form_item, { label: "Foreground color:" }, {
default: withCtx(() => [
createVNode(_component_n_color_picker, {
value: unref(foreground),
"onUpdate:value": ($event) => isRef(foreground) ? foreground.value = $event : null,
modes: ["hex"]
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_n_form_item, { label: "Background color:" }, {
default: withCtx(() => [
createVNode(_component_n_color_picker, {
value: unref(background),
"onUpdate:value": ($event) => isRef(background) ? background.value = $event : null,
modes: ["hex"]
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
]),
unref(qrcode) ? (openBlock(), createBlock("div", { key: 0 }, [
createVNode("div", {
flex: "",
"flex-col": "",
"items-center": "",
"gap-3": ""
}, [
createVNode("img", {
alt: "wifi-qrcode",
src: unref(qrcode),
width: "200"
}, null, 8, ["src"]),
createVNode(_component_c_button, { onClick: unref(download) }, {
default: withCtx(() => [
createTextVNode(" Download qr-code ")
]),
_: 1
}, 8, ["onClick"])
])
])) : createCommentVNode("", true)
])
];
}
}),
_: 1
}, _parent));
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

42723
dist/server/chunks/chunk-b6b34114.js vendored Normal file

File diff suppressed because it is too large Load diff

186
dist/server/chunks/chunk-b7049a80.js vendored Normal file
View file

@ -0,0 +1,186 @@
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { defineComponent, ref, computed, mergeProps, unref, isRef, withCtx, createVNode, toDisplayString, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
import _ from 'lodash';
import './chunk-6003391e.js';
import '@vueuse/core';
import 'pinia';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
function prettifyExponentialNotation(exponentialNotation) {
const [base, exponent] = exponentialNotation.toString().split("e");
const baseAsNumber = Number.parseFloat(base);
const prettyBase = baseAsNumber % 1 === 0 ? baseAsNumber.toLocaleString() : baseAsNumber.toFixed(2);
return exponent ? `${prettyBase}e${exponent}` : prettyBase;
}
function getHumanFriendlyDuration({ seconds }) {
if (seconds <= 1e-3) {
return "Instantly";
}
if (seconds <= 1) {
return "Less than a second";
}
const timeUnits = [
{ unit: "millenium", secondsInUnit: 31536e6, format: prettifyExponentialNotation, plural: "millennia" },
{ unit: "century", secondsInUnit: 31536e5, plural: "centuries" },
{ unit: "decade", secondsInUnit: 31536e4, plural: "decades" },
{ unit: "year", secondsInUnit: 31536e3, plural: "years" },
{ unit: "month", secondsInUnit: 2592e3, plural: "months" },
{ unit: "week", secondsInUnit: 604800, plural: "weeks" },
{ unit: "day", secondsInUnit: 86400, plural: "days" },
{ unit: "hour", secondsInUnit: 3600, plural: "hours" },
{ unit: "minute", secondsInUnit: 60, plural: "minutes" },
{ unit: "second", secondsInUnit: 1, plural: "seconds" }
];
return _.chain(timeUnits).map(({ unit, secondsInUnit, plural, format = _.identity }) => {
const quantity = Math.floor(seconds / secondsInUnit);
seconds %= secondsInUnit;
if (quantity <= 0) {
return void 0;
}
const formattedQuantity = format(quantity);
return `${formattedQuantity} ${quantity > 1 ? plural : unit}`;
}).compact().take(2).join(", ").value();
}
function getPasswordCrackTimeEstimation({ password, guessesPerSecond = 1e9 }) {
const charsetLength = getCharsetLength({ password });
const passwordLength = password.length;
const entropy = password === "" ? 0 : Math.log2(charsetLength) * passwordLength;
const secondsToCrack = 2 ** entropy / guessesPerSecond;
const crackDurationFormatted = getHumanFriendlyDuration({ seconds: secondsToCrack });
const score = Math.min(entropy / 128, 1);
return {
entropy,
charsetLength,
passwordLength,
crackDurationFormatted,
secondsToCrack,
score
};
}
function getCharsetLength({ password }) {
const hasLowercase = /[a-z]/.test(password);
const hasUppercase = /[A-Z]/.test(password);
const hasDigits = /\d/.test(password);
const hasSpecialChars = /\W|_/.test(password);
let charsetLength = 0;
if (hasLowercase) {
charsetLength += 26;
}
if (hasUppercase) {
charsetLength += 26;
}
if (hasDigits) {
charsetLength += 10;
}
if (hasSpecialChars) {
charsetLength += 32;
}
return charsetLength;
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "password-strength-analyser",
__ssrInlineRender: true,
setup(__props) {
const password = ref("");
const crackTimeEstimation = computed(() => getPasswordCrackTimeEstimation({ password: password.value }));
const details = computed(() => [
{
label: "Password length:",
value: crackTimeEstimation.value.passwordLength
},
{
label: "Entropy:",
value: Math.round(crackTimeEstimation.value.entropy * 100) / 100
},
{
label: "Character set size:",
value: crackTimeEstimation.value.charsetLength
},
{
label: "Score:",
value: `${Math.round(crackTimeEstimation.value.score * 100)} / 100`
}
]);
return (_ctx, _push, _parent, _attrs) => {
const _component_c_input_text = __unplugin_components_3;
const _component_c_card = __unplugin_components_1;
_push(`<div${ssrRenderAttrs(mergeProps({
flex: "",
"flex-col": "",
"gap-3": ""
}, _attrs))}>`);
_push(ssrRenderComponent(_component_c_input_text, {
value: unref(password),
"onUpdate:value": ($event) => isRef(password) ? password.value = $event : null,
type: "password",
placeholder: "Enter a password...",
clearable: "",
autofocus: "",
"raw-text": "",
"test-id": "password-input"
}, null, _parent));
_push(ssrRenderComponent(_component_c_card, { "text-center": "" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div op-60${_scopeId}> Duration to crack this password with brute force </div><div text-2xl data-test-id="crack-duration"${_scopeId}>${ssrInterpolate(unref(crackTimeEstimation).crackDurationFormatted)}</div>`);
} else {
return [
createVNode("div", { "op-60": "" }, " Duration to crack this password with brute force "),
createVNode("div", {
"text-2xl": "",
"data-test-id": "crack-duration"
}, toDisplayString(unref(crackTimeEstimation).crackDurationFormatted), 1)
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<!--[-->`);
ssrRenderList(unref(details), ({ label, value }) => {
_push2(`<div flex gap-3${_scopeId}><div flex-1 text-right op-60${_scopeId}>${ssrInterpolate(label)}</div><div flex-1 text-left${_scopeId}>${ssrInterpolate(value)}</div></div>`);
});
_push2(`<!--]-->`);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(unref(details), ({ label, value }) => {
return openBlock(), createBlock("div", {
key: label,
flex: "",
"gap-3": ""
}, [
createVNode("div", {
"flex-1": "",
"text-right": "",
"op-60": ""
}, toDisplayString(label), 1),
createVNode("div", {
"flex-1": "",
"text-left": ""
}, toDisplayString(value), 1)
]);
}), 128))
];
}
}),
_: 1
}, _parent));
_push(`<div op-70><span font-bold>Note: </span> The computed strength is based on the time it would take to crack the password using a brute force approach, it does not take into account the possibility of a dictionary attack. </div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/password-strength-analyser/password-strength-analyser.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

48
dist/server/chunks/chunk-bb5bb4f6.js vendored Normal file
View file

@ -0,0 +1,48 @@
import { defineComponent, toRefs, mergeProps, unref, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderAttr, ssrRenderStyle, ssrRenderClass, ssrInterpolate, ssrRenderSlot } from 'vue/server-renderer';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "c-label",
__ssrInlineRender: true,
props: {
label: { default: void 0 },
labelFor: { default: void 0 },
labelPosition: { default: "top" },
labelWidth: { default: "auto" },
labelAlign: { default: "left" }
},
setup(__props) {
const props = __props;
const { label, labelAlign, labelFor, labelPosition, labelWidth } = toRefs(props);
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({
class: {
"flex-col": unref(labelPosition) === "top",
"flex-row": unref(labelPosition) === "left"
},
flex: "",
"items-baseline": ""
}, _attrs))}>`);
if (unref(label)) {
_push(`<label${ssrRenderAttr("for", unref(labelFor))} style="${ssrRenderStyle({ flex: `0 0 ${unref(labelWidth)}` })}" mb-5px pr-12px class="${ssrRenderClass({
"text-left": unref(labelAlign) === "left",
"text-center": unref(labelAlign) === "center",
"text-right": unref(labelAlign) === "right"
})}">${ssrInterpolate(unref(label))}</label>`);
} else {
_push(`<!---->`);
}
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/ui/c-label/c-label.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };

824
dist/server/chunks/chunk-bb837c1f.js vendored Normal file
View file

@ -0,0 +1,824 @@
import { openBlock, createElementBlock, createElementVNode, computed, ref, defineComponent, watchEffect, onBeforeUnmount, unref, withCtx, createTextVNode, createBlock, createVNode, isRef, createCommentVNode, toDisplayString, useSSRContext } from 'vue';
import { _ as __unplugin_components_0$1 } from './chunk-89a4876c.js';
import { a as __unplugin_components_0 } from './chunk-6003391e.js';
import { _ as __unplugin_components_3 } from './chunk-28375bc9.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer';
import _ from 'lodash';
import { createEventHook, useDevicesList, useUserMedia } from '@vueuse/core';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import 'pinia';
const _hoisted_1$6 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$6 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M6 19a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7H6v12M8 9h8v10H8V9m7.5-5l-1-1h-5l-1 1H5v2h14V4h-3.5Z"
}, null, -1);
const _hoisted_3$6 = [
_hoisted_2$6
];
function render$6(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$6))
}
const __unplugin_components_10 = { name: 'mdi-delete-outline', render: render$6 };
/* vite-plugin-components disabled */
const _hoisted_1$5 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$5 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M5 20h14v-2H5m14-9h-4V3H9v6H5l7 7l7-7Z"
}, null, -1);
const _hoisted_3$5 = [
_hoisted_2$5
];
function render$5(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$5))
}
const __unplugin_components_9 = { name: 'mdi-download', render: render$5 };
/* vite-plugin-components disabled */
const _hoisted_1$4 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$4 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M19 12c0 3.86-3.14 7-7 7s-7-3.14-7-7s3.14-7 7-7s7 3.14 7 7Z"
}, null, -1);
const _hoisted_3$4 = [
_hoisted_2$4
];
function render$4(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$4))
}
const __unplugin_components_8 = { name: 'mdi-record', render: render$4 };
/* vite-plugin-components disabled */
const _hoisted_1$3 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$3 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M8 5.14v14l11-7l-11-7Z"
}, null, -1);
const _hoisted_3$3 = [
_hoisted_2$3
];
function render$3(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3))
}
const __unplugin_components_7 = { name: 'mdi-play', render: render$3 };
/* vite-plugin-components disabled */
const _hoisted_1$2 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M14 19h4V5h-4M6 19h4V5H6v14Z"
}, null, -1);
const _hoisted_3$2 = [
_hoisted_2$2
];
function render$2(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2))
}
const __unplugin_components_6 = { name: 'mdi-pause', render: render$2 };
/* vite-plugin-components disabled */
const _hoisted_1$1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2$1 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"
}, null, -1);
const _hoisted_3$1 = [
_hoisted_2$1
];
function render$1(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1))
}
const __unplugin_components_5 = { name: 'mdi-video', render: render$1 };
/* vite-plugin-components disabled */
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "M4 4h3l2-2h6l2 2h3a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m8 3a5 5 0 0 0-5 5a5 5 0 0 0 5 5a5 5 0 0 0 5-5a5 5 0 0 0-5-5m0 2a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_4 = { name: 'mdi-camera', render };
/* vite-plugin-components disabled */
function useMediaRecorder({ stream }) {
const isRecordingSupported = computed(() => MediaRecorder.isTypeSupported("video/webm"));
const mediaRecorder = ref(null);
const recordedChunks = ref([]);
const recordAvailable = createEventHook();
const recordingState = ref("stopped");
const createVideo = () => {
const blob = new Blob(recordedChunks.value, { type: "video/webm" });
const url = URL.createObjectURL(blob);
recordedChunks.value = [];
return url;
};
const startRecording = () => {
if (!isRecordingSupported.value) {
return;
}
if (!stream.value) {
return;
}
if (recordingState.value !== "stopped") {
return;
}
mediaRecorder.value = new MediaRecorder(stream.value, { mimeType: "video/webm" });
mediaRecorder.value.ondataavailable = (e) => {
if (e.data.size > 0) {
recordedChunks.value.push(e.data);
}
};
mediaRecorder.value.onstop = () => {
recordAvailable.trigger(createVideo());
};
if (mediaRecorder.value.state !== "inactive") {
return;
}
mediaRecorder.value.start();
recordingState.value = "recording";
};
const stopRecording = () => {
if (!isRecordingSupported.value) {
return;
}
if (!mediaRecorder.value) {
return;
}
if (recordingState.value === "stopped") {
return;
}
mediaRecorder.value.stop();
recordingState.value = "stopped";
};
const pauseRecording = () => {
if (!isRecordingSupported.value) {
return;
}
if (!mediaRecorder.value) {
return;
}
if (recordingState.value !== "recording") {
return;
}
mediaRecorder.value.pause();
recordingState.value = "paused";
};
const resumeRecording = () => {
if (!isRecordingSupported.value) {
return;
}
if (!mediaRecorder.value) {
return;
}
if (recordingState.value !== "paused") {
return;
}
mediaRecorder.value.resume();
recordingState.value = "recording";
};
return {
isRecordingSupported,
startRecording,
stopRecording,
pauseRecording,
resumeRecording,
recordingState,
onRecordAvailable: recordAvailable.on
};
}
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "camera-recorder",
__ssrInlineRender: true,
setup(__props) {
const {
videoInputs: cameras,
audioInputs: microphones,
permissionGranted,
isSupported,
ensurePermissions
} = useDevicesList({
requestPermissions: true,
constraints: { video: true, audio: true },
onUpdated() {
refreshCurrentDevices();
}
});
const video = ref();
const medias = ref([]);
const currentCamera = ref(cameras.value[0]?.deviceId);
const currentMicrophone = ref(microphones.value[0]?.deviceId);
const permissionCannotBePrompted = ref(false);
const {
stream,
start,
stop,
enabled: isMediaStreamAvailable
} = useUserMedia({
constraints: computed(() => ({
video: { deviceId: currentCamera.value },
...currentMicrophone.value ? { audio: { deviceId: currentMicrophone.value } } : {}
})),
autoSwitch: true
});
const {
isRecordingSupported,
onRecordAvailable,
startRecording,
stopRecording,
pauseRecording,
recordingState,
resumeRecording
} = useMediaRecorder({
stream
});
onRecordAvailable((value) => {
medias.value.unshift({ type: "video", value, createdAt: /* @__PURE__ */ new Date() });
});
function refreshCurrentDevices() {
if (_.isNil(currentCamera) || !cameras.value.find((i) => i.deviceId === currentCamera.value)) {
currentCamera.value = cameras.value[0]?.deviceId;
}
if (_.isNil(microphones) || !microphones.value.find((i) => i.deviceId === currentMicrophone.value)) {
currentMicrophone.value = microphones.value[0]?.deviceId;
}
}
function takeScreenshot() {
if (!video.value) {
return;
}
const canvas = document.createElement("canvas");
canvas.width = video.value.videoWidth;
canvas.height = video.value.videoHeight;
canvas.getContext("2d")?.drawImage(video.value, 0, 0);
const image = canvas.toDataURL("image/png");
medias.value.unshift({ type: "image", value: image, createdAt: /* @__PURE__ */ new Date() });
}
watchEffect(() => {
if (video.value && stream.value) {
video.value.srcObject = stream.value;
}
});
onBeforeUnmount(() => stop());
async function requestPermissions() {
try {
await ensurePermissions();
} catch (e) {
permissionCannotBePrompted.value = true;
}
}
function downloadMedia({ type, value, createdAt }) {
const link = document.createElement("a");
link.href = value;
link.download = `${type}-${createdAt.getTime()}.${type === "image" ? "png" : "webm"}`;
link.click();
}
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_alert = __unplugin_components_3;
const _component_c_button = __unplugin_components_0;
const _component_c_select = __unplugin_components_0$1;
const _component_icon_mdi_camera = __unplugin_components_4;
const _component_icon_mdi_video = __unplugin_components_5;
const _component_icon_mdi_pause = __unplugin_components_6;
const _component_icon_mdi_play = __unplugin_components_7;
const _component_icon_mdi_record = __unplugin_components_8;
const _component_icon_mdi_download = __unplugin_components_9;
const _component_icon_mdi_delete_outline = __unplugin_components_10;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
if (!unref(isSupported)) {
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` Your browser does not support recording video from camera `);
} else {
return [
createTextVNode(" Your browser does not support recording video from camera ")
];
}
}),
_: 1
}, _parent));
} else if (!unref(permissionGranted)) {
_push(ssrRenderComponent(_component_c_card, { "text-center": "" }, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(` You need to grant permission to use your camera and microphone `);
if (unref(permissionCannotBePrompted)) {
_push2(ssrRenderComponent(_component_c_alert, {
"mt-4": "",
"text-left": ""
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Your browser has blocked permission request or does not support it. You need to grant permission manually in your browser settings (usually the lock icon in the address bar). `);
} else {
return [
createTextVNode(" Your browser has blocked permission request or does not support it. You need to grant permission manually in your browser settings (usually the lock icon in the address bar). ")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<div mt-4 flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, { onClick: requestPermissions }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Grant permission `);
} else {
return [
createTextVNode(" Grant permission ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
}
} else {
return [
createTextVNode(" You need to grant permission to use your camera and microphone "),
unref(permissionCannotBePrompted) ? (openBlock(), createBlock(_component_c_alert, {
key: 0,
"mt-4": "",
"text-left": ""
}, {
default: withCtx(() => [
createTextVNode(" Your browser has blocked permission request or does not support it. You need to grant permission manually in your browser settings (usually the lock icon in the address bar). ")
]),
_: 1
})) : (openBlock(), createBlock("div", {
key: 1,
"mt-4": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, { onClick: requestPermissions }, {
default: withCtx(() => [
createTextVNode(" Grant permission ")
]),
_: 1
})
]))
];
}
}),
_: 1
}, _parent));
} else {
_push(ssrRenderComponent(_component_c_card, null, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div flex flex-col gap-2${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_select, {
value: unref(currentCamera),
"onUpdate:value": ($event) => isRef(currentCamera) ? currentCamera.value = $event : null,
"label-position": "left",
"label-width": "60px",
label: "Video:",
options: unref(cameras).map(({ deviceId, label }) => ({ value: deviceId, label })),
placeholder: "Select camera"
}, null, _parent2, _scopeId));
if (unref(currentMicrophone) && unref(microphones).length > 0) {
_push2(ssrRenderComponent(_component_c_select, {
value: unref(currentMicrophone),
"onUpdate:value": ($event) => isRef(currentMicrophone) ? currentMicrophone.value = $event : null,
label: "Audio:",
"label-position": "left",
"label-width": "60px",
options: unref(microphones).map(({ deviceId, label }) => ({ value: deviceId, label })),
placeholder: "Select microphone"
}, null, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
if (!unref(isMediaStreamAvailable)) {
_push2(`<div mt-3 flex justify-center${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
type: "primary",
onClick: unref(start)
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(` Start webcam `);
} else {
return [
createTextVNode(" Start webcam ")
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`</div>`);
} else {
_push2(`<div${_scopeId}><div my-2${_scopeId}><video autoplay controls playsinline max-h-full w-full${_scopeId}></video></div><div flex items-center justify-between gap-2${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
disabled: !unref(isMediaStreamAvailable),
onClick: takeScreenshot
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<span mr-2${_scopeId2}>`);
_push3(ssrRenderComponent(_component_icon_mdi_camera, null, null, _parent3, _scopeId2));
_push3(`</span> Take screenshot `);
} else {
return [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_camera)
]),
createTextVNode(" Take screenshot ")
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(isRecordingSupported)) {
_push2(`<div flex justify-center gap-2${_scopeId}>`);
if (unref(recordingState) === "stopped") {
_push2(ssrRenderComponent(_component_c_button, { onClick: unref(startRecording) }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<span mr-2${_scopeId2}>`);
_push3(ssrRenderComponent(_component_icon_mdi_video, null, null, _parent3, _scopeId2));
_push3(`</span> Start recording `);
} else {
return [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_video)
]),
createTextVNode(" Start recording ")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(recordingState) === "recording") {
_push2(ssrRenderComponent(_component_c_button, { onClick: unref(pauseRecording) }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<span mr-2${_scopeId2}>`);
_push3(ssrRenderComponent(_component_icon_mdi_pause, null, null, _parent3, _scopeId2));
_push3(`</span> Pause `);
} else {
return [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_pause)
]),
createTextVNode(" Pause ")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(recordingState) === "paused") {
_push2(ssrRenderComponent(_component_c_button, { onClick: unref(resumeRecording) }, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<span mr-2${_scopeId2}>`);
_push3(ssrRenderComponent(_component_icon_mdi_play, null, null, _parent3, _scopeId2));
_push3(`</span> Resume `);
} else {
return [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_play)
]),
createTextVNode(" Resume ")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
if (unref(recordingState) !== "stopped") {
_push2(ssrRenderComponent(_component_c_button, {
type: "error",
onClick: unref(stopRecording)
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<span mr-2${_scopeId2}>`);
_push3(ssrRenderComponent(_component_icon_mdi_record, null, null, _parent3, _scopeId2));
_push3(`</span> Stop `);
} else {
return [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_record)
]),
createTextVNode(" Stop ")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(`<!---->`);
}
_push2(`</div>`);
} else {
_push2(`<div italic op-60${_scopeId}> Video recording is not supported in your browser </div>`);
}
_push2(`</div></div>`);
}
} else {
return [
createVNode("div", {
flex: "",
"flex-col": "",
"gap-2": ""
}, [
createVNode(_component_c_select, {
value: unref(currentCamera),
"onUpdate:value": ($event) => isRef(currentCamera) ? currentCamera.value = $event : null,
"label-position": "left",
"label-width": "60px",
label: "Video:",
options: unref(cameras).map(({ deviceId, label }) => ({ value: deviceId, label })),
placeholder: "Select camera"
}, null, 8, ["value", "onUpdate:value", "options"]),
unref(currentMicrophone) && unref(microphones).length > 0 ? (openBlock(), createBlock(_component_c_select, {
key: 0,
value: unref(currentMicrophone),
"onUpdate:value": ($event) => isRef(currentMicrophone) ? currentMicrophone.value = $event : null,
label: "Audio:",
"label-position": "left",
"label-width": "60px",
options: unref(microphones).map(({ deviceId, label }) => ({ value: deviceId, label })),
placeholder: "Select microphone"
}, null, 8, ["value", "onUpdate:value", "options"])) : createCommentVNode("", true)
]),
!unref(isMediaStreamAvailable) ? (openBlock(), createBlock("div", {
key: 0,
"mt-3": "",
flex: "",
"justify-center": ""
}, [
createVNode(_component_c_button, {
type: "primary",
onClick: unref(start)
}, {
default: withCtx(() => [
createTextVNode(" Start webcam ")
]),
_: 1
}, 8, ["onClick"])
])) : (openBlock(), createBlock("div", { key: 1 }, [
createVNode("div", { "my-2": "" }, [
createVNode("video", {
ref_key: "video",
ref: video,
autoplay: "",
controls: "",
playsinline: "",
"max-h-full": "",
"w-full": ""
}, null, 512)
]),
createVNode("div", {
flex: "",
"items-center": "",
"justify-between": "",
"gap-2": ""
}, [
createVNode(_component_c_button, {
disabled: !unref(isMediaStreamAvailable),
onClick: takeScreenshot
}, {
default: withCtx(() => [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_camera)
]),
createTextVNode(" Take screenshot ")
]),
_: 1
}, 8, ["disabled"]),
unref(isRecordingSupported) ? (openBlock(), createBlock("div", {
key: 0,
flex: "",
"justify-center": "",
"gap-2": ""
}, [
unref(recordingState) === "stopped" ? (openBlock(), createBlock(_component_c_button, {
key: 0,
onClick: unref(startRecording)
}, {
default: withCtx(() => [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_video)
]),
createTextVNode(" Start recording ")
]),
_: 1
}, 8, ["onClick"])) : createCommentVNode("", true),
unref(recordingState) === "recording" ? (openBlock(), createBlock(_component_c_button, {
key: 1,
onClick: unref(pauseRecording)
}, {
default: withCtx(() => [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_pause)
]),
createTextVNode(" Pause ")
]),
_: 1
}, 8, ["onClick"])) : createCommentVNode("", true),
unref(recordingState) === "paused" ? (openBlock(), createBlock(_component_c_button, {
key: 2,
onClick: unref(resumeRecording)
}, {
default: withCtx(() => [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_play)
]),
createTextVNode(" Resume ")
]),
_: 1
}, 8, ["onClick"])) : createCommentVNode("", true),
unref(recordingState) !== "stopped" ? (openBlock(), createBlock(_component_c_button, {
key: 3,
type: "error",
onClick: unref(stopRecording)
}, {
default: withCtx(() => [
createVNode("span", { "mr-2": "" }, [
createVNode(_component_icon_mdi_record)
]),
createTextVNode(" Stop ")
]),
_: 1
}, 8, ["onClick"])) : createCommentVNode("", true)
])) : (openBlock(), createBlock("div", {
key: 1,
italic: "",
"op-60": ""
}, " Video recording is not supported in your browser "))
])
]))
];
}
}),
_: 1
}, _parent));
}
_push(`<div grid grid-cols-2 mt-5 gap-2><!--[-->`);
ssrRenderList(unref(medias), ({ type, value, createdAt }, index) => {
_push(ssrRenderComponent(_component_c_card, { key: index }, {
default: withCtx((_2, _push2, _parent2, _scopeId) => {
if (_push2) {
if (type === "image") {
_push2(`<img${ssrRenderAttr("src", value)} max-h-full w-full alt="screenshot"${_scopeId}>`);
} else {
_push2(`<video${ssrRenderAttr("src", value)} controls max-h-full w-full${_scopeId}></video>`);
}
_push2(`<div flex items-center justify-between${_scopeId}><div font-bold${_scopeId}>${ssrInterpolate(type === "image" ? "Screenshot" : "Video")}</div><div flex gap-2${_scopeId}>`);
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => downloadMedia({ type, value, createdAt })
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_icon_mdi_download, null, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_icon_mdi_download)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_c_button, {
onClick: ($event) => medias.value = unref(medias).filter((_ignored, i) => i !== index)
}, {
default: withCtx((_3, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_icon_mdi_delete_outline, null, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_icon_mdi_delete_outline)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`</div></div>`);
} else {
return [
type === "image" ? (openBlock(), createBlock("img", {
key: 0,
src: value,
"max-h-full": "",
"w-full": "",
alt: "screenshot"
}, null, 8, ["src"])) : (openBlock(), createBlock("video", {
key: 1,
src: value,
controls: "",
"max-h-full": "",
"w-full": ""
}, null, 8, ["src"])),
createVNode("div", {
flex: "",
"items-center": "",
"justify-between": ""
}, [
createVNode("div", { "font-bold": "" }, toDisplayString(type === "image" ? "Screenshot" : "Video"), 1),
createVNode("div", {
flex: "",
"gap-2": ""
}, [
createVNode(_component_c_button, {
onClick: ($event) => downloadMedia({ type, value, createdAt })
}, {
default: withCtx(() => [
createVNode(_component_icon_mdi_download)
]),
_: 2
}, 1032, ["onClick"]),
createVNode(_component_c_button, {
onClick: ($event) => medias.value = unref(medias).filter((_ignored, i) => i !== index)
}, {
default: withCtx(() => [
createVNode(_component_icon_mdi_delete_outline)
]),
_: 2
}, 1032, ["onClick"])
])
])
];
}
}),
_: 2
}, _parent));
});
_push(`<!--]--></div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/camera-recorder/camera-recorder.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };

32
dist/server/chunks/chunk-bc09e76f.js vendored Normal file
View file

@ -0,0 +1,32 @@
import { useRouteQuery } from '@vueuse/router';
import { computed } from 'vue';
const transformers = {
number: {
fromQuery: (value) => Number(value),
toQuery: (value) => String(value)
},
string: {
fromQuery: (value) => value,
toQuery: (value) => value
},
boolean: {
fromQuery: (value) => value.toLowerCase() === "true",
toQuery: (value) => value ? "true" : "false"
}
};
function useQueryParam({ name, defaultValue }) {
const type = typeof defaultValue;
const transformer = transformers[type] ?? transformers.string;
const proxy = useRouteQuery(name, transformer.toQuery(defaultValue));
return computed({
get() {
return transformer.fromQuery(proxy.value);
},
set(value) {
proxy.value = transformer.toQuery(value);
}
});
}
export { useQueryParam as u };

164
dist/server/chunks/chunk-bd78fec4.js vendored Normal file
View file

@ -0,0 +1,164 @@
import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js';
import { NFormItem } from 'naive-ui';
import { _ as __unplugin_components_0 } from './chunk-89a4876c.js';
import { defineComponent, ref, reactive, computed, unref, withCtx, isRef, createVNode, useSSRContext } from 'vue';
import { ssrRenderStyle, ssrRenderClass, ssrRenderComponent } from 'vue/server-renderer';
import { format } from 'sql-formatter';
import { T as TextareaCopyable } from './chunk-727cc0fb.js';
import { u as useStyleStore, _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import '@vueuse/core';
import 'lodash';
import './chunk-bb5bb4f6.js';
import './chunk-2ce6ed5e.js';
import 'fuse.js';
import './chunk-8109fd17.js';
import '@vicons/tabler';
import 'highlight.js/lib/core';
import 'highlight.js/lib/languages/json';
import 'highlight.js/lib/languages/sql';
import 'highlight.js/lib/languages/xml';
import 'highlight.js/lib/languages/yaml';
import 'highlight.js/lib/languages/ini';
import './chunk-77c5cc16.js';
import 'pinia';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "sql-prettify",
__ssrInlineRender: true,
setup(__props) {
const inputElement = ref();
const styleStore = useStyleStore();
const config = reactive({
keywordCase: "upper",
useTabs: false,
language: "sql",
indentStyle: "standard",
tabulateAlias: true
});
const rawSQL = ref("select field1,field2,field3 from my_table where my_condition;");
const prettySQL = computed(() => format(rawSQL.value, config));
return (_ctx, _push, _parent, _attrs) => {
const _component_c_select = __unplugin_components_0;
const _component_n_form_item = NFormItem;
const _component_c_input_text = __unplugin_components_3;
_push(`<!--[--><div style="${ssrRenderStyle({ "flex": "0 0 100%" })}" data-v-b7c40ff0><div style="${ssrRenderStyle({ "max-width": "600px" })}" class="${ssrRenderClass({ "flex-col": unref(styleStore).isSmallScreen })}" mx-auto mb-5 flex gap-2 data-v-b7c40ff0>`);
_push(ssrRenderComponent(_component_c_select, {
value: unref(config).language,
"onUpdate:value": ($event) => unref(config).language = $event,
"flex-1": "",
label: "Dialect",
options: [
{ label: "GCP BigQuery", value: "bigquery" },
{ label: "IBM DB2", value: "db2" },
{ label: "Apache Hive", value: "hive" },
{ label: "MariaDB", value: "mariadb" },
{ label: "MySQL", value: "mysql" },
{ label: "Couchbase N1QL", value: "n1ql" },
{ label: "Oracle PL/SQL", value: "plsql" },
{ label: "PostgreSQL", value: "postgresql" },
{ label: "Amazon Redshift", value: "redshift" },
{ label: "Spark", value: "spark" },
{ label: "Standard SQL", value: "sql" },
{ label: "sqlite", value: "sqlite" },
{ label: "SQL Server Transact-SQL", value: "tsql" }
]
}, null, _parent));
_push(ssrRenderComponent(_component_c_select, {
value: unref(config).keywordCase,
"onUpdate:value": ($event) => unref(config).keywordCase = $event,
label: "Keyword case",
"flex-1": "",
options: [
{ label: "UPPERCASE", value: "upper" },
{ label: "lowercase", value: "lower" },
{ label: "Preserve", value: "preserve" }
]
}, null, _parent));
_push(ssrRenderComponent(_component_c_select, {
value: unref(config).indentStyle,
"onUpdate:value": ($event) => unref(config).indentStyle = $event,
label: "Indent style",
"flex-1": "",
options: [
{ label: "Standard", value: "standard" },
{ label: "Tabular left", value: "tabularLeft" },
{ label: "Tabular right", value: "tabularRight" }
]
}, null, _parent));
_push(`</div></div>`);
_push(ssrRenderComponent(_component_n_form_item, { label: "Your SQL query" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
ref_key: "inputElement",
ref: inputElement,
value: unref(rawSQL),
"onUpdate:value": ($event) => isRef(rawSQL) ? rawSQL.value = $event : null,
placeholder: "Put your SQL query here...",
rows: "20",
multiline: "",
autocomplete: "off",
autocorrect: "off",
autocapitalize: "off",
spellcheck: "false",
monospace: ""
}, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_c_input_text, {
ref_key: "inputElement",
ref: inputElement,
value: unref(rawSQL),
"onUpdate:value": ($event) => isRef(rawSQL) ? rawSQL.value = $event : null,
placeholder: "Put your SQL query here...",
rows: "20",
multiline: "",
autocomplete: "off",
autocorrect: "off",
autocapitalize: "off",
spellcheck: "false",
monospace: ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_n_form_item, { label: "Prettify version of your query" }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(TextareaCopyable, {
value: unref(prettySQL),
language: "sql",
"follow-height-of": unref(inputElement)
}, null, _parent2, _scopeId));
} else {
return [
createVNode(TextareaCopyable, {
value: unref(prettySQL),
language: "sql",
"follow-height-of": unref(inputElement)
}, null, 8, ["value", "follow-height-of"])
];
}
}),
_: 1
}, _parent));
_push(`<!--]-->`);
};
}
});
/* unplugin-vue-components disabled */const sqlPrettify_vue_vue_type_style_index_0_scoped_b7c40ff0_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/sql-prettify/sql-prettify.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const sqlPrettify = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b7c40ff0"]]);
export { sqlPrettify as default };

28471
dist/server/chunks/chunk-c20f225b.js vendored Normal file

File diff suppressed because it is too large Load diff

167
dist/server/chunks/chunk-c2ffa29c.js vendored Normal file
View file

@ -0,0 +1,167 @@
import { openBlock, createElementBlock, createElementVNode, defineComponent, ref, computed, withCtx, unref, isRef, createVNode, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { NDivider } from 'naive-ui';
import { _ as __unplugin_components_3$1 } from './chunk-4e7a6a8d.js';
import { a as __unplugin_components_1 } from './chunk-8109fd17.js';
import { ssrRenderComponent, ssrRenderList, ssrRenderStyle } from 'vue/server-renderer';
import { _ as _sfc_main$1 } from './chunk-de61ec1c.js';
import { i as isNotThrowing } from './chunk-5697d061.js';
import { w as withDefaultOnError } from './chunk-f1b4cc24.js';
import { _ as _export_sfc } from './chunk-6003391e.js';
import './chunk-11f44f81.js';
import './chunk-35c3d701.js';
import '@vueuse/core';
import 'lodash';
import './chunk-95ec8cf7.js';
import './chunk-77c5cc16.js';
import 'pinia';
const _hoisted_1 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
const _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
fill: "currentColor",
d: "m20 16l-5.5 5.5l-1.42-1.41L16.17 17H10.5A6.5 6.5 0 0 1 4 10.5V4h2v6.5C6 13 8 15 10.5 15h5.67l-3.08-3.09l1.41-1.41L20 16Z"
}, null, -1);
const _hoisted_3 = [
_hoisted_2
];
function render(_ctx, _cache) {
return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3))
}
const __unplugin_components_3 = { name: 'mdi-arrow-right-bottom', render };
/* vite-plugin-components disabled */
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "url-parser",
__ssrInlineRender: true,
setup(__props) {
const urlToParse = ref("https://me:pwd@it-tools.tech:3000/url-parser?key1=value&key2=value2#the-hash");
const urlParsed = computed(() => withDefaultOnError(() => new URL(urlToParse.value), void 0));
const urlValidationRules = [
{
validator: (value) => isNotThrowing(() => new URL(value)),
message: "Invalid url"
}
];
const properties = [
{ title: "Protocol", key: "protocol" },
{ title: "Username", key: "username" },
{ title: "Password", key: "password" },
{ title: "Hostname", key: "hostname" },
{ title: "Port", key: "port" },
{ title: "Path", key: "pathname" },
{ title: "Params", key: "search" }
];
return (_ctx, _push, _parent, _attrs) => {
const _component_c_card = __unplugin_components_1;
const _component_c_input_text = __unplugin_components_3$1;
const _component_n_divider = NDivider;
const _component_icon_mdi_arrow_right_bottom = __unplugin_components_3;
_push(ssrRenderComponent(_component_c_card, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_c_input_text, {
value: unref(urlToParse),
"onUpdate:value": ($event) => isRef(urlToParse) ? urlToParse.value = $event : null,
label: "Your url to parse:",
placeholder: "Your url to parse...",
"raw-text": "",
"validation-rules": urlValidationRules
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_n_divider, null, null, _parent2, _scopeId));
_push2(`<!--[-->`);
ssrRenderList(properties, ({ title, key }) => {
_push2(ssrRenderComponent(_sfc_main$1, {
key,
label: title,
value: unref(urlParsed)?.[key] ?? "",
readonly: "",
"label-position": "left",
"label-width": "110px",
"mb-2": "",
placeholder: " "
}, null, _parent2, _scopeId));
});
_push2(`<!--]--><!--[-->`);
ssrRenderList(Object.entries(Object.fromEntries(unref(urlParsed)?.searchParams.entries() ?? [])), ([k, v]) => {
_push2(`<div mb-2 w-full flex data-v-98d1859c${_scopeId}><div style="${ssrRenderStyle({ "flex": "1 0 110px" })}" data-v-98d1859c${_scopeId}>`);
_push2(ssrRenderComponent(_component_icon_mdi_arrow_right_bottom, null, null, _parent2, _scopeId));
_push2(`</div>`);
_push2(ssrRenderComponent(_sfc_main$1, {
value: k,
readonly: ""
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$1, {
value: v,
readonly: ""
}, null, _parent2, _scopeId));
_push2(`</div>`);
});
_push2(`<!--]-->`);
} else {
return [
createVNode(_component_c_input_text, {
value: unref(urlToParse),
"onUpdate:value": ($event) => isRef(urlToParse) ? urlToParse.value = $event : null,
label: "Your url to parse:",
placeholder: "Your url to parse...",
"raw-text": "",
"validation-rules": urlValidationRules
}, null, 8, ["value", "onUpdate:value"]),
createVNode(_component_n_divider),
(openBlock(), createBlock(Fragment, null, renderList(properties, ({ title, key }) => {
return createVNode(_sfc_main$1, {
key,
label: title,
value: unref(urlParsed)?.[key] ?? "",
readonly: "",
"label-position": "left",
"label-width": "110px",
"mb-2": "",
placeholder: " "
}, null, 8, ["label", "value"]);
}), 64)),
(openBlock(true), createBlock(Fragment, null, renderList(Object.entries(Object.fromEntries(unref(urlParsed)?.searchParams.entries() ?? [])), ([k, v]) => {
return openBlock(), createBlock("div", {
key: k,
"mb-2": "",
"w-full": "",
flex: ""
}, [
createVNode("div", { style: { "flex": "1 0 110px" } }, [
createVNode(_component_icon_mdi_arrow_right_bottom)
]),
createVNode(_sfc_main$1, {
value: k,
readonly: ""
}, null, 8, ["value"]),
createVNode(_sfc_main$1, {
value: v,
readonly: ""
}, null, 8, ["value"])
]);
}), 128))
];
}
}),
_: 1
}, _parent));
};
}
});
/* unplugin-vue-components disabled */const urlParser_vue_vue_type_style_index_0_scoped_98d1859c_lang = '';
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/tools/url-parser/url-parser.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const urlParser = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-98d1859c"]]);
export { urlParser as default };

Some files were not shown because too many files have changed in this diff Show more