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W,EACX,EAAQ,OACR,EAAQ,aACP,EAOH,EAAQ,OAAS,SAAmC,EAAG,GAErD,OADA,EAAK,KAAK,GACH,EAAS,EAAG,EACrB,EARA,EAAQ,aAAe,EACnB,GAAG,OAAO,EAAU,GACpB,CAAC,EAQT,CAEA,MAAO,CACL,SAAU,EACV,QAAS,EACT,QAAS,EAEb,CAGO,EAED,SAAU,EAAQ,EAAS,GAEjC,EAAO,QAAQ,CAAC,OAAO,WAAY,IAAI,EAAI,KAAS,EAAG,EAAI,eAAmB,EAAG,EAAI,MAAM,IAAI,EAC7F,OAAO,EAAG,mBAAoB,CAC5B,YAAa,CACX,SAAY,YAEd,MAAO,CACL,IAAO,EAAI,QACX,KAAQ,kBAEV,GAAI,CACF,eAAgB,SAAU,GAAM,OAAO,EAAI,MAAM,eAAgB,EAAK,EACtE,eAAgB,SAAU,GAAM,OAAO,EAAI,MAAM,eAAgB,EAAK,EACtE,cAAe,SAAU,GAAM,OAAO,EAAI,MAAM,cAAe,EAAK,EACpE,cAAe,SAAU,GAAM,OAAO,EAAI,MAAM,cAAe,EAAK,IAErE,CAAE,EAAU,OAAI,EAAG,MAAO,CAC3B,IAAK,aACJ,CAAC,EAAI,GAAG,UAAW,KAAM,CAC1B,QAAS,EAAI,WACV,GAAM,EAAI,OAAe,SAAI,EAAG,MAAO,CAC1C,IAAK,YACJ,CAAC,EAAI,GAAG,aAAc,GAAK,EAAG,MAAO,CACtC,IAAK,aAET,EAAE,gBAAiB,IACnB,EAAO,QAAQ,OAAO,eAAgB,CAQ/B,GAEP","file":"/npm/@xunlei/vue-lazy-component@1.1.3/dist/vue-lazy-component.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/@xunlei/vue-lazy-component@1.1.3/dist/vue-lazy-component.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueLazyComponent\"] = factory();\n\telse\n\t\troot[\"VueLazyComponent\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar disposed = false\nvar Component = __webpack_require__(3)(\n  /* script */\n  __webpack_require__(1),\n  /* template */\n  __webpack_require__(4),\n  /* styles */\n  null,\n  /* scopeId */\n  null,\n  /* moduleIdentifier (server only) */\n  null\n)\nComponent.options.__file = \"/Users/benzhao/Sites/@xunlei/vue-lazy-component/src/VueLazyComponent.vue\"\nif (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== \"default\" && key.substr(0, 2) !== \"__\"})) {console.error(\"named exports are not supported in *.vue files.\")}\nif (Component.options.functional) {console.error(\"[vue-loader] VueLazyComponent.vue: functional components are not supported with templates, they should use render functions.\")}\n\n/* hot reload */\nif (false) {(function () {\n  var hotAPI = require(\"vue-hot-reload-api\")\n  hotAPI.install(require(\"vue\"), false)\n  if (!hotAPI.compatible) return\n  module.hot.accept()\n  if (!module.hot.data) {\n    hotAPI.createRecord(\"data-v-175ab158\", Component.options)\n  } else {\n    hotAPI.reload(\"data-v-175ab158\", Component.options)\n  }\n  module.hot.dispose(function (data) {\n    disposed = true\n  })\n})()}\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nexports.default = {\n  name: 'VueLazyComponent',\n\n  props: {\n    timeout: {\n      type: Number\n    },\n    tagName: {\n      type: String,\n      default: 'div'\n    },\n    viewport: {\n      type: typeof window !== 'undefined' ? window.HTMLElement : Object,\n      default: function _default() {\n        return null;\n      }\n    },\n    threshold: {\n      type: String,\n      default: '0px'\n    },\n    direction: {\n      type: String,\n      default: 'vertical'\n    },\n    maxWaitingTime: {\n      type: Number,\n      default: 50\n    }\n  },\n\n  data: function data() {\n    return {\n      isInit: false,\n      timer: null,\n      io: null,\n      loading: false\n    };\n  },\n  created: function created() {\n    var _this = this;\n\n    // 如果指定timeout则无论可见与否都是在timeout之后初始化\n    if (this.timeout) {\n      this.timer = setTimeout(function () {\n        _this.init();\n      }, this.timeout);\n    }\n  },\n  mounted: function mounted() {\n    if (!this.timeout) {\n      // 根据滚动方向来构造视口外边距，用于提前加载\n      var rootMargin = void 0;\n      switch (this.direction) {\n        case 'vertical':\n          rootMargin = this.threshold + ' 0px';\n          break;\n        case 'horizontal':\n          rootMargin = '0px ' + this.threshold;\n          break;\n      }\n\n      // 观察视口与组件容器的交叉情况\n      this.io = new window.IntersectionObserver(this.intersectionHandler, {\n        rootMargin: rootMargin,\n        root: this.viewport,\n        threshold: [0, Number.MIN_VALUE, 0.01]\n      });\n      this.io.observe(this.$el);\n    }\n  },\n  beforeDestroy: function beforeDestroy() {\n    // 在组件销毁前取消观察\n    if (this.io) {\n      this.io.unobserve(this.$el);\n    }\n  },\n\n\n  methods: {\n    // 交叉情况变化处理函数\n    intersectionHandler: function intersectionHandler(entries) {\n      if (\n      // 正在交叉\n      entries[0].isIntersecting ||\n      // 交叉率大于0\n      entries[0].intersectionRatio) {\n        this.init();\n        this.io.unobserve(this.$el);\n      }\n    },\n\n\n    // 处理组件和骨架组件的切换\n    init: function init() {\n      var _this2 = this;\n\n      // 此时说明骨架组件即将被切换\n      this.$emit('beforeInit');\n      this.$emit('before-init');\n\n      // 此时可以准备加载懒加载组件的资源\n      this.loading = true;\n\n      // 由于函数会在主线程中执行，加载懒加载组件非常耗时，容易卡顿\n      // 所以在requestAnimationFrame回调中延后执行\n      this.requestAnimationFrame(function () {\n        _this2.isInit = true;\n        _this2.$emit('init');\n      });\n    },\n    requestAnimationFrame: function requestAnimationFrame(callback) {\n      var _this3 = this;\n\n      // 防止等待太久没有执行回调\n      // 设置最大等待时间\n      setTimeout(function () {\n        if (_this3.isInit) return;\n        callback();\n      }, this.maxWaitingTime);\n\n      // 兼容不支持requestAnimationFrame 的浏览器\n      return (window.requestAnimationFrame || function (callback) {\n        return setTimeout(callback, 1000 / 60);\n      })(callback);\n    }\n  }\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n  * vue-lazy-component\n  * (c) 2017 赵兵\n  * @license MIT\n  */\nvar VueLazyComponent = __webpack_require__(0);\nvar vueLazyComponent = {};\n\n/**\n * Plugin API\n */\nvueLazyComponent.install = function (Vue, options) {\n  Vue.component(VueLazyComponent.name, VueLazyComponent);\n};\n\nvueLazyComponent.component = VueLazyComponent;\n\n/**\n * Auto install\n */\nif (typeof window !== 'undefined' && window.Vue) {\n  window.Vue.use(vueLazyComponent);\n}\n\nmodule.exports = vueLazyComponent;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n  rawScriptExports,\n  compiledTemplate,\n  injectStyles,\n  scopeId,\n  moduleIdentifier /* server only */\n) {\n  var esModule\n  var scriptExports = rawScriptExports = rawScriptExports || {}\n\n  // ES6 modules interop\n  var type = typeof rawScriptExports.default\n  if (type === 'object' || type === 'function') {\n    esModule = rawScriptExports\n    scriptExports = rawScriptExports.default\n  }\n\n  // Vue.extend constructor export interop\n  var options = typeof scriptExports === 'function'\n    ? scriptExports.options\n    : scriptExports\n\n  // render functions\n  if (compiledTemplate) {\n    options.render = compiledTemplate.render\n    options.staticRenderFns = compiledTemplate.staticRenderFns\n  }\n\n  // scopedId\n  if (scopeId) {\n    options._scopeId = scopeId\n  }\n\n  var hook\n  if (moduleIdentifier) { // server build\n    hook = function (context) {\n      // 2.3 injection\n      context =\n        context || // cached call\n        (this.$vnode && this.$vnode.ssrContext) || // stateful\n        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n      // 2.2 with runInNewContext: true\n      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n        context = __VUE_SSR_CONTEXT__\n      }\n      // inject component styles\n      if (injectStyles) {\n        injectStyles.call(this, context)\n      }\n      // register component module identifier for async chunk inferrence\n      if (context && context._registeredComponents) {\n        context._registeredComponents.add(moduleIdentifier)\n      }\n    }\n    // used by ssr in case component is cached and beforeCreate\n    // never gets called\n    options._ssrRegister = hook\n  } else if (injectStyles) {\n    hook = injectStyles\n  }\n\n  if (hook) {\n    var functional = options.functional\n    var existing = functional\n      ? options.render\n      : options.beforeCreate\n    if (!functional) {\n      // inject component registration as beforeCreate hook\n      options.beforeCreate = existing\n        ? [].concat(existing, hook)\n        : [hook]\n    } else {\n      // register for functioal component in vue file\n      options.render = function renderWithStyleInjection (h, context) {\n        hook.call(context)\n        return existing(h, context)\n      }\n    }\n  }\n\n  return {\n    esModule: esModule,\n    exports: scriptExports,\n    options: options\n  }\n}\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n  return _c('transition-group', {\n    staticStyle: {\n      \"position\": \"relative\"\n    },\n    attrs: {\n      \"tag\": _vm.tagName,\n      \"name\": \"lazy-component\"\n    },\n    on: {\n      \"before-enter\": function (el) { return _vm.$emit('before-enter', el); },\n      \"before-leave\": function (el) { return _vm.$emit('before-leave', el); },\n      \"after-enter\": function (el) { return _vm.$emit('after-enter', el); },\n      \"after-leave\": function (el) { return _vm.$emit('after-leave', el); }\n    }\n  }, [(_vm.isInit) ? _c('div', {\n    key: \"component\"\n  }, [_vm._t(\"default\", null, {\n    loading: _vm.loading\n  })], 2) : (_vm.$slots.skeleton) ? _c('div', {\n    key: \"skeleton\"\n  }, [_vm._t(\"skeleton\")], 2) : _c('div', {\n    key: \"loading\"\n  })])\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (false) {\n  module.hot.accept()\n  if (module.hot.data) {\n     require(\"vue-hot-reload-api\").rerender(\"data-v-175ab158\", module.exports)\n  }\n}\n\n/***/ })\n/******/ ]);\n});"]}