Files
2024-12-17 17:34:10 +01:00

5 lines
67 KiB
JavaScript

/*! shepherd.js 11.2.0 */var isMergeableObject=function(t){return isNonNullObject(t)&&!isSpecial(t)};function isNonNullObject(e){return!!e&&typeof e=="object"}function isSpecial(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||isReactElement(e)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(e){return e.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(e){return Array.isArray(e)?[]:{}}function cloneUnlessOtherwiseSpecified(e,t){return t.clone!==!1&&t.isMergeableObject(e)?deepmerge(emptyTarget(e),e,t):e}function defaultArrayMerge(e,t,n){return e.concat(t).map(function(s){return cloneUnlessOtherwiseSpecified(s,n)})}function getMergeFunction(e,t){if(!t.customMerge)return deepmerge;var n=t.customMerge(e);return typeof n=="function"?n:deepmerge}function getEnumerableOwnPropertySymbols(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function getKeys(e){return Object.keys(e).concat(getEnumerableOwnPropertySymbols(e))}function propertyIsOnObject(e,t){try{return t in e}catch{return!1}}function propertyIsUnsafe(e,t){return propertyIsOnObject(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function mergeObject(e,t,n){var s={};return n.isMergeableObject(e)&&getKeys(e).forEach(function(o){s[o]=cloneUnlessOtherwiseSpecified(e[o],n)}),getKeys(t).forEach(function(o){propertyIsUnsafe(e,o)||(propertyIsOnObject(e,o)&&n.isMergeableObject(t[o])?s[o]=getMergeFunction(o,n)(e[o],t[o],n):s[o]=cloneUnlessOtherwiseSpecified(t[o],n))}),s}function deepmerge(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||defaultArrayMerge,n.isMergeableObject=n.isMergeableObject||isMergeableObject,n.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var s=Array.isArray(t),o=Array.isArray(e),i=s===o;return i?s?n.arrayMerge(e,t,n):mergeObject(e,t,n):cloneUnlessOtherwiseSpecified(t,n)}deepmerge.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(s,o){return deepmerge(s,o,n)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;function isElement$1(e){return e instanceof Element}function isHTMLElement$1(e){return e instanceof HTMLElement}function isFunction(e){return typeof e=="function"}function isString(e){return typeof e=="string"}function isUndefined(e){return e===void 0}class Evented{on(t,n,s,o=!1){return isUndefined(this.bindings)&&(this.bindings={}),isUndefined(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:n,ctx:s,once:o}),this}once(t,n,s){return this.on(t,n,s,!0)}off(t,n){return isUndefined(this.bindings)||isUndefined(this.bindings[t])?this:(isUndefined(n)?delete this.bindings[t]:this.bindings[t].forEach((s,o)=>{s.handler===n&&this.bindings[t].splice(o,1)}),this)}trigger(t,...n){return!isUndefined(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((s,o)=>{const{ctx:i,handler:r,once:l}=s,c=i||this;r.apply(c,n),l&&this.bindings[t].splice(o,1)}),this}}function autoBind(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const s=t[n],o=e[s];s!=="constructor"&&typeof o=="function"&&(e[s]=o.bind(e))}return e}function _setupAdvanceOnHandler(e,t){return n=>{if(t.isOpen()){const s=t.el&&n.currentTarget===t.el;(!isUndefined(e)&&n.currentTarget.matches(e)||s)&&t.tour.next()}}}function bindAdvance(e){const{event:t,selector:n}=e.options.advanceOn||{};if(t){const s=_setupAdvanceOnHandler(n,e);let o;try{o=document.querySelector(n)}catch{}if(!isUndefined(n)&&!o)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);o?(o.addEventListener(t,s),e.on("destroy",()=>o.removeEventListener(t,s))):(document.body.addEventListener(t,s,!0),e.on("destroy",()=>document.body.removeEventListener(t,s,!0)))}else return console.error("advanceOn was defined, but no event name was passed.")}function normalizePrefix(e){return!isString(e)||e===""?"":e.charAt(e.length-1)!=="-"?`${e}-`:e}function parseAttachTo(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(isFunction(n.element)&&(n.element=n.element.call(e)),isString(n.element)){try{n.element=document.querySelector(n.element)}catch{}n.element||console.error(`The element for this Shepherd step was not found ${t.element}`)}return n}function shouldCenterStep(e){return e==null?!0:!e.element||!e.on}function uuid(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t=="x"?n:n&3|8).toString(16)})}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var n={},s=Object.keys(e),o,i;for(i=0;i<s.length;i++)o=s[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(e,t,n){return max(e,min(t,n))}function evaluate(e,t){return typeof e=="function"?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return e==="x"?"y":"x"}function getAxisLength(e){return e==="y"?"height":"width"}function getSideAxis(e){return["top","bottom"].includes(getSide(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){n===void 0&&(n=!1);const s=getAlignment(e),o=getAlignmentAxis(e),i=getAxisLength(o);let r=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=getOppositePlacement(r)),[r,getOppositePlacement(r)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,t=>oppositeAlignmentMap[t])}function getSideList(e,t,n){const s=["left","right"],o=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:s:t?s:o;case"left":case"right":return t?i:r;default:return[]}}function getOppositeAxisPlacements(e,t,n,s){const o=getAlignment(e);let i=getSideList(getSide(e),n==="start",s);return o&&(i=i.map(r=>r+"-"+o),t&&(i=i.concat(i.map(getOppositeAlignmentPlacement)))),i}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,t=>oppositeSideMap[t])}function expandPaddingObject(e){return _extends({top:0,right:0,bottom:0,left:0},e)}function getPaddingObject(e){return typeof e!="number"?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){return _extends({},e,{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}const _excluded2=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],_excluded4=["mainAxis","crossAxis","limiter"];function computeCoordsFromPlacement(e,t,n){let{reference:s,floating:o}=e;const i=getSideAxis(t),r=getAlignmentAxis(t),l=getAxisLength(r),c=getSide(t),a=i==="y",u=s.x+s.width/2-o.width/2,d=s.y+s.height/2-o.height/2,f=s[l]/2-o[l]/2;let p;switch(c){case"top":p={x:u,y:s.y-o.height};break;case"bottom":p={x:u,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:d};break;case"left":p={x:s.x-o.width,y:d};break;default:p={x:s.x,y:s.y}}switch(getAlignment(t)){case"start":p[r]-=f*(n&&a?-1:1);break;case"end":p[r]+=f*(n&&a?-1:1);break}return p}const computePosition$1=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:i=[],platform:r}=n,l=i.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(t));let a=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=computeCoordsFromPlacement(a,s,c),f=s,p={},m=0;for(let b=0;b<l.length;b++){const{name:_,fn:y}=l[b],{x:S,y:x,data:g,reset:h}=await y({x:u,y:d,initialPlacement:s,placement:f,strategy:o,middlewareData:p,rects:a,platform:r,elements:{reference:e,floating:t}});if(u=S??u,d=x??d,p=_extends({},p,{[_]:_extends({},p[_],g)}),h&&m<=50){m++,typeof h=="object"&&(h.placement&&(f=h.placement),h.rects&&(a=h.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:o}):h.rects),{x:u,y:d}=computeCoordsFromPlacement(a,f,c)),b=-1;continue}}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function detectOverflow(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:i,rects:r,elements:l,strategy:c}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=evaluate(t,e),m=getPaddingObject(p),_=l[f?d==="floating"?"reference":"floating":d],y=rectToClientRect(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(_)))==null||n?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),S=d==="floating"?_extends({},r.floating,{x:s,y:o}):r.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),g=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},h=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:x,strategy:c}):S);return{top:(y.top-h.top+m.top)/g.y,bottom:(h.bottom-y.bottom+m.bottom)/g.y,left:(y.left-h.left+m.left)/g.x,right:(h.right-y.right+m.right)/g.x}}const arrow=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:i,platform:r,elements:l}=t,{element:c,padding:a=0}=evaluate(e,t)||{};if(c==null)return{};const u=getPaddingObject(a),d={x:n,y:s},f=getAlignmentAxis(o),p=getAxisLength(f),m=await r.getDimensions(c),b=f==="y",_=b?"top":"left",y=b?"bottom":"right",S=b?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-d[f]-i.floating[p],g=d[f]-i.reference[f],h=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let w=h?h[S]:0;(!w||!await(r.isElement==null?void 0:r.isElement(h)))&&(w=l.floating[S]||i.floating[p]);const T=x/2-g/2,E=w/2-m[p]/2-1,I=min(u[_],E),C=min(u[y],E),O=I,L=w-m[p]-C,v=w/2-m[p]/2+T,k=clamp(O,v,L),A=getAlignment(o)!=null&&v!=k&&i.reference[p]/2-(v<O?I:C)-m[p]/2<0?v<O?O-v:L-v:0;return{[f]:d[f]-A,data:{[f]:k,centerOffset:v-k+A}}}}),flip=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var s;const{placement:o,middlewareData:i,rects:r,initialPlacement:l,platform:c,elements:a}=n,u=evaluate(t,n),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:_=!0}=u,y=_objectWithoutPropertiesLoose(u,_excluded2),S=getSide(o),x=getSide(l)===l,g=await(c.isRTL==null?void 0:c.isRTL(a.floating)),h=p||(x||!_?[getOppositePlacement(l)]:getExpandedPlacements(l));!p&&b!=="none"&&h.push(...getOppositeAxisPlacements(l,_,b,g));const w=[l,...h],T=await detectOverflow(n,y),E=[];let I=((s=i.flip)==null?void 0:s.overflows)||[];if(d&&E.push(T[S]),f){const v=getAlignmentSides(o,r,g);E.push(T[v[0]],T[v[1]])}if(I=[...I,{placement:o,overflows:E}],!E.every(v=>v<=0)){var C,O;const v=(((C=i.flip)==null?void 0:C.index)||0)+1,k=w[v];if(k)return{data:{index:v,overflows:I},reset:{placement:k}};let R=(O=I.filter(A=>A.overflows[0]<=0).sort((A,P)=>A.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!R)switch(m){case"bestFit":{var L;const A=(L=I.map(P=>[P.placement,P.overflows.filter(M=>M>0).reduce((M,N)=>M+N,0)]).sort((P,M)=>P[1]-M[1])[0])==null?void 0:L[0];A&&(R=A);break}case"initialPlacement":R=l;break}if(o!==R)return{reset:{placement:R}}}return{}}}},shift=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:s,y:o,placement:i}=n,r=evaluate(t,n),{mainAxis:l=!0,crossAxis:c=!1,limiter:a={fn:S=>{let{x,y:g}=S;return{x,y:g}}}}=r,u=_objectWithoutPropertiesLoose(r,_excluded4),d={x:s,y:o},f=await detectOverflow(n,u),p=getSideAxis(getSide(i)),m=getOppositeAxis(p);let b=d[m],_=d[p];if(l){const S=m==="y"?"top":"left",x=m==="y"?"bottom":"right",g=b+f[S],h=b-f[x];b=clamp(g,b,h)}if(c){const S=p==="y"?"top":"left",x=p==="y"?"bottom":"right",g=_+f[S],h=_-f[x];_=clamp(g,_,h)}const y=a.fn(_extends({},n,{[m]:b,[p]:_}));return _extends({},y,{data:{x:y.x-s,y:y.y-o}})}}},limitShift=function(t){return t===void 0&&(t={}),{options:t,fn(n){const{x:s,y:o,placement:i,rects:r,middlewareData:l}=n,{offset:c=0,mainAxis:a=!0,crossAxis:u=!0}=evaluate(t,n),d={x:s,y:o},f=getSideAxis(i),p=getOppositeAxis(f);let m=d[p],b=d[f];const _=evaluate(c,n),y=typeof _=="number"?{mainAxis:_,crossAxis:0}:_extends({mainAxis:0,crossAxis:0},_);if(a){const g=p==="y"?"height":"width",h=r.reference[p]-r.floating[g]+y.mainAxis,w=r.reference[p]+r.reference[g]-y.mainAxis;m<h?m=h:m>w&&(m=w)}if(u){var S,x;const g=p==="y"?"width":"height",h=["top","left"].includes(getSide(i)),w=r.reference[f]-r.floating[g]+(h&&((S=l.offset)==null?void 0:S[f])||0)+(h?0:y.crossAxis),T=r.reference[f]+r.reference[g]+(h?0:((x=l.offset)==null?void 0:x[f])||0)-(h?y.crossAxis:0);b<w?b=w:b>T&&(b=T)}return{[p]:m,[f]:b}}}};function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return(t=(isNode(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function isNode(e){return e instanceof Node||e instanceof getWindow(e).Node}function isElement(e){return e instanceof Element||e instanceof getWindow(e).Element}function isHTMLElement(e){return e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement}function isShadowRoot(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=getComputedStyle(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!["inline","contents"].includes(o)}function isTableElement(e){return["table","td","th"].includes(getNodeName(e))}function isContainingBlock(e){const t=isWebKit(),n=getComputedStyle(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(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;t=getParentNode(t)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(e){return["html","body","#document"].includes(getNodeName(e))}function getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function getParentNode(e){if(getNodeName(e)==="html")return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t){var n;t===void 0&&(t=[]);const s=getNearestOverflowAncestor(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=getWindow(s);return o?t.concat(i,i.visualViewport||[],isOverflowElement(s)?s:[]):t.concat(s,getOverflowAncestors(s))}function getCssDimensions(e){const t=getComputedStyle(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=isHTMLElement(e),i=o?e.offsetWidth:n,r=o?e.offsetHeight:s,l=round(n)!==i||round(s)!==r;return l&&(n=i,s=r),{width:n,height:s,$:l}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:i}=getCssDimensions(t);let r=(i?round(n.width):n.width)/s,l=(i?round(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return!isWebKit()||!t.visualViewport?noOffsets:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function shouldAddVisualOffsets(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==getWindow(e)?!1:t}function getBoundingClientRect(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=unwrapElement(e);let r=createCoords(1);t&&(s?isElement(s)&&(r=getScale(s)):r=getScale(e));const l=shouldAddVisualOffsets(i,n,s)?getVisualOffsets(i):createCoords(0);let c=(o.left+l.x)/r.x,a=(o.top+l.y)/r.y,u=o.width/r.x,d=o.height/r.y;if(i){const f=getWindow(i),p=s&&isElement(s)?getWindow(s):s;let m=f.frameElement;for(;m&&s&&p!==f;){const b=getScale(m),_=m.getBoundingClientRect(),y=getComputedStyle(m),S=_.left+(m.clientLeft+parseFloat(y.paddingLeft))*b.x,x=_.top+(m.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,a*=b.y,u*=b.x,d*=b.y,c+=S,a+=x,m=getWindow(m).frameElement}}return rectToClientRect({width:u,height:d,x:c,y:a})}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{rect:t,offsetParent:n,strategy:s}=e;const o=isHTMLElement(n),i=getDocumentElement(n);if(n===i)return t;let r={scrollLeft:0,scrollTop:0},l=createCoords(1);const c=createCoords(0);if((o||!o&&s!=="fixed")&&((getNodeName(n)!=="body"||isOverflowElement(i))&&(r=getNodeScroll(n)),isHTMLElement(n))){const a=getBoundingClientRect(n);l=getScale(n),c.x=a.x+n.clientLeft,c.y=a.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-r.scrollLeft*l.x+c.x,y:t.y*l.y-r.scrollTop*l.y+c.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getWindowScrollBarX(e){return getBoundingClientRect(getDocumentElement(e)).left+getNodeScroll(e).scrollLeft}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),s=e.ownerDocument.body,o=max(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=max(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+getWindowScrollBarX(e);const l=-n.scrollTop;return getComputedStyle(s).direction==="rtl"&&(r+=max(t.clientWidth,s.clientWidth)-o),{width:o,height:i,x:r,y:l}}function getViewportRect(e,t){const n=getWindow(e),s=getDocumentElement(e),o=n.visualViewport;let i=s.clientWidth,r=s.clientHeight,l=0,c=0;if(o){i=o.width,r=o.height;const a=isWebKit();(!a||a&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:r,x:l,y:c}}function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,i=isHTMLElement(e)?getScale(e):createCoords(1),r=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,a=s*i.y;return{width:r,height:l,x:c,y:a}}function getClientRectFromClippingAncestor(e,t,n){let s;if(t==="viewport")s=getViewportRect(e,n);else if(t==="document")s=getDocumentRect(getDocumentElement(e));else if(isElement(t))s=getInnerBoundingClientRect(t,n);else{const o=getVisualOffsets(e);s=_extends({},t,{x:t.x-o.x,y:t.y-o.y})}return rectToClientRect(s)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return n===t||!isElement(n)||isLastTraversableNode(n)?!1:getComputedStyle(n).position==="fixed"||hasFixedPositionAncestor(n,t)}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let s=getOverflowAncestors(e).filter(l=>isElement(l)&&getNodeName(l)!=="body"),o=null;const i=getComputedStyle(e).position==="fixed";let r=i?getParentNode(e):e;for(;isElement(r)&&!isLastTraversableNode(r);){const l=getComputedStyle(r),c=isContainingBlock(r);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||isOverflowElement(r)&&!c&&hasFixedPositionAncestor(e,r))?s=s.filter(u=>u!==r):o=l,r=getParentNode(r)}return t.set(e,s),s}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const r=[...n==="clippingAncestors"?getClippingElementAncestors(t,this._c):[].concat(n),s],l=r[0],c=r.reduce((a,u)=>{const d=getClientRectFromClippingAncestor(t,u,o);return a.top=max(d.top,a.top),a.right=min(d.right,a.right),a.bottom=min(d.bottom,a.bottom),a.left=max(d.left,a.left),a},getClientRectFromClippingAncestor(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function getDimensions(e){return getCssDimensions(e)}function getRectRelativeToOffsetParent(e,t,n){const s=isHTMLElement(t),o=getDocumentElement(t),i=n==="fixed",r=getBoundingClientRect(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=createCoords(0);if(s||!s&&!i)if((getNodeName(t)!=="body"||isOverflowElement(o))&&(l=getNodeScroll(t)),s){const a=getBoundingClientRect(t,!0,i,t);c.x=a.x+t.clientLeft,c.y=a.y+t.clientTop}else o&&(c.x=getWindowScrollBarX(o));return{x:r.left+l.scrollLeft-c.x,y:r.top+l.scrollTop-c.y,width:r.width,height:r.height}}function getTrueOffsetParent(e,t){return!isHTMLElement(e)||getComputedStyle(e).position==="fixed"?null:t?t(e):e.offsetParent}function getOffsetParent(e,t){const n=getWindow(e);if(!isHTMLElement(e))return n;let s=getTrueOffsetParent(e,t);for(;s&&isTableElement(s)&&getComputedStyle(s).position==="static";)s=getTrueOffsetParent(s,t);return s&&(getNodeName(s)==="html"||getNodeName(s)==="body"&&getComputedStyle(s).position==="static"&&!isContainingBlock(s))?n:s||getContainingBlock(e)||n}const getElementRects=async function(t){let{reference:n,floating:s,strategy:o}=t;const i=this.getOffsetParent||getOffsetParent,r=this.getDimensions;return{reference:getRectRelativeToOffsetParent(n,await i(s),o),floating:_extends({x:0,y:0},await r(s))}};function isRTL(e){return getComputedStyle(e).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function observeMove(e,t){let n=null,s;const o=getDocumentElement(e);function i(){clearTimeout(s),n&&n.disconnect(),n=null}function r(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:a,top:u,width:d,height:f}=e.getBoundingClientRect();if(l||t(),!d||!f)return;const p=floor(u),m=floor(o.clientWidth-(a+d)),b=floor(o.clientHeight-(u+f)),_=floor(a),S={rootMargin:-p+"px "+-m+"px "+-b+"px "+-_+"px",threshold:max(0,min(1,c))||1};let x=!0;function g(h){const w=h[0].intersectionRatio;if(w!==c){if(!x)return r();w?r(!1,w):s=setTimeout(()=>{r(!1,1e-7)},100)}x=!1}try{n=new IntersectionObserver(g,_extends({},S,{root:o.ownerDocument}))}catch{n=new IntersectionObserver(g,S)}n.observe(e)}return r(!0),i}function autoUpdate(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,a=unwrapElement(e),u=o||i?[...a?getOverflowAncestors(a):[],...getOverflowAncestors(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=a&&l?observeMove(a,n):null;let f=-1,p=null;r&&(p=new ResizeObserver(y=>{let[S]=y;S&&S.target===a&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),a&&!c&&p.observe(a),p.observe(t));let m,b=c?getBoundingClientRect(e):null;c&&_();function _(){const y=getBoundingClientRect(e);b&&(y.x!==b.x||y.y!==b.y||y.width!==b.width||y.height!==b.height)&&n(),b=y,m=requestAnimationFrame(_)}return n(),()=>{u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const computePosition=(e,t,n)=>{const s=new Map,o=_extends({platform},n),i=_extends({},o.platform,{_c:s});return computePosition$1(e,t,_extends({},o,{platform:i}))};function setupTooltip(e){e.cleanup&&e.cleanup();const t=e._getResolvedAttachToOptions();let n=t.element;const s=getFloatingUIOptions(t,e),o=shouldCenterStep(t);return o&&(n=document.body,e.shepherdElementComponent.getElement().classList.add("shepherd-centered")),e.cleanup=autoUpdate(n,e.el,()=>{if(!e.el){e.cleanup();return}setPosition(n,e,s,o)}),e.target=t.element,s}function mergeTooltipConfig(e,t){return{floatingUIOptions:cjs(e.floatingUIOptions||{},t.floatingUIOptions||{})}}function destroyTooltip(e){e.cleanup&&e.cleanup(),e.cleanup=null}function setPosition(e,t,n,s){return computePosition(e,t.el,n).then(floatingUIposition(t,s)).then(o=>new Promise(i=>{setTimeout(()=>i(o),300)})).then(o=>{o&&o.el&&o.el.focus({preventScroll:!0})})}function floatingUIposition(e,t){return({x:n,y:s,placement:o,middlewareData:i})=>(e.el&&(t?Object.assign(e.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(e.el.style,{position:"absolute",left:`${n}px`,top:`${s}px`}),e.el.dataset.popperPlacement=o,placeArrow(e.el,i)),e)}function placeArrow(e,t){const n=e.querySelector(".shepherd-arrow");if(n&&t.arrow){const{x:s,y:o}=t.arrow;Object.assign(n.style,{left:s!=null?`${s}px`:"",top:o!=null?`${o}px`:""})}}function getFloatingUIOptions(e,t){const n={strategy:"absolute",middleware:[]},s=addArrow(t);return shouldCenterStep(e)||(n.middleware.push(flip(),shift({limiter:limitShift(),crossAxis:!0})),s&&n.middleware.push(arrow({element:s})),n.placement=e.on),cjs(t.options.floatingUIOptions||{},n)}function addArrow(e){return e.options.arrow&&e.el?e.el.querySelector(".shepherd-arrow"):!1}function noop(){}function assign(e,t){for(const n in t)e[n]=t[n];return e}function run(e){return e()}function blank_object(){return Object.create(null)}function run_all(e){e.forEach(run)}function is_function(e){return typeof e=="function"}function safe_not_equal(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function is_empty(e){return Object.keys(e).length===0}function append(e,t){e.appendChild(t)}function insert(e,t,n){e.insertBefore(t,n||null)}function detach(e){e.parentNode&&e.parentNode.removeChild(e)}function destroy_each(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function element(e){return document.createElement(e)}function svg_element(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function text(e){return document.createTextNode(e)}function space(){return text(" ")}function empty(){return text("")}function listen(e,t,n,s){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n,s)}function attr(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const always_set_through_set_attribute=["width","height"];function set_attributes(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const s in t)t[s]==null?e.removeAttribute(s):s==="style"?e.style.cssText=t[s]:s==="__value"?e.value=e[s]=t[s]:n[s]&&n[s].set&&always_set_through_set_attribute.indexOf(s)===-1?e[s]=t[s]:attr(e,s,t[s])}function children(e){return Array.from(e.childNodes)}function toggle_class(e,t,n){e.classList[n?"add":"remove"](t)}let current_component;function set_current_component(e){current_component=e}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(e){get_current_component().$$.on_mount.push(e)}function afterUpdate(e){get_current_component().$$.after_update.push(e)}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function add_render_callback(e){render_callbacks.push(e)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const e=current_component;do{try{for(;flushidx<dirty_components.length;){const t=dirty_components[flushidx];flushidx++,set_current_component(t),update(t.$$)}}catch(t){throw dirty_components.length=0,flushidx=0,t}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let t=0;t<render_callbacks.length;t+=1){const n=render_callbacks[t];seen_callbacks.has(n)||(seen_callbacks.add(n),n())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(e)}function update(e){if(e.fragment!==null){e.update(),run_all(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(add_render_callback)}}function flush_render_callbacks(e){const t=[],n=[];render_callbacks.forEach(s=>e.indexOf(s)===-1?t.push(s):n.push(s)),n.forEach(s=>s()),render_callbacks=t}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(e,t){e&&e.i&&(outroing.delete(e),e.i(t))}function transition_out(e,t,n,s){if(e&&e.o){if(outroing.has(e))return;outroing.add(e),outros.c.push(()=>{outroing.delete(e),s&&(n&&e.d(1),s())}),e.o(t)}else s&&s()}function get_spread_update(e,t){const n={},s={},o={$$scope:1};let i=e.length;for(;i--;){const r=e[i],l=t[i];if(l){for(const c in r)c in l||(s[c]=1);for(const c in l)o[c]||(n[c]=l[c],o[c]=1);e[i]=l}else for(const c in r)o[c]=1}for(const r in s)r in n||(n[r]=void 0);return n}function create_component(e){e&&e.c()}function mount_component(e,t,n,s){const{fragment:o,after_update:i}=e.$$;o&&o.m(t,n),s||add_render_callback(()=>{const r=e.$$.on_mount.map(run).filter(is_function);e.$$.on_destroy?e.$$.on_destroy.push(...r):run_all(r),e.$$.on_mount=[]}),i.forEach(add_render_callback)}function destroy_component(e,t){const n=e.$$;n.fragment!==null&&(flush_render_callbacks(n.after_update),run_all(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function make_dirty(e,t){e.$$.dirty[0]===-1&&(dirty_components.push(e),schedule_update(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function init(e,t,n,s,o,i,r,l=[-1]){const c=current_component;set_current_component(e);const a=e.$$={fragment:null,ctx:[],props:i,update:noop,not_equal:o,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:blank_object(),dirty:l,skip_bound:!1,root:t.target||c.$$.root};r&&r(a.root);let u=!1;if(a.ctx=n?n(e,t.props||{},(d,f,...p)=>{const m=p.length?p[0]:f;return a.ctx&&o(a.ctx[d],a.ctx[d]=m)&&(!a.skip_bound&&a.bound[d]&&a.bound[d](m),u&&make_dirty(e,d)),f}):[],a.update(),u=!0,run_all(a.before_update),a.fragment=s?s(a.ctx):!1,t.target){if(t.hydrate){const d=children(t.target);a.fragment&&a.fragment.l(d),d.forEach(detach)}else a.fragment&&a.fragment.c();t.intro&&transition_in(e.$$.fragment),mount_component(e,t.target,t.anchor,t.customElement),flush()}set_current_component(c)}class SvelteComponent{$destroy(){destroy_component(this,1),this.$destroy=noop}$on(t,n){if(!is_function(n))return noop;const s=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return s.push(n),()=>{const o=s.indexOf(n);o!==-1&&s.splice(o,1)}}$set(t){this.$$set&&!is_empty(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function create_fragment$8(e){let t,n,s,o,i;return{c(){t=element("button"),attr(t,"aria-label",n=e[3]?e[3]:null),attr(t,"class",s=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],attr(t,"tabindex","0")},m(r,l){insert(r,t,l),t.innerHTML=e[5],o||(i=listen(t,"click",function(){is_function(e[0])&&e[0].apply(this,arguments)}),o=!0)},p(r,[l]){e=r,l&32&&(t.innerHTML=e[5]),l&8&&n!==(n=e[3]?e[3]:null)&&attr(t,"aria-label",n),l&18&&s!==(s=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&attr(t,"class",s),l&4&&(t.disabled=e[2])},i:noop,o:noop,d(r){r&&detach(t),o=!1,i()}}}function instance$8(e,t,n){let{config:s,step:o}=t,i,r,l,c,a,u;function d(f){return isFunction(f)?f=f.call(o):f}return e.$$set=f=>{"config"in f&&n(6,s=f.config),"step"in f&&n(7,o=f.step)},e.$$.update=()=>{e.$$.dirty&192&&(n(0,i=s.action?s.action.bind(o.tour):null),n(1,r=s.classes),n(2,l=s.disabled?d(s.disabled):!1),n(3,c=s.label?d(s.label):null),n(4,a=s.secondary),n(5,u=s.text?d(s.text):null))},[i,r,l,c,a,u,s,o]}class Shepherd_button extends SvelteComponent{constructor(t){super(),init(this,t,instance$8,create_fragment$8,safe_not_equal,{config:6,step:7})}}function get_each_context(e,t,n){const s=e.slice();return s[2]=t[n],s}function create_if_block$3(e){let t,n,s=e[1],o=[];for(let r=0;r<s.length;r+=1)o[r]=create_each_block(get_each_context(e,s,r));const i=r=>transition_out(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=empty()},m(r,l){for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(r,l);insert(r,t,l),n=!0},p(r,l){if(l&3){s=r[1];let c;for(c=0;c<s.length;c+=1){const a=get_each_context(r,s,c);o[c]?(o[c].p(a,l),transition_in(o[c],1)):(o[c]=create_each_block(a),o[c].c(),transition_in(o[c],1),o[c].m(t.parentNode,t))}for(group_outros(),c=s.length;c<o.length;c+=1)i(c);check_outros()}},i(r){if(!n){for(let l=0;l<s.length;l+=1)transition_in(o[l]);n=!0}},o(r){o=o.filter(Boolean);for(let l=0;l<o.length;l+=1)transition_out(o[l]);n=!1},d(r){destroy_each(o,r),r&&detach(t)}}}function create_each_block(e){let t,n;return t=new Shepherd_button({props:{config:e[2],step:e[0]}}),{c(){create_component(t.$$.fragment)},m(s,o){mount_component(t,s,o),n=!0},p(s,o){const i={};o&2&&(i.config=s[2]),o&1&&(i.step=s[0]),t.$set(i)},i(s){n||(transition_in(t.$$.fragment,s),n=!0)},o(s){transition_out(t.$$.fragment,s),n=!1},d(s){destroy_component(t,s)}}}function create_fragment$7(e){let t,n,s=e[1]&&create_if_block$3(e);return{c(){t=element("footer"),s&&s.c(),attr(t,"class","shepherd-footer")},m(o,i){insert(o,t,i),s&&s.m(t,null),n=!0},p(o,[i]){o[1]?s?(s.p(o,i),i&2&&transition_in(s,1)):(s=create_if_block$3(o),s.c(),transition_in(s,1),s.m(t,null)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros())},i(o){n||(transition_in(s),n=!0)},o(o){transition_out(s),n=!1},d(o){o&&detach(t),s&&s.d()}}}function instance$7(e,t,n){let s,{step:o}=t;return e.$$set=i=>{"step"in i&&n(0,o=i.step)},e.$$.update=()=>{e.$$.dirty&1&&n(1,s=o.options.buttons)},[o,s]}class Shepherd_footer extends SvelteComponent{constructor(t){super(),init(this,t,instance$7,create_fragment$7,safe_not_equal,{step:0})}}function create_fragment$6(e){let t,n,s,o,i;return{c(){t=element("button"),n=element("span"),n.textContent="\xD7",attr(n,"aria-hidden","true"),attr(t,"aria-label",s=e[0].label?e[0].label:"Close Tour"),attr(t,"class","shepherd-cancel-icon"),attr(t,"type","button")},m(r,l){insert(r,t,l),append(t,n),o||(i=listen(t,"click",e[1]),o=!0)},p(r,[l]){l&1&&s!==(s=r[0].label?r[0].label:"Close Tour")&&attr(t,"aria-label",s)},i:noop,o:noop,d(r){r&&detach(t),o=!1,i()}}}function instance$6(e,t,n){let{cancelIcon:s,step:o}=t;const i=r=>{r.preventDefault(),o.cancel()};return e.$$set=r=>{"cancelIcon"in r&&n(0,s=r.cancelIcon),"step"in r&&n(2,o=r.step)},[s,i,o]}class Shepherd_cancel_icon extends SvelteComponent{constructor(t){super(),init(this,t,instance$6,create_fragment$6,safe_not_equal,{cancelIcon:0,step:2})}}function create_fragment$5(e){let t;return{c(){t=element("h3"),attr(t,"id",e[1]),attr(t,"class","shepherd-title")},m(n,s){insert(n,t,s),e[3](t)},p(n,[s]){s&2&&attr(t,"id",n[1])},i:noop,o:noop,d(n){n&&detach(t),e[3](null)}}}function instance$5(e,t,n){let{labelId:s,element:o,title:i}=t;afterUpdate(()=>{isFunction(i)&&n(2,i=i()),n(0,o.innerHTML=i,o)});function r(l){binding_callbacks[l?"unshift":"push"](()=>{o=l,n(0,o)})}return e.$$set=l=>{"labelId"in l&&n(1,s=l.labelId),"element"in l&&n(0,o=l.element),"title"in l&&n(2,i=l.title)},[o,s,i,r]}class Shepherd_title extends SvelteComponent{constructor(t){super(),init(this,t,instance$5,create_fragment$5,safe_not_equal,{labelId:1,element:0,title:2})}}function create_if_block_1$1(e){let t,n;return t=new Shepherd_title({props:{labelId:e[0],title:e[2]}}),{c(){create_component(t.$$.fragment)},m(s,o){mount_component(t,s,o),n=!0},p(s,o){const i={};o&1&&(i.labelId=s[0]),o&4&&(i.title=s[2]),t.$set(i)},i(s){n||(transition_in(t.$$.fragment,s),n=!0)},o(s){transition_out(t.$$.fragment,s),n=!1},d(s){destroy_component(t,s)}}}function create_if_block$2(e){let t,n;return t=new Shepherd_cancel_icon({props:{cancelIcon:e[3],step:e[1]}}),{c(){create_component(t.$$.fragment)},m(s,o){mount_component(t,s,o),n=!0},p(s,o){const i={};o&8&&(i.cancelIcon=s[3]),o&2&&(i.step=s[1]),t.$set(i)},i(s){n||(transition_in(t.$$.fragment,s),n=!0)},o(s){transition_out(t.$$.fragment,s),n=!1},d(s){destroy_component(t,s)}}}function create_fragment$4(e){let t,n,s,o=e[2]&&create_if_block_1$1(e),i=e[3]&&e[3].enabled&&create_if_block$2(e);return{c(){t=element("header"),o&&o.c(),n=space(),i&&i.c(),attr(t,"class","shepherd-header")},m(r,l){insert(r,t,l),o&&o.m(t,null),append(t,n),i&&i.m(t,null),s=!0},p(r,[l]){r[2]?o?(o.p(r,l),l&4&&transition_in(o,1)):(o=create_if_block_1$1(r),o.c(),transition_in(o,1),o.m(t,n)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros()),r[3]&&r[3].enabled?i?(i.p(r,l),l&8&&transition_in(i,1)):(i=create_if_block$2(r),i.c(),transition_in(i,1),i.m(t,null)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(r){s||(transition_in(o),transition_in(i),s=!0)},o(r){transition_out(o),transition_out(i),s=!1},d(r){r&&detach(t),o&&o.d(),i&&i.d()}}}function instance$4(e,t,n){let{labelId:s,step:o}=t,i,r;return e.$$set=l=>{"labelId"in l&&n(0,s=l.labelId),"step"in l&&n(1,o=l.step)},e.$$.update=()=>{e.$$.dirty&2&&(n(2,i=o.options.title),n(3,r=o.options.cancelIcon))},[s,o,i,r]}class Shepherd_header extends SvelteComponent{constructor(t){super(),init(this,t,instance$4,create_fragment$4,safe_not_equal,{labelId:0,step:1})}}function create_fragment$3(e){let t;return{c(){t=element("div"),attr(t,"class","shepherd-text"),attr(t,"id",e[1])},m(n,s){insert(n,t,s),e[3](t)},p(n,[s]){s&2&&attr(t,"id",n[1])},i:noop,o:noop,d(n){n&&detach(t),e[3](null)}}}function instance$3(e,t,n){let{descriptionId:s,element:o,step:i}=t;afterUpdate(()=>{let{text:l}=i.options;isFunction(l)&&(l=l.call(i)),isHTMLElement$1(l)?o.appendChild(l):n(0,o.innerHTML=l,o)});function r(l){binding_callbacks[l?"unshift":"push"](()=>{o=l,n(0,o)})}return e.$$set=l=>{"descriptionId"in l&&n(1,s=l.descriptionId),"element"in l&&n(0,o=l.element),"step"in l&&n(2,i=l.step)},[o,s,i,r]}class Shepherd_text extends SvelteComponent{constructor(t){super(),init(this,t,instance$3,create_fragment$3,safe_not_equal,{descriptionId:1,element:0,step:2})}}function create_if_block_2(e){let t,n;return t=new Shepherd_header({props:{labelId:e[1],step:e[2]}}),{c(){create_component(t.$$.fragment)},m(s,o){mount_component(t,s,o),n=!0},p(s,o){const i={};o&2&&(i.labelId=s[1]),o&4&&(i.step=s[2]),t.$set(i)},i(s){n||(transition_in(t.$$.fragment,s),n=!0)},o(s){transition_out(t.$$.fragment,s),n=!1},d(s){destroy_component(t,s)}}}function create_if_block_1(e){let t,n;return t=new Shepherd_text({props:{descriptionId:e[0],step:e[2]}}),{c(){create_component(t.$$.fragment)},m(s,o){mount_component(t,s,o),n=!0},p(s,o){const i={};o&1&&(i.descriptionId=s[0]),o&4&&(i.step=s[2]),t.$set(i)},i(s){n||(transition_in(t.$$.fragment,s),n=!0)},o(s){transition_out(t.$$.fragment,s),n=!1},d(s){destroy_component(t,s)}}}function create_if_block$1(e){let t,n;return t=new Shepherd_footer({props:{step:e[2]}}),{c(){create_component(t.$$.fragment)},m(s,o){mount_component(t,s,o),n=!0},p(s,o){const i={};o&4&&(i.step=s[2]),t.$set(i)},i(s){n||(transition_in(t.$$.fragment,s),n=!0)},o(s){transition_out(t.$$.fragment,s),n=!1},d(s){destroy_component(t,s)}}}function create_fragment$2(e){let t,n=!isUndefined(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,s,o=!isUndefined(e[2].options.text),i,r=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,l,c=n&&create_if_block_2(e),a=o&&create_if_block_1(e),u=r&&create_if_block$1(e);return{c(){t=element("div"),c&&c.c(),s=space(),a&&a.c(),i=space(),u&&u.c(),attr(t,"class","shepherd-content")},m(d,f){insert(d,t,f),c&&c.m(t,null),append(t,s),a&&a.m(t,null),append(t,i),u&&u.m(t,null),l=!0},p(d,[f]){f&4&&(n=!isUndefined(d[2].options.title)||d[2].options.cancelIcon&&d[2].options.cancelIcon.enabled),n?c?(c.p(d,f),f&4&&transition_in(c,1)):(c=create_if_block_2(d),c.c(),transition_in(c,1),c.m(t,s)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()),f&4&&(o=!isUndefined(d[2].options.text)),o?a?(a.p(d,f),f&4&&transition_in(a,1)):(a=create_if_block_1(d),a.c(),transition_in(a,1),a.m(t,i)):a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()),f&4&&(r=Array.isArray(d[2].options.buttons)&&d[2].options.buttons.length),r?u?(u.p(d,f),f&4&&transition_in(u,1)):(u=create_if_block$1(d),u.c(),transition_in(u,1),u.m(t,null)):u&&(group_outros(),transition_out(u,1,1,()=>{u=null}),check_outros())},i(d){l||(transition_in(c),transition_in(a),transition_in(u),l=!0)},o(d){transition_out(c),transition_out(a),transition_out(u),l=!1},d(d){d&&detach(t),c&&c.d(),a&&a.d(),u&&u.d()}}}function instance$2(e,t,n){let{descriptionId:s,labelId:o,step:i}=t;return e.$$set=r=>{"descriptionId"in r&&n(0,s=r.descriptionId),"labelId"in r&&n(1,o=r.labelId),"step"in r&&n(2,i=r.step)},[s,o,i]}class Shepherd_content extends SvelteComponent{constructor(t){super(),init(this,t,instance$2,create_fragment$2,safe_not_equal,{descriptionId:0,labelId:1,step:2})}}function create_if_block(e){let t;return{c(){t=element("div"),attr(t,"class","shepherd-arrow"),attr(t,"data-popper-arrow","")},m(n,s){insert(n,t,s)},d(n){n&&detach(t)}}}function create_fragment$1(e){let t,n,s,o,i,r,l,c,a=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&create_if_block();s=new Shepherd_content({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let u=[{"aria-describedby":o=isUndefined(e[4].options.text)?null:e[2]},{"aria-labelledby":i=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],d={};for(let f=0;f<u.length;f+=1)d=assign(d,u[f]);return{c(){t=element("div"),a&&a.c(),n=space(),create_component(s.$$.fragment),set_attributes(t,d),toggle_class(t,"shepherd-has-cancel-icon",e[5]),toggle_class(t,"shepherd-has-title",e[6]),toggle_class(t,"shepherd-element",!0)},m(f,p){insert(f,t,p),a&&a.m(t,null),append(t,n),mount_component(s,t,null),e[13](t),r=!0,l||(c=listen(t,"keydown",e[7]),l=!0)},p(f,[p]){f[4].options.arrow&&f[4].options.attachTo&&f[4].options.attachTo.element&&f[4].options.attachTo.on?a||(a=create_if_block(),a.c(),a.m(t,n)):a&&(a.d(1),a=null);const m={};p&4&&(m.descriptionId=f[2]),p&8&&(m.labelId=f[3]),p&16&&(m.step=f[4]),s.$set(m),set_attributes(t,d=get_spread_update(u,[(!r||p&20&&o!==(o=isUndefined(f[4].options.text)?null:f[2]))&&{"aria-describedby":o},(!r||p&24&&i!==(i=f[4].options.title?f[3]:null))&&{"aria-labelledby":i},p&2&&f[1],{role:"dialog"},{tabindex:"0"}])),toggle_class(t,"shepherd-has-cancel-icon",f[5]),toggle_class(t,"shepherd-has-title",f[6]),toggle_class(t,"shepherd-element",!0)},i(f){r||(transition_in(s.$$.fragment,f),r=!0)},o(f){transition_out(s.$$.fragment,f),r=!1},d(f){f&&detach(t),a&&a.d(),destroy_component(s),e[13](null),l=!1,c()}}}const KEY_TAB=9,KEY_ESC=27,LEFT_ARROW=37,RIGHT_ARROW=39;function getClassesArray(e){return e.split(" ").filter(t=>!!t.length)}function instance$1(e,t,n){let{classPrefix:s,element:o,descriptionId:i,firstFocusableElement:r,focusableElements:l,labelId:c,lastFocusableElement:a,step:u,dataStepId:d}=t,f,p,m;const b=()=>o;onMount(()=>{n(1,d={[`data-${s}shepherd-step-id`]:u.id}),n(9,l=o.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,r=l[0]),n(10,a=l[l.length-1])}),afterUpdate(()=>{m!==u.options.classes&&_()});function _(){y(m),m=u.options.classes,S(m)}function y(h){if(isString(h)){const w=getClassesArray(h);w.length&&o.classList.remove(...w)}}function S(h){if(isString(h)){const w=getClassesArray(h);w.length&&o.classList.add(...w)}}const x=h=>{const{tour:w}=u;switch(h.keyCode){case KEY_TAB:if(l.length===0){h.preventDefault();break}h.shiftKey?(document.activeElement===r||document.activeElement.classList.contains("shepherd-element"))&&(h.preventDefault(),a.focus()):document.activeElement===a&&(h.preventDefault(),r.focus());break;case KEY_ESC:w.options.exitOnEsc&&(h.stopPropagation(),u.cancel());break;case LEFT_ARROW:w.options.keyboardNavigation&&(h.stopPropagation(),w.back());break;case RIGHT_ARROW:w.options.keyboardNavigation&&(h.stopPropagation(),w.next());break}};function g(h){binding_callbacks[h?"unshift":"push"](()=>{o=h,n(0,o)})}return e.$$set=h=>{"classPrefix"in h&&n(11,s=h.classPrefix),"element"in h&&n(0,o=h.element),"descriptionId"in h&&n(2,i=h.descriptionId),"firstFocusableElement"in h&&n(8,r=h.firstFocusableElement),"focusableElements"in h&&n(9,l=h.focusableElements),"labelId"in h&&n(3,c=h.labelId),"lastFocusableElement"in h&&n(10,a=h.lastFocusableElement),"step"in h&&n(4,u=h.step),"dataStepId"in h&&n(1,d=h.dataStepId)},e.$$.update=()=>{e.$$.dirty&16&&(n(5,f=u.options&&u.options.cancelIcon&&u.options.cancelIcon.enabled),n(6,p=u.options&&u.options.title))},[o,d,i,c,u,f,p,x,r,l,a,s,b,g]}class Shepherd_element extends SvelteComponent{constructor(t){super(),init(this,t,instance$1,create_fragment$1,safe_not_equal,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}class Step extends Evented{constructor(t,n={}){return super(t,n),this.tour=t,this.classPrefix=this.tour.options?normalizePrefix(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,autoBind(this),this._setOptions(n),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){destroyTooltip(this),isHTMLElement$1(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=parseAttachTo(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return this._resolvedAttachTo===null?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return!!(this.el&&!this.el.hidden)}show(){return isFunction(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then(()=>this._show()):Promise.resolve(this._show())}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=`${this.id}-description`,n=`${this.id}-label`;return this.shepherdElementComponent=new Shepherd_element({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:n,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:n}=this._getResolvedAttachToOptions();isFunction(this.options.scrollToHandler)?this.options.scrollToHandler(n):isElement$1(n)&&typeof n.scrollIntoView=="function"&&n.scrollIntoView(t)}_getClassOptions(t){const n=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,s=t.classes?t.classes:"",o=n&&n.classes?n.classes:"",i=[...s.split(" "),...o.split(" ")],r=new Set(i);return Array.from(r).join(" ").trim()}_setOptions(t={}){let n=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;n=cjs({},n||{}),this.options=Object.assign({arrow:!0},n,t,mergeTooltipConfig(n,t));const{when:s}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||`step-${uuid()}`,s&&Object.keys(s).forEach(o=>{this.on(o,s[o],this)})}_setupElements(){isUndefined(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&bindAdvance(this),setupTooltip(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),n=this.target||document.body;n.classList.add(`${this.classPrefix}shepherd-enabled`),n.classList.add(`${this.classPrefix}shepherd-target`),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const n=t.target;n&&(t.options.highlightClass&&n.classList.add(t.options.highlightClass),n.classList.remove("shepherd-target-click-disabled"),t.options.canClickTarget===!1&&n.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}}function cleanupSteps(e){if(e){const{steps:t}=e;t.forEach(n=>{n.options&&n.options.canClickTarget===!1&&n.options.attachTo&&n.target instanceof HTMLElement&&n.target.classList.remove("shepherd-target-click-disabled")})}}function makeOverlayPath({width:e,height:t,x:n=0,y:s=0,r:o=0}){const{innerWidth:i,innerHeight:r}=window,{topLeft:l=0,topRight:c=0,bottomRight:a=0,bottomLeft:u=0}=typeof o=="number"?{topLeft:o,topRight:o,bottomRight:o,bottomLeft:o}:o;return`M${i},${r}H0V0H${i}V${r}ZM${n+l},${s}a${l},${l},0,0,0-${l},${l}V${t+s-u}a${u},${u},0,0,0,${u},${u}H${e+n-a}a${a},${a},0,0,0,${a}-${a}V${s+c}a${c},${c},0,0,0-${c}-${c}Z`}function create_fragment(e){let t,n,s,o,i;return{c(){t=svg_element("svg"),n=svg_element("path"),attr(n,"d",e[2]),attr(t,"class",s=`${e[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)},m(r,l){insert(r,t,l),append(t,n),e[11](t),o||(i=listen(t,"touchmove",e[3]),o=!0)},p(r,[l]){l&4&&attr(n,"d",r[2]),l&2&&s!==(s=`${r[1]?"shepherd-modal-is-visible":""} shepherd-modal-overlay-container`)&&attr(t,"class",s)},i:noop,o:noop,d(r){r&&detach(t),e[11](null),o=!1,i()}}}function _getScrollParent(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return n!=="hidden"&&n!=="visible"&&e.scrollHeight>=e.clientHeight?e:_getScrollParent(e.parentElement)}function _getVisibleHeight(e,t){const n=e.getBoundingClientRect();let s=n.y||n.top,o=n.bottom||s+n.height;if(t){const r=t.getBoundingClientRect(),l=r.y||r.top,c=r.bottom||l+r.height;s=Math.max(s,l),o=Math.min(o,c)}const i=Math.max(o-s,0);return{y:s,height:i}}function instance(e,t,n){let{element:s,openingProperties:o}=t;uuid();let i=!1,r,l;a();const c=()=>s;function a(){n(4,o={width:0,height:0,x:0,y:0,r:0})}function u(){n(1,i=!1),y()}function d(g=0,h=0,w,T){if(T){const{y:E,height:I}=_getVisibleHeight(T,w),{x:C,width:O,left:L}=T.getBoundingClientRect();n(4,o={width:O+g*2,height:I+g*2,x:(C||L)-g,y:E-g,r:h})}else a()}function f(g){y(),g.tour.options.useModalOverlay?(S(g),p()):u()}function p(){n(1,i=!0)}const m=g=>{g.preventDefault()},b=g=>{g.stopPropagation()};function _(){window.addEventListener("touchmove",m,{passive:!1})}function y(){r&&(cancelAnimationFrame(r),r=void 0),window.removeEventListener("touchmove",m,{passive:!1})}function S(g){const{modalOverlayOpeningPadding:h,modalOverlayOpeningRadius:w}=g.options,T=_getScrollParent(g.target),E=()=>{r=void 0,d(h,w,T,g.target),r=requestAnimationFrame(E)};E(),_()}function x(g){binding_callbacks[g?"unshift":"push"](()=>{s=g,n(0,s)})}return e.$$set=g=>{"element"in g&&n(0,s=g.element),"openingProperties"in g&&n(4,o=g.openingProperties)},e.$$.update=()=>{e.$$.dirty&16&&n(2,l=makeOverlayPath(o))},[s,i,l,b,o,c,a,u,d,f,p,x]}class Shepherd_modal extends SvelteComponent{constructor(t){super(),init(this,t,instance,create_fragment,safe_not_equal,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const Shepherd=new Evented;class Tour extends Evented{constructor(t={}){super(t),autoBind(this);const n={exitOnEsc:!0,keyboardNavigation:!0};return this.options=Object.assign({},n,t),this.classPrefix=normalizePrefix(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map(o=>{(i=>{this.on(i,r=>{r=r||{},r.tour=this,Shepherd.trigger(i,r)})})(o)}),this._setTourID(),this}addStep(t,n){let s=t;return s instanceof Step?s.tour=this:s=new Step(this,s),isUndefined(n)?this.steps.push(s):this.steps.splice(n,0,s),s}addSteps(t){return Array.isArray(t)&&t.forEach(n=>{this.addStep(n)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}async cancel(){if(this.options.confirmCancel){const t=typeof this.options.confirmCancel=="function",n=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";(t?await this.options.confirmCancel():window.confirm(n))&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(n=>n.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return Shepherd.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const n=this.getCurrentStep();this.steps.some((s,o)=>{if(s.id===t)return s.isOpen()&&s.hide(),s.destroy(),this.steps.splice(o,1),!0}),n&&n.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t=0,n=!0){const s=isString(t)?this.getById(t):this.steps[t];s&&(this._updateStateBeforeShow(),isFunction(s.options.showOn)&&!s.options.showOn()?this._skipStep(s,n):(this.trigger("show",{step:s,previous:this.currentStep}),this.currentStep=s,s.show()))}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const n=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(s=>s.destroy()),cleanupSteps(this),this.trigger(t,{index:n}),Shepherd.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),(t==="cancel"||t==="complete")&&this.modal){const s=document.querySelector(".shepherd-modal-overlay-container");s&&s.remove()}isHTMLElement$1(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),Shepherd.activeTour=this}_setupModal(){this.modal=new Shepherd_modal({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,n){const s=this.steps.indexOf(t);if(s===this.steps.length-1)this.complete();else{const o=n?s+1:s-1;this.show(o,n)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${uuid()}`}}const isServerSide=typeof window>"u";class NoOp{constructor(){}}isServerSide?Object.assign(Shepherd,{Tour:NoOp,Step:NoOp}):Object.assign(Shepherd,{Tour,Step});/**
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/if(!Joomla)throw new Error("Joomla API is not properly initialised");function emptyStorage(){sessionStorage.removeItem("currentStepId"),sessionStorage.removeItem("stepCount"),sessionStorage.removeItem("tourId"),sessionStorage.removeItem("tourToken"),sessionStorage.removeItem("previousStepUrl"),sessionStorage.removeItem("skipTour"),sessionStorage.removeItem("autoTourId")}function fetchTourState(e,t,n){Joomla.request({url:`index.php?option=com_guidedtours&task=ajax.fetchUserState&format=json&tid=${e}&sid=${t}&context=${n}`,method:"GET",perform:!0,onSuccess:o=>{try{JSON.parse(o)}catch{return Joomla.renderMessages({error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_TOUR_INVALID_RESPONSE")]},"gt"),!1}return!0},onError:()=>(Joomla.renderMessages({error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_TOUR_ERROR_RESPONSE")]}),!1)})}function stopTour(e,t){const n=sessionStorage.getItem("tourId");let s=sessionStorage.getItem("currentStepId");s==="tourinfo"?s=1:s=Number(s)+1;let o=t;return t==="tour.cancel"&&sessionStorage.getItem("skipTour")==="true"&&(o="tour.skip"),o==="tour.cancel"||o==="tour.skip"||o==="tour.complete"?(fetchTourState(n,s,o),emptyStorage(),e.steps=[],!0):!1}function getTourInstance(){const e=new Shepherd.Tour({defaultStepOptions:{cancelIcon:{enabled:!0,label:Joomla.Text._("JCANCEL")},classes:"shepherd-theme-arrows",scrollTo:{behavior:"smooth",block:"center"}},useModalOverlay:!0,keyboardNavigation:!0});return e.on("cancel",()=>{sessionStorage.getItem("tourId")&&stopTour(e,"tour.cancel")}),e}function addProgressIndicator(e,t,n){const s=e.querySelector(".shepherd-header"),o=document.createElement("div");o.classList.add("shepherd-progress","badge","bg-secondary","px-2"),o.setAttribute("role","status");const i=document.createElement("span");i.classList.add("m-0"),i.innerText=Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_STEP_NUMBER_OF").replace("{number}",t).replace("{total}",n),o.appendChild(i),s.insertBefore(o,s.querySelector(".shepherd-title"))}function setFocus(e,t,n){e&&!e.disabled?e.focus():t&&!t.disabled?t.focus():n.focus()}function enableButton(e){const t=e instanceof Event?document.querySelector(`.step-next-button-${e.currentTarget.step_id}`):e;t.removeAttribute("disabled"),t.classList.remove("disabled")}function disableButton(e){const t=e instanceof Event?document.querySelector(`.step-next-button-${e.currentTarget.step_id}`):e;t.setAttribute("disabled","disabled"),t.classList.add("disabled")}function addStepToTourButton(e,t,n){const s=new Shepherd.Step(e,{title:t.title,text:t.description,classes:"shepherd-theme-arrows",buttons:n,id:t.id,arrow:!0,params:t.params,beforeShowPromise(){return new Promise(o=>{if(e.currentStep.options.attachTo.element){const i=e.currentStep.options.attachTo.element.split(","),r=e.currentStep.options.attachTo.on;e.currentStep.options.attachTo.element="",e.currentStep.options.attachTo.on="center";for(let l=0;l<i.length;l+=1){const c=document.querySelector(i[l]);if(c!=null&&!c.disabled&&!c.readonly&&c.style.display!=="none"){e.currentStep.options.attachTo.element=i[l],e.currentStep.options.attachTo.on=r;break}}}if(e.currentStep.options.attachTo.type==="redirect"){const i=Joomla.getOptions("system.paths").rootFull+e.currentStep.options.attachTo.url;window.location.href!==i?(sessionStorage.setItem("currentStepId",e.currentStep.id),sessionStorage.setItem("previousStepUrl",window.location.href),window.location.href=i):o()}else o()}).catch(()=>{})},when:{show(){const o=this.getElement(),i=this.getTarget();if(!i&&this.options.attachTo.element){emptyStorage(),this.cancel();return}if(o.setAttribute("aria-live","assertive"),sessionStorage.setItem("currentStepId",this.id),addProgressIndicator(o,this.id+1,sessionStorage.getItem("stepCount")),i&&this.options.attachTo.type==="interactive"){const r=o.querySelector(".shepherd-cancel-icon"),l=o.querySelector(".shepherd-button-primary"),c=o.querySelector(".shepherd-button-secondary");switch(this.options.attachTo.interactive_type){case"text":(i.hasAttribute("required")||this.options.params.required)&&(i.tagName.toLowerCase()==="input"&&["email","password","search","tel","text","url"].includes(i.type)||i.tagName.toLowerCase()==="textarea")&&((this.options.params.requiredvalue||"")!==""?i.value.trim()===this.options.params.requiredvalue?enableButton(l):disableButton(l):i.value.trim().length?enableButton(l):disableButton(l));break;case"checkbox_radio":i.tagName.toLowerCase()==="input"&&(i.hasAttribute("required")||this.options.params.required)&&["checkbox","radio"].includes(i.type)&&(i.checked?enableButton(l):disableButton(l));break;case"select":i.tagName.toLowerCase()==="select"&&(i.hasAttribute("required")||this.options.params.required)&&((this.options.params.requiredvalue||"")!==""?i.value.trim()===this.options.params.requiredvalue?enableButton(l):disableButton(l):i.value.trim().length?enableButton(l):disableButton(l));break}r.addEventListener("keydown",a=>{a.key==="Tab"&&(i.tagName.toLowerCase()==="joomla-field-fancy-select"?(i.querySelector(".choices").click(),i.querySelector(".choices input").focus()):i.parentElement.tagName.toLowerCase()==="joomla-field-fancy-select"?(i.click(),i.querySelector("input").focus()):(i.focus(),a.preventDefault()))}),i.tagName.toLowerCase()==="iframe"?i.contentWindow.document.body.addEventListener("blur",a=>{sessionStorage.getItem("tourId")&&(setTimeout(()=>{setFocus(l,c,r)},1),a.preventDefault())}):i.tagName.toLowerCase()==="joomla-field-fancy-select"?i.querySelector(".choices input").addEventListener("blur",a=>{sessionStorage.getItem("tourId")&&(setFocus(l,c,r),a.preventDefault())}):i.parentElement.tagName.toLowerCase()==="joomla-field-fancy-select"?i.querySelector("input").addEventListener("blur",a=>{sessionStorage.getItem("tourId")&&(setFocus(l,c,r),a.preventDefault())}):i.addEventListener("blur",a=>{sessionStorage.getItem("tourId")&&(setFocus(l,c,r),a.preventDefault())})}}}});if(t.target?s.updateStepOptions({attachTo:{element:t.target,on:t.position,url:t.url,type:t.type,interactive_type:t.interactive_type,params:t.params}}):s.updateStepOptions({attachTo:{url:t.url,type:t.type,interactive_type:t.interactive_type,params:t.params}}),t.type!=="next"){const o=`${Joomla.getOptions("system.paths").root}/${t.url}`;sessionStorage.getItem(o)&&sessionStorage.removeItem(o)}e.addStep(s)}function addStartButton(e,t,n){t.push({text:n,classes:"btn btn-primary shepherd-button-primary",action(){return this.next()}})}function addSkipButton(e,t){t.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_HIDE_FOREVER"),classes:"btn btn-secondary shepherd-button-secondary",action(){return sessionStorage.setItem("skipTour","true"),this.cancel()}})}function showTourInfo(e,t){const n=[];sessionStorage.getItem("autoTourId")===sessionStorage.getItem("tourId")&&addSkipButton(e,n),addStartButton(e,n,t.start_label),e.addStep({title:t.title,text:t.description,classes:"shepherd-theme-arrows",buttons:n,id:"tourinfo",when:{show(){sessionStorage.setItem("currentStepId","tourinfo"),sessionStorage.setItem("skipTour","false"),addProgressIndicator(this.getElement(),1,sessionStorage.getItem("stepCount"))}}})}function pushCompleteButton(e,t){t.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_COMPLETE"),classes:"btn btn-primary shepherd-button-primary",action(){return stopTour(e,"tour.complete"),this.complete()}})}function pushNextButton(e,t,n=!1,s=""){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_NEXT"),classes:`btn btn-primary shepherd-button-primary step-next-button-${t.id} ${s}`,action(){return this.next()},disabled:n})}function addBackButton(e,t){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_BACK"),classes:"btn btn-secondary shepherd-button-secondary",action(){if(t.type==="redirect"){sessionStorage.setItem("currentStepId",t.id-1);const n=sessionStorage.getItem("previousStepUrl");n&&(sessionStorage.removeItem("previousStepUrl"),window.location.href=n)}return this.back()}})}function startTour(e){sessionStorage.setItem("tourId",e.id),sessionStorage.setItem("stepCount",String(e.steps.length));const t=sessionStorage.getItem("currentStepId");let n=null,s=-1;t!=null&&Number(t)>-1&&(s=typeof e.steps[t]<"u"?Number(t):-1,s>0&&(n=e.steps[s-1]));const o=getTourInstance();if(s<0){const l=Joomla.getOptions("system.paths").rootFull;if(window.location.href!==l+e.steps[0].url){window.location.href=l+e.steps[0].url;return}showTourInfo(o,e.steps[0]),s=1}const i=e.steps.length;let r;for(let l=s;l<i;l+=1){if(r=[],(n===null||l>s||e.steps[l].type==="redirect")&&addBackButton(r,e.steps[l]),e&&e.steps[l].target&&e.steps[l].type==="interactive"){typeof e.steps[l].params=="string"&&e.steps[l].params!==""?e.steps[l].params=JSON.parse(e.steps[l].params):e.steps[l].params=[];const c=document.querySelector(e.steps[l].target);if(c&&e&&e.steps&&e.steps[l]&&e.steps[l].interactive_type)switch(e.steps[l].interactive_type){case"submit":c.addEventListener("click",()=>{sessionStorage.getItem("tourId")&&sessionStorage.setItem("currentStepId",e.steps[l].id+1)});break;case"text":c.step_id=l,(c.hasAttribute("required")||e.steps[l].params.required)&&(c.tagName.toLowerCase()==="input"&&["email","password","search","tel","text","url"].includes(c.type)||c.tagName.toLowerCase()==="textarea")&&["input","focus"].forEach(a=>c.addEventListener(a,u=>{sessionStorage.getItem("tourId")&&((e.steps[l].params.requiredvalue||"")!==""?u.target.value.trim()===e.steps[l].params.requiredvalue?enableButton(u):disableButton(u):u.target.value.trim().length?enableButton(u):disableButton(u))}));break;case"checkbox_radio":c.step_id=l,c.tagName.toLowerCase()==="input"&&(c.hasAttribute("required")||e.steps[l].params.required)&&["checkbox","radio"].includes(c.type)&&["click"].forEach(a=>c.addEventListener(a,u=>{u.target.checked?enableButton(u):disableButton(u)}));break;case"select":c.step_id=l,c.tagName.toLowerCase()==="select"&&(c.hasAttribute("required")||e.steps[l].params.required)&&["change"].forEach(a=>c.addEventListener(a,u=>{(e.steps[l].params.requiredvalue||"")!==""?u.target.value.trim()===e.steps[l].params.requiredvalue?enableButton(u):disableButton(u):u.target.value.trim().length?enableButton(u):disableButton(u)}));break;case"button":c.addEventListener("click",()=>{sessionStorage.setItem("currentStepId",e.steps[l].id+1),o.next()});break}}l<i-1?(e&&e.steps[l].type!=="interactive"||e&&["text","checkbox_radio","select","other"].includes(e.steps[l].interactive_type))&&pushNextButton(r,e.steps[l]):pushCompleteButton(e,r),addStepToTourButton(o,e.steps[l],r),n=e.steps[l]}o.start()}function loadTour(e){const t=Number.parseInt(e,10)>0?"":encodeURI(e),n=Number.parseInt(e,10)>0?Number.parseInt(e,10):0;if(n>0||t!==""){let s=`${Joomla.getOptions("system.paths").rootFull}administrator/index.php?option=com_ajax&plugin=guidedtours&group=system&format=json`;n>0?s+=`&id=${n}`:s+=`&uid=${t}`,fetch(s).then(o=>o.json()).then(o=>{o.success||(o.messages&&Joomla.renderMessages(o.messages),emptyStorage()),startTour(o.data)}).catch(o=>{emptyStorage();const i={error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_TOUR_ERROR")]};throw Joomla.renderMessages(i),new Error(o)})}}document.querySelector("body").addEventListener("click",e=>{if(!(!e.target||!e.target.classList.contains("button-start-guidedtour"))){if((!e.target.hasAttribute("data-id")||e.target.getAttribute("data-id")<=0)&&(!e.target.hasAttribute("data-gt-uid")||e.target.getAttribute("data-gt-uid")==="")){Joomla.renderMessages({error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_COULD_NOT_LOAD_THE_TOUR")]});return}sessionStorage.setItem("tourToken",String(Joomla.getOptions("com_guidedtours.token"))),loadTour(e.target.getAttribute("data-id")||e.target.getAttribute("data-gt-uid"))}});let tourId=sessionStorage.getItem("tourId");Joomla.getOptions("com_guidedtours.autotour","")!==""&&(sessionStorage.setItem("tourToken",String(Joomla.getOptions("com_guidedtours.token"))),sessionStorage.setItem("autoTourId",String(Joomla.getOptions("com_guidedtours.autotour"))),tourId=Joomla.getOptions("com_guidedtours.autotour")),(Number.parseInt(tourId,10)>0||tourId!=="")&&sessionStorage.getItem("tourToken")===String(Joomla.getOptions("com_guidedtours.token"))?loadTour(tourId):emptyStorage();