UNPKG

vue-shepherd

Version:

A Vue wrapper for the site tour library Shepherd.

1 lines 42.6 kB
var VueShepherd=function(t){"use strict";/*! shepherd.js 15.0.0 */function e(t){return t instanceof HTMLElement}function n(t){return"function"==typeof t}function o(t){return"string"==typeof t}function i(t){return void 0===t}class s{on(t,e,n,o=!1){var s;return i(this.bindings)&&(this.bindings={}),i(this.bindings[t])&&(this.bindings[t]=[]),null==(s=this.bindings[t])||s.push({handler:e,ctx:n,once:o}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return i(this.bindings)||i(this.bindings[t])||(i(e)?delete this.bindings[t]:null==(n=this.bindings[t])||n.forEach(((n,o)=>{var i;n.handler===e&&(null==(i=this.bindings[t])||i.splice(o,1))}))),this;var n}trigger(t,...e){var n;return!i(this.bindings)&&this.bindings[t]&&(null==(n=this.bindings[t])||n.forEach(((n,o)=>{const{ctx:i,handler:s,once:r}=n,l=i||this;var c;s.apply(l,e),r&&(null==(c=this.bindings[t])||c.splice(o,1))}))),this}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r.apply(null,arguments)}function l(t,e){if(null==t)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==e.indexOf(o))continue;n[o]=t[o]}return n}const c={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function a(t,e){return e}function u(t,e){return t.filter((t=>void 0!==t))}var h;function d(t){return"object"!=typeof t||null===t?0:Array.isArray(t)?2:function(t){if(!g.includes(Object.prototype.toString.call(t)))return!1;const{constructor:e}=t;if(void 0===e)return!0;const n=e.prototype;return!(null===n||"object"!=typeof n||!g.includes(Object.prototype.toString.call(n)))&&!!n.hasOwnProperty("isPrototypeOf")}(t)?1:t instanceof Set?3:t instanceof Map?4:5}function f(t,e){return"object"==typeof t&&Object.prototype.propertyIsEnumerable.call(t,e)}function p(t){var e;let n=0,o=null==(e=t[0])?void 0:e[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(void 0===o)return{done:!0,value:void 0};const i=o.next();if(!0!==i.done)return{done:!1,value:i.value};var e;n+=1,o=null==(e=t[n])?void 0:e[Symbol.iterator]()}}})}}!function(t){t[t.NOT=0]="NOT",t[t.RECORD=1]="RECORD",t[t.ARRAY=2]="ARRAY",t[t.SET=3]="SET",t[t.MAP=4]="MAP",t[t.OTHER=5]="OTHER"}(h||(h={}));const g=["[object Object]","[object Module]"],m={mergeRecords:function(t,e,n){const o={};for(const i of function(t){const e=new Set;for(const n of t)for(const t of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])e.add(t);return e}(t)){const s=[];for(const e of t)f(e,i)&&s.push(e[i]);if(0===s.length)continue;const r=e.metaDataUpdater(n,{key:i,parents:t}),l=y(s,e,r);l!==c.skip&&("__proto__"===i?Object.defineProperty(o,i,{value:l,configurable:!0,enumerable:!0,writable:!0}):o[i]=l)}return o},mergeArrays:function(t){return t.flat()},mergeSets:function(t){return new Set(p(t))},mergeMaps:function(t){return new Map(p(t))},mergeOthers:function(t){return t.at(-1)}};function v(...t){return function(){const t=function(t,e){var n,o,i;return{defaultMergeFunctions:m,mergeFunctions:r({},m,Object.fromEntries(Object.entries(t).filter((([t,e])=>Object.hasOwn(m,t))).map((([t,e])=>!1===e?[t,m.mergeOthers]:[t,e])))),metaDataUpdater:null!=(n=t.metaDataUpdater)?n:a,deepmerge:e,useImplicitDefaultMerging:null!=(o=t.enableImplicitDefaultMerging)&&o,filterValues:!1===t.filterValues?void 0:null!=(i=t.filterValues)?i:u,actions:c}}({},e);function e(...e){return y(e,t,undefined)}return e}()(...t)}function y(t,e,n){var o;const i=null!=(o=null==e.filterValues?void 0:e.filterValues(t,n))?o:t;if(0===i.length)return;if(1===i.length)return x(i,e,n);const s=d(i[0]);if(0!==s&&5!==s)for(let t=1;t<i.length;t++)if(d(i[t])!==s)return x(i,e,n);switch(s){case 1:return function(t,e,n){const o=e.mergeFunctions.mergeRecords(t,e,n);return o===c.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,n):o}(i,e,n);case 2:return function(t,e,n){const o=e.mergeFunctions.mergeArrays(t,e,n);return o===c.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):o}(i,e,n);case 3:return function(t,e,n){const o=e.mergeFunctions.mergeSets(t,e,n);return o===c.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):o}(i,e,n);case 4:return function(t,e,n){const o=e.mergeFunctions.mergeMaps(t,e,n);return o===c.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):o}(i,e,n);default:return x(i,e,n)}}function x(t,e,n){const o=e.mergeFunctions.mergeOthers(t,e,n);return o===c.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):o}function b(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const o=e[n],i=t[o];"constructor"!==o&&"function"==typeof i&&(t[o]=i.bind(t))}return t}function w(t){return o(t)&&""!==t?"-"!==t.charAt(t.length-1)?`${t}-`:t:""}function O(t){return null==t||!t.element||!t.on}function E(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}const T=["start","end"],S=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+T[0],e+"-"+T[1])),[]),A=Math.min,_=Math.max,L=Math.round,R=Math.floor,M=t=>({x:t,y:t}),P={left:"right",right:"left",bottom:"top",top:"bottom"},C={start:"end",end:"start"};function k(t,e,n){return _(t,A(e,n))}function D(t,e){return"function"==typeof t?t(e):t}function $(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function I(t){return"x"===t?"y":"x"}function H(t){return"y"===t?"height":"width"}const j=new Set(["top","bottom"]);function B(t){return j.has($(t))?"y":"x"}function V(t){return I(B(t))}function N(t,e,n){void 0===n&&(n=!1);const o=F(t),i=V(t),s=H(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=X(r)),[r,X(r)]}function W(t){return t.replace(/start|end/g,(t=>C[t]))}const q=["left","right"],U=["right","left"],z=["top","bottom"],Y=["bottom","top"];function X(t){return t.replace(/left|right|bottom|top/g,(t=>P[t]))}function Z(t){return"number"!=typeof t?function(t){return r({top:0,right:0,bottom:0,left:0},t)}(t):{top:t,right:t,bottom:t,left:t}}function K(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}const G=["crossAxis","alignment","allowedPlacements","autoAlignment"],J=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],Q=["mainAxis","crossAxis","limiter"];function tt(t,e,n){let{reference:o,floating:i}=t;const s=B(e),r=V(e),l=H(r),c=$(e),a="y"===s,u=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,d=o[l]/2-i[l]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:h};break;case"left":f={x:o.x-i.width,y:h};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=d*(n&&a?-1:1);break;case"end":f[r]+=d*(n&&a?-1:1)}return f}async function et(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=D(e,t),p=Z(f),g=l[d?"floating"===h?"reference":"floating":h],m=K(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(g)))||n?g:g.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),v="floating"===h?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},b=K(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-b.top+p.top)/x.y,bottom:(b.bottom-m.bottom+p.bottom)/x.y,left:(m.left-b.left+p.left)/x.x,right:(b.right-m.right+p.right)/x.x}}const nt=new Set(["left","top"]);function ot(){return"undefined"!=typeof window}function it(t){return lt(t)?(t.nodeName||"").toLowerCase():"#document"}function st(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function rt(t){var e;return null==(e=(lt(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function lt(t){return!!ot()&&(t instanceof Node||t instanceof st(t).Node)}function ct(t){return!!ot()&&(t instanceof Element||t instanceof st(t).Element)}function at(t){return!!ot()&&(t instanceof HTMLElement||t instanceof st(t).HTMLElement)}function ut(t){return!(!ot()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof st(t).ShadowRoot)}const ht=new Set(["inline","contents"]);function dt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Tt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!ht.has(i)}const ft=new Set(["table","td","th"]);function pt(t){return ft.has(it(t))}const gt=[":popover-open",":modal"];function mt(t){return gt.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const vt=["transform","translate","scale","rotate","perspective"],yt=["transform","translate","scale","rotate","perspective","filter"],xt=["paint","layout","strict","content"];function bt(t){const e=wt(),n=ct(t)?Tt(t):t;return vt.some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||yt.some((t=>(n.willChange||"").includes(t)))||xt.some((t=>(n.contain||"").includes(t)))}function wt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ot=new Set(["html","body","#document"]);function Et(t){return Ot.has(it(t))}function Tt(t){return st(t).getComputedStyle(t)}function St(t){return ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function At(t){if("html"===it(t))return t;const e=t.assignedSlot||t.parentNode||ut(t)&&t.host||rt(t);return ut(e)?e.host:e}function _t(t){const e=At(t);return Et(e)?t.ownerDocument?t.ownerDocument.body:t.body:at(e)&&dt(e)?e:_t(e)}function Lt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=_t(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),r=st(i);if(s){const t=Rt(r);return e.concat(r,r.visualViewport||[],dt(i)?i:[],t&&n?Lt(t):[])}return e.concat(i,Lt(i,[],n))}function Rt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mt(t){const e=Tt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=at(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,l=L(n)!==s||L(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function Pt(t){return ct(t)?t:t.contextElement}function Ct(t){const e=Pt(t);if(!at(e))return M(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Mt(e);let r=(s?L(n.width):n.width)/o,l=(s?L(n.height):n.height)/i;return r&&Number.isFinite(r)||(r=1),l&&Number.isFinite(l)||(l=1),{x:r,y:l}}const kt=M(0);function Dt(t){const e=st(t);return wt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:kt}function $t(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),s=Pt(t);let r=M(1);e&&(o?ct(o)&&(r=Ct(o)):r=Ct(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==st(t))&&e}(s,n,o)?Dt(s):M(0);let c=(i.left+l.x)/r.x,a=(i.top+l.y)/r.y,u=i.width/r.x,h=i.height/r.y;if(s){const t=st(s),e=o&&ct(o)?st(o):o;let n=t,i=Rt(n);for(;i&&o&&e!==n;){const t=Ct(i),e=i.getBoundingClientRect(),o=Tt(i),s=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,a*=t.y,u*=t.x,h*=t.y,c+=s,a+=r,n=st(i),i=Rt(n)}}return K({width:u,height:h,x:c,y:a})}function Ft(t,e){const n=St(t).scrollLeft;return e?e.left+n:$t(rt(t)).left+n}function It(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-Ft(t,n),y:n.top+e.scrollTop}}const Ht=new Set(["absolute","fixed"]);function jt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=st(t),o=rt(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,c=0;if(i){s=i.width,r=i.height;const t=wt();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,c=i.offsetTop)}const a=Ft(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(o.clientWidth-e.clientWidth-i);r<=25&&(s-=r)}else a<=25&&(s+=a);return{width:s,height:r,x:l,y:c}}(t,n);else if("document"===e)o=function(t){const e=rt(t),n=St(t),o=t.ownerDocument.body,i=_(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=_(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ft(t);const l=-n.scrollTop;return"rtl"===Tt(o).direction&&(r+=_(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}(rt(t));else if(ct(e))o=function(t,e){const n=$t(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=at(t)?Ct(t):M(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(e,n);else{const n=Dt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return K(o)}function Bt(t,e){const n=At(t);return!(n===e||!ct(n)||Et(n))&&("fixed"===Tt(n).position||Bt(n,e))}function Vt(t,e,n){const o=at(e),i=rt(e),s="fixed"===n,r=$t(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=M(0);function a(){c.x=Ft(i)}if(o||!o&&!s)if(("body"!==it(e)||dt(i))&&(l=St(e)),o){const t=$t(e,!0,s,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&a();s&&!o&&i&&a();const u=!i||o||s?M(0):It(i,l);return{x:r.left+l.scrollLeft-c.x-u.x,y:r.top+l.scrollTop-c.y-u.y,width:r.width,height:r.height}}function Nt(t){return"static"===Tt(t).position}function Wt(t,e){if(!at(t)||"fixed"===Tt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return rt(t)===n&&(n=n.ownerDocument.body),n}function qt(t,e){const n=st(t);if(mt(t))return n;if(!at(t)){let e=At(t);for(;e&&!Et(e);){if(ct(e)&&!Nt(e))return e;e=At(e)}return n}let o=Wt(t,e);for(;o&&pt(o)&&Nt(o);)o=Wt(o,e);return o&&Et(o)&&Nt(o)&&!bt(o)?n:o||function(t){let e=At(t);for(;at(e)&&!Et(e);){if(bt(e))return e;if(mt(e))return null;e=At(e)}return null}(t)||n}const Ut={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,r=rt(o),l=!!e&&mt(e.floating);if(o===r||l&&s)return n;let c={scrollLeft:0,scrollTop:0},a=M(1);const u=M(0),h=at(o);if((h||!h&&!s)&&(("body"!==it(o)||dt(r))&&(c=St(o)),at(o))){const t=$t(o);a=Ct(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const d=!r||h||s?M(0):It(r,c);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+d.x,y:n.y*a.y-c.scrollTop*a.y+u.y+d.y}},getDocumentElement:rt,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[..."clippingAncestors"===n?mt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=Lt(t,[],!1).filter((t=>ct(t)&&"body"!==it(t))),i=null;const s="fixed"===Tt(t).position;let r=s?At(t):t;for(;ct(r)&&!Et(r);){const e=Tt(r),n=bt(r);n||"fixed"!==e.position||(i=null),(s?!n&&!i:!n&&"static"===e.position&&i&&Ht.has(i.position)||dt(r)&&!n&&Bt(t,r))?o=o.filter((t=>t!==r)):i=e,r=At(r)}return e.set(t,o),o}(e,this._c):[].concat(n),o],r=s[0],l=s.reduce(((t,n)=>{const o=jt(e,n,i);return t.top=_(o.top,t.top),t.right=A(o.right,t.right),t.bottom=A(o.bottom,t.bottom),t.left=_(o.left,t.left),t}),jt(e,r,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:qt,getElementRects:async function(t){const e=this.getOffsetParent||qt,n=this.getDimensions,o=await n(t.floating);return{reference:Vt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=Mt(t);return{width:e,height:n}},getScale:Ct,isElement:ct,isRTL:function(t){return"rtl"===Tt(t).direction}};function zt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Yt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,u=Pt(t),h=i||s?[...u?Lt(u):[],...Lt(e)]:[];h.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));const d=u&&c?function(t,e){let n,o=null;const i=rt(t);function s(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(c,a){void 0===c&&(c=!1),void 0===a&&(a=1),s();const u=t.getBoundingClientRect(),{left:h,top:d,width:f,height:p}=u;if(c||e(),!f||!p)return;const g={rootMargin:-R(d)+"px "+-R(i.clientWidth-(h+f))+"px "+-R(i.clientHeight-(d+p))+"px "+-R(h)+"px",threshold:_(0,A(1,a))||1};let m=!0;function v(e){const o=e[0].intersectionRatio;if(o!==a){if(!m)return l();o?l(!1,o):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}1!==o||zt(u,t.getBoundingClientRect())||l(),m=!1}try{o=new IntersectionObserver(v,r({},g,{root:i.ownerDocument}))}catch(t){o=new IntersectionObserver(v,g)}o.observe(t)}(!0),s}(u,n):null;let f,p=-1,g=null;l&&(g=new ResizeObserver((t=>{let[o]=t;o&&o.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=g)||t.observe(e)}))),n()})),u&&!a&&g.observe(u),g.observe(e));let m=a?$t(t):null;return a&&function e(){const o=$t(t);m&&!zt(m,o)&&n(),m=o,f=requestAnimationFrame(e)}(),n(),()=>{var t;h.forEach((t=>{i&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==d||d(),null==(t=g)||t.disconnect(),g=null,a&&cancelAnimationFrame(f)}}const Xt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:s,middlewareData:r,placement:c,platform:a,elements:u}=e,h=D(t,e),{crossAxis:d=!1,alignment:f,allowedPlacements:p=S,autoAlignment:g=!0}=h,m=l(h,G),v=void 0!==f||p===S?function(t,e,n){return(t?[...n.filter((e=>F(e)===t)),...n.filter((e=>F(e)!==t))]:n.filter((t=>$(t)===t))).filter((n=>!t||F(n)===t||!!e&&W(n)!==n))}(f||null,g,p):p,y=await a.detectOverflow(e,m),x=(null==(n=r.autoPlacement)?void 0:n.index)||0,b=v[x];if(null==b)return{};const w=N(b,s,await(null==a.isRTL?void 0:a.isRTL(u.floating)));if(c!==b)return{reset:{placement:v[0]}};const O=[y[$(b)],y[w[0]],y[w[1]]],E=[...(null==(o=r.autoPlacement)?void 0:o.overflows)||[],{placement:b,overflows:O}],T=v[x+1];if(T)return{data:{index:x+1,overflows:E},reset:{placement:T}};const A=E.map((t=>{const e=F(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),_=(null==(i=A.filter((t=>t[2].slice(0,F(t[0])?2:3).every((t=>t<=0))))[0])?void 0:i[0])||A[0][0];return _!==c?{data:{index:x+1,overflows:E},reset:{placement:_}}:{}}}},Zt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,c=D(t,e),{mainAxis:a=!0,crossAxis:u=!1,limiter:h={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}}}=c,d=l(c,Q),f={x:n,y:o},p=await s.detectOverflow(e,d),g=B($(i)),m=I(g);let v=f[m],y=f[g];if(a){const t="y"===m?"bottom":"right";v=k(v+p["y"===m?"top":"left"],v,v-p[t])}if(u){const t="y"===g?"bottom":"right";y=k(y+p["y"===g?"top":"left"],y,y-p[t])}const x=h.fn(r({},e,{[m]:v,[g]:y}));return r({},x,{data:{x:x.x-n,y:x.y-o,enabled:{[m]:a,[g]:u}}})}}},Kt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:a,elements:u}=e,h=D(t,e),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0}=h,y=l(h,J);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const x=$(i),b=B(c),w=$(c)===c,O=await(null==a.isRTL?void 0:a.isRTL(u.floating)),E=p||(w||!v?[X(c)]:function(t){const e=X(t);return[W(t),e,W(e)]}(c)),T="none"!==m;!p&&T&&E.push(...function(t,e,n,o){const i=F(t);let s=function(t,e,n){switch(t){case"top":case"bottom":return n?e?U:q:e?q:U;case"left":case"right":return e?z:Y;default:return[]}}($(t),"start"===n,o);return i&&(s=s.map((t=>t+"-"+i)),e&&(s=s.concat(s.map(W)))),s}(c,v,m,O));const S=[c,...E],A=await a.detectOverflow(e,y),_=[];let L=(null==(o=s.flip)?void 0:o.overflows)||[];if(d&&_.push(A[x]),f){const t=N(i,r,O);_.push(A[t[0]],A[t[1]])}if(L=[...L,{placement:i,overflows:_}],!_.every((t=>t<=0))){var R,M;const t=((null==(R=s.flip)?void 0:R.index)||0)+1,e=S[t];if(e&&("alignment"!==f||b===B(e)||L.every((t=>B(t.placement)!==b||t.overflows[0]>0))))return{data:{index:t,overflows:L},reset:{placement:e}};let n=null==(M=L.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(g){case"bestFit":{var P;const t=null==(P=L.filter((t=>{if(T){const e=B(t.placement);return e===b||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:P[0];t&&(n=t);break}case"initialPlacement":n=c}if(i!==n)return{reset:{placement:n}}}return{}}}},Gt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:s,platform:l,elements:c,middlewareData:a}=e,{element:u,padding:h=0}=D(t,e)||{};if(null==u)return{};const d=Z(h),f={x:n,y:o},p=V(i),g=H(p),m=await l.getDimensions(u),v="y"===p,y=v?"top":"left",x=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[p]-f[p]-s.floating[g],O=f[p]-s.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let T=E?E[b]:0;T&&await(null==l.isElement?void 0:l.isElement(E))||(T=c.floating[b]||s.floating[g]);const S=w/2-O/2,_=T/2-m[g]/2-1,L=A(d[y],_),R=A(d[x],_),M=L,P=T-m[g]-R,C=T/2-m[g]/2+S,$=k(M,C,P),I=!a.arrow&&null!=F(i)&&C!==$&&s.reference[g]/2-(C<M?L:R)-m[g]/2<0,j=I?C<M?C-M:C-P:0;return{[p]:f[p]+j,data:r({[p]:$,centerOffset:C-$-j},I&&{alignmentOffset:j}),reset:I}}}),Jt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:s,middlewareData:l}=e,{offset:c=0,mainAxis:a=!0,crossAxis:u=!0}=D(t,e),h={x:n,y:o},d=B(i),f=I(d);let p=h[f],g=h[d];const m=D(c,e),v="number"==typeof m?{mainAxis:m,crossAxis:0}:r({mainAxis:0,crossAxis:0},m);if(a){const t="y"===f?"height":"width",e=s.reference[f]-s.floating[t]+v.mainAxis,n=s.reference[f]+s.reference[t]-v.mainAxis;p<e?p=e:p>n&&(p=n)}if(u){var y,x;const t="y"===f?"width":"height",e=nt.has($(i)),n=s.reference[d]-s.floating[t]+(e&&(null==(y=l.offset)?void 0:y[d])||0)+(e?0:v.crossAxis),o=s.reference[d]+s.reference[t]+(e?0:(null==(x=l.offset)?void 0:x[d])||0)-(e?v.crossAxis:0);g<n?g=n:g>o&&(g=o)}return{[f]:p,[d]:g}}}},Qt=(t,e,n)=>{const o=new Map,i=r({platform:Ut},n),s=r({},i.platform,{_c:o});return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,c=s.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(e));let u=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=tt(u,o,a),f=o,p={},g=0;for(let n=0;n<c.length;n++){var m;const{name:s,fn:v}=c[n],{x:y,y:x,data:b,reset:w}=await v({x:h,y:d,initialPlacement:o,placement:f,strategy:i,middlewareData:p,rects:u,platform:r({},l,{detectOverflow:null!=(m=l.detectOverflow)?m:et}),elements:{reference:t,floating:e}});h=null!=y?y:h,d=null!=x?x:d,p=r({},p,{[s]:r({},p[s],b)}),w&&g<=50&&(g++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(u=!0===w.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):w.rects),({x:h,y:d}=tt(u,f,a))),n=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:p}})(t,e,r({},i,{platform:s}))};function te(t,e,...n){const o=document.createElement(t);return ne(o,e),oe(o,n),o}function ee(t,e,...n){const o=document.createElementNS("http://www.w3.org/2000/svg",t);return ne(o,e),oe(o,n),o}function ne(t,e){if(e)for(const[n,o]of Object.entries(e))null!=o&&!1!==o&&(n.startsWith("on")&&"function"==typeof o?t.addEventListener(n.slice(2).toLowerCase(),o):"disabled"===n&&!0===o?t.disabled=!0:t.setAttribute(n,String(o)))}function oe(t,e){for(const n of e)null!=n&&!1!==n&&t.append("string"==typeof n?document.createTextNode(n):n)}function ie(t,e){return n(t)?t.call(e):t}function se(t,e){const n=t.action?t.action.bind(e.tour):null,o=!!t.disabled&&ie(t.disabled,e),i=t.label?ie(t.label,e):null,s=t.text?ie(t.text,e):null,r=te("button",{"aria-label":i||null,class:`${t.classes||""} shepherd-button ${t.secondary?"shepherd-button-secondary":""}`,disabled:o||null,onclick:n,tabindex:"0",type:"button"});return s&&(r.innerHTML=s),r}function re(t,o,s){const r=te("div",{class:"shepherd-content"});return(!i(s.options.title)||s.options.cancelIcon&&s.options.cancelIcon.enabled)&&r.append(function(t,e){const o=te("header",{class:"shepherd-header"});return e.options.title&&o.append(function(t,e){const o=te("h3",{id:t,class:"shepherd-title"}),i=n(e)?e():e;return o.innerHTML=i,o}(t,e.options.title)),e.options.cancelIcon&&e.options.cancelIcon.enabled&&o.append(function(t,e){return te("button",{"aria-label":t.label?t.label:"Close Tour",class:"shepherd-cancel-icon",onclick:t=>{t.preventDefault(),e.cancel()},type:"button"},te("span",{"aria-hidden":"true"},"×"))}(e.options.cancelIcon,e)),o}(o,s)),i(s.options.text)||r.append(function(t,o){const i=te("div",{class:"shepherd-text",id:t});let s=o.options.text;return n(s)&&(s=s.call(o)),e(s)?i.appendChild(s):i.innerHTML=s,i}(t,s)),Array.isArray(s.options.buttons)&&s.options.buttons.length&&r.append(function(t){const e=te("footer",{class:"shepherd-footer"});if(t.options.buttons)for(const n of t.options.buttons)e.append(se(n,t));return e}(s)),r}class le extends s{constructor(t,e={}){return super(),this._resolvedAttachTo=void 0,this._resolvedExtraHighlightElements=void 0,this._originalTabIndexes=void 0,this.classPrefix=void 0,this.el=void 0,this.shepherdElementComponent=void 0,this.target=void 0,this.tour=void 0,this.tour=t,this.classPrefix=this.tour.options?w(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,this._originalTabIndexes=new Map,b(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this._teardownElements(),this.trigger("destroy")}_teardownElements(){this.cleanup&&this.cleanup(),this.cleanup=null,this.shepherdElementComponent&&(this.shepherdElementComponent.cleanup(),this.shepherdElementComponent=void 0),e(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this._originalTabIndexes.clear()}getTour(){return this.tour}hide(){var t;null==(t=this.tour.modal)||t.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveExtraHiglightElements(){return this._resolvedExtraHighlightElements=this.options.extraHighlights?this.options.extraHighlights.flatMap((t=>Array.from(document.querySelectorAll(t)))):[],this._resolvedExtraHighlightElements}_resolveAttachToOptions(){return this._resolvedAttachTo=function(t){const e=t.options.attachTo||{},i=Object.assign({},e);if(n(i.element)&&(i.element=i.element.call(t)),o(i.element)){try{i.element=document.querySelector(i.element)}catch(t){}i.element}return i}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){return n(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then((()=>this._show())):Promise.resolve(this._show())}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.el&&(this._teardownElements(),this._setupElements())}getElement(){return this.el}getTarget(){return this.target}_storeOriginalTabIndex(t){const e=t.getAttribute("tabindex");null!==e&&this._originalTabIndexes.set(t,e)}_restoreOriginalTabIndexes(){const t=this.target;t&&(this._originalTabIndexes.has(t)?t.setAttribute("tabindex",this._originalTabIndexes.get(t)):t.removeAttribute("tabindex"))}_createTooltipContent(){const t=`${this.id}-description`,e=`${this.id}-label`;return this.shepherdElementComponent=function(t){var e,n,s,r;const{classPrefix:l,descriptionId:c,labelId:a,step:u}=t;let h,d,f,p,g,m,v;const y=null!=(e=null==(n=u.options)||null==(n=n.cancelIcon)?void 0:n.enabled)&&e,x=null!=(s=null==(r=u.options)?void 0:r.title)&&s,b=t=>{const{tour:e}=u;switch(t.keyCode){case 9:if((!d||0===d.length)&&m&&0===m.length){t.preventDefault();break}var n,o,i;if(t.shiftKey){if(document.activeElement===g||null!=(n=document.activeElement)&&n.classList.contains("shepherd-element"))t.preventDefault(),null==(o=null!=p?p:v)||o.focus();else if(document.activeElement===f){var s;t.preventDefault(),null==(s=v)||s.focus()}}else if(document.activeElement===v)t.preventDefault(),null==(i=null!=f?f:g)||i.focus();else if(document.activeElement===p){var r;t.preventDefault(),null==(r=g)||r.focus()}break;case 27:e.options.exitOnEsc&&(t.preventDefault(),t.stopPropagation(),u.cancel());break;case 37:e.options.keyboardNavigation&&(t.preventDefault(),t.stopPropagation(),e.back());break;case 39:e.options.keyboardNavigation&&(t.preventDefault(),t.stopPropagation(),e.next())}},w=te("dialog",{"aria-describedby":i(u.options.text)?null:c,"aria-labelledby":u.options.title?a:null,class:["shepherd-element",y?"shepherd-has-cancel-icon":"",x?"shepherd-has-title":""].filter(Boolean).join(" "),[`data-${l}shepherd-step-id`]:u.id,onkeydown:b,open:"true"});if(u.options.arrow&&u.options.attachTo&&u.options.attachTo.element&&u.options.attachTo.on&&w.append(te("div",{class:"shepherd-arrow","data-popper-arrow":""})),w.append(re(c,a,u)),o(u.options.classes)){const t=u.options.classes.split(" ").filter((t=>!!t.length));t.length&&w.classList.add(...t)}const O='a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]';m=[...w.querySelectorAll(O)],g=m[0],v=m[m.length-1];const E=u._getResolvedAttachToOptions();return null!=E&&E.element&&(h=E.element,u._storeOriginalTabIndex(h),h.tabIndex=0,d=[h,...h.querySelectorAll(O)],f=d[0],p=d[d.length-1],h.addEventListener("keydown",b)),{element:w,cleanup:()=>{var t;null==(t=h)||t.removeEventListener("keydown",b)}}}({classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this}),(this.tour.options.stepsContainer||document.body).append(this.shepherdElementComponent.element),this.shepherdElementComponent.element}_scrollTo(t){const{element:e}=this._getResolvedAttachToOptions();n(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",o=e&&e.classes?e.classes:"",i=[...n.split(" "),...o.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(t={}){let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=v({},e||{}),this.options=Object.assign({arrow:!0},e,t,function(t,e){return{floatingUIOptions:v(t.floatingUIOptions||{},e.floatingUIOptions||{})}}(e,t));const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||`step-${E()}`,n&&Object.keys(n).forEach((t=>{this.on(t,n[t],this)}))}_setupElements(){i(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&function(t){const{event:e,selector:n}=t.options.advanceOn||{};if(e){const o=function(t,e){return n=>{if(t.isOpen()){const o=t.el&&n.currentTarget===t.el;(!i(e)&&n.currentTarget.matches(e)||o)&&t.tour.next()}}}(t,n);let s=null;if(!i(n)&&(s=document.querySelector(n),!s))return;s?(s.addEventListener(e,o),t.on("destroy",(()=>s.removeEventListener(e,o)))):(document.body.addEventListener(e,o,!0),t.on("destroy",(()=>document.body.removeEventListener(e,o,!0))))}}(this),function(t){t.cleanup&&t.cleanup();const n=t._getResolvedAttachToOptions();let o=n.element;const i=function(t,e){var n,o,i;const s={strategy:"absolute",middleware:[]},r=function(t){return!(!t.options.arrow||!t.el)&&t.el.querySelector(".shepherd-arrow")}(e),l=O(t),c=null==(n=t.on)?void 0:n.includes("auto"),a=(null==t||null==(o=t.on)?void 0:o.includes("-start"))||(null==t||null==(i=t.on)?void 0:i.includes("-end"));if(!l){var u;if(c?s.middleware.push(Xt({crossAxis:!0,alignment:a?null==t||null==(u=t.on)?void 0:u.split("-").pop():null})):s.middleware.push(Kt()),s.middleware.push(Zt({limiter:Jt(),crossAxis:!0})),r){const t="object"==typeof e.options.arrow?e.options.arrow:{padding:4};s.middleware.push(Gt({element:r,padding:a?t.padding:0}))}c||(s.placement=t.on)}return v(s,e.options.floatingUIOptions||{})}(n,t),s=O(n);if(s){var r;o=document.body;const e=null==(r=t.shepherdElementComponent)?void 0:r.element;null==e||e.classList.add("shepherd-centered")}t.cleanup=Yt(o,t.el,(()=>{t.el?function(t,n,o,i){Qt(t,n.el,o).then(function(t,n){return({x:o,y:i,placement:s,middlewareData:r})=>t.el?(n?Object.assign(t.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(t.el.style,{position:"absolute",left:`${o}px`,top:`${i}px`}),t.el.dataset.popperPlacement=s,function(t,n){const o=t.querySelector(".shepherd-arrow");if(e(o)&&n.arrow){const{x:t,y:e}=n.arrow;Object.assign(o.style,{left:null!=t?`${t}px`:"",top:null!=e?`${e}px`:""})}}(t.el,r),t):t}(n,i)).then((t=>new Promise((e=>{setTimeout((()=>e(t)),300)})))).then((t=>{null!=t&&t.el&&(t.el.tabIndex=0,t.el.focus({preventScroll:!0}))}))}(o,t,i,s):null==t.cleanup||t.cleanup()})),t.target=n.element}(this)}_show(){var t;this.trigger("before-show"),this._resolveAttachToOptions(),this._resolveExtraHiglightElements(),this._setupElements(),this.tour.modal||this.tour.setupModal(),null==(t=this.tour.modal)||t.setupForStep(this),this._styleTargetElementForStep(this),this.el&&(this.el.hidden=!1),this.options.scrollTo&&setTimeout((()=>{this._scrollTo(this.options.scrollTo)})),this.el&&(this.el.hidden=!1);const e=this.shepherdElementComponent.element,n=this.target||document.body,o=this._resolvedExtraHighlightElements;n.classList.add(`${this.classPrefix}shepherd-enabled`),n.classList.add(`${this.classPrefix}shepherd-target`),e.classList.add("shepherd-enabled"),null==o||o.forEach((t=>{t.classList.add(`${this.classPrefix}shepherd-enabled`),t.classList.add(`${this.classPrefix}shepherd-target`)})),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target,n=t._resolvedExtraHighlightElements;if(!e)return;const o=t.options.highlightClass;o&&(e.classList.add(o),null==n||n.forEach((t=>t.classList.add(o)))),e.classList.remove("shepherd-target-click-disabled"),null==n||n.forEach((t=>t.classList.remove("shepherd-target-click-disabled"))),!1===t.options.canClickTarget&&(e.classList.add("shepherd-target-click-disabled"),null==n||n.forEach((t=>t.classList.add("shepherd-target-click-disabled"))))}_updateStepTargetOnHide(){const t=this.target||document.body,e=this._resolvedExtraHighlightElements,n=this.options.highlightClass;n&&(t.classList.remove(n),null==e||e.forEach((t=>t.classList.remove(n)))),t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`),null==e||e.forEach((t=>{t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)})),this._restoreOriginalTabIndexes()}}function ce(t){let e,n=[{width:0,height:0,x:0,y:0,r:0}];const o=ee("path"),i=ee("svg",{class:"shepherd-modal-overlay-container"},o);function s(){o.setAttribute("d",function(t){let e="";const{innerWidth:n,innerHeight:o}=window;return t.forEach((t=>{const{width:n,height:o,x:i=0,y:s=0,r:r=0}=t,{topLeft:l=0,topRight:c=0,bottomRight:a=0,bottomLeft:u=0}="number"==typeof r?{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r}:r;e+=`M${i+l},${s} a${l},${l},0,0,0-${l},${l} V${o+s-u} a${u},${u},0,0,0,${u},${u} H${n+i-a} a${a},${a},0,0,0,${a}-${a} V${s+c} a${c},${c},0,0,0-${c}-${c} Z`})),`M${n},${o} H0 V0 H${n} V${o} Z ${e}`.replace(/\s/g,"")}(n))}function r(){n=[{width:0,height:0,x:0,y:0,r:0}],s()}function l(){i.classList.remove("shepherd-modal-is-visible"),d()}function c(){i.classList.add("shepherd-modal-is-visible")}function a(t=0,e=0,o=0,i=0,l,c,a){if(c){{const s=[c,...a||[]],r=[];for(const n of s){if(!n)continue;if(s.indexOf(n)!==s.lastIndexOf(n))continue;const{y:c,height:a}=p(n,l),{x:u,width:h,left:d}=n.getBoundingClientRect();s.some((t=>{if(t===n)return!1;const e=t.getBoundingClientRect(),{y:o,height:i}=p(t,l);return u>=e.left&&u+h<=e.left+e.width&&c>=o&&c+a<=o+i}))||r.push({width:h+2*t,height:a+2*t,x:(u||d)+o-t,y:c+i-t,r:e})}n=r}s()}else r()}function u(t){t.stopPropagation()}i.addEventListener("touchmove",u),s(),t.append(i);const h=t=>{t.preventDefault()};function d(){e&&(cancelAnimationFrame(e),e=void 0),window.removeEventListener("touchmove",h,{passive:!1})}function f(t){if(!t)return null;const e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY;return"hidden"!==e&&"visible"!==e&&t.scrollHeight>=t.clientHeight?t:f(t.parentElement)}function p(t,e){const n=t.getBoundingClientRect();let o=n.y||n.top,i=n.bottom||o+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,s=t.bottom||n+t.height;o=Math.max(o,n),i=Math.min(i,s)}return{y:o,height:Math.max(i-o,0)}}return{closeModalOpening:r,destroy:function(){d(),i.removeEventListener("touchmove",u),i.remove()},hide:l,positionModal:a,setupForStep:function(t){d(),t.tour.options.useModalOverlay?(function(t){const{modalOverlayOpeningPadding:n,modalOverlayOpeningRadius:o,modalOverlayOpeningXOffset:i=0,modalOverlayOpeningYOffset:s=0}=t.options,r=function(t){const e={top:0,left:0};if(!t)return e;let n=t.ownerDocument.defaultView;try{for(;n&&n!==window.top;){var o;const t=null==(o=n)?void 0:o.frameElement;if(t){const n=t.getBoundingClientRect();e.top+=n.top+t.scrollTop,e.left+=n.left+t.scrollLeft}n=n.parent}}catch(t){}return e}(t.target),l=f(t.target),c=()=>{e=void 0,a(n,o,i+r.left,s+r.top,l,t.target,t._resolvedExtraHighlightElements),e=requestAnimationFrame(c)};c(),window.addEventListener("touchmove",h,{passive:!1})}(t),c()):l()},show:c,getElement:function(){return i}}}const ae=new class extends s{constructor(){super(),this.activeTour=void 0,b(this)}},ue="undefined"==typeof window;ae.Step=ue?class{constructor(t){}}:le,ae.Tour=ue?class{constructor(t,e){}}:class extends s{constructor(t={}){return super(),this.trackedEvents=["active","cancel","complete","show"],this.classPrefix=void 0,this.currentStep=void 0,this.focusedElBeforeOpen=void 0,this.id=void 0,this.modal=void 0,this.options=void 0,this.steps=void 0,b(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=w(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map((t=>{(t=>{this.on(t,(e=>{(e=e||{}).tour=this,ae.trigger(t,e)}))})(t)})),this._setTourID(t.id),this}addStep(t,e){let n=t;return n instanceof le?n.tour=this:n=new le(this,n),i(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach((t=>{this.addStep(t)})),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}async cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";let e;e=n(this.options.confirmCancel)?await this.options.confirmCancel():window.confirm(t),e&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find((e=>e.id===t))}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return ae.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some(((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0})),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t=0,e=!0){const i=o(t)?this.getById(t):this.steps[t];i&&(this._updateStateBeforeShow(),n(i.options.showOn)&&!i.options.showOn()?this._skipStep(i,e):(this.currentStep=i,this.trigger("show",{step:i,previous:this.currentStep}),i.show()))}async start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this.setupModal(),this._setupActiveTour(),this.next()}_done(t){const n=this.steps.indexOf(this.currentStep);Array.isArray(this.steps)&&this.steps.forEach((t=>t.destroy())),function(t){if(t){const{steps:n}=t;n.forEach((t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&(e(t.target)&&t.target.classList.remove("shepherd-target-click-disabled"),t._resolvedExtraHighlightElements&&t._resolvedExtraHighlightElements.forEach((t=>{e(t)&&t.classList.remove("shepherd-target-click-disabled")})))}))}}(this),this.trigger(t,{index:n}),ae.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),"cancel"!==t&&"complete"!==t||this.modal&&(this.modal.destroy(),this.modal=null),e(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),ae.activeTour=this}setupModal(){const t=this.options.modalContainer||document.body;this.modal=ce(t)}_skipStep(t,e){const n=this.steps.indexOf(t);if(n===this.steps.length-1)this.complete();else{const t=e?n+1:n-1;this.show(t,e)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(t){const e=this.options.tourName||"tour",n=t||E();this.id=`${e}--${n}`}};const he=(...t)=>new ae.Tour(...t),de=function(t){de.installed||(de.installed=!0,t.config.globalProperties.$shepherd=he)},fe={install:de};{let t=null;"undefined"!=typeof window?t=window.Vue:"undefined"!=typeof global&&(t=global.Vue),t&&t.use(fe)}return t.default=fe,t.useShepherd=he,Object.defineProperty(t,"__esModule",{value:!0}),t}({});