siteguide.js 0.4.0 → 0.5.0

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-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: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}
package/dist/index.d.ts CHANGED
@@ -40,18 +40,20 @@ declare type CustomPopupData_2 = SharedPopupData_2 & {
40
40
  * @template T The type to make deep required
41
41
  * @returns A type that represents a deep required version of T
42
42
  */
43
- declare type DeepRequired<T> = Required<{
44
- [Prop in keyof T]: T[Prop] extends object | undefined ? DeepRequired<Required<T[Prop]>> : T[Prop];
45
- }>;
43
+ declare type DeepRequired<T> = T extends (...args: any[]) => any
44
+ ? T
45
+ : T extends object
46
+ ? { [K in keyof T]-?: DeepRequired<T[K]> }
47
+ : T;
46
48
 
47
49
  /**
48
50
  * Represents a deep required type, ensuring all properties of an object are required and recursively applies to nested objects
49
51
  * @template T The type to make deep required
50
52
  * @returns A type that represents a deep required version of T
51
53
  */
52
- declare type DeepRequired_2<T> = Required<{
53
- [Prop in keyof T]: T[Prop] extends object | undefined ? DeepRequired_2<Required<T[Prop]>> : T[Prop];
54
- }>;
54
+ declare type DeepRequired_2<T> = T extends (...args: any[]) => any ? T : T extends object ? {
55
+ [K in keyof T]-?: DeepRequired_2<T[K]>;
56
+ } : T;
55
57
 
56
58
  /**
57
59
  * Interface for rendering element
@@ -436,11 +438,6 @@ export declare class Tour implements ITour {
436
438
  get highlight(): HTMLElement | null;
437
439
  readonly popupRenderer: IRenderer_2;
438
440
  readonly highlightRenderer: IRenderer_2;
439
- /**
440
- * TODO remove
441
- * @deprecated remove later
442
- */
443
- isStarted: boolean;
444
441
  private _popup;
445
442
  private _highlight;
446
443
  private _stepList;
@@ -547,6 +544,11 @@ export declare type TourConfig = {
547
544
  * The element or HTML to use as the close icon
548
545
  */
549
546
  closeIcon?: PopupCloseIconElement;
547
+ /**
548
+ * Indicates if the arrow should be shown
549
+ * @default true
550
+ */
551
+ enableArrow?: boolean;
550
552
  /**
551
553
  * Configuration for the helper layout.
552
554
  */
@@ -560,14 +562,10 @@ export declare type TourConfig = {
560
562
  * The horizontal padding for the helper layout.
561
563
  * @default 8
562
564
  */
563
- paddingX?: number;
564
- /**
565
- * The vertical padding for the helper layout.
566
- * @default 8
567
- */
568
- paddingY?: number;
565
+ padding?: number;
569
566
  /**
570
567
  * The class to apply to the highlight
568
+ * @default 'siteguide-highlight'
571
569
  */
572
570
  class?: string;
573
571
  };
@@ -576,6 +574,10 @@ export declare type TourConfig = {
576
574
  * @default 'siteguide-animation'
577
575
  */
578
576
  animationClass?: string;
577
+ /**
578
+ * The function to translate the tokens
579
+ */
580
+ translateFn?: TranslateFn_2;
579
581
  };
580
582
 
581
583
  /**
@@ -609,6 +611,11 @@ declare type TourConfig_2 = {
609
611
  * The element or HTML to use as the close icon
610
612
  */
611
613
  closeIcon?: PopupCloseIconElement_2;
614
+ /**
615
+ * Indicates if the arrow should be shown
616
+ * @default true
617
+ */
618
+ enableArrow?: boolean;
612
619
  /**
613
620
  * Configuration for the helper layout.
614
621
  */
@@ -622,14 +629,10 @@ declare type TourConfig_2 = {
622
629
  * The horizontal padding for the helper layout.
623
630
  * @default 8
624
631
  */
625
- paddingX?: number;
626
- /**
627
- * The vertical padding for the helper layout.
628
- * @default 8
629
- */
630
- paddingY?: number;
632
+ padding?: number;
631
633
  /**
632
634
  * The class to apply to the highlight
635
+ * @default 'siteguide-highlight'
633
636
  */
634
637
  class?: string;
635
638
  };
@@ -639,6 +642,10 @@ declare type TourConfig_2 = {
639
642
  * @default 'siteguide-animation'
640
643
  */
641
644
  animationClass?: string;
645
+ /**
646
+ * The function to translate the tokens
647
+ */
648
+ translateFn?: TranslateFn;
642
649
  };
643
650
 
644
651
  export declare class TourStep implements ITourStep_2 {
@@ -706,4 +713,18 @@ declare type TourStepConfig_2 = {
706
713
  popup: PopupData_2;
707
714
  };
708
715
 
716
+ /**
717
+ * The function to translate the tokens
718
+ * @param {string} token - The token to translate
719
+ * @returns {string} The translated string
720
+ */
721
+ declare type TranslateFn = (token: string) => string;
722
+
723
+ /**
724
+ * The function to translate the tokens
725
+ * @param {string} token - The token to translate
726
+ * @returns {string} The translated string
727
+ */
728
+ declare type TranslateFn_2 = (token: string) => string;
729
+
709
730
  export { }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Vt=Object.defineProperty,Ft=Object.defineProperties;var Wt=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var ut=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var tt=(e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))ut.call(t,n)&&tt(e,n,t[n]);if(U)for(var n of U(t))dt.call(t,n)&&tt(e,n,t[n]);return e},z=(e,t)=>Ft(e,Wt(t));var gt=(e,t)=>{var n={};for(var i in e)ut.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&U)for(var i of U(e))t.indexOf(i)<0&&dt.call(e,i)&&(n[i]=e[i]);return n};var w=(e,t,n)=>tt(e,typeof t!="symbol"?t+"":t,n);var A=(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 zt=["top","right","bottom","left"],pt=["start","end"],mt=zt.reduce((e,t)=>e.concat(t,t+"-"+pt[0],t+"-"+pt[1]),[]),yt=Math.min,Y=Math.max,q=Math.round,P=e=>({x:e,y:e}),Yt={left:"right",right:"left",bottom:"top",top:"bottom"},It={start:"end",end:"start"};function ot(e,t){return typeof e=="function"?e(t):e}function j(e){return e.split("-")[0]}function D(e){return e.split("-")[1]}function jt(e){return e==="x"?"y":"x"}function Lt(e){return e==="y"?"height":"width"}function st(e){return["top","bottom"].includes(j(e))?"y":"x"}function St(e){return jt(st(e))}function Xt(e,t,n){n===void 0&&(n=!1);const i=D(e),o=St(e),r=Lt(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=wt(s)),[s,wt(s)]}function Ut(e){return e.replace(/start|end/g,t=>It[t])}function wt(e){return e.replace(/left|right|bottom|top/g,t=>Yt[t])}function qt(e){return L({top:0,right:0,bottom:0,left:0},e)}function Kt(e){return typeof e!="number"?qt(e):{top:e,right:e,bottom:e,left:e}}function K(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 xt(e,t,n){let{reference:i,floating:o}=e;const r=st(t),s=St(t),l=Lt(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(D(t)){case"start":u[s]-=g*(n&&c?-1:1);break;case"end":u[s]+=g*(n&&c?-1:1);break}return u}const Gt=(e,t,n)=>A(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}=xt(c,i,a),g=i,u={},p=0;for(let y=0;y<l.length;y++){const{name:m,fn:_}=l[y],{x:b,y:d,data:v,reset:x}=yield _({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=d!=null?d:f,u=z(L({},u),{[m]:L(L({},u[m]),v)}),x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(g=x.placement),x.rects&&(c=x.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:h,y:f}=xt(c,g,a)),y=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:u}});function Jt(e,t){return A(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}=ot(t,e),p=Kt(u),m=l[g?f==="floating"?"reference":"floating":f],_=K(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(m))==null||n?m:m.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,d=yield r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating),v=(yield r.isElement==null?void 0:r.isElement(d))?(yield r.getScale==null?void 0:r.getScale(d))||{x:1,y:1}:{x:1,y:1},x=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:d,strategy:a}):b);return{top:(_.top-x.top+p.top)/v.y,bottom:(x.bottom-_.bottom+p.bottom)/v.y,left:(_.left-x.left+p.left)/v.x,right:(x.right-_.right+p.right)/v.x}})}function Qt(e,t,n){return(e?[...n.filter(o=>D(o)===e),...n.filter(o=>D(o)!==e)]:n.filter(o=>j(o)===o)).filter(o=>e?D(o)===e||(t?Ut(o)!==o:!1):!0)}const Zt=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(n){return A(this,null,function*(){var i,o,r;const{rects:s,middlewareData:l,placement:a,platform:c,elements:h}=n,ht=ot(e,n),{crossAxis:f=!1,alignment:g,allowedPlacements:u=mt,autoAlignment:p=!0}=ht,y=gt(ht,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||u===mt?Qt(g||null,p,u):u,_=yield Jt(n,y),b=((i=l.autoPlacement)==null?void 0:i.index)||0,d=m[b];if(d==null)return{};const v=Xt(d,s,yield c.isRTL==null?void 0:c.isRTL(h.floating));if(a!==d)return{reset:{placement:m[0]}};const x=[_[j(d)],_[v[0]],_[v[1]]],N=[...((o=l.autoPlacement)==null?void 0:o.overflows)||[],{placement:d,overflows:x}],Z=m[b+1];if(Z)return{data:{index:b+1,overflows:N},reset:{placement:Z}};const at=N.map(E=>{const W=D(E.placement);return[E.placement,W&&f?E.overflows.slice(0,2).reduce((Nt,Ht)=>Nt+Ht,0):E.overflows[0],E.overflows]}).sort((E,W)=>E[1]-W[1]),ft=((r=at.filter(E=>E[2].slice(0,D(E[0])?2:3).every(W=>W<=0))[0])==null?void 0:r[0])||at[0][0];return ft!==a?{data:{index:b+1,overflows:N},reset:{placement:ft}}:{}})}}};function te(e,t){return A(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=D(n),a=st(n)==="y",c=["left","top"].includes(s)?-1:1,h=r&&a?-1:1,f=ot(t,e);let{mainAxis:g,crossAxis:u,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),a?{x:u*h,y:g*c}:{x:g*c,y:u*h}})}const ee=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return A(this,null,function*(){var i,o;const{x:r,y:s,placement:l,middlewareData:a}=n,c=yield te(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:z(L({},c),{placement:l})}})}}};function G(){return typeof window!="undefined"}function F(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function C(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return G()?e instanceof Node||e instanceof C(e).Node:!1}function T(e){return G()?e instanceof Element||e instanceof C(e).Element:!1}function O(e){return G()?e instanceof HTMLElement||e instanceof C(e).HTMLElement:!1}function vt(e){return!G()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof C(e).ShadowRoot}function X(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 ne(e){return["table","td","th"].includes(F(e))}function J(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function rt(e){const t=lt(),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 ie(e){let t=M(e);for(;O(t)&&!V(t);){if(rt(t))return t;if(J(t))return null;t=M(t)}return null}function lt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function V(e){return["html","body","#document"].includes(F(e))}function R(e){return C(e).getComputedStyle(e)}function Q(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function M(e){if(F(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vt(e)&&e.host||$(e);return vt(t)?t.host:t}function Rt(e){const t=M(e);return V(t)?e.ownerDocument?e.ownerDocument.body:e.body:O(t)&&X(t)?t:Rt(t)}function nt(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Rt(e),r=o===((i=e.ownerDocument)==null?void 0:i.body),s=C(o);if(r){const l=it(s);return t.concat(s,s.visualViewport||[],X(o)?o:[],l&&n?nt(l):[])}return t.concat(o,nt(o,[],n))}function it(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Et(e){const t=R(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=O(e),r=o?e.offsetWidth:n,s=o?e.offsetHeight:i,l=q(n)!==r||q(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function Pt(e){return T(e)?e:e.contextElement}function H(e){const t=Pt(e);if(!O(t))return P(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=Et(t);let s=(r?q(n.width):n.width)/i,l=(r?q(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const oe=P(0);function Ot(e){const t=C(e);return!lt()||!t.visualViewport?oe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function se(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==C(e)?!1:t}function I(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=Pt(e);let s=P(1);t&&(i?T(i)&&(s=H(i)):s=H(e));const l=se(r,n,i)?Ot(r):P(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=C(r),u=i&&T(i)?C(i):i;let p=g,y=it(p);for(;y&&i&&u!==p;){const m=H(y),_=y.getBoundingClientRect(),b=R(y),d=_.left+(y.clientLeft+parseFloat(b.paddingLeft))*m.x,v=_.top+(y.clientTop+parseFloat(b.paddingTop))*m.y;a*=m.x,c*=m.y,h*=m.x,f*=m.y,a+=d,c+=v,p=C(y),y=it(p)}}return K({width:h,height:f,x:a,y:c})}function ct(e,t){const n=Q(e).scrollLeft;return t?t.left+n:I($(e)).left+n}function $t(e,t,n){n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-(n?0:ct(e,i)),r=i.top+t.scrollTop;return{x:o,y:r}}function re(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r=o==="fixed",s=$(i),l=t?J(t.floating):!1;if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=P(1);const h=P(0),f=O(i);if((f||!f&&!r)&&((F(i)!=="body"||X(s))&&(a=Q(i)),O(i))){const u=I(i);c=H(i),h.x=u.x+i.clientLeft,h.y=u.y+i.clientTop}const g=s&&!f&&!r?$t(s,a,!0):P(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 le(e){return Array.from(e.getClientRects())}function ce(e){const t=$(e),n=Q(e),i=e.ownerDocument.body,o=Y(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=Y(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+ct(e);const l=-n.scrollTop;return R(i).direction==="rtl"&&(s+=Y(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:l}}function ae(e,t){const n=C(e),i=$(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=lt();(!c||c&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l,y:a}}function fe(e,t){const n=I(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=O(e)?H(e):P(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 _t(e,t,n){let i;if(t==="viewport")i=ae(e,n);else if(t==="document")i=ce($(e));else if(T(t))i=fe(t,n);else{const o=Ot(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return K(i)}function At(e,t){const n=M(e);return n===t||!T(n)||V(n)?!1:R(n).position==="fixed"||At(n,t)}function he(e,t){const n=t.get(e);if(n)return n;let i=nt(e,[],!1).filter(l=>T(l)&&F(l)!=="body"),o=null;const r=R(e).position==="fixed";let s=r?M(e):e;for(;T(s)&&!V(s);){const l=R(s),a=rt(s);!a&&l.position==="fixed"&&(o=null),(r?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||X(s)&&!a&&At(e,s))?i=i.filter(h=>h!==s):o=l,s=M(s)}return t.set(e,i),i}function ue(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const s=[...n==="clippingAncestors"?J(t)?[]:he(t,this._c):[].concat(n),i],l=s[0],a=s.reduce((c,h)=>{const f=_t(t,h,o);return c.top=Y(f.top,c.top),c.right=yt(f.right,c.right),c.bottom=yt(f.bottom,c.bottom),c.left=Y(f.left,c.left),c},_t(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function de(e){const{width:t,height:n}=Et(e);return{width:t,height:n}}function ge(e,t,n){const i=O(t),o=$(t),r=n==="fixed",s=I(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=P(0);if(i||!i&&!r)if((F(t)!=="body"||X(o))&&(l=Q(t)),i){const g=I(t,!0,r,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=ct(o));const c=o&&!i&&!r?$t(o,l):P(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 et(e){return R(e).position==="static"}function bt(e,t){if(!O(e)||R(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $(e)===n&&(n=n.ownerDocument.body),n}function kt(e,t){const n=C(e);if(J(e))return n;if(!O(e)){let o=M(e);for(;o&&!V(o);){if(T(o)&&!et(o))return o;o=M(o)}return n}let i=bt(e,t);for(;i&&ne(i)&&et(i);)i=bt(i,t);return i&&V(i)&&et(i)&&!rt(i)?n:i||ie(e)||n}const pe=function(e){return A(this,null,function*(){const t=this.getOffsetParent||kt,n=this.getDimensions,i=yield n(e.floating);return{reference:ge(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function me(e){return R(e).direction==="rtl"}const ye={convertOffsetParentRelativeRectToViewportRelativeRect:re,getDocumentElement:$,getClippingRect:ue,getOffsetParent:kt,getElementRects:pe,getClientRects:le,getDimensions:de,getScale:H,isElement:T,isRTL:me},we=ee,xe=Zt,ve=(e,t,n)=>{const i=new Map,o=L({platform:ye},n),r=z(L({},o.platform),{_c:i});return Gt(e,t,z(L({},o),{platform:r}))};function B(e){return e===null||typeof e=="undefined"}function k(e){return!B(e)}function Ct(e){return new Promise(t=>setTimeout(t,e))}function Dt(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:Dt(t)}function Mt(e){return Dt(e)?"fixed":"absolute"}class _e{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 be{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=n.text,o.appendChild(c)}}}function Ce(e,t,n){var l,a,c,h,f,g,u,p,y,m,_,b;e.innerHTML="",e.className=`${n.config.classPrefix} ${n.config.animationClass}`,(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=(g=t.title)!=null?g:"",i.appendChild(o),n.config.allowClose){const d=S("button",[`${n.config.classPrefix}-close`,`${(p=(u=t.customization)==null?void 0:u.closeButtonClass)!=null?p:""}`]);Le(d,n.config.closeIcon),d.onclick=n.complete.bind(n),i.appendChild(d)}const r=S("div",[`${n.config.classPrefix}-content`,`${(m=(y=t.customization)==null?void 0:y.contentClass)!=null?m:""}`]);e.appendChild(r);const s=S("div",[`${n.config.classPrefix}-footer`,`${(b=(_=t.customization)==null?void 0:_.footerClass)!=null?b:""}`]);B(t.buttonList)&&(t.buttonList=Se(n)),t.buttonList.forEach(d=>{var N;d.action=d.action.bind(n);const v=[`${n.config.classPrefix}-button`,(N=d.class)!=null?N:""];B(d.type)||d.type==="secondary"?v.push(`${n.config.classPrefix}-button-secondary`):d.type==="primary"?v.push(`${n.config.classPrefix}-button-primary`):d.type==="link"&&v.push(`${n.config.classPrefix}-button-link`),!B(d.class)&&d.class!==""&&v.push(d.class);const x=S("button",v);x.innerText=d.text,x.onclick=Z=>{d.action.call(n)},s.appendChild(x)}),e.appendChild(s)}function Le(e,t){t instanceof HTMLElement?e.appendChild(t):e.innerHTML=t.innerHTML}function Se(e){return[{text:"Back",action:e.prev},{text:"Next",type:"primary",action:e.next}]}class Te{constructor(){w(this,"_renderContentStrategy",new Map);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=Mt(n.hostElement):t.style.position="fixed",Ce(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"?Ct(0):Ct(400)).then(()=>{t.style.display="block",this.updatePosition(t,n),t.classList.add(n.tour.config.animationClass)})}updatePosition(t,n){const i=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=[],r=k(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0;(n.popupData.position==="auto"||B(r))&&o.push(xe()),n.hostElement?ve(n.hostElement,t,{placement:r,middleware:[...o,we(20)]}).then(({x:s,y:l})=>{Object.assign(t.style,{top:`${l-i}px`,left:`${s}px`,marginTop:"0",marginLeft:"0"})}):Object.assign(t.style,{top:"50%",left:"50%",marginTop:`-${t.clientHeight/2}px`,marginLeft:`-${t.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new be),this._renderContentStrategy.set("custom",new _e)}}class Re{render(t,n){return new Promise(i=>{n.hostElement&&(t.style.position=Mt(n.hostElement)),i()}).then(()=>{this.updatePosition(t,n)})}updatePosition(t,n){var l,a,c,h;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.borderWidth="0";return}const i=n.hostElement.getBoundingClientRect(),o=(a=(l=n.tour.config.highlight)==null?void 0:l.paddingX)!=null?a:8,r=(h=(c=n.tour.config.highlight)==null?void 0:c.paddingY)!=null?h:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.borderWidth="2px",t.style.left=`${i.left-o}px`,t.style.top=`${i.top+s-r}px`,t.style.width=`${i.width+2*o}px`,t.style.height=`${i.height+2*r}px`}}class Bt{constructor(t,n){w(this,"id");w(this,"popupData");w(this,"tour");w(this,"index");w(this,"_hostElement",null);w(this,"_direction","toNext");w(this,"_hostData");w(this,"_popupRenderer");w(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 k(this._hostElement)}get hostElement(){return this._hostElement}show(t){return A(this,null,function*(){var i;if(B(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&&!B(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 Ee(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 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),E=U,Z=H-w[p]-C,D=H/2-w[p]/2+vt,lt=Jt(E,D,Z),ct=!c.arrow&&M(r)!=null&&D!==lt&&s.reference[p]/2-(D<E?U:C)-w[p]/2<0,at=ct?D<E?D-E: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 E=M(C.placement);return[C.placement,E&&f?C.overflows.slice(0,2).reduce((Z,D)=>Z+D,0):C.overflows[0],C.overflows]}).sort((C,E)=>C[1]-E[1]),q=((r=H.filter(C=>C[2].slice(0,M(C[0])?2:3).every(E=>E<=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 R(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}=O(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=R(e)?O(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 O(e){return P(e).getComputedStyle(e)}function rt(e){return R(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=O(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 R(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?R(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&&R(i)?P(i):i;let d=g,p=dt(d);for(;p&&i&&u!==d;){const w=j(p),x=p.getBoundingClientRect(),_=O(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 O(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(R(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||!R(n)||I(n)?!1:O(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=>R(l)&&Y(l)!=="body"),o=null;const r=O(e).position==="fixed";let s=r?N(e):e;for(;R(s)&&!I(s);){const l=O(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 O(e).position==="static"}function $t(e,t){if(!A(e)||O(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(R(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 O(e).direction==="rtl"}const Pe={convertOffsetParentRelativeRectToViewportRelativeRect:de,getDocumentElement:F,getClippingRect:ye,getOffsetParent:Wt,getElementRects:_e,getClientRects:ge,getDimensions:ve,getScale:j,isElement:R,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 T(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.enableArrow){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){T(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=T(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.enableArrow&&T(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&&T(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.borderWidth="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.borderWidth="2px",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`}}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 T(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:`
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 Pe{constructor(t){w(this,"popupRenderer",new Te);w(this,"highlightRenderer",new Re);w(this,"isStarted",!1);w(this,"_popup",null);w(this,"_highlight",null);w(this,"_stepList",[]);w(this,"_activeStep",null);w(this,"_bodyResizeObserver");w(this,"_config");w(this,"_stepMap",new Map);var n,i,o,r,s,l,a,c,h,f,g,u,p,y,m;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:Ee((l=t.classPrefix)!=null?l:"siteguide"),highlight:{disable:(h=(c=t.highlight)==null?void 0:c.disable)!=null?h:!1,paddingX:(g=(f=t.highlight)==null?void 0:f.paddingX)!=null?g:8,paddingY:(p=(u=t.highlight)==null?void 0:u.paddingY)!=null?p:8,class:(m=(y=t.highlight)==null?void 0:y.class)!=null?m:"siteguide-highlight"}}}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 Bt(this,t);k(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.isStarted=!0,this._popup=S("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this._config.highlight.disable||(this._highlight=S("div",[k(this._config.highlight.class)?this._config.highlight.class:`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this.next()}complete(){this.isStarted=!1,this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._activeStep=null}prev(){const t=k(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=k(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.isStarted||!this._activeStep||(k(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),k(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep))});return t.observe(document.body),t}}exports.Tour=Pe;exports.TourStep=Bt;exports.createElement=S;
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"),enableArrow:(c=t.enableArrow)!=null?c:!0,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);T(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",[T(this._config.highlight.class)?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=T(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=T(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&&(T(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),T(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;