From 0683a4d0ac4eb29a9f3ecbd2cc8b09d1076b1e32 Mon Sep 17 00:00:00 2001
From: jian <jian@docsie.io>
Date: Thu, 7 Jan 2021 23:06:14 +0800
Subject: [PATCH 1/2] bug fix #28

---
 src/step/index.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/step/index.js b/src/step/index.js
index f4d7799..4e03b44 100644
--- a/src/step/index.js
+++ b/src/step/index.js
@@ -136,6 +136,7 @@ export default class Step {
       style.left = `${0}px`;
       style.width = `${0}px`;
       style.height = `${0}px`;
+      style.boxShadow = "none";
       const tooltip = this.tooltip;
       style = tooltip.first().style;
       style.opacity = 0.1;
@@ -143,6 +144,9 @@ export default class Step {
       style.left = `${view.width / 2}px`;
       tooltip.addClass("guided-tour-arrow-none");
       tooltip.addClass("guided-tour-center");
+
+      if (this.context._background)
+        this.context._background.show();
     }
   }
   adjust() {

From 4008ebcd6437ee5f62dfc98888dd2454f94611ac Mon Sep 17 00:00:00 2001
From: jian <jian@docsie.io>
Date: Thu, 7 Jan 2021 23:06:25 +0800
Subject: [PATCH 2/2] bulid

---
 tourguide.esm.js | 3 +++
 tourguide.js     | 3 +++
 tourguide.min.js | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tourguide.esm.js b/tourguide.esm.js
index 27fad0e..c8cd14a 100644
--- a/tourguide.esm.js
+++ b/tourguide.esm.js
@@ -509,6 +509,7 @@ var Step = function () {
         _style.left = 0 + "px";
         _style.width = 0 + "px";
         _style.height = 0 + "px";
+        _style.boxShadow = "none";
         var _tooltip = this.tooltip;
         _style = _tooltip.first().style;
         _style.opacity = 0.1;
@@ -516,6 +517,8 @@ var Step = function () {
         _style.left = _view.width / 2 + "px";
         _tooltip.addClass("guided-tour-arrow-none");
         _tooltip.addClass("guided-tour-center");
+
+        if (this.context._background) this.context._background.show();
       }
     }
   }, {
diff --git a/tourguide.js b/tourguide.js
index 4b7bf8d..e5f937b 100644
--- a/tourguide.js
+++ b/tourguide.js
@@ -512,6 +512,7 @@ var Tourguide = (function () {
 	        _style.left = 0 + "px";
 	        _style.width = 0 + "px";
 	        _style.height = 0 + "px";
+	        _style.boxShadow = "none";
 	        var _tooltip = this.tooltip;
 	        _style = _tooltip.first().style;
 	        _style.opacity = 0.1;
@@ -519,6 +520,8 @@ var Tourguide = (function () {
 	        _style.left = _view.width / 2 + "px";
 	        _tooltip.addClass("guided-tour-arrow-none");
 	        _tooltip.addClass("guided-tour-center");
+
+	        if (this.context._background) this.context._background.show();
 	      }
 	    }
 	  }, {
diff --git a/tourguide.min.js b/tourguide.min.js
index 1bfedd2..78110cc 100644
--- a/tourguide.min.js
+++ b/tourguide.min.js
@@ -1 +1 @@
-var Tourguide=function(){var t,l=(function(t){var s=function(t,e){return this instanceof s?t instanceof s?t:("string"==typeof t&&(t=this.select(t,e)),t&&t.nodeName&&(t=[t]),void(this.nodes=this.slice(t))):new s(t,e)};s.prototype={get length(){return this.nodes.length}},s.prototype.nodes=[],s.prototype.addClass=function(){return this.eacharg(arguments,function(t,e){t.classList.add(e)})},s.prototype.adjacent=function(o,t,r){return"number"==typeof t&&(t=0===t?[]:new Array(t).join().split(",").map(Number.call,Number)),this.each(function(i,n){var e=document.createDocumentFragment();s(t||{}).map(function(t,e){e="function"==typeof o?o.call(this,t,e,i,n):o;return"string"==typeof e?this.generate(e):s(e)}).each(function(t){this.isInPage(t)?e.appendChild(s(t).clone().first()):e.appendChild(t)}),r.call(this,i,e)})},s.prototype.after=function(t,e){return this.adjacent(t,e,function(t,e){t.parentNode.insertBefore(e,t.nextSibling)})},s.prototype.append=function(t,e){return this.adjacent(t,e,function(t,e){t.appendChild(e)})},s.prototype.args=function(t,e,i){return"function"==typeof t&&(t=t(e,i)),"string"!=typeof t&&(t=this.slice(t).map(this.str(e,i))),t.toString().split(/[\s,]+/).filter(function(t){return t.length})},s.prototype.array=function(o){var r=this;return this.nodes.reduce(function(t,e,i){var n;return o?((n=o.call(r,e,i))||(n=!1),"string"==typeof n&&(n=s(n)),n instanceof s&&(n=n.nodes)):n=e.innerHTML,t.concat(!1!==n?n:[])},[])},s.prototype.attr=function(t,e,n){return n=n?"data-":"",this.pairs(t,e,function(t,e){return t.getAttribute(n+e)},function(t,e,i){t.setAttribute(n+e,i)})},s.prototype.before=function(t,e){return this.adjacent(t,e,function(t,e){t.parentNode.insertBefore(e,t)})},s.prototype.children=function(t){return this.map(function(t){return this.slice(t.children)}).filter(t)},s.prototype.clone=function(){return this.map(function(t,e){var i=t.cloneNode(!0),n=this.getAll(i);return this.getAll(t).each(function(t,e){for(var i in this.mirror)this.mirror[i]&&this.mirror[i](t,n.nodes[e])}),i})},s.prototype.getAll=function(t){return s([t].concat(s("*",t).nodes))},s.prototype.mirror={},s.prototype.mirror.events=function(t,e){if(t._e)for(var i in t._e)t._e[i].forEach(function(t){s(e).on(i,t.callback)})},s.prototype.mirror.select=function(t,e){s(t).is("select")&&(e.value=t.value)},s.prototype.mirror.textarea=function(t,e){s(t).is("textarea")&&(e.value=t.value)},s.prototype.closest=function(e){return this.map(function(t){do{if(s(t).is(e))return t}while((t=t.parentNode)&&t!==document)})},s.prototype.data=function(t,e){return this.attr(t,e,!0)},s.prototype.each=function(t){return this.nodes.forEach(t.bind(this)),this},s.prototype.eacharg=function(i,n){return this.each(function(e,t){this.args(i,e,t).forEach(function(t){n.call(this,e,t)},this)})},s.prototype.empty=function(){return this.each(function(t){for(;t.firstChild;)t.removeChild(t.firstChild)})},s.prototype.filter=function(e){var t=e instanceof s?function(t){return-1!==e.nodes.indexOf(t)}:"function"==typeof e?e:function(t){return t.matches=t.matches||t.msMatchesSelector||t.webkitMatchesSelector,t.matches(e||"*")};return s(this.nodes.filter(t))},s.prototype.find=function(e){return this.map(function(t){return s(e||"*",t)})},s.prototype.first=function(){return this.nodes[0]||!1},s.prototype.generate=function(t){return/^\s*<tr[> ]/.test(t)?s(document.createElement("table")).html(t).children().children().nodes:/^\s*<t(h|d)[> ]/.test(t)?s(document.createElement("table")).html(t).children().children().children().nodes:/^\s*</.test(t)?s(document.createElement("div")).html(t).children().nodes:document.createTextNode(t)},s.prototype.handle=function(){var t=this.slice(arguments).map(function(e){return"function"==typeof e?function(t){t.preventDefault(),e.apply(this,arguments)}:e},this);return this.on.apply(this,t)},s.prototype.hasClass=function(){return this.is("."+this.args(arguments).join("."))},s.prototype.html=function(e){return void 0===e?this.first().innerHTML||"":this.each(function(t){t.innerHTML=e})},s.prototype.is=function(t){return 0<this.filter(t).length},s.prototype.isInPage=function(t){return t!==document.body&&document.body.contains(t)},s.prototype.last=function(){return this.nodes[this.length-1]||!1},s.prototype.map=function(t){return t?s(this.array(t)).unique():this},s.prototype.not=function(e){return this.filter(function(t){return!s(t).is(e||!0)})},s.prototype.off=function(t,e,i){var n=null==e&&null==i,o=null,r=e;return"string"==typeof e&&(o=e,r=i),this.eacharg(t,function(e,i){s(e._e?e._e[i]:[]).each(function(t){(n||t.orig_callback===r&&t.selector===o)&&e.removeEventListener(i,t.callback)})})},s.prototype.on=function(t,e,o){var r=null,i=e;"string"==typeof e&&(r=e,i=o,e=function(e){var i=arguments,n=!1;s(e.currentTarget).find(r).each(function(t){if(t===e.target||t.contains(e.target)){n=!0;try{Object.defineProperty(e,"currentTarget",{get:function(){return t}})}catch(t){}o.apply(t,i)}}),n||e.currentTarget!==e.target||o.apply(e.target,i)});function n(t){return e.apply(this,[t].concat(t.detail||[]))}return this.eacharg(t,function(t,e){t.addEventListener(e,n),t._e=t._e||{},t._e[e]=t._e[e]||[],t._e[e].push({callback:n,orig_callback:i,selector:r})})},s.prototype.pairs=function(i,t,e,n){var o;return void 0!==t&&(o=i,(i={})[o]=t),"object"==typeof i?this.each(function(t){for(var e in i)n(t,e,i[e])}):this.length?e(this.first(),i):""},s.prototype.param=function(e){return Object.keys(e).map(function(t){return this.uri(t)+"="+this.uri(e[t])}.bind(this)).join("&")},s.prototype.parent=function(t){return this.map(function(t){return t.parentNode}).filter(t)},s.prototype.prepend=function(t,e){return this.adjacent(t,e,function(t,e){t.insertBefore(e,t.firstChild)})},s.prototype.remove=function(){return this.each(function(t){t.parentNode&&t.parentNode.removeChild(t)})},s.prototype.removeClass=function(){return this.eacharg(arguments,function(t,e){t.classList.remove(e)})},s.prototype.replace=function(t,e){var i=[];return this.adjacent(t,e,function(t,e){i=i.concat(this.slice(e.children)),t.parentNode.replaceChild(e,t)}),s(i)},s.prototype.scroll=function(){return this.first().scrollIntoView({behavior:"smooth"}),this},s.prototype.select=function(t,e){return t=t.replace(/^\s*/,"").replace(/\s*$/,""),/^</.test(t)?s().generate(t):(e||document).querySelectorAll(t)},s.prototype.serialize=function(){var n=this;return this.slice(this.first().elements).reduce(function(e,i){return!i.name||i.disabled||"file"===i.type||/(checkbox|radio)/.test(i.type)&&!i.checked?e:"select-multiple"===i.type?(s(i.options).each(function(t){t.selected&&(e+="&"+n.uri(i.name)+"="+n.uri(t.value))}),e):e+"&"+n.uri(i.name)+"="+n.uri(i.value)},"").slice(1)},s.prototype.siblings=function(t){return this.parent().children(t).not(this)},s.prototype.size=function(){return this.first().getBoundingClientRect()},s.prototype.slice=function(t){return t&&0!==t.length&&"string"!=typeof t&&"[object Function]"!==t.toString()?t.length?[].slice.call(t.nodes||t):[t]:[]},s.prototype.str=function(e,i){return function(t){return"function"==typeof t?t.call(this,e,i):t.toString()}},s.prototype.text=function(e){return void 0===e?this.first().textContent||"":this.each(function(t){t.textContent=e})},s.prototype.toggleClass=function(t,e){return!!e===e?this[e?"addClass":"removeClass"](t):this.eacharg(t,function(t,e){t.classList.toggle(e)})},s.prototype.trigger=function(t){var o=this.slice(arguments).slice(1);return this.eacharg(t,function(t,e){var i,n={bubbles:!0,cancelable:!0,detail:o};try{i=new window.CustomEvent(e,n)}catch(t){(i=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,o)}t.dispatchEvent(i)})},s.prototype.unique=function(){return s(this.nodes.reduce(function(t,e){return null!=e&&!1!==e&&-1===t.indexOf(e)?t.concat(e):t},[]))},s.prototype.uri=function(t){return encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},s.prototype.wrap=function(t){return this.map(function(e){return s(t).each(function(t){(function(t){for(;t.firstElementChild;)t=t.firstElementChild;return s(t)})(t).append(e.cloneNode(!0)),e.parentNode.replaceChild(t,e)})})},t.exports&&(t.exports=s,t.exports.u=s)}(t={exports:{}}),t.exports),v=(l.u,"complete"),u="canceled";function m(t,e,i){t.self===t?t.scrollTo(e,i):(t.scrollLeft=e,t.scrollTop=i)}function y(t){var e=t._scrollSettings;if(e){var i,n,o,r,s,c,l,a,u,h,p,d,f=e.maxSynchronousAlignments,c=(g=t,l=(i=e).align,a=i.target.getBoundingClientRect(),u=l&&null!=l.left?l.left:.5,h=l&&null!=l.top?l.top:.5,p=l&&null!=l.leftOffset?l.leftOffset:0,d=l&&null!=l.topOffset?l.topOffset:0,l=u,u=h,g=i.isWindow(g)?(o=Math.min(a.width,g.innerWidth),r=Math.min(a.height,g.innerHeight),s=a.left+g.pageXOffset-g.innerWidth*l+o*l,c=a.top+g.pageYOffset-g.innerHeight*u+r*u,c-=d,n=(s-=p)-g.pageXOffset,c-g.pageYOffset):(o=a.width,r=a.height,h=g.getBoundingClientRect(),i=a.left-(h.left-g.scrollLeft),h=a.top-(h.top-g.scrollTop),s=i+o*l-g.clientWidth*l,c=h+r*u-g.clientHeight*u,s-=p,c-=d,s=Math.max(Math.min(s,g.scrollWidth-g.clientWidth),0),c=Math.max(Math.min(c,g.scrollHeight-g.clientHeight),0),n=s-g.scrollLeft,c-g.scrollTop),{x:s,y:c,differenceX:n,differenceY:g}),n=Date.now()-e.startTime,g=Math.min(1/e.time*n,1);if(e.endIterations>=f)return m(t,c.x,c.y),t._scrollSettings=null,e.end(v);var g=1-e.ease(g);if(m(t,c.x-c.differenceX*g,c.y-c.differenceY*g),n>=e.time)return e.endIterations++,y(t);t=y.bind(null,t),!("requestAnimationFrame"in window?window.requestAnimationFrame(t):void setTimeout(t,16))}}function h(t){return t.self===t}function a(t){return"pageXOffset"in t||(t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth)&&"hidden"!==getComputedStyle(t).overflow}function p(){return!0}function d(t){if(t.assignedSlot)return d(t.assignedSlot);if(t.parentElement)return"BODY"===t.parentElement.tagName?t.parentElement.ownerDocument.defaultView||t.parentElement.ownerDocument.ownerWindow:t.parentElement;if(t.getRootNode){t=t.getRootNode();if(11===t.nodeType)return t.host}}function i(t,e,i){if(t){"function"==typeof e&&(i=e,e=null),(e=e||{}).time=isNaN(e.time)?1e3:e.time,e.ease=e.ease||function(t){return 1-Math.pow(1-t,t/2)};var n,o=d(t),r=1,s=e.validTarget||p,c=e.isScrollable;for(e.debug&&(console.log("About to scroll to",t),o||console.error("Target did not have a parent, is it mounted in the DOM?"));o;)if(e.debug&&console.log("Scrolling parent node",o),s(o,r)&&(c?c(o,a):a(o))&&(r++,n=function(t,e,i,n){var o,r=!e._scrollSettings,s=e._scrollSettings,c=Date.now(),l={passive:!0};function a(t){e._scrollSettings=null,e.parentElement&&e.parentElement._scrollSettings&&e.parentElement._scrollSettings.end(t),i.debug&&console.log("Scrolling ended with type",t,"for",e),n(t),o&&(e.removeEventListener("touchstart",o,l),e.removeEventListener("wheel",o,l))}return s&&s.end(u),null==(s=i.maxSynchronousAlignments)&&(s=3),e._scrollSettings={startTime:c,endIterations:0,target:t,time:i.time,ease:i.ease,align:i.align,isWindow:i.isWindow||h,maxSynchronousAlignments:s,end:a},"cancellable"in i&&!i.cancellable||(o=a.bind(null,u),e.addEventListener("touchstart",o,l),e.addEventListener("wheel",o,l)),r&&y(e),o}(t,o,e,l)),!(o=d(o))){l(v);break}return n}function l(t){--r||i&&i(t)}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t};function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i,n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};function c(t,e,i){return e=isNaN(e)?t:e,i=isNaN(i)?t:i,Math.max(e,Math.min(t,i))}function f(t){var e=l(t).size(),t=g();return{width:e.width,height:e.height,top:e.top,bottom:e.bottom,left:e.left,right:e.right,viewtop:e.top-t.scrollY,viewbottom:e.bottom-t.scrollY,viewleft:e.left-t.scrollX,viewright:e.right-t.scrollX}}function g(){return{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,bodyWidth:document.body.clientWidth,bodyHeight:document.body.clientHeight}}var w=(e(b,[{key:"el",get:function(){var t,e,i,n,o,r,s,c=this;return this.container||(t=l('<div role="figure" class="guided-tour-step-image">'+(this.image?'<img src="'+this.image+'" />':"")+"</div>"),e=l('<div role="heading" class="guided-tour-step-title">'+this.title+"</div>"),i=l('<div class="guided-tour-step-content">'+this.content+"</div>"),(n=l('<div class="guided-tour-step-footer">\n                <span role="button" class="guided-tour-step-button guided-tour-step-button-close" title="End tour">\n                    <svg class="guided-tour-icon" viewBox="0 0 20 20" width="16" height="16"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#tour-icon-close"></use></svg>\n                </span>\n                '+(this.last?'<span role="button" class="guided-tour-step-button guided-tour-step-button-complete" title="Complete tour">\n                        <svg class="guided-tour-icon" viewBox="0 0 20 20" width="32" height="32"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#tour-icon-complete"></use></svg>\n                    </span>':'<span role="button" class="guided-tour-step-button guided-tour-step-button-next" title="Next step">\n                        <svg class="guided-tour-icon" viewBox="0 0 20 20" width="32" height="32"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#tour-icon-next"></use></svg>\n                    </span>')+"\n                "+(1<this.context._steps.length?'<div class="guided-tour-step-footer-bullets">\n                    <ul>'+this.context._steps.map(function(t,e){return'<li  title="Go to step '+(e+1)+'" data-index="'+e+'" class="'+(t.index<c.index?"complete":t.index==c.index?"current":"")+'"></li>'}).join("")+"</ul>\n                </div>":"")+"\n            </div>")).find(".guided-tour-step-button-next").on("click",this.context.next),n.find(".guided-tour-step-button-close").on("click",this.context.stop),n.find(".guided-tour-step-button-complete").on("click",this.context.complete),n.find(".guided-tour-step-footer-bullets li").on("click",function(t){return c.context.go(parseInt(l(t.target).data("index")))}),(o=this.highlight=l('<div class="guided-tour-step-highlight"></div>')).on("click",this.context.action),r=this.tooltip=l('<div role="tooltip" class="guided-tour-step-tooltip"></div>'),s=this.arrow=l('<div aria-hidden="true" class="guided-tour-arrow"></div>'),r.append(s).append(t).append(e).append(i).append(n),this.container=l('<div role="dialog" class="guided-tour-step'+(this.first?" guided-tour-step-first":"")+(this.last?" guided-tour-step-last":"")+'"></div>'),this.container.append(o).append(r)),this.container}},{key:"target",get:function(){return this._target||l(this.selector).first()},set:function(t){this._target=t}}]),e(b,[{key:"attach",value:function(){l(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"body").append(this.el)}},{key:"remove",value:function(){this.hide(),this.el.remove()}},{key:"position",value:function(){var t,e,i,n,o;this.target&&null!==this.target.offsetParent?(n=f(this.target),o=g(),(e=this.highlight.first().style).top=n.top-this.context.options.padding+"px",e.left=n.left-this.context.options.padding+"px",e.width=n.width+2*this.context.options.padding+"px",e.height=n.height+2*this.context.options.padding+"px",t=this.tooltip,i=this.arrow,(e=t.first().style).opacity=.1,o.height/2>n.top?(t.addClass("guided-tour-arrow-top"),e.top=n.top+n.height+"px"):(t.addClass("guided-tour-arrow-bottom"),e.bottom=o.height-n.top+"px"),o.width/2>n.left?(e.left=n.left+"px",i.first().style.left=400<n.width?"18px":c(n.width/2,14,386)+"px"):(e.right=Math.max(o.width-n.right,40)+"px",i.first().style.right=o.width-n.right<40||400<n.width?"8px":c(n.width/2-8,14,386)+"px")):(i=g(),(o=this.highlight.first().style).top="0px",o.left="0px",o.width="0px",o.height="0px",(o=(n=this.tooltip).first().style).opacity=.1,o.top=i.height/2+"px",o.left=i.width/2+"px",n.addClass("guided-tour-arrow-none"),n.addClass("guided-tour-center"))}},{key:"adjust",value:function(){var t=f(this.tooltip),e=g(),i=this.tooltip.first().style;t.top<0&&(i.top="8px"),t.top>e.height-t.height&&(i.top=e.height-t.height-40+"px"),t.left<0&&(i.left="8px"),t.right<40&&(i.right="40px"),i.opacity=1}},{key:"show",value:function(){var t=this;if(this.visible)return!1;function e(){t.position(),t.el.addClass("active"),t.adjust(),t.visible=!0}return this.target?i(this.target,{time:this.context.options.animationspeed},e):setTimeout(e,this.context.options.animationspeed),!0}},{key:"hide",value:function(){return!!this.visible&&(this.el.removeClass("active"),this.tooltip.removeClass("guided-tour-arrow-top"),!(this.visible=!1))}},{key:"toJSON",value:function(){var t=this;return index=t.index,title=t.title,contnet=t.contnet,image=t.image,active=t.active,t}}]),b);function b(t,e){var i=this;r(this,b),this.index=0,this.first=!1,this.last=!1,this.target=null,this.container=null,this.highlight=null,this.tooltip=null,this.arrow=null,this.rect={},this.image=null,this.title="",this.content="",this.active=!1,this.context=null,this.visible=!1,this._target=null,this.context=e;var n=void 0;if("object"===(void 0===t?"undefined":o(t))){if(!(t.hasOwnProperty("title")&&t.hasOwnProperty("content")&&t.hasOwnProperty("step")))throw new Error("invalid step parameter:\n"+JSON.stringify(t,null,2)+"\nsee this doc for more detail: https://github.com/LikaloLLC/tourguide.js#json-based-approach");n=t,this.selector=t.selector}else this.target=t,n=function(t,e){var i=0<arguments.length&&void 0!==t?t:"",n=1<arguments.length&&void 0!==e?e:{},i=i.split(";"),o=s({},n);return i.forEach(function(t){t=(t||"").split(":");o[(t[0]||"").trim()]=(t[1]||"").trim()}),o}(l(t).data("tour"));this.index=parseInt(n.step),this.title=n.title,this.content=n.content,this.actiontarget=n.actiontarget,this.image=n.image,n.image&&e.options.preloadimages&&!/^data:/i.test(n.image)&&((n=new Image).onerror=function(){i.image=null},n.src=this.image)}var x=(e(_,[{key:"el",get:function(){return this.container||(this.container=l('<div role="dialog" class="guided-tour-background"></div>')),this.container}}]),e(_,[{key:"attach",value:function(){l(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"body").append(this.el)}},{key:"remove",value:function(){this.hide(),this.el.remove()}},{key:"show",value:function(){return!this.visible&&(this.el.addClass("active"),this.visible=!0)}},{key:"hide",value:function(){var t=this;if(this.visible){function e(){t.el.removeClass("active"),t.visible=!1}return setTimeout(e,this.context.options.animationspeed),!0}return!1}},{key:"toJSON",value:function(){return active=this.active,this}}]),_);function _(t){r(this,_),this.container=null,this.active=!1,this.context=t}var k={DOM:0,JSON:1,REMOTE:2};function C(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(r(this,C),this._options=Object.assign({root:"body",selector:"[data-tour]",animationspeed:300,padding:5,steps:null,src:null,restoreinitialposition:!0,preloadimages:!1,request:{options:{mode:"cors",cache:"no-cache"},headers:{"Content-Type":"application/json"}},onStart:function(){},onStop:function(){},onComplete:function(){},onStep:function(){},onAction:function(){}},t),this._background=null,this._steps=[],this._current=0,this._active=!1,this._stepsSrc=k.DOM,this._ready=!1,this._initialposition=null,this.start=this.start.bind(this),this.action=this.action.bind(this),this.next=this.next.bind(this),this.previous=this.previous.bind(this),this.go=this.go.bind(this),this.stop=this.stop.bind(this),this.complete=this.complete.bind(this),this._injectIcons(),"object"===o(this._options.steps)&&Array.isArray(this._options.steps))this._stepsSrc=k.JSON,this._steps=this._options.steps.map(function(t){return new w(t,e)}),this._ready=!0;else if("string"==typeof this._options.src)this._stepsSrc=k.REMOTE,fetch(new Request(this._options.src,this._options.request)).then(function(t){return t.json().then(function(t){e._steps=t.map(function(t){return new w(t,e)}),e._ready=!0})});else{if(!(0<l(this._options.selector).length))throw new Error("Tour is not configured properly. Check documentation.");this._ready=!0}}return e(C,[{key:"currentstep",get:function(){return this._steps[this._current]}},{key:"length",get:function(){return this._steps.length}},{key:"steps",get:function(){return this._steps.map(function(t){return t.toJSON()})}},{key:"hasnext",get:function(){return this.nextstep!==this._current}},{key:"nextstep",get:function(){return c(this._current+1,0,this.length-1)}},{key:"previousstep",get:function(){return c(this._current-1,0)}},{key:"options",get:function(){return this._options}}]),e(C,[{key:"_injectIcons",value:function(){0===l("#GuidedTourIconSet").length&&l("body").append(l('<svg id="GuidedTourIconSet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<symbol id="tour-icon-close" viewBox="0 0 20 20"><path d="M16,16 L4,4" fill="none" stroke="currentColor" stroke-width="1"></path><path d="M16,4 L4,16" fill="none" stroke="currentColor" stroke-width="1"></path></symbol>\n<symbol id="tour-icon-next" viewBox="0 0 20 20"><polyline points="7 4 13 10 7 16" fill="none" stroke="currentColor" stroke-width="1"></polyline></symbol>\n<symbol id="tour-icon-complete" viewBox="0 0 20 20"><polyline points="4,10 8,15 17,4" fill="none" stroke="currentColor" stroke-width="1"></polyline></symbol>\n</svg>'))}},{key:"init",value:function(){var t,e=this;this.reset(),this._background=new x(this),this._stepsSrc===k.DOM&&(t=l(this._options.selector).nodes,this._steps=t.map(function(t){return new w(t,e)})),this._steps=this._steps.sort(function(t,e){return t.index-e.index}),this._steps[0].first=!0,this._steps[this.length-1].last=!0}},{key:"reset",value:function(){this._active&&this.stop(),this._stepsSrc===k.DOM&&(this._steps=[]),this._current=0}},{key:"start",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;if(!this._ready)throw new Error("Tour is not configured properly. Check documentation.");this._options.restoreinitialposition&&(this._initialposition={top:window.scrollX,left:window.screenY,behavior:"smooth"}),this._active?this.go(t):(l(this._options.root).addClass("guided-tour"),this.init(),this._background.attach(this._options.root),this._steps.forEach(function(t){return t.attach(e._options.root)}),this._current=t,this.currentstep.show(),this._active=!0,this._options.onStart(this._options))}},{key:"action",value:function(t){if(this._active){var e=this.currentstep;if(e.actiontarget){var i=l(e.target).find(e.actiontarget);if(i)try{i.first().click()}catch(t){console.warn("Could not find actiontarget: "+e.actiontarget+" on step #"+e.index)}}this._options.onAction(e,t)}}},{key:"next",value:function(){this._active&&this.go(this.nextstep,"next")}},{key:"previous",value:function(){this._active&&this.go(this.previousstep,"previous")}},{key:"go",value:function(t,e){this._active&&this._current!==t&&(this.currentstep.hide(),this._background.show(),this._current=c(t,0,this.length-1),this._background.hide(),this.currentstep.show(),this._options.onStep(this.currentstep,e))}},{key:"stop",value:function(){this._active&&(this.currentstep.hide(),this._active=!1,this._background.remove(),this._steps.forEach(function(t){return t.remove()}),l(this._options.root).removeClass("guided-tour"),this._options.restoreinitialposition&&window.scrollTo(this._initialposition),this._options.onStop(this._options))}},{key:"complete",value:function(){this._active&&(this.stop(),this._options.onComplete())}}]),C}();
+var Tourguide=function(){var t,a=(function(t){var s=function(t,e){return this instanceof s?t instanceof s?t:("string"==typeof t&&(t=this.select(t,e)),t&&t.nodeName&&(t=[t]),void(this.nodes=this.slice(t))):new s(t,e)};s.prototype={get length(){return this.nodes.length}},s.prototype.nodes=[],s.prototype.addClass=function(){return this.eacharg(arguments,function(t,e){t.classList.add(e)})},s.prototype.adjacent=function(o,t,r){return"number"==typeof t&&(t=0===t?[]:new Array(t).join().split(",").map(Number.call,Number)),this.each(function(i,n){var e=document.createDocumentFragment();s(t||{}).map(function(t,e){e="function"==typeof o?o.call(this,t,e,i,n):o;return"string"==typeof e?this.generate(e):s(e)}).each(function(t){this.isInPage(t)?e.appendChild(s(t).clone().first()):e.appendChild(t)}),r.call(this,i,e)})},s.prototype.after=function(t,e){return this.adjacent(t,e,function(t,e){t.parentNode.insertBefore(e,t.nextSibling)})},s.prototype.append=function(t,e){return this.adjacent(t,e,function(t,e){t.appendChild(e)})},s.prototype.args=function(t,e,i){return"function"==typeof t&&(t=t(e,i)),"string"!=typeof t&&(t=this.slice(t).map(this.str(e,i))),t.toString().split(/[\s,]+/).filter(function(t){return t.length})},s.prototype.array=function(o){var r=this;return this.nodes.reduce(function(t,e,i){var n;return o?((n=o.call(r,e,i))||(n=!1),"string"==typeof n&&(n=s(n)),n instanceof s&&(n=n.nodes)):n=e.innerHTML,t.concat(!1!==n?n:[])},[])},s.prototype.attr=function(t,e,n){return n=n?"data-":"",this.pairs(t,e,function(t,e){return t.getAttribute(n+e)},function(t,e,i){t.setAttribute(n+e,i)})},s.prototype.before=function(t,e){return this.adjacent(t,e,function(t,e){t.parentNode.insertBefore(e,t)})},s.prototype.children=function(t){return this.map(function(t){return this.slice(t.children)}).filter(t)},s.prototype.clone=function(){return this.map(function(t,e){var i=t.cloneNode(!0),n=this.getAll(i);return this.getAll(t).each(function(t,e){for(var i in this.mirror)this.mirror[i]&&this.mirror[i](t,n.nodes[e])}),i})},s.prototype.getAll=function(t){return s([t].concat(s("*",t).nodes))},s.prototype.mirror={},s.prototype.mirror.events=function(t,e){if(t._e)for(var i in t._e)t._e[i].forEach(function(t){s(e).on(i,t.callback)})},s.prototype.mirror.select=function(t,e){s(t).is("select")&&(e.value=t.value)},s.prototype.mirror.textarea=function(t,e){s(t).is("textarea")&&(e.value=t.value)},s.prototype.closest=function(e){return this.map(function(t){do{if(s(t).is(e))return t}while((t=t.parentNode)&&t!==document)})},s.prototype.data=function(t,e){return this.attr(t,e,!0)},s.prototype.each=function(t){return this.nodes.forEach(t.bind(this)),this},s.prototype.eacharg=function(i,n){return this.each(function(e,t){this.args(i,e,t).forEach(function(t){n.call(this,e,t)},this)})},s.prototype.empty=function(){return this.each(function(t){for(;t.firstChild;)t.removeChild(t.firstChild)})},s.prototype.filter=function(e){var t=e instanceof s?function(t){return-1!==e.nodes.indexOf(t)}:"function"==typeof e?e:function(t){return t.matches=t.matches||t.msMatchesSelector||t.webkitMatchesSelector,t.matches(e||"*")};return s(this.nodes.filter(t))},s.prototype.find=function(e){return this.map(function(t){return s(e||"*",t)})},s.prototype.first=function(){return this.nodes[0]||!1},s.prototype.generate=function(t){return/^\s*<tr[> ]/.test(t)?s(document.createElement("table")).html(t).children().children().nodes:/^\s*<t(h|d)[> ]/.test(t)?s(document.createElement("table")).html(t).children().children().children().nodes:/^\s*</.test(t)?s(document.createElement("div")).html(t).children().nodes:document.createTextNode(t)},s.prototype.handle=function(){var t=this.slice(arguments).map(function(e){return"function"==typeof e?function(t){t.preventDefault(),e.apply(this,arguments)}:e},this);return this.on.apply(this,t)},s.prototype.hasClass=function(){return this.is("."+this.args(arguments).join("."))},s.prototype.html=function(e){return void 0===e?this.first().innerHTML||"":this.each(function(t){t.innerHTML=e})},s.prototype.is=function(t){return 0<this.filter(t).length},s.prototype.isInPage=function(t){return t!==document.body&&document.body.contains(t)},s.prototype.last=function(){return this.nodes[this.length-1]||!1},s.prototype.map=function(t){return t?s(this.array(t)).unique():this},s.prototype.not=function(e){return this.filter(function(t){return!s(t).is(e||!0)})},s.prototype.off=function(t,e,i){var n=null==e&&null==i,o=null,r=e;return"string"==typeof e&&(o=e,r=i),this.eacharg(t,function(e,i){s(e._e?e._e[i]:[]).each(function(t){(n||t.orig_callback===r&&t.selector===o)&&e.removeEventListener(i,t.callback)})})},s.prototype.on=function(t,e,o){var r=null,i=e;"string"==typeof e&&(r=e,i=o,e=function(e){var i=arguments,n=!1;s(e.currentTarget).find(r).each(function(t){if(t===e.target||t.contains(e.target)){n=!0;try{Object.defineProperty(e,"currentTarget",{get:function(){return t}})}catch(t){}o.apply(t,i)}}),n||e.currentTarget!==e.target||o.apply(e.target,i)});function n(t){return e.apply(this,[t].concat(t.detail||[]))}return this.eacharg(t,function(t,e){t.addEventListener(e,n),t._e=t._e||{},t._e[e]=t._e[e]||[],t._e[e].push({callback:n,orig_callback:i,selector:r})})},s.prototype.pairs=function(i,t,e,n){var o;return void 0!==t&&(o=i,(i={})[o]=t),"object"==typeof i?this.each(function(t){for(var e in i)n(t,e,i[e])}):this.length?e(this.first(),i):""},s.prototype.param=function(e){return Object.keys(e).map(function(t){return this.uri(t)+"="+this.uri(e[t])}.bind(this)).join("&")},s.prototype.parent=function(t){return this.map(function(t){return t.parentNode}).filter(t)},s.prototype.prepend=function(t,e){return this.adjacent(t,e,function(t,e){t.insertBefore(e,t.firstChild)})},s.prototype.remove=function(){return this.each(function(t){t.parentNode&&t.parentNode.removeChild(t)})},s.prototype.removeClass=function(){return this.eacharg(arguments,function(t,e){t.classList.remove(e)})},s.prototype.replace=function(t,e){var i=[];return this.adjacent(t,e,function(t,e){i=i.concat(this.slice(e.children)),t.parentNode.replaceChild(e,t)}),s(i)},s.prototype.scroll=function(){return this.first().scrollIntoView({behavior:"smooth"}),this},s.prototype.select=function(t,e){return t=t.replace(/^\s*/,"").replace(/\s*$/,""),/^</.test(t)?s().generate(t):(e||document).querySelectorAll(t)},s.prototype.serialize=function(){var n=this;return this.slice(this.first().elements).reduce(function(e,i){return!i.name||i.disabled||"file"===i.type||/(checkbox|radio)/.test(i.type)&&!i.checked?e:"select-multiple"===i.type?(s(i.options).each(function(t){t.selected&&(e+="&"+n.uri(i.name)+"="+n.uri(t.value))}),e):e+"&"+n.uri(i.name)+"="+n.uri(i.value)},"").slice(1)},s.prototype.siblings=function(t){return this.parent().children(t).not(this)},s.prototype.size=function(){return this.first().getBoundingClientRect()},s.prototype.slice=function(t){return t&&0!==t.length&&"string"!=typeof t&&"[object Function]"!==t.toString()?t.length?[].slice.call(t.nodes||t):[t]:[]},s.prototype.str=function(e,i){return function(t){return"function"==typeof t?t.call(this,e,i):t.toString()}},s.prototype.text=function(e){return void 0===e?this.first().textContent||"":this.each(function(t){t.textContent=e})},s.prototype.toggleClass=function(t,e){return!!e===e?this[e?"addClass":"removeClass"](t):this.eacharg(t,function(t,e){t.classList.toggle(e)})},s.prototype.trigger=function(t){var o=this.slice(arguments).slice(1);return this.eacharg(t,function(t,e){var i,n={bubbles:!0,cancelable:!0,detail:o};try{i=new window.CustomEvent(e,n)}catch(t){(i=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,o)}t.dispatchEvent(i)})},s.prototype.unique=function(){return s(this.nodes.reduce(function(t,e){return null!=e&&!1!==e&&-1===t.indexOf(e)?t.concat(e):t},[]))},s.prototype.uri=function(t){return encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},s.prototype.wrap=function(t){return this.map(function(e){return s(t).each(function(t){(function(t){for(;t.firstElementChild;)t=t.firstElementChild;return s(t)})(t).append(e.cloneNode(!0)),e.parentNode.replaceChild(t,e)})})},t.exports&&(t.exports=s,t.exports.u=s)}(t={exports:{}}),t.exports),v=(a.u,"complete"),u="canceled";function m(t,e,i){t.self===t?t.scrollTo(e,i):(t.scrollLeft=e,t.scrollTop=i)}function y(t){var e=t._scrollSettings;if(e){var i,n,o,r,s,c,a,l,u,h,p,d,f=e.maxSynchronousAlignments,c=(g=t,a=(i=e).align,l=i.target.getBoundingClientRect(),u=a&&null!=a.left?a.left:.5,h=a&&null!=a.top?a.top:.5,p=a&&null!=a.leftOffset?a.leftOffset:0,d=a&&null!=a.topOffset?a.topOffset:0,a=u,u=h,g=i.isWindow(g)?(o=Math.min(l.width,g.innerWidth),r=Math.min(l.height,g.innerHeight),s=l.left+g.pageXOffset-g.innerWidth*a+o*a,c=l.top+g.pageYOffset-g.innerHeight*u+r*u,c-=d,n=(s-=p)-g.pageXOffset,c-g.pageYOffset):(o=l.width,r=l.height,h=g.getBoundingClientRect(),i=l.left-(h.left-g.scrollLeft),h=l.top-(h.top-g.scrollTop),s=i+o*a-g.clientWidth*a,c=h+r*u-g.clientHeight*u,s-=p,c-=d,s=Math.max(Math.min(s,g.scrollWidth-g.clientWidth),0),c=Math.max(Math.min(c,g.scrollHeight-g.clientHeight),0),n=s-g.scrollLeft,c-g.scrollTop),{x:s,y:c,differenceX:n,differenceY:g}),n=Date.now()-e.startTime,g=Math.min(1/e.time*n,1);if(e.endIterations>=f)return m(t,c.x,c.y),t._scrollSettings=null,e.end(v);var g=1-e.ease(g);if(m(t,c.x-c.differenceX*g,c.y-c.differenceY*g),n>=e.time)return e.endIterations++,y(t);t=y.bind(null,t),!("requestAnimationFrame"in window?window.requestAnimationFrame(t):void setTimeout(t,16))}}function h(t){return t.self===t}function l(t){return"pageXOffset"in t||(t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth)&&"hidden"!==getComputedStyle(t).overflow}function p(){return!0}function d(t){if(t.assignedSlot)return d(t.assignedSlot);if(t.parentElement)return"BODY"===t.parentElement.tagName?t.parentElement.ownerDocument.defaultView||t.parentElement.ownerDocument.ownerWindow:t.parentElement;if(t.getRootNode){t=t.getRootNode();if(11===t.nodeType)return t.host}}function i(t,e,i){if(t){"function"==typeof e&&(i=e,e=null),(e=e||{}).time=isNaN(e.time)?1e3:e.time,e.ease=e.ease||function(t){return 1-Math.pow(1-t,t/2)};var n,o=d(t),r=1,s=e.validTarget||p,c=e.isScrollable;for(e.debug&&(console.log("About to scroll to",t),o||console.error("Target did not have a parent, is it mounted in the DOM?"));o;)if(e.debug&&console.log("Scrolling parent node",o),s(o,r)&&(c?c(o,l):l(o))&&(r++,n=function(t,e,i,n){var o,r=!e._scrollSettings,s=e._scrollSettings,c=Date.now(),a={passive:!0};function l(t){e._scrollSettings=null,e.parentElement&&e.parentElement._scrollSettings&&e.parentElement._scrollSettings.end(t),i.debug&&console.log("Scrolling ended with type",t,"for",e),n(t),o&&(e.removeEventListener("touchstart",o,a),e.removeEventListener("wheel",o,a))}return s&&s.end(u),null==(s=i.maxSynchronousAlignments)&&(s=3),e._scrollSettings={startTime:c,endIterations:0,target:t,time:i.time,ease:i.ease,align:i.align,isWindow:i.isWindow||h,maxSynchronousAlignments:s,end:l},"cancellable"in i&&!i.cancellable||(o=l.bind(null,u),e.addEventListener("touchstart",o,a),e.addEventListener("wheel",o,a)),r&&y(e),o}(t,o,e,a)),!(o=d(o))){a(v);break}return n}function a(t){--r||i&&i(t)}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t};function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i,n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};function c(t,e,i){return e=isNaN(e)?t:e,i=isNaN(i)?t:i,Math.max(e,Math.min(t,i))}function f(t){var e=a(t).size(),t=g();return{width:e.width,height:e.height,top:e.top,bottom:e.bottom,left:e.left,right:e.right,viewtop:e.top-t.scrollY,viewbottom:e.bottom-t.scrollY,viewleft:e.left-t.scrollX,viewright:e.right-t.scrollX}}function g(){return{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,bodyWidth:document.body.clientWidth,bodyHeight:document.body.clientHeight}}var w=(e(b,[{key:"el",get:function(){var t,e,i,n,o,r,s,c=this;return this.container||(t=a('<div role="figure" class="guided-tour-step-image">'+(this.image?'<img src="'+this.image+'" />':"")+"</div>"),e=a('<div role="heading" class="guided-tour-step-title">'+this.title+"</div>"),i=a('<div class="guided-tour-step-content">'+this.content+"</div>"),(n=a('<div class="guided-tour-step-footer">\n                <span role="button" class="guided-tour-step-button guided-tour-step-button-close" title="End tour">\n                    <svg class="guided-tour-icon" viewBox="0 0 20 20" width="16" height="16"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#tour-icon-close"></use></svg>\n                </span>\n                '+(this.last?'<span role="button" class="guided-tour-step-button guided-tour-step-button-complete" title="Complete tour">\n                        <svg class="guided-tour-icon" viewBox="0 0 20 20" width="32" height="32"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#tour-icon-complete"></use></svg>\n                    </span>':'<span role="button" class="guided-tour-step-button guided-tour-step-button-next" title="Next step">\n                        <svg class="guided-tour-icon" viewBox="0 0 20 20" width="32" height="32"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#tour-icon-next"></use></svg>\n                    </span>')+"\n                "+(1<this.context._steps.length?'<div class="guided-tour-step-footer-bullets">\n                    <ul>'+this.context._steps.map(function(t,e){return'<li  title="Go to step '+(e+1)+'" data-index="'+e+'" class="'+(t.index<c.index?"complete":t.index==c.index?"current":"")+'"></li>'}).join("")+"</ul>\n                </div>":"")+"\n            </div>")).find(".guided-tour-step-button-next").on("click",this.context.next),n.find(".guided-tour-step-button-close").on("click",this.context.stop),n.find(".guided-tour-step-button-complete").on("click",this.context.complete),n.find(".guided-tour-step-footer-bullets li").on("click",function(t){return c.context.go(parseInt(a(t.target).data("index")))}),(o=this.highlight=a('<div class="guided-tour-step-highlight"></div>')).on("click",this.context.action),r=this.tooltip=a('<div role="tooltip" class="guided-tour-step-tooltip"></div>'),s=this.arrow=a('<div aria-hidden="true" class="guided-tour-arrow"></div>'),r.append(s).append(t).append(e).append(i).append(n),this.container=a('<div role="dialog" class="guided-tour-step'+(this.first?" guided-tour-step-first":"")+(this.last?" guided-tour-step-last":"")+'"></div>'),this.container.append(o).append(r)),this.container}},{key:"target",get:function(){return this._target||a(this.selector).first()},set:function(t){this._target=t}}]),e(b,[{key:"attach",value:function(){a(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"body").append(this.el)}},{key:"remove",value:function(){this.hide(),this.el.remove()}},{key:"position",value:function(){var t,e,i,n,o;this.target&&null!==this.target.offsetParent?(n=f(this.target),o=g(),(e=this.highlight.first().style).top=n.top-this.context.options.padding+"px",e.left=n.left-this.context.options.padding+"px",e.width=n.width+2*this.context.options.padding+"px",e.height=n.height+2*this.context.options.padding+"px",t=this.tooltip,i=this.arrow,(e=t.first().style).opacity=.1,o.height/2>n.top?(t.addClass("guided-tour-arrow-top"),e.top=n.top+n.height+"px"):(t.addClass("guided-tour-arrow-bottom"),e.bottom=o.height-n.top+"px"),o.width/2>n.left?(e.left=n.left+"px",i.first().style.left=400<n.width?"18px":c(n.width/2,14,386)+"px"):(e.right=Math.max(o.width-n.right,40)+"px",i.first().style.right=o.width-n.right<40||400<n.width?"8px":c(n.width/2-8,14,386)+"px")):(i=g(),(o=this.highlight.first().style).top="0px",o.left="0px",o.width="0px",o.height="0px",o.boxShadow="none",(o=(n=this.tooltip).first().style).opacity=.1,o.top=i.height/2+"px",o.left=i.width/2+"px",n.addClass("guided-tour-arrow-none"),n.addClass("guided-tour-center"),this.context._background&&this.context._background.show())}},{key:"adjust",value:function(){var t=f(this.tooltip),e=g(),i=this.tooltip.first().style;t.top<0&&(i.top="8px"),t.top>e.height-t.height&&(i.top=e.height-t.height-40+"px"),t.left<0&&(i.left="8px"),t.right<40&&(i.right="40px"),i.opacity=1}},{key:"show",value:function(){var t=this;if(this.visible)return!1;function e(){t.position(),t.el.addClass("active"),t.adjust(),t.visible=!0}return this.target?i(this.target,{time:this.context.options.animationspeed},e):setTimeout(e,this.context.options.animationspeed),!0}},{key:"hide",value:function(){return!!this.visible&&(this.el.removeClass("active"),this.tooltip.removeClass("guided-tour-arrow-top"),!(this.visible=!1))}},{key:"toJSON",value:function(){var t=this;return index=t.index,title=t.title,contnet=t.contnet,image=t.image,active=t.active,t}}]),b);function b(t,e){var i=this;r(this,b),this.index=0,this.first=!1,this.last=!1,this.target=null,this.container=null,this.highlight=null,this.tooltip=null,this.arrow=null,this.rect={},this.image=null,this.title="",this.content="",this.active=!1,this.context=null,this.visible=!1,this._target=null,this.context=e;var n=void 0;if("object"===(void 0===t?"undefined":o(t))){if(!(t.hasOwnProperty("title")&&t.hasOwnProperty("content")&&t.hasOwnProperty("step")))throw new Error("invalid step parameter:\n"+JSON.stringify(t,null,2)+"\nsee this doc for more detail: https://github.com/LikaloLLC/tourguide.js#json-based-approach");n=t,this.selector=t.selector}else this.target=t,n=function(t,e){var i=0<arguments.length&&void 0!==t?t:"",n=1<arguments.length&&void 0!==e?e:{},i=i.split(";"),o=s({},n);return i.forEach(function(t){t=(t||"").split(":");o[(t[0]||"").trim()]=(t[1]||"").trim()}),o}(a(t).data("tour"));this.index=parseInt(n.step),this.title=n.title,this.content=n.content,this.actiontarget=n.actiontarget,this.image=n.image,n.image&&e.options.preloadimages&&!/^data:/i.test(n.image)&&((n=new Image).onerror=function(){i.image=null},n.src=this.image)}var x=(e(_,[{key:"el",get:function(){return this.container||(this.container=a('<div role="dialog" class="guided-tour-background"></div>')),this.container}}]),e(_,[{key:"attach",value:function(){a(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"body").append(this.el)}},{key:"remove",value:function(){this.hide(),this.el.remove()}},{key:"show",value:function(){return!this.visible&&(this.el.addClass("active"),this.visible=!0)}},{key:"hide",value:function(){var t=this;if(this.visible){function e(){t.el.removeClass("active"),t.visible=!1}return setTimeout(e,this.context.options.animationspeed),!0}return!1}},{key:"toJSON",value:function(){return active=this.active,this}}]),_);function _(t){r(this,_),this.container=null,this.active=!1,this.context=t}var k={DOM:0,JSON:1,REMOTE:2};function C(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(r(this,C),this._options=Object.assign({root:"body",selector:"[data-tour]",animationspeed:300,padding:5,steps:null,src:null,restoreinitialposition:!0,preloadimages:!1,request:{options:{mode:"cors",cache:"no-cache"},headers:{"Content-Type":"application/json"}},onStart:function(){},onStop:function(){},onComplete:function(){},onStep:function(){},onAction:function(){}},t),this._background=null,this._steps=[],this._current=0,this._active=!1,this._stepsSrc=k.DOM,this._ready=!1,this._initialposition=null,this.start=this.start.bind(this),this.action=this.action.bind(this),this.next=this.next.bind(this),this.previous=this.previous.bind(this),this.go=this.go.bind(this),this.stop=this.stop.bind(this),this.complete=this.complete.bind(this),this._injectIcons(),"object"===o(this._options.steps)&&Array.isArray(this._options.steps))this._stepsSrc=k.JSON,this._steps=this._options.steps.map(function(t){return new w(t,e)}),this._ready=!0;else if("string"==typeof this._options.src)this._stepsSrc=k.REMOTE,fetch(new Request(this._options.src,this._options.request)).then(function(t){return t.json().then(function(t){e._steps=t.map(function(t){return new w(t,e)}),e._ready=!0})});else{if(!(0<a(this._options.selector).length))throw new Error("Tour is not configured properly. Check documentation.");this._ready=!0}}return e(C,[{key:"currentstep",get:function(){return this._steps[this._current]}},{key:"length",get:function(){return this._steps.length}},{key:"steps",get:function(){return this._steps.map(function(t){return t.toJSON()})}},{key:"hasnext",get:function(){return this.nextstep!==this._current}},{key:"nextstep",get:function(){return c(this._current+1,0,this.length-1)}},{key:"previousstep",get:function(){return c(this._current-1,0)}},{key:"options",get:function(){return this._options}}]),e(C,[{key:"_injectIcons",value:function(){0===a("#GuidedTourIconSet").length&&a("body").append(a('<svg id="GuidedTourIconSet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<symbol id="tour-icon-close" viewBox="0 0 20 20"><path d="M16,16 L4,4" fill="none" stroke="currentColor" stroke-width="1"></path><path d="M16,4 L4,16" fill="none" stroke="currentColor" stroke-width="1"></path></symbol>\n<symbol id="tour-icon-next" viewBox="0 0 20 20"><polyline points="7 4 13 10 7 16" fill="none" stroke="currentColor" stroke-width="1"></polyline></symbol>\n<symbol id="tour-icon-complete" viewBox="0 0 20 20"><polyline points="4,10 8,15 17,4" fill="none" stroke="currentColor" stroke-width="1"></polyline></symbol>\n</svg>'))}},{key:"init",value:function(){var t,e=this;this.reset(),this._background=new x(this),this._stepsSrc===k.DOM&&(t=a(this._options.selector).nodes,this._steps=t.map(function(t){return new w(t,e)})),this._steps=this._steps.sort(function(t,e){return t.index-e.index}),this._steps[0].first=!0,this._steps[this.length-1].last=!0}},{key:"reset",value:function(){this._active&&this.stop(),this._stepsSrc===k.DOM&&(this._steps=[]),this._current=0}},{key:"start",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;if(!this._ready)throw new Error("Tour is not configured properly. Check documentation.");this._options.restoreinitialposition&&(this._initialposition={top:window.scrollX,left:window.screenY,behavior:"smooth"}),this._active?this.go(t):(a(this._options.root).addClass("guided-tour"),this.init(),this._background.attach(this._options.root),this._steps.forEach(function(t){return t.attach(e._options.root)}),this._current=t,this.currentstep.show(),this._active=!0,this._options.onStart(this._options))}},{key:"action",value:function(t){if(this._active){var e=this.currentstep;if(e.actiontarget){var i=a(e.target).find(e.actiontarget);if(i)try{i.first().click()}catch(t){console.warn("Could not find actiontarget: "+e.actiontarget+" on step #"+e.index)}}this._options.onAction(e,t)}}},{key:"next",value:function(){this._active&&this.go(this.nextstep,"next")}},{key:"previous",value:function(){this._active&&this.go(this.previousstep,"previous")}},{key:"go",value:function(t,e){this._active&&this._current!==t&&(this.currentstep.hide(),this._background.show(),this._current=c(t,0,this.length-1),this._background.hide(),this.currentstep.show(),this._options.onStep(this.currentstep,e))}},{key:"stop",value:function(){this._active&&(this.currentstep.hide(),this._active=!1,this._background.remove(),this._steps.forEach(function(t){return t.remove()}),a(this._options.root).removeClass("guided-tour"),this._options.restoreinitialposition&&window.scrollTo(this._initialposition),this._options.onStop(this._options))}},{key:"complete",value:function(){this._active&&(this.stop(),this._options.onComplete())}}]),C}();