403Webshell
Server IP : 185.208.173.17  /  Your IP : 87.236.161.98
Web Server : Microsoft-IIS/10.0
System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64
User : IUSR ( 0)
PHP Version : 7.4.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/parsmega.nuxt/node_modules/vue-lazy-hydration/src/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/vue-lazy-hydration/src/utils/hydration-blocker.js
import { makeHydrationObserver } from './hydration-observer';
import { makeHydrationPromise } from './hydration-promise';
import { makeNonce } from './nonce';

export function makeHydrationBlocker(component, options) {
  return Object.assign({
    mixins: [{
      beforeCreate() {
        this.cleanupHandlers = [];
        const { hydrate, hydrationPromise } = makeHydrationPromise();
        this.Nonce = makeNonce({ component, hydrationPromise });
        this.hydrate = hydrate;
        this.hydrationPromise = hydrationPromise;
      },
      beforeDestroy() {
        this.cleanup();
      },
      mounted() {
        if (this.$el.nodeType === Node.COMMENT_NODE) {
          // No SSR rendered content, hydrate immediately.
          this.hydrate();
          return;
        }

        if (this.never) return;

        if (this.whenVisible) {
          const observerOptions = this.whenVisible !== true ? this.whenVisible : undefined;
          const observer = makeHydrationObserver(observerOptions);

          // If Intersection Observer API is not supported, hydrate immediately.
          if (!observer) {
            this.hydrate();
            return;
          }

          this.$el.hydrate = this.hydrate;
          const cleanup = () => observer.unobserve(this.$el);
          this.cleanupHandlers.push(cleanup);
          this.hydrationPromise.then(cleanup);
          observer.observe(this.$el);
          return;
        }

        if (this.whenIdle) {
          // If `requestIdleCallback()` or `requestAnimationFrame()`
          // is not supported, hydrate immediately.
          if (!(`requestIdleCallback` in window) || !(`requestAnimationFrame` in window)) {
            this.hydrate();
            return;
          }

          // @ts-ignore
          const id = requestIdleCallback(() => {
            requestAnimationFrame(this.hydrate);
          }, { timeout: this.idleTimeout });
          // @ts-ignore
          const cleanup = () => cancelIdleCallback(id);
          this.cleanupHandlers.push(cleanup);
          this.hydrationPromise.then(cleanup);
        }

        if (this.interactionEvents && this.interactionEvents.length) {
          const eventListenerOptions = {
            capture: true,
            once: true,
            passive: true,
          };

          this.interactionEvents.forEach((eventName) => {
            this.$el.addEventListener(eventName, this.hydrate, eventListenerOptions);
            const cleanup = () => {
              this.$el.removeEventListener(eventName, this.hydrate, eventListenerOptions);
            };
            this.cleanupHandlers.push(cleanup);
          });
        }
      },
      methods: {
        cleanup() {
          this.cleanupHandlers.forEach(handler => handler());
        },
      },
      render(h) {
        return h(this.Nonce, {
          attrs: this.$attrs,
          on: this.$listeners,
          scopedSlots: this.$scopedSlots,
        }, this.$slots.default);
      },
    }],
  }, options);
}

Youez - 2016 - github.com/yon3zu
LinuXploit