| Current Path : /home/u4uwebca/public_html/4uweb.design/media/plg_system_guidedtours/js/ |
| Current File : /home/u4uwebca/public_html/4uweb.design/media/plg_system_guidedtours/js/guidedtours.min.js |
var isMergeableObject=function(e){return isNonNullObject(e)&&!isSpecial(e)};function isNonNullObject(e){return!!e&&"object"==typeof e}function isSpecial(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||isReactElement(e)}var canUseSymbol="function"==typeof Symbol&&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!1!==t.clone&&t.isMergeableObject(e)?deepmerge(emptyTarget(e),e,t):e}function defaultArrayMerge(e,t,n){return e.concat(t).map((function(e){return cloneUnlessOtherwiseSpecified(e,n)}))}function getMergeFunction(e,t){if(!t.customMerge)return deepmerge;var n=t.customMerge(e);return"function"==typeof n?n:deepmerge}function getEnumerableOwnPropertySymbols(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}function getKeys(e){return Object.keys(e).concat(getEnumerableOwnPropertySymbols(e))}function propertyIsOnObject(e,t){try{return t in e}catch(e){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 o={};return n.isMergeableObject(e)&&getKeys(e).forEach((function(t){o[t]=cloneUnlessOtherwiseSpecified(e[t],n)})),getKeys(t).forEach((function(i){propertyIsUnsafe(e,i)||(propertyIsOnObject(e,i)&&n.isMergeableObject(t[i])?o[i]=getMergeFunction(i,n)(e[i],t[i],n):o[i]=cloneUnlessOtherwiseSpecified(t[i],n))})),o}function deepmerge(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||defaultArrayMerge,n.isMergeableObject=n.isMergeableObject||isMergeableObject,n.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):mergeObject(e,t,n):cloneUnlessOtherwiseSpecified(t,n)}deepmerge.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return deepmerge(e,n,t)}),{})};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"function"==typeof e}function isString(e){return"string"==typeof e}function isUndefined(e){return void 0===e}class Evented{on(e,t,n,o){return void 0===o&&(o=!1),isUndefined(this.bindings)&&(this.bindings={}),isUndefined(this.bindings[e])&&(this.bindings[e]=[]),this.bindings[e].push({handler:t,ctx:n,once:o}),this}once(e,t,n){return this.on(e,t,n,!0)}off(e,t){return isUndefined(this.bindings)||isUndefined(this.bindings[e])||(isUndefined(t)?delete this.bindings[e]:this.bindings[e].forEach(((n,o)=>{n.handler===t&&this.bindings[e].splice(o,1)}))),this}trigger(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return!isUndefined(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach(((t,o)=>{const{ctx:i,handler:s,once:r}=t,l=i||this;s.apply(l,n),r&&this.bindings[e].splice(o,1)})),this}}function autoBind(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const o=t[n],i=e[o];"constructor"!==o&&"function"==typeof i&&(e[o]=i.bind(e))}return e}function _setupAdvanceOnHandler(e,t){return n=>{if(t.isOpen()){const o=t.el&&n.currentTarget===t.el;(!isUndefined(e)&&n.currentTarget.matches(e)||o)&&t.tour.next()}}}function bindAdvance(e){const{event:t,selector:n}=e.options.advanceOn||{};if(!t)return console.error("advanceOn was defined, but no event name was passed.");{const o=_setupAdvanceOnHandler(n,e);let i;try{i=document.querySelector(n)}catch(e){}if(!isUndefined(n)&&!i)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);i?(i.addEventListener(t,o),e.on("destroy",(()=>i.removeEventListener(t,o)))):(document.body.addEventListener(t,o,!0),e.on("destroy",(()=>document.body.removeEventListener(t,o,!0))))}}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(e){}n.element||console.error(`The element for this Shepherd step was not found ${t.element}`)}return n}function shouldCenterStep(e){return null==e||(!e.element||!e.on)}function uuid(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,o,i={},s=Object.keys(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}const _excluded2=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],_excluded4=["mainAxis","crossAxis","limiter"];function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getMainAxisFromPlacement(e){return["top","bottom"].includes(getSide(e))?"x":"y"}function getLengthFromAxis(e){return"y"===e?"height":"width"}function computeCoordsFromPlacement(e,t,n){let{reference:o,floating:i}=e;const s=o.x+o.width/2-i.width/2,r=o.y+o.height/2-i.height/2,l=getMainAxisFromPlacement(t),a=getLengthFromAxis(l),c=o[a]/2-i[a]/2,u="x"===l;let d;switch(getSide(t)){case"top":d={x:s,y:o.y-i.height};break;case"bottom":d={x:s,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:r};break;case"left":d={x:o.x-i.width,y:r};break;default:d={x:o.x,y:o.y}}switch(getAlignment(t)){case"start":d[l]-=c*(n&&u?-1:1);break;case"end":d[l]+=c*(n&&u?-1:1)}return d}const computePosition$1=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),a=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=computeCoordsFromPlacement(c,o,a),p=o,h={},f=0;for(let n=0;n<l.length;n++){const{name:s,fn:m}=l[n],{x:g,y:_,data:b,reset:y}=await m({x:u,y:d,initialPlacement:o,placement:p,strategy:i,middlewareData:h,rects:c,platform:r,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=_?_:d,h=_extends({},h,{[s]:_extends({},h[s],b)}),y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:e,floating:t,strategy:i}):y.rects),({x:u,y:d}=computeCoordsFromPlacement(c,p,a))),n=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:h}};function expandPaddingObject(e){return _extends({top:0,right:0,bottom:0,left:0},e)}function getSideObjectFromPadding(e){return"number"!=typeof e?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})}async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=t,f=getSideObjectFromPadding(h),m=l[p?"floating"===d?"reference":"floating":d],g=rectToClientRect(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),_="floating"===d?_extends({},r.floating,{x:o,y:i}):r.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),y=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},x=rectToClientRect(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:b,strategy:a}):_);return{top:(g.top-x.top+f.top)/y.y,bottom:(x.bottom-g.bottom+f.bottom)/y.y,left:(g.left-x.left+f.left)/y.x,right:(x.right-g.right+f.right)/y.x}}const min$1=Math.min,max$1=Math.max;function within(e,t,n){return max$1(e,min$1(t,n))}const arrow=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:o=0}=null!=e?e:{},{x:i,y:s,placement:r,rects:l,platform:a}=t;if(null==n)return{};const c=getSideObjectFromPadding(o),u={x:i,y:s},d=getMainAxisFromPlacement(r),p=getAlignment(r),h=getLengthFromAxis(d),f=await a.getDimensions(n),m="y"===d?"top":"left",g="y"===d?"bottom":"right",_=l.reference[h]+l.reference[d]-u[d]-l.floating[h],b=u[d]-l.reference[d],y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(n));let x=y?"y"===d?y.clientHeight||0:y.clientWidth||0:0;0===x&&(x=l.floating[h]);const v=_/2-b/2,S=c[m],w=x-f[h]-c[g],$=x/2-f[h]/2+v,E=within(S,$,w),T=("start"===p?c[m]:c[g])>0&&$!==E&&l.reference[h]<=l.floating[h];return{[d]:u[d]-(T?$<S?S-$:w-$:0),data:{[d]:E,centerOffset:$-E}}}}),hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,(e=>hash$1[e]))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const o=getAlignment(e),i=getMainAxisFromPlacement(e),s=getLengthFromAxis(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=getOppositePlacement(r)),{main:r,cross:getOppositePlacement(r)}}const hash={start:"end",end:"start"};function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,(e=>hash[e]))}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}const flip=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:i,rects:s,initialPlacement:r,platform:l,elements:a}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",flipAlignment:h=!0}=e,f=_objectWithoutPropertiesLoose(e,_excluded2),m=getSide(o),g=[r,...d||(m===r||!h?[getOppositePlacement(r)]:getExpandedPlacements(r))],_=await detectOverflow(t,f),b=[];let y=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&b.push(_[m]),u){const{main:e,cross:t}=getAlignmentSides(o,s,await(null==l.isRTL?void 0:l.isRTL(a.floating)));b.push(_[e],_[t])}if(y=[...y,{placement:o,overflows:b}],!b.every((e=>e<=0))){var x,v;const e=(null!=(x=null==(v=i.flip)?void 0:v.index)?x:0)+1,t=g[e];if(t)return{data:{index:e,overflows:y},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var S;const e=null==(S=y.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0].placement;e&&(n=e);break}case"initialPlacement":n=r}if(o!==n)return{reset:{placement:n}}}return{}}}};function getCrossAxis(e){return"x"===e?"y":"x"}const shift=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=e,a=_objectWithoutPropertiesLoose(e,_excluded4),c={x:n,y:o},u=await detectOverflow(t,a),d=getMainAxisFromPlacement(getSide(i)),p=getCrossAxis(d);let h=c[d],f=c[p];if(s){const e="y"===d?"bottom":"right";h=within(h+u["y"===d?"top":"left"],h,h-u[e])}if(r){const e="y"===p?"bottom":"right";f=within(f+u["y"===p?"top":"left"],f,f-u[e])}const m=l.fn(_extends({},t,{[d]:h,[p]:f}));return _extends({},m,{data:{x:m.x-n,y:m.y-o}})}}},limitShift=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=t,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=e,u={x:n,y:o},d=getMainAxisFromPlacement(i),p=getCrossAxis(d);let h=u[d],f=u[p];const m="function"==typeof l?l(t):l,g="number"==typeof m?{mainAxis:m,crossAxis:0}:_extends({mainAxis:0,crossAxis:0},m);if(a){const e="y"===d?"height":"width",t=s.reference[d]-s.floating[e]+g.mainAxis,n=s.reference[d]+s.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var _,b,y,x;const e="y"===d?"width":"height",t=["top","left"].includes(getSide(i)),n=s.reference[p]-s.floating[e]+(t&&null!=(_=null==(b=r.offset)?void 0:b[p])?_:0)+(t?0:g.crossAxis),o=s.reference[p]+s.reference[e]+(t?0:null!=(y=null==(x=r.offset)?void 0:x[p])?y:0)-(t?g.crossAxis:0);f<n?f=n:f>o&&(f=o)}return{[d]:h,[p]:f}}}};function getWindow(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():""}let uaString;function getUAString(){if(uaString)return uaString;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(uaString=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),uaString):navigator.userAgent}function isHTMLElement(e){return e instanceof getWindow(e).HTMLElement}function isElement(e){return e instanceof getWindow(e).Element}function isNode(e){return e instanceof getWindow(e).Node}function isShadowRoot(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof getWindow(e).ShadowRoot||e instanceof ShadowRoot}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(t+o+n)&&!["inline","contents"].includes(i)}function isTableElement(e){return["table","td","th"].includes(getNodeName(e))}function isContainingBlock(e){const t=/firefox/i.test(getUAString()),n=getComputedStyle(e),o=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!o&&"none"!==o||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function isLastTraversableNode(e){return["html","body","#document"].includes(getNodeName(e))}const FALLBACK_SCALE={x:1,y:1};function getScale(e){const t=!isElement(e)&&e.contextElement?e.contextElement:isElement(e)?e:null;if(!t)return FALLBACK_SCALE;const n=t.getBoundingClientRect(),o=getComputedStyle(t);let i=n.width/parseFloat(o.width),s=n.height/parseFloat(o.height);return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}function getBoundingClientRect(e,t,n,o){var i,s,r,l;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect();let c=FALLBACK_SCALE;t&&(o?isElement(o)&&(c=getScale(o)):c=getScale(e));const u=isElement(e)?getWindow(e):window,d=!isLayoutViewport()&&n,p=(a.left+(d&&null!=(i=null==(s=u.visualViewport)?void 0:s.offsetLeft)?i:0))/c.x,h=(a.top+(d&&null!=(r=null==(l=u.visualViewport)?void 0:l.offsetTop)?r:0))/c.y,f=a.width/c.x,m=a.height/c.y;return{width:f,height:m,top:h,right:p+f,bottom:h+m,left:p,x:p,y:h}}function getDocumentElement(e){return((isNode(e)?e.ownerDocument:e.document)||window.document).documentElement}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function getWindowScrollBarX(e){return getBoundingClientRect(getDocumentElement(e)).left+getNodeScroll(e).scrollLeft}function getRectRelativeToOffsetParent(e,t,n){const o=isHTMLElement(t),i=getDocumentElement(t),s=getBoundingClientRect(e,!0,"fixed"===n,t);let r={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==getNodeName(t)||isOverflowElement(i))&&(r=getNodeScroll(t)),isHTMLElement(t)){const e=getBoundingClientRect(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=getWindowScrollBarX(i));return{x:s.left+r.scrollLeft-l.x,y:s.top+r.scrollTop-l.y,width:s.width,height:s.height}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||(isShadowRoot(e)?e.host:null)||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getTrueOffsetParent(e){return isHTMLElement(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;t=getParentNode(t)}return null}function getOffsetParent(e){const t=getWindow(e);let n=getTrueOffsetParent(e);for(;n&&isTableElement(n)&&"static"===getComputedStyle(n).position;)n=getTrueOffsetParent(n);return n&&("html"===getNodeName(n)||"body"===getNodeName(n)&&"static"===getComputedStyle(n).position&&!isContainingBlock(n))?t:n||getContainingBlock(e)||t}function getDimensions(e){if(isHTMLElement(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=getBoundingClientRect(e);return{width:t.width,height:t.height}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{rect:t,offsetParent:n,strategy:o}=e;const i=isHTMLElement(n),s=getDocumentElement(n);if(n===s)return t;let r={scrollLeft:0,scrollTop:0},l={x:1,y:1};const a={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==getNodeName(n)||isOverflowElement(s))&&(r=getNodeScroll(n)),isHTMLElement(n))){const e=getBoundingClientRect(n);l=getScale(n),a.x=e.x+n.clientLeft,a.y=e.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-r.scrollLeft*l.x+a.x,y:t.y*l.y-r.scrollTop*l.y+a.y}}function getViewportRect(e,t){const n=getWindow(e),o=getDocumentElement(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,a=0;if(i){s=i.width,r=i.height;const e=isLayoutViewport();(e||!e&&"fixed"===t)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:s,height:r,x:l,y:a}}const min=Math.min,max=Math.max;function getDocumentRect(e){var t;const n=getDocumentElement(e),o=getNodeScroll(e),i=null==(t=e.ownerDocument)?void 0:t.body,s=max(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=max(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let l=-o.scrollLeft+getWindowScrollBarX(e);const a=-o.scrollTop;return"rtl"===getComputedStyle(i||n).direction&&(l+=max(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:r,x:l,y:a}}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t){var n;void 0===t&&(t=[]);const o=getNearestOverflowAncestor(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),s=getWindow(o);return i?t.concat(s,s.visualViewport||[],isOverflowElement(o)?o:[]):t.concat(o,getOverflowAncestors(o))}function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=isHTMLElement(e)?getScale(e):{x:1,y:1},r=e.clientWidth*s.x,l=e.clientHeight*s.y,a=i*s.x,c=o*s.y;return{top:c,left:a,right:a+r,bottom:c+l,x:a,y:c,width:r,height:l}}function getClientRectFromClippingAncestor(e,t,n){return"viewport"===t?rectToClientRect(getViewportRect(e,n)):isElement(t)?getInnerBoundingClientRect(t,n):rectToClientRect(getDocumentRect(getDocumentElement(e)))}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let o=getOverflowAncestors(e).filter((e=>isElement(e)&&"body"!==getNodeName(e))),i=null;const s="fixed"===getComputedStyle(e).position;let r=s?getParentNode(e):e;for(;isElement(r)&&!isLastTraversableNode(r);){const e=getComputedStyle(r),t=isContainingBlock(r);(s?!t&&!i:!t&&"static"===e.position&&!!i&&["absolute","fixed"].includes(i.position))?o=o.filter((e=>e!==r)):i=e,r=getParentNode(r)}return t.set(e,o),o}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[..."clippingAncestors"===n?getClippingElementAncestors(t,this._c):[].concat(n),o],r=s[0],l=s.reduce(((e,n)=>{const o=getClientRectFromClippingAncestor(t,n,i);return e.top=max(o.top,e.top),e.right=min(o.right,e.right),e.bottom=min(o.bottom,e.bottom),e.left=max(o.left,e.left),e}),getClientRectFromClippingAncestor(t,r,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const platform={getClippingRect:getClippingRect,convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,isElement:isElement,getDimensions:getDimensions,getOffsetParent:getOffsetParent,getDocumentElement:getDocumentElement,getScale:getScale,async getElementRects(e){let{reference:t,floating:n,strategy:o}=e;const i=this.getOffsetParent||getOffsetParent,s=this.getDimensions;return{reference:getRectRelativeToOffsetParent(t,await i(n),o),floating:_extends({x:0,y:0},await s(n))}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===getComputedStyle(e).direction};function autoUpdate(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:l=!1}=o,a=i&&!l,c=a||s?[...isElement(e)?getOverflowAncestors(e):e.contextElement?getOverflowAncestors(e.contextElement):[],...getOverflowAncestors(t)]:[];c.forEach((e=>{a&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)}));let u,d=null;if(r){let o=!0;d=new ResizeObserver((()=>{o||n(),o=!1})),isElement(e)&&!l&&d.observe(e),isElement(e)||!e.contextElement||l||d.observe(e.contextElement),d.observe(t)}let p=l?getBoundingClientRect(e):null;return l&&function t(){const o=getBoundingClientRect(e);!p||o.x===p.x&&o.y===p.y&&o.width===p.width&&o.height===p.height||n();p=o,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{a&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,l&&cancelAnimationFrame(u)}}const computePosition=(e,t,n)=>{const o=new Map,i=_extends({platform:platform},n),s=_extends({},i.platform,{_c:o});return computePosition$1(e,t,_extends({},i,{platform:s}))};function setupTooltip(e){e.cleanup&&e.cleanup();const t=e._getResolvedAttachToOptions();let n=t.element;const o=getFloatingUIOptions(t,e),i=shouldCenterStep(t);if(i){n=document.body;e.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return e.cleanup=autoUpdate(n,e.el,(()=>{e.el?setPosition(n,e,o,i):e.cleanup()})),e.target=t.element,o}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,o){return computePosition(e,t.el,n).then(floatingUIposition(t,o)).then((e=>new Promise((t=>{setTimeout((()=>t(e)),300)})))).then((e=>{e&&e.el&&e.el.focus({preventScroll:!0})}))}function floatingUIposition(e,t){return n=>{let{x:o,y:i,placement:s,middlewareData:r}=n;return 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:`${o}px`,top:`${i}px`}),e.el.dataset.popperPlacement=s,placeArrow(e.el,r),e):e}}function placeArrow(e,t){const n=e.querySelector(".shepherd-arrow");if(n){let e,o,i,s;if(t.arrow){const{x:n,y:i}=t.arrow;e=null!=n?`${n}px`:"",o=null!=i?`${i}px`:""}Object.assign(n.style,{left:e,top:o,right:i,bottom:s})}}function getFloatingUIOptions(e,t){const n={strategy:"absolute",middleware:[]},o=addArrow(t);return shouldCenterStep(e)||(n.middleware.push(flip(),shift({limiter:limitShift(),crossAxis:!0})),o&&n.middleware.push(arrow({element:o})),n.placement=e.on),cjs(t.options.floatingUIOptions||{},n)}function addArrow(e){return!(!e.options.arrow||!e.el)&&e.el.querySelector(".shepherd-arrow")}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"function"==typeof e}function safe_not_equal(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function is_empty(e){return 0===Object.keys(e).length}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,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function attr(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function set_attributes(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const o in t)null==t[o]?e.removeAttribute(o):"style"===o?e.style.cssText=t[o]:"__value"===o?e.value=e[o]=t[o]:n[o]&&n[o].set?e[o]=t[o]:attr(e,o,t[o])}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=[],render_callbacks=[],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(){const e=current_component;do{for(;flushidx<dirty_components.length;){const e=dirty_components[flushidx];flushidx++,set_current_component(e),update(e.$$)}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let e=0;e<render_callbacks.length;e+=1){const t=render_callbacks[e];seen_callbacks.has(t)||(seen_callbacks.add(t),t())}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(null!==e.fragment){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)}}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,o){if(e&&e.o){if(outroing.has(e))return;outroing.add(e),outros.c.push((()=>{outroing.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}function get_spread_update(e,t){const n={},o={},i={$$scope:1};let s=e.length;for(;s--;){const r=e[s],l=t[s];if(l){for(const e in r)e in l||(o[e]=1);for(const e in l)i[e]||(n[e]=l[e],i[e]=1);e[s]=l}else for(const e in r)i[e]=1}for(const e in o)e in n||(n[e]=void 0);return n}function create_component(e){e&&e.c()}function mount_component(e,t,n,o){const{fragment:i,after_update:s}=e.$$;i&&i.m(t,n),o||add_render_callback((()=>{const t=e.$$.on_mount.map(run).filter(is_function);e.$$.on_destroy?e.$$.on_destroy.push(...t):run_all(t),e.$$.on_mount=[]})),s.forEach(add_render_callback)}function destroy_component(e,t){const n=e.$$;null!==n.fragment&&(run_all(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function make_dirty(e,t){-1===e.$$.dirty[0]&&(dirty_components.push(e),schedule_update(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function init(e,t,n,o,i,s,r,l){void 0===l&&(l=[-1]);const a=current_component;set_current_component(e);const c=e.$$={fragment:null,ctx:[],props:s,update:noop,not_equal:i,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:blank_object(),dirty:l,skip_bound:!1,root:t.target||a.$$.root};r&&r(c.root);let u=!1;if(c.ctx=n?n(e,t.props||{},(function(t,n){const o=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&i(c.ctx[t],c.ctx[t]=o)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](o),u&&make_dirty(e,t)),n})):[],c.update(),u=!0,run_all(c.before_update),c.fragment=!!o&&o(c.ctx),t.target){if(t.hydrate){const e=children(t.target);c.fragment&&c.fragment.l(e),e.forEach(detach)}else c.fragment&&c.fragment.c();t.intro&&transition_in(e.$$.fragment),mount_component(e,t.target,t.anchor,t.customElement),flush()}set_current_component(a)}class SvelteComponent{$destroy(){destroy_component(this,1),this.$destroy=noop}$on(e,t){if(!is_function(t))return noop;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!is_empty(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function create_fragment$8(e){let t,n,o,i,s;return{c(){t=element("button"),attr(t,"aria-label",n=e[3]?e[3]:null),attr(t,"class",o=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],attr(t,"tabindex","0")},m(n,o){insert(n,t,o),t.innerHTML=e[5],i||(s=listen(t,"click",(function(){is_function(e[0])&&e[0].apply(this,arguments)})),i=!0)},p(i,s){let[r]=s;e=i,32&r&&(t.innerHTML=e[5]),8&r&&n!==(n=e[3]?e[3]:null)&&attr(t,"aria-label",n),18&r&&o!==(o=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&attr(t,"class",o),4&r&&(t.disabled=e[2])},i:noop,o:noop,d(e){e&&detach(t),i=!1,s()}}}function instance$8(e,t,n){let o,i,s,r,l,a,{config:c,step:u}=t;function d(e){return isFunction(e)?e.call(u):e}return e.$$set=e=>{"config"in e&&n(6,c=e.config),"step"in e&&n(7,u=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,o=c.action?c.action.bind(u.tour):null),n(1,i=c.classes),n(2,s=!!c.disabled&&d(c.disabled)),n(3,r=c.label?d(c.label):null),n(4,l=c.secondary),n(5,a=c.text?d(c.text):null))},[o,i,s,r,l,a,c,u]}class Shepherd_button extends SvelteComponent{constructor(e){super(),init(this,e,instance$8,create_fragment$8,safe_not_equal,{config:6,step:7})}}function get_each_context(e,t,n){const o=e.slice();return o[2]=t[n],o}function create_if_block$3(e){let t,n,o=e[1],i=[];for(let t=0;t<o.length;t+=1)i[t]=create_each_block(get_each_context(e,o,t));const s=e=>transition_out(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=empty()},m(e,o){for(let t=0;t<i.length;t+=1)i[t].m(e,o);insert(e,t,o),n=!0},p(e,n){if(3&n){let r;for(o=e[1],r=0;r<o.length;r+=1){const s=get_each_context(e,o,r);i[r]?(i[r].p(s,n),transition_in(i[r],1)):(i[r]=create_each_block(s),i[r].c(),transition_in(i[r],1),i[r].m(t.parentNode,t))}for(group_outros(),r=o.length;r<i.length;r+=1)s(r);check_outros()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)transition_in(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)transition_out(i[e]);n=!1},d(e){destroy_each(i,e),e&&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(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};2&n&&(o.config=e[2]),1&n&&(o.step=e[0]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$7(e){let t,n,o=e[1]&&create_if_block$3(e);return{c(){t=element("footer"),o&&o.c(),attr(t,"class","shepherd-footer")},m(e,i){insert(e,t,i),o&&o.m(t,null),n=!0},p(e,n){let[i]=n;e[1]?o?(o.p(e,i),2&i&&transition_in(o,1)):(o=create_if_block$3(e),o.c(),transition_in(o,1),o.m(t,null)):o&&(group_outros(),transition_out(o,1,1,(()=>{o=null})),check_outros())},i(e){n||(transition_in(o),n=!0)},o(e){transition_out(o),n=!1},d(e){e&&detach(t),o&&o.d()}}}function instance$7(e,t,n){let o,{step:i}=t;return e.$$set=e=>{"step"in e&&n(0,i=e.step)},e.$$.update=()=>{1&e.$$.dirty&&n(1,o=i.options.buttons)},[i,o]}class Shepherd_footer extends SvelteComponent{constructor(e){super(),init(this,e,instance$7,create_fragment$7,safe_not_equal,{step:0})}}function create_fragment$6(e){let t,n,o,i,s;return{c(){t=element("button"),n=element("span"),n.textContent="×",attr(n,"aria-hidden","true"),attr(t,"aria-label",o=e[0].label?e[0].label:"Close Tour"),attr(t,"class","shepherd-cancel-icon"),attr(t,"type","button")},m(o,r){insert(o,t,r),append(t,n),i||(s=listen(t,"click",e[1]),i=!0)},p(e,n){let[i]=n;1&i&&o!==(o=e[0].label?e[0].label:"Close Tour")&&attr(t,"aria-label",o)},i:noop,o:noop,d(e){e&&detach(t),i=!1,s()}}}function instance$6(e,t,n){let{cancelIcon:o,step:i}=t;return e.$$set=e=>{"cancelIcon"in e&&n(0,o=e.cancelIcon),"step"in e&&n(2,i=e.step)},[o,e=>{e.preventDefault(),i.cancel()},i]}class Shepherd_cancel_icon extends SvelteComponent{constructor(e){super(),init(this,e,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,o){insert(n,t,o),e[3](t)},p(e,n){let[o]=n;2&o&&attr(t,"id",e[1])},i:noop,o:noop,d(n){n&&detach(t),e[3](null)}}}function instance$5(e,t,n){let{labelId:o,element:i,title:s}=t;return afterUpdate((()=>{isFunction(s)&&n(2,s=s()),n(0,i.innerHTML=s,i)})),e.$$set=e=>{"labelId"in e&&n(1,o=e.labelId),"element"in e&&n(0,i=e.element),"title"in e&&n(2,s=e.title)},[i,o,s,function(e){binding_callbacks[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Shepherd_title extends SvelteComponent{constructor(e){super(),init(this,e,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(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.labelId=e[0]),4&n&&(o.title=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}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(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};8&n&&(o.cancelIcon=e[3]),2&n&&(o.step=e[1]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$4(e){let t,n,o,i=e[2]&&create_if_block_1$1(e),s=e[3]&&e[3].enabled&&create_if_block$2(e);return{c(){t=element("header"),i&&i.c(),n=space(),s&&s.c(),attr(t,"class","shepherd-header")},m(e,r){insert(e,t,r),i&&i.m(t,null),append(t,n),s&&s.m(t,null),o=!0},p(e,o){let[r]=o;e[2]?i?(i.p(e,r),4&r&&transition_in(i,1)):(i=create_if_block_1$1(e),i.c(),transition_in(i,1),i.m(t,n)):i&&(group_outros(),transition_out(i,1,1,(()=>{i=null})),check_outros()),e[3]&&e[3].enabled?s?(s.p(e,r),8&r&&transition_in(s,1)):(s=create_if_block$2(e),s.c(),transition_in(s,1),s.m(t,null)):s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros())},i(e){o||(transition_in(i),transition_in(s),o=!0)},o(e){transition_out(i),transition_out(s),o=!1},d(e){e&&detach(t),i&&i.d(),s&&s.d()}}}function instance$4(e,t,n){let o,i,{labelId:s,step:r}=t;return e.$$set=e=>{"labelId"in e&&n(0,s=e.labelId),"step"in e&&n(1,r=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,o=r.options.title),n(3,i=r.options.cancelIcon))},[s,r,o,i]}class Shepherd_header extends SvelteComponent{constructor(e){super(),init(this,e,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,o){insert(n,t,o),e[3](t)},p(e,n){let[o]=n;2&o&&attr(t,"id",e[1])},i:noop,o:noop,d(n){n&&detach(t),e[3](null)}}}function instance$3(e,t,n){let{descriptionId:o,element:i,step:s}=t;return afterUpdate((()=>{let{text:e}=s.options;isFunction(e)&&(e=e.call(s)),isHTMLElement$1(e)?i.appendChild(e):n(0,i.innerHTML=e,i)})),e.$$set=e=>{"descriptionId"in e&&n(1,o=e.descriptionId),"element"in e&&n(0,i=e.element),"step"in e&&n(2,s=e.step)},[i,o,s,function(e){binding_callbacks[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Shepherd_text extends SvelteComponent{constructor(e){super(),init(this,e,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(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};2&n&&(o.labelId=e[1]),4&n&&(o.step=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}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(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.descriptionId=e[0]),4&n&&(o.step=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block$1(e){let t,n;return t=new Shepherd_footer({props:{step:e[2]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.step=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$2(e){let t,n,o,i,s=!isUndefined(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,r=!isUndefined(e[2].options.text),l=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,a=s&&create_if_block_2(e),c=r&&create_if_block_1(e),u=l&&create_if_block$1(e);return{c(){t=element("div"),a&&a.c(),n=space(),c&&c.c(),o=space(),u&&u.c(),attr(t,"class","shepherd-content")},m(e,s){insert(e,t,s),a&&a.m(t,null),append(t,n),c&&c.m(t,null),append(t,o),u&&u.m(t,null),i=!0},p(e,i){let[d]=i;4&d&&(s=!isUndefined(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),s?a?(a.p(e,d),4&d&&transition_in(a,1)):(a=create_if_block_2(e),a.c(),transition_in(a,1),a.m(t,n)):a&&(group_outros(),transition_out(a,1,1,(()=>{a=null})),check_outros()),4&d&&(r=!isUndefined(e[2].options.text)),r?c?(c.p(e,d),4&d&&transition_in(c,1)):(c=create_if_block_1(e),c.c(),transition_in(c,1),c.m(t,o)):c&&(group_outros(),transition_out(c,1,1,(()=>{c=null})),check_outros()),4&d&&(l=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),l?u?(u.p(e,d),4&d&&transition_in(u,1)):(u=create_if_block$1(e),u.c(),transition_in(u,1),u.m(t,null)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros())},i(e){i||(transition_in(a),transition_in(c),transition_in(u),i=!0)},o(e){transition_out(a),transition_out(c),transition_out(u),i=!1},d(e){e&&detach(t),a&&a.d(),c&&c.d(),u&&u.d()}}}function instance$2(e,t,n){let{descriptionId:o,labelId:i,step:s}=t;return e.$$set=e=>{"descriptionId"in e&&n(0,o=e.descriptionId),"labelId"in e&&n(1,i=e.labelId),"step"in e&&n(2,s=e.step)},[o,i,s]}class Shepherd_content extends SvelteComponent{constructor(e){super(),init(this,e,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(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_fragment$1(e){let t,n,o,i,s,r,l,a,c=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&create_if_block();o=new Shepherd_content({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let u=[{"aria-describedby":i=isUndefined(e[4].options.text)?null:e[2]},{"aria-labelledby":s=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],d={};for(let e=0;e<u.length;e+=1)d=assign(d,u[e]);return{c(){t=element("div"),c&&c.c(),n=space(),create_component(o.$$.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(i,s){insert(i,t,s),c&&c.m(t,null),append(t,n),mount_component(o,t,null),e[13](t),r=!0,l||(a=listen(t,"keydown",e[7]),l=!0)},p(e,l){let[a]=l;e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on?c||(c=create_if_block(),c.c(),c.m(t,n)):c&&(c.d(1),c=null);const p={};4&a&&(p.descriptionId=e[2]),8&a&&(p.labelId=e[3]),16&a&&(p.step=e[4]),o.$set(p),set_attributes(t,d=get_spread_update(u,[(!r||20&a&&i!==(i=isUndefined(e[4].options.text)?null:e[2]))&&{"aria-describedby":i},(!r||24&a&&s!==(s=e[4].options.title?e[3]:null))&&{"aria-labelledby":s},2&a&&e[1],{role:"dialog"},{tabindex:"0"}])),toggle_class(t,"shepherd-has-cancel-icon",e[5]),toggle_class(t,"shepherd-has-title",e[6]),toggle_class(t,"shepherd-element",!0)},i(e){r||(transition_in(o.$$.fragment,e),r=!0)},o(e){transition_out(o.$$.fragment,e),r=!1},d(n){n&&detach(t),c&&c.d(),destroy_component(o),e[13](null),l=!1,a()}}}const KEY_TAB=9,KEY_ESC=27,LEFT_ARROW=37,RIGHT_ARROW=39;function getClassesArray(e){return e.split(" ").filter((e=>!!e.length))}function instance$1(e,t,n){let o,i,s,{classPrefix:r,element:l,descriptionId:a,firstFocusableElement:c,focusableElements:u,labelId:d,lastFocusableElement:p,step:h,dataStepId:f}=t;onMount((()=>{n(1,f={[`data-${r}shepherd-step-id`]:h.id}),n(9,u=l.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=u[0]),n(10,p=u[u.length-1])})),afterUpdate((()=>{s!==h.options.classes&&(function(e){if(isString(e)){const t=getClassesArray(e);t.length&&l.classList.remove(...t)}}(s),s=h.options.classes,function(e){if(isString(e)){const t=getClassesArray(e);t.length&&l.classList.add(...t)}}(s))}));return e.$$set=e=>{"classPrefix"in e&&n(11,r=e.classPrefix),"element"in e&&n(0,l=e.element),"descriptionId"in e&&n(2,a=e.descriptionId),"firstFocusableElement"in e&&n(8,c=e.firstFocusableElement),"focusableElements"in e&&n(9,u=e.focusableElements),"labelId"in e&&n(3,d=e.labelId),"lastFocusableElement"in e&&n(10,p=e.lastFocusableElement),"step"in e&&n(4,h=e.step),"dataStepId"in e&&n(1,f=e.dataStepId)},e.$$.update=()=>{16&e.$$.dirty&&(n(5,o=h.options&&h.options.cancelIcon&&h.options.cancelIcon.enabled),n(6,i=h.options&&h.options.title))},[l,f,a,d,h,o,i,e=>{const{tour:t}=h;switch(e.keyCode){case KEY_TAB:if(0===u.length){e.preventDefault();break}e.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),p.focus()):document.activeElement===p&&(e.preventDefault(),c.focus());break;case KEY_ESC:t.options.exitOnEsc&&h.cancel();break;case LEFT_ARROW:t.options.keyboardNavigation&&t.back();break;case RIGHT_ARROW:t.options.keyboardNavigation&&t.next()}},c,u,p,r,()=>l,function(e){binding_callbacks[e?"unshift":"push"]((()=>{l=e,n(0,l)}))}]}class Shepherd_element extends SvelteComponent{constructor(e){super(),init(this,e,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(e,t){return void 0===t&&(t={}),super(e,t),this.tour=e,this.classPrefix=this.tour.options?normalizePrefix(this.tour.options.classPrefix):"",this.styles=e.styles,this._resolvedAttachTo=null,autoBind(this),this._setOptions(t),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 null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){return isFunction(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then((()=>this._show())):Promise.resolve(this._show())}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const e=`${this.id}-description`,t=`${this.id}-label`;return this.shepherdElementComponent=new Shepherd_element({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(e){const{element:t}=this._getResolvedAttachToOptions();isFunction(this.options.scrollToHandler)?this.options.scrollToHandler(t):isElement$1(t)&&"function"==typeof t.scrollIntoView&&t.scrollIntoView(e)}_getClassOptions(e){const t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:"",o=t&&t.classes?t.classes:"",i=[...n.split(" "),...o.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(e){void 0===e&&(e={});let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=cjs({},t||{}),this.options=Object.assign({arrow:!0},t,e,mergeTooltipConfig(t,e));const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||`step-${uuid()}`,n&&Object.keys(n).forEach((e=>{this.on(e,n[e],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 e=this.shepherdElementComponent.getElement(),t=this.target||document.body;t.classList.add(`${this.classPrefix}shepherd-enabled`),t.classList.add(`${this.classPrefix}shepherd-target`),e.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(e){const t=e.target;t&&(e.options.highlightClass&&t.classList.add(e.options.highlightClass),t.classList.remove("shepherd-target-click-disabled"),!1===e.options.canClickTarget&&t.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const e=this.target||document.body;this.options.highlightClass&&e.classList.remove(this.options.highlightClass),e.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((e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&e.target instanceof HTMLElement&&e.target.classList.remove("shepherd-target-click-disabled")}))}}function makeOverlayPath(e){let{width:t,height:n,x:o=0,y:i=0,r:s=0}=e;const{innerWidth:r,innerHeight:l}=window,{topLeft:a=0,topRight:c=0,bottomRight:u=0,bottomLeft:d=0}="number"==typeof s?{topLeft:s,topRight:s,bottomRight:s,bottomLeft:s}:s;return`M${r},${l}H0V0H${r}V${l}ZM${o+a},${i}a${a},${a},0,0,0-${a},${a}V${n+i-d}a${d},${d},0,0,0,${d},${d}H${t+o-u}a${u},${u},0,0,0,${u}-${u}V${i+c}a${c},${c},0,0,0-${c}-${c}Z`}function create_fragment(e){let t,n,o,i,s;return{c(){t=svg_element("svg"),n=svg_element("path"),attr(n,"d",e[2]),attr(t,"class",o=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(o,r){insert(o,t,r),append(t,n),e[11](t),i||(s=listen(t,"touchmove",e[3]),i=!0)},p(e,i){let[s]=i;4&s&&attr(n,"d",e[2]),2&s&&o!==(o=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&attr(t,"class",o)},i:noop,o:noop,d(n){n&&detach(t),e[11](null),i=!1,s()}}}function _getScrollParent(e){if(!e)return null;const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==t&&"visible"!==t&&e.scrollHeight>=e.clientHeight?e:_getScrollParent(e.parentElement)}function _getVisibleHeight(e,t){const n=e.getBoundingClientRect();let o=n.y||n.top,i=n.bottom||o+n.height;if(t){const e=t.getBoundingClientRect(),n=e.y||e.top,s=e.bottom||n+e.height;o=Math.max(o,n),i=Math.min(i,s)}return{y:o,height:Math.max(i-o,0)}}function instance(e,t,n){let{element:o,openingProperties:i}=t;uuid();let s,r,l=!1;a();function a(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,l=!1),h()}function u(e,t,o,s){if(void 0===e&&(e=0),void 0===t&&(t=0),s){const{y:r,height:l}=_getVisibleHeight(s,o),{x:a,width:c,left:u}=s.getBoundingClientRect();n(4,i={width:c+2*e,height:l+2*e,x:(a||u)-e,y:r-e,r:t})}else a()}function d(){n(1,l=!0)}const p=e=>{e.preventDefault()};function h(){s&&(cancelAnimationFrame(s),s=void 0),window.removeEventListener("touchmove",p,{passive:!1})}return e.$$set=e=>{"element"in e&&n(0,o=e.element),"openingProperties"in e&&n(4,i=e.openingProperties)},e.$$.update=()=>{16&e.$$.dirty&&n(2,r=makeOverlayPath(i))},[o,l,r,e=>{e.stopPropagation()},i,()=>o,a,c,u,function(e){h(),e.tour.options.useModalOverlay?(!function(e){const{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n}=e.options,o=_getScrollParent(e.target),i=()=>{s=void 0,u(t,n,o,e.target),s=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",p,{passive:!1})}(e),d()):c()},d,function(e){binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(0,o)}))}]}class Shepherd_modal extends SvelteComponent{constructor(e){super(),init(this,e,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(e){void 0===e&&(e={}),super(e),autoBind(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=normalizePrefix(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map((e=>{(e=>{this.on(e,(t=>{(t=t||{}).tour=this,Shepherd.trigger(e,t)}))})(e)})),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof Step?n.tour=this:n=new Step(this,n),isUndefined(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach((e=>{this.addStep(e)})),this}back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}cancel(){if(this.options.confirmCancel){const e=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(e)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find((t=>t.id===e))}getCurrentStep(){return this.currentStep}hide(){const e=this.getCurrentStep();if(e)return e.hide()}isActive(){return Shepherd.activeTour===this}next(){const e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){const t=this.getCurrentStep();this.steps.some(((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0})),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e,t){void 0===e&&(e=0),void 0===t&&(t=!0);const n=isString(e)?this.getById(e):this.steps[e];if(n){this._updateStateBeforeShow();isFunction(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(e){const t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach((e=>e.destroy())),cleanupSteps(this),this.trigger(e,{index:t}),Shepherd.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){const e=document.querySelector(".shepherd-modal-overlay-container");e&&e.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(e,t){const n=this.steps.indexOf(e);if(n===this.steps.length-1)this.complete();else{const e=t?n+1:n-1;this.show(e,t)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const e=this.options.tourName||"tour";this.id=`${e}--${uuid()}`}}const isServerSide="undefined"==typeof window;class NoOp{constructor(){}}if(isServerSide?Object.assign(Shepherd,{Tour:NoOp,Step:NoOp}):Object.assign(Shepherd,{Tour:Tour,Step:Step}),!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")}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",(()=>{emptyStorage(),e.steps=[]})),e}function addProgressIndicator(e,t,n){const o=e.querySelector(".shepherd-header"),i=document.createElement("div");i.classList.add("shepherd-progress"),i.setAttribute("role","status"),i.setAttribute("aria-label",Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_STEP_NUMBER_OF").replace("{number}",t).replace("{total}",n));const s=document.createElement("span");s.setAttribute("aria-hidden",!0),s.innerText=`${t}/${n}`,i.appendChild(s),o.insertBefore(i,e.querySelector(".shepherd-cancel-icon"))}function setFocus(e,t,n){e&&!e.disabled?e.focus():t&&!t.disabled?t.focus():n.focus()}function addStepToTourButton(e,t,n){const o=new Shepherd.Step(e,{title:t.title,text:t.description,classes:"shepherd-theme-arrows",buttons:n,id:t.id,arrow:!0,beforeShowPromise:()=>new Promise((t=>{if(e.currentStep.options.attachTo.element){const t=e.currentStep.options.attachTo.element.split(","),n=e.currentStep.options.attachTo.on;e.currentStep.options.attachTo.element="",e.currentStep.options.attachTo.on="center";for(let o=0;o<t.length;o+=1){const i=document.querySelector(t[o]);if(null!=i&&!i.disabled&&!i.readonly&&"none"!==i.style.display){e.currentStep.options.attachTo.element=t[o],e.currentStep.options.attachTo.on=n;break}}}if("redirect"===e.currentStep.options.attachTo.type){const n=Joomla.getOptions("system.paths").rootFull+e.currentStep.options.attachTo.url;window.location.href!==n?(sessionStorage.setItem("currentStepId",e.currentStep.id),sessionStorage.setItem("previousStepUrl",window.location.href),window.location.href=n):t()}else t()})).catch((()=>{})),when:{show(){const e=this.getElement(),t=this.getTarget();if(e.setAttribute("aria-live","assertive"),sessionStorage.setItem("currentStepId",this.id),addProgressIndicator(e,this.id+1,sessionStorage.getItem("stepCount")),t&&"interactive"===this.options.attachTo.type){const n=e.querySelector(".shepherd-cancel-icon"),o=e.querySelector(".shepherd-button-primary"),i=e.querySelector(".shepherd-button-secondary");"input"===t.tagName.toLowerCase()&&t.hasAttribute("required")&&["email","password","search","tel","text","url"].includes(t.type)&&(t.value.trim().length?(o.removeAttribute("disabled"),o.classList.remove("disabled")):(o.setAttribute("disabled","disabled"),o.classList.add("disabled"))),n.addEventListener("keydown",(e=>{"Tab"===e.key&&("joomla-field-fancy-select"===t.tagName.toLowerCase()?(t.querySelector(".choices").click(),t.querySelector(".choices input").focus()):"joomla-field-fancy-select"===t.parentElement.tagName.toLowerCase()?(t.click(),t.querySelector("input").focus()):(t.focus(),e.preventDefault()))})),"iframe"===t.tagName.toLowerCase()?t.contentWindow.document.body.addEventListener("blur",(e=>{setTimeout((()=>{setFocus(o,i,n)}),1),e.preventDefault()})):"joomla-field-fancy-select"===t.tagName.toLowerCase()?t.querySelector(".choices input").addEventListener("blur",(e=>{setFocus(o,i,n),e.preventDefault()})):"joomla-field-fancy-select"===t.parentElement.tagName.toLowerCase()?t.querySelector("input").addEventListener("blur",(e=>{setFocus(o,i,n),e.preventDefault()})):t.addEventListener("blur",(e=>{setFocus(o,i,n),e.preventDefault()}))}}}});if(t.target?o.updateStepOptions({attachTo:{element:t.target,on:t.position,url:t.url,type:t.type,interactive_type:t.interactive_type}}):o.updateStepOptions({attachTo:{url:t.url,type:t.type,interactive_type:t.interactive_type}}),"next"!==t.type){const e=`${Joomla.getOptions("system.paths").root}/${t.url}`;sessionStorage.getItem(e)&&sessionStorage.removeItem(e)}e.addStep(o)}function showTourInfo(e,t){e.addStep({title:t.title,text:t.description,classes:"shepherd-theme-arrows",buttons:[{classes:"btn btn-primary shepherd-button-primary",action(){return this.next()},text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_START")}],id:"tourinfo",when:{show(){sessionStorage.setItem("currentStepId","tourinfo"),addProgressIndicator(this.getElement(),1,sessionStorage.getItem("stepCount"))}}})}function pushCompleteButton(e){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_COMPLETE"),classes:"btn btn-primary shepherd-button-primary",action(){return this.cancel()}})}function pushNextButton(e,t,n=!1,o=""){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_NEXT"),classes:`btn btn-primary shepherd-button-primary step-next-button-${t.id} ${o}`,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("redirect"===t.type){sessionStorage.setItem("currentStepId",t.id-1);const e=sessionStorage.getItem("previousStepUrl");e&&(sessionStorage.removeItem("previousStepUrl"),window.location.href=e)}return this.back()}})}function enableButton(e){const t=document.querySelector(`.step-next-button-${e.currentTarget.step_id}`);t.removeAttribute("disabled"),t.classList.remove("disabled")}function disableButton(e){const t=document.querySelector(`.step-next-button-${e.currentTarget.step_id}`);t.setAttribute("disabled","disabled"),t.classList.add("disabled")}function startTour(e){sessionStorage.setItem("tourId",e.id),sessionStorage.setItem("stepCount",String(e.steps.length));const t=sessionStorage.getItem("currentStepId");let n=null,o=-1;null!=t&&Number(t)>-1&&(o=void 0!==e.steps[t]?Number(t):-1,o>0&&(n=e.steps[o-1]));const i=getTourInstance();if(o<0){const t=Joomla.getOptions("system.paths").rootFull;if(window.location.href!==t+e.steps[0].url)return void(window.location.href=t+e.steps[0].url);showTourInfo(i,e.steps[0]),o=1}const s=e.steps.length;let r;for(let t=o;t<s;t+=1){if(r=[],(null===n||t>o||"redirect"===e.steps[t].type)&&addBackButton(r,e.steps[t]),e&&e.steps[t].target&&"interactive"===e.steps[t].type){const n=document.querySelector(e.steps[t].target);if(n&&e&&e.steps&&e.steps[t]&&e.steps[t].interactive_type)switch(e.steps[t].interactive_type){case"submit":n.addEventListener("click",(()=>{sessionStorage.setItem("currentStepId",e.steps[t].id+1)}));break;case"text":n.step_id=t,n.hasAttribute("required")&&["email","password","search","tel","text","url"].includes(n.type)&&["input","focus"].forEach((e=>n.addEventListener(e,(e=>{e.target.value.trim().length?enableButton(e):disableButton(e)}))));break;case"button":i.next()}}t<s-1?(e&&"interactive"!==e.steps[t].type||e&&"text"===e.steps[t].interactive_type||e&&"other"===e.steps[t].interactive_type)&&pushNextButton(r,e.steps[t]):pushCompleteButton(r),addStepToTourButton(i,e.steps[t],r),n=e.steps[t]}i.start()}function loadTour(e){if(e>0){const t=`${Joomla.getOptions("system.paths").rootFull}administrator/index.php?option=com_ajax&plugin=guidedtours&group=system&format=json&id=${e}`;fetch(t).then((e=>e.json())).then((e=>{e.success||(e.messages&&Joomla.renderMessages(e.messages),emptyStorage()),startTour(e.data)})).catch((e=>{emptyStorage();const t={error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_TOUR_ERROR")]};throw Joomla.renderMessages(t),new Error(e)}))}}document.querySelector("body").addEventListener("click",(e=>{e.target&&e.target.classList.contains("button-start-guidedtour")&&(void 0===e.target.getAttribute("data-id")||e.target.getAttribute("data-id")<=0?Joomla.renderMessages({error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_COULD_NOT_LOAD_THE_TOUR")]}):(sessionStorage.setItem("tourToken",String(Joomla.getOptions("com_guidedtours.token"))),loadTour(e.target.getAttribute("data-id"))))}));const tourId=sessionStorage.getItem("tourId");tourId>0&&sessionStorage.getItem("tourToken")===String(Joomla.getOptions("com_guidedtours.token"))?loadTour(tourId):emptyStorage();