siteguide.js 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- :root{--sg-bg: var(--sg-mono-100);--sg-text: var(--sg-mono-900);--sg-line: var(--sg-mono-500);--primary: #2e62d9;--primary-hover: #2ca2fd;--secondary: #2ca2fd;--secondary-hover: #2ca2fd;--sg-mono-900: #101828;--sg-mono-800: #4c525e;--sg-mono-700: #7c8089;--sg-mono-600: #acaeb5;--sg-mono-500: #d5d6d9;--sg-mono-400: #e6e7e8;--sg-mono-300: #f4f4f5;--sg-mono-200: #f9f9fa;--sg-mono-100: #fff;--padding-s: 8px;--padding-m: 12px;--padding-l: 16px;--padding-2l: 20px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.siteguide{color:var(--sg-text);box-sizing:border-box;font-family:Inter,sans-serif;font-size:var(--sg-text-m);width:280px;min-height:150px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);display:flex;flex-direction:column;position:absolute;box-shadow:0 10px 10px #0001;z-index:1000001;max-height:400px}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-arrow{position:absolute;width:10px;height:10px;background-color:var(--sg-bg)}.siteguide-highlight{box-shadow:0 0 #212121cc,0 0 0 5000px #21212180;border:2px solid var(--sg-mono-900);border-radius:4px;opacity:1;z-index:1000000;position:absolute;transition:all .3s ease-out;pointer-events:none}.siteguide-header{display:flex;align-items:center;width:100%;padding:var(--padding-m) var(--padding-2l) 0}.siteguide-content{width:100%;padding:var(--padding-m) var(--padding-2l);overflow-y:auto}.siteguide-content::-webkit-scrollbar{width:4px}.siteguide-content::-webkit-scrollbar-thumb{background-color:var(--primary);border-radius:4px}.siteguide-title{display:block;font-size:var(--sg-text-l);font-weight:800;color:var(--sg-text)}.siteguide-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:var(--padding-m)}.siteguide-description{font-size:14px;font-weight:400;color:var(--sg-text)}.siteguide-footer{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--padding-m);border-top:1px solid var(--sg-line);gap:var(--padding-l);margin-top:auto}.siteguide-button{padding:var(--padding-s) var(--padding-l);border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;transition:background-color .3s ease-out;color:var(--sg-mono-100)}.siteguide-button-secondary{background-color:var(--secondary)}.siteguide-button-secondary:hover{background-color:var(--secondary-hover)}.siteguide-button-primary{background-color:var(--primary)}.siteguide-button-primary:hover{background-color:var(--primary-hover)}.siteguide-button-link{color:var(--primary);background-color:transparent;cursor:pointer;transition:color .3s ease-out}.siteguide-button-link:hover{color:var(--primary-hover)}.siteguide-close{width:20px;height:20px;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:4px;cursor:pointer;position:absolute;top:10px;right:10px;transition:background-color .3s ease-out}.siteguide-close:hover{background-color:var(--secondary-hover);color:#fff}.siteguide-close-icon{height:10px}
1
+ :root{--sg-bg: var(--sg-mono-100);--sg-text: var(--sg-mono-900);--sg-line: var(--sg-mono-500);--primary: #2e62d9;--primary-hover: #2ca2fd;--secondary: #2ca2fd;--secondary-hover: #2ca2fd;--sg-mono-900: #101828;--sg-mono-800: #4c525e;--sg-mono-700: #7c8089;--sg-mono-600: #acaeb5;--sg-mono-500: #d5d6d9;--sg-mono-400: #e6e7e8;--sg-mono-300: #f4f4f5;--sg-mono-200: #f9f9fa;--sg-mono-100: #fff;--padding-s: 8px;--padding-m: 12px;--padding-l: 16px;--padding-2l: 20px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.siteguide{color:var(--sg-text);box-sizing:border-box;font-family:Inter,sans-serif;font-size:var(--sg-text-m);width:280px;min-height:150px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);display:flex;flex-direction:column;position:absolute;box-shadow:0 10px 10px #0001;z-index:1000001;max-height:400px}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-arrow{position:absolute;width:10px;height:10px;background-color:inherit}.siteguide-highlight{box-shadow:0 0 #212121cc,0 0 0 5000px #21212180;border:2px solid var(--sg-mono-900);border-radius:4px;opacity:1;z-index:1000000;position:absolute;transition:all .3s ease-out;pointer-events:none}.siteguide-header{display:flex;align-items:center;width:100%;padding:var(--padding-m) var(--padding-2l) 0}.siteguide-content{width:100%;padding:var(--padding-m) var(--padding-2l);overflow-y:auto}.siteguide-content::-webkit-scrollbar{width:4px}.siteguide-content::-webkit-scrollbar-thumb{background-color:var(--primary);border-radius:4px}.siteguide-title{display:block;font-size:var(--sg-text-l);font-weight:800;color:var(--sg-text)}.siteguide-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:var(--padding-m)}.siteguide-description{font-size:14px;font-weight:400;color:var(--sg-text)}.siteguide-footer{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--padding-m);border-top:1px solid var(--sg-line);gap:var(--padding-l);margin-top:auto}.siteguide-button{padding:var(--padding-s) var(--padding-l);border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;transition:background-color .3s ease-out;color:var(--sg-mono-100)}.siteguide-button-secondary{background-color:var(--secondary)}.siteguide-button-secondary:hover{background-color:var(--secondary-hover)}.siteguide-button-primary{background-color:var(--primary)}.siteguide-button-primary:hover{background-color:var(--primary-hover)}.siteguide-button-link{color:var(--primary);background-color:transparent;cursor:pointer;transition:color .3s ease-out}.siteguide-button-link:hover{color:var(--primary-hover)}.siteguide-close{width:20px;height:20px;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:4px;cursor:pointer;position:absolute;top:10px;right:10px;transition:background-color .3s ease-out}.siteguide-close:hover{background-color:var(--secondary-hover);color:#fff}.siteguide-close-icon{height:10px}
package/dist/index.d.ts CHANGED
@@ -545,10 +545,20 @@ export declare type TourConfig = {
545
545
  */
546
546
  closeIcon?: PopupCloseIconElement;
547
547
  /**
548
- * Indicates if the arrow should be shown
549
- * @default false
548
+ * Arrow configuration
550
549
  */
551
- disableArrow?: boolean;
550
+ arrow?: {
551
+ /**
552
+ * Indicates if the arrow should be shown
553
+ * @default false
554
+ */
555
+ disable?: boolean;
556
+ /**
557
+ * The class to apply to the arrow
558
+ * @default 'siteguide-arrow'
559
+ */
560
+ class?: string;
561
+ };
552
562
  /**
553
563
  * Configuration for the helper layout.
554
564
  */
@@ -612,10 +622,20 @@ declare type TourConfig_2 = {
612
622
  */
613
623
  closeIcon?: PopupCloseIconElement_2;
614
624
  /**
615
- * Indicates if the arrow should be shown
616
- * @default false
625
+ * Arrow configuration
617
626
  */
618
- disableArrow?: boolean;
627
+ arrow?: {
628
+ /**
629
+ * Indicates if the arrow should be shown
630
+ * @default false
631
+ */
632
+ disable?: boolean;
633
+ /**
634
+ * The class to apply to the arrow
635
+ * @default 'siteguide-arrow'
636
+ */
637
+ class?: string;
638
+ };
619
639
  /**
620
640
  * Configuration for the helper layout.
621
641
  */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Yt=Object.defineProperty,qt=Object.defineProperties;var Ut=Object.getOwnPropertyDescriptors;var tt=Object.getOwnPropertySymbols;var bt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var Ct=Math.pow,ft=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))bt.call(t,n)&&ft(e,n,t[n]);if(tt)for(var n of tt(t))_t.call(t,n)&&ft(e,n,t[n]);return e},X=(e,t)=>qt(e,Ut(t));var Pt=(e,t)=>{var n={};for(var i in e)bt.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&tt)for(var i of tt(e))t.indexOf(i)<0&&_t.call(e,i)&&(n[i]=e[i]);return n};var y=(e,t,n)=>ft(e,typeof t!="symbol"?t+"":t,n);var k=(e,t,n)=>new Promise((i,o)=>{var r=a=>{try{l(n.next(a))}catch(c){o(c)}},s=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,s);l((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Xt=["top","right","bottom","left"],Lt=["start","end"],St=Xt.reduce((e,t)=>e.concat(t,t+"-"+Lt[0],t+"-"+Lt[1]),[]),K=Math.min,z=Math.max,et=Math.round,$=e=>({x:e,y:e}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Gt={start:"end",end:"start"};function Jt(e,t,n){return z(e,K(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function M(e){return e.split("-")[1]}function Qt(e){return e==="x"?"y":"x"}function gt(e){return e==="y"?"height":"width"}function pt(e){return["top","bottom"].includes(J(e))?"y":"x"}function mt(e){return Qt(pt(e))}function Zt(e,t,n){n===void 0&&(n=!1);const i=M(e),o=mt(e),r=gt(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Tt(s)),[s,Tt(s)]}function te(e){return e.replace(/start|end/g,t=>Gt[t])}function Tt(e){return e.replace(/left|right|bottom|top/g,t=>Kt[t])}function ee(e){return L({top:0,right:0,bottom:0,left:0},e)}function Dt(e){return typeof e!="number"?ee(e):{top:e,right:e,bottom:e,left:e}}function nt(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function Rt(e,t,n){let{reference:i,floating:o}=e;const r=pt(t),s=mt(t),l=gt(s),a=J(t),c=r==="y",h=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,g=i[l]/2-o[l]/2;let u;switch(a){case"top":u={x:h,y:i.y-o.height};break;case"bottom":u={x:h,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:f};break;case"left":u={x:i.x-o.width,y:f};break;default:u={x:i.x,y:i.y}}switch(M(t)){case"start":u[s]-=g*(n&&c?-1:1);break;case"end":u[s]+=g*(n&&c?-1:1);break}return u}const ne=(e,t,n)=>k(exports,null,function*(){const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=yield s.isRTL==null?void 0:s.isRTL(t);let c=yield s.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=Rt(c,i,a),g=i,u={},d=0;for(let p=0;p<l.length;p++){const{name:w,fn:x}=l[p],{x:_,y:m,data:v,reset:b}=yield x({x:h,y:f,initialPlacement:i,placement:g,strategy:o,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});h=_!=null?_:h,f=m!=null?m:f,u=X(L({},u),{[w]:L(L({},u[w]),v)}),b&&d<=50&&(d++,typeof b=="object"&&(b.placement&&(g=b.placement),b.rects&&(c=b.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:h,y:f}=Rt(c,g,a)),p=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:u}});function ie(e,t){return k(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:o,platform:r,rects:s,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:u=0}=it(t,e),d=Dt(u),w=l[g?f==="floating"?"reference":"floating":f],x=nt(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(w))==null||n?w:w.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:h,strategy:a})),_=f==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,m=yield r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating),v=(yield r.isElement==null?void 0:r.isElement(m))?(yield r.getScale==null?void 0:r.getScale(m))||{x:1,y:1}:{x:1,y:1},b=nt(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:m,strategy:a}):_);return{top:(x.top-b.top+d.top)/v.y,bottom:(b.bottom-x.bottom+d.bottom)/v.y,left:(x.left-b.left+d.left)/v.x,right:(b.right-x.right+d.right)/v.x}})}const oe=e=>({name:"arrow",options:e,fn(n){return k(this,null,function*(){const{x:i,y:o,placement:r,rects:s,platform:l,elements:a,middlewareData:c}=n,{element:h,padding:f=0}=it(e,n)||{};if(h==null)return{};const g=Dt(f),u={x:i,y:o},d=mt(r),p=gt(d),w=yield l.getDimensions(h),x=d==="y",_=x?"top":"left",m=x?"bottom":"right",v=x?"clientHeight":"clientWidth",b=s.reference[p]+s.reference[d]-u[d]-s.floating[p],B=u[d]-s.reference[d],V=yield l.getOffsetParent==null?void 0:l.getOffsetParent(h);let H=V?V[v]:0;(!H||!(yield l.isElement==null?void 0:l.isElement(V)))&&(H=a.floating[v]||s.floating[p]);const vt=b/2-B/2,q=H/2-w[p]/2-1,U=K(g[_],q),C=K(g[m],q),O=U,Z=H-w[p]-C,D=H/2-w[p]/2+vt,lt=Jt(O,D,Z),ct=!c.arrow&&M(r)!=null&&D!==lt&&s.reference[p]/2-(D<O?U:C)-w[p]/2<0,at=ct?D<O?D-O:D-Z:0;return{[d]:u[d]+at,data:L({[d]:lt,centerOffset:D-lt-at},ct&&{alignmentOffset:at}),reset:ct}})}});function se(e,t,n){return(e?[...n.filter(o=>M(o)===e),...n.filter(o=>M(o)!==e)]:n.filter(o=>J(o)===o)).filter(o=>e?M(o)===e||(t?te(o)!==o:!1):!0)}const re=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(n){return k(this,null,function*(){var i,o,r;const{rects:s,middlewareData:l,placement:a,platform:c,elements:h}=n,U=it(e,n),{crossAxis:f=!1,alignment:g,allowedPlacements:u=St,autoAlignment:d=!0}=U,p=Pt(U,["crossAxis","alignment","allowedPlacements","autoAlignment"]),w=g!==void 0||u===St?se(g||null,d,u):u,x=yield ie(n,p),_=((i=l.autoPlacement)==null?void 0:i.index)||0,m=w[_];if(m==null)return{};const v=Zt(m,s,yield c.isRTL==null?void 0:c.isRTL(h.floating));if(a!==m)return{reset:{placement:w[0]}};const b=[x[J(m)],x[v[0]],x[v[1]]],B=[...((o=l.autoPlacement)==null?void 0:o.overflows)||[],{placement:m,overflows:b}],V=w[_+1];if(V)return{data:{index:_+1,overflows:B},reset:{placement:V}};const H=B.map(C=>{const O=M(C.placement);return[C.placement,O&&f?C.overflows.slice(0,2).reduce((Z,D)=>Z+D,0):C.overflows[0],C.overflows]}).sort((C,O)=>C[1]-O[1]),q=((r=H.filter(C=>C[2].slice(0,M(C[0])?2:3).every(O=>O<=0))[0])==null?void 0:r[0])||H[0][0];return q!==a?{data:{index:_+1,overflows:B},reset:{placement:q}}:{}})}}};function le(e,t){return k(this,null,function*(){const{placement:n,platform:i,elements:o}=e,r=yield i.isRTL==null?void 0:i.isRTL(o.floating),s=J(n),l=M(n),a=pt(n)==="y",c=["left","top"].includes(s)?-1:1,h=r&&a?-1:1,f=it(t,e);let{mainAxis:g,crossAxis:u,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),a?{x:u*h,y:g*c}:{x:g*c,y:u*h}})}const ce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return k(this,null,function*(){var i,o;const{x:r,y:s,placement:l,middlewareData:a}=n,c=yield le(n,e);return l===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:X(L({},c),{placement:l})}})}}};function ot(){return typeof window!="undefined"}function Y(e){return kt(e)?(e.nodeName||"").toLowerCase():"#document"}function P(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function F(e){var t;return(t=(kt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kt(e){return ot()?e instanceof Node||e instanceof P(e).Node:!1}function T(e){return ot()?e instanceof Element||e instanceof P(e).Element:!1}function A(e){return ot()?e instanceof HTMLElement||e instanceof P(e).HTMLElement:!1}function Ot(e){return!ot()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof P(e).ShadowRoot}function Q(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ae(e){return["table","td","th"].includes(Y(e))}function st(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function wt(e){const t=xt(),n=T(e)?R(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function fe(e){let t=N(e);for(;A(t)&&!I(t);){if(wt(t))return t;if(st(t))return null;t=N(t)}return null}function xt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function I(e){return["html","body","#document"].includes(Y(e))}function R(e){return P(e).getComputedStyle(e)}function rt(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function N(e){if(Y(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ot(e)&&e.host||F(e);return Ot(t)?t.host:t}function Mt(e){const t=N(e);return I(t)?e.ownerDocument?e.ownerDocument.body:e.body:A(t)&&Q(t)?t:Mt(t)}function ut(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Mt(e),r=o===((i=e.ownerDocument)==null?void 0:i.body),s=P(o);if(r){const l=dt(s);return t.concat(s,s.visualViewport||[],Q(o)?o:[],l&&n?ut(l):[])}return t.concat(o,ut(o,[],n))}function dt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ft(e){const t=R(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=A(e),r=o?e.offsetWidth:n,s=o?e.offsetHeight:i,l=et(n)!==r||et(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function Bt(e){return T(e)?e:e.contextElement}function j(e){const t=Bt(e);if(!A(t))return $(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=Ft(t);let s=(r?et(n.width):n.width)/i,l=(r?et(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const he=$(0);function Ht(e){const t=P(e);return!xt()||!t.visualViewport?he:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ue(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==P(e)?!1:t}function G(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=Bt(e);let s=$(1);t&&(i?T(i)&&(s=j(i)):s=j(e));const l=ue(r,n,i)?Ht(r):$(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,h=o.width/s.x,f=o.height/s.y;if(r){const g=P(r),u=i&&T(i)?P(i):i;let d=g,p=dt(d);for(;p&&i&&u!==d;){const w=j(p),x=p.getBoundingClientRect(),_=R(p),m=x.left+(p.clientLeft+parseFloat(_.paddingLeft))*w.x,v=x.top+(p.clientTop+parseFloat(_.paddingTop))*w.y;a*=w.x,c*=w.y,h*=w.x,f*=w.y,a+=m,c+=v,d=P(p),p=dt(d)}}return nt({width:h,height:f,x:a,y:c})}function yt(e,t){const n=rt(e).scrollLeft;return t?t.left+n:G(F(e)).left+n}function Nt(e,t,n){n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-(n?0:yt(e,i)),r=i.top+t.scrollTop;return{x:o,y:r}}function de(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r=o==="fixed",s=F(i),l=t?st(t.floating):!1;if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=$(1);const h=$(0),f=A(i);if((f||!f&&!r)&&((Y(i)!=="body"||Q(s))&&(a=rt(i)),A(i))){const u=G(i);c=j(i),h.x=u.x+i.clientLeft,h.y=u.y+i.clientTop}const g=s&&!f&&!r?Nt(s,a,!0):$(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+h.x+g.x,y:n.y*c.y-a.scrollTop*c.y+h.y+g.y}}function ge(e){return Array.from(e.getClientRects())}function pe(e){const t=F(e),n=rt(e),i=e.ownerDocument.body,o=z(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=z(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+yt(e);const l=-n.scrollTop;return R(i).direction==="rtl"&&(s+=z(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:l}}function me(e,t){const n=P(e),i=F(e),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;const c=xt();(!c||c&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l,y:a}}function we(e,t){const n=G(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=A(e)?j(e):$(1),s=e.clientWidth*r.x,l=e.clientHeight*r.y,a=o*r.x,c=i*r.y;return{width:s,height:l,x:a,y:c}}function Et(e,t,n){let i;if(t==="viewport")i=me(e,n);else if(t==="document")i=pe(F(e));else if(T(t))i=we(t,n);else{const o=Ht(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return nt(i)}function Vt(e,t){const n=N(e);return n===t||!T(n)||I(n)?!1:R(n).position==="fixed"||Vt(n,t)}function xe(e,t){const n=t.get(e);if(n)return n;let i=ut(e,[],!1).filter(l=>T(l)&&Y(l)!=="body"),o=null;const r=R(e).position==="fixed";let s=r?N(e):e;for(;T(s)&&!I(s);){const l=R(s),a=wt(s);!a&&l.position==="fixed"&&(o=null),(r?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Q(s)&&!a&&Vt(e,s))?i=i.filter(h=>h!==s):o=l,s=N(s)}return t.set(e,i),i}function ye(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const s=[...n==="clippingAncestors"?st(t)?[]:xe(t,this._c):[].concat(n),i],l=s[0],a=s.reduce((c,h)=>{const f=Et(t,h,o);return c.top=z(f.top,c.top),c.right=K(f.right,c.right),c.bottom=K(f.bottom,c.bottom),c.left=z(f.left,c.left),c},Et(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ve(e){const{width:t,height:n}=Ft(e);return{width:t,height:n}}function be(e,t,n){const i=A(t),o=F(t),r=n==="fixed",s=G(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=$(0);if(i||!i&&!r)if((Y(t)!=="body"||Q(o))&&(l=rt(t)),i){const g=G(t,!0,r,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=yt(o));const c=o&&!i&&!r?Nt(o,l):$(0),h=s.left+l.scrollLeft-a.x-c.x,f=s.top+l.scrollTop-a.y-c.y;return{x:h,y:f,width:s.width,height:s.height}}function ht(e){return R(e).position==="static"}function $t(e,t){if(!A(e)||R(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return F(e)===n&&(n=n.ownerDocument.body),n}function Wt(e,t){const n=P(e);if(st(e))return n;if(!A(e)){let o=N(e);for(;o&&!I(o);){if(T(o)&&!ht(o))return o;o=N(o)}return n}let i=$t(e,t);for(;i&&ae(i)&&ht(i);)i=$t(i,t);return i&&I(i)&&ht(i)&&!wt(i)?n:i||fe(e)||n}const _e=function(e){return k(this,null,function*(){const t=this.getOffsetParent||Wt,n=this.getDimensions,i=yield n(e.floating);return{reference:be(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Ce(e){return R(e).direction==="rtl"}const Pe={convertOffsetParentRelativeRectToViewportRelativeRect:de,getDocumentElement:F,getClippingRect:ye,getOffsetParent:Wt,getElementRects:_e,getClientRects:ge,getDimensions:ve,getScale:j,isElement:T,isRTL:Ce},Le=ce,Se=re,Te=oe,Re=(e,t,n)=>{const i=new Map,o=L({platform:Pe},n),r=X(L({},o.platform),{_c:i});return ne(e,t,X(L({},o),{platform:r}))};function W(e){return e===null||typeof e=="undefined"}function E(e){return!W(e)}function At(e){return new Promise(t=>setTimeout(t,e))}function zt(e){var i;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((i=document.defaultView)==null?void 0:i.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:zt(t)}function jt(e){return zt(e)?"fixed":"absolute"}class Oe{renderContent(t,n,i){t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node)}}function S(e,t){const n=document.createElement(e);return t&&t.length>0&&(t=t.filter(i=>i),n.classList.add(...t)),n}class Ee{renderContent(t,n,i){var r,s,l,a;const o=t.querySelector(`.${i.classPrefix}-content`);if(n.imgSrc){const c=S("img",[`${i.classPrefix}-image`,`${(s=(r=n.customization)==null?void 0:r.imageClass)!=null?s:""}`]);c.src=n.imgSrc,o.appendChild(c)}if(n.text){const c=S("p",[`${i.classPrefix}-description`,`${(a=(l=n.customization)==null?void 0:l.descriptionClass)!=null?a:""}`]);c.innerText=i.translateFn(n.text),o.appendChild(c)}}}function $e(e,t,n){var l,a,c,h,f,g,u,d,p,w,x,_;if(e.innerHTML="",e.className=`${n.config.classPrefix} ${n.config.animationClass}`,!n.config.disableArrow){const m=S("div",[`${n.config.classPrefix}-arrow`]);e.appendChild(m)}(l=t.customization)!=null&&l.class&&e.classList.add(t.customization.class);const i=S("div",[`${n.config.classPrefix}-header`,`${(c=(a=t.customization)==null?void 0:a.headerClass)!=null?c:""}`]);e.appendChild(i);const o=S("h1",[`${n.config.classPrefix}-title`,`${(f=(h=t.customization)==null?void 0:h.titleClass)!=null?f:""}`]);if(o.innerHTML=n.config.translateFn((g=t.title)!=null?g:""),i.appendChild(o),n.config.allowClose){const m=S("button",[`${n.config.classPrefix}-close`,`${(d=(u=t.customization)==null?void 0:u.closeButtonClass)!=null?d:""}`]);Ae(m,n.config.closeIcon),m.onclick=n.complete.bind(n),i.appendChild(m)}const r=S("div",[`${n.config.classPrefix}-content`,`${(w=(p=t.customization)==null?void 0:p.contentClass)!=null?w:""}`]);e.appendChild(r);const s=S("div",[`${n.config.classPrefix}-footer`,`${(_=(x=t.customization)==null?void 0:x.footerClass)!=null?_:""}`]);W(t.buttonList)&&(t.buttonList=De(n)),t.buttonList.forEach(m=>{var B;const v=[`${n.config.classPrefix}-button`,(B=m.class)!=null?B:""];W(m.type)||m.type==="secondary"?v.push(`${n.config.classPrefix}-button-secondary`):m.type==="primary"?v.push(`${n.config.classPrefix}-button-primary`):m.type==="link"&&v.push(`${n.config.classPrefix}-button-link`),!W(m.class)&&m.class!==""&&v.push(m.class);const b=S("button",v);b.innerText=n.config.translateFn(m.text),b.onclick=V=>{m.action.call(n)},s.appendChild(b)}),e.appendChild(s)}function Ae(e,t){t instanceof HTMLElement?e.appendChild(t):e.innerHTML=t.innerHTML}function De(e){return[{text:"Back",action:e.prev},{text:"Next",type:"primary",action:e.next}]}class ke{constructor(){y(this,"_renderContentStrategy",new Map);y(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(t,n){return new Promise(i=>{var o,r;if(!this._renderContentStrategy.has(n.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(n.tour.config.animationClass),n.hostElement?t.style.position=jt(n.hostElement):t.style.position="fixed",$e(t,n.popupData,n.tour),(o=this._renderContentStrategy.get(n.popupData.type))==null||o.renderContent(t,n.popupData,n.tour.config),(r=n.hostElement)==null||r.scrollIntoView(n.tour.config.scrollTo),i()}).then(()=>n.isFirst&&n.direction==="toNext"?At(0):At(400)).then(()=>{t.style.display="block",this.updatePosition(t,n),t.classList.add(n.tour.config.animationClass)})}updatePosition(t,n){E(n.hostElement)?this.renderFloatingPopup(t,n):this.renderCenterPopup(t)}renderFloatingPopup(t,n){var c;const i=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=t.querySelector(`.${n.tour.config.classPrefix}-arrow`),r=[],s=E(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0,l=(c=o==null?void 0:o.offsetWidth)!=null?c:10,a=Math.sqrt(2*Ct(l,2))/2+n.tour.config.highlight.padding;r.push(Le(a)),(n.popupData.position==="auto"||W(s))&&r.push(Se()),!n.tour.config.disableArrow&&E(o)&&r.push(Te({element:o})),Re(n.hostElement,t,{placement:s,middleware:[...r]}).then(({x:h,y:f,middlewareData:g,placement:u})=>{Object.assign(t.style,{top:`${f-i}px`,left:`${h}px`,marginTop:"0",marginLeft:"0"});const d=u.split("-")[0],p=this._staticSides[d];if(g.arrow&&E(o)){const{x:w,y:x}=g.arrow;Object.assign(o.style,{left:w!=null?`${w}px`:"",top:x!=null?`${x}px`:"",right:"",bottom:"",[p]:`${-l/2}px`,transform:"rotate(45deg)"})}})}renderCenterPopup(t){Object.assign(t.style,{top:"50%",left:"50%",marginTop:`-${t.clientHeight/2}px`,marginLeft:`-${t.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new Ee),this._renderContentStrategy.set("custom",new Oe)}}class Me{render(t,n){return new Promise(i=>{n.hostElement&&(t.style.position=jt(n.hostElement)),i()}).then(()=>{this.updatePosition(t,n)})}updatePosition(t,n){var s,l;if(!n.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.opacity="0";return}const i=n.hostElement.getBoundingClientRect(),o=(l=(s=n.tour.config.highlight)==null?void 0:s.padding)!=null?l:8,r=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${i.left-o}px`,t.style.top=`${i.top+r-o}px`,t.style.width=`${i.width+2*o}px`,t.style.height=`${i.height+2*o}px`,t.style.opacity="1"}}class It{constructor(t,n){y(this,"id");y(this,"popupData");y(this,"tour");y(this,"index");y(this,"_hostElement",null);y(this,"_direction","toNext");y(this,"_hostData");y(this,"_popupRenderer");y(this,"_highlightRenderer");var i;this.id=n.id,this.popupData=n.popup,this.tour=t,this.index=(i=n.index)!=null?i:null,this._hostData=n.host,this._popupRenderer=t.popupRenderer,this._highlightRenderer=t.highlightRenderer}get isFirst(){return this.index===0}get nextStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)+1])!=null?t:null}get prevStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)-1])!=null?t:null}get direction(){return this._direction}get hasHost(){return E(this._hostElement)}get hostElement(){return this._hostElement}show(t){return k(this,null,function*(){var i;if(W(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(i=this._hostData)!=null?i:null));const n=[this._popupRenderer.render(this.tour.popup,this)];!this.tour.config.highlight.disable&&!W(this.tour.highlight)&&n.push(this._highlightRenderer.render(this.tour.highlight,this)),yield Promise.all(n)})}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}}function Fe(e){return{innerHTML:`
1
+ "use strict";var Yt=Object.defineProperty,qt=Object.defineProperties;var Ut=Object.getOwnPropertyDescriptors;var tt=Object.getOwnPropertySymbols;var bt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var Ct=Math.pow,ft=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))bt.call(t,n)&&ft(e,n,t[n]);if(tt)for(var n of tt(t))_t.call(t,n)&&ft(e,n,t[n]);return e},X=(e,t)=>qt(e,Ut(t));var Pt=(e,t)=>{var n={};for(var i in e)bt.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&tt)for(var i of tt(e))t.indexOf(i)<0&&_t.call(e,i)&&(n[i]=e[i]);return n};var _=(e,t,n)=>ft(e,typeof t!="symbol"?t+"":t,n);var B=(e,t,n)=>new Promise((i,o)=>{var r=a=>{try{l(n.next(a))}catch(c){o(c)}},s=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,s);l((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Xt=["top","right","bottom","left"],Lt=["start","end"],St=Xt.reduce((e,t)=>e.concat(t,t+"-"+Lt[0],t+"-"+Lt[1]),[]),K=Math.min,z=Math.max,et=Math.round,$=e=>({x:e,y:e}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Gt={start:"end",end:"start"};function Jt(e,t,n){return z(e,K(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function H(e){return e.split("-")[1]}function Qt(e){return e==="x"?"y":"x"}function gt(e){return e==="y"?"height":"width"}function pt(e){return["top","bottom"].includes(J(e))?"y":"x"}function mt(e){return Qt(pt(e))}function Zt(e,t,n){n===void 0&&(n=!1);const i=H(e),o=mt(e),r=gt(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Tt(s)),[s,Tt(s)]}function te(e){return e.replace(/start|end/g,t=>Gt[t])}function Tt(e){return e.replace(/left|right|bottom|top/g,t=>Kt[t])}function ee(e){return L({top:0,right:0,bottom:0,left:0},e)}function Dt(e){return typeof e!="number"?ee(e):{top:e,right:e,bottom:e,left:e}}function nt(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function Rt(e,t,n){let{reference:i,floating:o}=e;const r=pt(t),s=mt(t),l=gt(s),a=J(t),c=r==="y",h=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,g=i[l]/2-o[l]/2;let u;switch(a){case"top":u={x:h,y:i.y-o.height};break;case"bottom":u={x:h,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:f};break;case"left":u={x:i.x-o.width,y:f};break;default:u={x:i.x,y:i.y}}switch(H(t)){case"start":u[s]-=g*(n&&c?-1:1);break;case"end":u[s]+=g*(n&&c?-1:1);break}return u}const ne=(e,t,n)=>B(exports,null,function*(){const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=yield s.isRTL==null?void 0:s.isRTL(t);let c=yield s.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=Rt(c,i,a),g=i,u={},d=0;for(let p=0;p<l.length;p++){const{name:w,fn:x}=l[p],{x:b,y,data:m,reset:v}=yield x({x:h,y:f,initialPlacement:i,placement:g,strategy:o,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});h=b!=null?b:h,f=y!=null?y:f,u=X(L({},u),{[w]:L(L({},u[w]),m)}),v&&d<=50&&(d++,typeof v=="object"&&(v.placement&&(g=v.placement),v.rects&&(c=v.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:o}):v.rects),{x:h,y:f}=Rt(c,g,a)),p=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:u}});function ie(e,t){return B(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:o,platform:r,rects:s,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:u=0}=it(t,e),d=Dt(u),w=l[g?f==="floating"?"reference":"floating":f],x=nt(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(w))==null||n?w:w.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:h,strategy:a})),b=f==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=yield r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating),m=(yield r.isElement==null?void 0:r.isElement(y))?(yield r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},v=nt(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:y,strategy:a}):b);return{top:(x.top-v.top+d.top)/m.y,bottom:(v.bottom-x.bottom+d.bottom)/m.y,left:(x.left-v.left+d.left)/m.x,right:(v.right-x.right+d.right)/m.x}})}const oe=e=>({name:"arrow",options:e,fn(n){return B(this,null,function*(){const{x:i,y:o,placement:r,rects:s,platform:l,elements:a,middlewareData:c}=n,{element:h,padding:f=0}=it(e,n)||{};if(h==null)return{};const g=Dt(f),u={x:i,y:o},d=mt(r),p=gt(d),w=yield l.getDimensions(h),x=d==="y",b=x?"top":"left",y=x?"bottom":"right",m=x?"clientHeight":"clientWidth",v=s.reference[p]+s.reference[d]-u[d]-s.floating[p],D=u[d]-s.reference[d],k=yield l.getOffsetParent==null?void 0:l.getOffsetParent(h);let M=k?k[m]:0;(!M||!(yield l.isElement==null?void 0:l.isElement(k)))&&(M=a.floating[m]||s.floating[p]);const vt=v/2-D/2,q=M/2-w[p]/2-1,U=K(g[b],q),C=K(g[y],q),O=U,Z=M-w[p]-C,F=M/2-w[p]/2+vt,lt=Jt(O,F,Z),ct=!c.arrow&&H(r)!=null&&F!==lt&&s.reference[p]/2-(F<O?U:C)-w[p]/2<0,at=ct?F<O?F-O:F-Z:0;return{[d]:u[d]+at,data:L({[d]:lt,centerOffset:F-lt-at},ct&&{alignmentOffset:at}),reset:ct}})}});function se(e,t,n){return(e?[...n.filter(o=>H(o)===e),...n.filter(o=>H(o)!==e)]:n.filter(o=>J(o)===o)).filter(o=>e?H(o)===e||(t?te(o)!==o:!1):!0)}const re=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(n){return B(this,null,function*(){var i,o,r;const{rects:s,middlewareData:l,placement:a,platform:c,elements:h}=n,U=it(e,n),{crossAxis:f=!1,alignment:g,allowedPlacements:u=St,autoAlignment:d=!0}=U,p=Pt(U,["crossAxis","alignment","allowedPlacements","autoAlignment"]),w=g!==void 0||u===St?se(g||null,d,u):u,x=yield ie(n,p),b=((i=l.autoPlacement)==null?void 0:i.index)||0,y=w[b];if(y==null)return{};const m=Zt(y,s,yield c.isRTL==null?void 0:c.isRTL(h.floating));if(a!==y)return{reset:{placement:w[0]}};const v=[x[J(y)],x[m[0]],x[m[1]]],D=[...((o=l.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:v}],k=w[b+1];if(k)return{data:{index:b+1,overflows:D},reset:{placement:k}};const M=D.map(C=>{const O=H(C.placement);return[C.placement,O&&f?C.overflows.slice(0,2).reduce((Z,F)=>Z+F,0):C.overflows[0],C.overflows]}).sort((C,O)=>C[1]-O[1]),q=((r=M.filter(C=>C[2].slice(0,H(C[0])?2:3).every(O=>O<=0))[0])==null?void 0:r[0])||M[0][0];return q!==a?{data:{index:b+1,overflows:D},reset:{placement:q}}:{}})}}};function le(e,t){return B(this,null,function*(){const{placement:n,platform:i,elements:o}=e,r=yield i.isRTL==null?void 0:i.isRTL(o.floating),s=J(n),l=H(n),a=pt(n)==="y",c=["left","top"].includes(s)?-1:1,h=r&&a?-1:1,f=it(t,e);let{mainAxis:g,crossAxis:u,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),a?{x:u*h,y:g*c}:{x:g*c,y:u*h}})}const ce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return B(this,null,function*(){var i,o;const{x:r,y:s,placement:l,middlewareData:a}=n,c=yield le(n,e);return l===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:X(L({},c),{placement:l})}})}}};function ot(){return typeof window!="undefined"}function Y(e){return kt(e)?(e.nodeName||"").toLowerCase():"#document"}function P(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){var t;return(t=(kt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kt(e){return ot()?e instanceof Node||e instanceof P(e).Node:!1}function T(e){return ot()?e instanceof Element||e instanceof P(e).Element:!1}function A(e){return ot()?e instanceof HTMLElement||e instanceof P(e).HTMLElement:!1}function Ot(e){return!ot()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof P(e).ShadowRoot}function Q(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ae(e){return["table","td","th"].includes(Y(e))}function st(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function wt(e){const t=xt(),n=T(e)?R(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function fe(e){let t=V(e);for(;A(t)&&!I(t);){if(wt(t))return t;if(st(t))return null;t=V(t)}return null}function xt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function I(e){return["html","body","#document"].includes(Y(e))}function R(e){return P(e).getComputedStyle(e)}function rt(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function V(e){if(Y(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ot(e)&&e.host||N(e);return Ot(t)?t.host:t}function Mt(e){const t=V(e);return I(t)?e.ownerDocument?e.ownerDocument.body:e.body:A(t)&&Q(t)?t:Mt(t)}function ut(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Mt(e),r=o===((i=e.ownerDocument)==null?void 0:i.body),s=P(o);if(r){const l=dt(s);return t.concat(s,s.visualViewport||[],Q(o)?o:[],l&&n?ut(l):[])}return t.concat(o,ut(o,[],n))}function dt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ft(e){const t=R(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=A(e),r=o?e.offsetWidth:n,s=o?e.offsetHeight:i,l=et(n)!==r||et(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function Bt(e){return T(e)?e:e.contextElement}function j(e){const t=Bt(e);if(!A(t))return $(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=Ft(t);let s=(r?et(n.width):n.width)/i,l=(r?et(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const he=$(0);function Ht(e){const t=P(e);return!xt()||!t.visualViewport?he:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ue(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==P(e)?!1:t}function G(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=Bt(e);let s=$(1);t&&(i?T(i)&&(s=j(i)):s=j(e));const l=ue(r,n,i)?Ht(r):$(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,h=o.width/s.x,f=o.height/s.y;if(r){const g=P(r),u=i&&T(i)?P(i):i;let d=g,p=dt(d);for(;p&&i&&u!==d;){const w=j(p),x=p.getBoundingClientRect(),b=R(p),y=x.left+(p.clientLeft+parseFloat(b.paddingLeft))*w.x,m=x.top+(p.clientTop+parseFloat(b.paddingTop))*w.y;a*=w.x,c*=w.y,h*=w.x,f*=w.y,a+=y,c+=m,d=P(p),p=dt(d)}}return nt({width:h,height:f,x:a,y:c})}function yt(e,t){const n=rt(e).scrollLeft;return t?t.left+n:G(N(e)).left+n}function Nt(e,t,n){n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-(n?0:yt(e,i)),r=i.top+t.scrollTop;return{x:o,y:r}}function de(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r=o==="fixed",s=N(i),l=t?st(t.floating):!1;if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=$(1);const h=$(0),f=A(i);if((f||!f&&!r)&&((Y(i)!=="body"||Q(s))&&(a=rt(i)),A(i))){const u=G(i);c=j(i),h.x=u.x+i.clientLeft,h.y=u.y+i.clientTop}const g=s&&!f&&!r?Nt(s,a,!0):$(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+h.x+g.x,y:n.y*c.y-a.scrollTop*c.y+h.y+g.y}}function ge(e){return Array.from(e.getClientRects())}function pe(e){const t=N(e),n=rt(e),i=e.ownerDocument.body,o=z(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=z(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+yt(e);const l=-n.scrollTop;return R(i).direction==="rtl"&&(s+=z(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:l}}function me(e,t){const n=P(e),i=N(e),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;const c=xt();(!c||c&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l,y:a}}function we(e,t){const n=G(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=A(e)?j(e):$(1),s=e.clientWidth*r.x,l=e.clientHeight*r.y,a=o*r.x,c=i*r.y;return{width:s,height:l,x:a,y:c}}function Et(e,t,n){let i;if(t==="viewport")i=me(e,n);else if(t==="document")i=pe(N(e));else if(T(t))i=we(t,n);else{const o=Ht(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return nt(i)}function Vt(e,t){const n=V(e);return n===t||!T(n)||I(n)?!1:R(n).position==="fixed"||Vt(n,t)}function xe(e,t){const n=t.get(e);if(n)return n;let i=ut(e,[],!1).filter(l=>T(l)&&Y(l)!=="body"),o=null;const r=R(e).position==="fixed";let s=r?V(e):e;for(;T(s)&&!I(s);){const l=R(s),a=wt(s);!a&&l.position==="fixed"&&(o=null),(r?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Q(s)&&!a&&Vt(e,s))?i=i.filter(h=>h!==s):o=l,s=V(s)}return t.set(e,i),i}function ye(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const s=[...n==="clippingAncestors"?st(t)?[]:xe(t,this._c):[].concat(n),i],l=s[0],a=s.reduce((c,h)=>{const f=Et(t,h,o);return c.top=z(f.top,c.top),c.right=K(f.right,c.right),c.bottom=K(f.bottom,c.bottom),c.left=z(f.left,c.left),c},Et(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ve(e){const{width:t,height:n}=Ft(e);return{width:t,height:n}}function be(e,t,n){const i=A(t),o=N(t),r=n==="fixed",s=G(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=$(0);if(i||!i&&!r)if((Y(t)!=="body"||Q(o))&&(l=rt(t)),i){const g=G(t,!0,r,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=yt(o));const c=o&&!i&&!r?Nt(o,l):$(0),h=s.left+l.scrollLeft-a.x-c.x,f=s.top+l.scrollTop-a.y-c.y;return{x:h,y:f,width:s.width,height:s.height}}function ht(e){return R(e).position==="static"}function $t(e,t){if(!A(e)||R(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return N(e)===n&&(n=n.ownerDocument.body),n}function Wt(e,t){const n=P(e);if(st(e))return n;if(!A(e)){let o=V(e);for(;o&&!I(o);){if(T(o)&&!ht(o))return o;o=V(o)}return n}let i=$t(e,t);for(;i&&ae(i)&&ht(i);)i=$t(i,t);return i&&I(i)&&ht(i)&&!wt(i)?n:i||fe(e)||n}const _e=function(e){return B(this,null,function*(){const t=this.getOffsetParent||Wt,n=this.getDimensions,i=yield n(e.floating);return{reference:be(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Ce(e){return R(e).direction==="rtl"}const Pe={convertOffsetParentRelativeRectToViewportRelativeRect:de,getDocumentElement:N,getClippingRect:ye,getOffsetParent:Wt,getElementRects:_e,getClientRects:ge,getDimensions:ve,getScale:j,isElement:T,isRTL:Ce},Le=ce,Se=re,Te=oe,Re=(e,t,n)=>{const i=new Map,o=L({platform:Pe},n),r=X(L({},o.platform),{_c:i});return ne(e,t,X(L({},o),{platform:r}))};function W(e){return e===null||typeof e=="undefined"}function E(e){return!W(e)}function At(e){return new Promise(t=>setTimeout(t,e))}function zt(e){var i;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((i=document.defaultView)==null?void 0:i.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:zt(t)}function jt(e){return zt(e)?"fixed":"absolute"}class Oe{renderContent(t,n,i){t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node)}}function S(e,t){const n=document.createElement(e);return t&&t.length>0&&(t=t.filter(i=>i),n.classList.add(...t)),n}class Ee{renderContent(t,n,i){var r,s,l,a;const o=t.querySelector(`.${i.classPrefix}-content`);if(n.imgSrc){const c=S("img",[`${i.classPrefix}-image`,`${(s=(r=n.customization)==null?void 0:r.imageClass)!=null?s:""}`]);c.src=n.imgSrc,o.appendChild(c)}if(n.text){const c=S("p",[`${i.classPrefix}-description`,`${(a=(l=n.customization)==null?void 0:l.descriptionClass)!=null?a:""}`]);c.innerText=i.translateFn(n.text),o.appendChild(c)}}}function $e(e,t,n){var l,a,c,h,f,g,u,d,p,w,x,b,y;if(e.innerHTML="",e.className=`${n.config.classPrefix} ${n.config.animationClass}`,!n.config.arrow.disable){const m=S("div",[(l=n.config.arrow.class)!=null?l:"",`${n.config.classPrefix}-arrow`]);e.appendChild(m)}(a=t.customization)!=null&&a.class&&e.classList.add(t.customization.class);const i=S("div",[`${n.config.classPrefix}-header`,`${(h=(c=t.customization)==null?void 0:c.headerClass)!=null?h:""}`]);e.appendChild(i);const o=S("h1",[`${n.config.classPrefix}-title`,`${(g=(f=t.customization)==null?void 0:f.titleClass)!=null?g:""}`]);if(o.innerHTML=n.config.translateFn((u=t.title)!=null?u:""),i.appendChild(o),n.config.allowClose){const m=S("button",[`${n.config.classPrefix}-close`,`${(p=(d=t.customization)==null?void 0:d.closeButtonClass)!=null?p:""}`]);Ae(m,n.config.closeIcon),m.onclick=n.complete.bind(n),i.appendChild(m)}const r=S("div",[`${n.config.classPrefix}-content`,`${(x=(w=t.customization)==null?void 0:w.contentClass)!=null?x:""}`]);e.appendChild(r);const s=S("div",[`${n.config.classPrefix}-footer`,`${(y=(b=t.customization)==null?void 0:b.footerClass)!=null?y:""}`]);W(t.buttonList)&&(t.buttonList=De(n)),t.buttonList.forEach(m=>{var k;const v=[`${n.config.classPrefix}-button`,(k=m.class)!=null?k:""];W(m.type)||m.type==="secondary"?v.push(`${n.config.classPrefix}-button-secondary`):m.type==="primary"?v.push(`${n.config.classPrefix}-button-primary`):m.type==="link"&&v.push(`${n.config.classPrefix}-button-link`),!W(m.class)&&m.class!==""&&v.push(m.class);const D=S("button",v);D.innerText=n.config.translateFn(m.text),D.onclick=M=>{m.action.call(n)},s.appendChild(D)}),e.appendChild(s)}function Ae(e,t){t instanceof HTMLElement?e.appendChild(t):e.innerHTML=t.innerHTML}function De(e){return[{text:"Back",action:e.prev},{text:"Next",type:"primary",action:e.next}]}class ke{constructor(){_(this,"_renderContentStrategy",new Map);_(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(t,n){return new Promise(i=>{var o,r;if(!this._renderContentStrategy.has(n.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(n.tour.config.animationClass),n.hostElement?t.style.position=jt(n.hostElement):t.style.position="fixed",$e(t,n.popupData,n.tour),(o=this._renderContentStrategy.get(n.popupData.type))==null||o.renderContent(t,n.popupData,n.tour.config),(r=n.hostElement)==null||r.scrollIntoView(n.tour.config.scrollTo),i()}).then(()=>n.isFirst&&n.direction==="toNext"?At(0):At(400)).then(()=>{t.style.display="block",this.updatePosition(t,n),t.classList.add(n.tour.config.animationClass)})}updatePosition(t,n){E(n.hostElement)?this.renderFloatingPopup(t,n):this.renderCenterPopup(t)}renderFloatingPopup(t,n){var c;const i=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=t.querySelector(`.${n.tour.config.classPrefix}-arrow`),r=[],s=E(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0,l=(c=o==null?void 0:o.offsetWidth)!=null?c:10,a=Math.sqrt(2*Ct(l,2))/2+n.tour.config.highlight.padding;r.push(Le(a)),(n.popupData.position==="auto"||W(s))&&r.push(Se()),!n.tour.config.arrow.disable&&E(o)&&r.push(Te({element:o})),Re(n.hostElement,t,{placement:s,middleware:[...r]}).then(({x:h,y:f,middlewareData:g,placement:u})=>{Object.assign(t.style,{top:`${f-i}px`,left:`${h}px`,marginTop:"0",marginLeft:"0"});const d=u.split("-")[0],p=this._staticSides[d];if(g.arrow&&E(o)){const{x:w,y:x}=g.arrow;Object.assign(o.style,{left:w!=null?`${w}px`:"",top:x!=null?`${x}px`:"",right:"",bottom:"",[p]:`${-l/2}px`,transform:"rotate(45deg)"})}})}renderCenterPopup(t){Object.assign(t.style,{top:"50%",left:"50%",marginTop:`-${t.clientHeight/2}px`,marginLeft:`-${t.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new Ee),this._renderContentStrategy.set("custom",new Oe)}}class Me{render(t,n){return new Promise(i=>{n.hostElement&&(t.style.position=jt(n.hostElement)),i()}).then(()=>{this.updatePosition(t,n)})}updatePosition(t,n){var s,l;if(!n.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.opacity="0";return}const i=n.hostElement.getBoundingClientRect(),o=(l=(s=n.tour.config.highlight)==null?void 0:s.padding)!=null?l:8,r=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${i.left-o}px`,t.style.top=`${i.top+r-o}px`,t.style.width=`${i.width+2*o}px`,t.style.height=`${i.height+2*o}px`,t.style.opacity="1"}}class It{constructor(t,n){_(this,"id");_(this,"popupData");_(this,"tour");_(this,"index");_(this,"_hostElement",null);_(this,"_direction","toNext");_(this,"_hostData");_(this,"_popupRenderer");_(this,"_highlightRenderer");var i;this.id=n.id,this.popupData=n.popup,this.tour=t,this.index=(i=n.index)!=null?i:null,this._hostData=n.host,this._popupRenderer=t.popupRenderer,this._highlightRenderer=t.highlightRenderer}get isFirst(){return this.index===0}get nextStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)+1])!=null?t:null}get prevStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)-1])!=null?t:null}get direction(){return this._direction}get hasHost(){return E(this._hostElement)}get hostElement(){return this._hostElement}show(t){return B(this,null,function*(){var i;if(W(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(i=this._hostData)!=null?i:null));const n=[this._popupRenderer.render(this.tour.popup,this)];!this.tour.config.highlight.disable&&!W(this.tour.highlight)&&n.push(this._highlightRenderer.render(this.tour.highlight,this)),yield Promise.all(n)})}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}}function Fe(e){return{innerHTML:`
2
2
  <svg
3
3
  xmlns="http://www.w3.org/2000/svg"
4
4
  fill="none"
@@ -18,4 +18,4 @@
18
18
  d="M9.01074 153L153.021 8.98926"
19
19
  ></path>
20
20
  </svg>
21
- `}}class Be{constructor(t){y(this,"popupRenderer",new ke);y(this,"highlightRenderer",new Me);y(this,"_popup",null);y(this,"_highlight",null);y(this,"_stepList",[]);y(this,"_activeStep",null);y(this,"_bodyResizeObserver");y(this,"_config");y(this,"_stepMap",new Map);var n,i,o,r,s,l,a,c,h,f,g,u,d,p,w;this._bodyResizeObserver=this.getBodyResizeObserver(),this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",animationClass:(i=t.animationClass)!=null?i:"siteguide-animation",allowClose:(o=t.allowClose)!=null?o:!0,scrollTo:(r=t.scrollTo)!=null?r:{behavior:"smooth",block:"center",inline:"center"},allowClickoutClose:(s=t.allowClickoutClose)!=null?s:!1,closeIcon:(a=t.closeIcon)!=null?a:Fe((l=t.classPrefix)!=null?l:"siteguide"),disableArrow:(c=t.disableArrow)!=null?c:!1,highlight:{disable:(f=(h=t.highlight)==null?void 0:h.disable)!=null?f:!1,padding:(u=(g=t.highlight)==null?void 0:g.padding)!=null?u:8,class:(p=(d=t.highlight)==null?void 0:d.class)!=null?p:"siteguide-highlight"},translateFn:(w=t.translateFn)!=null?w:x=>x}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}addStep(t){if(this._stepMap.has(t.id))throw new Error("Step with provided id has been already registered");const n=new It(this,t);E(t.index)?this._stepList.splice(t.index,0,n):this._stepList.push(n),this._stepMap.set(t.id,n)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.id),this._stepMap.delete(t)}start(){this._popup=S("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this._config.highlight.disable||(this._highlight=S("div",[this._config.highlight.class,`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this.next()}complete(){this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._activeStep=null}prev(){const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this._activeStep=this._stepList[t],this._activeStep.show("fromBack")}next(){const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}this._activeStep=this._stepList[t],this._activeStep.show("toNext")}setConfig(t){this._config=L(L({},this._config),t)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(E(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),E(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep))});return t.observe(document.body),t}}exports.Tour=Be;exports.TourStep=It;exports.createElement=S;
21
+ `}}class Be{constructor(t){_(this,"popupRenderer",new ke);_(this,"highlightRenderer",new Me);_(this,"_popup",null);_(this,"_highlight",null);_(this,"_stepList",[]);_(this,"_activeStep",null);_(this,"_bodyResizeObserver");_(this,"_config");_(this,"_stepMap",new Map);var n,i,o,r,s,l,a,c,h,f,g,u,d,p,w,x,b,y;this._bodyResizeObserver=this.getBodyResizeObserver(),this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",animationClass:(i=t.animationClass)!=null?i:"siteguide-animation",allowClose:(o=t.allowClose)!=null?o:!0,scrollTo:(r=t.scrollTo)!=null?r:{behavior:"smooth",block:"center",inline:"center"},allowClickoutClose:(s=t.allowClickoutClose)!=null?s:!1,closeIcon:(a=t.closeIcon)!=null?a:Fe((l=t.classPrefix)!=null?l:"siteguide"),arrow:{disable:(h=(c=t.arrow)==null?void 0:c.disable)!=null?h:!1,class:(g=(f=t.arrow)==null?void 0:f.class)!=null?g:""},highlight:{disable:(d=(u=t.highlight)==null?void 0:u.disable)!=null?d:!1,padding:(w=(p=t.highlight)==null?void 0:p.padding)!=null?w:8,class:(b=(x=t.highlight)==null?void 0:x.class)!=null?b:""},translateFn:(y=t.translateFn)!=null?y:m=>m}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}addStep(t){if(this._stepMap.has(t.id))throw new Error("Step with provided id has been already registered");const n=new It(this,t);E(t.index)?this._stepList.splice(t.index,0,n):this._stepList.push(n),this._stepMap.set(t.id,n)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.id),this._stepMap.delete(t)}start(){this._popup=S("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this._config.highlight.disable||(this._highlight=S("div",[this._config.highlight.class,`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this.next()}complete(){this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._activeStep=null}prev(){const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this._activeStep=this._stepList[t],this._activeStep.show("fromBack")}next(){const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}this._activeStep=this._stepList[t],this._activeStep.show("toNext")}setConfig(t){this._config=L(L({},this._config),t)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(E(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),E(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep))});return t.observe(document.body),t}}exports.Tour=Be;exports.TourStep=It;exports.createElement=S;
package/dist/index.mjs CHANGED
@@ -19,8 +19,8 @@ var Pt = (e, t) => {
19
19
  t.indexOf(i) < 0 && _t.call(e, i) && (n[i] = e[i]);
20
20
  return n;
21
21
  };
22
- var y = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
23
- var k = (e, t, n) => new Promise((i, o) => {
22
+ var _ = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
23
+ var B = (e, t, n) => new Promise((i, o) => {
24
24
  var r = (a) => {
25
25
  try {
26
26
  l(n.next(a));
@@ -57,7 +57,7 @@ function it(e, t) {
57
57
  function J(e) {
58
58
  return e.split("-")[0];
59
59
  }
60
- function M(e) {
60
+ function H(e) {
61
61
  return e.split("-")[1];
62
62
  }
63
63
  function Jt(e) {
@@ -74,7 +74,7 @@ function mt(e) {
74
74
  }
75
75
  function Qt(e, t, n) {
76
76
  n === void 0 && (n = !1);
77
- const i = M(e), o = mt(e), r = gt(o);
77
+ const i = H(e), o = mt(e), r = gt(o);
78
78
  let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
79
79
  return t.reference[r] > t.floating[r] && (s = Rt(s)), [s, Rt(s)];
80
80
  }
@@ -156,7 +156,7 @@ function Tt(e, t, n) {
156
156
  y: i.y
157
157
  };
158
158
  }
159
- switch (M(t)) {
159
+ switch (H(t)) {
160
160
  case "start":
161
161
  u[s] -= g * (n && c ? -1 : 1);
162
162
  break;
@@ -166,7 +166,7 @@ function Tt(e, t, n) {
166
166
  }
167
167
  return u;
168
168
  }
169
- const ee = (e, t, n) => k(void 0, null, function* () {
169
+ const ee = (e, t, n) => B(void 0, null, function* () {
170
170
  const {
171
171
  placement: i = "bottom",
172
172
  strategy: o = "absolute",
@@ -186,10 +186,10 @@ const ee = (e, t, n) => k(void 0, null, function* () {
186
186
  name: w,
187
187
  fn: x
188
188
  } = l[p], {
189
- x: _,
190
- y: m,
191
- data: v,
192
- reset: b
189
+ x: b,
190
+ y,
191
+ data: m,
192
+ reset: v
193
193
  } = yield x({
194
194
  x: h,
195
195
  y: f,
@@ -204,13 +204,13 @@ const ee = (e, t, n) => k(void 0, null, function* () {
204
204
  floating: t
205
205
  }
206
206
  });
207
- h = _ != null ? _ : h, f = m != null ? m : f, u = X(L({}, u), {
208
- [w]: L(L({}, u[w]), v)
209
- }), b && d <= 50 && (d++, typeof b == "object" && (b.placement && (g = b.placement), b.rects && (c = b.rects === !0 ? yield s.getElementRects({
207
+ h = b != null ? b : h, f = y != null ? y : f, u = X(L({}, u), {
208
+ [w]: L(L({}, u[w]), m)
209
+ }), v && d <= 50 && (d++, typeof v == "object" && (v.placement && (g = v.placement), v.rects && (c = v.rects === !0 ? yield s.getElementRects({
210
210
  reference: e,
211
211
  floating: t,
212
212
  strategy: o
213
- }) : b.rects), {
213
+ }) : v.rects), {
214
214
  x: h,
215
215
  y: f
216
216
  } = Tt(c, g, a)), p = -1);
@@ -224,7 +224,7 @@ const ee = (e, t, n) => k(void 0, null, function* () {
224
224
  };
225
225
  });
226
226
  function ne(e, t) {
227
- return k(this, null, function* () {
227
+ return B(this, null, function* () {
228
228
  var n;
229
229
  t === void 0 && (t = {});
230
230
  const {
@@ -245,28 +245,28 @@ function ne(e, t) {
245
245
  boundary: c,
246
246
  rootBoundary: h,
247
247
  strategy: a
248
- })), _ = f === "floating" ? {
248
+ })), b = f === "floating" ? {
249
249
  x: i,
250
250
  y: o,
251
251
  width: s.floating.width,
252
252
  height: s.floating.height
253
- } : s.reference, m = yield r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating), v = (yield r.isElement == null ? void 0 : r.isElement(m)) ? (yield r.getScale == null ? void 0 : r.getScale(m)) || {
253
+ } : s.reference, y = yield r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating), m = (yield r.isElement == null ? void 0 : r.isElement(y)) ? (yield r.getScale == null ? void 0 : r.getScale(y)) || {
254
254
  x: 1,
255
255
  y: 1
256
256
  } : {
257
257
  x: 1,
258
258
  y: 1
259
- }, b = nt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? yield r.convertOffsetParentRelativeRectToViewportRelativeRect({
259
+ }, v = nt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? yield r.convertOffsetParentRelativeRectToViewportRelativeRect({
260
260
  elements: l,
261
- rect: _,
262
- offsetParent: m,
261
+ rect: b,
262
+ offsetParent: y,
263
263
  strategy: a
264
- }) : _);
264
+ }) : b);
265
265
  return {
266
- top: (x.top - b.top + d.top) / v.y,
267
- bottom: (b.bottom - x.bottom + d.bottom) / v.y,
268
- left: (x.left - b.left + d.left) / v.x,
269
- right: (b.right - x.right + d.right) / v.x
266
+ top: (x.top - v.top + d.top) / m.y,
267
+ bottom: (v.bottom - x.bottom + d.bottom) / m.y,
268
+ left: (x.left - v.left + d.left) / m.x,
269
+ right: (v.right - x.right + d.right) / m.x
270
270
  };
271
271
  });
272
272
  }
@@ -274,7 +274,7 @@ const ie = (e) => ({
274
274
  name: "arrow",
275
275
  options: e,
276
276
  fn(n) {
277
- return k(this, null, function* () {
277
+ return B(this, null, function* () {
278
278
  const {
279
279
  x: i,
280
280
  y: o,
@@ -292,15 +292,15 @@ const ie = (e) => ({
292
292
  const g = Dt(f), u = {
293
293
  x: i,
294
294
  y: o
295
- }, d = mt(r), p = gt(d), w = yield l.getDimensions(h), x = d === "y", _ = x ? "top" : "left", m = x ? "bottom" : "right", v = x ? "clientHeight" : "clientWidth", b = s.reference[p] + s.reference[d] - u[d] - s.floating[p], B = u[d] - s.reference[d], V = yield l.getOffsetParent == null ? void 0 : l.getOffsetParent(h);
296
- let H = V ? V[v] : 0;
297
- (!H || !(yield l.isElement == null ? void 0 : l.isElement(V))) && (H = a.floating[v] || s.floating[p]);
298
- const vt = b / 2 - B / 2, q = H / 2 - w[p] / 2 - 1, U = K(g[_], q), C = K(g[m], q), O = U, Z = H - w[p] - C, D = H / 2 - w[p] / 2 + vt, lt = Gt(O, D, Z), ct = !c.arrow && M(r) != null && D !== lt && s.reference[p] / 2 - (D < O ? U : C) - w[p] / 2 < 0, at = ct ? D < O ? D - O : D - Z : 0;
295
+ }, d = mt(r), p = gt(d), w = yield l.getDimensions(h), x = d === "y", b = x ? "top" : "left", y = x ? "bottom" : "right", m = x ? "clientHeight" : "clientWidth", v = s.reference[p] + s.reference[d] - u[d] - s.floating[p], D = u[d] - s.reference[d], k = yield l.getOffsetParent == null ? void 0 : l.getOffsetParent(h);
296
+ let M = k ? k[m] : 0;
297
+ (!M || !(yield l.isElement == null ? void 0 : l.isElement(k))) && (M = a.floating[m] || s.floating[p]);
298
+ const vt = v / 2 - D / 2, q = M / 2 - w[p] / 2 - 1, U = K(g[b], q), C = K(g[y], q), O = U, Z = M - w[p] - C, F = M / 2 - w[p] / 2 + vt, lt = Gt(O, F, Z), ct = !c.arrow && H(r) != null && F !== lt && s.reference[p] / 2 - (F < O ? U : C) - w[p] / 2 < 0, at = ct ? F < O ? F - O : F - Z : 0;
299
299
  return {
300
300
  [d]: u[d] + at,
301
301
  data: L({
302
302
  [d]: lt,
303
- centerOffset: D - lt - at
303
+ centerOffset: F - lt - at
304
304
  }, ct && {
305
305
  alignmentOffset: at
306
306
  }),
@@ -310,14 +310,14 @@ const ie = (e) => ({
310
310
  }
311
311
  });
312
312
  function oe(e, t, n) {
313
- return (e ? [...n.filter((o) => M(o) === e), ...n.filter((o) => M(o) !== e)] : n.filter((o) => J(o) === o)).filter((o) => e ? M(o) === e || (t ? Zt(o) !== o : !1) : !0);
313
+ return (e ? [...n.filter((o) => H(o) === e), ...n.filter((o) => H(o) !== e)] : n.filter((o) => J(o) === o)).filter((o) => e ? H(o) === e || (t ? Zt(o) !== o : !1) : !0);
314
314
  }
315
315
  const se = function(e) {
316
316
  return e === void 0 && (e = {}), {
317
317
  name: "autoPlacement",
318
318
  options: e,
319
319
  fn(n) {
320
- return k(this, null, function* () {
320
+ return B(this, null, function* () {
321
321
  var i, o, r;
322
322
  const {
323
323
  rects: s,
@@ -335,49 +335,49 @@ const se = function(e) {
335
335
  "alignment",
336
336
  "allowedPlacements",
337
337
  "autoAlignment"
338
- ]), w = g !== void 0 || u === St ? oe(g || null, d, u) : u, x = yield ne(n, p), _ = ((i = l.autoPlacement) == null ? void 0 : i.index) || 0, m = w[_];
339
- if (m == null)
338
+ ]), w = g !== void 0 || u === St ? oe(g || null, d, u) : u, x = yield ne(n, p), b = ((i = l.autoPlacement) == null ? void 0 : i.index) || 0, y = w[b];
339
+ if (y == null)
340
340
  return {};
341
- const v = Qt(m, s, yield c.isRTL == null ? void 0 : c.isRTL(h.floating));
342
- if (a !== m)
341
+ const m = Qt(y, s, yield c.isRTL == null ? void 0 : c.isRTL(h.floating));
342
+ if (a !== y)
343
343
  return {
344
344
  reset: {
345
345
  placement: w[0]
346
346
  }
347
347
  };
348
- const b = [x[J(m)], x[v[0]], x[v[1]]], B = [...((o = l.autoPlacement) == null ? void 0 : o.overflows) || [], {
349
- placement: m,
350
- overflows: b
351
- }], V = w[_ + 1];
352
- if (V)
348
+ const v = [x[J(y)], x[m[0]], x[m[1]]], D = [...((o = l.autoPlacement) == null ? void 0 : o.overflows) || [], {
349
+ placement: y,
350
+ overflows: v
351
+ }], k = w[b + 1];
352
+ if (k)
353
353
  return {
354
354
  data: {
355
- index: _ + 1,
356
- overflows: B
355
+ index: b + 1,
356
+ overflows: D
357
357
  },
358
358
  reset: {
359
- placement: V
359
+ placement: k
360
360
  }
361
361
  };
362
- const H = B.map((C) => {
363
- const O = M(C.placement);
362
+ const M = D.map((C) => {
363
+ const O = H(C.placement);
364
364
  return [C.placement, O && f ? (
365
365
  // Check along the mainAxis and main crossAxis side.
366
- C.overflows.slice(0, 2).reduce((Z, D) => Z + D, 0)
366
+ C.overflows.slice(0, 2).reduce((Z, F) => Z + F, 0)
367
367
  ) : (
368
368
  // Check only the mainAxis.
369
369
  C.overflows[0]
370
370
  ), C.overflows];
371
- }).sort((C, O) => C[1] - O[1]), q = ((r = H.filter((C) => C[2].slice(
371
+ }).sort((C, O) => C[1] - O[1]), q = ((r = M.filter((C) => C[2].slice(
372
372
  0,
373
373
  // Aligned placements should not check their opposite crossAxis
374
374
  // side.
375
- M(C[0]) ? 2 : 3
376
- ).every((O) => O <= 0))[0]) == null ? void 0 : r[0]) || H[0][0];
375
+ H(C[0]) ? 2 : 3
376
+ ).every((O) => O <= 0))[0]) == null ? void 0 : r[0]) || M[0][0];
377
377
  return q !== a ? {
378
378
  data: {
379
- index: _ + 1,
380
- overflows: B
379
+ index: b + 1,
380
+ overflows: D
381
381
  },
382
382
  reset: {
383
383
  placement: q
@@ -388,12 +388,12 @@ const se = function(e) {
388
388
  };
389
389
  };
390
390
  function re(e, t) {
391
- return k(this, null, function* () {
391
+ return B(this, null, function* () {
392
392
  const {
393
393
  placement: n,
394
394
  platform: i,
395
395
  elements: o
396
- } = e, r = yield i.isRTL == null ? void 0 : i.isRTL(o.floating), s = J(n), l = M(n), a = pt(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, h = r && a ? -1 : 1, f = it(t, e);
396
+ } = e, r = yield i.isRTL == null ? void 0 : i.isRTL(o.floating), s = J(n), l = H(n), a = pt(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, h = r && a ? -1 : 1, f = it(t, e);
397
397
  let {
398
398
  mainAxis: g,
399
399
  crossAxis: u,
@@ -421,7 +421,7 @@ const le = function(e) {
421
421
  name: "offset",
422
422
  options: e,
423
423
  fn(n) {
424
- return k(this, null, function* () {
424
+ return B(this, null, function* () {
425
425
  var i, o;
426
426
  const {
427
427
  x: r,
@@ -450,7 +450,7 @@ function P(e) {
450
450
  var t;
451
451
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
452
452
  }
453
- function F(e) {
453
+ function N(e) {
454
454
  var t;
455
455
  return (t = (kt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
456
456
  }
@@ -492,13 +492,13 @@ function wt(e) {
492
492
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
493
493
  }
494
494
  function ae(e) {
495
- let t = N(e);
495
+ let t = V(e);
496
496
  for (; A(t) && !I(t); ) {
497
497
  if (wt(t))
498
498
  return t;
499
499
  if (st(t))
500
500
  return null;
501
- t = N(t);
501
+ t = V(t);
502
502
  }
503
503
  return null;
504
504
  }
@@ -520,7 +520,7 @@ function rt(e) {
520
520
  scrollTop: e.scrollY
521
521
  };
522
522
  }
523
- function N(e) {
523
+ function V(e) {
524
524
  if (Y(e) === "html")
525
525
  return e;
526
526
  const t = (
@@ -528,12 +528,12 @@ function N(e) {
528
528
  e.assignedSlot || // DOM Element detected.
529
529
  e.parentNode || // ShadowRoot detected.
530
530
  Ot(e) && e.host || // Fallback.
531
- F(e)
531
+ N(e)
532
532
  );
533
533
  return Ot(t) ? t.host : t;
534
534
  }
535
535
  function Mt(e) {
536
- const t = N(e);
536
+ const t = V(e);
537
537
  return I(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : A(t) && Q(t) ? t : Mt(t);
538
538
  }
539
539
  function ut(e, t, n) {
@@ -599,8 +599,8 @@ function G(e, t, n, i) {
599
599
  const g = P(r), u = i && R(i) ? P(i) : i;
600
600
  let d = g, p = dt(d);
601
601
  for (; p && i && u !== d; ) {
602
- const w = j(p), x = p.getBoundingClientRect(), _ = T(p), m = x.left + (p.clientLeft + parseFloat(_.paddingLeft)) * w.x, v = x.top + (p.clientTop + parseFloat(_.paddingTop)) * w.y;
603
- a *= w.x, c *= w.y, h *= w.x, f *= w.y, a += m, c += v, d = P(p), p = dt(d);
602
+ const w = j(p), x = p.getBoundingClientRect(), b = T(p), y = x.left + (p.clientLeft + parseFloat(b.paddingLeft)) * w.x, m = x.top + (p.clientTop + parseFloat(b.paddingTop)) * w.y;
603
+ a *= w.x, c *= w.y, h *= w.x, f *= w.y, a += y, c += m, d = P(p), p = dt(d);
604
604
  }
605
605
  }
606
606
  return nt({
@@ -612,7 +612,7 @@ function G(e, t, n, i) {
612
612
  }
613
613
  function yt(e, t) {
614
614
  const n = rt(e).scrollLeft;
615
- return t ? t.left + n : G(F(e)).left + n;
615
+ return t ? t.left + n : G(N(e)).left + n;
616
616
  }
617
617
  function Nt(e, t, n) {
618
618
  n === void 0 && (n = !1);
@@ -632,7 +632,7 @@ function ue(e) {
632
632
  offsetParent: i,
633
633
  strategy: o
634
634
  } = e;
635
- const r = o === "fixed", s = F(i), l = t ? st(t.floating) : !1;
635
+ const r = o === "fixed", s = N(i), l = t ? st(t.floating) : !1;
636
636
  if (i === s || l && r)
637
637
  return n;
638
638
  let a = {
@@ -656,7 +656,7 @@ function de(e) {
656
656
  return Array.from(e.getClientRects());
657
657
  }
658
658
  function ge(e) {
659
- const t = F(e), n = rt(e), i = e.ownerDocument.body, o = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
659
+ const t = N(e), n = rt(e), i = e.ownerDocument.body, o = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
660
660
  let s = -n.scrollLeft + yt(e);
661
661
  const l = -n.scrollTop;
662
662
  return T(i).direction === "rtl" && (s += z(t.clientWidth, i.clientWidth) - o), {
@@ -667,7 +667,7 @@ function ge(e) {
667
667
  };
668
668
  }
669
669
  function pe(e, t) {
670
- const n = P(e), i = F(e), o = n.visualViewport;
670
+ const n = P(e), i = N(e), o = n.visualViewport;
671
671
  let r = i.clientWidth, s = i.clientHeight, l = 0, a = 0;
672
672
  if (o) {
673
673
  r = o.width, s = o.height;
@@ -695,7 +695,7 @@ function Et(e, t, n) {
695
695
  if (t === "viewport")
696
696
  i = pe(e, n);
697
697
  else if (t === "document")
698
- i = ge(F(e));
698
+ i = ge(N(e));
699
699
  else if (R(t))
700
700
  i = me(t, n);
701
701
  else {
@@ -710,7 +710,7 @@ function Et(e, t, n) {
710
710
  return nt(i);
711
711
  }
712
712
  function Vt(e, t) {
713
- const n = N(e);
713
+ const n = V(e);
714
714
  return n === t || !R(n) || I(n) ? !1 : T(n).position === "fixed" || Vt(n, t);
715
715
  }
716
716
  function we(e, t) {
@@ -719,10 +719,10 @@ function we(e, t) {
719
719
  return n;
720
720
  let i = ut(e, [], !1).filter((l) => R(l) && Y(l) !== "body"), o = null;
721
721
  const r = T(e).position === "fixed";
722
- let s = r ? N(e) : e;
722
+ let s = r ? V(e) : e;
723
723
  for (; R(s) && !I(s); ) {
724
724
  const l = T(s), a = wt(s);
725
- !a && l.position === "fixed" && (o = null), (r ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Q(s) && !a && Vt(e, s)) ? i = i.filter((h) => h !== s) : o = l, s = N(s);
725
+ !a && l.position === "fixed" && (o = null), (r ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Q(s) && !a && Vt(e, s)) ? i = i.filter((h) => h !== s) : o = l, s = V(s);
726
726
  }
727
727
  return t.set(e, i), i;
728
728
  }
@@ -755,7 +755,7 @@ function ye(e) {
755
755
  };
756
756
  }
757
757
  function ve(e, t, n) {
758
- const i = A(t), o = F(t), r = n === "fixed", s = G(e, !0, r, t);
758
+ const i = A(t), o = N(t), r = n === "fixed", s = G(e, !0, r, t);
759
759
  let l = {
760
760
  scrollLeft: 0,
761
761
  scrollTop: 0
@@ -783,18 +783,18 @@ function $t(e, t) {
783
783
  if (t)
784
784
  return t(e);
785
785
  let n = e.offsetParent;
786
- return F(e) === n && (n = n.ownerDocument.body), n;
786
+ return N(e) === n && (n = n.ownerDocument.body), n;
787
787
  }
788
788
  function Wt(e, t) {
789
789
  const n = P(e);
790
790
  if (st(e))
791
791
  return n;
792
792
  if (!A(e)) {
793
- let o = N(e);
793
+ let o = V(e);
794
794
  for (; o && !I(o); ) {
795
795
  if (R(o) && !ht(o))
796
796
  return o;
797
- o = N(o);
797
+ o = V(o);
798
798
  }
799
799
  return n;
800
800
  }
@@ -804,7 +804,7 @@ function Wt(e, t) {
804
804
  return i && I(i) && ht(i) && !wt(i) ? n : i || ae(e) || n;
805
805
  }
806
806
  const be = function(e) {
807
- return k(this, null, function* () {
807
+ return B(this, null, function* () {
808
808
  const t = this.getOffsetParent || Wt, n = this.getDimensions, i = yield n(e.floating);
809
809
  return {
810
810
  reference: ve(e.reference, yield t(e.floating), e.strategy),
@@ -822,7 +822,7 @@ function _e(e) {
822
822
  }
823
823
  const Ce = {
824
824
  convertOffsetParentRelativeRectToViewportRelativeRect: ue,
825
- getDocumentElement: F,
825
+ getDocumentElement: N,
826
826
  getClippingRect: xe,
827
827
  getOffsetParent: Wt,
828
828
  getElementRects: be,
@@ -890,45 +890,48 @@ class Oe {
890
890
  }
891
891
  }
892
892
  function Ee(e, t, n) {
893
- var l, a, c, h, f, g, u, d, p, w, x, _;
894
- if (e.innerHTML = "", e.className = `${n.config.classPrefix} ${n.config.animationClass}`, !n.config.disableArrow) {
895
- const m = S("div", [`${n.config.classPrefix}-arrow`]);
893
+ var l, a, c, h, f, g, u, d, p, w, x, b, y;
894
+ if (e.innerHTML = "", e.className = `${n.config.classPrefix} ${n.config.animationClass}`, !n.config.arrow.disable) {
895
+ const m = S("div", [
896
+ (l = n.config.arrow.class) != null ? l : "",
897
+ `${n.config.classPrefix}-arrow`
898
+ ]);
896
899
  e.appendChild(m);
897
900
  }
898
- (l = t.customization) != null && l.class && e.classList.add(t.customization.class);
901
+ (a = t.customization) != null && a.class && e.classList.add(t.customization.class);
899
902
  const i = S("div", [
900
903
  `${n.config.classPrefix}-header`,
901
- `${(c = (a = t.customization) == null ? void 0 : a.headerClass) != null ? c : ""}`
904
+ `${(h = (c = t.customization) == null ? void 0 : c.headerClass) != null ? h : ""}`
902
905
  ]);
903
906
  e.appendChild(i);
904
907
  const o = S("h1", [
905
908
  `${n.config.classPrefix}-title`,
906
- `${(f = (h = t.customization) == null ? void 0 : h.titleClass) != null ? f : ""}`
909
+ `${(g = (f = t.customization) == null ? void 0 : f.titleClass) != null ? g : ""}`
907
910
  ]);
908
- if (o.innerHTML = n.config.translateFn((g = t.title) != null ? g : ""), i.appendChild(o), n.config.allowClose) {
911
+ if (o.innerHTML = n.config.translateFn((u = t.title) != null ? u : ""), i.appendChild(o), n.config.allowClose) {
909
912
  const m = S("button", [
910
913
  `${n.config.classPrefix}-close`,
911
- `${(d = (u = t.customization) == null ? void 0 : u.closeButtonClass) != null ? d : ""}`
914
+ `${(p = (d = t.customization) == null ? void 0 : d.closeButtonClass) != null ? p : ""}`
912
915
  ]);
913
916
  $e(m, n.config.closeIcon), m.onclick = n.complete.bind(n), i.appendChild(m);
914
917
  }
915
918
  const r = S("div", [
916
919
  `${n.config.classPrefix}-content`,
917
- `${(w = (p = t.customization) == null ? void 0 : p.contentClass) != null ? w : ""}`
920
+ `${(x = (w = t.customization) == null ? void 0 : w.contentClass) != null ? x : ""}`
918
921
  ]);
919
922
  e.appendChild(r);
920
923
  const s = S("div", [
921
924
  `${n.config.classPrefix}-footer`,
922
- `${(_ = (x = t.customization) == null ? void 0 : x.footerClass) != null ? _ : ""}`
925
+ `${(y = (b = t.customization) == null ? void 0 : b.footerClass) != null ? y : ""}`
923
926
  ]);
924
927
  W(t.buttonList) && (t.buttonList = Ae(n)), t.buttonList.forEach((m) => {
925
- var B;
926
- const v = [`${n.config.classPrefix}-button`, (B = m.class) != null ? B : ""];
928
+ var k;
929
+ const v = [`${n.config.classPrefix}-button`, (k = m.class) != null ? k : ""];
927
930
  W(m.type) || m.type === "secondary" ? v.push(`${n.config.classPrefix}-button-secondary`) : m.type === "primary" ? v.push(`${n.config.classPrefix}-button-primary`) : m.type === "link" && v.push(`${n.config.classPrefix}-button-link`), !W(m.class) && m.class !== "" && v.push(m.class);
928
- const b = S("button", v);
929
- b.innerText = n.config.translateFn(m.text), b.onclick = (V) => {
931
+ const D = S("button", v);
932
+ D.innerText = n.config.translateFn(m.text), D.onclick = (M) => {
930
933
  m.action.call(n);
931
- }, s.appendChild(b);
934
+ }, s.appendChild(D);
932
935
  }), e.appendChild(s);
933
936
  }
934
937
  function $e(e, t) {
@@ -949,8 +952,8 @@ function Ae(e) {
949
952
  }
950
953
  class De {
951
954
  constructor() {
952
- y(this, "_renderContentStrategy", /* @__PURE__ */ new Map());
953
- y(this, "_staticSides", {
955
+ _(this, "_renderContentStrategy", /* @__PURE__ */ new Map());
956
+ _(this, "_staticSides", {
954
957
  top: "bottom",
955
958
  right: "left",
956
959
  bottom: "top",
@@ -976,7 +979,7 @@ class De {
976
979
  renderFloatingPopup(t, n) {
977
980
  var c;
978
981
  const i = t.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, o = t.querySelector(`.${n.tour.config.classPrefix}-arrow`), r = [], s = E(n.popupData.position) && n.popupData.position !== "auto" ? n.popupData.position : void 0, l = (c = o == null ? void 0 : o.offsetWidth) != null ? c : 10, a = Math.sqrt(2 * Ct(l, 2)) / 2 + n.tour.config.highlight.padding;
979
- r.push(Pe(a)), (n.popupData.position === "auto" || W(s)) && r.push(Le()), !n.tour.config.disableArrow && E(o) && r.push(Se({ element: o })), Re(n.hostElement, t, {
982
+ r.push(Pe(a)), (n.popupData.position === "auto" || W(s)) && r.push(Le()), !n.tour.config.arrow.disable && E(o) && r.push(Se({ element: o })), Re(n.hostElement, t, {
980
983
  placement: s,
981
984
  middleware: [...r]
982
985
  }).then(({ x: h, y: f, middlewareData: g, placement: u }) => {
@@ -1034,15 +1037,15 @@ class ke {
1034
1037
  }
1035
1038
  class Me {
1036
1039
  constructor(t, n) {
1037
- y(this, "id");
1038
- y(this, "popupData");
1039
- y(this, "tour");
1040
- y(this, "index");
1041
- y(this, "_hostElement", null);
1042
- y(this, "_direction", "toNext");
1043
- y(this, "_hostData");
1044
- y(this, "_popupRenderer");
1045
- y(this, "_highlightRenderer");
1040
+ _(this, "id");
1041
+ _(this, "popupData");
1042
+ _(this, "tour");
1043
+ _(this, "index");
1044
+ _(this, "_hostElement", null);
1045
+ _(this, "_direction", "toNext");
1046
+ _(this, "_hostData");
1047
+ _(this, "_popupRenderer");
1048
+ _(this, "_highlightRenderer");
1046
1049
  var i;
1047
1050
  this.id = n.id, this.popupData = n.popup, this.tour = t, this.index = (i = n.index) != null ? i : null, this._hostData = n.host, this._popupRenderer = t.popupRenderer, this._highlightRenderer = t.highlightRenderer;
1048
1051
  }
@@ -1067,7 +1070,7 @@ class Me {
1067
1070
  return this._hostElement;
1068
1071
  }
1069
1072
  show(t) {
1070
- return k(this, null, function* () {
1073
+ return B(this, null, function* () {
1071
1074
  var i;
1072
1075
  if (W(this.tour.popup))
1073
1076
  return;
@@ -1109,16 +1112,16 @@ function Fe(e) {
1109
1112
  }
1110
1113
  class He {
1111
1114
  constructor(t) {
1112
- y(this, "popupRenderer", new De());
1113
- y(this, "highlightRenderer", new ke());
1114
- y(this, "_popup", null);
1115
- y(this, "_highlight", null);
1116
- y(this, "_stepList", []);
1117
- y(this, "_activeStep", null);
1118
- y(this, "_bodyResizeObserver");
1119
- y(this, "_config");
1120
- y(this, "_stepMap", /* @__PURE__ */ new Map());
1121
- var n, i, o, r, s, l, a, c, h, f, g, u, d, p, w;
1115
+ _(this, "popupRenderer", new De());
1116
+ _(this, "highlightRenderer", new ke());
1117
+ _(this, "_popup", null);
1118
+ _(this, "_highlight", null);
1119
+ _(this, "_stepList", []);
1120
+ _(this, "_activeStep", null);
1121
+ _(this, "_bodyResizeObserver");
1122
+ _(this, "_config");
1123
+ _(this, "_stepMap", /* @__PURE__ */ new Map());
1124
+ var n, i, o, r, s, l, a, c, h, f, g, u, d, p, w, x, b, y;
1122
1125
  this._bodyResizeObserver = this.getBodyResizeObserver(), this._config = {
1123
1126
  classPrefix: (n = t.classPrefix) != null ? n : "siteguide",
1124
1127
  animationClass: (i = t.animationClass) != null ? i : "siteguide-animation",
@@ -1131,13 +1134,16 @@ class He {
1131
1134
  },
1132
1135
  allowClickoutClose: (s = t.allowClickoutClose) != null ? s : !1,
1133
1136
  closeIcon: (a = t.closeIcon) != null ? a : Fe((l = t.classPrefix) != null ? l : "siteguide"),
1134
- disableArrow: (c = t.disableArrow) != null ? c : !1,
1137
+ arrow: {
1138
+ disable: (h = (c = t.arrow) == null ? void 0 : c.disable) != null ? h : !1,
1139
+ class: (g = (f = t.arrow) == null ? void 0 : f.class) != null ? g : ""
1140
+ },
1135
1141
  highlight: {
1136
- disable: (f = (h = t.highlight) == null ? void 0 : h.disable) != null ? f : !1,
1137
- padding: (u = (g = t.highlight) == null ? void 0 : g.padding) != null ? u : 8,
1138
- class: (p = (d = t.highlight) == null ? void 0 : d.class) != null ? p : "siteguide-highlight"
1142
+ disable: (d = (u = t.highlight) == null ? void 0 : u.disable) != null ? d : !1,
1143
+ padding: (w = (p = t.highlight) == null ? void 0 : p.padding) != null ? w : 8,
1144
+ class: (b = (x = t.highlight) == null ? void 0 : x.class) != null ? b : ""
1139
1145
  },
1140
- translateFn: (w = t.translateFn) != null ? w : (x) => x
1146
+ translateFn: (y = t.translateFn) != null ? y : (m) => m
1141
1147
  };
1142
1148
  }
1143
1149
  get stepList() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siteguide.js",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Open source library made with vanilla Javascript and CSS to help you build website guides and onboarding tours.",
5
5
  "license": "MIT",
6
6
  "keywords": [