New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

blinguidance

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blinguidance - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

src/utils/index.js

2

package.json
{
"name": "blinguidance",
"version": "1.0.8",
"version": "1.0.9",
"description": "guidance",

@@ -5,0 +5,0 @@ "main": "src/lib/guidance.umd.min.js",

@@ -532,11 +532,15 @@

function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");
function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
_classCheckPrivateStaticAccess(receiver, classConstructor);
_classCheckPrivateStaticFieldDescriptor(descriptor, "get");
return _classApplyDescriptorGet(receiver, descriptor);
}
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set");
function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
_classCheckPrivateStaticAccess(receiver, classConstructor);
_classCheckPrivateStaticFieldDescriptor(descriptor, "set");
_classApplyDescriptorSet(receiver, descriptor, value);

@@ -547,10 +551,2 @@

function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
function _classApplyDescriptorGet(receiver, descriptor) {

@@ -576,2 +572,14 @@ if (descriptor.get) {

function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
function _classPrivateMethodGet(receiver, privateSet, fn) {

@@ -591,8 +599,2 @@ if (!privateSet.has(receiver)) {

function _classPrivateFieldInitSpec(obj, privateMap, value) {
_checkPrivateRedeclaration(obj, privateMap);
privateMap.set(obj, value);
}
function _classPrivateMethodInitSpec(obj, privateSet) {

@@ -604,4 +606,2 @@ _checkPrivateRedeclaration(obj, privateSet);

var _Symbol$iterator;
// 给元素添加样式

@@ -622,7 +622,6 @@ function elementWithStyle(tag, styles) {

var domStylesMap$1 = new Map(); // 样式重置
var domStylesMap = new Map(); // 样式重置
function resetStyle() {
var _iterator = _createForOfIteratorHelper(domStylesMap),
var _iterator = _createForOfIteratorHelper(domStylesMap$1),
_step;

@@ -650,7 +649,6 @@

function addRelactive(target) {
var position = getComputedStyle(target).position;
var zIndex = getComputedStyle(target).zIndex;
domStylesMap.set(target, {
domStylesMap$1.set(target, {
position: position,

@@ -667,6 +665,4 @@ zIndex: zIndex

function getElementTopOrLeft(el, key) {
if (el.offsetParent) {
console.log(el.offsetParent);
return getElementTopOrLeft(el.offsetParent, key) + el[key];

@@ -678,3 +674,2 @@ }

function getElementTopAndLeft(selector) {

@@ -685,3 +680,2 @@ var target = document.querySelector(selector);

var offsetLeft = getElementTopOrLeft(target, 'offsetLeft');
console.log(offsetLeft, offsetTop);
var clientHeight = target.clientHeight,

@@ -692,3 +686,2 @@ clientWidth = target.clientWidth;

function debounce(func) {

@@ -700,3 +693,3 @@ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;

return function () {
var _this2 = this;
var _this = this;

@@ -713,3 +706,3 @@ for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {

timer = setTimeout(function () {
func.apply(_this2, arg);
func.apply(_this, arg);
timer = null;

@@ -722,3 +715,2 @@ invoke = false;

function scrollToTop(target) {

@@ -731,3 +723,3 @@ window.scrollTo({

var _isCreate = /*#__PURE__*/new WeakMap();
var _Symbol$iterator;

@@ -764,7 +756,2 @@ var _setPosition = /*#__PURE__*/new WeakSet();

_classPrivateFieldInitSpec(this, _isCreate, {
writable: true,
value: false
});
var flow = options.flow,

@@ -786,3 +773,4 @@ _options$btns = options.btns,

zIndex: '99'
}); // showBoxStyle
});
this.mask.id = 'blinMask'; // showBoxStyle

@@ -813,8 +801,6 @@ this.showBox = elementWithStyle('div', {

value: function insert(next, end) {
if (_classPrivateFieldGet(this, _isCreate)) return;
if (_classStaticPrivateFieldSpecGet(Guidance, Guidance, _instance)) return _classStaticPrivateFieldSpecGet(Guidance, Guidance, _instance);
_classPrivateFieldSet(this, _isCreate, true);
var guidanceGenerator = /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_this) {
var _iterator2, _step2, styles;
var _iterator, _step, styles;

@@ -825,2 +811,10 @@ return _regeneratorRuntime().wrap(function _callee$(_context) {

case 0:
if (!document.getElementById('blinMask')) {
_context.next = 2;
break;
}
return _context.abrupt("return");
case 2:
document.body.appendChild(_this.mask);

@@ -837,17 +831,17 @@ document.body.appendChild(_this.showBox);

_this.endBtn.onclick = end;
_iterator2 = _createForOfIteratorHelper(_this.flow);
_context.prev = 8;
_iterator = _createForOfIteratorHelper(_this.flow);
_context.prev = 10;
_iterator2.s();
_iterator.s();
case 10:
if ((_step2 = _iterator2.n()).done) {
_context.next = 23;
case 12:
if ((_step = _iterator.n()).done) {
_context.next = 25;
break;
}
styles = _step2.value;
styles = _step.value;
if (styles.target) {
_context.next = 14;
_context.next = 16;
break;

@@ -858,3 +852,3 @@ }

case 14:
case 16:
_this.currentStyle = styles;

@@ -867,27 +861,27 @@ resetStyle();

elementWithStyle(_this.endBtn, styles.end);
_context.next = 21;
_context.next = 23;
return;
case 21:
_context.next = 10;
break;
case 23:
_context.next = 28;
_context.next = 12;
break;
case 25:
_context.prev = 25;
_context.t0 = _context["catch"](8);
_context.next = 30;
break;
_iterator2.e(_context.t0);
case 27:
_context.prev = 27;
_context.t0 = _context["catch"](10);
case 28:
_context.prev = 28;
_iterator.e(_context.t0);
_iterator2.f();
case 30:
_context.prev = 30;
return _context.finish(28);
_iterator.f();
case 31:
return _context.finish(30);
case 33:
case "end":

@@ -897,6 +891,9 @@ return _context.stop();

}
}, _callee, null, [[8, 25, 28, 31]]);
}, _callee, null, [[10, 27, 30, 33]]);
})(this);
guidanceGenerator.end = _classPrivateMethodGet(this, _end, _end2).bind(this);
_classStaticPrivateFieldSpecSet(Guidance, Guidance, _instance, guidanceGenerator);
return guidanceGenerator;

@@ -1029,6 +1026,6 @@ }

function _listenerResize2() {
var _this3 = this;
var _this2 = this;
this.resize = debounce(function () {
_classPrivateMethodGet(_this3, _setShowBoxStyle, _setShowBoxStyle2).call(_this3, _this3.currentStyle);
_classPrivateMethodGet(_this2, _setShowBoxStyle, _setShowBoxStyle2).call(_this2, _this2.currentStyle);
});

@@ -1055,2 +1052,7 @@ window.addEventListener('resize', this.resize);

var _instance = {
writable: true,
value: null
};
module.exports = Guidance;
"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(j([])));g&&g!==e&&n.call(g,i)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=d,u(m,"constructor",d),u(d,"constructor",p),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function l(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,s(t,e,"set"),r),r}function s(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function f(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p(t,e){h(t,e),e.add(t)}var d;function y(t,e){var r=t;for(var n in"string"==typeof t&&(r=document.createElement(t)),e)r.style[n]=e[n];return r}var v=new Map;function g(){var t,r=u(v);try{for(r.s();!(t=r.n()).done;){var n=i(t.value,2),o=n[0],a=n[1];o.style=e(e({},o.style),a)}}catch(t){r.e(t)}finally{r.f()}}function m(t,e){return t.offsetParent?(console.log(t.offsetParent),m(t.offsetParent,e)+t[e]):t[e]||0}function w(t){var e=document.querySelector(t);!function(t){var e=getComputedStyle(t).position,r=getComputedStyle(t).zIndex;v.set(t,{position:e,zIndex:r}),"static"===e&&(t.style.position="relative"),t.style.zIndex="9999"}(e);var r=m(e,"offsetTop"),n=m(e,"offsetLeft");return console.log(n,r),[r+"px",n+"px",e.clientHeight+"px",e.clientWidth+"px"]}function b(t){window.scrollTo({top:t,behavior:"smooth"})}var x=new WeakMap,L=new WeakSet,E=new WeakSet,O=new WeakSet,j=new WeakSet,k=new WeakSet;d=Symbol.iterator;var S=function(){function t(r){var n,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,k),p(this,j),p(this,O),p(this,E),p(this,L),i={writable:!0,value:!1},h(n=this,o=x),o.set(n,i);var a=r.flow,c=r.btns,u=void 0===c?{next:{},end:{}}:c;this.flow=a,this.innerHeight=window.innerHeight,this.mask=y("div",{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0,0,0,.5)",zIndex:"99"}),this.showBox=y("div",{position:"absolute",zIndex:"999",backgroundSize:"100% 100%",transition:"all 0.3s ease-in-out"});var l={cursor:"pointer",position:"absolute",display:"fixed",textAlign:"center"};this.nextBtn=y("div",e(e({},u.next),l)),this.nextBtn.innerHTML=u.next.content,this.endBtn=y("div",e(e({},u.end),{},{cursor:"pointer"},l)),this.endBtn.innerHTML=u.end.content}var o,i,a;return o=t,a=[{key:"create",value:function(e){var r=new t(e);return r.insert.bind(r)}}],(i=[{key:"insert",value:function(t,e){if(!function(t,e){return e.get?e.get.call(t):e.value}(n=this,s(n,x,"get"))){var n;l(this,x,!0);var o=r().mark((function n(o){var i,a,c;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:document.body.appendChild(o.mask),document.body.appendChild(o.showBox),f(o,O,B).call(o),o.showBox.appendChild(o.nextBtn),o.showBox.appendChild(o.endBtn),o.nextBtn.onclick=t,o.endBtn.onclick=e,i=u(o.flow),r.prev=8,i.s();case 10:if((a=i.n()).done){r.next=23;break}if((c=a.value).target){r.next=14;break}throw new Error("Target is not passed in");case 14:return o.currentStyle=c,g(),f(o,E,T).call(o,c),y(o.nextBtn,c.next),y(o.endBtn,c.end),void(r.next=21);case 21:r.next=10;break;case 23:r.next=28;break;case 25:r.prev=25,r.t0=r.catch(8),i.e(r.t0);case 28:return r.prev=28,i.f(),r.finish(28);case 31:case"end":return r.stop()}}),n,null,[[8,25,28,31]])}))(this);return o.end=f(this,k,C).bind(this),o}}},{key:d,value:r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.flow,"t0",1);case 1:case"end":return t.stop()}}),t,this)}))}])&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}();function F(t,r){r.adjustment||(r.adjustment={});var n=r.adjustment,o=n.top,i=void 0===o?0:o,a=n.left,c=void 0===a?0:a;if(!t)return e(e({},r),{},{left:parseFloat(r.left)-parseFloat(r.width)+parseFloat(r.targetWidth)+"px"});var u={xLeft:parseFloat(r.left)-parseFloat(r.width)+c+"px",xRight:parseFloat(r.left)+parseFloat(r.targetWidth)+c+"px",xCenter:parseFloat(r.left)-parseFloat(r.width)/2+parseFloat(r.targetWidth)/2+c+"px",yTop:parseFloat(r.top)-parseFloat(r.height)+i+"px",yBottom:parseFloat(r.top)+parseFloat(r.targetHeight)+i+"px",yCenter:parseFloat(r.top)-parseFloat(r.height)/2+parseFloat(r.targetHeight)/2+i+"px"};switch(t){case"top":return e(e({},r),{},{top:u.yTop,left:u.xCenter});case"right":return e(e({},r),{},{left:u.xRight,top:u.yCenter});case"bottom":return e(e({},r),{},{top:u.yBottom,left:u.xCenter});case"left":return e(e({},r),{},{left:u.xLeft,top:u.yCenter});case"topLeft":return e(e({},r),{},{left:u.xLeft,top:u.yTop});case"topRight":return e(e({},r),{},{left:u.xRight,top:u.yTop});case"bottomLeft":return e(e({},r),{},{left:u.xLeft,top:u.yBottom});case"bottomRight":return e(e({},r),{},{left:u.xRight,top:u.yBottom})}}function T(t){var r=i(w(t.target),4),n=r[0],o=r[1],a=r[2],c=r[3];f(this,j,P).call(this,n,a);var u=f(this,L,F).call(this,t.placement,e(e({},t),{},{top:n,left:o,targetWidth:c,targetHeight:a}));y(this.showBox,u)}function B(){var t=this;this.resize=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return function(){for(var i=this,a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];n&&!o?(t.apply(this,c),o=!0):(e&&clearTimeout(e),e=setTimeout((function(){t.apply(i,c),e=null,o=!1}),r))}}((function(){f(t,E,T).call(t,t.currentStyle)})),window.addEventListener("resize",this.resize)}function P(t,e){b(parseFloat(t)+parseFloat(e)/2-this.innerHeight/2)}function C(){b(0),document.body.removeChild(this.mask),document.body.removeChild(this.showBox),this.mask=null,this.showBox=null,g(),v=null,window.removeEventListener("resize",this.resize)}module.exports=S;
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(O([])));g&&g!==e&&n.call(g,i)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=d,u(m,"constructor",d),u(d,"constructor",p),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function l(t,e,r){return f(t,e),h(r,"get"),function(t,e){if(e.get)return e.get.call(t);return e.value}(t,r)}function s(t,e,r,n){return f(t,e),h(r,"set"),function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,r,n),n}function f(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}function h(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function p(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function d(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function y(t,e){var r=t;for(var n in"string"==typeof t&&(r=document.createElement(t)),e)r.style[n]=e[n];return r}var v,g=new Map;function m(){var t,r=u(g);try{for(r.s();!(t=r.n()).done;){var n=i(t.value,2),o=n[0],a=n[1];o.style=e(e({},o.style),a)}}catch(t){r.e(t)}finally{r.f()}}function w(t,e){return t.offsetParent?w(t.offsetParent,e)+t[e]:t[e]||0}function b(t){var e=document.querySelector(t);return function(t){var e=getComputedStyle(t).position,r=getComputedStyle(t).zIndex;g.set(t,{position:e,zIndex:r}),"static"===e&&(t.style.position="relative"),t.style.zIndex="9999"}(e),[w(e,"offsetTop")+"px",w(e,"offsetLeft")+"px",e.clientHeight+"px",e.clientWidth+"px"]}function x(t){window.scrollTo({top:t,behavior:"smooth"})}var L=new WeakSet,E=new WeakSet,k=new WeakSet,O=new WeakSet,j=new WeakSet;v=Symbol.iterator;var S=function(){function t(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,j),d(this,O),d(this,k),d(this,E),d(this,L);var n=r.flow,o=r.btns,i=void 0===o?{next:{},end:{}}:o;this.flow=n,this.innerHeight=window.innerHeight,this.mask=y("div",{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0,0,0,.5)",zIndex:"99"}),this.mask.id="blinMask",this.showBox=y("div",{position:"absolute",zIndex:"999",backgroundSize:"100% 100%",transition:"all 0.3s ease-in-out"});var a={cursor:"pointer",position:"absolute",display:"fixed",textAlign:"center"};this.nextBtn=y("div",e(e({},i.next),a)),this.nextBtn.innerHTML=i.next.content,this.endBtn=y("div",e(e({},i.end),{},{cursor:"pointer"},a)),this.endBtn.innerHTML=i.end.content}var o,i,a;return o=t,a=[{key:"create",value:function(e){var r=new t(e);return r.insert.bind(r)}}],(i=[{key:"insert",value:function(e,n){if(l(t,t,_))return l(t,t,_);var o=r().mark((function t(o){var i,a,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!document.getElementById("blinMask")){t.next=2;break}return t.abrupt("return");case 2:document.body.appendChild(o.mask),document.body.appendChild(o.showBox),p(o,k,B).call(o),o.showBox.appendChild(o.nextBtn),o.showBox.appendChild(o.endBtn),o.nextBtn.onclick=e,o.endBtn.onclick=n,i=u(o.flow),t.prev=10,i.s();case 12:if((a=i.n()).done){t.next=25;break}if((c=a.value).target){t.next=16;break}throw new Error("Target is not passed in");case 16:return o.currentStyle=c,m(),p(o,E,T).call(o,c),y(o.nextBtn,c.next),y(o.endBtn,c.end),void(t.next=23);case 23:t.next=12;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(10),i.e(t.t0);case 30:return t.prev=30,i.f(),t.finish(30);case 33:case"end":return t.stop()}}),t,null,[[10,27,30,33]])}))(this);return o.end=p(this,j,C).bind(this),s(t,t,_,o),o}},{key:v,value:r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.flow,"t0",1);case 1:case"end":return t.stop()}}),t,this)}))}])&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}();function F(t,r){r.adjustment||(r.adjustment={});var n=r.adjustment,o=n.top,i=void 0===o?0:o,a=n.left,c=void 0===a?0:a;if(!t)return e(e({},r),{},{left:parseFloat(r.left)-parseFloat(r.width)+parseFloat(r.targetWidth)+"px"});var u={xLeft:parseFloat(r.left)-parseFloat(r.width)+c+"px",xRight:parseFloat(r.left)+parseFloat(r.targetWidth)+c+"px",xCenter:parseFloat(r.left)-parseFloat(r.width)/2+parseFloat(r.targetWidth)/2+c+"px",yTop:parseFloat(r.top)-parseFloat(r.height)+i+"px",yBottom:parseFloat(r.top)+parseFloat(r.targetHeight)+i+"px",yCenter:parseFloat(r.top)-parseFloat(r.height)/2+parseFloat(r.targetHeight)/2+i+"px"};switch(t){case"top":return e(e({},r),{},{top:u.yTop,left:u.xCenter});case"right":return e(e({},r),{},{left:u.xRight,top:u.yCenter});case"bottom":return e(e({},r),{},{top:u.yBottom,left:u.xCenter});case"left":return e(e({},r),{},{left:u.xLeft,top:u.yCenter});case"topLeft":return e(e({},r),{},{left:u.xLeft,top:u.yTop});case"topRight":return e(e({},r),{},{left:u.xRight,top:u.yTop});case"bottomLeft":return e(e({},r),{},{left:u.xLeft,top:u.yBottom});case"bottomRight":return e(e({},r),{},{left:u.xRight,top:u.yBottom})}}function T(t){var r=i(b(t.target),4),n=r[0],o=r[1],a=r[2],c=r[3];p(this,O,P).call(this,n,a);var u=p(this,L,F).call(this,t.placement,e(e({},t),{},{top:n,left:o,targetWidth:c,targetHeight:a}));y(this.showBox,u)}function B(){var t=this;this.resize=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return function(){for(var i=this,a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];n&&!o?(t.apply(this,c),o=!0):(e&&clearTimeout(e),e=setTimeout((function(){t.apply(i,c),e=null,o=!1}),r))}}((function(){p(t,E,T).call(t,t.currentStyle)})),window.addEventListener("resize",this.resize)}function P(t,e){x(parseFloat(t)+parseFloat(e)/2-this.innerHeight/2)}function C(){x(0),document.body.removeChild(this.mask),document.body.removeChild(this.showBox),this.mask=null,this.showBox=null,m(),domStylesMap=null,window.removeEventListener("resize",this.resize)}var _={writable:!0,value:null};module.exports=S;

@@ -530,11 +530,15 @@

function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");
function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
_classCheckPrivateStaticAccess(receiver, classConstructor);
_classCheckPrivateStaticFieldDescriptor(descriptor, "get");
return _classApplyDescriptorGet(receiver, descriptor);
}
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set");
function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
_classCheckPrivateStaticAccess(receiver, classConstructor);
_classCheckPrivateStaticFieldDescriptor(descriptor, "set");
_classApplyDescriptorSet(receiver, descriptor, value);

@@ -545,10 +549,2 @@

function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
function _classApplyDescriptorGet(receiver, descriptor) {

@@ -574,2 +570,14 @@ if (descriptor.get) {

function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
function _classPrivateMethodGet(receiver, privateSet, fn) {

@@ -589,8 +597,2 @@ if (!privateSet.has(receiver)) {

function _classPrivateFieldInitSpec(obj, privateMap, value) {
_checkPrivateRedeclaration(obj, privateMap);
privateMap.set(obj, value);
}
function _classPrivateMethodInitSpec(obj, privateSet) {

@@ -602,4 +604,2 @@ _checkPrivateRedeclaration(obj, privateSet);

var _Symbol$iterator;
// 给元素添加样式

@@ -620,7 +620,6 @@ function elementWithStyle(tag, styles) {

var domStylesMap$1 = new Map(); // 样式重置
var domStylesMap = new Map(); // 样式重置
function resetStyle() {
var _iterator = _createForOfIteratorHelper(domStylesMap),
var _iterator = _createForOfIteratorHelper(domStylesMap$1),
_step;

@@ -648,7 +647,6 @@

function addRelactive(target) {
var position = getComputedStyle(target).position;
var zIndex = getComputedStyle(target).zIndex;
domStylesMap.set(target, {
domStylesMap$1.set(target, {
position: position,

@@ -665,6 +663,4 @@ zIndex: zIndex

function getElementTopOrLeft(el, key) {
if (el.offsetParent) {
console.log(el.offsetParent);
return getElementTopOrLeft(el.offsetParent, key) + el[key];

@@ -676,3 +672,2 @@ }

function getElementTopAndLeft(selector) {

@@ -683,3 +678,2 @@ var target = document.querySelector(selector);

var offsetLeft = getElementTopOrLeft(target, 'offsetLeft');
console.log(offsetLeft, offsetTop);
var clientHeight = target.clientHeight,

@@ -690,3 +684,2 @@ clientWidth = target.clientWidth;

function debounce(func) {

@@ -698,3 +691,3 @@ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;

return function () {
var _this2 = this;
var _this = this;

@@ -711,3 +704,3 @@ for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {

timer = setTimeout(function () {
func.apply(_this2, arg);
func.apply(_this, arg);
timer = null;

@@ -720,3 +713,2 @@ invoke = false;

function scrollToTop(target) {

@@ -729,3 +721,3 @@ window.scrollTo({

var _isCreate = /*#__PURE__*/new WeakMap();
var _Symbol$iterator;

@@ -762,7 +754,2 @@ var _setPosition = /*#__PURE__*/new WeakSet();

_classPrivateFieldInitSpec(this, _isCreate, {
writable: true,
value: false
});
var flow = options.flow,

@@ -784,3 +771,4 @@ _options$btns = options.btns,

zIndex: '99'
}); // showBoxStyle
});
this.mask.id = 'blinMask'; // showBoxStyle

@@ -811,8 +799,6 @@ this.showBox = elementWithStyle('div', {

value: function insert(next, end) {
if (_classPrivateFieldGet(this, _isCreate)) return;
if (_classStaticPrivateFieldSpecGet(Guidance, Guidance, _instance)) return _classStaticPrivateFieldSpecGet(Guidance, Guidance, _instance);
_classPrivateFieldSet(this, _isCreate, true);
var guidanceGenerator = /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_this) {
var _iterator2, _step2, styles;
var _iterator, _step, styles;

@@ -823,2 +809,10 @@ return _regeneratorRuntime().wrap(function _callee$(_context) {

case 0:
if (!document.getElementById('blinMask')) {
_context.next = 2;
break;
}
return _context.abrupt("return");
case 2:
document.body.appendChild(_this.mask);

@@ -835,17 +829,17 @@ document.body.appendChild(_this.showBox);

_this.endBtn.onclick = end;
_iterator2 = _createForOfIteratorHelper(_this.flow);
_context.prev = 8;
_iterator = _createForOfIteratorHelper(_this.flow);
_context.prev = 10;
_iterator2.s();
_iterator.s();
case 10:
if ((_step2 = _iterator2.n()).done) {
_context.next = 23;
case 12:
if ((_step = _iterator.n()).done) {
_context.next = 25;
break;
}
styles = _step2.value;
styles = _step.value;
if (styles.target) {
_context.next = 14;
_context.next = 16;
break;

@@ -856,3 +850,3 @@ }

case 14:
case 16:
_this.currentStyle = styles;

@@ -865,27 +859,27 @@ resetStyle();

elementWithStyle(_this.endBtn, styles.end);
_context.next = 21;
_context.next = 23;
return;
case 21:
_context.next = 10;
break;
case 23:
_context.next = 28;
_context.next = 12;
break;
case 25:
_context.prev = 25;
_context.t0 = _context["catch"](8);
_context.next = 30;
break;
_iterator2.e(_context.t0);
case 27:
_context.prev = 27;
_context.t0 = _context["catch"](10);
case 28:
_context.prev = 28;
_iterator.e(_context.t0);
_iterator2.f();
case 30:
_context.prev = 30;
return _context.finish(28);
_iterator.f();
case 31:
return _context.finish(30);
case 33:
case "end":

@@ -895,6 +889,9 @@ return _context.stop();

}
}, _callee, null, [[8, 25, 28, 31]]);
}, _callee, null, [[10, 27, 30, 33]]);
})(this);
guidanceGenerator.end = _classPrivateMethodGet(this, _end, _end2).bind(this);
_classStaticPrivateFieldSpecSet(Guidance, Guidance, _instance, guidanceGenerator);
return guidanceGenerator;

@@ -1027,6 +1024,6 @@ }

function _listenerResize2() {
var _this3 = this;
var _this2 = this;
this.resize = debounce(function () {
_classPrivateMethodGet(_this3, _setShowBoxStyle, _setShowBoxStyle2).call(_this3, _this3.currentStyle);
_classPrivateMethodGet(_this2, _setShowBoxStyle, _setShowBoxStyle2).call(_this2, _this2.currentStyle);
});

@@ -1053,2 +1050,7 @@ window.addEventListener('resize', this.resize);

var _instance = {
writable: true,
value: null
};
export { Guidance as default };
function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(j([])));g&&g!==e&&n.call(g,i)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=d,u(m,"constructor",d),u(d,"constructor",p),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function l(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,s(t,e,"set"),r),r}function s(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function f(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p(t,e){h(t,e),e.add(t)}var d;function y(t,e){var r=t;for(var n in"string"==typeof t&&(r=document.createElement(t)),e)r.style[n]=e[n];return r}var v=new Map;function g(){var t,r=u(v);try{for(r.s();!(t=r.n()).done;){var n=i(t.value,2),o=n[0],a=n[1];o.style=e(e({},o.style),a)}}catch(t){r.e(t)}finally{r.f()}}function m(t,e){return t.offsetParent?(console.log(t.offsetParent),m(t.offsetParent,e)+t[e]):t[e]||0}function w(t){var e=document.querySelector(t);!function(t){var e=getComputedStyle(t).position,r=getComputedStyle(t).zIndex;v.set(t,{position:e,zIndex:r}),"static"===e&&(t.style.position="relative"),t.style.zIndex="9999"}(e);var r=m(e,"offsetTop"),n=m(e,"offsetLeft");return console.log(n,r),[r+"px",n+"px",e.clientHeight+"px",e.clientWidth+"px"]}function b(t){window.scrollTo({top:t,behavior:"smooth"})}var x=new WeakMap,L=new WeakSet,E=new WeakSet,O=new WeakSet,j=new WeakSet,k=new WeakSet;d=Symbol.iterator;var S=function(){function t(r){var n,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,k),p(this,j),p(this,O),p(this,E),p(this,L),i={writable:!0,value:!1},h(n=this,o=x),o.set(n,i);var a=r.flow,c=r.btns,u=void 0===c?{next:{},end:{}}:c;this.flow=a,this.innerHeight=window.innerHeight,this.mask=y("div",{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0,0,0,.5)",zIndex:"99"}),this.showBox=y("div",{position:"absolute",zIndex:"999",backgroundSize:"100% 100%",transition:"all 0.3s ease-in-out"});var l={cursor:"pointer",position:"absolute",display:"fixed",textAlign:"center"};this.nextBtn=y("div",e(e({},u.next),l)),this.nextBtn.innerHTML=u.next.content,this.endBtn=y("div",e(e({},u.end),{},{cursor:"pointer"},l)),this.endBtn.innerHTML=u.end.content}var o,i,a;return o=t,a=[{key:"create",value:function(e){var r=new t(e);return r.insert.bind(r)}}],(i=[{key:"insert",value:function(t,e){if(!function(t,e){return e.get?e.get.call(t):e.value}(n=this,s(n,x,"get"))){var n;l(this,x,!0);var o=r().mark((function n(o){var i,a,c;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:document.body.appendChild(o.mask),document.body.appendChild(o.showBox),f(o,O,B).call(o),o.showBox.appendChild(o.nextBtn),o.showBox.appendChild(o.endBtn),o.nextBtn.onclick=t,o.endBtn.onclick=e,i=u(o.flow),r.prev=8,i.s();case 10:if((a=i.n()).done){r.next=23;break}if((c=a.value).target){r.next=14;break}throw new Error("Target is not passed in");case 14:return o.currentStyle=c,g(),f(o,E,T).call(o,c),y(o.nextBtn,c.next),y(o.endBtn,c.end),void(r.next=21);case 21:r.next=10;break;case 23:r.next=28;break;case 25:r.prev=25,r.t0=r.catch(8),i.e(r.t0);case 28:return r.prev=28,i.f(),r.finish(28);case 31:case"end":return r.stop()}}),n,null,[[8,25,28,31]])}))(this);return o.end=f(this,k,C).bind(this),o}}},{key:d,value:r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.flow,"t0",1);case 1:case"end":return t.stop()}}),t,this)}))}])&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}();function F(t,r){r.adjustment||(r.adjustment={});var n=r.adjustment,o=n.top,i=void 0===o?0:o,a=n.left,c=void 0===a?0:a;if(!t)return e(e({},r),{},{left:parseFloat(r.left)-parseFloat(r.width)+parseFloat(r.targetWidth)+"px"});var u={xLeft:parseFloat(r.left)-parseFloat(r.width)+c+"px",xRight:parseFloat(r.left)+parseFloat(r.targetWidth)+c+"px",xCenter:parseFloat(r.left)-parseFloat(r.width)/2+parseFloat(r.targetWidth)/2+c+"px",yTop:parseFloat(r.top)-parseFloat(r.height)+i+"px",yBottom:parseFloat(r.top)+parseFloat(r.targetHeight)+i+"px",yCenter:parseFloat(r.top)-parseFloat(r.height)/2+parseFloat(r.targetHeight)/2+i+"px"};switch(t){case"top":return e(e({},r),{},{top:u.yTop,left:u.xCenter});case"right":return e(e({},r),{},{left:u.xRight,top:u.yCenter});case"bottom":return e(e({},r),{},{top:u.yBottom,left:u.xCenter});case"left":return e(e({},r),{},{left:u.xLeft,top:u.yCenter});case"topLeft":return e(e({},r),{},{left:u.xLeft,top:u.yTop});case"topRight":return e(e({},r),{},{left:u.xRight,top:u.yTop});case"bottomLeft":return e(e({},r),{},{left:u.xLeft,top:u.yBottom});case"bottomRight":return e(e({},r),{},{left:u.xRight,top:u.yBottom})}}function T(t){var r=i(w(t.target),4),n=r[0],o=r[1],a=r[2],c=r[3];f(this,j,P).call(this,n,a);var u=f(this,L,F).call(this,t.placement,e(e({},t),{},{top:n,left:o,targetWidth:c,targetHeight:a}));y(this.showBox,u)}function B(){var t=this;this.resize=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return function(){for(var i=this,a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];n&&!o?(t.apply(this,c),o=!0):(e&&clearTimeout(e),e=setTimeout((function(){t.apply(i,c),e=null,o=!1}),r))}}((function(){f(t,E,T).call(t,t.currentStyle)})),window.addEventListener("resize",this.resize)}function P(t,e){b(parseFloat(t)+parseFloat(e)/2-this.innerHeight/2)}function C(){b(0),document.body.removeChild(this.mask),document.body.removeChild(this.showBox),this.mask=null,this.showBox=null,g(),v=null,window.removeEventListener("resize",this.resize)}export{S as default};
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(O([])));g&&g!==e&&n.call(g,i)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=d,u(m,"constructor",d),u(d,"constructor",p),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function l(t,e,r){return f(t,e),h(r,"get"),function(t,e){if(e.get)return e.get.call(t);return e.value}(t,r)}function s(t,e,r,n){return f(t,e),h(r,"set"),function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,r,n),n}function f(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}function h(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function p(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function d(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function y(t,e){var r=t;for(var n in"string"==typeof t&&(r=document.createElement(t)),e)r.style[n]=e[n];return r}var v,g=new Map;function m(){var t,r=u(g);try{for(r.s();!(t=r.n()).done;){var n=i(t.value,2),o=n[0],a=n[1];o.style=e(e({},o.style),a)}}catch(t){r.e(t)}finally{r.f()}}function w(t,e){return t.offsetParent?w(t.offsetParent,e)+t[e]:t[e]||0}function b(t){var e=document.querySelector(t);return function(t){var e=getComputedStyle(t).position,r=getComputedStyle(t).zIndex;g.set(t,{position:e,zIndex:r}),"static"===e&&(t.style.position="relative"),t.style.zIndex="9999"}(e),[w(e,"offsetTop")+"px",w(e,"offsetLeft")+"px",e.clientHeight+"px",e.clientWidth+"px"]}function x(t){window.scrollTo({top:t,behavior:"smooth"})}var L=new WeakSet,E=new WeakSet,k=new WeakSet,O=new WeakSet,j=new WeakSet;v=Symbol.iterator;var S=function(){function t(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,j),d(this,O),d(this,k),d(this,E),d(this,L);var n=r.flow,o=r.btns,i=void 0===o?{next:{},end:{}}:o;this.flow=n,this.innerHeight=window.innerHeight,this.mask=y("div",{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0,0,0,.5)",zIndex:"99"}),this.mask.id="blinMask",this.showBox=y("div",{position:"absolute",zIndex:"999",backgroundSize:"100% 100%",transition:"all 0.3s ease-in-out"});var a={cursor:"pointer",position:"absolute",display:"fixed",textAlign:"center"};this.nextBtn=y("div",e(e({},i.next),a)),this.nextBtn.innerHTML=i.next.content,this.endBtn=y("div",e(e({},i.end),{},{cursor:"pointer"},a)),this.endBtn.innerHTML=i.end.content}var o,i,a;return o=t,a=[{key:"create",value:function(e){var r=new t(e);return r.insert.bind(r)}}],(i=[{key:"insert",value:function(e,n){if(l(t,t,_))return l(t,t,_);var o=r().mark((function t(o){var i,a,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!document.getElementById("blinMask")){t.next=2;break}return t.abrupt("return");case 2:document.body.appendChild(o.mask),document.body.appendChild(o.showBox),p(o,k,B).call(o),o.showBox.appendChild(o.nextBtn),o.showBox.appendChild(o.endBtn),o.nextBtn.onclick=e,o.endBtn.onclick=n,i=u(o.flow),t.prev=10,i.s();case 12:if((a=i.n()).done){t.next=25;break}if((c=a.value).target){t.next=16;break}throw new Error("Target is not passed in");case 16:return o.currentStyle=c,m(),p(o,E,T).call(o,c),y(o.nextBtn,c.next),y(o.endBtn,c.end),void(t.next=23);case 23:t.next=12;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(10),i.e(t.t0);case 30:return t.prev=30,i.f(),t.finish(30);case 33:case"end":return t.stop()}}),t,null,[[10,27,30,33]])}))(this);return o.end=p(this,j,C).bind(this),s(t,t,_,o),o}},{key:v,value:r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.flow,"t0",1);case 1:case"end":return t.stop()}}),t,this)}))}])&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}();function F(t,r){r.adjustment||(r.adjustment={});var n=r.adjustment,o=n.top,i=void 0===o?0:o,a=n.left,c=void 0===a?0:a;if(!t)return e(e({},r),{},{left:parseFloat(r.left)-parseFloat(r.width)+parseFloat(r.targetWidth)+"px"});var u={xLeft:parseFloat(r.left)-parseFloat(r.width)+c+"px",xRight:parseFloat(r.left)+parseFloat(r.targetWidth)+c+"px",xCenter:parseFloat(r.left)-parseFloat(r.width)/2+parseFloat(r.targetWidth)/2+c+"px",yTop:parseFloat(r.top)-parseFloat(r.height)+i+"px",yBottom:parseFloat(r.top)+parseFloat(r.targetHeight)+i+"px",yCenter:parseFloat(r.top)-parseFloat(r.height)/2+parseFloat(r.targetHeight)/2+i+"px"};switch(t){case"top":return e(e({},r),{},{top:u.yTop,left:u.xCenter});case"right":return e(e({},r),{},{left:u.xRight,top:u.yCenter});case"bottom":return e(e({},r),{},{top:u.yBottom,left:u.xCenter});case"left":return e(e({},r),{},{left:u.xLeft,top:u.yCenter});case"topLeft":return e(e({},r),{},{left:u.xLeft,top:u.yTop});case"topRight":return e(e({},r),{},{left:u.xRight,top:u.yTop});case"bottomLeft":return e(e({},r),{},{left:u.xLeft,top:u.yBottom});case"bottomRight":return e(e({},r),{},{left:u.xRight,top:u.yBottom})}}function T(t){var r=i(b(t.target),4),n=r[0],o=r[1],a=r[2],c=r[3];p(this,O,P).call(this,n,a);var u=p(this,L,F).call(this,t.placement,e(e({},t),{},{top:n,left:o,targetWidth:c,targetHeight:a}));y(this.showBox,u)}function B(){var t=this;this.resize=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return function(){for(var i=this,a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];n&&!o?(t.apply(this,c),o=!0):(e&&clearTimeout(e),e=setTimeout((function(){t.apply(i,c),e=null,o=!1}),r))}}((function(){p(t,E,T).call(t,t.currentStyle)})),window.addEventListener("resize",this.resize)}function P(t,e){x(parseFloat(t)+parseFloat(e)/2-this.innerHeight/2)}function C(){x(0),document.body.removeChild(this.mask),document.body.removeChild(this.showBox),this.mask=null,this.showBox=null,m(),domStylesMap=null,window.removeEventListener("resize",this.resize)}var _={writable:!0,value:null};export{S as default};

@@ -536,11 +536,15 @@

function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");
function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
_classCheckPrivateStaticAccess(receiver, classConstructor);
_classCheckPrivateStaticFieldDescriptor(descriptor, "get");
return _classApplyDescriptorGet(receiver, descriptor);
}
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set");
function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
_classCheckPrivateStaticAccess(receiver, classConstructor);
_classCheckPrivateStaticFieldDescriptor(descriptor, "set");
_classApplyDescriptorSet(receiver, descriptor, value);

@@ -551,10 +555,2 @@

function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
function _classApplyDescriptorGet(receiver, descriptor) {

@@ -580,2 +576,14 @@ if (descriptor.get) {

function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance");
}
}
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
function _classPrivateMethodGet(receiver, privateSet, fn) {

@@ -595,8 +603,2 @@ if (!privateSet.has(receiver)) {

function _classPrivateFieldInitSpec(obj, privateMap, value) {
_checkPrivateRedeclaration(obj, privateMap);
privateMap.set(obj, value);
}
function _classPrivateMethodInitSpec(obj, privateSet) {

@@ -608,4 +610,2 @@ _checkPrivateRedeclaration(obj, privateSet);

var _Symbol$iterator;
// 给元素添加样式

@@ -626,7 +626,6 @@ function elementWithStyle(tag, styles) {

var domStylesMap$1 = new Map(); // 样式重置
var domStylesMap = new Map(); // 样式重置
function resetStyle() {
var _iterator = _createForOfIteratorHelper(domStylesMap),
var _iterator = _createForOfIteratorHelper(domStylesMap$1),
_step;

@@ -654,7 +653,6 @@

function addRelactive(target) {
var position = getComputedStyle(target).position;
var zIndex = getComputedStyle(target).zIndex;
domStylesMap.set(target, {
domStylesMap$1.set(target, {
position: position,

@@ -671,6 +669,4 @@ zIndex: zIndex

function getElementTopOrLeft(el, key) {
if (el.offsetParent) {
console.log(el.offsetParent);
return getElementTopOrLeft(el.offsetParent, key) + el[key];

@@ -682,3 +678,2 @@ }

function getElementTopAndLeft(selector) {

@@ -689,3 +684,2 @@ var target = document.querySelector(selector);

var offsetLeft = getElementTopOrLeft(target, 'offsetLeft');
console.log(offsetLeft, offsetTop);
var clientHeight = target.clientHeight,

@@ -696,3 +690,2 @@ clientWidth = target.clientWidth;

function debounce(func) {

@@ -704,3 +697,3 @@ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;

return function () {
var _this2 = this;
var _this = this;

@@ -717,3 +710,3 @@ for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {

timer = setTimeout(function () {
func.apply(_this2, arg);
func.apply(_this, arg);
timer = null;

@@ -726,3 +719,2 @@ invoke = false;

function scrollToTop(target) {

@@ -735,3 +727,3 @@ window.scrollTo({

var _isCreate = /*#__PURE__*/new WeakMap();
var _Symbol$iterator;

@@ -768,7 +760,2 @@ var _setPosition = /*#__PURE__*/new WeakSet();

_classPrivateFieldInitSpec(this, _isCreate, {
writable: true,
value: false
});
var flow = options.flow,

@@ -790,3 +777,4 @@ _options$btns = options.btns,

zIndex: '99'
}); // showBoxStyle
});
this.mask.id = 'blinMask'; // showBoxStyle

@@ -817,8 +805,6 @@ this.showBox = elementWithStyle('div', {

value: function insert(next, end) {
if (_classPrivateFieldGet(this, _isCreate)) return;
if (_classStaticPrivateFieldSpecGet(Guidance, Guidance, _instance)) return _classStaticPrivateFieldSpecGet(Guidance, Guidance, _instance);
_classPrivateFieldSet(this, _isCreate, true);
var guidanceGenerator = /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_this) {
var _iterator2, _step2, styles;
var _iterator, _step, styles;

@@ -829,2 +815,10 @@ return _regeneratorRuntime().wrap(function _callee$(_context) {

case 0:
if (!document.getElementById('blinMask')) {
_context.next = 2;
break;
}
return _context.abrupt("return");
case 2:
document.body.appendChild(_this.mask);

@@ -841,17 +835,17 @@ document.body.appendChild(_this.showBox);

_this.endBtn.onclick = end;
_iterator2 = _createForOfIteratorHelper(_this.flow);
_context.prev = 8;
_iterator = _createForOfIteratorHelper(_this.flow);
_context.prev = 10;
_iterator2.s();
_iterator.s();
case 10:
if ((_step2 = _iterator2.n()).done) {
_context.next = 23;
case 12:
if ((_step = _iterator.n()).done) {
_context.next = 25;
break;
}
styles = _step2.value;
styles = _step.value;
if (styles.target) {
_context.next = 14;
_context.next = 16;
break;

@@ -862,3 +856,3 @@ }

case 14:
case 16:
_this.currentStyle = styles;

@@ -871,27 +865,27 @@ resetStyle();

elementWithStyle(_this.endBtn, styles.end);
_context.next = 21;
_context.next = 23;
return;
case 21:
_context.next = 10;
break;
case 23:
_context.next = 28;
_context.next = 12;
break;
case 25:
_context.prev = 25;
_context.t0 = _context["catch"](8);
_context.next = 30;
break;
_iterator2.e(_context.t0);
case 27:
_context.prev = 27;
_context.t0 = _context["catch"](10);
case 28:
_context.prev = 28;
_iterator.e(_context.t0);
_iterator2.f();
case 30:
_context.prev = 30;
return _context.finish(28);
_iterator.f();
case 31:
return _context.finish(30);
case 33:
case "end":

@@ -901,6 +895,9 @@ return _context.stop();

}
}, _callee, null, [[8, 25, 28, 31]]);
}, _callee, null, [[10, 27, 30, 33]]);
})(this);
guidanceGenerator.end = _classPrivateMethodGet(this, _end, _end2).bind(this);
_classStaticPrivateFieldSpecSet(Guidance, Guidance, _instance, guidanceGenerator);
return guidanceGenerator;

@@ -1033,6 +1030,6 @@ }

function _listenerResize2() {
var _this3 = this;
var _this2 = this;
this.resize = debounce(function () {
_classPrivateMethodGet(_this3, _setShowBoxStyle, _setShowBoxStyle2).call(_this3, _this3.currentStyle);
_classPrivateMethodGet(_this2, _setShowBoxStyle, _setShowBoxStyle2).call(_this2, _this2.currentStyle);
});

@@ -1059,4 +1056,9 @@ window.addEventListener('resize', this.resize);

var _instance = {
writable: true,
value: null
};
return Guidance;
}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Guidance=e()}(this,(function(){"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new j(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(O([])));g&&g!==e&&n.call(g,i)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=d,u(m,"constructor",d),u(d,"constructor",p),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function l(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,s(t,e,"set"),r),r}function s(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function f(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p(t,e){h(t,e),e.add(t)}var d;function y(t,e){var r=t;for(var n in"string"==typeof t&&(r=document.createElement(t)),e)r.style[n]=e[n];return r}var v=new Map;function g(){var t,r=u(v);try{for(r.s();!(t=r.n()).done;){var n=i(t.value,2),o=n[0],a=n[1];o.style=e(e({},o.style),a)}}catch(t){r.e(t)}finally{r.f()}}function m(t,e){return t.offsetParent?(console.log(t.offsetParent),m(t.offsetParent,e)+t[e]):t[e]||0}function w(t){var e=document.querySelector(t);!function(t){var e=getComputedStyle(t).position,r=getComputedStyle(t).zIndex;v.set(t,{position:e,zIndex:r}),"static"===e&&(t.style.position="relative"),t.style.zIndex="9999"}(e);var r=m(e,"offsetTop"),n=m(e,"offsetLeft");return console.log(n,r),[r+"px",n+"px",e.clientHeight+"px",e.clientWidth+"px"]}function b(t){window.scrollTo({top:t,behavior:"smooth"})}var x=new WeakMap,L=new WeakSet,E=new WeakSet,j=new WeakSet,O=new WeakSet,k=new WeakSet;function S(t,r){r.adjustment||(r.adjustment={});var n=r.adjustment,o=n.top,i=void 0===o?0:o,a=n.left,c=void 0===a?0:a;if(!t)return e(e({},r),{},{left:parseFloat(r.left)-parseFloat(r.width)+parseFloat(r.targetWidth)+"px"});var u={xLeft:parseFloat(r.left)-parseFloat(r.width)+c+"px",xRight:parseFloat(r.left)+parseFloat(r.targetWidth)+c+"px",xCenter:parseFloat(r.left)-parseFloat(r.width)/2+parseFloat(r.targetWidth)/2+c+"px",yTop:parseFloat(r.top)-parseFloat(r.height)+i+"px",yBottom:parseFloat(r.top)+parseFloat(r.targetHeight)+i+"px",yCenter:parseFloat(r.top)-parseFloat(r.height)/2+parseFloat(r.targetHeight)/2+i+"px"};switch(t){case"top":return e(e({},r),{},{top:u.yTop,left:u.xCenter});case"right":return e(e({},r),{},{left:u.xRight,top:u.yCenter});case"bottom":return e(e({},r),{},{top:u.yBottom,left:u.xCenter});case"left":return e(e({},r),{},{left:u.xLeft,top:u.yCenter});case"topLeft":return e(e({},r),{},{left:u.xLeft,top:u.yTop});case"topRight":return e(e({},r),{},{left:u.xRight,top:u.yTop});case"bottomLeft":return e(e({},r),{},{left:u.xLeft,top:u.yBottom});case"bottomRight":return e(e({},r),{},{left:u.xRight,top:u.yBottom})}}function T(t){var r=i(w(t.target),4),n=r[0],o=r[1],a=r[2],c=r[3];f(this,O,B).call(this,n,a);var u=f(this,L,S).call(this,t.placement,e(e({},t),{},{top:n,left:o,targetWidth:c,targetHeight:a}));y(this.showBox,u)}function F(){var t=this;this.resize=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return function(){for(var i=this,a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];n&&!o?(t.apply(this,c),o=!0):(e&&clearTimeout(e),e=setTimeout((function(){t.apply(i,c),e=null,o=!1}),r))}}((function(){f(t,E,T).call(t,t.currentStyle)})),window.addEventListener("resize",this.resize)}function B(t,e){b(parseFloat(t)+parseFloat(e)/2-this.innerHeight/2)}function P(){b(0),document.body.removeChild(this.mask),document.body.removeChild(this.showBox),this.mask=null,this.showBox=null,g(),v=null,window.removeEventListener("resize",this.resize)}return d=Symbol.iterator,function(){function t(r){var n,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,k),p(this,O),p(this,j),p(this,E),p(this,L),i={writable:!0,value:!1},h(n=this,o=x),o.set(n,i);var a=r.flow,c=r.btns,u=void 0===c?{next:{},end:{}}:c;this.flow=a,this.innerHeight=window.innerHeight,this.mask=y("div",{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0,0,0,.5)",zIndex:"99"}),this.showBox=y("div",{position:"absolute",zIndex:"999",backgroundSize:"100% 100%",transition:"all 0.3s ease-in-out"});var l={cursor:"pointer",position:"absolute",display:"fixed",textAlign:"center"};this.nextBtn=y("div",e(e({},u.next),l)),this.nextBtn.innerHTML=u.next.content,this.endBtn=y("div",e(e({},u.end),{},{cursor:"pointer"},l)),this.endBtn.innerHTML=u.end.content}var o,i,a;return o=t,a=[{key:"create",value:function(e){var r=new t(e);return r.insert.bind(r)}}],(i=[{key:"insert",value:function(t,e){if(!function(t,e){return e.get?e.get.call(t):e.value}(n=this,s(n,x,"get"))){var n;l(this,x,!0);var o=r().mark((function n(o){var i,a,c;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:document.body.appendChild(o.mask),document.body.appendChild(o.showBox),f(o,j,F).call(o),o.showBox.appendChild(o.nextBtn),o.showBox.appendChild(o.endBtn),o.nextBtn.onclick=t,o.endBtn.onclick=e,i=u(o.flow),r.prev=8,i.s();case 10:if((a=i.n()).done){r.next=23;break}if((c=a.value).target){r.next=14;break}throw new Error("Target is not passed in");case 14:return o.currentStyle=c,g(),f(o,E,T).call(o,c),y(o.nextBtn,c.next),y(o.endBtn,c.end),void(r.next=21);case 21:r.next=10;break;case 23:r.next=28;break;case 25:r.prev=25,r.t0=r.catch(8),i.e(r.t0);case 28:return r.prev=28,i.f(),r.finish(28);case 31:case"end":return r.stop()}}),n,null,[[8,25,28,31]])}))(this);return o.end=f(this,k,P).bind(this),o}}},{key:d,value:r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.flow,"t0",1);case 1:case"end":return t.stop()}}),t,this)}))}])&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}()}));
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(j([])));g&&g!==e&&n.call(g,i)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function j(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=d,u(m,"constructor",d),u(d,"constructor",p),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function l(t,e,r){return f(t,e),h(r,"get"),function(t,e){if(e.get)return e.get.call(t);return e.value}(t,r)}function s(t,e,r,n){return f(t,e),h(r,"set"),function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,r,n),n}function f(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}function h(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function p(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function d(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function y(t,e){var r=t;for(var n in"string"==typeof t&&(r=document.createElement(t)),e)r.style[n]=e[n];return r}var v,g=new Map;function m(){var t,r=u(g);try{for(r.s();!(t=r.n()).done;){var n=i(t.value,2),o=n[0],a=n[1];o.style=e(e({},o.style),a)}}catch(t){r.e(t)}finally{r.f()}}function w(t,e){return t.offsetParent?w(t.offsetParent,e)+t[e]:t[e]||0}function b(t){var e=document.querySelector(t);return function(t){var e=getComputedStyle(t).position,r=getComputedStyle(t).zIndex;g.set(t,{position:e,zIndex:r}),"static"===e&&(t.style.position="relative"),t.style.zIndex="9999"}(e),[w(e,"offsetTop")+"px",w(e,"offsetLeft")+"px",e.clientHeight+"px",e.clientWidth+"px"]}function x(t){window.scrollTo({top:t,behavior:"smooth"})}var L=new WeakSet,E=new WeakSet,k=new WeakSet,j=new WeakSet,O=new WeakSet;v=Symbol.iterator;var S=function(){function t(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,O),d(this,j),d(this,k),d(this,E),d(this,L);var n=r.flow,o=r.btns,i=void 0===o?{next:{},end:{}}:o;this.flow=n,this.innerHeight=window.innerHeight,this.mask=y("div",{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0,0,0,.5)",zIndex:"99"}),this.mask.id="blinMask",this.showBox=y("div",{position:"absolute",zIndex:"999",backgroundSize:"100% 100%",transition:"all 0.3s ease-in-out"});var a={cursor:"pointer",position:"absolute",display:"fixed",textAlign:"center"};this.nextBtn=y("div",e(e({},i.next),a)),this.nextBtn.innerHTML=i.next.content,this.endBtn=y("div",e(e({},i.end),{},{cursor:"pointer"},a)),this.endBtn.innerHTML=i.end.content}var o,i,a;return o=t,a=[{key:"create",value:function(e){var r=new t(e);return r.insert.bind(r)}}],(i=[{key:"insert",value:function(e,n){if(l(t,t,_))return l(t,t,_);var o=r().mark((function t(o){var i,a,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!document.getElementById("blinMask")){t.next=2;break}return t.abrupt("return");case 2:document.body.appendChild(o.mask),document.body.appendChild(o.showBox),p(o,k,B).call(o),o.showBox.appendChild(o.nextBtn),o.showBox.appendChild(o.endBtn),o.nextBtn.onclick=e,o.endBtn.onclick=n,i=u(o.flow),t.prev=10,i.s();case 12:if((a=i.n()).done){t.next=25;break}if((c=a.value).target){t.next=16;break}throw new Error("Target is not passed in");case 16:return o.currentStyle=c,m(),p(o,E,F).call(o,c),y(o.nextBtn,c.next),y(o.endBtn,c.end),void(t.next=23);case 23:t.next=12;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(10),i.e(t.t0);case 30:return t.prev=30,i.f(),t.finish(30);case 33:case"end":return t.stop()}}),t,null,[[10,27,30,33]])}))(this);return o.end=p(this,O,C).bind(this),s(t,t,_,o),o}},{key:v,value:r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(this.flow,"t0",1);case 1:case"end":return t.stop()}}),t,this)}))}])&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}();function T(t,r){r.adjustment||(r.adjustment={});var n=r.adjustment,o=n.top,i=void 0===o?0:o,a=n.left,c=void 0===a?0:a;if(!t)return e(e({},r),{},{left:parseFloat(r.left)-parseFloat(r.width)+parseFloat(r.targetWidth)+"px"});var u={xLeft:parseFloat(r.left)-parseFloat(r.width)+c+"px",xRight:parseFloat(r.left)+parseFloat(r.targetWidth)+c+"px",xCenter:parseFloat(r.left)-parseFloat(r.width)/2+parseFloat(r.targetWidth)/2+c+"px",yTop:parseFloat(r.top)-parseFloat(r.height)+i+"px",yBottom:parseFloat(r.top)+parseFloat(r.targetHeight)+i+"px",yCenter:parseFloat(r.top)-parseFloat(r.height)/2+parseFloat(r.targetHeight)/2+i+"px"};switch(t){case"top":return e(e({},r),{},{top:u.yTop,left:u.xCenter});case"right":return e(e({},r),{},{left:u.xRight,top:u.yCenter});case"bottom":return e(e({},r),{},{top:u.yBottom,left:u.xCenter});case"left":return e(e({},r),{},{left:u.xLeft,top:u.yCenter});case"topLeft":return e(e({},r),{},{left:u.xLeft,top:u.yTop});case"topRight":return e(e({},r),{},{left:u.xRight,top:u.yTop});case"bottomLeft":return e(e({},r),{},{left:u.xLeft,top:u.yBottom});case"bottomRight":return e(e({},r),{},{left:u.xRight,top:u.yBottom})}}function F(t){var r=i(b(t.target),4),n=r[0],o=r[1],a=r[2],c=r[3];p(this,j,P).call(this,n,a);var u=p(this,L,T).call(this,t.placement,e(e({},t),{},{top:n,left:o,targetWidth:c,targetHeight:a}));y(this.showBox,u)}function B(){var t=this;this.resize=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return function(){for(var i=this,a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];n&&!o?(t.apply(this,c),o=!0):(e&&clearTimeout(e),e=setTimeout((function(){t.apply(i,c),e=null,o=!1}),r))}}((function(){p(t,E,F).call(t,t.currentStyle)})),window.addEventListener("resize",this.resize)}function P(t,e){x(parseFloat(t)+parseFloat(e)/2-this.innerHeight/2)}function C(){x(0),document.body.removeChild(this.mask),document.body.removeChild(this.showBox),this.mask=null,this.showBox=null,m(),domStylesMap=null,window.removeEventListener("resize",this.resize)}var _={writable:!0,value:null};return S}));

@@ -1,89 +0,9 @@

// 给元素添加样式
function elementWithStyle(tag, styles) {
let el = tag
if (typeof tag === 'string') {
el = document.createElement(tag)
}
import {
elementWithStyle,
resetStyle,
getElementTopAndLeft,
debounce,
scrollToTop,
} from './utils/index.js'
for (const key in styles) {
el.style[key] = styles[key]
}
return el
}
// 保存之前的样式
let domStylesMap = new Map()
// 样式重置
function resetStyle() {
for (const [dom, styles] of domStylesMap) {
dom.style = { ...dom.style, ...styles }
}
}
// 给元素添加相对定位
/**
*
* @param {HTMLElement} target
*/
function addRelactive(target) {
const position = getComputedStyle(target).position
const zIndex = getComputedStyle(target).zIndex
domStylesMap.set(target, { position, zIndex })
if (position === 'static') {
target.style.position = 'relative'
}
target.style.zIndex = '9999'
}
// 获取到页面顶部或者左侧的值
function getElementTopOrLeft(el, key) {
if (el.offsetParent) {
return getElementTopOrLeft(el.offsetParent, key) + el[key]
}
return el[key] || 0
}
// 获取dom的top和left
function getElementTopAndLeft(selector) {
const target = document.querySelector(selector)
addRelactive(target)
const offsetTop = getElementTopOrLeft(target, 'offsetTop')
const offsetLeft = getElementTopOrLeft(target, 'offsetLeft')
const { clientHeight, clientWidth } = target
return [
offsetTop + 'px',
offsetLeft + 'px',
clientHeight + 'px',
clientWidth + 'px',
]
}
// 防抖函数
function debounce(func, delay = 250, immediate = false) {
let timer
let invoke = false
return function (...arg) {
if (immediate && !invoke) {
func.apply(this, arg)
invoke = true
} else {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
func.apply(this, arg)
timer = null
invoke = false
}, delay)
}
}
}
// 滚动函数
function scrollToTop(target) {
window.scrollTo({ top: target, behavior: 'smooth' })
}
class Guidance {

@@ -94,3 +14,4 @@ /**

*/
#isCreate = false
static #instance = null
constructor(options) {

@@ -112,3 +33,3 @@ const { flow, btns = { next: {}, end: {} } } = options

})
this.mask.id = 'blinMask'
// showBoxStyle

@@ -145,6 +66,5 @@

insert(next, end) {
if (this.#isCreate) return
this.#isCreate = true
if (Guidance.#instance) return Guidance.#instance
const guidanceGenerator = (function* (_this) {
if (document.getElementById('blinMask')) return
document.body.appendChild(_this.mask)

@@ -177,2 +97,4 @@ document.body.appendChild(_this.showBox)

Guidance.#instance = guidanceGenerator
return guidanceGenerator

@@ -179,0 +101,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc