/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ anchor_location_bar; }
});

;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/anchor-location-bar/src/main.vue?vue&type=template&id=09035213&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "jdf-anchor-location-bar"
  }, [_c("ul", {
    staticClass: "operate-menu"
  }, [_vm._l(_vm.list, function (item, index) {
    return [item.isShow === undefined || item.isShow ? _c("li", {
      key: index,
      class: _vm.activeIndex === index ? "active" : ""
    }, [_c("div", {
      attrs: {
        title: item.label
      },
      on: {
        click: function click($event) {
          return _vm.jump(item.anchor, index);
        }
      }
    }, [_c("i", {
      class: item.icon
    }), _c("span", [_vm._v(_vm._s(item.label))])])]) : _vm._e()];
  })], 2)]);
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/anchor-location-bar/src/main.vue?vue&type=template&id=09035213&

;// CONCATENATED MODULE: external "lodash/findLastIndex"
var findLastIndex_namespaceObject = require("lodash/findLastIndex");
var findLastIndex_default = /*#__PURE__*/__webpack_require__.n(findLastIndex_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isEmpty"
var isEmpty_namespaceObject = require("lodash/isEmpty");
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_namespaceObject);
;// CONCATENATED MODULE: external "globalthis/implementation"
var implementation_namespaceObject = require("globalthis/implementation");
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/anchor-location-bar/src/main.vue?vue&type=script&lang=js&
// 引入全局变量



/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'JdfAnchorLocationBar',
  props: {
    // 操作列表
    list: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // 要滚动的domId
    domId: String
  },
  data: function data() {
    return {
      // 当前定位
      activeIndex: 0,
      // 锚点定位的各元素距顶部高度数组
      itemTabs: [],
      // 是否刚刚进行过跳转
      isJump: false,
      bodyHeightMut: 0
    };
  },
  created: function created() {
    // 监听滚动事件
    implementation_namespaceObject.window.addEventListener('scroll', this.onscroll);
  },
  methods: {
    loadElements: function loadElements() {
      var itemTabs = this.itemTabs;
      this.list.forEach(function (item, index) {
        var ele = implementation_namespaceObject.document.querySelector("#".concat(item.anchor));
        if (!ele) {
          return;
        }
        // eslint-disable-next-line no-nested-ternary
        var offsetTop = index === 0 ? 0 : ele.offsetTop - 40;
        itemTabs[index] !== offsetTop && (itemTabs[index] = offsetTop);
      });
    },
    /**
     * 点击鼠标跳到指定的dom
     */
    jump: function jump(anchor, index) {
      this.loadElements();
      // 当前激活的页签
      this.activeIndex = index;
      var scrollTop = this.itemTabs[index] - 30;
      if (this.domId) {
        implementation_namespaceObject.document.getElementById(this.domId).scrollTop = scrollTop;
      } else {
        implementation_namespaceObject.document.documentElement.scrollTop = scrollTop;
      }
      // 是否刚刚跳转状态为真
      this.isJump = true;
    },
    /**
     * 鼠标滚动时进行锚点定位.
     */
    onscroll: function onscroll() {
      var _window$scrollY;
      if (isEmpty_default()(this.itemTabs)) {
        this.loadElements();
      }
      // 当前滚动条据顶部距离
      var top = (_window$scrollY = implementation_namespaceObject.window.scrollY) !== null && _window$scrollY !== void 0 ? _window$scrollY : implementation_namespaceObject.window.pageYOffset;
      // 获取当前激活的页签 如果刚刚跳转过就不再更改激活页签
      this.activeIndex = this.isJump ? this.activeIndex : findLastIndex_default()(this.itemTabs, function (it) {
        return top >= it - 30;
      });
      // 更改跳转状态
      this.isJump = false;
    }
  }
});
;// CONCATENATED MODULE: ./packages/anchor-location-bar/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/anchor-location-bar/src/main.vue





/* normalize component */
;
var component = normalizeComponent(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var main = (component.exports);
;// CONCATENATED MODULE: ./packages/anchor-location-bar/index.js

main.install = function (Vue) {
  Vue.component(main.name, main);
};
/* harmony default export */ var anchor_location_bar = (main);
module.exports = __webpack_exports__;
/******/ })()
;