siteguide.js 0.9.2 → 0.9.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);--sg-primary: #2e62d9;--sg-primary-hover: #2ca2fd;--sg-secondary: #2ca2fd;--sg-secondary-hover: #2ca2fd;--sg-danger: #ff3b30;--sg-success: #52b52f;--sg-attention: #ffa900;--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;--sg-padding-s: 8px;--sg-padding-m: 12px;--sg-padding-l: 16px;--sg-padding-2l: 20px;--sg-text-xs: 12px;--sg-text-s: 14px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=siteguide]{box-sizing:border-box;font-family:Inter,sans-serif}.siteguide-background{position:fixed;inset:0;background:#00000080;z-index:999999;opacity:0;transition:opacity .3s ease-out}.siteguide-highlight{position:fixed;border:2px solid var(--sg-mono-900);border-radius:4px;box-shadow:0 0 #212121cc,0 0 0 5000px #21212180;z-index:9999998;opacity:0;transition:all .3s ease-out}.siteguide-host{position:relative;z-index:99999999!important}.siteguide-interaction{position:fixed;border-radius:4px;z-index:99999999}.siteguide{position:fixed;width:280px;min-height:150px;max-height:400px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);box-shadow:0 10px 10px #0001;display:flex;flex-direction:column;z-index:100000000;color:var(--sg-text);font-size:var(--sg-text-m)}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-arrow{position:absolute;width:10px;height:10px;background-color:inherit;z-index:1}.siteguide-header{display:flex;align-items:center;width:100%;padding:var(--sg-padding-m) var(--sg-padding-2l) 0;position:relative}.siteguide-content{width:100%;padding:var(--sg-padding-m) var(--sg-padding-2l);overflow-y:auto}.siteguide-content::-webkit-scrollbar{width:4px}.siteguide-content::-webkit-scrollbar-thumb{background-color:var(--sg-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(--sg-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(--sg-padding-m);border-top:1px solid var(--sg-line);gap:var(--sg-padding-l);margin-top:auto}.siteguide-button{padding:var(--sg-padding-s) var(--sg-padding-l);border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;transition:background-color .3s ease-out;color:var(--sg-mono-100);border:none}.siteguide-button-secondary{background-color:var(--sg-secondary)}.siteguide-button-secondary:hover{background-color:var(--sg-secondary-hover)}.siteguide-button-primary{background-color:var(--sg-primary)}.siteguide-button-primary:hover{background-color:var(--sg-primary-hover)}.siteguide-button-link{color:var(--sg-primary);background-color:transparent;cursor:pointer;transition:color .3s ease-out}.siteguide-button-link:hover{color:var(--sg-primary-hover)}.siteguide-progress{font-size:var(--sg-text-s);color:var(--sg-mono-800)}.siteguide-close{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:4px;cursor:pointer;position:absolute;top:10px;right:10px;transition:color .3s ease-out,background-color .3s ease-out;border:none}.siteguide-close:hover{background-color:var(--sg-secondary-hover);color:#fff}
1
+ :root{--sg-bg: var(--sg-mono-100);--sg-text: var(--sg-mono-900);--sg-line: var(--sg-mono-500);--sg-primary: #2e62d9;--sg-primary-hover: #2ca2fd;--sg-secondary: #2ca2fd;--sg-secondary-hover: #2ca2fd;--sg-danger: #ff3b30;--sg-success: #52b52f;--sg-attention: #ffa900;--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;--sg-padding-s: 8px;--sg-padding-m: 12px;--sg-padding-l: 16px;--sg-padding-2l: 20px;--sg-text-xs: 12px;--sg-text-s: 14px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=siteguide]{box-sizing:border-box;font-family:Inter,sans-serif}.siteguide-background{position:fixed;inset:0;background:#00000080;z-index:999999;opacity:0;transition:opacity .3s ease-out}.siteguide-highlight{position:fixed;border:2px solid var(--sg-mono-900);border-radius:4px;box-shadow:0 0 #212121cc,0 0 0 5000px #21212180;z-index:9999998;opacity:0;transition:all .3s ease-out}.siteguide-host{position:relative;z-index:99999999!important}.siteguide-host-parent{opacity:1;transform:none;filter:none;isolation:auto;will-change:auto;animation-play-state:paused}.siteguide-interaction{position:fixed;border-radius:4px;z-index:99999999}.siteguide{position:fixed;width:280px;min-height:150px;max-height:400px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);box-shadow:0 10px 10px #0001;display:flex;flex-direction:column;z-index:100000000;color:var(--sg-text);font-size:var(--sg-text-m)}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-arrow{position:absolute;width:10px;height:10px;background-color:inherit;z-index:1}.siteguide-header{display:flex;align-items:center;width:100%;padding:var(--sg-padding-m) var(--sg-padding-2l) 0;position:relative}.siteguide-content{width:100%;padding:var(--sg-padding-m) var(--sg-padding-2l);overflow-y:auto}.siteguide-content::-webkit-scrollbar{width:4px}.siteguide-content::-webkit-scrollbar-thumb{background-color:var(--sg-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(--sg-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(--sg-padding-m);border-top:1px solid var(--sg-line);gap:var(--sg-padding-l);margin-top:auto}.siteguide-button{padding:var(--sg-padding-s) var(--sg-padding-l);border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;transition:background-color .3s ease-out;color:var(--sg-mono-100);border:none}.siteguide-button-secondary{background-color:var(--sg-secondary)}.siteguide-button-secondary:hover{background-color:var(--sg-secondary-hover)}.siteguide-button-primary{background-color:var(--sg-primary)}.siteguide-button-primary:hover{background-color:var(--sg-primary-hover)}.siteguide-button-link{color:var(--sg-primary);background-color:transparent;cursor:pointer;transition:color .3s ease-out}.siteguide-button-link:hover{color:var(--sg-primary-hover)}.siteguide-progress{font-size:var(--sg-text-s);color:var(--sg-mono-800)}.siteguide-close{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:4px;cursor:pointer;position:absolute;top:10px;right:10px;transition:color .3s ease-out,background-color .3s ease-out;border:none}.siteguide-close:hover{background-color:var(--sg-secondary-hover);color:#fff}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var Kt=Object.defineProperty,Xt=Object.defineProperties;var Gt=Object.getOwnPropertyDescriptors;var nt=Object.getOwnPropertySymbols;var Ct=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable;var Pt=Math.pow,ut=(e,t,i)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,A=(e,t)=>{for(var i in t||(t={}))Ct.call(t,i)&&ut(e,i,t[i]);if(nt)for(var i of nt(t))Tt.call(t,i)&&ut(e,i,t[i]);return e},Q=(e,t)=>Xt(e,Gt(t));var Et=(e,t)=>{var i={};for(var n in e)Ct.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&nt)for(var n of nt(e))t.indexOf(n)<0&&Tt.call(e,n)&&(i[n]=e[n]);return i};var x=(e,t,i)=>ut(e,typeof t!="symbol"?t+"":t,i);var k=(e,t,i)=>new Promise((n,o)=>{var s=a=>{try{c(i.next(a))}catch(l){o(l)}},r=a=>{try{c(i.throw(a))}catch(l){o(l)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,r);c((i=i.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jt=["top","right","bottom","left"],Lt=["start","end"],Ot=Jt.reduce((e,t)=>e.concat(t,t+"-"+Lt[0],t+"-"+Lt[1]),[]),Z=Math.min,U=Math.max,st=Math.round,B=e=>({x:e,y:e}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},Zt={start:"end",end:"start"};function te(e,t,i){return U(e,Z(t,i))}function ct(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function V(e){return e.split("-")[1]}function ee(e){return e==="x"?"y":"x"}function yt(e){return e==="y"?"height":"width"}function xt(e){return["top","bottom"].includes(et(e))?"y":"x"}function wt(e){return ee(xt(e))}function ie(e,t,i){i===void 0&&(i=!1);const n=V(e),o=wt(e),s=yt(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Rt(r)),[r,Rt(r)]}function ne(e){return e.replace(/start|end/g,t=>Zt[t])}function Rt(e){return e.replace(/left|right|bottom|top/g,t=>Qt[t])}function oe(e){return A({top:0,right:0,bottom:0,left:0},e)}function Nt(e){return typeof e!="number"?oe(e):{top:e,right:e,bottom:e,left:e}}function rt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function $t(e,t,i){let{reference:n,floating:o}=e;const s=xt(t),r=wt(t),c=yt(r),a=et(t),l=s==="y",h=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,g=n[c]/2-o[c]/2;let u;switch(a){case"top":u={x:h,y:n.y-o.height};break;case"bottom":u={x:h,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:f};break;case"left":u={x:n.x-o.width,y:f};break;default:u={x:n.x,y:n.y}}switch(V(t)){case"start":u[r]-=g*(i&&l?-1:1);break;case"end":u[r]+=g*(i&&l?-1:1);break}return u}const se=(e,t,i)=>k(exports,null,function*(){const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,c=s.filter(Boolean),a=yield r.isRTL==null?void 0:r.isRTL(t);let l=yield r.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=$t(l,n,a),g=n,u={},d=0;for(let p=0;p<c.length;p++){const{name:m,fn:y}=c[p],{x:_,y:v,data:S,reset:b}=yield y({x:h,y:f,initialPlacement:n,placement:g,strategy:o,middlewareData:u,rects:l,platform:r,elements:{reference:e,floating:t}});h=_!=null?_:h,f=v!=null?v:f,u=Q(A({},u),{[m]:A(A({},u[m]),S)}),b&&d<=50&&(d++,typeof b=="object"&&(b.placement&&(g=b.placement),b.rects&&(l=b.rects===!0?yield r.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:h,y:f}=$t(l,g,a)),p=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:u}});function re(e,t){return k(this,null,function*(){var i;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:r,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:u=0}=ct(t,e),d=Nt(u),m=c[g?f==="floating"?"reference":"floating":f],y=rt(yield s.getClippingRect({element:(i=yield s.isElement==null?void 0:s.isElement(m))==null||i?m:m.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:h,strategy:a})),_=f==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),S=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},b=rt(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:v,strategy:a}):_);return{top:(y.top-b.top+d.top)/S.y,bottom:(b.bottom-y.bottom+d.bottom)/S.y,left:(y.left-b.left+d.left)/S.x,right:(b.right-y.right+d.right)/S.x}})}const ce=e=>({name:"arrow",options:e,fn(i){return k(this,null,function*(){const{x:n,y:o,placement:s,rects:r,platform:c,elements:a,middlewareData:l}=i,{element:h,padding:f=0}=ct(e,i)||{};if(h==null)return{};const g=Nt(f),u={x:n,y:o},d=wt(s),p=yt(d),m=yield c.getDimensions(h),y=d==="y",_=y?"top":"left",v=y?"bottom":"right",S=y?"clientHeight":"clientWidth",b=r.reference[p]+r.reference[d]-u[d]-r.floating[p],w=u[d]-r.reference[d],P=yield c.getOffsetParent==null?void 0:c.getOffsetParent(h);let E=P?P[S]:0;(!E||!(yield c.isElement==null?void 0:c.isElement(P)))&&(E=a.floating[S]||r.floating[p]);const W=b/2-w/2,M=E/2-m[p]/2-1,I=Z(g[_],M),T=Z(g[v],M),O=I,Y=E-m[p]-T,$=E/2-m[p]/2+W,q=te(O,$,Y),J=!l.arrow&&V(s)!=null&&$!==q&&r.reference[p]/2-($<O?I:T)-m[p]/2<0,ht=J?$<O?$-O:$-Y:0;return{[d]:u[d]+ht,data:A({[d]:q,centerOffset:$-q-ht},J&&{alignmentOffset:ht}),reset:J}})}});function le(e,t,i){return(e?[...i.filter(o=>V(o)===e),...i.filter(o=>V(o)!==e)]:i.filter(o=>et(o)===o)).filter(o=>e?V(o)===e||(t?ne(o)!==o:!1):!0)}const ae=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(i){return k(this,null,function*(){var n,o,s;const{rects:r,middlewareData:c,placement:a,platform:l,elements:h}=i,I=ct(e,i),{crossAxis:f=!1,alignment:g,allowedPlacements:u=Ot,autoAlignment:d=!0}=I,p=Et(I,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||u===Ot?le(g||null,d,u):u,y=yield re(i,p),_=((n=c.autoPlacement)==null?void 0:n.index)||0,v=m[_];if(v==null)return{};const S=ie(v,r,yield l.isRTL==null?void 0:l.isRTL(h.floating));if(a!==v)return{reset:{placement:m[0]}};const b=[y[et(v)],y[S[0]],y[S[1]]],w=[...((o=c.autoPlacement)==null?void 0:o.overflows)||[],{placement:v,overflows:b}],P=m[_+1];if(P)return{data:{index:_+1,overflows:w},reset:{placement:P}};const E=w.map(T=>{const O=V(T.placement);return[T.placement,O&&f?T.overflows.slice(0,2).reduce((Y,$)=>Y+$,0):T.overflows[0],T.overflows]}).sort((T,O)=>T[1]-O[1]),M=((s=E.filter(T=>T[2].slice(0,V(T[0])?2:3).every(O=>O<=0))[0])==null?void 0:s[0])||E[0][0];return M!==a?{data:{index:_+1,overflows:w},reset:{placement:M}}:{}})}}};function fe(e,t){return k(this,null,function*(){const{placement:i,platform:n,elements:o}=e,s=yield n.isRTL==null?void 0:n.isRTL(o.floating),r=et(i),c=V(i),a=xt(i)==="y",l=["left","top"].includes(r)?-1:1,h=s&&a?-1:1,f=ct(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 c&&typeof d=="number"&&(u=c==="end"?d*-1:d),a?{x:u*h,y:g*l}:{x:g*l,y:u*h}})}const he=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(i){return k(this,null,function*(){var n,o;const{x:s,y:r,placement:c,middlewareData:a}=i,l=yield fe(i,e);return c===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:Q(A({},l),{placement:c})}})}}};function lt(){return typeof window!="undefined"}function G(e){return Bt(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function z(e){var t;return(t=(Bt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bt(e){return lt()?e instanceof Node||e instanceof R(e).Node:!1}function D(e){return lt()?e instanceof Element||e instanceof R(e).Element:!1}function F(e){return lt()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function At(e){return!lt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function it(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function ue(e){return["table","td","th"].includes(G(e))}function at(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(i){return!1}})}function vt(e){const t=bt(),i=D(e)?H(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function de(e){let t=j(e);for(;F(t)&&!X(t);){if(vt(t))return t;if(at(t))return null;t=j(t)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function X(e){return["html","body","#document"].includes(G(e))}function H(e){return R(e).getComputedStyle(e)}function ft(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(G(e)==="html")return e;const t=e.assignedSlot||e.parentNode||At(e)&&e.host||z(e);return At(t)?t.host:t}function Ft(e){const t=j(e);return X(t)?e.ownerDocument?e.ownerDocument.body:e.body:F(t)&&it(t)?t:Ft(t)}function pt(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=Ft(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=R(o);if(s){const c=mt(r);return t.concat(r,r.visualViewport||[],it(o)?o:[],c&&i?pt(c):[])}return t.concat(o,pt(o,[],i))}function mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=H(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=F(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,c=st(i)!==s||st(n)!==r;return c&&(i=s,n=r),{width:i,height:n,$:c}}function Vt(e){return D(e)?e:e.contextElement}function K(e){const t=Vt(e);if(!F(t))return B(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=Mt(t);let r=(s?st(i.width):i.width)/n,c=(s?st(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const ge=B(0);function zt(e){const t=R(e);return!bt()||!t.visualViewport?ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pe(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==R(e)?!1:t}function tt(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=Vt(e);let r=B(1);t&&(n?D(n)&&(r=K(n)):r=K(e));const c=pe(s,i,n)?zt(s):B(0);let a=(o.left+c.x)/r.x,l=(o.top+c.y)/r.y,h=o.width/r.x,f=o.height/r.y;if(s){const g=R(s),u=n&&D(n)?R(n):n;let d=g,p=mt(d);for(;p&&n&&u!==d;){const m=K(p),y=p.getBoundingClientRect(),_=H(p),v=y.left+(p.clientLeft+parseFloat(_.paddingLeft))*m.x,S=y.top+(p.clientTop+parseFloat(_.paddingTop))*m.y;a*=m.x,l*=m.y,h*=m.x,f*=m.y,a+=v,l+=S,d=R(p),p=mt(d)}}return rt({width:h,height:f,x:a,y:l})}function _t(e,t){const i=ft(e).scrollLeft;return t?t.left+i:tt(z(e)).left+i}function Wt(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(i?0:_t(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function me(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=z(n),c=t?at(t.floating):!1;if(n===r||c&&s)return i;let a={scrollLeft:0,scrollTop:0},l=B(1);const h=B(0),f=F(n);if((f||!f&&!s)&&((G(n)!=="body"||it(r))&&(a=ft(n)),F(n))){const u=tt(n);l=K(n),h.x=u.x+n.clientLeft,h.y=u.y+n.clientTop}const g=r&&!f&&!s?Wt(r,a,!0):B(0);return{width:i.width*l.x,height:i.height*l.y,x:i.x*l.x-a.scrollLeft*l.x+h.x+g.x,y:i.y*l.y-a.scrollTop*l.y+h.y+g.y}}function ye(e){return Array.from(e.getClientRects())}function xe(e){const t=z(e),i=ft(e),n=e.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=U(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+_t(e);const c=-i.scrollTop;return H(n).direction==="rtl"&&(r+=U(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:c}}function we(e,t){const i=R(e),n=z(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,c=0,a=0;if(o){s=o.width,r=o.height;const l=bt();(!l||l&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:c,y:a}}function ve(e,t){const i=tt(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=F(e)?K(e):B(1),r=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=n*s.y;return{width:r,height:c,x:a,y:l}}function kt(e,t,i){let n;if(t==="viewport")n=we(e,i);else if(t==="document")n=xe(z(e));else if(D(t))n=ve(t,i);else{const o=zt(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return rt(n)}function It(e,t){const i=j(e);return i===t||!D(i)||X(i)?!1:H(i).position==="fixed"||It(i,t)}function be(e,t){const i=t.get(e);if(i)return i;let n=pt(e,[],!1).filter(c=>D(c)&&G(c)!=="body"),o=null;const s=H(e).position==="fixed";let r=s?j(e):e;for(;D(r)&&!X(r);){const c=H(r),a=vt(r);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||it(r)&&!a&&It(e,r))?n=n.filter(h=>h!==r):o=c,r=j(r)}return t.set(e,n),n}function _e(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const r=[...i==="clippingAncestors"?at(t)?[]:be(t,this._c):[].concat(i),n],c=r[0],a=r.reduce((l,h)=>{const f=kt(t,h,o);return l.top=U(f.top,l.top),l.right=Z(f.right,l.right),l.bottom=Z(f.bottom,l.bottom),l.left=U(f.left,l.left),l},kt(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Se(e){const{width:t,height:i}=Mt(e);return{width:t,height:i}}function Ce(e,t,i){const n=F(t),o=z(t),s=i==="fixed",r=tt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=B(0);if(n||!n&&!s)if((G(t)!=="body"||it(o))&&(c=ft(t)),n){const g=tt(t,!0,s,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=_t(o));const l=o&&!n&&!s?Wt(o,c):B(0),h=r.left+c.scrollLeft-a.x-l.x,f=r.top+c.scrollTop-a.y-l.y;return{x:h,y:f,width:r.width,height:r.height}}function dt(e){return H(e).position==="static"}function Dt(e,t){if(!F(e)||H(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return z(e)===i&&(i=i.ownerDocument.body),i}function jt(e,t){const i=R(e);if(at(e))return i;if(!F(e)){let o=j(e);for(;o&&!X(o);){if(D(o)&&!dt(o))return o;o=j(o)}return i}let n=Dt(e,t);for(;n&&ue(n)&&dt(n);)n=Dt(n,t);return n&&X(n)&&dt(n)&&!vt(n)?i:n||de(e)||i}const Te=function(e){return k(this,null,function*(){const t=this.getOffsetParent||jt,i=this.getDimensions,n=yield i(e.floating);return{reference:Ce(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function Pe(e){return H(e).direction==="rtl"}const Ee={convertOffsetParentRelativeRectToViewportRelativeRect:me,getDocumentElement:z,getClippingRect:_e,getOffsetParent:jt,getElementRects:Te,getClientRects:ye,getDimensions:Se,getScale:K,isElement:D,isRTL:Pe},Le=he,Oe=ae,Re=ce,$e=(e,t,i)=>{const n=new Map,o=A({platform:Ee},i),s=Q(A({},o.platform),{_c:n});return se(e,t,Q(A({},o),{platform:s}))};function N(e){return e===null||typeof e=="undefined"}function C(e){return!N(e)}function Ht(e){return new Promise(t=>setTimeout(t,e))}function Yt(e){var n;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((n=document.defaultView)==null?void 0:n.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:Yt(t)}function St(e){return Yt(e)?"fixed":"absolute"}class Ae{renderContent(t,i,n){t.querySelector(`.${n.classPrefix}-content`).appendChild(i.node)}}function L(e,t){const i=document.createElement(e);return t&&t.length>0&&(t=t.filter(n=>n),i.classList.add(...t)),i}class ke{renderContent(t,i,n){var s,r,c,a;const o=t.querySelector(`.${n.classPrefix}-content`);if(i.imgSrc){const l=L("img",[`${n.classPrefix}-image`,`${(r=(s=i.customization)==null?void 0:s.imageClass)!=null?r:""}`]);l.src=i.imgSrc,o.appendChild(l)}if(i.text){const l=L("p",[`${n.classPrefix}-description`,`${(a=(c=i.customization)==null?void 0:c.descriptionClass)!=null?a:""}`]);l.innerHTML=n.translateFn(i.text),o.appendChild(l)}}}function De(e,t,i){var c,a,l,h,f,g,u,d,p,m,y,_,v,S,b;if(e.innerHTML="",e.className=`${(c=i.config.class)!=null?c:""} ${i.config.classPrefix} ${i.config.animationClass}`,!i.config.arrow.disable&&((a=i.activeStep)!=null&&a.hasHost)){const w=L("div",[(l=i.config.arrow.class)!=null?l:"",`${i.config.classPrefix}-arrow`]);e.appendChild(w)}(h=t.customization)!=null&&h.class&&e.classList.add(t.customization.class);const n=L("div",[`${i.config.classPrefix}-header`,`${(g=(f=t.customization)==null?void 0:f.headerClass)!=null?g:""}`]);e.appendChild(n);const o=L("h1",[`${i.config.classPrefix}-title`,`${(d=(u=t.customization)==null?void 0:u.titleClass)!=null?d:""}`]);o.innerHTML=i.config.translateFn((p=t.title)!=null?p:""),n.appendChild(o),i.config.close.button&&(i.config.closeIcon.onclick=i.complete.bind(i),n.appendChild(i.config.closeIcon));const s=L("div",[`${i.config.classPrefix}-content`,`${(y=(m=t.customization)==null?void 0:m.contentClass)!=null?y:""}`]);e.appendChild(s);const r=L("div",[`${i.config.classPrefix}-footer`,`${(v=(_=t.customization)==null?void 0:_.footerClass)!=null?v:""}`]);if(N(t.buttonList)&&(t.buttonList=He(i)),t.buttonList.forEach(w=>{var W;const P=[`${i.config.classPrefix}-button`,(W=w.class)!=null?W:""];N(w.type)||w.type==="secondary"?P.push(`${i.config.classPrefix}-button-secondary`):w.type==="primary"?P.push(`${i.config.classPrefix}-button-primary`):w.type==="link"&&P.push(`${i.config.classPrefix}-button-link`),!N(w.class)&&w.class!==""&&P.push(w.class);const E=L("button",P);E.innerHTML=i.config.translateFn(w.text),E.onclick=M=>{w.action.call(i)},r.appendChild(E)}),!i.config.progress.disable&&i.config.progress.text&&C(i.activeStepIndex)){const w=L("p",[`${i.config.classPrefix}-progress`,`${(b=(S=t.customization)==null?void 0:S.progressClass)!=null?b:""}`]);w.innerHTML=i.config.translateFn(Ne(i.config.progress.text,i.activeStepIndex+1,i.stepList.length)),r.appendChild(w)}e.appendChild(r)}function He(e){return[{text:e.config.buttons.prevText,action:e.prev},{text:e.config.buttons.nextText,type:"primary",action:e.next}]}function Ne(e,t,i){return e.replace("{{currentStep}}",t.toString()).replace("{{totalSteps}}",i.toString())}class Be{constructor(){x(this,"_renderContentStrategy",new Map);x(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(t,i){return new Promise(n=>{var o,s;if(!this._renderContentStrategy.has(i.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(i.tour.config.animationClass),i.hostElement?t.style.position=St(i.hostElement):t.style.position="fixed",De(t,i.popupData,i.tour),(o=this._renderContentStrategy.get(i.popupData.type))==null||o.renderContent(t,i.popupData,i.tour.config),(s=i.hostElement)==null||s.scrollIntoView(i.tour.config.scrollTo),n()}).then(()=>i.isFirst&&i.direction==="toNext"?Ht(0):Ht(400)).then(()=>{t.style.display="flex",this.updatePosition(t,i),t.classList.add(i.tour.config.animationClass)})}updatePosition(t,i){C(i.hostElement)?this.renderFloatingPopup(t,i):this.renderCenterPopup(t)}renderFloatingPopup(t,i){var l;const n=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=t.querySelector(`.${i.tour.config.classPrefix}-arrow`),s=[],r=C(i.popupData.position)&&i.popupData.position!=="auto"?i.popupData.position:void 0,c=(l=o==null?void 0:o.offsetWidth)!=null?l:10,a=Math.sqrt(2*Pt(c,2))/2+i.tour.config.highlight.padding;s.push(Le(a)),(i.popupData.position==="auto"||N(r))&&s.push(Oe()),!i.tour.config.arrow.disable&&C(o)&&s.push(Re({element:o})),$e(i.hostElement,t,{placement:r,middleware:[...s]}).then(({x:h,y:f,middlewareData:g,placement:u})=>{Object.assign(t.style,{top:`${f-n}px`,left:`${h}px`,marginTop:"0",marginLeft:"0"});const d=u.split("-")[0],p=this._staticSides[d];if(g.arrow&&C(o)){const{x:m,y}=g.arrow;Object.assign(o.style,{left:m!=null?`${m}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",[p]:`${-c/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 ke),this._renderContentStrategy.set("custom",new Ae)}}class Fe{render(t,i){return new Promise(n=>{i.hostElement&&(t.style.position=St(i.hostElement)),n()}).then(()=>{this.updatePosition(t,i)})}updatePosition(t,i){var r,c;if(!i.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 n=i.hostElement.getBoundingClientRect(),o=(c=(r=i.tour.config.highlight)==null?void 0:r.padding)!=null?c:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${n.left-o}px`,t.style.top=`${n.top+s-o}px`,t.style.width=`${n.width+2*o}px`,t.style.height=`${n.height+2*o}px`,t.style.opacity="1"}}class Me{render(t,i){return new Promise(n=>{i.hostElement&&(t.style.position=St(i.hostElement)),n()}).then(()=>{this.updatePosition(t,i)})}updatePosition(t,i){var r,c;if(!i.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)";return}const n=i.hostElement.getBoundingClientRect(),o=(c=(r=i.tour.config.highlight)==null?void 0:r.padding)!=null?c:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${n.left-o}px`,t.style.top=`${n.top+s-o}px`,t.style.width=`${n.width+2*o}px`,t.style.height=`${n.height+2*o}px`}}class qt{constructor(t,i){x(this,"popupData");x(this,"tour");x(this,"_index");x(this,"_hostElement",null);x(this,"_direction","toNext");x(this,"_hostData");x(this,"_resizeObserver",null);var n;this.popupData=i.popup,this.tour=t,this._index=(n=i.index)!=null?n:null,this._hostData=i.host}get isFirst(){return this.tour.stepList.indexOf(this)===0}get direction(){return this._direction}get hasHost(){return C(this._hostElement)}get hostElement(){return this._hostElement}get index(){return this._index}set index(t){this._index=t}show(t){return k(this,null,function*(){var n;if(N(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(n=this._hostData)!=null?n:null)),this._resizeObserver=this.listenHostResize();const i=[this.tour.popupRenderer.render(this.tour.popup,this)];this.tour.config.interaction.disable&&C(this.tour.interaction)?i.push(this.tour.interactionRenderer.render(this.tour.interaction,this)):!this.tour.config.interaction.disable&&C(this.tour.interaction)&&i.push(this.tour.interactionRenderer.render(this.tour.interaction,{})),!this.tour.config.highlight.disable&&!N(this.tour.highlight)&&i.push(this.tour.highlightRenderer.render(this.tour.highlight,this)),this.tour.config.highlight.disable&&C(this.tour.highlight)&&this.tour.highlightRenderer.render(this.tour.highlight,{}),yield Promise.all(i),this.toggleHostClass(!0)})}hide(){return k(this,null,function*(){var t;(t=this._resizeObserver)==null||t.disconnect(),this.toggleHostClass(!1)})}toggleHostClass(t){N(this._hostElement)||(t?this._hostElement.classList.add("siteguide-host"):this._hostElement.classList.remove("siteguide-host"))}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}listenHostResize(){const t=new ResizeObserver(()=>{N(this.tour.activeStep)||(C(this.tour.popup)&&this.tour.popupRenderer.updatePosition(this.tour.popup,this.tour.activeStep),C(this.tour.highlight)&&!this.tour.config.highlight.disable&&this.tour.highlightRenderer.updatePosition(this.tour.highlight,this.tour.activeStep),C(this.tour.interaction)&&this.tour.config.interaction.disable&&this.tour.interactionRenderer.updatePosition(this.tour.interaction,this.tour.activeStep))});return C(this._hostElement)&&t.observe(this._hostElement),t}}function gt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Ut(e,t){const i=A({},e);return gt(e)&&gt(t)&&Object.keys(t).forEach(n=>{const o=n,s=n;gt(t[o])?(s in e||Object.assign(i,{[s]:{}}),i[s]=Ut(e[s],t[o])):Object.assign(i,{[s]:t[o]})}),i}function Ve(e){const t=L("button",[`${e}-close`]);return t.innerHTML="✖",t}class ze{constructor(){x(this,"_activeTour",null)}get isActive(){return C(this.activeTour)}get activeTour(){return this._activeTour}setActiveTour(t){this._activeTour=t}}const ot=new ze;class We{constructor(t){x(this,"popupRenderer",new Be);x(this,"highlightRenderer",new Fe);x(this,"interactionRenderer",new Me);x(this,"_popup",null);x(this,"_highlight",null);x(this,"_interaction",null);x(this,"_background",null);x(this,"_stepList",[]);x(this,"_activeStep",null);x(this,"_bodyResizeObserver",null);x(this,"_config");x(this,"closeOnEsc",t=>{t.key==="Escape"&&this.complete()});x(this,"closeOnClick",()=>{this.complete()});x(this,"keyboardControl",t=>{t.key==="ArrowRight"?this.next():t.key==="ArrowLeft"&&this.prev()});var i,n,o,s,r,c,a,l,h,f,g,u,d,p,m,y,_,v,S,b,w,P,E,W,M,I,T,O,Y,$,q;this._config={classPrefix:(i=t.classPrefix)!=null?i:"siteguide",class:"",buttons:{nextText:(o=(n=t.buttons)==null?void 0:n.nextText)!=null?o:"Next",prevText:(r=(s=t.buttons)==null?void 0:s.prevText)!=null?r:"Back"},animationClass:(c=t.animationClass)!=null?c:"siteguide-animation",close:{button:(l=(a=t.close)==null?void 0:a.button)!=null?l:!0,clickout:(f=(h=t.close)==null?void 0:h.clickout)!=null?f:!1,esc:(u=(g=t.close)==null?void 0:g.esc)!=null?u:!0},scrollTo:(d=t.scrollTo)!=null?d:{behavior:"smooth",block:"center",inline:"center"},closeIcon:(m=t.closeIcon)!=null?m:Ve((p=t.classPrefix)!=null?p:"siteguide"),arrow:{disable:(_=(y=t.arrow)==null?void 0:y.disable)!=null?_:!1,class:(S=(v=t.arrow)==null?void 0:v.class)!=null?S:""},highlight:{disable:(w=(b=t.highlight)==null?void 0:b.disable)!=null?w:!1,padding:(E=(P=t.highlight)==null?void 0:P.padding)!=null?E:8,class:(M=(W=t.highlight)==null?void 0:W.class)!=null?M:""},progress:{disable:(T=(I=t.progress)==null?void 0:I.disable)!=null?T:!0,text:"Step {{currentStep}} of {{totalSteps}}"},interaction:{disable:(Y=(O=t.interaction)==null?void 0:O.disable)!=null?Y:!0},keyboardControl:($=t.keyboardControl)!=null?$:!1,translateFn:(q=t.translateFn)!=null?q:J=>J}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}get interaction(){return this._interaction}get activeStep(){return this._activeStep}get activeStepIndex(){return this._activeStep?this.stepList.indexOf(this._activeStep):null}addStep(t){if(N(t.index)){const n=this._stepList.reduce((o,s)=>s.index!==null&&s.index!==void 0&&s.index>o?s.index:o,-1);t.index=n+1}const i=new qt(this,t);this._stepList.push(i),this._stepList.sort((n,o)=>n.index-o.index)}addSteps(t){t.forEach(i=>this.addStep(i))}removeStep(t){this._stepList=this._stepList.filter(i=>t!==i.index)}start(){ot.isActive||(ot.setActiveTour(this),this._bodyResizeObserver=this.getBodyResizeObserver(),this.config.close.esc&&document.addEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.addEventListener("keydown",this.keyboardControl),this._background=L("div",["siteguide-background"]),document.body.appendChild(this._background),this.config.close.clickout&&this._background.addEventListener("click",this.closeOnClick),this._config.highlight.disable||(this._highlight=L("div",[this._config.highlight.class,`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this._config.interaction.disable&&(this._interaction=L("div",["siteguide-interaction"]),document.body.appendChild(this._interaction)),this._popup=L("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this.next())}complete(){var t,i;this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._interaction&&document.body.removeChild(this._interaction),this._background&&document.body.removeChild(this._background),(t=this._bodyResizeObserver)==null||t.disconnect(),(i=this._activeStep)==null||i.hide(),this._activeStep=null,ot.setActiveTour(null),this.config.close.esc&&document.removeEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.removeEventListener("keydown",this.keyboardControl)}prev(){const t=C(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this.changeStepTo(t,"fromBack")}next(){return k(this,null,function*(){var i,n,o;const t=C(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}C((i=this._activeStep)==null?void 0:i.popupData.allowNext)&&!((o=yield(n=this._activeStep)==null?void 0:n.popupData.allowNext.call(this))==null||o)||this.changeStepTo(t,"toNext")})}goTo(t){var i;if(t>this._stepList.length-1){console.error("Provided index was larger than steps amount");return}this.changeStepTo(t,t>((i=this.activeStepIndex)!=null?i:-1)?"toNext":"fromBack")}setConfig(t){this._config=Ut(this._config,t)}changeStepTo(t,i){var n;(n=this._activeStep)==null||n.hide(),this._activeStep=this._stepList[t],this._activeStep.show(i)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(C(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),C(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep),C(this._interaction)&&this.config.interaction.disable&&this.interactionRenderer.updatePosition(this._interaction,this._activeStep))});return t.observe(document.body),t}}const Ie=ot;exports.Siteguide=Ie;exports.Tour=We;exports.TourStep=qt;exports.createElement=L;
1
+ "use strict";var Kt=Object.defineProperty,Xt=Object.defineProperties;var Gt=Object.getOwnPropertyDescriptors;var nt=Object.getOwnPropertySymbols;var Ct=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable;var Et=Math.pow,ut=(e,t,i)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,A=(e,t)=>{for(var i in t||(t={}))Ct.call(t,i)&&ut(e,i,t[i]);if(nt)for(var i of nt(t))Tt.call(t,i)&&ut(e,i,t[i]);return e},Q=(e,t)=>Xt(e,Gt(t));var Pt=(e,t)=>{var i={};for(var n in e)Ct.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&nt)for(var n of nt(e))t.indexOf(n)<0&&Tt.call(e,n)&&(i[n]=e[n]);return i};var x=(e,t,i)=>ut(e,typeof t!="symbol"?t+"":t,i);var k=(e,t,i)=>new Promise((n,o)=>{var s=a=>{try{c(i.next(a))}catch(l){o(l)}},r=a=>{try{c(i.throw(a))}catch(l){o(l)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,r);c((i=i.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jt=["top","right","bottom","left"],Lt=["start","end"],Ot=Jt.reduce((e,t)=>e.concat(t,t+"-"+Lt[0],t+"-"+Lt[1]),[]),Z=Math.min,U=Math.max,st=Math.round,B=e=>({x:e,y:e}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},Zt={start:"end",end:"start"};function te(e,t,i){return U(e,Z(t,i))}function ct(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function V(e){return e.split("-")[1]}function ee(e){return e==="x"?"y":"x"}function yt(e){return e==="y"?"height":"width"}function xt(e){return["top","bottom"].includes(et(e))?"y":"x"}function wt(e){return ee(xt(e))}function ie(e,t,i){i===void 0&&(i=!1);const n=V(e),o=wt(e),s=yt(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Rt(r)),[r,Rt(r)]}function ne(e){return e.replace(/start|end/g,t=>Zt[t])}function Rt(e){return e.replace(/left|right|bottom|top/g,t=>Qt[t])}function oe(e){return A({top:0,right:0,bottom:0,left:0},e)}function Nt(e){return typeof e!="number"?oe(e):{top:e,right:e,bottom:e,left:e}}function rt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function $t(e,t,i){let{reference:n,floating:o}=e;const s=xt(t),r=wt(t),c=yt(r),a=et(t),l=s==="y",h=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,g=n[c]/2-o[c]/2;let u;switch(a){case"top":u={x:h,y:n.y-o.height};break;case"bottom":u={x:h,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:f};break;case"left":u={x:n.x-o.width,y:f};break;default:u={x:n.x,y:n.y}}switch(V(t)){case"start":u[r]-=g*(i&&l?-1:1);break;case"end":u[r]+=g*(i&&l?-1:1);break}return u}const se=(e,t,i)=>k(exports,null,function*(){const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,c=s.filter(Boolean),a=yield r.isRTL==null?void 0:r.isRTL(t);let l=yield r.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=$t(l,n,a),g=n,u={},d=0;for(let p=0;p<c.length;p++){const{name:m,fn:y}=c[p],{x:_,y:v,data:S,reset:b}=yield y({x:h,y:f,initialPlacement:n,placement:g,strategy:o,middlewareData:u,rects:l,platform:r,elements:{reference:e,floating:t}});h=_!=null?_:h,f=v!=null?v:f,u=Q(A({},u),{[m]:A(A({},u[m]),S)}),b&&d<=50&&(d++,typeof b=="object"&&(b.placement&&(g=b.placement),b.rects&&(l=b.rects===!0?yield r.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:h,y:f}=$t(l,g,a)),p=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:u}});function re(e,t){return k(this,null,function*(){var i;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:r,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:u=0}=ct(t,e),d=Nt(u),m=c[g?f==="floating"?"reference":"floating":f],y=rt(yield s.getClippingRect({element:(i=yield s.isElement==null?void 0:s.isElement(m))==null||i?m:m.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:h,strategy:a})),_=f==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),S=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},b=rt(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:v,strategy:a}):_);return{top:(y.top-b.top+d.top)/S.y,bottom:(b.bottom-y.bottom+d.bottom)/S.y,left:(y.left-b.left+d.left)/S.x,right:(b.right-y.right+d.right)/S.x}})}const ce=e=>({name:"arrow",options:e,fn(i){return k(this,null,function*(){const{x:n,y:o,placement:s,rects:r,platform:c,elements:a,middlewareData:l}=i,{element:h,padding:f=0}=ct(e,i)||{};if(h==null)return{};const g=Nt(f),u={x:n,y:o},d=wt(s),p=yt(d),m=yield c.getDimensions(h),y=d==="y",_=y?"top":"left",v=y?"bottom":"right",S=y?"clientHeight":"clientWidth",b=r.reference[p]+r.reference[d]-u[d]-r.floating[p],w=u[d]-r.reference[d],E=yield c.getOffsetParent==null?void 0:c.getOffsetParent(h);let P=E?E[S]:0;(!P||!(yield c.isElement==null?void 0:c.isElement(E)))&&(P=a.floating[S]||r.floating[p]);const W=b/2-w/2,M=P/2-m[p]/2-1,I=Z(g[_],M),T=Z(g[v],M),O=I,Y=P-m[p]-T,$=P/2-m[p]/2+W,q=te(O,$,Y),J=!l.arrow&&V(s)!=null&&$!==q&&r.reference[p]/2-($<O?I:T)-m[p]/2<0,ht=J?$<O?$-O:$-Y:0;return{[d]:u[d]+ht,data:A({[d]:q,centerOffset:$-q-ht},J&&{alignmentOffset:ht}),reset:J}})}});function le(e,t,i){return(e?[...i.filter(o=>V(o)===e),...i.filter(o=>V(o)!==e)]:i.filter(o=>et(o)===o)).filter(o=>e?V(o)===e||(t?ne(o)!==o:!1):!0)}const ae=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(i){return k(this,null,function*(){var n,o,s;const{rects:r,middlewareData:c,placement:a,platform:l,elements:h}=i,I=ct(e,i),{crossAxis:f=!1,alignment:g,allowedPlacements:u=Ot,autoAlignment:d=!0}=I,p=Pt(I,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||u===Ot?le(g||null,d,u):u,y=yield re(i,p),_=((n=c.autoPlacement)==null?void 0:n.index)||0,v=m[_];if(v==null)return{};const S=ie(v,r,yield l.isRTL==null?void 0:l.isRTL(h.floating));if(a!==v)return{reset:{placement:m[0]}};const b=[y[et(v)],y[S[0]],y[S[1]]],w=[...((o=c.autoPlacement)==null?void 0:o.overflows)||[],{placement:v,overflows:b}],E=m[_+1];if(E)return{data:{index:_+1,overflows:w},reset:{placement:E}};const P=w.map(T=>{const O=V(T.placement);return[T.placement,O&&f?T.overflows.slice(0,2).reduce((Y,$)=>Y+$,0):T.overflows[0],T.overflows]}).sort((T,O)=>T[1]-O[1]),M=((s=P.filter(T=>T[2].slice(0,V(T[0])?2:3).every(O=>O<=0))[0])==null?void 0:s[0])||P[0][0];return M!==a?{data:{index:_+1,overflows:w},reset:{placement:M}}:{}})}}};function fe(e,t){return k(this,null,function*(){const{placement:i,platform:n,elements:o}=e,s=yield n.isRTL==null?void 0:n.isRTL(o.floating),r=et(i),c=V(i),a=xt(i)==="y",l=["left","top"].includes(r)?-1:1,h=s&&a?-1:1,f=ct(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 c&&typeof d=="number"&&(u=c==="end"?d*-1:d),a?{x:u*h,y:g*l}:{x:g*l,y:u*h}})}const he=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(i){return k(this,null,function*(){var n,o;const{x:s,y:r,placement:c,middlewareData:a}=i,l=yield fe(i,e);return c===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:Q(A({},l),{placement:c})}})}}};function lt(){return typeof window!="undefined"}function G(e){return Bt(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function z(e){var t;return(t=(Bt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bt(e){return lt()?e instanceof Node||e instanceof R(e).Node:!1}function D(e){return lt()?e instanceof Element||e instanceof R(e).Element:!1}function F(e){return lt()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function At(e){return!lt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function it(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function ue(e){return["table","td","th"].includes(G(e))}function at(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(i){return!1}})}function vt(e){const t=bt(),i=D(e)?H(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function de(e){let t=j(e);for(;F(t)&&!X(t);){if(vt(t))return t;if(at(t))return null;t=j(t)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function X(e){return["html","body","#document"].includes(G(e))}function H(e){return R(e).getComputedStyle(e)}function ft(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(G(e)==="html")return e;const t=e.assignedSlot||e.parentNode||At(e)&&e.host||z(e);return At(t)?t.host:t}function Ft(e){const t=j(e);return X(t)?e.ownerDocument?e.ownerDocument.body:e.body:F(t)&&it(t)?t:Ft(t)}function pt(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=Ft(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=R(o);if(s){const c=mt(r);return t.concat(r,r.visualViewport||[],it(o)?o:[],c&&i?pt(c):[])}return t.concat(o,pt(o,[],i))}function mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=H(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=F(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,c=st(i)!==s||st(n)!==r;return c&&(i=s,n=r),{width:i,height:n,$:c}}function Vt(e){return D(e)?e:e.contextElement}function K(e){const t=Vt(e);if(!F(t))return B(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=Mt(t);let r=(s?st(i.width):i.width)/n,c=(s?st(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const ge=B(0);function zt(e){const t=R(e);return!bt()||!t.visualViewport?ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pe(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==R(e)?!1:t}function tt(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=Vt(e);let r=B(1);t&&(n?D(n)&&(r=K(n)):r=K(e));const c=pe(s,i,n)?zt(s):B(0);let a=(o.left+c.x)/r.x,l=(o.top+c.y)/r.y,h=o.width/r.x,f=o.height/r.y;if(s){const g=R(s),u=n&&D(n)?R(n):n;let d=g,p=mt(d);for(;p&&n&&u!==d;){const m=K(p),y=p.getBoundingClientRect(),_=H(p),v=y.left+(p.clientLeft+parseFloat(_.paddingLeft))*m.x,S=y.top+(p.clientTop+parseFloat(_.paddingTop))*m.y;a*=m.x,l*=m.y,h*=m.x,f*=m.y,a+=v,l+=S,d=R(p),p=mt(d)}}return rt({width:h,height:f,x:a,y:l})}function _t(e,t){const i=ft(e).scrollLeft;return t?t.left+i:tt(z(e)).left+i}function Wt(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(i?0:_t(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function me(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=z(n),c=t?at(t.floating):!1;if(n===r||c&&s)return i;let a={scrollLeft:0,scrollTop:0},l=B(1);const h=B(0),f=F(n);if((f||!f&&!s)&&((G(n)!=="body"||it(r))&&(a=ft(n)),F(n))){const u=tt(n);l=K(n),h.x=u.x+n.clientLeft,h.y=u.y+n.clientTop}const g=r&&!f&&!s?Wt(r,a,!0):B(0);return{width:i.width*l.x,height:i.height*l.y,x:i.x*l.x-a.scrollLeft*l.x+h.x+g.x,y:i.y*l.y-a.scrollTop*l.y+h.y+g.y}}function ye(e){return Array.from(e.getClientRects())}function xe(e){const t=z(e),i=ft(e),n=e.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=U(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+_t(e);const c=-i.scrollTop;return H(n).direction==="rtl"&&(r+=U(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:c}}function we(e,t){const i=R(e),n=z(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,c=0,a=0;if(o){s=o.width,r=o.height;const l=bt();(!l||l&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:c,y:a}}function ve(e,t){const i=tt(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=F(e)?K(e):B(1),r=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=n*s.y;return{width:r,height:c,x:a,y:l}}function kt(e,t,i){let n;if(t==="viewport")n=we(e,i);else if(t==="document")n=xe(z(e));else if(D(t))n=ve(t,i);else{const o=zt(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return rt(n)}function It(e,t){const i=j(e);return i===t||!D(i)||X(i)?!1:H(i).position==="fixed"||It(i,t)}function be(e,t){const i=t.get(e);if(i)return i;let n=pt(e,[],!1).filter(c=>D(c)&&G(c)!=="body"),o=null;const s=H(e).position==="fixed";let r=s?j(e):e;for(;D(r)&&!X(r);){const c=H(r),a=vt(r);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||it(r)&&!a&&It(e,r))?n=n.filter(h=>h!==r):o=c,r=j(r)}return t.set(e,n),n}function _e(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const r=[...i==="clippingAncestors"?at(t)?[]:be(t,this._c):[].concat(i),n],c=r[0],a=r.reduce((l,h)=>{const f=kt(t,h,o);return l.top=U(f.top,l.top),l.right=Z(f.right,l.right),l.bottom=Z(f.bottom,l.bottom),l.left=U(f.left,l.left),l},kt(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Se(e){const{width:t,height:i}=Mt(e);return{width:t,height:i}}function Ce(e,t,i){const n=F(t),o=z(t),s=i==="fixed",r=tt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=B(0);if(n||!n&&!s)if((G(t)!=="body"||it(o))&&(c=ft(t)),n){const g=tt(t,!0,s,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=_t(o));const l=o&&!n&&!s?Wt(o,c):B(0),h=r.left+c.scrollLeft-a.x-l.x,f=r.top+c.scrollTop-a.y-l.y;return{x:h,y:f,width:r.width,height:r.height}}function dt(e){return H(e).position==="static"}function Dt(e,t){if(!F(e)||H(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return z(e)===i&&(i=i.ownerDocument.body),i}function jt(e,t){const i=R(e);if(at(e))return i;if(!F(e)){let o=j(e);for(;o&&!X(o);){if(D(o)&&!dt(o))return o;o=j(o)}return i}let n=Dt(e,t);for(;n&&ue(n)&&dt(n);)n=Dt(n,t);return n&&X(n)&&dt(n)&&!vt(n)?i:n||de(e)||i}const Te=function(e){return k(this,null,function*(){const t=this.getOffsetParent||jt,i=this.getDimensions,n=yield i(e.floating);return{reference:Ce(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function Ee(e){return H(e).direction==="rtl"}const Pe={convertOffsetParentRelativeRectToViewportRelativeRect:me,getDocumentElement:z,getClippingRect:_e,getOffsetParent:jt,getElementRects:Te,getClientRects:ye,getDimensions:Se,getScale:K,isElement:D,isRTL:Ee},Le=he,Oe=ae,Re=ce,$e=(e,t,i)=>{const n=new Map,o=A({platform:Pe},i),s=Q(A({},o.platform),{_c:n});return se(e,t,Q(A({},o),{platform:s}))};function N(e){return e===null||typeof e=="undefined"}function C(e){return!N(e)}function Ht(e){return new Promise(t=>setTimeout(t,e))}function Yt(e){var n;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((n=document.defaultView)==null?void 0:n.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:Yt(t)}function St(e){return Yt(e)?"fixed":"absolute"}class Ae{renderContent(t,i,n){t.querySelector(`.${n.classPrefix}-content`).appendChild(i.node)}}function L(e,t){const i=document.createElement(e);return t&&t.length>0&&(t=t.filter(n=>n),i.classList.add(...t)),i}class ke{renderContent(t,i,n){var s,r,c,a;const o=t.querySelector(`.${n.classPrefix}-content`);if(i.imgSrc){const l=L("img",[`${n.classPrefix}-image`,`${(r=(s=i.customization)==null?void 0:s.imageClass)!=null?r:""}`]);l.src=i.imgSrc,o.appendChild(l)}if(i.text){const l=L("p",[`${n.classPrefix}-description`,`${(a=(c=i.customization)==null?void 0:c.descriptionClass)!=null?a:""}`]);l.innerHTML=n.translateFn(i.text),o.appendChild(l)}}}function De(e,t,i){var c,a,l,h,f,g,u,d,p,m,y,_,v,S,b;if(e.innerHTML="",e.className=`${(c=i.config.class)!=null?c:""} ${i.config.classPrefix} ${i.config.animationClass}`,!i.config.arrow.disable&&((a=i.activeStep)!=null&&a.hasHost)){const w=L("div",[(l=i.config.arrow.class)!=null?l:"",`${i.config.classPrefix}-arrow`]);e.appendChild(w)}(h=t.customization)!=null&&h.class&&e.classList.add(t.customization.class);const n=L("div",[`${i.config.classPrefix}-header`,`${(g=(f=t.customization)==null?void 0:f.headerClass)!=null?g:""}`]);e.appendChild(n);const o=L("h1",[`${i.config.classPrefix}-title`,`${(d=(u=t.customization)==null?void 0:u.titleClass)!=null?d:""}`]);o.innerHTML=i.config.translateFn((p=t.title)!=null?p:""),n.appendChild(o),i.config.close.button&&(i.config.closeIcon.onclick=i.complete.bind(i),n.appendChild(i.config.closeIcon));const s=L("div",[`${i.config.classPrefix}-content`,`${(y=(m=t.customization)==null?void 0:m.contentClass)!=null?y:""}`]);e.appendChild(s);const r=L("div",[`${i.config.classPrefix}-footer`,`${(v=(_=t.customization)==null?void 0:_.footerClass)!=null?v:""}`]);if(N(t.buttonList)&&(t.buttonList=He(i)),t.buttonList.forEach(w=>{var W;const E=[`${i.config.classPrefix}-button`,(W=w.class)!=null?W:""];N(w.type)||w.type==="secondary"?E.push(`${i.config.classPrefix}-button-secondary`):w.type==="primary"?E.push(`${i.config.classPrefix}-button-primary`):w.type==="link"&&E.push(`${i.config.classPrefix}-button-link`),!N(w.class)&&w.class!==""&&E.push(w.class);const P=L("button",E);P.innerHTML=i.config.translateFn(w.text),P.onclick=M=>{w.action.call(i)},r.appendChild(P)}),!i.config.progress.disable&&i.config.progress.text&&C(i.activeStepIndex)){const w=L("p",[`${i.config.classPrefix}-progress`,`${(b=(S=t.customization)==null?void 0:S.progressClass)!=null?b:""}`]);w.innerHTML=i.config.translateFn(Ne(i.config.progress.text,i.activeStepIndex+1,i.stepList.length)),r.appendChild(w)}e.appendChild(r)}function He(e){return[{text:e.config.buttons.prevText,action:e.prev},{text:e.config.buttons.nextText,type:"primary",action:e.next}]}function Ne(e,t,i){return e.replace("{{currentStep}}",t.toString()).replace("{{totalSteps}}",i.toString())}class Be{constructor(){x(this,"_renderContentStrategy",new Map);x(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(t,i){return new Promise(n=>{var o,s;if(!this._renderContentStrategy.has(i.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(i.tour.config.animationClass),i.hostElement?t.style.position=St(i.hostElement):t.style.position="fixed",De(t,i.popupData,i.tour),(o=this._renderContentStrategy.get(i.popupData.type))==null||o.renderContent(t,i.popupData,i.tour.config),(s=i.hostElement)==null||s.scrollIntoView(i.tour.config.scrollTo),n()}).then(()=>i.isFirst&&i.direction==="toNext"?Ht(0):Ht(400)).then(()=>{t.style.display="flex",this.updatePosition(t,i),t.classList.add(i.tour.config.animationClass)})}updatePosition(t,i){C(i.hostElement)?this.renderFloatingPopup(t,i):this.renderCenterPopup(t)}renderFloatingPopup(t,i){var l;const n=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=t.querySelector(`.${i.tour.config.classPrefix}-arrow`),s=[],r=C(i.popupData.position)&&i.popupData.position!=="auto"?i.popupData.position:void 0,c=(l=o==null?void 0:o.offsetWidth)!=null?l:10,a=Math.sqrt(2*Et(c,2))/2+i.tour.config.highlight.padding;s.push(Le(a)),(i.popupData.position==="auto"||N(r))&&s.push(Oe()),!i.tour.config.arrow.disable&&C(o)&&s.push(Re({element:o})),$e(i.hostElement,t,{placement:r,middleware:[...s]}).then(({x:h,y:f,middlewareData:g,placement:u})=>{Object.assign(t.style,{top:`${f-n}px`,left:`${h}px`,marginTop:"0",marginLeft:"0"});const d=u.split("-")[0],p=this._staticSides[d];if(g.arrow&&C(o)){const{x:m,y}=g.arrow;Object.assign(o.style,{left:m!=null?`${m}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",[p]:`${-c/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 ke),this._renderContentStrategy.set("custom",new Ae)}}class Fe{render(t,i){return new Promise(n=>{i.hostElement&&(t.style.position=St(i.hostElement)),n()}).then(()=>{this.updatePosition(t,i)})}updatePosition(t,i){var r,c;if(!i.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 n=i.hostElement.getBoundingClientRect(),o=(c=(r=i.tour.config.highlight)==null?void 0:r.padding)!=null?c:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${n.left-o}px`,t.style.top=`${n.top+s-o}px`,t.style.width=`${n.width+2*o}px`,t.style.height=`${n.height+2*o}px`,t.style.opacity="1"}}class Me{render(t,i){return new Promise(n=>{i.hostElement&&(t.style.position=St(i.hostElement)),n()}).then(()=>{this.updatePosition(t,i)})}updatePosition(t,i){var r,c;if(!i.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)";return}const n=i.hostElement.getBoundingClientRect(),o=(c=(r=i.tour.config.highlight)==null?void 0:r.padding)!=null?c:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${n.left-o}px`,t.style.top=`${n.top+s-o}px`,t.style.width=`${n.width+2*o}px`,t.style.height=`${n.height+2*o}px`}}class qt{constructor(t,i){x(this,"popupData");x(this,"tour");x(this,"_index");x(this,"_hostElement",null);x(this,"_direction","toNext");x(this,"_hostData");x(this,"_resizeObserver",null);var n;this.popupData=i.popup,this.tour=t,this._index=(n=i.index)!=null?n:null,this._hostData=i.host}get isFirst(){return this.tour.stepList.indexOf(this)===0}get direction(){return this._direction}get hasHost(){return C(this._hostElement)}get hostElement(){return this._hostElement}get index(){return this._index}set index(t){this._index=t}show(t){return k(this,null,function*(){var n;if(N(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(n=this._hostData)!=null?n:null)),this._resizeObserver=this.listenHostResize();const i=[];!this.tour.config.highlight.disable&&!N(this.tour.highlight)&&i.push(this.tour.highlightRenderer.render(this.tour.highlight,this)),this.tour.config.highlight.disable&&C(this.tour.highlight)&&this.tour.highlightRenderer.render(this.tour.highlight,{}),this.tour.config.interaction.disable&&C(this.tour.interaction)?i.push(this.tour.interactionRenderer.render(this.tour.interaction,this)):!this.tour.config.interaction.disable&&C(this.tour.interaction)&&i.push(this.tour.interactionRenderer.render(this.tour.interaction,{})),i.push(this.tour.popupRenderer.render(this.tour.popup,this)),yield Promise.all(i),this.toggleHostClass(!0)})}hide(){return k(this,null,function*(){var t;(t=this._resizeObserver)==null||t.disconnect(),this.toggleHostClass(!1)})}toggleHostClass(t){var i,n;N(this._hostElement)||(t?(this._hostElement.classList.add("siteguide-host"),(i=this._hostElement.parentElement)==null||i.classList.add("siteguide-host-parent")):(this._hostElement.classList.remove("siteguide-host"),(n=this._hostElement.parentElement)==null||n.classList.remove("siteguide-host-parent")))}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}listenHostResize(){const t=new ResizeObserver(()=>{N(this.tour.activeStep)||(C(this.tour.popup)&&this.tour.popupRenderer.updatePosition(this.tour.popup,this.tour.activeStep),C(this.tour.highlight)&&!this.tour.config.highlight.disable&&this.tour.highlightRenderer.updatePosition(this.tour.highlight,this.tour.activeStep),C(this.tour.interaction)&&this.tour.config.interaction.disable&&this.tour.interactionRenderer.updatePosition(this.tour.interaction,this.tour.activeStep))});return C(this._hostElement)&&t.observe(this._hostElement),t}}function gt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Ut(e,t){const i=A({},e);return gt(e)&&gt(t)&&Object.keys(t).forEach(n=>{const o=n,s=n;gt(t[o])?(s in e||Object.assign(i,{[s]:{}}),i[s]=Ut(e[s],t[o])):Object.assign(i,{[s]:t[o]})}),i}function Ve(e){const t=L("button",[`${e}-close`]);return t.innerHTML="✖",t}class ze{constructor(){x(this,"_activeTour",null)}get isActive(){return C(this.activeTour)}get activeTour(){return this._activeTour}setActiveTour(t){this._activeTour=t}}const ot=new ze;class We{constructor(t){x(this,"popupRenderer",new Be);x(this,"highlightRenderer",new Fe);x(this,"interactionRenderer",new Me);x(this,"_popup",null);x(this,"_highlight",null);x(this,"_interaction",null);x(this,"_background",null);x(this,"_stepList",[]);x(this,"_activeStep",null);x(this,"_bodyResizeObserver",null);x(this,"_config");x(this,"closeOnEsc",t=>{t.key==="Escape"&&this.complete()});x(this,"closeOnClick",()=>{this.complete()});x(this,"keyboardControl",t=>{t.key==="ArrowRight"?this.next():t.key==="ArrowLeft"&&this.prev()});var i,n,o,s,r,c,a,l,h,f,g,u,d,p,m,y,_,v,S,b,w,E,P,W,M,I,T,O,Y,$,q;this._config={classPrefix:(i=t.classPrefix)!=null?i:"siteguide",class:"",buttons:{nextText:(o=(n=t.buttons)==null?void 0:n.nextText)!=null?o:"Next",prevText:(r=(s=t.buttons)==null?void 0:s.prevText)!=null?r:"Back"},animationClass:(c=t.animationClass)!=null?c:"siteguide-animation",close:{button:(l=(a=t.close)==null?void 0:a.button)!=null?l:!0,clickout:(f=(h=t.close)==null?void 0:h.clickout)!=null?f:!1,esc:(u=(g=t.close)==null?void 0:g.esc)!=null?u:!0},scrollTo:(d=t.scrollTo)!=null?d:{behavior:"smooth",block:"center",inline:"center"},closeIcon:(m=t.closeIcon)!=null?m:Ve((p=t.classPrefix)!=null?p:"siteguide"),arrow:{disable:(_=(y=t.arrow)==null?void 0:y.disable)!=null?_:!1,class:(S=(v=t.arrow)==null?void 0:v.class)!=null?S:""},highlight:{disable:(w=(b=t.highlight)==null?void 0:b.disable)!=null?w:!1,padding:(P=(E=t.highlight)==null?void 0:E.padding)!=null?P:8,class:(M=(W=t.highlight)==null?void 0:W.class)!=null?M:""},progress:{disable:(T=(I=t.progress)==null?void 0:I.disable)!=null?T:!0,text:"Step {{currentStep}} of {{totalSteps}}"},interaction:{disable:(Y=(O=t.interaction)==null?void 0:O.disable)!=null?Y:!0},keyboardControl:($=t.keyboardControl)!=null?$:!1,translateFn:(q=t.translateFn)!=null?q:J=>J}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}get interaction(){return this._interaction}get activeStep(){return this._activeStep}get activeStepIndex(){return this._activeStep?this.stepList.indexOf(this._activeStep):null}addStep(t){if(N(t.index)){const n=this._stepList.reduce((o,s)=>s.index!==null&&s.index!==void 0&&s.index>o?s.index:o,-1);t.index=n+1}const i=new qt(this,t);this._stepList.push(i),this._stepList.sort((n,o)=>n.index-o.index)}addSteps(t){t.forEach(i=>this.addStep(i))}removeStep(t){this._stepList=this._stepList.filter(i=>t!==i.index)}start(){ot.isActive||(ot.setActiveTour(this),this._bodyResizeObserver=this.getBodyResizeObserver(),this.config.close.esc&&document.addEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.addEventListener("keydown",this.keyboardControl),this._background=L("div",["siteguide-background"]),document.body.appendChild(this._background),this.config.close.clickout&&this._background.addEventListener("click",this.closeOnClick),this._config.highlight.disable||(this._highlight=L("div",[this._config.highlight.class,`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this._config.interaction.disable&&(this._interaction=L("div",["siteguide-interaction"]),document.body.appendChild(this._interaction)),this._popup=L("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this.next())}complete(){var t,i;this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._interaction&&document.body.removeChild(this._interaction),this._background&&document.body.removeChild(this._background),(t=this._bodyResizeObserver)==null||t.disconnect(),(i=this._activeStep)==null||i.hide(),this._activeStep=null,ot.setActiveTour(null),this.config.close.esc&&document.removeEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.removeEventListener("keydown",this.keyboardControl)}prev(){const t=C(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this.changeStepTo(t,"fromBack")}next(){return k(this,null,function*(){var i,n,o;const t=C(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}C((i=this._activeStep)==null?void 0:i.popupData.allowNext)&&!((o=yield(n=this._activeStep)==null?void 0:n.popupData.allowNext.call(this))==null||o)||this.changeStepTo(t,"toNext")})}goTo(t){var i;if(t>this._stepList.length-1){console.error("Provided index was larger than steps amount");return}this.changeStepTo(t,t>((i=this.activeStepIndex)!=null?i:-1)?"toNext":"fromBack")}setConfig(t){this._config=Ut(this._config,t)}changeStepTo(t,i){var n;(n=this._activeStep)==null||n.hide(),this._activeStep=this._stepList[t],this._activeStep.show(i)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(C(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),C(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep),C(this._interaction)&&this.config.interaction.disable&&this.interactionRenderer.updatePosition(this._interaction,this._activeStep))});return t.observe(document.body),t}}const Ie=ot;exports.Siteguide=Ie;exports.Tour=We;exports.TourStep=qt;exports.createElement=L;
package/dist/index.mjs CHANGED
@@ -1,22 +1,22 @@
1
1
  var Ut = Object.defineProperty, Kt = Object.defineProperties;
2
2
  var Xt = Object.getOwnPropertyDescriptors;
3
3
  var nt = Object.getOwnPropertySymbols;
4
- var St = Object.prototype.hasOwnProperty, Pt = Object.prototype.propertyIsEnumerable;
5
- var Tt = Math.pow, ut = (e, t, i) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, A = (e, t) => {
4
+ var St = Object.prototype.hasOwnProperty, Et = Object.prototype.propertyIsEnumerable;
5
+ var Pt = Math.pow, ut = (e, t, i) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, A = (e, t) => {
6
6
  for (var i in t || (t = {}))
7
7
  St.call(t, i) && ut(e, i, t[i]);
8
8
  if (nt)
9
9
  for (var i of nt(t))
10
- Pt.call(t, i) && ut(e, i, t[i]);
10
+ Et.call(t, i) && ut(e, i, t[i]);
11
11
  return e;
12
12
  }, Q = (e, t) => Kt(e, Xt(t));
13
- var Et = (e, t) => {
13
+ var Tt = (e, t) => {
14
14
  var i = {};
15
15
  for (var n in e)
16
16
  St.call(e, n) && t.indexOf(n) < 0 && (i[n] = e[n]);
17
17
  if (e != null && nt)
18
18
  for (var n of nt(e))
19
- t.indexOf(n) < 0 && Pt.call(e, n) && (i[n] = e[n]);
19
+ t.indexOf(n) < 0 && Et.call(e, n) && (i[n] = e[n]);
20
20
  return i;
21
21
  };
22
22
  var y = (e, t, i) => ut(e, typeof t != "symbol" ? t + "" : t, i);
@@ -292,10 +292,10 @@ const re = (e) => ({
292
292
  const g = Nt(f), u = {
293
293
  x: n,
294
294
  y: o
295
- }, d = wt(s), p = xt(d), m = yield c.getDimensions(h), x = d === "y", _ = x ? "top" : "left", v = x ? "bottom" : "right", C = x ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[d] - u[d] - r.floating[p], w = u[d] - r.reference[d], T = yield c.getOffsetParent == null ? void 0 : c.getOffsetParent(h);
296
- let E = T ? T[C] : 0;
297
- (!E || !(yield c.isElement == null ? void 0 : c.isElement(T))) && (E = a.floating[C] || r.floating[p]);
298
- const W = b / 2 - w / 2, M = E / 2 - m[p] / 2 - 1, I = Z(g[_], M), P = Z(g[v], M), O = I, Y = E - m[p] - P, $ = E / 2 - m[p] / 2 + W, q = Zt(O, $, Y), J = !l.arrow && V(s) != null && $ !== q && r.reference[p] / 2 - ($ < O ? I : P) - m[p] / 2 < 0, ht = J ? $ < O ? $ - O : $ - Y : 0;
295
+ }, d = wt(s), p = xt(d), m = yield c.getDimensions(h), x = d === "y", _ = x ? "top" : "left", v = x ? "bottom" : "right", C = x ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[d] - u[d] - r.floating[p], w = u[d] - r.reference[d], P = yield c.getOffsetParent == null ? void 0 : c.getOffsetParent(h);
296
+ let T = P ? P[C] : 0;
297
+ (!T || !(yield c.isElement == null ? void 0 : c.isElement(P))) && (T = a.floating[C] || r.floating[p]);
298
+ const W = b / 2 - w / 2, M = T / 2 - m[p] / 2 - 1, I = Z(g[_], M), E = Z(g[v], M), O = I, Y = T - m[p] - E, $ = T / 2 - m[p] / 2 + W, q = Zt(O, $, Y), J = !l.arrow && V(s) != null && $ !== q && r.reference[p] / 2 - ($ < O ? I : E) - m[p] / 2 < 0, ht = J ? $ < O ? $ - O : $ - Y : 0;
299
299
  return {
300
300
  [d]: u[d] + ht,
301
301
  data: A({
@@ -330,7 +330,7 @@ const le = function(e) {
330
330
  alignment: g,
331
331
  allowedPlacements: u = Ot,
332
332
  autoAlignment: d = !0
333
- } = I, p = Et(I, [
333
+ } = I, p = Tt(I, [
334
334
  "crossAxis",
335
335
  "alignment",
336
336
  "allowedPlacements",
@@ -348,32 +348,32 @@ const le = function(e) {
348
348
  const b = [x[et(v)], x[C[0]], x[C[1]]], w = [...((o = c.autoPlacement) == null ? void 0 : o.overflows) || [], {
349
349
  placement: v,
350
350
  overflows: b
351
- }], T = m[_ + 1];
352
- if (T)
351
+ }], P = m[_ + 1];
352
+ if (P)
353
353
  return {
354
354
  data: {
355
355
  index: _ + 1,
356
356
  overflows: w
357
357
  },
358
358
  reset: {
359
- placement: T
359
+ placement: P
360
360
  }
361
361
  };
362
- const E = w.map((P) => {
363
- const O = V(P.placement);
364
- return [P.placement, O && f ? (
362
+ const T = w.map((E) => {
363
+ const O = V(E.placement);
364
+ return [E.placement, O && f ? (
365
365
  // Check along the mainAxis and main crossAxis side.
366
- P.overflows.slice(0, 2).reduce((Y, $) => Y + $, 0)
366
+ E.overflows.slice(0, 2).reduce((Y, $) => Y + $, 0)
367
367
  ) : (
368
368
  // Check only the mainAxis.
369
- P.overflows[0]
370
- ), P.overflows];
371
- }).sort((P, O) => P[1] - O[1]), M = ((s = E.filter((P) => P[2].slice(
369
+ E.overflows[0]
370
+ ), E.overflows];
371
+ }).sort((E, O) => E[1] - O[1]), M = ((s = T.filter((E) => E[2].slice(
372
372
  0,
373
373
  // Aligned placements should not check their opposite crossAxis
374
374
  // side.
375
- V(P[0]) ? 2 : 3
376
- ).every((O) => O <= 0))[0]) == null ? void 0 : s[0]) || E[0][0];
375
+ V(E[0]) ? 2 : 3
376
+ ).every((O) => O <= 0))[0]) == null ? void 0 : s[0]) || T[0][0];
377
377
  return M !== a ? {
378
378
  data: {
379
379
  index: _ + 1,
@@ -817,10 +817,10 @@ const Se = function(e) {
817
817
  };
818
818
  });
819
819
  };
820
- function Pe(e) {
820
+ function Ee(e) {
821
821
  return H(e).direction === "rtl";
822
822
  }
823
- const Te = {
823
+ const Pe = {
824
824
  convertOffsetParentRelativeRectToViewportRelativeRect: pe,
825
825
  getDocumentElement: z,
826
826
  getClippingRect: be,
@@ -830,10 +830,10 @@ const Te = {
830
830
  getDimensions: _e,
831
831
  getScale: K,
832
832
  isElement: D,
833
- isRTL: Pe
834
- }, Ee = fe, Le = le, Oe = re, Re = (e, t, i) => {
833
+ isRTL: Ee
834
+ }, Te = fe, Le = le, Oe = re, Re = (e, t, i) => {
835
835
  const n = /* @__PURE__ */ new Map(), o = A({
836
- platform: Te
836
+ platform: Pe
837
837
  }, i), s = Q(A({}, o.platform), {
838
838
  _c: n
839
839
  });
@@ -920,12 +920,12 @@ function ke(e, t, i) {
920
920
  ]);
921
921
  if (N(t.buttonList) && (t.buttonList = De(i)), t.buttonList.forEach((w) => {
922
922
  var W;
923
- const T = [`${i.config.classPrefix}-button`, (W = w.class) != null ? W : ""];
924
- N(w.type) || w.type === "secondary" ? T.push(`${i.config.classPrefix}-button-secondary`) : w.type === "primary" ? T.push(`${i.config.classPrefix}-button-primary`) : w.type === "link" && T.push(`${i.config.classPrefix}-button-link`), !N(w.class) && w.class !== "" && T.push(w.class);
925
- const E = L("button", T);
926
- E.innerHTML = i.config.translateFn(w.text), E.onclick = (M) => {
923
+ const P = [`${i.config.classPrefix}-button`, (W = w.class) != null ? W : ""];
924
+ N(w.type) || w.type === "secondary" ? P.push(`${i.config.classPrefix}-button-secondary`) : w.type === "primary" ? P.push(`${i.config.classPrefix}-button-primary`) : w.type === "link" && P.push(`${i.config.classPrefix}-button-link`), !N(w.class) && w.class !== "" && P.push(w.class);
925
+ const T = L("button", P);
926
+ T.innerHTML = i.config.translateFn(w.text), T.onclick = (M) => {
927
927
  w.action.call(i);
928
- }, r.appendChild(E);
928
+ }, r.appendChild(T);
929
929
  }), !i.config.progress.disable && i.config.progress.text && S(i.activeStepIndex)) {
930
930
  const w = L("p", [
931
931
  `${i.config.classPrefix}-progress`,
@@ -981,8 +981,8 @@ class Ne {
981
981
  }
982
982
  renderFloatingPopup(t, i) {
983
983
  var l;
984
- const n = t.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, o = t.querySelector(`.${i.tour.config.classPrefix}-arrow`), s = [], r = S(i.popupData.position) && i.popupData.position !== "auto" ? i.popupData.position : void 0, c = (l = o == null ? void 0 : o.offsetWidth) != null ? l : 10, a = Math.sqrt(2 * Tt(c, 2)) / 2 + i.tour.config.highlight.padding;
985
- s.push(Ee(a)), (i.popupData.position === "auto" || N(r)) && s.push(Le()), !i.tour.config.arrow.disable && S(o) && s.push(Oe({ element: o })), Re(i.hostElement, t, {
984
+ const n = t.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, o = t.querySelector(`.${i.tour.config.classPrefix}-arrow`), s = [], r = S(i.popupData.position) && i.popupData.position !== "auto" ? i.popupData.position : void 0, c = (l = o == null ? void 0 : o.offsetWidth) != null ? l : 10, a = Math.sqrt(2 * Pt(c, 2)) / 2 + i.tour.config.highlight.padding;
985
+ s.push(Te(a)), (i.popupData.position === "auto" || N(r)) && s.push(Le()), !i.tour.config.arrow.disable && S(o) && s.push(Oe({ element: o })), Re(i.hostElement, t, {
986
986
  placement: r,
987
987
  middleware: [...s]
988
988
  }).then(({ x: h, y: f, middlewareData: g, placement: u }) => {
@@ -1096,8 +1096,8 @@ class Me {
1096
1096
  this._direction = t, this._hostData && (this._hostElement = this.resolveHostElement(
1097
1097
  typeof this._hostData == "function" ? this._hostData() : (n = this._hostData) != null ? n : null
1098
1098
  )), this._resizeObserver = this.listenHostResize();
1099
- const i = [this.tour.popupRenderer.render(this.tour.popup, this)];
1100
- this.tour.config.interaction.disable && S(this.tour.interaction) ? i.push(this.tour.interactionRenderer.render(this.tour.interaction, this)) : !this.tour.config.interaction.disable && S(this.tour.interaction) && i.push(this.tour.interactionRenderer.render(this.tour.interaction, {})), !this.tour.config.highlight.disable && !N(this.tour.highlight) && i.push(this.tour.highlightRenderer.render(this.tour.highlight, this)), this.tour.config.highlight.disable && S(this.tour.highlight) && this.tour.highlightRenderer.render(this.tour.highlight, {}), yield Promise.all(i), this.toggleHostClass(!0);
1099
+ const i = [];
1100
+ !this.tour.config.highlight.disable && !N(this.tour.highlight) && i.push(this.tour.highlightRenderer.render(this.tour.highlight, this)), this.tour.config.highlight.disable && S(this.tour.highlight) && this.tour.highlightRenderer.render(this.tour.highlight, {}), this.tour.config.interaction.disable && S(this.tour.interaction) ? i.push(this.tour.interactionRenderer.render(this.tour.interaction, this)) : !this.tour.config.interaction.disable && S(this.tour.interaction) && i.push(this.tour.interactionRenderer.render(this.tour.interaction, {})), i.push(this.tour.popupRenderer.render(this.tour.popup, this)), yield Promise.all(i), this.toggleHostClass(!0);
1101
1101
  });
1102
1102
  }
1103
1103
  hide() {
@@ -1107,7 +1107,8 @@ class Me {
1107
1107
  });
1108
1108
  }
1109
1109
  toggleHostClass(t) {
1110
- N(this._hostElement) || (t ? this._hostElement.classList.add("siteguide-host") : this._hostElement.classList.remove("siteguide-host"));
1110
+ var i, n;
1111
+ N(this._hostElement) || (t ? (this._hostElement.classList.add("siteguide-host"), (i = this._hostElement.parentElement) == null || i.classList.add("siteguide-host-parent")) : (this._hostElement.classList.remove("siteguide-host"), (n = this._hostElement.parentElement) == null || n.classList.remove("siteguide-host-parent")));
1111
1112
  }
1112
1113
  resolveHostElement(t) {
1113
1114
  return typeof this._hostData == "string" ? document.querySelector(this._hostData) : t;
@@ -1170,7 +1171,7 @@ class Ie {
1170
1171
  y(this, "keyboardControl", (t) => {
1171
1172
  t.key === "ArrowRight" ? this.next() : t.key === "ArrowLeft" && this.prev();
1172
1173
  });
1173
- var i, n, o, s, r, c, a, l, h, f, g, u, d, p, m, x, _, v, C, b, w, T, E, W, M, I, P, O, Y, $, q;
1174
+ var i, n, o, s, r, c, a, l, h, f, g, u, d, p, m, x, _, v, C, b, w, P, T, W, M, I, E, O, Y, $, q;
1174
1175
  this._config = {
1175
1176
  classPrefix: (i = t.classPrefix) != null ? i : "siteguide",
1176
1177
  class: "",
@@ -1198,11 +1199,11 @@ class Ie {
1198
1199
  },
1199
1200
  highlight: {
1200
1201
  disable: (w = (b = t.highlight) == null ? void 0 : b.disable) != null ? w : !1,
1201
- padding: (E = (T = t.highlight) == null ? void 0 : T.padding) != null ? E : 8,
1202
+ padding: (T = (P = t.highlight) == null ? void 0 : P.padding) != null ? T : 8,
1202
1203
  class: (M = (W = t.highlight) == null ? void 0 : W.class) != null ? M : ""
1203
1204
  },
1204
1205
  progress: {
1205
- disable: (P = (I = t.progress) == null ? void 0 : I.disable) != null ? P : !0,
1206
+ disable: (E = (I = t.progress) == null ? void 0 : I.disable) != null ? E : !0,
1206
1207
  text: "Step {{currentStep}} of {{totalSteps}}"
1207
1208
  },
1208
1209
  interaction: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siteguide.js",
3
- "version": "0.9.2",
3
+ "version": "0.9.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": [