diff --git a/assets/css/driver-js.css b/assets/css/driver-js.css index d89fd79..22bebd2 100644 --- a/assets/css/driver-js.css +++ b/assets/css/driver-js.css @@ -4,5 +4,7 @@ * * Made by Kamran Ahmed * Under MIT License + * + * Build source: https://github.com/trymebytes/driver.js/tree/fix-accessibility */ -.driver-active .driver-overlay,.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in .2s ease-in-out}.driver-fade .driver-popover{animation:animate-fade-in .2s}.driver-popover{all:unset;box-sizing:border-box;color:#2d2d2d;margin:0;padding:15px;border-radius:5px;min-width:250px;max-width:300px;box-shadow:0 1px 10px #0006;z-index:1000000000;position:fixed;top:0;right:0;background-color:#fff}.driver-popover *{font-family:Helvetica Neue,Inter,ui-sans-serif,"Apple Color Emoji",Helvetica,Arial,sans-serif}.driver-popover-title{font:19px/normal sans-serif;font-weight:700;display:block;position:relative;line-height:1.5;zoom:1;margin:0}.driver-popover-close-btn{all:unset;position:absolute;top:0;right:0;width:32px;height:28px;cursor:pointer;font-size:18px;font-weight:500;color:#d2d2d2;z-index:1;text-align:center;transition:color;transition-duration:.2s}.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{margin-bottom:0;font:14px/normal sans-serif;line-height:1.5;font-weight:400;zoom:1}.driver-popover-footer{margin-top:15px;text-align:right;zoom:1;display:flex;align-items:center;justify-content:space-between}.driver-popover-progress-text{font-size:13px;font-weight:400;color:#727272;zoom:1}.driver-popover-footer button{all:unset;display:inline-block;box-sizing:border-box;padding:3px 7px;text-decoration:none;text-shadow:1px 1px 0 #fff;background-color:#fff;color:#2d2d2d;font:12px/normal sans-serif;cursor:pointer;outline:0;zoom:1;line-height:1.3;border:1px solid #ccc;border-radius:3px}.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}:not(body):has(>.driver-active-element){overflow:hidden!important}.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}.driver-popover-footer button:hover,.driver-popover-footer button:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{display:flex;flex-grow:1;justify-content:flex-end}.driver-popover-navigation-btns button+button{margin-left:4px}.driver-popover-arrow{content:"";position:absolute;border:5px solid #fff}.driver-popover-arrow-side-over{display:none}.driver-popover-arrow-side-left{left:100%;border-right-color:transparent;border-bottom-color:transparent;border-top-color:transparent}.driver-popover-arrow-side-right{right:100%;border-left-color:transparent;border-bottom-color:transparent;border-top-color:transparent}.driver-popover-arrow-side-top{top:100%;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.driver-popover-arrow-side-bottom{bottom:100%;border-left-color:transparent;border-top-color:transparent;border-right-color:transparent}.driver-popover-arrow-side-center{display:none}.driver-popover-arrow-side-left.driver-popover-arrow-align-start,.driver-popover-arrow-side-right.driver-popover-arrow-align-start{top:15px}.driver-popover-arrow-side-top.driver-popover-arrow-align-start,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-start{left:15px}.driver-popover-arrow-align-end.driver-popover-arrow-side-left,.driver-popover-arrow-align-end.driver-popover-arrow-side-right{bottom:15px}.driver-popover-arrow-side-top.driver-popover-arrow-align-end,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-end{right:15px}.driver-popover-arrow-side-left.driver-popover-arrow-align-center,.driver-popover-arrow-side-right.driver-popover-arrow-align-center{top:50%;margin-top:-5px}.driver-popover-arrow-side-top.driver-popover-arrow-align-center,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-center{left:50%;margin-left:-5px}.driver-popover-arrow-none{display:none} +.driver-active .driver-overlay,.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in .2s ease-in-out}.driver-fade .driver-popover{animation:animate-fade-in .2s}.driver-popover{all:unset;box-sizing:border-box;color:#2d2d2d;margin:0;padding:15px;border-radius:5px;min-width:250px;max-width:300px;box-shadow:0 1px 10px #0006;z-index:1000000000;position:fixed;top:0;right:0;background-color:#fff}.driver-popover *{font-family:Helvetica Neue,Inter,ui-sans-serif,"Apple Color Emoji",Helvetica,Arial,sans-serif}.driver-popover-title{font:19px/normal sans-serif;font-weight:700;display:block;position:relative;line-height:1.5;zoom:1;margin:0}.driver-popover-close-btn{all:unset;position:absolute;top:0;right:0;width:32px;height:28px;cursor:pointer;font-size:18px;font-weight:500;color:#5c5757;z-index:1;text-align:center;transition:color;transition-duration:.2s}.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{margin-bottom:0;font:14px/normal sans-serif;line-height:1.5;font-weight:400;zoom:1}.driver-popover-footer{margin-top:15px;text-align:right;zoom:1;display:flex;align-items:center;justify-content:space-between}.driver-popover-progress-text{font-size:13px;font-weight:400;color:#727272;zoom:1}.driver-popover-footer button{all:unset;display:inline-block;box-sizing:border-box;padding:3px 7px;text-decoration:none;text-shadow:1px 1px 0 #fff;background-color:#fff;color:#2d2d2d;font:12px/normal sans-serif;cursor:pointer;outline:0;zoom:1;line-height:1.3;border:1px solid #ccc;border-radius:3px}.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}:not(body):has(>.driver-active-element){overflow:hidden!important}.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}.driver-popover-footer button:hover,.driver-popover-footer button:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{display:flex;flex-grow:1;justify-content:flex-end}.driver-popover-navigation-btns button+button{margin-left:4px}.driver-popover-arrow{content:"";position:absolute;border:5px solid #fff}.driver-popover-arrow-side-over{display:none}.driver-popover-arrow-side-left{left:100%;border-right-color:transparent;border-bottom-color:transparent;border-top-color:transparent}.driver-popover-arrow-side-right{right:100%;border-left-color:transparent;border-bottom-color:transparent;border-top-color:transparent}.driver-popover-arrow-side-top{top:100%;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.driver-popover-arrow-side-bottom{bottom:100%;border-left-color:transparent;border-top-color:transparent;border-right-color:transparent}.driver-popover-arrow-side-center{display:none}.driver-popover-arrow-side-left.driver-popover-arrow-align-start,.driver-popover-arrow-side-right.driver-popover-arrow-align-start{top:15px}.driver-popover-arrow-side-top.driver-popover-arrow-align-start,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-start{left:15px}.driver-popover-arrow-align-end.driver-popover-arrow-side-left,.driver-popover-arrow-align-end.driver-popover-arrow-side-right{bottom:15px}.driver-popover-arrow-side-top.driver-popover-arrow-align-end,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-end{right:15px}.driver-popover-arrow-side-left.driver-popover-arrow-align-center,.driver-popover-arrow-side-right.driver-popover-arrow-align-center{top:50%;margin-top:-5px}.driver-popover-arrow-side-top.driver-popover-arrow-align-center,.driver-popover-arrow-side-bottom.driver-popover-arrow-align-center{left:50%;margin-left:-5px}.driver-popover-arrow-none{display:none}button.driver-popover-next-btn{margin-left:4px} diff --git a/assets/js/driver-js.js b/assets/js/driver-js.js index a7f1451..f9c9dc9 100644 --- a/assets/js/driver-js.js +++ b/assets/js/driver-js.js @@ -4,7 +4,7 @@ * Made by Kamran Ahmed * Under MIT License * - * Build source: https://github.com/trymebytes/driver.js/tree/select-visible-elements + * Build source: https://github.com/trymebytes/driver.js/tree/fix-accessibility */ -this.driver=this.driver||{};this.driver.js=function(D){"use strict";let F={};function z(e={}){F={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function a(e){return e?F[e]:F}function W(e,o,t,i){return(e/=i/2)<1?t/2*e*e+o:-t/2*(--e*(e-2)-1)+o}function q(e){const o='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap(t=>{const i=t.matches(o),d=Array.from(t.querySelectorAll(o));return[...i?[t]:[],...d]}).filter(t=>getComputedStyle(t).pointerEvents!=="none"&&ae(t))}function V(e){if(!e||se(e))return;const o=a("smoothScroll");e.scrollIntoView({behavior:!o||re(e)?"auto":"smooth",inline:"center",block:"center"})}function re(e){if(!e||!e.parentElement)return;const o=e.parentElement;return o.scrollHeight>o.clientHeight}function se(e){const o=e.getBoundingClientRect();return o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&o.right<=(window.innerWidth||document.documentElement.clientWidth)}function ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let N={};function b(e,o){N[e]=o}function l(e){return e?N[e]:N}function K(){N={}}let T={};function O(e,o){T[e]=o}function _(e){var o;(o=T[e])==null||o.call(T)}function ce(){T={}}function le(e,o,t,i){let d=l("__activeStagePosition");const n=d||t.getBoundingClientRect(),f=i.getBoundingClientRect(),w=W(e,n.x,f.x-n.x,o),r=W(e,n.y,f.y-n.y,o),v=W(e,n.width,f.width-n.width,o),s=W(e,n.height,f.height-n.height,o);d={x:w,y:r,width:v,height:s},Y(d),b("__activeStagePosition",d)}function X(e){if(!e)return;const o=e.getBoundingClientRect(),t={x:o.x,y:o.y,width:o.width,height:o.height};b("__activeStagePosition",t),Y(t)}function de(){const e=l("__activeStagePosition"),o=l("__overlaySvg");if(!e)return;if(!o){console.warn("No stage svg found.");return}const t=window.innerWidth,i=window.innerHeight;o.setAttribute("viewBox",`0 0 ${t} ${i}`)}function pe(e){const o=ue(e);document.body.appendChild(o),G(o,t=>{t.target.tagName==="path"&&_("overlayClick")}),b("__overlaySvg",o)}function Y(e){const o=l("__overlaySvg");if(!o){pe(e);return}const t=o.firstElementChild;if((t==null?void 0:t.tagName)!=="path")throw new Error("no path element found in stage svg");t.setAttribute("d",j(e))}function ue(e){const o=window.innerWidth,t=window.innerHeight,i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.classList.add("driver-overlay","driver-overlay-animated"),i.setAttribute("viewBox",`0 0 ${o} ${t}`),i.setAttribute("xmlSpace","preserve"),i.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),i.setAttribute("version","1.1"),i.setAttribute("preserveAspectRatio","xMinYMin slice"),i.style.fillRule="evenodd",i.style.clipRule="evenodd",i.style.strokeLinejoin="round",i.style.strokeMiterlimit="2",i.style.zIndex="10000",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%";const d=document.createElementNS("http://www.w3.org/2000/svg","path");return d.setAttribute("d",j(e)),d.style.fill=a("overlayColor")||"rgb(0,0,0)",d.style.opacity=`${a("overlayOpacity")}`,d.style.pointerEvents="auto",d.style.cursor="auto",i.appendChild(d),i}function j(e){const o=window.innerWidth,t=window.innerHeight,i=a("stagePadding")||0,d=a("stageRadius")||0,n=e.width+i*2,f=e.height+i*2,w=Math.min(d,n/2,f/2),r=Math.floor(Math.max(w,0)),v=e.x-i+r,s=e.y-i,c=n-r*2,p=f-r*2;return`M${o},0L0,0L0,${t}L${o},${t}L${o},0Z - M${v},${s} h${c} a${r},${r} 0 0 1 ${r},${r} v${p} a${r},${r} 0 0 1 -${r},${r} h-${c} a${r},${r} 0 0 1 -${r},-${r} v-${p} a${r},${r} 0 0 1 ${r},-${r} z`}function ve(){const e=l("__overlaySvg");e&&e.remove()}function fe(){const e=document.getElementById("driver-dummy-element");if(e)return e;let o=document.createElement("div");return o.id="driver-dummy-element",o.style.width="0",o.style.height="0",o.style.pointerEvents="none",o.style.opacity="0",o.style.position="fixed",o.style.top="50%",o.style.left="50%",document.body.appendChild(o),o}function Q(e){const{element:o}=e;let t=null;typeof o=="string"?(t=document.querySelector(o),(!t||t.getBoundingClientRect().width===0)&&(t=null,document.querySelectorAll(o).forEach(function(i){var d=i.getBoundingClientRect();if(!t&&d.width>0&&d.height>0){t=i;return}}))):o instanceof Element&&(t=o),t||(t=fe()),ge(t,e)}function he(){const e=l("__activeElement"),o=l("__activeStep");e&&(X(e),de(),oe(e,o))}function ge(e,o){const i=Date.now(),d=l("__activeStep"),n=l("__activeElement")||e,f=!n||n===e,w=e.id==="driver-dummy-element",r=n.id==="driver-dummy-element",v=a("animate"),s=o.onHighlightStarted||a("onHighlightStarted"),c=(o==null?void 0:o.onHighlighted)||a("onHighlighted"),p=(d==null?void 0:d.onDeselected)||a("onDeselected"),m=a(),g=l();!f&&p&&p(r?void 0:n,d,{config:m,state:g}),s&&s(w?void 0:e,o,{config:m,state:g});const u=!f&&v;let h=!1;xe(),b("previousStep",d),b("previousElement",n),b("activeStep",o),b("activeElement",e);const P=()=>{if(l("__transitionCallback")!==P)return;const x=Date.now()-i,y=400-x<=400/2;o.popover&&y&&!h&&u&&(J(e,o),h=!0),a("animate")&&x<400?le(x,400,n,e):(X(e),c&&c(w?void 0:e,o,{config:a(),state:l()}),b("__transitionCallback",void 0),b("__previousStep",d),b("__previousElement",n),b("__activeStep",o),b("__activeElement",e)),window.requestAnimationFrame(P)};b("__transitionCallback",P),window.requestAnimationFrame(P),V(e),!u&&o.popover&&J(e,o),n.classList.remove("driver-active-element","driver-no-interaction"),n.removeAttribute("aria-haspopup"),n.removeAttribute("aria-expanded"),n.removeAttribute("aria-controls"),a("disableActiveInteraction")&&e.classList.add("driver-no-interaction"),e.classList.add("driver-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","driver-popover-content")}function we(){var e;(e=document.getElementById("driver-dummy-element"))==null||e.remove(),document.querySelectorAll(".driver-active-element").forEach(o=>{o.classList.remove("driver-active-element","driver-no-interaction"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-controls")})}function A(){const e=l("__resizeTimeout");e&&window.cancelAnimationFrame(e),b("__resizeTimeout",window.requestAnimationFrame(he))}function me(e){var r;if(!l("isInitialized")||!(e.key==="Tab"||e.keyCode===9))return;const i=l("__activeElement"),d=(r=l("popover"))==null?void 0:r.wrapper,n=q([...d?[d]:[],...i?[i]:[]]),f=n[0],w=n[n.length-1];if(e.preventDefault(),e.shiftKey){const v=n[n.indexOf(document.activeElement)-1]||w;v==null||v.focus()}else{const v=n[n.indexOf(document.activeElement)+1]||f;v==null||v.focus()}}function Z(e){var t;((t=a("allowKeyboardControl"))==null||t)&&(e.key==="Escape"?_("escapePress"):e.key==="ArrowRight"?_("arrowRightPress"):e.key==="ArrowLeft"&&_("arrowLeftPress"))}function G(e,o,t){const i=(n,f)=>{const w=n.target;e.contains(w)&&((!t||t(w))&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()),f==null||f(n))};document.addEventListener("pointerdown",i,!0),document.addEventListener("mousedown",i,!0),document.addEventListener("pointerup",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("click",n=>{i(n,o)},!0)}function ye(){window.addEventListener("keyup",Z,!1),window.addEventListener("keydown",me,!1),window.addEventListener("resize",A),window.addEventListener("scroll",A)}function be(){window.removeEventListener("keyup",Z),window.removeEventListener("resize",A),window.removeEventListener("scroll",A)}function xe(){const e=l("popover");e&&(e.wrapper.style.display="none")}function J(e,o){var C,y;let t=l("popover");t&&document.body.removeChild(t.wrapper),t=Pe(),document.body.appendChild(t.wrapper);const{title:i,description:d,showButtons:n,disableButtons:f,showProgress:w,nextBtnText:r=a("nextBtnText")||"Next →",prevBtnText:v=a("prevBtnText")||"← Previous",progressText:s=a("progressText")||"{current} of {total}"}=o.popover||{};t.nextButton.innerHTML=r,t.previousButton.innerHTML=v,t.progress.innerHTML=s,i?(t.title.innerHTML=i,t.title.style.display="block"):t.title.style.display="none",d?(t.description.innerHTML=d,t.description.style.display="block"):t.description.style.display="none";const c=n||a("showButtons"),p=w||a("showProgress")||!1,m=(c==null?void 0:c.includes("next"))||(c==null?void 0:c.includes("previous"))||p;t.closeButton.style.display=c.includes("close")?"block":"none",m?(t.footer.style.display="flex",t.progress.style.display=p?"block":"none",t.nextButton.style.display=c.includes("next")?"block":"none",t.previousButton.style.display=c.includes("previous")?"block":"none"):t.footer.style.display="none";const g=f||a("disableButtons")||[];g!=null&&g.includes("next")&&(t.nextButton.disabled=!0,t.nextButton.classList.add("driver-popover-btn-disabled")),g!=null&&g.includes("previous")&&(t.previousButton.disabled=!0,t.previousButton.classList.add("driver-popover-btn-disabled")),g!=null&&g.includes("close")&&(t.closeButton.disabled=!0,t.closeButton.classList.add("driver-popover-btn-disabled"));const u=t.wrapper;u.style.display="block",u.style.left="",u.style.top="",u.style.bottom="",u.style.right="",u.id="driver-popover-content",u.setAttribute("role","dialog"),u.setAttribute("aria-labelledby","driver-popover-title"),u.setAttribute("aria-describedby","driver-popover-description");const h=t.arrow;h.className="driver-popover-arrow";const P=((C=o.popover)==null?void 0:C.popoverClass)||a("popoverClass")||"";u.className=`driver-popover ${P}`.trim(),G(t.wrapper,k=>{var R,M,I;const E=k.target,H=((R=o.popover)==null?void 0:R.onNextClick)||a("onNextClick"),$=((M=o.popover)==null?void 0:M.onPrevClick)||a("onPrevClick"),B=((I=o.popover)==null?void 0:I.onCloseClick)||a("onCloseClick");if(E.classList.contains("driver-popover-next-btn"))return H?H(e,o,{config:a(),state:l()}):_("nextClick");if(E.classList.contains("driver-popover-prev-btn"))return $?$(e,o,{config:a(),state:l()}):_("prevClick");if(E.classList.contains("driver-popover-close-btn"))return B?B(e,o,{config:a(),state:l()}):_("closeClick")},k=>!(t!=null&&t.description.contains(k))&&!(t!=null&&t.title.contains(k))&&typeof k.className=="string"&&k.className.includes("driver-popover")),b("popover",t);const S=((y=o.popover)==null?void 0:y.onPopoverRender)||a("onPopoverRender");S&&S(t,{config:a(),state:l()}),oe(e,o),V(u);const L=e.classList.contains("driver-dummy-element"),x=q([u,...L?[]:[e]]);x.length>0&&x[0].focus()}function U(){const e=l("popover");if(!(e!=null&&e.wrapper))return;const o=e.wrapper.getBoundingClientRect(),t=a("stagePadding")||0,i=a("popoverOffset")||0;return{width:o.width+t+i,height:o.height+t+i,realWidth:o.width,realHeight:o.height}}function ee(e,o){const{elementDimensions:t,popoverDimensions:i,popoverPadding:d,popoverArrowDimensions:n}=o;return e==="start"?Math.max(Math.min(t.top-d,window.innerHeight-i.realHeight-n.width),n.width):e==="end"?Math.max(Math.min(t.top-(i==null?void 0:i.realHeight)+t.height+d,window.innerHeight-(i==null?void 0:i.realHeight)-n.width),n.width):e==="center"?Math.max(Math.min(t.top+t.height/2-(i==null?void 0:i.realHeight)/2,window.innerHeight-(i==null?void 0:i.realHeight)-n.width),n.width):0}function te(e,o){const{elementDimensions:t,popoverDimensions:i,popoverPadding:d,popoverArrowDimensions:n}=o;return e==="start"?Math.max(Math.min(t.left-d,window.innerWidth-i.realWidth-n.width),n.width):e==="end"?Math.max(Math.min(t.left-(i==null?void 0:i.realWidth)+t.width+d,window.innerWidth-(i==null?void 0:i.realWidth)-n.width),n.width):e==="center"?Math.max(Math.min(t.left+t.width/2-(i==null?void 0:i.realWidth)/2,window.innerWidth-(i==null?void 0:i.realWidth)-n.width),n.width):0}function oe(e,o){const t=l("popover");if(!t)return;const{align:i="start",side:d="left"}=(o==null?void 0:o.popover)||{},n=i,f=e.id==="driver-dummy-element"?"over":d,w=a("stagePadding")||0,r=U(),v=t.arrow.getBoundingClientRect(),s=e.getBoundingClientRect(),c=s.top-r.height;let p=c>=0;const m=window.innerHeight-(s.bottom+r.height);let g=m>=0;const u=s.left-r.width;let h=u>=0;const P=window.innerWidth-(s.right+r.width);let S=P>=0;const L=!p&&!g&&!h&&!S;let x=f;if(f==="top"&&p?S=h=g=!1:f==="bottom"&&g?S=h=p=!1:f==="left"&&h?S=p=g=!1:f==="right"&&S&&(h=p=g=!1),f==="over"){const C=window.innerWidth/2-r.realWidth/2,y=window.innerHeight/2-r.realHeight/2;t.wrapper.style.left=`${C}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${y}px`,t.wrapper.style.bottom="auto"}else if(L){const C=window.innerWidth/2-(r==null?void 0:r.realWidth)/2,y=10;t.wrapper.style.left=`${C}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom=`${y}px`,t.wrapper.style.top="auto"}else if(h){const C=Math.min(u,window.innerWidth-(r==null?void 0:r.realWidth)-v.width),y=ee(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.left=`${C}px`,t.wrapper.style.top=`${y}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",x="left"}else if(S){const C=Math.min(P,window.innerWidth-(r==null?void 0:r.realWidth)-v.width),y=ee(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.right=`${C}px`,t.wrapper.style.top=`${y}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",x="right"}else if(p){const C=Math.min(c,window.innerHeight-r.realHeight-v.width);let y=te(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.top=`${C}px`,t.wrapper.style.left=`${y}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",x="top"}else if(g){const C=Math.min(m,window.innerHeight-(r==null?void 0:r.realHeight)-v.width);let y=te(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:v});t.wrapper.style.left=`${y}px`,t.wrapper.style.bottom=`${C}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",x="bottom"}L?t.arrow.classList.add("driver-popover-arrow-none"):Ce(n,x,e)}function Ce(e,o,t){const i=l("popover");if(!i)return;const d=t.getBoundingClientRect(),n=U(),f=i.arrow,w=n.width,r=window.innerWidth,v=d.width,s=d.left,c=n.height,p=window.innerHeight,m=d.top,g=d.height;f.className="driver-popover-arrow";let u=o,h=e;o==="top"?(s+v<=0?(u="right",h="end"):s+v-w<=0&&(u="top",h="start"),s>=r?(u="left",h="end"):s+w>=r&&(u="top",h="end")):o==="bottom"?(s+v<=0?(u="right",h="start"):s+v-w<=0&&(u="bottom",h="start"),s>=r?(u="left",h="start"):s+w>=r&&(u="bottom",h="end")):o==="left"?(m+g<=0?(u="bottom",h="end"):m+g-c<=0&&(u="left",h="start"),m>=p?(u="top",h="end"):m+c>=p&&(u="left",h="end")):o==="right"&&(m+g<=0?(u="bottom",h="start"):m+g-c<=0&&(u="right",h="start"),m>=p?(u="top",h="start"):m+c>=p&&(u="right",h="end")),u?(f.classList.add(`driver-popover-arrow-side-${u}`),f.classList.add(`driver-popover-arrow-align-${h}`)):f.classList.add("driver-popover-arrow-none")}function Pe(){const e=document.createElement("div");e.classList.add("driver-popover");const o=document.createElement("div");o.classList.add("driver-popover-arrow");const t=document.createElement("header");t.id="driver-popover-title",t.classList.add("driver-popover-title"),t.style.display="none",t.innerText="Popover Title";const i=document.createElement("div");i.id="driver-popover-description",i.classList.add("driver-popover-description"),i.style.display="none",i.innerText="Popover description is here";const d=document.createElement("button");d.type="button",d.classList.add("driver-popover-close-btn"),d.setAttribute("aria-label","Close"),d.innerHTML="×";const n=document.createElement("footer");n.classList.add("driver-popover-footer");const f=document.createElement("span");f.classList.add("driver-popover-progress-text"),f.innerText="";const w=document.createElement("span");w.classList.add("driver-popover-navigation-btns");const r=document.createElement("button");r.type="button",r.classList.add("driver-popover-prev-btn"),r.innerHTML="← Previous";const v=document.createElement("button");return v.type="button",v.classList.add("driver-popover-next-btn"),v.innerHTML="Next →",w.appendChild(r),w.appendChild(v),n.appendChild(f),n.appendChild(w),e.appendChild(d),e.appendChild(o),e.appendChild(t),e.appendChild(i),e.appendChild(n),{wrapper:e,arrow:o,title:t,description:i,footer:n,previousButton:r,nextButton:v,closeButton:d,footerButtons:w,progress:f}}function Se(){var o;const e=l("popover");e&&((o=e.wrapper.parentElement)==null||o.removeChild(e.wrapper))}const Le="";function ke(e={}){z(e);function o(){a("allowClose")&&v()}function t(){const s=l("activeIndex"),c=a("steps")||[];if(typeof s=="undefined")return;const p=s+1;c[p]?r(p):v()}function i(){const s=l("activeIndex"),c=a("steps")||[];if(typeof s=="undefined")return;const p=s-1;c[p]?r(p):v()}function d(s){(a("steps")||[])[s]?r(s):v()}function n(){var h;if(l("__transitionCallback"))return;const c=l("activeIndex"),p=l("__activeStep"),m=l("__activeElement");if(typeof c=="undefined"||typeof p=="undefined"||typeof l("activeIndex")=="undefined")return;const u=((h=p.popover)==null?void 0:h.onPrevClick)||a("onPrevClick");if(u)return u(m,p,{config:a(),state:l()});i()}function f(){var u;if(l("__transitionCallback"))return;const c=l("activeIndex"),p=l("__activeStep"),m=l("__activeElement");if(typeof c=="undefined"||typeof p=="undefined")return;const g=((u=p.popover)==null?void 0:u.onNextClick)||a("onNextClick");if(g)return g(m,p,{config:a(),state:l()});t()}function w(){l("isInitialized")||(b("isInitialized",!0),document.body.classList.add("driver-active",a("animate")?"driver-fade":"driver-simple"),ye(),O("overlayClick",o),O("escapePress",o),O("arrowLeftPress",n),O("arrowRightPress",f))}function r(s=0){var H,$,B,R,M,I,ie,ne;const c=a("steps");if(!c){console.error("No steps to drive through"),v();return}if(!c[s]){v();return}b("__activeOnDestroyed",document.activeElement),b("activeIndex",s);const p=c[s],m=c[s+1],g=c[s-1],u=((H=p.popover)==null?void 0:H.doneBtnText)||a("doneBtnText")||"Done",h=a("allowClose"),P=typeof(($=p.popover)==null?void 0:$.showProgress)!="undefined"?(B=p.popover)==null?void 0:B.showProgress:a("showProgress"),L=(((R=p.popover)==null?void 0:R.progressText)||a("progressText")||"{{current}} of {{total}}").replace("{{current}}",`${s+1}`).replace("{{total}}",`${c.length}`),x=((M=p.popover)==null?void 0:M.showButtons)||a("showButtons"),C=["next","previous",...h?["close"]:[]].filter(_e=>!(x!=null&&x.length)||x.includes(_e)),y=((I=p.popover)==null?void 0:I.onNextClick)||a("onNextClick"),k=((ie=p.popover)==null?void 0:ie.onPrevClick)||a("onPrevClick"),E=((ne=p.popover)==null?void 0:ne.onCloseClick)||a("onCloseClick");Q({...p,popover:{showButtons:C,nextBtnText:m?void 0:u,disableButtons:[...g?[]:["previous"]],showProgress:P,progressText:L,onNextClick:y||(()=>{m?r(s+1):v()}),onPrevClick:k||(()=>{r(s-1)}),onCloseClick:E||(()=>{v()}),...(p==null?void 0:p.popover)||{}}})}function v(s=!0){const c=l("__activeElement"),p=l("__activeStep"),m=l("__activeOnDestroyed"),g=a("onDestroyStarted");if(s&&g){const P=!c||(c==null?void 0:c.id)==="driver-dummy-element";g(P?void 0:c,p,{config:a(),state:l()});return}const u=(p==null?void 0:p.onDeselected)||a("onDeselected"),h=a("onDestroyed");if(document.body.classList.remove("driver-active","driver-fade","driver-simple"),be(),Se(),we(),ve(),ce(),K(),c&&p){const P=c.id==="driver-dummy-element";u&&u(P?void 0:c,p,{config:a(),state:l()}),h&&h(P?void 0:c,p,{config:a(),state:l()})}m&&m.focus()}return{isActive:()=>l("isInitialized")||!1,refresh:A,drive:(s=0)=>{w(),r(s)},setConfig:z,setSteps:s=>{K(),z({...a(),steps:s})},getConfig:a,getState:l,getActiveIndex:()=>l("activeIndex"),isFirstStep:()=>l("activeIndex")===0,isLastStep:()=>{const s=a("steps")||[],c=l("activeIndex");return c!==void 0&&c===s.length-1},getActiveStep:()=>l("activeStep"),getActiveElement:()=>l("activeElement"),getPreviousElement:()=>l("previousElement"),getPreviousStep:()=>l("previousStep"),moveNext:t,movePrevious:i,moveTo:d,hasNextStep:()=>{const s=a("steps")||[],c=l("activeIndex");return c!==void 0&&s[c+1]},hasPreviousStep:()=>{const s=a("steps")||[],c=l("activeIndex");return c!==void 0&&s[c-1]},highlight:s=>{w(),Q({...s,popover:s.popover?{showButtons:[],showProgress:!1,progressText:"",...s.popover}:void 0})},destroy:()=>{v(!1)}}}return D.driver=ke,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),D}({}); +this.driver=this.driver||{};this.driver.js=function(z){"use strict";let q={};function V(e={}){q={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function a(e){return e?q[e]:q}function O(e,o,t,i){return(e/=i/2)<1?t/2*e*e+o:-t/2*(--e*(e-2)-1)+o}function K(e){const o='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap(t=>{const i=t.matches(o),d=Array.from(t.querySelectorAll(o));return[...i?[t]:[],...d]}).filter(t=>getComputedStyle(t).pointerEvents!=="none"&&ae(t))}function X(e){if(!e||se(e))return;const o=a("smoothScroll");e.scrollIntoView({behavior:!o||re(e)?"auto":"smooth",inline:"center",block:"center"})}function re(e){if(!e||!e.parentElement)return;const o=e.parentElement;return o.scrollHeight>o.clientHeight}function se(e){const o=e.getBoundingClientRect();return o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&o.right<=(window.innerWidth||document.documentElement.clientWidth)}function ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let D={};function x(e,o){D[e]=o}function c(e){return e?D[e]:D}function Y(){D={}}let T={};function F(e,o){T[e]=o}function _(e){var o;(o=T[e])==null||o.call(T)}function ce(){T={}}function le(e,o,t,i){let d=c("__activeStagePosition");const n=d||t.getBoundingClientRect(),f=i.getBoundingClientRect(),w=O(e,n.x,f.x-n.x,o),r=O(e,n.y,f.y-n.y,o),u=O(e,n.width,f.width-n.width,o),s=O(e,n.height,f.height-n.height,o);d={x:w,y:r,width:u,height:s},Q(d),x("__activeStagePosition",d)}function j(e){if(!e)return;const o=e.getBoundingClientRect(),t={x:o.x,y:o.y,width:o.width,height:o.height};x("__activeStagePosition",t),Q(t)}function de(){const e=c("__activeStagePosition"),o=c("__overlaySvg");if(!e)return;if(!o){console.warn("No stage svg found.");return}const t=window.innerWidth,i=window.innerHeight;o.setAttribute("viewBox",`0 0 ${t} ${i}`)}function pe(e){const o=ue(e);document.body.appendChild(o),U(o,t=>{t.target.tagName==="path"&&_("overlayClick")}),x("__overlaySvg",o)}function Q(e){const o=c("__overlaySvg");if(!o){pe(e);return}const t=o.firstElementChild;if((t==null?void 0:t.tagName)!=="path")throw new Error("no path element found in stage svg");t.setAttribute("d",Z(e))}function ue(e){const o=window.innerWidth,t=window.innerHeight,i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.classList.add("driver-overlay","driver-overlay-animated"),i.setAttribute("viewBox",`0 0 ${o} ${t}`),i.setAttribute("xmlSpace","preserve"),i.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),i.setAttribute("version","1.1"),i.setAttribute("preserveAspectRatio","xMinYMin slice"),i.style.fillRule="evenodd",i.style.clipRule="evenodd",i.style.strokeLinejoin="round",i.style.strokeMiterlimit="2",i.style.zIndex="10000",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%";const d=document.createElementNS("http://www.w3.org/2000/svg","path");return d.setAttribute("d",Z(e)),d.style.fill=a("overlayColor")||"rgb(0,0,0)",d.style.opacity=`${a("overlayOpacity")}`,d.style.pointerEvents="auto",d.style.cursor="auto",i.appendChild(d),i}function Z(e){const o=window.innerWidth,t=window.innerHeight,i=a("stagePadding")||0,d=a("stageRadius")||0,n=e.width+i*2,f=e.height+i*2,w=Math.min(d,n/2,f/2),r=Math.floor(Math.max(w,0)),u=e.x-i+r,s=e.y-i,p=n-r*2,l=f-r*2;return`M${o},0L0,0L0,${t}L${o},${t}L${o},0Z + M${u},${s} h${p} a${r},${r} 0 0 1 ${r},${r} v${l} a${r},${r} 0 0 1 -${r},${r} h-${p} a${r},${r} 0 0 1 -${r},-${r} v-${l} a${r},${r} 0 0 1 ${r},-${r} z`}function ve(){const e=c("__overlaySvg");e&&e.remove()}function fe(){const e=document.getElementById("driver-dummy-element");if(e)return e;let o=document.createElement("div");return o.id="driver-dummy-element",o.style.width="0",o.style.height="0",o.style.pointerEvents="none",o.style.opacity="0",o.style.position="fixed",o.style.top="50%",o.style.left="50%",document.body.appendChild(o),o}function G(e){const{element:o}=e;let t=typeof o=="string"?document.querySelector(o):o;t||(t=fe()),ge(t,e)}function he(){const e=c("__activeElement"),o=c("__activeStep");e&&(j(e),de(),ne(e,o))}function ge(e,o){const i=Date.now(),d=c("__activeStep"),n=c("__activeElement")||e,f=!n||n===e,w=e.id==="driver-dummy-element",r=n.id==="driver-dummy-element",u=a("animate"),s=o.onHighlightStarted||a("onHighlightStarted"),p=(o==null?void 0:o.onHighlighted)||a("onHighlighted"),l=(d==null?void 0:d.onDeselected)||a("onDeselected"),g=a(),y=c();!f&&l&&l(r?void 0:n,d,{config:g,state:y}),s&&s(w?void 0:e,o,{config:g,state:y});const h=!f&&u;let v=!1;xe(),x("previousStep",d),x("previousElement",n),x("activeStep",o),x("activeElement",e);const m=()=>{if(c("__transitionCallback")!==m)return;const C=Date.now()-i,b=400-C<=400/2;o.popover&&b&&!v&&h&&(ee(e,o),v=!0),a("animate")&&C<400?le(C,400,n,e):(j(e),p&&p(w?void 0:e,o,{config:a(),state:c()}),x("__transitionCallback",void 0),x("__previousStep",d),x("__previousElement",n),x("__activeStep",o),x("__activeElement",e)),window.requestAnimationFrame(m)};x("__transitionCallback",m),window.requestAnimationFrame(m),X(e),!h&&o.popover&&ee(e,o),n.classList.remove("driver-active-element","driver-no-interaction"),n.removeAttribute("aria-haspopup"),n.removeAttribute("aria-expanded"),n.removeAttribute("aria-controls"),a("disableActiveInteraction")&&e.classList.add("driver-no-interaction"),e.classList.add("driver-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","driver-popover-content")}function we(){var e;(e=document.getElementById("driver-dummy-element"))==null||e.remove(),document.querySelectorAll(".driver-active-element").forEach(o=>{o.classList.remove("driver-active-element","driver-no-interaction"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-controls")})}function A(){const e=c("__resizeTimeout");e&&window.cancelAnimationFrame(e),x("__resizeTimeout",window.requestAnimationFrame(he))}function me(e){var r;if(!c("isInitialized")||!(e.key==="Tab"||e.keyCode===9))return;const i=c("__activeElement"),d=(r=c("popover"))==null?void 0:r.wrapper,n=K([...d?[d]:[],...i?[i]:[]]),f=n[0],w=n[n.length-1];if(e.preventDefault(),e.shiftKey){const u=n[n.indexOf(document.activeElement)-1]||w;u==null||u.focus()}else{const u=n[n.indexOf(document.activeElement)+1]||f;u==null||u.focus()}}function J(e){var t;((t=a("allowKeyboardControl"))==null||t)&&(e.key==="Escape"?_("escapePress"):e.key==="ArrowRight"?_("arrowRightPress"):e.key==="ArrowLeft"&&_("arrowLeftPress"))}function U(e,o,t){const i=(n,f)=>{const w=n.target;e.contains(w)&&((!t||t(w))&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()),f==null||f(n))};document.addEventListener("pointerdown",i,!0),document.addEventListener("mousedown",i,!0),document.addEventListener("pointerup",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("click",n=>{i(n,o)},!0)}function ye(){window.addEventListener("keyup",J,!1),window.addEventListener("keydown",me,!1),window.addEventListener("resize",A),window.addEventListener("scroll",A)}function be(){window.removeEventListener("keyup",J),window.removeEventListener("resize",A),window.removeEventListener("scroll",A)}function xe(){const e=c("popover");e&&(e.wrapper.style.display="none")}function ee(e,o){var H,$;let t=c("popover");t&&document.body.removeChild(t.wrapper),t=Pe(),document.body.appendChild(t.wrapper);const{title:i,description:d,showButtons:n,disableButtons:f,showProgress:w,nextBtnText:r=a("nextBtnText")||"Next",prevBtnText:u=a("prevBtnText")||"Previous",progressText:s=a("progressText")||"{current} of {total}"}=o.popover||{},p=document.createElement("span");p.ariaHidden="true",p.textContent=" →";const l=document.createElement("span");l.ariaHidden="true",l.textContent="← ",t.nextButton.innerHTML=r,t.nextButton.appendChild(p),t.previousButton.innerHTML=u,t.previousButton.insertBefore(l,t.previousButton.firstChild),t.progress.innerHTML=s,i?(t.title.innerHTML=i,t.title.style.display="block"):t.title.style.display="none",d?(t.description.innerHTML=d,t.description.style.display="block"):t.description.style.display="none";const g=n||a("showButtons"),y=w||a("showProgress")||!1,h=(g==null?void 0:g.includes("next"))||(g==null?void 0:g.includes("previous"))||y;t.closeButton.style.display=g.includes("close")?"block":"none",h?(t.footer.style.display="flex",t.progress.style.display=y?"block":"none",t.nextButton.style.display=g.includes("next")?"block":"none",t.previousButton.style.display=g.includes("previous")?"block":"none"):t.footer.style.display="none";const v=f||a("disableButtons")||[];v!=null&&v.includes("next")&&(t.nextButton.disabled=!0,t.nextButton.classList.add("driver-popover-btn-disabled")),v!=null&&v.includes("previous")&&(t.previousButton.disabled=!0,t.previousButton.classList.add("driver-popover-btn-disabled")),v!=null&&v.includes("close")&&(t.closeButton.disabled=!0,t.closeButton.classList.add("driver-popover-btn-disabled"));const m=t.wrapper;m.style.display="block",m.style.left="",m.style.top="",m.style.bottom="",m.style.right="",m.id="driver-popover-content",m.setAttribute("role","dialog"),m.setAttribute("aria-labelledby","driver-popover-title"),m.setAttribute("aria-describedby","driver-popover-description");const S=t.arrow;S.className="driver-popover-arrow";const L=((H=o.popover)==null?void 0:H.popoverClass)||a("popoverClass")||"";m.className=`driver-popover ${L}`.trim(),U(t.wrapper,k=>{var I,W,N;const E=k.target,B=((I=o.popover)==null?void 0:I.onNextClick)||a("onNextClick"),M=((W=o.popover)==null?void 0:W.onPrevClick)||a("onPrevClick"),R=((N=o.popover)==null?void 0:N.onCloseClick)||a("onCloseClick");if(E.classList.contains("driver-popover-next-btn"))return B?B(e,o,{config:a(),state:c()}):_("nextClick");if(E.classList.contains("driver-popover-prev-btn"))return M?M(e,o,{config:a(),state:c()}):_("prevClick");if(E.classList.contains("driver-popover-close-btn"))return R?R(e,o,{config:a(),state:c()}):_("closeClick")},k=>!(t!=null&&t.description.contains(k))&&!(t!=null&&t.title.contains(k))&&typeof k.className=="string"&&k.className.includes("driver-popover")),x("popover",t);const C=(($=o.popover)==null?void 0:$.onPopoverRender)||a("onPopoverRender");C&&C(t,{config:a(),state:c()}),ne(e,o),X(m);const P=e.classList.contains("driver-dummy-element"),b=K([m,...P?[]:[e]]);b.length>0&&b[0].focus()}function te(){const e=c("popover");if(!(e!=null&&e.wrapper))return;const o=e.wrapper.getBoundingClientRect(),t=a("stagePadding")||0,i=a("popoverOffset")||0;return{width:o.width+t+i,height:o.height+t+i,realWidth:o.width,realHeight:o.height}}function oe(e,o){const{elementDimensions:t,popoverDimensions:i,popoverPadding:d,popoverArrowDimensions:n}=o;return e==="start"?Math.max(Math.min(t.top-d,window.innerHeight-i.realHeight-n.width),n.width):e==="end"?Math.max(Math.min(t.top-(i==null?void 0:i.realHeight)+t.height+d,window.innerHeight-(i==null?void 0:i.realHeight)-n.width),n.width):e==="center"?Math.max(Math.min(t.top+t.height/2-(i==null?void 0:i.realHeight)/2,window.innerHeight-(i==null?void 0:i.realHeight)-n.width),n.width):0}function ie(e,o){const{elementDimensions:t,popoverDimensions:i,popoverPadding:d,popoverArrowDimensions:n}=o;return e==="start"?Math.max(Math.min(t.left-d,window.innerWidth-i.realWidth-n.width),n.width):e==="end"?Math.max(Math.min(t.left-(i==null?void 0:i.realWidth)+t.width+d,window.innerWidth-(i==null?void 0:i.realWidth)-n.width),n.width):e==="center"?Math.max(Math.min(t.left+t.width/2-(i==null?void 0:i.realWidth)/2,window.innerWidth-(i==null?void 0:i.realWidth)-n.width),n.width):0}function ne(e,o){const t=c("popover");if(!t)return;const{align:i="start",side:d="left"}=(o==null?void 0:o.popover)||{},n=i,f=e.id==="driver-dummy-element"?"over":d,w=a("stagePadding")||0,r=te(),u=t.arrow.getBoundingClientRect(),s=e.getBoundingClientRect(),p=s.top-r.height;let l=p>=0;const g=window.innerHeight-(s.bottom+r.height);let y=g>=0;const h=s.left-r.width;let v=h>=0;const m=window.innerWidth-(s.right+r.width);let S=m>=0;const L=!l&&!y&&!v&&!S;let C=f;if(f==="top"&&l?S=v=y=!1:f==="bottom"&&y?S=v=l=!1:f==="left"&&v?S=l=y=!1:f==="right"&&S&&(v=l=y=!1),f==="over"){const P=window.innerWidth/2-r.realWidth/2,b=window.innerHeight/2-r.realHeight/2;t.wrapper.style.left=`${P}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${b}px`,t.wrapper.style.bottom="auto"}else if(L){const P=window.innerWidth/2-(r==null?void 0:r.realWidth)/2,b=10;t.wrapper.style.left=`${P}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom=`${b}px`,t.wrapper.style.top="auto"}else if(v){const P=Math.min(h,window.innerWidth-(r==null?void 0:r.realWidth)-u.width),b=oe(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:u});t.wrapper.style.left=`${P}px`,t.wrapper.style.top=`${b}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",C="left"}else if(S){const P=Math.min(m,window.innerWidth-(r==null?void 0:r.realWidth)-u.width),b=oe(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:u});t.wrapper.style.right=`${P}px`,t.wrapper.style.top=`${b}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",C="right"}else if(l){const P=Math.min(p,window.innerHeight-r.realHeight-u.width);let b=ie(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:u});t.wrapper.style.top=`${P}px`,t.wrapper.style.left=`${b}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",C="top"}else if(y){const P=Math.min(g,window.innerHeight-(r==null?void 0:r.realHeight)-u.width);let b=ie(n,{elementDimensions:s,popoverDimensions:r,popoverPadding:w,popoverArrowDimensions:u});t.wrapper.style.left=`${b}px`,t.wrapper.style.bottom=`${P}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",C="bottom"}L?t.arrow.classList.add("driver-popover-arrow-none"):Ce(n,C,e)}function Ce(e,o,t){const i=c("popover");if(!i)return;const d=t.getBoundingClientRect(),n=te(),f=i.arrow,w=n.width,r=window.innerWidth,u=d.width,s=d.left,p=n.height,l=window.innerHeight,g=d.top,y=d.height;f.className="driver-popover-arrow";let h=o,v=e;o==="top"?(s+u<=0?(h="right",v="end"):s+u-w<=0&&(h="top",v="start"),s>=r?(h="left",v="end"):s+w>=r&&(h="top",v="end")):o==="bottom"?(s+u<=0?(h="right",v="start"):s+u-w<=0&&(h="bottom",v="start"),s>=r?(h="left",v="start"):s+w>=r&&(h="bottom",v="end")):o==="left"?(g+y<=0?(h="bottom",v="end"):g+y-p<=0&&(h="left",v="start"),g>=l?(h="top",v="end"):g+p>=l&&(h="left",v="end")):o==="right"&&(g+y<=0?(h="bottom",v="start"):g+y-p<=0&&(h="right",v="start"),g>=l?(h="top",v="start"):g+p>=l&&(h="right",v="end")),h?(f.classList.add(`driver-popover-arrow-side-${h}`),f.classList.add(`driver-popover-arrow-align-${v}`)):f.classList.add("driver-popover-arrow-none")}function Pe(){const e=document.createElement("div");e.classList.add("driver-popover");const o=document.createElement("div");o.classList.add("driver-popover-arrow");const t=document.createElement("header");t.id="driver-popover-title",t.classList.add("driver-popover-title"),t.style.display="none",t.innerText="Popover Title";const i=document.createElement("div");i.id="driver-popover-description",i.classList.add("driver-popover-description"),i.style.display="none",i.innerText="Popover description is here";const d=document.createElement("button");d.type="button",d.classList.add("driver-popover-close-btn"),d.setAttribute("aria-label","Close"),d.innerHTML="×";const n=document.createElement("footer");n.classList.add("driver-popover-footer");const f=document.createElement("span");f.classList.add("driver-popover-progress-text"),f.innerText="";const w=document.createElement("span");w.classList.add("driver-popover-navigation-btns");const r=document.createElement("button");r.type="button",r.classList.add("driver-popover-prev-btn"),r.innerHTML="← Previous";const u=document.createElement("button");return u.type="button",u.classList.add("driver-popover-next-btn"),u.innerHTML="Next →",w.appendChild(r),w.appendChild(u),n.appendChild(f),n.appendChild(w),e.appendChild(d),e.appendChild(o),e.appendChild(t),e.appendChild(i),e.appendChild(n),{wrapper:e,arrow:o,title:t,description:i,footer:n,previousButton:r,nextButton:u,closeButton:d,footerButtons:w,progress:f}}function Se(){var o;const e=c("popover");e&&((o=e.wrapper.parentElement)==null||o.removeChild(e.wrapper))}const Le="";function ke(e={}){V(e);function o(){a("allowClose")&&u()}function t(){const s=c("activeIndex"),p=a("steps")||[];if(typeof s=="undefined")return;const l=s+1;p[l]?r(l):u()}function i(){const s=c("activeIndex"),p=a("steps")||[];if(typeof s=="undefined")return;const l=s-1;p[l]?r(l):u()}function d(s){(a("steps")||[])[s]?r(s):u()}function n(){var v;if(c("__transitionCallback"))return;const p=c("activeIndex"),l=c("__activeStep"),g=c("__activeElement");if(typeof p=="undefined"||typeof l=="undefined"||typeof c("activeIndex")=="undefined")return;const h=((v=l.popover)==null?void 0:v.onPrevClick)||a("onPrevClick");if(h)return h(g,l,{config:a(),state:c()});i()}function f(){var h;if(c("__transitionCallback"))return;const p=c("activeIndex"),l=c("__activeStep"),g=c("__activeElement");if(typeof p=="undefined"||typeof l=="undefined")return;const y=((h=l.popover)==null?void 0:h.onNextClick)||a("onNextClick");if(y)return y(g,l,{config:a(),state:c()});t()}function w(){c("isInitialized")||(x("isInitialized",!0),document.body.classList.add("driver-active",a("animate")?"driver-fade":"driver-simple"),ye(),F("overlayClick",o),F("escapePress",o),F("arrowLeftPress",n),F("arrowRightPress",f))}function r(s=0){var k,E,B,M,R,I,W,N;const p=a("steps");if(!p){console.error("No steps to drive through"),u();return}if(!p[s]){u();return}x("__activeOnDestroyed",document.activeElement),x("activeIndex",s);const l=p[s],g=p[s+1],y=p[s-1],h=((k=l.popover)==null?void 0:k.doneBtnText)||a("doneBtnText")||"Done",v=a("allowClose"),m=typeof((E=l.popover)==null?void 0:E.showProgress)!="undefined"?(B=l.popover)==null?void 0:B.showProgress:a("showProgress"),L=(((M=l.popover)==null?void 0:M.progressText)||a("progressText")||"{{current}} of {{total}}").replace("{{current}}",`${s+1}`).replace("{{total}}",`${p.length}`),C=((R=l.popover)==null?void 0:R.showButtons)||a("showButtons"),P=["next","previous",...v?["close"]:[]].filter(_e=>!(C!=null&&C.length)||C.includes(_e)),b=((I=l.popover)==null?void 0:I.onNextClick)||a("onNextClick"),H=((W=l.popover)==null?void 0:W.onPrevClick)||a("onPrevClick"),$=((N=l.popover)==null?void 0:N.onCloseClick)||a("onCloseClick");G({...l,popover:{showButtons:P,nextBtnText:g?void 0:h,disableButtons:[...y?[]:["previous"]],showProgress:m,progressText:L,onNextClick:b||(()=>{g?r(s+1):u()}),onPrevClick:H||(()=>{r(s-1)}),onCloseClick:$||(()=>{u()}),...(l==null?void 0:l.popover)||{}}})}function u(s=!0){const p=c("__activeElement"),l=c("__activeStep"),g=c("__activeOnDestroyed"),y=a("onDestroyStarted");if(s&&y){const m=!p||(p==null?void 0:p.id)==="driver-dummy-element";y(m?void 0:p,l,{config:a(),state:c()});return}const h=(l==null?void 0:l.onDeselected)||a("onDeselected"),v=a("onDestroyed");if(document.body.classList.remove("driver-active","driver-fade","driver-simple"),be(),Se(),we(),ve(),ce(),Y(),p&&l){const m=p.id==="driver-dummy-element";h&&h(m?void 0:p,l,{config:a(),state:c()}),v&&v(m?void 0:p,l,{config:a(),state:c()})}g&&g.focus()}return{isActive:()=>c("isInitialized")||!1,refresh:A,drive:(s=0)=>{w(),r(s)},setConfig:V,setSteps:s=>{Y(),V({...a(),steps:s})},getConfig:a,getState:c,getActiveIndex:()=>c("activeIndex"),isFirstStep:()=>c("activeIndex")===0,isLastStep:()=>{const s=a("steps")||[],p=c("activeIndex");return p!==void 0&&p===s.length-1},getActiveStep:()=>c("activeStep"),getActiveElement:()=>c("activeElement"),getPreviousElement:()=>c("previousElement"),getPreviousStep:()=>c("previousStep"),moveNext:t,movePrevious:i,moveTo:d,hasNextStep:()=>{const s=a("steps")||[],p=c("activeIndex");return p!==void 0&&s[p+1]},hasPreviousStep:()=>{const s=a("steps")||[],p=c("activeIndex");return p!==void 0&&s[p-1]},highlight:s=>{w(),G({...s,popover:s.popover?{showButtons:[],showProgress:!1,progressText:"",...s.popover}:void 0})},destroy:()=>{u(!1)}}}return z.driver=ke,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),z}({});