File "starter-tours.js"

Full Path: /home/romayxjt/public_html/wp-content/plugins/kadence-starter-templates/dist/starter-tours.js
File size: 57.9 KB
MIME-type: text/plain
Charset: utf-8

(()=>{"use strict";const t=window.React,e=window.wp.element,n=(window.wp.i18n,window.wp.notices,window.wp.data);window.wp.components;var o,r={exports:{}},i={};r.exports=function(){if(o)return i;o=1;var e=t,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(t,e,o){var r,i={},a=null,u=null;for(r in void 0!==o&&(a=""+o),void 0!==e.key&&(a=""+e.key),void 0!==e.ref&&(u=e.ref),e)s.call(e,r)&&!c.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===i[r]&&(i[r]=e[r]);return{$$typeof:n,type:t,key:a,ref:u,props:i,_owner:l.current}}return i.Fragment=r,i.jsx=a,i.jsxs=a,i}();var s=r.exports;function l(t){return t instanceof HTMLElement}function c(t){return"function"==typeof t}function a(t){return"string"==typeof t}function u(t){return void 0===t}class d{on(t,e,n,o=!1){var r;return u(this.bindings)&&(this.bindings={}),u(this.bindings[t])&&(this.bindings[t]=[]),null==(r=this.bindings[t])||r.push({handler:e,ctx:n,once:o}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return u(this.bindings)||u(this.bindings[t])||(u(e)?delete this.bindings[t]:null==(n=this.bindings[t])||n.forEach(((n,o)=>{var r;n.handler===e&&(null==(r=this.bindings[t])||r.splice(o,1))}))),this;var n}trigger(t,...e){var n;return!u(this.bindings)&&this.bindings[t]&&(null==(n=this.bindings[t])||n.forEach(((n,o)=>{const{ctx:r,handler:i,once:s}=n,l=r||this;var c;i.apply(l,e),s&&(null==(c=this.bindings[t])||c.splice(o,1))}))),this}}function f(){return f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},f.apply(null,arguments)}function p(t,e){if(null==t)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.includes(o))continue;n[o]=t[o]}return n}const h={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function m(t,e){return e}function g(t,e){return t.filter((t=>void 0!==t))}var y,v;function b(t){return"object"!=typeof t||null===t?0:Array.isArray(t)?2:function(t){if(!$.has(Object.prototype.toString.call(t)))return!1;const{constructor:e}=t;if(void 0===e)return!0;const n=e.prototype;return!(null===n||"object"!=typeof n||!$.has(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}(t)?1:t instanceof Set?3:t instanceof Map?4:5}function w(t,e){return"object"==typeof t&&Object.prototype.propertyIsEnumerable.call(t,e)}function x(t){return{*[Symbol.iterator](){for(const e of t)for(const t of e)yield t}}}(v=y||(y={}))[v.NOT=0]="NOT",v[v.RECORD=1]="RECORD",v[v.ARRAY=2]="ARRAY",v[v.SET=3]="SET",v[v.MAP=4]="MAP",v[v.OTHER=5]="OTHER";const $=new Set(["[object Object]","[object Module]"]),E={mergeRecords:function(t,e,n){const o={};for(const r of function(t){const e=new Set;for(const n of t)for(const t of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])e.add(t);return e}(t)){const i=[];for(const e of t)w(e,r)&&i.push(e[r]);if(0===i.length)continue;const s=e.metaDataUpdater(n,{key:r,parents:t}),l=O(i,e,s);l!==h.skip&&("__proto__"===r?Object.defineProperty(o,r,{value:l,configurable:!0,enumerable:!0,writable:!0}):o[r]=l)}return o},mergeArrays:function(t){return t.flat()},mergeSets:function(t){return new Set(x(t))},mergeMaps:function(t){return new Map(x(t))},mergeOthers:function(t){return t.at(-1)}};function S(...t){return function(){const t=function(t,e){var n,o,r;return{defaultMergeFunctions:E,mergeFunctions:f({},E,Object.fromEntries(Object.entries(t).filter((([t,e])=>Object.hasOwn(E,t))).map((([t,e])=>!1===e?[t,E.mergeOthers]:[t,e])))),metaDataUpdater:null!=(n=t.metaDataUpdater)?n:m,deepmerge:e,useImplicitDefaultMerging:null!=(o=t.enableImplicitDefaultMerging)&&o,filterValues:!1===t.filterValues?void 0:null!=(r=t.filterValues)?r:g,actions:h}}({},e);function e(...e){return O(e,t,undefined)}return e}()(...t)}function O(t,e,n){var o;const r=null!=(o=null==e.filterValues?void 0:e.filterValues(t,n))?o:t;if(0===r.length)return;if(1===r.length)return T(r,e,n);const i=b(r[0]);if(0!==i&&5!==i)for(let t=1;t<r.length;t++)if(b(r[t])!==i)return T(r,e,n);switch(i){case 1:return function(t,e,n){const o=e.mergeFunctions.mergeRecords(t,e,n);return o===h.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,n):o}(r,e,n);case 2:return function(t,e,n){const o=e.mergeFunctions.mergeArrays(t,e,n);return o===h.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):o}(r,e,n);case 3:return function(t,e,n){const o=e.mergeFunctions.mergeSets(t,e,n);return o===h.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):o}(r,e,n);case 4:return function(t,e,n){const o=e.mergeFunctions.mergeMaps(t,e,n);return o===h.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):o}(r,e,n);default:return T(r,e,n)}}function T(t,e,n){const o=e.mergeFunctions.mergeOthers(t,e,n);return o===h.defaultMerge||e.useImplicitDefaultMerging&&void 0===o&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):o}function _(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const o=e[n],r=t[o];"constructor"!==o&&"function"==typeof r&&(t[o]=r.bind(t))}return t}function k(t){return a(t)&&""!==t?"-"!==t.charAt(t.length-1)?`${t}-`:t:""}function A(t){return null==t||!t.element||!t.on}function L(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}const P=["start","end"],I=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+P[0],e+"-"+P[1])),[]),R=Math.min,M=Math.max,C=Math.round,D=Math.floor,F=t=>({x:t,y:t}),H={left:"right",right:"left",bottom:"top",top:"bottom"},q={start:"end",end:"start"};function j(t,e,n){return M(t,R(e,n))}function B(t,e){return"function"==typeof t?t(e):t}function N(t){return t.split("-")[0]}function V(t){return t.split("-")[1]}function W(t){return"x"===t?"y":"x"}function U(t){return"y"===t?"height":"width"}function z(t){return["top","bottom"].includes(N(t))?"y":"x"}function Y(t){return W(z(t))}function X(t,e,n){void 0===n&&(n=!1);const o=V(t),r=Y(t),i=U(r);let s="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=J(s)),[s,J(s)]}function Z(t){return t.replace(/start|end/g,(t=>q[t]))}function J(t){return t.replace(/left|right|bottom|top/g,(t=>H[t]))}function K(t){return"number"!=typeof t?function(t){return f({top:0,right:0,bottom:0,left:0},t)}(t):{top:t,right:t,bottom:t,left:t}}function G(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}const Q=["crossAxis","alignment","allowedPlacements","autoAlignment"],tt=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],et=["mainAxis","crossAxis","limiter"];function nt(t,e,n){let{reference:o,floating:r}=t;const i=z(e),s=Y(e),l=U(s),c=N(e),a="y"===i,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let p;switch(c){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(V(e)){case"start":p[s]-=f*(n&&a?-1:1);break;case"end":p[s]+=f*(n&&a?-1:1)}return p}async function ot(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=B(e,t),h=K(p),m=l[f?"floating"===d?"reference":"floating":d],g=G(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),y="floating"===d?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=G(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:c}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function rt(t){return lt(t)?(t.nodeName||"").toLowerCase():"#document"}function it(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function st(t){var e;return null==(e=(lt(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function lt(t){return t instanceof Node||t instanceof it(t).Node}function ct(t){return t instanceof Element||t instanceof it(t).Element}function at(t){return t instanceof HTMLElement||t instanceof it(t).HTMLElement}function ut(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof it(t).ShadowRoot)}function dt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=yt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function ft(t){return["table","td","th"].includes(rt(t))}function pt(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch{return!1}}))}function ht(t){const e=mt(),n=ct(t)?yt(t):t;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function mt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function gt(t){return["html","body","#document"].includes(rt(t))}function yt(t){return it(t).getComputedStyle(t)}function vt(t){return ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bt(t){if("html"===rt(t))return t;const e=t.assignedSlot||t.parentNode||ut(t)&&t.host||st(t);return ut(e)?e.host:e}function wt(t){const e=bt(t);return gt(e)?t.ownerDocument?t.ownerDocument.body:t.body:at(e)&&dt(e)?e:wt(e)}function xt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=wt(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),s=it(r);return i?e.concat(s,s.visualViewport||[],dt(r)?r:[],s.frameElement&&n?xt(s.frameElement):[]):e.concat(r,xt(r,[],n))}function $t(t){const e=yt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=at(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,l=C(n)!==i||C(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Et(t){return ct(t)?t:t.contextElement}function St(t){const e=Et(t);if(!at(e))return F(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=$t(e);let s=(i?C(n.width):n.width)/o,l=(i?C(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ot=F(0);function Tt(t){const e=it(t);return mt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ot}function _t(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=Et(t);let s=F(1);e&&(o?ct(o)&&(s=St(o)):s=St(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==it(t))&&e}(i,n,o)?Tt(i):F(0);let c=(r.left+l.x)/s.x,a=(r.top+l.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const t=it(i),e=o&&ct(o)?it(o):o;let n=t,r=n.frameElement;for(;r&&o&&e!==n;){const t=St(r),e=r.getBoundingClientRect(),o=yt(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,a*=t.y,u*=t.x,d*=t.y,c+=i,a+=s,n=it(r),r=n.frameElement}}return G({width:u,height:d,x:c,y:a})}function kt(t){return _t(st(t)).left+vt(t).scrollLeft}function At(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=it(t),o=st(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(r){i=r.width,s=r.height;const t=mt();(!t||t&&"fixed"===e)&&(l=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:l,y:c}}(t,n);else if("document"===e)o=function(t){const e=st(t),n=vt(t),o=t.ownerDocument.body,r=M(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=M(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+kt(t);const l=-n.scrollTop;return"rtl"===yt(o).direction&&(s+=M(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}(st(t));else if(ct(e))o=function(t,e){const n=_t(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=at(t)?St(t):F(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=Tt(t);o=f({},e,{x:e.x-n.x,y:e.y-n.y})}return G(o)}function Lt(t,e){const n=bt(t);return!(n===e||!ct(n)||gt(n))&&("fixed"===yt(n).position||Lt(n,e))}function Pt(t,e){const n=e.get(t);if(n)return n;let o=xt(t,[],!1).filter((t=>ct(t)&&"body"!==rt(t))),r=null;const i="fixed"===yt(t).position;let s=i?bt(t):t;for(;ct(s)&&!gt(s);){const e=yt(s),n=ht(s);!n&&"fixed"===e.position&&(r=null),(i?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||dt(s)&&!n&&Lt(t,s))?o=o.filter((t=>t!==s)):r=e,s=bt(s)}return e.set(t,o),o}function It(t,e,n){const o=at(e),r=st(e),i="fixed"===n,s=_t(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=F(0);if(o||!o&&!i)if(("body"!==rt(e)||dt(r))&&(l=vt(e)),o){const t=_t(e,!0,i,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else r&&(c.x=kt(r));return{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Rt(t){return"static"===yt(t).position}function Mt(t,e){return at(t)&&"fixed"!==yt(t).position?e?e(t):t.offsetParent:null}function Ct(t,e){const n=it(t);if(pt(t))return n;if(!at(t)){let e=bt(t);for(;e&&!gt(e);){if(ct(e)&&!Rt(e))return e;e=bt(e)}return n}let o=Mt(t,e);for(;o&&ft(o)&&Rt(o);)o=Mt(o,e);return o&&gt(o)&&Rt(o)&&!ht(o)?n:o||function(t){let e=bt(t);for(;at(e)&&!gt(e);){if(ht(e))return e;if(pt(e))return null;e=bt(e)}return null}(t)||n}const Dt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i="fixed"===r,s=st(o),l=!!e&&pt(e.floating);if(o===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},a=F(1);const u=F(0),d=at(o);if((d||!d&&!i)&&(("body"!==rt(o)||dt(s))&&(c=vt(o)),at(o))){const t=_t(o);a=St(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x,y:n.y*a.y-c.scrollTop*a.y+u.y}},getDocumentElement:st,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===n?pt(e)?[]:Pt(e,this._c):[].concat(n),o],s=i[0],l=i.reduce(((t,n)=>{const o=At(e,n,r);return t.top=M(o.top,t.top),t.right=R(o.right,t.right),t.bottom=R(o.bottom,t.bottom),t.left=M(o.left,t.left),t}),At(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Ct,getElementRects:async function(t){const e=this.getOffsetParent||Ct,n=this.getDimensions,o=await n(t.floating);return{reference:It(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=$t(t);return{width:e,height:n}},getScale:St,isElement:ct,isRTL:function(t){return"rtl"===yt(t).direction}};const Ft=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=e,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=B(t,e),u={x:n,y:o},d=z(r),p=W(d);let h=u[p],m=u[d];const g=B(l,e),y="number"==typeof g?{mainAxis:g,crossAxis:0}:f({mainAxis:0,crossAxis:0},g);if(c){const t="y"===p?"height":"width",e=i.reference[p]-i.floating[t]+y.mainAxis,n=i.reference[p]+i.reference[t]-y.mainAxis;h<e?h=e:h>n&&(h=n)}if(a){var v,b;const t="y"===p?"width":"height",e=["top","left"].includes(N(r)),n=i.reference[d]-i.floating[t]+(e&&(null==(v=s.offset)?void 0:v[d])||0)+(e?0:y.crossAxis),o=i.reference[d]+i.reference[t]+(e?0:(null==(b=s.offset)?void 0:b[d])||0)-(e?y.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[p]:h,[d]:m}}}};function Ht(t){t.cleanup&&t.cleanup();const e=t._getResolvedAttachToOptions();let n=e.element;const o=function(t,e){var n,o,r;const i={strategy:"absolute",middleware:[]},s=function(t){return!(!t.options.arrow||!t.el)&&t.el.querySelector(".shepherd-arrow")}(e),l=A(t),c=null==(n=t.on)?void 0:n.includes("auto"),a=(null==t||null==(o=t.on)?void 0:o.includes("-start"))||(null==t||null==(r=t.on)?void 0:r.includes("-end"));var u;l||(c?i.middleware.push(function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,r;const{rects:i,middlewareData:s,placement:l,platform:c,elements:a}=e,u=B(t,e),{crossAxis:d=!1,alignment:f,allowedPlacements:h=I,autoAlignment:m=!0}=u,g=p(u,Q),y=void 0!==f||h===I?function(t,e,n){return(t?[...n.filter((e=>V(e)===t)),...n.filter((e=>V(e)!==t))]:n.filter((t=>N(t)===t))).filter((n=>!t||V(n)===t||!!e&&Z(n)!==n))}(f||null,m,h):h,v=await ot(e,g),b=(null==(n=s.autoPlacement)?void 0:n.index)||0,w=y[b];if(null==w)return{};const x=X(w,i,await(null==c.isRTL?void 0:c.isRTL(a.floating)));if(l!==w)return{reset:{placement:y[0]}};const $=[v[N(w)],v[x[0]],v[x[1]]],E=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:w,overflows:$}],S=y[b+1];if(S)return{data:{index:b+1,overflows:E},reset:{placement:S}};const O=E.map((t=>{const e=V(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),T=(null==(r=O.filter((t=>t[2].slice(0,V(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||O[0][0];return T!==l?{data:{index:b+1,overflows:E},reset:{placement:T}}:{}}}}({crossAxis:!0,alignment:a?null==t||null==(u=t.on)?void 0:u.split("-").pop():null})):i.middleware.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:a}=e,u=B(t,e),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0}=u,v=p(u,tt);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const b=N(r),w=z(l),x=N(l)===l,$=await(null==c.isRTL?void 0:c.isRTL(a.floating)),E=h||(x||!y?[J(l)]:function(t){const e=J(t);return[Z(t),e,Z(e)]}(l)),S="none"!==g;!h&&S&&E.push(...function(t,e,n,o){const r=V(t);let i=function(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}(N(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(Z)))),i}(l,y,g,$));const O=[l,...E],T=await ot(e,v),_=[];let k=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&_.push(T[b]),f){const t=X(r,s,$);_.push(T[t[0]],T[t[1]])}if(k=[...k,{placement:r,overflows:_}],!_.every((t=>t<=0))){var A,L;const t=((null==(A=i.flip)?void 0:A.index)||0)+1,e=O[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let n=null==(L=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:L.placement;if(!n)switch(m){case"bestFit":{var P;const t=null==(P=k.filter((t=>{if(S){const e=z(t.placement);return e===w||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:P[0];t&&(n=t);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}}()),i.middleware.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,i=B(t,e),{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}}}=i,a=p(i,et),u={x:n,y:o},d=await ot(e,a),h=z(N(r)),m=W(h);let g=u[m],y=u[h];if(s){const t="y"===m?"bottom":"right";g=j(g+d["y"===m?"top":"left"],g,g-d[t])}if(l){const t="y"===h?"bottom":"right";y=j(y+d["y"===h?"top":"left"],y,y-d[t])}const v=c.fn(f({},e,{[m]:g,[h]:y}));return f({},v,{data:{x:v.x-n,y:v.y-o}})}}}({limiter:Ft(),crossAxis:!0})),s&&i.middleware.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:u=0}=B(t,e)||{};if(null==a)return{};const d=K(u),p={x:n,y:o},h=Y(r),m=U(h),g=await s.getDimensions(a),y="y"===h,v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[h]-p[h]-i.floating[m],$=p[h]-i.reference[h],E=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a));let S=E?E[w]:0;(!S||!await(null==s.isElement?void 0:s.isElement(E)))&&(S=l.floating[w]||i.floating[m]);const O=x/2-$/2,T=S/2-g[m]/2-1,_=R(d[v],T),k=R(d[b],T),A=_,L=S-g[m]-k,P=S/2-g[m]/2+O,I=j(A,P,L),M=!c.arrow&&null!=V(r)&&P!==I&&i.reference[m]/2-(P<A?_:k)-g[m]/2<0,C=M?P<A?P-A:P-L:0;return{[h]:p[h]+C,data:f({[h]:I,centerOffset:P-I-C},M&&{alignmentOffset:C}),reset:M}}}))({element:s,padding:a?4:0})),c||(i.placement=t.on));return S(i,e.options.floatingUIOptions||{})}(e,t),r=A(e);return r&&(n=document.body,t.shepherdElementComponent.getElement().classList.add("shepherd-centered")),t.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,a=Et(t),u=r||i?[...a?xt(a):[],...xt(e)]:[];u.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)}));const d=a&&l?function(t,e){let n,o=null;const r=st(t);function i(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function s(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const{left:a,top:u,width:d,height:p}=t.getBoundingClientRect();if(l||e(),!d||!p)return;const h={rootMargin:-D(u)+"px "+-D(r.clientWidth-(a+d))+"px "+-D(r.clientHeight-(u+p))+"px "+-D(a)+"px",threshold:M(0,R(1,c))||1};let m=!0;function g(t){const e=t[0].intersectionRatio;if(e!==c){if(!m)return s();e?s(!1,e):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}m=!1}try{o=new IntersectionObserver(g,f({},h,{root:r.ownerDocument}))}catch{o=new IntersectionObserver(g,h)}o.observe(t)}(!0),i}(a,n):null;let p=-1,h=null;s&&(h=new ResizeObserver((t=>{let[o]=t;o&&o.target===a&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=h)||t.observe(e)}))),n()})),a&&!c&&h.observe(a),h.observe(e));let m,g=c?_t(t):null;return c&&function e(){const o=_t(t);g&&(o.x!==g.x||o.y!==g.y||o.width!==g.width||o.height!==g.height)&&n(),g=o,m=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),null==d||d(),null==(t=h)||t.disconnect(),h=null,c&&cancelAnimationFrame(m)}}(n,t.el,(()=>{t.el?function(t,e,n,o){((t,e,n)=>{const o=new Map,r=f({platform:Dt},n),i=f({},r.platform,{_c:o});return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(null==s.isRTL?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=nt(a,o,c),p=o,h={},m=0;for(let n=0;n<l.length;n++){const{name:i,fn:g}=l[n],{x:y,y:v,data:b,reset:w}=await g({x:u,y:d,initialPlacement:o,placement:p,strategy:r,middlewareData:h,rects:a,platform:s,elements:{reference:t,floating:e}});u=y??u,d=v??d,h=f({},h,{[i]:f({},h[i],b)}),w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(a=!0===w.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):w.rects),({x:u,y:d}=nt(a,p,c))),n=-1)}return{x:u,y:d,placement:p,strategy:r,middlewareData:h}})(t,e,f({},r,{platform:i}))})(t,e.el,n).then(function(t,e){return({x:n,y:o,placement:r,middlewareData:i})=>(t.el&&(e?Object.assign(t.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(t.el.style,{position:"absolute",left:`${n}px`,top:`${o}px`}),t.el.dataset.popperPlacement=r,function(t,e){const n=t.querySelector(".shepherd-arrow");if(l(n)&&e.arrow){const{x:t,y:o}=e.arrow;Object.assign(n.style,{left:null!=t?`${t}px`:"",top:null!=o?`${o}px`:""})}}(t.el,i)),t)}(e,o)).then((t=>new Promise((e=>{setTimeout((()=>e(t)),300)})))).then((t=>{null!=t&&t.el&&t.el.focus({preventScroll:!0})}))}(n,t,o,r):null==t.cleanup||t.cleanup()})),t.target=e.element,o}function qt(){}function jt(t,e){for(const n in e)t[n]=e[n];return t}function Bt(t){return t()}function _n(){return Object.create(null)}function Nt(t){t.forEach(Bt)}function Vt(t){return"function"==typeof t}function Wt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Ut(t,e){t.appendChild(e)}function zt(t,e,n){t.insertBefore(e,n||null)}function Yt(t){t.parentNode&&t.parentNode.removeChild(t)}function Xt(t){return document.createElement(t)}function Zt(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Jt(t){return document.createTextNode(t)}function Kt(){return Jt(" ")}function Gt(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function Qt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const te=["width","height"];function ee(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const o in e)null==e[o]?t.removeAttribute(o):"style"===o?t.style.cssText=e[o]:"__value"===o?t.value=t[o]=e[o]:n[o]&&n[o].set&&-1===te.indexOf(o)?t[o]=e[o]:Qt(t,o,e[o])}function ne(t,e,n){t.classList.toggle(e,!!n)}let oe;function re(t){oe=t}function ie(){if(!oe)throw new Error("Function called outside component initialization");return oe}function se(t){ie().$$.after_update.push(t)}const le=[],ce=[];let ae=[];const ue=[],de=Promise.resolve();let fe=!1;function pe(t){ae.push(t)}const he=new Set;let me=0;function ge(){if(0!==me)return;const t=oe;do{try{for(;me<le.length;){const t=le[me];me++,re(t),ye(t.$$)}}catch(t){throw le.length=0,me=0,t}for(re(null),le.length=0,me=0;ce.length;)ce.pop()();for(let t=0;t<ae.length;t+=1){const e=ae[t];he.has(e)||(he.add(e),e())}ae.length=0}while(le.length);for(;ue.length;)ue.pop()();fe=!1,he.clear(),re(t)}function ye(t){if(null!==t.fragment){t.update(),Nt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(pe)}}const ve=new Set;let be;function we(){be={r:0,c:[],p:be}}function xe(){be.r||Nt(be.c),be=be.p}function $e(t,e){t&&t.i&&(ve.delete(t),t.i(e))}function Ee(t,e,n,o){if(t&&t.o){if(ve.has(t))return;ve.add(t),be.c.push((()=>{ve.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}function Se(t){return void 0!==(null==t?void 0:t.length)?t:Array.from(t)}function Oe(t){t&&t.c()}function Te(t,e,n){const{fragment:o,after_update:r}=t.$$;o&&o.m(e,n),pe((()=>{const e=t.$$.on_mount.map(Bt).filter(Vt);t.$$.on_destroy?t.$$.on_destroy.push(...e):Nt(e),t.$$.on_mount=[]})),r.forEach(pe)}function _e(t,e){const n=t.$$;null!==n.fragment&&(function(t){const e=[],n=[];ae.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),ae=e}(n.after_update),Nt(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ke(t,e,n,o,r,i,s=null,l=[-1]){const c=oe;re(t);const a=t.$$={fragment:null,ctx:[],props:i,update:qt,not_equal:r,bound:_n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:_n(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let u=!1;if(a.ctx=n?n(t,e.props||{},((e,n,...o)=>{const i=o.length?o[0]:n;return a.ctx&&r(a.ctx[e],a.ctx[e]=i)&&(!a.skip_bound&&a.bound[e]&&a.bound[e](i),u&&function(t,e){-1===t.$$.dirty[0]&&(le.push(t),fe||(fe=!0,de.then(ge)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(t,e)),n})):[],a.update(),u=!0,Nt(a.before_update),a.fragment=!!o&&o(a.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);a.fragment&&a.fragment.l(t),t.forEach(Yt)}else a.fragment&&a.fragment.c();e.intro&&$e(t.$$.fragment),Te(t,e.target,e.anchor),ge()}re(c)}class Ae{constructor(){this.$$=void 0,this.$$set=void 0}$destroy(){_e(this,1),this.$destroy=qt}$on(t,e){if(!Vt(e))return qt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!function(t){return 0===Object.keys(t).length}(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Le(t){let e,n,o,r,i;return{c(){e=Xt("button"),Qt(e,"aria-label",n=t[3]?t[3]:null),Qt(e,"class",o=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],Qt(e,"tabindex","0"),Qt(e,"type","button")},m(n,o){zt(n,e,o),e.innerHTML=t[5],r||(i=Gt(e,"click",(function(){Vt(t[0])&&t[0].apply(this,arguments)})),r=!0)},p(r,[i]){t=r,32&i&&(e.innerHTML=t[5]),8&i&&n!==(n=t[3]?t[3]:null)&&Qt(e,"aria-label",n),18&i&&o!==(o=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&Qt(e,"class",o),4&i&&(e.disabled=t[2])},i:qt,o:qt,d(t){t&&Yt(e),r=!1,i()}}}function Pe(t,e,n){let o,r,i,s,l,a,{config:u,step:d}=e;function f(t){return c(t)?t=t.call(d):t}return t.$$set=t=>{"config"in t&&n(6,u=t.config),"step"in t&&n(7,d=t.step)},t.$$.update=()=>{192&t.$$.dirty&&(n(0,o=u.action?u.action.bind(d.tour):null),n(1,r=u.classes),n(2,i=!!u.disabled&&f(u.disabled)),n(3,s=u.label?f(u.label):null),n(4,l=u.secondary),n(5,a=u.text?f(u.text):null))},[o,r,i,s,l,a,u,d]}typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class Ie extends Ae{constructor(t){super(),ke(this,t,Pe,Le,Wt,{config:6,step:7})}}function Re(t,e,n){const o=t.slice();return o[2]=e[n],o}function Me(t){let e,n,o=Se(t[1]),r=[];for(let e=0;e<o.length;e+=1)r[e]=Ce(Re(t,o,e));const i=t=>Ee(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=Jt("")},m(t,o){for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(t,o);zt(t,e,o),n=!0},p(t,n){if(3&n){let s;for(o=Se(t[1]),s=0;s<o.length;s+=1){const i=Re(t,o,s);r[s]?(r[s].p(i,n),$e(r[s],1)):(r[s]=Ce(i),r[s].c(),$e(r[s],1),r[s].m(e.parentNode,e))}for(we(),s=o.length;s<r.length;s+=1)i(s);xe()}},i(t){if(!n){for(let t=0;t<o.length;t+=1)$e(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)Ee(r[t]);n=!1},d(t){t&&Yt(e),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(r,t)}}}function Ce(t){let e,n;return e=new Ie({props:{config:t[2],step:t[0]}}),{c(){Oe(e.$$.fragment)},m(t,o){Te(e,t,o),n=!0},p(t,n){const o={};2&n&&(o.config=t[2]),1&n&&(o.step=t[0]),e.$set(o)},i(t){n||($e(e.$$.fragment,t),n=!0)},o(t){Ee(e.$$.fragment,t),n=!1},d(t){_e(e,t)}}}function De(t){let e,n,o=t[1]&&Me(t);return{c(){e=Xt("footer"),o&&o.c(),Qt(e,"class","shepherd-footer")},m(t,r){zt(t,e,r),o&&o.m(e,null),n=!0},p(t,[n]){t[1]?o?(o.p(t,n),2&n&&$e(o,1)):(o=Me(t),o.c(),$e(o,1),o.m(e,null)):o&&(we(),Ee(o,1,1,(()=>{o=null})),xe())},i(t){n||($e(o),n=!0)},o(t){Ee(o),n=!1},d(t){t&&Yt(e),o&&o.d()}}}function Fe(t,e,n){let o,{step:r}=e;return t.$$set=t=>{"step"in t&&n(0,r=t.step)},t.$$.update=()=>{1&t.$$.dirty&&n(1,o=r.options.buttons)},[r,o]}class He extends Ae{constructor(t){super(),ke(this,t,Fe,De,Wt,{step:0})}}function qe(t){let e,n,o,r,i;return{c(){e=Xt("button"),n=Xt("span"),n.textContent="×",Qt(n,"aria-hidden","true"),Qt(e,"aria-label",o=t[0].label?t[0].label:"Close Tour"),Qt(e,"class","shepherd-cancel-icon"),Qt(e,"type","button")},m(o,s){zt(o,e,s),Ut(e,n),r||(i=Gt(e,"click",t[1]),r=!0)},p(t,[n]){1&n&&o!==(o=t[0].label?t[0].label:"Close Tour")&&Qt(e,"aria-label",o)},i:qt,o:qt,d(t){t&&Yt(e),r=!1,i()}}}function je(t,e,n){let{cancelIcon:o,step:r}=e;return t.$$set=t=>{"cancelIcon"in t&&n(0,o=t.cancelIcon),"step"in t&&n(2,r=t.step)},[o,t=>{t.preventDefault(),r.cancel()},r]}class Be extends Ae{constructor(t){super(),ke(this,t,je,qe,Wt,{cancelIcon:0,step:2})}}function Ne(t){let e;return{c(){e=Xt("h3"),Qt(e,"id",t[1]),Qt(e,"class","shepherd-title")},m(n,o){zt(n,e,o),t[3](e)},p(t,[n]){2&n&&Qt(e,"id",t[1])},i:qt,o:qt,d(n){n&&Yt(e),t[3](null)}}}function Ve(t,e,n){let{labelId:o,element:r,title:i}=e;return se((()=>{c(i)&&n(2,i=i()),n(0,r.innerHTML=i,r)})),t.$$set=t=>{"labelId"in t&&n(1,o=t.labelId),"element"in t&&n(0,r=t.element),"title"in t&&n(2,i=t.title)},[r,o,i,function(t){ce[t?"unshift":"push"]((()=>{r=t,n(0,r)}))}]}class We extends Ae{constructor(t){super(),ke(this,t,Ve,Ne,Wt,{labelId:1,element:0,title:2})}}function Ue(t){let e,n;return e=new We({props:{labelId:t[0],title:t[2]}}),{c(){Oe(e.$$.fragment)},m(t,o){Te(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.labelId=t[0]),4&n&&(o.title=t[2]),e.$set(o)},i(t){n||($e(e.$$.fragment,t),n=!0)},o(t){Ee(e.$$.fragment,t),n=!1},d(t){_e(e,t)}}}function ze(t){let e,n;return e=new Be({props:{cancelIcon:t[3],step:t[1]}}),{c(){Oe(e.$$.fragment)},m(t,o){Te(e,t,o),n=!0},p(t,n){const o={};8&n&&(o.cancelIcon=t[3]),2&n&&(o.step=t[1]),e.$set(o)},i(t){n||($e(e.$$.fragment,t),n=!0)},o(t){Ee(e.$$.fragment,t),n=!1},d(t){_e(e,t)}}}function Ye(t){let e,n,o,r=t[2]&&Ue(t),i=t[3]&&t[3].enabled&&ze(t);return{c(){e=Xt("header"),r&&r.c(),n=Kt(),i&&i.c(),Qt(e,"class","shepherd-header")},m(t,s){zt(t,e,s),r&&r.m(e,null),Ut(e,n),i&&i.m(e,null),o=!0},p(t,[o]){t[2]?r?(r.p(t,o),4&o&&$e(r,1)):(r=Ue(t),r.c(),$e(r,1),r.m(e,n)):r&&(we(),Ee(r,1,1,(()=>{r=null})),xe()),t[3]&&t[3].enabled?i?(i.p(t,o),8&o&&$e(i,1)):(i=ze(t),i.c(),$e(i,1),i.m(e,null)):i&&(we(),Ee(i,1,1,(()=>{i=null})),xe())},i(t){o||($e(r),$e(i),o=!0)},o(t){Ee(r),Ee(i),o=!1},d(t){t&&Yt(e),r&&r.d(),i&&i.d()}}}function Xe(t,e,n){let o,r,{labelId:i,step:s}=e;return t.$$set=t=>{"labelId"in t&&n(0,i=t.labelId),"step"in t&&n(1,s=t.step)},t.$$.update=()=>{2&t.$$.dirty&&(n(2,o=s.options.title),n(3,r=s.options.cancelIcon))},[i,s,o,r]}class Ze extends Ae{constructor(t){super(),ke(this,t,Xe,Ye,Wt,{labelId:0,step:1})}}function Je(t){let e;return{c(){e=Xt("div"),Qt(e,"class","shepherd-text"),Qt(e,"id",t[1])},m(n,o){zt(n,e,o),t[3](e)},p(t,[n]){2&n&&Qt(e,"id",t[1])},i:qt,o:qt,d(n){n&&Yt(e),t[3](null)}}}function Ke(t,e,n){let{descriptionId:o,element:r,step:i}=e;return se((()=>{let{text:t}=i.options;c(t)&&(t=t.call(i)),l(t)?r.appendChild(t):n(0,r.innerHTML=t,r)})),t.$$set=t=>{"descriptionId"in t&&n(1,o=t.descriptionId),"element"in t&&n(0,r=t.element),"step"in t&&n(2,i=t.step)},[r,o,i,function(t){ce[t?"unshift":"push"]((()=>{r=t,n(0,r)}))}]}class Ge extends Ae{constructor(t){super(),ke(this,t,Ke,Je,Wt,{descriptionId:1,element:0,step:2})}}function Qe(t){let e,n;return e=new Ze({props:{labelId:t[1],step:t[2]}}),{c(){Oe(e.$$.fragment)},m(t,o){Te(e,t,o),n=!0},p(t,n){const o={};2&n&&(o.labelId=t[1]),4&n&&(o.step=t[2]),e.$set(o)},i(t){n||($e(e.$$.fragment,t),n=!0)},o(t){Ee(e.$$.fragment,t),n=!1},d(t){_e(e,t)}}}function tn(t){let e,n;return e=new Ge({props:{descriptionId:t[0],step:t[2]}}),{c(){Oe(e.$$.fragment)},m(t,o){Te(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.descriptionId=t[0]),4&n&&(o.step=t[2]),e.$set(o)},i(t){n||($e(e.$$.fragment,t),n=!0)},o(t){Ee(e.$$.fragment,t),n=!1},d(t){_e(e,t)}}}function en(t){let e,n;return e=new He({props:{step:t[2]}}),{c(){Oe(e.$$.fragment)},m(t,o){Te(e,t,o),n=!0},p(t,n){const o={};4&n&&(o.step=t[2]),e.$set(o)},i(t){n||($e(e.$$.fragment,t),n=!0)},o(t){Ee(e.$$.fragment,t),n=!1},d(t){_e(e,t)}}}function nn(t){let e,n,o,r,i=!u(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,s=!u(t[2].options.text),l=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,c=i&&Qe(t),a=s&&tn(t),d=l&&en(t);return{c(){e=Xt("div"),c&&c.c(),n=Kt(),a&&a.c(),o=Kt(),d&&d.c(),Qt(e,"class","shepherd-content"),Qt(e,"tabindex","0")},m(t,i){zt(t,e,i),c&&c.m(e,null),Ut(e,n),a&&a.m(e,null),Ut(e,o),d&&d.m(e,null),r=!0},p(t,[r]){4&r&&(i=!u(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),i?c?(c.p(t,r),4&r&&$e(c,1)):(c=Qe(t),c.c(),$e(c,1),c.m(e,n)):c&&(we(),Ee(c,1,1,(()=>{c=null})),xe()),4&r&&(s=!u(t[2].options.text)),s?a?(a.p(t,r),4&r&&$e(a,1)):(a=tn(t),a.c(),$e(a,1),a.m(e,o)):a&&(we(),Ee(a,1,1,(()=>{a=null})),xe()),4&r&&(l=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),l?d?(d.p(t,r),4&r&&$e(d,1)):(d=en(t),d.c(),$e(d,1),d.m(e,null)):d&&(we(),Ee(d,1,1,(()=>{d=null})),xe())},i(t){r||($e(c),$e(a),$e(d),r=!0)},o(t){Ee(c),Ee(a),Ee(d),r=!1},d(t){t&&Yt(e),c&&c.d(),a&&a.d(),d&&d.d()}}}function on(t,e,n){let{descriptionId:o,labelId:r,step:i}=e;return t.$$set=t=>{"descriptionId"in t&&n(0,o=t.descriptionId),"labelId"in t&&n(1,r=t.labelId),"step"in t&&n(2,i=t.step)},[o,r,i]}class rn extends Ae{constructor(t){super(),ke(this,t,on,nn,Wt,{descriptionId:0,labelId:1,step:2})}}function sn(t){let e;return{c(){e=Xt("div"),Qt(e,"class","shepherd-arrow"),Qt(e,"data-popper-arrow","")},m(t,n){zt(t,e,n)},d(t){t&&Yt(e)}}}function ln(t){let e,n,o,r,i,s,l,c,a=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&sn();o=new rn({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let d=[{"aria-describedby":r=u(t[4].options.text)?null:t[2]},{"aria-labelledby":i=t[4].options.title?t[3]:null},t[1],{open:"true"}],f={};for(let t=0;t<d.length;t+=1)f=jt(f,d[t]);return{c(){e=Xt("dialog"),a&&a.c(),n=Kt(),Oe(o.$$.fragment),ee(e,f),ne(e,"shepherd-has-cancel-icon",t[5]),ne(e,"shepherd-has-title",t[6]),ne(e,"shepherd-element",!0)},m(r,i){zt(r,e,i),a&&a.m(e,null),Ut(e,n),Te(o,e,null),t[13](e),s=!0,l||(c=Gt(e,"keydown",t[7]),l=!0)},p(t,[l]){t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?a||(a=sn(),a.c(),a.m(e,n)):a&&(a.d(1),a=null);const c={};4&l&&(c.descriptionId=t[2]),8&l&&(c.labelId=t[3]),16&l&&(c.step=t[4]),o.$set(c),ee(e,f=function(t,e){const n={},o={},r={$$scope:1};let i=t.length;for(;i--;){const s=t[i],l=e[i];if(l){for(const t in s)t in l||(o[t]=1);for(const t in l)r[t]||(n[t]=l[t],r[t]=1);t[i]=l}else for(const t in s)r[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(d,[(!s||20&l&&r!==(r=u(t[4].options.text)?null:t[2]))&&{"aria-describedby":r},(!s||24&l&&i!==(i=t[4].options.title?t[3]:null))&&{"aria-labelledby":i},2&l&&t[1],{open:"true"}])),ne(e,"shepherd-has-cancel-icon",t[5]),ne(e,"shepherd-has-title",t[6]),ne(e,"shepherd-element",!0)},i(t){s||($e(o.$$.fragment,t),s=!0)},o(t){Ee(o.$$.fragment,t),s=!1},d(n){n&&Yt(e),a&&a.d(),_e(o),t[13](null),l=!1,c()}}}function cn(t){return t.split(" ").filter((t=>!!t.length))}function an(t,e,n){let o,r,i,{classPrefix:s,element:l,descriptionId:c,firstFocusableElement:u,focusableElements:d,labelId:f,lastFocusableElement:p,step:h,dataStepId:m}=e;return ie().$$.on_mount.push((()=>{n(1,m={[`data-${s}shepherd-step-id`]:h.id}),n(9,d=l.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,u=d[0]),n(10,p=d[d.length-1])})),se((()=>{i!==h.options.classes&&(function(t){if(a(t)){const e=cn(t);e.length&&l.classList.remove(...e)}}(i),i=h.options.classes,function(t){if(a(t)){const e=cn(t);e.length&&l.classList.add(...e)}}(i))})),t.$$set=t=>{"classPrefix"in t&&n(11,s=t.classPrefix),"element"in t&&n(0,l=t.element),"descriptionId"in t&&n(2,c=t.descriptionId),"firstFocusableElement"in t&&n(8,u=t.firstFocusableElement),"focusableElements"in t&&n(9,d=t.focusableElements),"labelId"in t&&n(3,f=t.labelId),"lastFocusableElement"in t&&n(10,p=t.lastFocusableElement),"step"in t&&n(4,h=t.step),"dataStepId"in t&&n(1,m=t.dataStepId)},t.$$.update=()=>{16&t.$$.dirty&&(n(5,o=h.options&&h.options.cancelIcon&&h.options.cancelIcon.enabled),n(6,r=h.options&&h.options.title))},[l,m,c,f,h,o,r,t=>{const{tour:e}=h;switch(t.keyCode){case 9:if(0===d.length){t.preventDefault();break}t.shiftKey?(document.activeElement===u||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),p.focus()):document.activeElement===p&&(t.preventDefault(),u.focus());break;case 27:e.options.exitOnEsc&&(t.preventDefault(),t.stopPropagation(),h.cancel());break;case 37:e.options.keyboardNavigation&&(t.preventDefault(),t.stopPropagation(),e.back());break;case 39:e.options.keyboardNavigation&&(t.preventDefault(),t.stopPropagation(),e.next())}},u,d,p,s,()=>l,function(t){ce[t?"unshift":"push"]((()=>{l=t,n(0,l)}))}]}class un extends Ae{constructor(t){super(),ke(this,t,an,ln,Wt,{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 dn extends d{constructor(t,e={}){return super(),this._resolvedAttachTo=void 0,this._resolvedExtraHighlightElements=void 0,this.classPrefix=void 0,this.el=void 0,this.target=void 0,this.tour=void 0,this.tour=t,this.classPrefix=this.tour.options?k(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,_(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){(function(t){t.cleanup&&t.cleanup(),t.cleanup=null})(this),l(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){var t;null==(t=this.tour.modal)||t.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveExtraHiglightElements(){return this._resolvedExtraHighlightElements=function(t){return t.options.extraHighlights?t.options.extraHighlights.flatMap((t=>Array.from(document.querySelectorAll(t)))):[]}(this),this._resolvedExtraHighlightElements}_resolveAttachToOptions(){return this._resolvedAttachTo=function(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(c(n.element)&&(n.element=n.element.call(t)),a(n.element)){try{n.element=document.querySelector(n.element)}catch{}n.element||console.error(`The element for this Shepherd step was not found ${e.element}`)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return!(!this.el||this.el.hidden)}show(){return c(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`,e=`${this.id}-label`;return this.shepherdElementComponent=new un({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=this._getResolvedAttachToOptions();c(this.options.scrollToHandler)?this.options.scrollToHandler(e):function(t){return t instanceof Element}(e)&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",o=e&&e.classes?e.classes:"",r=[...n.split(" "),...o.split(" ")],i=new Set(r);return Array.from(i).join(" ").trim()}_setOptions(t={}){let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=S({},e||{}),this.options=Object.assign({arrow:!0},e,t,function(t,e){return{floatingUIOptions:S(t.floatingUIOptions||{},e.floatingUIOptions||{})}}(e,t));const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||`step-${L()}`,n&&Object.keys(n).forEach((t=>{this.on(t,n[t],this)}))}_setupElements(){u(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&function(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const o=function(t,e){return n=>{if(t.isOpen()){const o=t.el&&n.currentTarget===t.el;(!u(e)&&n.currentTarget.matches(e)||o)&&t.tour.next()}}}(t,n);let r=null;if(!u(n)&&(r=document.querySelector(n),!r))return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);r?(r.addEventListener(e,o),t.on("destroy",(()=>r.removeEventListener(e,o)))):(document.body.addEventListener(e,o,!0),t.on("destroy",(()=>document.body.removeEventListener(e,o,!0))))}}(this),Ht(this)}_show(){var t;this.trigger("before-show"),this._resolveAttachToOptions(),this._resolveExtraHiglightElements(),this._setupElements(),this.tour.modal||this.tour.setupModal(),null==(t=this.tour.modal)||t.setupForStep(this),this._styleTargetElementForStep(this),this.el&&(this.el.hidden=!1),this.options.scrollTo&&setTimeout((()=>{this._scrollTo(this.options.scrollTo)})),this.el&&(this.el.hidden=!1);const e=this.shepherdElementComponent.getElement(),n=this.target||document.body,o=this._resolvedExtraHighlightElements;n.classList.add(`${this.classPrefix}shepherd-enabled`),n.classList.add(`${this.classPrefix}shepherd-target`),e.classList.add("shepherd-enabled"),null==o||o.forEach((t=>{t.classList.add(`${this.classPrefix}shepherd-enabled`),t.classList.add(`${this.classPrefix}shepherd-target`)})),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target,n=t._resolvedExtraHighlightElements;if(!e)return;const o=t.options.highlightClass;o&&(e.classList.add(o),null==n||n.forEach((t=>t.classList.add(o)))),e.classList.remove("shepherd-target-click-disabled"),null==n||n.forEach((t=>t.classList.remove("shepherd-target-click-disabled"))),!1===t.options.canClickTarget&&(e.classList.add("shepherd-target-click-disabled"),null==n||n.forEach((t=>t.classList.add("shepherd-target-click-disabled"))))}_updateStepTargetOnHide(){const t=this.target||document.body,e=this._resolvedExtraHighlightElements,n=this.options.highlightClass;n&&(t.classList.remove(n),null==e||e.forEach((t=>t.classList.remove(n)))),t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`),null==e||e.forEach((t=>{t.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}))}}function fn(t){let e,n,o,r,i;return{c(){e=Zt("svg"),n=Zt("path"),Qt(n,"d",t[2]),Qt(e,"class",o=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(o,s){zt(o,e,s),Ut(e,n),t[11](e),r||(i=Gt(e,"touchmove",t[3]),r=!0)},p(t,[r]){4&r&&Qt(n,"d",t[2]),2&r&&o!==(o=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&Qt(e,"class",o)},i:qt,o:qt,d(n){n&&Yt(e),t[11](null),r=!1,i()}}}function pn(t){if(!t)return null;const e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY;return"hidden"!==e&&"visible"!==e&&t.scrollHeight>=t.clientHeight?t:pn(t.parentElement)}function hn(t,e){const n=t.getBoundingClientRect();let o=n.y||n.top,r=n.bottom||o+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,i=t.bottom||n+t.height;o=Math.max(o,n),r=Math.min(r,i)}return{y:o,height:Math.max(r-o,0)}}function mn(t,e,n){let o,r,{element:i,openingProperties:s}=e,l=!1;function c(){n(4,s=[{width:0,height:0,x:0,y:0,r:0}])}function a(){n(1,l=!1),p()}function u(t=0,e=0,o=0,r=0,i,l,a){if(l){const c=[l,...a||[]];n(4,s=[]);for(const n of c){if(!n||c.indexOf(n)!==c.lastIndexOf(n))continue;const{y:l,height:a}=hn(n,i),{x:u,width:d,left:f}=n.getBoundingClientRect();c.some((t=>{if(t===n)return!1;const e=t.getBoundingClientRect();return u>=e.left&&u+d<=e.right&&l>=e.top&&l+a<=e.bottom}))||s.push({width:d+2*t,height:a+2*t,x:(u||f)+o-t,y:l+r-t,r:e})}}else c()}function d(){n(1,l=!0)}c();const f=t=>{t.preventDefault()};function p(){o&&(cancelAnimationFrame(o),o=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=t=>{"element"in t&&n(0,i=t.element),"openingProperties"in t&&n(4,s=t.openingProperties)},t.$$.update=()=>{16&t.$$.dirty&&n(2,r=function(t){let e="";const{innerWidth:n,innerHeight:o}=window;return t.forEach((t=>{const{width:n,height:o,x:r=0,y:i=0,r:s=0}=t,{topLeft:l=0,topRight:c=0,bottomRight:a=0,bottomLeft:u=0}="number"==typeof s?{topLeft:s,topRight:s,bottomRight:s,bottomLeft:s}:s;e+=`M${r+l},${i}      a${l},${l},0,0,0-${l},${l}      V${o+i-u}      a${u},${u},0,0,0,${u},${u}      H${n+r-a}      a${a},${a},0,0,0,${a}-${a}      V${i+c}      a${c},${c},0,0,0-${c}-${c}      Z`})),`M${n},${o}          H0          V0          H${n}          V${o}          Z          ${e}`.replace(/\s/g,"")}(s))},[i,l,r,t=>{t.stopPropagation()},s,()=>i,c,a,u,function(t){p(),t.tour.options.useModalOverlay?(function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n,modalOverlayOpeningXOffset:r=0,modalOverlayOpeningYOffset:i=0}=t.options,s=function(t){let e={top:0,left:0};if(!t)return e;let n=t.ownerDocument.defaultView;for(;n!==window.top;){var o;const t=null==(o=n)?void 0:o.frameElement;if(t){var r,i;const n=t.getBoundingClientRect();e.top+=n.top+(null!=(r=n.scrollTop)?r:0),e.left+=n.left+(null!=(i=n.scrollLeft)?i:0)}n=n.parent}return e}(t.target),l=pn(t.target),c=()=>{o=void 0,u(e,n,r+s.left,i+s.top,l,t.target,t._resolvedExtraHighlightElements),o=requestAnimationFrame(c)};c(),window.addEventListener("touchmove",f,{passive:!1})}(t),d()):a()},d,function(t){ce[t?"unshift":"push"]((()=>{i=t,n(0,i)}))}]}class gn extends Ae{constructor(t){super(),ke(this,t,mn,fn,Wt,{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 yn=new class extends d{constructor(){super(),this.activeTour=void 0,_(this)}},vn=typeof window>"u";yn.Step=vn?class{constructor(t){}}:dn,yn.Tour=vn?class{constructor(t,e){}}:class extends d{constructor(t={}){return super(),this.trackedEvents=["active","cancel","complete","show"],this.classPrefix=void 0,this.currentStep=void 0,this.focusedElBeforeOpen=void 0,this.id=void 0,this.modal=void 0,this.options=void 0,this.steps=void 0,_(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=k(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map((t=>{(t=>{this.on(t,(e=>{(e=e||{}).tour=this,yn.trigger(t,e)}))})(t)})),this._setTourID(t.id),this}addStep(t,e){let n=t;return n instanceof dn?n.tour=this:n=new dn(this,n),u(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach((t=>{this.addStep(t)})),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}async cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";let e;e=c(this.options.confirmCancel)?await this.options.confirmCancel():window.confirm(t),e&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find((e=>e.id===t))}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return yn.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 e=this.getCurrentStep();this.steps.some(((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0})),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t=0,e=!0){const n=a(t)?this.getById(t):this.steps[t];n&&(this._updateStateBeforeShow(),c(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.currentStep=n,this.trigger("show",{step:n,previous:this.currentStep}),n.show()))}async start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this.setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach((t=>t.destroy())),function(t){if(t){const{steps:e}=t;e.forEach((t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&(l(t.target)&&t.target.classList.remove("shepherd-target-click-disabled"),t._resolvedExtraHighlightElements&&t._resolvedExtraHighlightElements.forEach((t=>{l(t)&&t.classList.remove("shepherd-target-click-disabled")})))}))}}(this),this.trigger(t,{index:e}),yn.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&(t.remove(),this.modal=null)}l(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),yn.activeTour=this}setupModal(){this.modal=new gn({target:this.options.modalContainer||document.body,props:{styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t);if(n===this.steps.length-1)this.complete();else{const t=e?n+1:n-1;this.show(t,e)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(t){const e=this.options.tourName||"tour",n=t||L();this.id=`${e}--${n}`}};const bn=(0,t.createContext)(void 0),wn=(bn.Consumer,({children:t})=>s.jsx(bn.Provider,{value:{Shepherd:yn},children:t})),xn=window.wp.blocks,$n=window.wp.blockEditor;function En(){const o=(()=>{const e=(0,t.useContext)(bn);if(!e)throw new Error("useShepherd must be used within a ShepherdJourneyProvider");const{Shepherd:n}=e;return n})(),{insertBlocks:r,removeBlock:i}=(0,n.useDispatch)($n.store),[s,l]=(0,e.useState)(!1),[c,a]=(0,e.useState)(""),{getAllBlocks:u}=(0,n.useSelect)((t=>{const{getBlocks:e}=t($n.store);return{getAllBlocks:e}})),d=()=>{const t=new URLSearchParams(window.location.search).get("kad-admin-tour");t&&a(t)};(0,e.useEffect)((()=>{d();const t=()=>{d()};return window.addEventListener("popstate",t),window.addEventListener("kad-tour-start",t),()=>{window.removeEventListener("popstate",t)}}),[]);const f={defaultStepOptions:{cancelIcon:{enabled:!0,label:kadenceToursParams.i18n.cancel},classes:"kad-sp-tour"},modalContainer:document.querySelector(".kadence-site-assist-tours"),stepsContainer:document.querySelector(".kadence-site-assist-tours"),classPrefix:"kad-sp-tour-",useModalOverlay:!0};return(0,e.useEffect)((()=>{if(c){const t=window?.kadenceToursParams?.tours?.[c];if(t){const e=()=>!!document.querySelector('iframe[name="editor-canvas"]'),n=new o.Tour({...f,tourName:c}),s=t.steps.length;t.steps.map(((t,l)=>{const c=[];l>0&&c.push({text:kadenceToursParams.i18n.previous,action:()=>{window.kadenceTourDirection="backward",n.back()},classes:"components-button is-secondary kad-sp-tour-btn"}),l<s-1?c.push({text:kadenceToursParams.i18n.next,action:()=>{window.kadenceTourDirection="forward",n.next()},classes:"components-button is-primary kad-sp-tour-btn"}):c.push({text:kadenceToursParams.i18n.finish,action:()=>{window.kadenceTourDirection="complete",n.complete()},classes:"components-button is-primary kad-sp-tour-btn"}),n.addStep({id:t.id,target:t.target,title:t.title,text:t.content,attachTo:{element:t.target,on:t?.placement||"auto"},beforeShowPromise:function(){return!t?.expand||("editor-load"===t.expand&&e()?new Promise((async function(e){const n=document.querySelector('iframe[name="editor-canvas"]');if(n.contentWindow&&n.contentWindow.document&&"complete"===n.contentWindow.document.readyState&&n.contentWindow.document.querySelector(t.target)){const r=o.activeTour?.getCurrentStep(),i=n.contentWindow;r.updateStepOptions({target:i.document.querySelector(t.target),attachTo:{element:i.document.querySelector(t.target),on:t?.placement||"auto"}}),e()}n.onload=()=>{const r=o.activeTour?.getCurrentStep(),i=n.contentWindow;r.updateStepOptions({target:i.document.querySelector(t.target),attachTo:{element:i.document.querySelector(t.target),on:t?.placement||"auto"}}),e()}})):"add-editor-blocks"===t.expand?new Promise((function(e){if(t?.blocks){for(const e of t.blocks){const t=(0,xn.createBlock)(e.name,e.attributes);r(t)}setTimeout((()=>{e()}),300)}else e()})):new Promise((function(e){const n=document.querySelector(t?.expand);if(n)if(n.classList.contains("is-pressed")){if(t?.subExpand){const e=document.querySelector(t.subExpand);e&&e.click()}e()}else if(".kb-toolbar-prebuilt-button"===t?.expand&&document.body.classList.contains("modal-open")){if(t?.subExpand){const e=document.querySelector(t.subExpand);e&&e.click()}e()}else{if(n.click(),t?.subExpand){const e=document.querySelector(t.subExpand);e&&e.click()}setTimeout((()=>{e()}),300)}else e()})))},canClickTarget:!1,buttons:c,when:{"before-show":function(){t?.hover&&(document.querySelector(t.hover).classList.add("hover"),document.querySelector(t.hover).classList.add("opensub"))},show:function(){const e=o.activeTour?.getCurrentStep(),n=e?.getElement(),r=n?.querySelector(".shepherd-footer");if(t?.image){const e=n?.querySelector(".shepherd-content"),o=document.createElement("img");o.className="kad-tour-image shepherd-image",o.src=t.image,e?.insertBefore(o,n.querySelector(".shepherd-header"))}const i=document.createElement("span");i.className="kad-tour-progress shepherd-progress",i.innerText=`${o.activeTour?.steps.indexOf(e)+1} of ${o.activeTour?.steps.length}`,r?.insertBefore(i,n.querySelector(".shepherd-button:first-child")),t?.interact&&(setTimeout((()=>{const e=document.querySelector(t.interact?.[0]);e&&e.click()}),1e3),setTimeout((()=>{const e=document.querySelector(t.interact?.[1]);e&&e.click()}),3e3))},"before-hide":function(){if(t?.hover&&(document.querySelector(t.hover).classList.remove("hover"),document.querySelector(t.hover).classList.remove("opensub")),t?.retract)if("remove-editor-blocks"===t.retract)u().map((t=>{"kadence-tour"===t.attributes.anchor&&i(t.clientId)}));else{const e=document.querySelector(t.retract);e&&("backward"===window.kadenceTourDirection&&"block_editor_color_patterns"===t.id||"forward"===window.kadenceTourDirection&&"block_editor_search_patterns"===t.id?console.log("skipping retract"):e.click())}},complete:function(){if(t?.hover&&(document.querySelector(t.hover).classList.remove("hover"),document.querySelector(t.hover).classList.remove("opensub")),t?.retract){const e=document.querySelector(t.retract);e&&e.click()}},cancel:function(){if(t?.hover&&(document.querySelector(t.hover).classList.remove("hover"),document.querySelector(t.hover).classList.remove("opensub")),t?.retract){const e=document.querySelector(t.retract);e&&e.click()}}}})})),l(n),setTimeout((()=>{n.start()}),50)}}}),[c]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{class:"kadence-site-assist-tours"}))}function Sn(){return(0,t.createElement)(wn,null,(0,t.createElement)(En,null))}window.kadenceTourDirection="forward",wp.domReady((()=>{const n=document.querySelector("#kadence-site-assist-tours");(0,e.createRoot)(n).render((0,t.createElement)(Sn,null))}))})();