���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.1
/
nuxt
/
dist
/
app
/
components
/
Viewing: client-only.js
import { cloneVNode, createElementBlock, createStaticVNode, defineComponent, getCurrentInstance, h, onMounted, provide, ref } from "vue"; import { isPromise } from "@vue/shared"; import { useNuxtApp } from "../nuxt.js"; import { getFragmentHTML } from "./utils.js"; export const clientOnlySymbol = Symbol.for("nuxt:client-only"); export default defineComponent({ name: "ClientOnly", inheritAttrs: false, props: ["fallback", "placeholder", "placeholderTag", "fallbackTag"], setup(_, { slots, attrs }) { const mounted = ref(false); onMounted(() => { mounted.value = true; }); if (import.meta.dev) { const nuxtApp = useNuxtApp(); nuxtApp._isNuxtPageUsed = true; nuxtApp._isNuxtLayoutUsed = true; } provide(clientOnlySymbol, true); return (props) => { if (mounted.value) { return slots.default?.(); } const slot = slots.fallback || slots.placeholder; if (slot) { return slot(); } const fallbackStr = props.fallback || props.placeholder || ""; const fallbackTag = props.fallbackTag || props.placeholderTag || "span"; return createElementBlock(fallbackTag, attrs, fallbackStr); }; } }); const cache = /* @__PURE__ */ new WeakMap(); // @__NO_SIDE_EFFECTS__ export function createClientOnly(component) { if (cache.has(component)) { return cache.get(component); } const clone = { ...component }; if (clone.render) { clone.render = (ctx, cache2, $props, $setup, $data, $options) => { if (import.meta.client && ($setup.mounted$ ?? ctx.mounted$)) { const res = component.render?.bind(ctx)(ctx, cache2, $props, $setup, $data, $options); return res.children === null || typeof res.children === "string" ? cloneVNode(res) : h(res); } else { const fragment = getFragmentHTML(ctx._.vnode.el ?? null) ?? ["<div></div>"]; return import.meta.client ? createStaticVNode(fragment.join(""), fragment.length) : h("div", ctx.$attrs ?? ctx._.attrs); } }; } else if (clone.template) { clone.template = ` <template v-if="mounted$">${component.template}</template> <template v-else><div></div></template> `; } clone.setup = (props, ctx) => { const nuxtApp = useNuxtApp(); const mounted$ = ref(import.meta.client && nuxtApp.isHydrating === false); const instance = getCurrentInstance(); if (import.meta.server || nuxtApp.isHydrating) { const attrs = { ...instance.attrs }; const directives = extractDirectives(instance); for (const key in attrs) { delete instance.attrs[key]; } onMounted(() => { Object.assign(instance.attrs, attrs); instance.vnode.dirs = directives; }); } onMounted(() => { mounted$.value = true; }); const setupState = component.setup?.(props, ctx) || {}; if (isPromise(setupState)) { return Promise.resolve(setupState).then((setupState2) => { if (typeof setupState2 !== "function") { setupState2 = setupState2 || {}; setupState2.mounted$ = mounted$; return setupState2; } return (...args) => { if (import.meta.client && (mounted$.value || !nuxtApp.isHydrating)) { const res = setupState2(...args); return res.children === null || typeof res.children === "string" ? cloneVNode(res) : h(res); } else { const fragment = getFragmentHTML(instance?.vnode.el ?? null) ?? ["<div></div>"]; return import.meta.client ? createStaticVNode(fragment.join(""), fragment.length) : h("div", ctx.attrs); } }; }); } else { if (typeof setupState === "function") { return (...args) => { if (mounted$.value) { return h(setupState(...args), ctx.attrs); } const fragment = getFragmentHTML(instance?.vnode.el ?? null) ?? ["<div></div>"]; return import.meta.client ? createStaticVNode(fragment.join(""), fragment.length) : h("div", ctx.attrs); }; } return Object.assign(setupState, { mounted$ }); } }; cache.set(component, clone); return clone; } function extractDirectives(instance) { if (!instance || !instance.vnode.dirs) { return null; } const directives = instance.vnode.dirs; instance.vnode.dirs = null; return directives; }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa