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(`