this.driver=this.driver||{},this.driver.js=(function(v){"use strict";let b={};function k(e={}){b={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 o(e){return e?b[e]:b}function s(e,r,n,l){return(e/=l/2)<1?n/2*e*e+r:-n/2*(--e*(e-2)-1)+r}function t(e){const r='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(n=>{const l=n.matches(r),i=Array.from(n.querySelectorAll(r));return[...l?[n]:[],...i]}).filter(n=>getComputedStyle(n).pointerEvents!=="none"&&T(n))}function a(e){if(!e||h(e))return;const r=o("smoothScroll");e.scrollIntoView({behavior:!r||d(e)?"auto":"smooth",inline:"center",block:"center"})}function d(e){if(!e||!e.parentElement)return;const r=e.parentElement;return r.scrollHeight>r.clientHeight}function h(e){const r=e.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function T(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let c={};function x(e,r){c[e]=r}function p(e){return e?c[e]:c}function B(){c={}}let R={};function U(e,r){R[e]=r}function H(e){var r;(r=R[e])==null||r.call(R)}function se(){R={}}function ae(e,r,n,l){let i=p("__activeStagePosition");const g=i||n.getBoundingClientRect(),C=l.getBoundingClientRect(),E=s(e,g.x,C.x-g.x,r),m=s(e,g.y,C.y-g.y,r),S=s(e,g.width,C.width-g.width,r),u=s(e,g.height,C.height-g.height,r);i={x:E,y:m,width:S,height:u},J(i),x("__activeStagePosition",i)}function K(e){if(!e)return;const r=e.getBoundingClientRect(),n={x:r.x,y:r.y,width:r.width,height:r.height};x("__activeStagePosition",n),J(n)}function le(){const e=p("__activeStagePosition"),r=p("__overlaySvg");if(!e)return;if(!r){console.warn("No stage svg found.");return}const n=window.innerWidth,l=window.innerHeight;r.setAttribute("viewBox",`0 0 ${n} ${l}`)}function de(e){const r=pe(e);document.body.appendChild(r),ee(r,n=>{n.target.tagName==="path"&&H("overlayClick")}),x("__overlaySvg",r)}function J(e){const r=p("__overlaySvg");if(!r){de(e);return}const n=r.firstElementChild;if(n?.tagName!=="path")throw new Error("no path element found in stage svg");n.setAttribute("d",Q(e))}function pe(e){const r=window.innerWidth,n=window.innerHeight,l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.classList.add("driver-overlay","driver-overlay-animated"),l.setAttribute("viewBox",`0 0 ${r} ${n}`),l.setAttribute("xmlSpace","preserve"),l.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),l.setAttribute("version","1.1"),l.setAttribute("preserveAspectRatio","xMinYMin slice"),l.style.fillRule="evenodd",l.style.clipRule="evenodd",l.style.strokeLinejoin="round",l.style.strokeMiterlimit="2",l.style.zIndex="10000",l.style.position="fixed",l.style.top="0",l.style.left="0",l.style.width="100%",l.style.height="100%";const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",Q(e)),i.style.fill=o("overlayColor")||"rgb(0,0,0)",i.style.opacity=`${o("overlayOpacity")}`,i.style.pointerEvents="auto",i.style.cursor="auto",l.appendChild(i),l}function Q(e){const r=window.innerWidth,n=window.innerHeight,l=o("stagePadding")||0,i=o("stageRadius")||0,g=e.width+l*2,C=e.height+l*2,E=Math.min(i,g/2,C/2),m=Math.floor(Math.max(E,0)),S=e.x-l+m,u=e.y-l,f=g-m*2,y=C-m*2;return`M${r},0L0,0L0,${n}L${r},${n}L${r},0Z M${S},${u} h${f} a${m},${m} 0 0 1 ${m},${m} v${y} a${m},${m} 0 0 1 -${m},${m} h-${f} a${m},${m} 0 0 1 -${m},-${m} v-${y} a${m},${m} 0 0 1 ${m},-${m} z`}function ce(){const e=p("__overlaySvg");e&&e.remove()}function ue(){const e=document.getElementById("driver-dummy-element");if(e)return e;let r=document.createElement("div");return r.id="driver-dummy-element",r.style.width="0",r.style.height="0",r.style.pointerEvents="none",r.style.opacity="0",r.style.position="fixed",r.style.top="50%",r.style.left="50%",document.body.appendChild(r),r}function X(e){const{element:r}=e;let n=typeof r=="string"?document.querySelector(r):r;n||(n=ue()),he(n,e)}function me(){const e=p("__activeElement"),r=p("__activeStep");e&&(K(e),le(),ne(e,r))}function he(e,r){const n=Date.now(),l=p("__activeStep"),i=p("__activeElement")||e,g=!i||i===e,C=e.id==="driver-dummy-element",E=i.id==="driver-dummy-element",m=o("animate"),S=r.onHighlightStarted||o("onHighlightStarted"),u=r?.onHighlighted||o("onHighlighted"),f=l?.onDeselected||o("onDeselected"),y=o(),D=p();!g&&f&&f(E?void 0:i,l,{config:y,state:D}),S&&S(C?void 0:e,r,{config:y,state:D});const _=!g&&m;let A=!1;we(),x("previousStep",l),x("previousElement",i),x("activeStep",r),x("activeElement",e);const w=()=>{if(p("__transitionCallback")!==w)return;const P=Date.now()-n,$=400-P<=400/2;r.popover&&$&&!A&&_&&(te(e,r),A=!0),o("animate")&&P<400?ae(P,400,i,e):(K(e),u&&u(C?void 0:e,r,{config:o(),state:p()}),x("__transitionCallback",void 0),x("__previousStep",l),x("__previousElement",i),x("__activeStep",r),x("__activeElement",e)),window.requestAnimationFrame(w)};x("__transitionCallback",w),window.requestAnimationFrame(w),a(e),!_&&r.popover&&te(e,r),i.classList.remove("driver-active-element","driver-no-interaction"),i.removeAttribute("aria-haspopup"),i.removeAttribute("aria-expanded"),i.removeAttribute("aria-controls"),o("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 ge(){var e;(e=document.getElementById("driver-dummy-element"))==null||e.remove(),document.querySelectorAll(".driver-active-element").forEach(r=>{r.classList.remove("driver-active-element","driver-no-interaction"),r.removeAttribute("aria-haspopup"),r.removeAttribute("aria-expanded"),r.removeAttribute("aria-controls")})}function F(){const e=p("__resizeTimeout");e&&window.cancelAnimationFrame(e),x("__resizeTimeout",window.requestAnimationFrame(me))}function ve(e){var r;if(!p("isInitialized")||!(e.key==="Tab"||e.keyCode===9))return;const n=p("__activeElement"),l=(r=p("popover"))==null?void 0:r.wrapper,i=t([...l?[l]:[],...n?[n]:[]]),g=i[0],C=i[i.length-1];if(e.preventDefault(),e.shiftKey){const E=i[i.indexOf(document.activeElement)-1]||C;E?.focus()}else{const E=i[i.indexOf(document.activeElement)+1]||g;E?.focus()}}function Z(e){var r;((r=o("allowKeyboardControl"))==null||r)&&(e.key==="Escape"?H("escapePress"):e.key==="ArrowRight"?H("arrowRightPress"):e.key==="ArrowLeft"&&H("arrowLeftPress"))}function ee(e,r,n){const l=(i,g)=>{const C=i.target;e.contains(C)&&((!n||n(C))&&(i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation()),g?.(i))};document.addEventListener("pointerdown",l,!0),document.addEventListener("mousedown",l,!0),document.addEventListener("pointerup",l,!0),document.addEventListener("mouseup",l,!0),document.addEventListener("click",i=>{l(i,r)},!0)}function fe(){window.addEventListener("keyup",Z,!1),window.addEventListener("keydown",ve,!1),window.addEventListener("resize",F),window.addEventListener("scroll",F)}function ye(){window.removeEventListener("keyup",Z),window.removeEventListener("resize",F),window.removeEventListener("scroll",F)}function we(){const e=p("popover");e&&(e.wrapper.style.display="none")}function te(e,r){var n,l;let i=p("popover");i&&document.body.removeChild(i.wrapper),i=Te(),document.body.appendChild(i.wrapper);const{title:g,description:C,showButtons:E,disableButtons:m,showProgress:S,nextBtnText:u=o("nextBtnText")||"Next →",prevBtnText:f=o("prevBtnText")||"← Previous",progressText:y=o("progressText")||"{current} of {total}"}=r.popover||{};i.nextButton.innerHTML=u,i.previousButton.innerHTML=f,i.progress.innerHTML=y,g?(i.title.innerHTML=g,i.title.style.display="block"):i.title.style.display="none",C?(i.description.innerHTML=C,i.description.style.display="block"):i.description.style.display="none";const D=E||o("showButtons"),_=S||o("showProgress")||!1,A=D?.includes("next")||D?.includes("previous")||_;i.closeButton.style.display=D.includes("close")?"block":"none",A?(i.footer.style.display="flex",i.progress.style.display=_?"block":"none",i.nextButton.style.display=D.includes("next")?"block":"none",i.previousButton.style.display=D.includes("previous")?"block":"none"):i.footer.style.display="none";const w=m||o("disableButtons")||[];w!=null&&w.includes("next")&&(i.nextButton.disabled=!0,i.nextButton.classList.add("driver-popover-btn-disabled")),w!=null&&w.includes("previous")&&(i.previousButton.disabled=!0,i.previousButton.classList.add("driver-popover-btn-disabled")),w!=null&&w.includes("close")&&(i.closeButton.disabled=!0,i.closeButton.classList.add("driver-popover-btn-disabled"));const P=i.wrapper;P.style.display="block",P.style.left="",P.style.top="",P.style.bottom="",P.style.right="",P.id="driver-popover-content",P.setAttribute("role","dialog"),P.setAttribute("aria-labelledby","driver-popover-title"),P.setAttribute("aria-describedby","driver-popover-description");const $=i.arrow;$.className="driver-popover-arrow";const M=((n=r.popover)==null?void 0:n.popoverClass)||o("popoverClass")||"";P.className=`driver-popover ${M}`.trim(),ee(i.wrapper,O=>{var W,j,V;const z=O.target,G=((W=r.popover)==null?void 0:W.onNextClick)||o("onNextClick"),q=((j=r.popover)==null?void 0:j.onPrevClick)||o("onPrevClick"),Y=((V=r.popover)==null?void 0:V.onCloseClick)||o("onCloseClick");if(z.classList.contains("driver-popover-next-btn"))return G?G(e,r,{config:o(),state:p()}):H("nextClick");if(z.classList.contains("driver-popover-prev-btn"))return q?q(e,r,{config:o(),state:p()}):H("prevClick");if(z.classList.contains("driver-popover-close-btn"))return Y?Y(e,r,{config:o(),state:p()}):H("closeClick")},O=>!(i!=null&&i.description.contains(O))&&!(i!=null&&i.title.contains(O))&&typeof O.className=="string"&&O.className.includes("driver-popover")),x("popover",i);const L=((l=r.popover)==null?void 0:l.onPopoverRender)||o("onPopoverRender");L&&L(i,{config:o(),state:p()}),ne(e,r),a(P);const I=e.classList.contains("driver-dummy-element"),N=t([P,...I?[]:[e]]);N.length>0&&N[0].focus()}function re(){const e=p("popover");if(!(e!=null&&e.wrapper))return;const r=e.wrapper.getBoundingClientRect(),n=o("stagePadding")||0,l=o("popoverOffset")||0;return{width:r.width+n+l,height:r.height+n+l,realWidth:r.width,realHeight:r.height}}function oe(e,r){const{elementDimensions:n,popoverDimensions:l,popoverPadding:i,popoverArrowDimensions:g}=r;return e==="start"?Math.max(Math.min(n.top-i,window.innerHeight-l.realHeight-g.width),g.width):e==="end"?Math.max(Math.min(n.top-l?.realHeight+n.height+i,window.innerHeight-l?.realHeight-g.width),g.width):e==="center"?Math.max(Math.min(n.top+n.height/2-l?.realHeight/2,window.innerHeight-l?.realHeight-g.width),g.width):0}function ie(e,r){const{elementDimensions:n,popoverDimensions:l,popoverPadding:i,popoverArrowDimensions:g}=r;return e==="start"?Math.max(Math.min(n.left-i,window.innerWidth-l.realWidth-g.width),g.width):e==="end"?Math.max(Math.min(n.left-l?.realWidth+n.width+i,window.innerWidth-l?.realWidth-g.width),g.width):e==="center"?Math.max(Math.min(n.left+n.width/2-l?.realWidth/2,window.innerWidth-l?.realWidth-g.width),g.width):0}function ne(e,r){const n=p("popover");if(!n)return;const{align:l="start",side:i="left"}=r?.popover||{},g=l,C=e.id==="driver-dummy-element"?"over":i,E=o("stagePadding")||0,m=re(),S=n.arrow.getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.top-m.height;let y=f>=0;const D=window.innerHeight-(u.bottom+m.height);let _=D>=0;const A=u.left-m.width;let w=A>=0;const P=window.innerWidth-(u.right+m.width);let $=P>=0;const M=!y&&!_&&!w&&!$;let L=C;if(C==="top"&&y?$=w=_=!1:C==="bottom"&&_?$=w=y=!1:C==="left"&&w?$=y=_=!1:C==="right"&&$&&(w=y=_=!1),C==="over"){const I=window.innerWidth/2-m.realWidth/2,N=window.innerHeight/2-m.realHeight/2;n.wrapper.style.left=`${I}px`,n.wrapper.style.right="auto",n.wrapper.style.top=`${N}px`,n.wrapper.style.bottom="auto"}else if(M){const I=window.innerWidth/2-m?.realWidth/2,N=10;n.wrapper.style.left=`${I}px`,n.wrapper.style.right="auto",n.wrapper.style.bottom=`${N}px`,n.wrapper.style.top="auto"}else if(w){const I=Math.min(A,window.innerWidth-m?.realWidth-S.width),N=oe(g,{elementDimensions:u,popoverDimensions:m,popoverPadding:E,popoverArrowDimensions:S});n.wrapper.style.left=`${I}px`,n.wrapper.style.top=`${N}px`,n.wrapper.style.bottom="auto",n.wrapper.style.right="auto",L="left"}else if($){const I=Math.min(P,window.innerWidth-m?.realWidth-S.width),N=oe(g,{elementDimensions:u,popoverDimensions:m,popoverPadding:E,popoverArrowDimensions:S});n.wrapper.style.right=`${I}px`,n.wrapper.style.top=`${N}px`,n.wrapper.style.bottom="auto",n.wrapper.style.left="auto",L="right"}else if(y){const I=Math.min(f,window.innerHeight-m.realHeight-S.width);let N=ie(g,{elementDimensions:u,popoverDimensions:m,popoverPadding:E,popoverArrowDimensions:S});n.wrapper.style.top=`${I}px`,n.wrapper.style.left=`${N}px`,n.wrapper.style.bottom="auto",n.wrapper.style.right="auto",L="top"}else if(_){const I=Math.min(D,window.innerHeight-m?.realHeight-S.width);let N=ie(g,{elementDimensions:u,popoverDimensions:m,popoverPadding:E,popoverArrowDimensions:S});n.wrapper.style.left=`${N}px`,n.wrapper.style.bottom=`${I}px`,n.wrapper.style.top="auto",n.wrapper.style.right="auto",L="bottom"}M?n.arrow.classList.add("driver-popover-arrow-none"):be(g,L,e)}function be(e,r,n){const l=p("popover");if(!l)return;const i=n.getBoundingClientRect(),g=re(),C=l.arrow,E=g.width,m=window.innerWidth,S=i.width,u=i.left,f=g.height,y=window.innerHeight,D=i.top,_=i.height;C.className="driver-popover-arrow";let A=r,w=e;r==="top"?(u+S<=0?(A="right",w="end"):u+S-E<=0&&(A="top",w="start"),u>=m?(A="left",w="end"):u+E>=m&&(A="top",w="end")):r==="bottom"?(u+S<=0?(A="right",w="start"):u+S-E<=0&&(A="bottom",w="start"),u>=m?(A="left",w="start"):u+E>=m&&(A="bottom",w="end")):r==="left"?(D+_<=0?(A="bottom",w="end"):D+_-f<=0&&(A="left",w="start"),D>=y?(A="top",w="end"):D+f>=y&&(A="left",w="end")):r==="right"&&(D+_<=0?(A="bottom",w="start"):D+_-f<=0&&(A="right",w="start"),D>=y?(A="top",w="start"):D+f>=y&&(A="right",w="end")),A?(C.classList.add(`driver-popover-arrow-side-${A}`),C.classList.add(`driver-popover-arrow-align-${w}`)):C.classList.add("driver-popover-arrow-none")}function Te(){const e=document.createElement("div");e.classList.add("driver-popover");const r=document.createElement("div");r.classList.add("driver-popover-arrow");const n=document.createElement("header");n.id="driver-popover-title",n.classList.add("driver-popover-title"),n.style.display="none",n.innerText="Popover Title";const l=document.createElement("div");l.id="driver-popover-description",l.classList.add("driver-popover-description"),l.style.display="none",l.innerText="Popover description is here";const i=document.createElement("button");i.type="button",i.classList.add("driver-popover-close-btn"),i.setAttribute("aria-label","Close"),i.innerHTML="×";const g=document.createElement("footer");g.classList.add("driver-popover-footer");const C=document.createElement("span");C.classList.add("driver-popover-progress-text"),C.innerText="";const E=document.createElement("span");E.classList.add("driver-popover-navigation-btns");const m=document.createElement("button");m.type="button",m.classList.add("driver-popover-prev-btn"),m.innerHTML="← Previous";const S=document.createElement("button");return S.type="button",S.classList.add("driver-popover-next-btn"),S.innerHTML="Next →",E.appendChild(m),E.appendChild(S),g.appendChild(C),g.appendChild(E),e.appendChild(i),e.appendChild(r),e.appendChild(n),e.appendChild(l),e.appendChild(g),{wrapper:e,arrow:r,title:n,description:l,footer:g,previousButton:m,nextButton:S,closeButton:i,footerButtons:E,progress:C}}function Se(){var e;const r=p("popover");r&&((e=r.wrapper.parentElement)==null||e.removeChild(r.wrapper))}const Ee="";function Ce(e={}){k(e);function r(){o("allowClose")&&S()}function n(){const u=p("activeIndex"),f=o("steps")||[];if(typeof u>"u")return;const y=u+1;f[y]?m(y):S()}function l(){const u=p("activeIndex"),f=o("steps")||[];if(typeof u>"u")return;const y=u-1;f[y]?m(y):S()}function i(u){(o("steps")||[])[u]?m(u):S()}function g(){var u;if(p("__transitionCallback"))return;const f=p("activeIndex"),y=p("__activeStep"),D=p("__activeElement");if(typeof f>"u"||typeof y>"u"||typeof p("activeIndex")>"u")return;const _=((u=y.popover)==null?void 0:u.onPrevClick)||o("onPrevClick");if(_)return _(D,y,{config:o(),state:p()});l()}function C(){var u;if(p("__transitionCallback"))return;const f=p("activeIndex"),y=p("__activeStep"),D=p("__activeElement");if(typeof f>"u"||typeof y>"u")return;const _=((u=y.popover)==null?void 0:u.onNextClick)||o("onNextClick");if(_)return _(D,y,{config:o(),state:p()});n()}function E(){p("isInitialized")||(x("isInitialized",!0),document.body.classList.add("driver-active",o("animate")?"driver-fade":"driver-simple"),fe(),U("overlayClick",r),U("escapePress",r),U("arrowLeftPress",g),U("arrowRightPress",C))}function m(u=0){var f,y,D,_,A,w,P,$;const M=o("steps");if(!M){console.error("No steps to drive through"),S();return}if(!M[u]){S();return}x("__activeOnDestroyed",document.activeElement),x("activeIndex",u);const L=M[u],I=M[u+1],N=M[u-1],O=((f=L.popover)==null?void 0:f.doneBtnText)||o("doneBtnText")||"Done",W=o("allowClose"),j=typeof((y=L.popover)==null?void 0:y.showProgress)<"u"?(D=L.popover)==null?void 0:D.showProgress:o("showProgress"),V=(((_=L.popover)==null?void 0:_.progressText)||o("progressText")||"{{current}} of {{total}}").replace("{{current}}",`${u+1}`).replace("{{total}}",`${M.length}`),z=((A=L.popover)==null?void 0:A.showButtons)||o("showButtons"),G=["next","previous",...W?["close"]:[]].filter(ke=>!(z!=null&&z.length)||z.includes(ke)),q=((w=L.popover)==null?void 0:w.onNextClick)||o("onNextClick"),Y=((P=L.popover)==null?void 0:P.onPrevClick)||o("onPrevClick"),xe=(($=L.popover)==null?void 0:$.onCloseClick)||o("onCloseClick");X({...L,popover:{showButtons:G,nextBtnText:I?void 0:O,disableButtons:[...N?[]:["previous"]],showProgress:j,progressText:V,onNextClick:q||(()=>{I?m(u+1):S()}),onPrevClick:Y||(()=>{m(u-1)}),onCloseClick:xe||(()=>{S()}),...L?.popover||{}}})}function S(u=!0){const f=p("__activeElement"),y=p("__activeStep"),D=p("__activeOnDestroyed"),_=o("onDestroyStarted");if(u&&_){const P=!f||f?.id==="driver-dummy-element";_(P?void 0:f,y,{config:o(),state:p()});return}const A=y?.onDeselected||o("onDeselected"),w=o("onDestroyed");if(document.body.classList.remove("driver-active","driver-fade","driver-simple"),ye(),Se(),ge(),ce(),se(),B(),f&&y){const P=f.id==="driver-dummy-element";A&&A(P?void 0:f,y,{config:o(),state:p()}),w&&w(P?void 0:f,y,{config:o(),state:p()})}D&&D.focus()}return{isActive:()=>p("isInitialized")||!1,refresh:F,drive:(u=0)=>{E(),m(u)},setConfig:k,setSteps:u=>{B(),k({...o(),steps:u})},getConfig:o,getState:p,getActiveIndex:()=>p("activeIndex"),isFirstStep:()=>p("activeIndex")===0,isLastStep:()=>{const u=o("steps")||[],f=p("activeIndex");return f!==void 0&&f===u.length-1},getActiveStep:()=>p("activeStep"),getActiveElement:()=>p("activeElement"),getPreviousElement:()=>p("previousElement"),getPreviousStep:()=>p("previousStep"),moveNext:n,movePrevious:l,moveTo:i,hasNextStep:()=>{const u=o("steps")||[],f=p("activeIndex");return f!==void 0&&u[f+1]},hasPreviousStep:()=>{const u=o("steps")||[],f=p("activeIndex");return f!==void 0&&u[f-1]},highlight:u=>{E(),X({...u,popover:u.popover?{showButtons:[],showProgress:!1,progressText:"",...u.popover}:void 0})},destroy:()=>{S(!1)}}}return v.driver=Ce,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),v})({}),(function(v){"use strict";class b{constructor(){this.errors=[],this.maxErrors=50}logError(o,s,t={}){const a={timestamp:new Date().toISOString(),context:o,message:s instanceof Error?s.message:s,stack:s instanceof Error?s.stack:null,metadata:t};this.errors.push(a),this.errors.length>this.maxErrors&&this.errors.shift(),console.error(`[Onboarding Error] ${o}:`,s,t)}recoverFromError(o,s){switch(this.classifyError(o)){case"ELEMENT_NOT_FOUND":return this.logError("Element Not Found",o,{currentStep:s}),{action:"SKIP_STEP",nextStep:s+1,message:"Target element not found, skipping to next step"};case"STORAGE_UNAVAILABLE":return this.logError("Storage Unavailable",o),{action:"USE_MEMORY_STORAGE",message:"Local storage unavailable, using in-memory storage"};case"DRIVER_NOT_LOADED":return this.logError("Driver.js Not Loaded",o),{action:"ABORT_TOUR",message:"Driver.js library not loaded, cannot start tour"};case"INVALID_TOOLTIP":return this.logError("Invalid Tooltip Configuration",o,{currentStep:s}),{action:"SKIP_STEP",nextStep:s+1,message:"Invalid tooltip configuration, skipping"};case"THEME_DETECTION_FAILED":return this.logError("Theme Detection Failed",o),{action:"USE_DEFAULT_THEME",message:"Using default dark theme"};default:return this.logError("Unknown Error",o,{currentStep:s}),{action:"ABORT_TOUR",message:"Unexpected error occurred, aborting tour"}}}classifyError(o){const s=o.message||o.toString();return s.includes("element")&&s.includes("not found")?"ELEMENT_NOT_FOUND":s.includes("storage")||s.includes("quota")?"STORAGE_UNAVAILABLE":s.includes("driver")||s.includes("undefined")?"DRIVER_NOT_LOADED":s.includes("invalid")||s.includes("validation")?"INVALID_TOOLTIP":s.includes("theme")?"THEME_DETECTION_FAILED":"UNKNOWN"}getErrors(){return[...this.errors]}clearErrors(){this.errors=[]}getStatistics(){const o={total:this.errors.length,byContext:{},byType:{},recent:this.errors.slice(-10)};return this.errors.forEach(s=>{o.byContext[s.context]=(o.byContext[s.context]||0)+1;const t=this.classifyError({message:s.message});o.byType[t]=(o.byType[t]||0)+1}),o}handleDriverLoadFailure(){this.logError("Driver.js Load Failure","Driver.js library failed to load");const o=document.createElement("div");return o.id="onboarding-fallback",o.style.cssText=` position: fixed; bottom: 20px; right: 20px; background: var(--card-base, #2a2a2a); color: var(--fg, #ffffff); padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 9999; max-width: 300px; font-size: 14px; `,o.innerHTML=` Welcome to DashCaddy!

The interactive tour is unavailable, but you can explore the dashboard freely. Check the documentation for help getting started.

`,document.body.appendChild(o),setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o)},1e4),!0}handleStorageUnavailable(){this.logError("Storage Unavailable","Local storage is not available");const o={data:{},getItem(s){return this.data[s]||null},setItem(s,t){this.data[s]=t},removeItem(s){delete this.data[s]},clear(){this.data={}}};return console.warn("[ErrorHandler] Using in-memory storage - progress will not persist"),o}sendToErrorTracking(o){}}v.ErrorHandler=b,console.log("[ErrorHandler] Module loaded")})(window),(function(v){"use strict";const b=new ErrorHandler,k=(...s)=>{v.DASHCADDY_DEBUG&&console.log(...s)};class o{constructor(t="dashcaddy_onboarding"){this.storageKey=t,this.storageVersion="1.0",this.installOnboardingCompleted=typeof SITE<"u"&&SITE.onboardingCompleted===!0,this._initializeStorage(),this._updateLastVisit()}_initializeStorage(){const t=this._getStorage();if(!t||t.version!==this.storageVersion){const a={version:this.storageVersion,tourCompleted:!1,completedTooltips:[],currentStep:0,completionTimestamp:null,dnsSetupDeferred:!1,lastVisit:new Date().toISOString()};this._setStorage(a)}}_getStorage(){try{const t=localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}catch(t){return b.logError("[ProgressTracker] Read Storage",t,{function:"_getStorage"}),null}}_setStorage(t){try{localStorage.setItem(this.storageKey,JSON.stringify(t))}catch(a){b.logError("[ProgressTracker] Write Storage",a,{function:"_setStorage"}),this._handleStorageError(a)}}_handleStorageError(t){try{sessionStorage.setItem(this.storageKey,JSON.stringify(this._getStorage())),console.warn("[ProgressTracker] Falling back to session storage")}catch(a){b.logError("[ProgressTracker] Session Storage Unavailable",a,{function:"_handleStorageError"})}}_updateLastVisit(){const t=this._getStorage();t&&(t.lastVisit=new Date().toISOString(),this._setStorage(t))}isTooltipCompleted(t){const a=this._getStorage();return a?a.completedTooltips.includes(t):!1}markTooltipCompleted(t){const a=this._getStorage();a&&(a.completedTooltips.includes(t)||(a.completedTooltips.push(t),a.tooltipTimestamps||(a.tooltipTimestamps={}),a.tooltipTimestamps[t]=new Date().toISOString(),this._setStorage(a)))}isTourCompleted(){const t=this._getStorage();return t?t.tourCompleted===!0:!1}isInstallOnboardingCompleted(){return this.installOnboardingCompleted===!0}async markInstallOnboardingCompleted(){if(!this.installOnboardingCompleted){this.installOnboardingCompleted=!0,typeof SITE<"u"&&(SITE.onboardingCompleted=!0);try{await secureFetch("/api/v1/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({onboardingCompleted:!0})})}catch(t){b.logError("[ProgressTracker] Persist Install Onboarding",t,{function:"markInstallOnboardingCompleted"})}}}markTourCompleted(){const t=this._getStorage();t&&(t.tourCompleted=!0,t.completionTimestamp=new Date().toISOString(),this._setStorage(t))}getCurrentStep(){const t=this._getStorage();return t&&t.currentStep||0}setCurrentStep(t){const a=this._getStorage();a&&(a.currentStep=t,this._setStorage(a))}resetProgress(){const t={version:this.storageVersion,tourCompleted:!1,completedTooltips:[],currentStep:0,completionTimestamp:null,dnsSetupDeferred:!1,lastVisit:new Date().toISOString()};this._setStorage(t)}getCompletionTimestamp(){const t=this._getStorage();return!t||!t.completionTimestamp?null:new Date(t.completionTimestamp)}isDnsSetupDeferred(){const t=this._getStorage();return t?t.dnsSetupDeferred===!0:!1}markDnsSetupDeferred(){const t=this._getStorage();t&&(t.dnsSetupDeferred=!0,this._setStorage(t))}getTooltipTimestamp(t){const a=this._getStorage();return!a||!a.tooltipTimestamps||!a.tooltipTimestamps[t]?null:new Date(a.tooltipTimestamps[t])}getCompletedTooltips(){const t=this._getStorage();return t?t.completedTooltips||[]:[]}getLastVisit(){const t=this._getStorage();return!t||!t.lastVisit?null:new Date(t.lastVisit)}}v.ProgressTracker=o,k("[ProgressTracker] Module loaded")})(window),(function(v){"use strict";const b=new ErrorHandler,k=(...t)=>{v.DASHCADDY_DEBUG&&console.log(...t)},o={dark:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(0, 0, 0, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},light:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent-strong)",overlayColor:"rgba(0, 0, 0, 0.5)",borderColor:"var(--border)",highlightColor:"var(--accent-strong)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},blue:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(25, 8, 172, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},nord:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(46, 52, 64, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},dracula:{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(40, 42, 54, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},"solarized-dark":{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(0, 43, 54, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},"solarized-light":{backgroundColor:"var(--card-base)",textColor:"var(--fg)",primaryColor:"var(--accent)",overlayColor:"rgba(253, 246, 227, 0.7)",borderColor:"var(--border)",highlightColor:"var(--accent)",fontFamily:"'Sami Grotesk', 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"}};class s{constructor(){this.currentTheme=this.getCurrentTheme(),this.themeChangeCallbacks=[],this._setupThemeChangeListener()}getCurrentTheme(){const a=document.documentElement,d=Array.from(a.classList);return(v.THEMES||[]).filter(c=>c!=="dark").find(c=>d.includes(c))||"dark"}getDriverTheme(){const a=this.getCurrentTheme(),d=o[a]||o.dark,h={};for(const[T,c]of Object.entries(d))if(typeof c=="string"&&c.startsWith("var(")){const x=c.match(/var\((--[^)]+)\)/)?.[1];if(x){const p=getComputedStyle(document.documentElement).getPropertyValue(x).trim();h[T]=p||c}else h[T]=c}else h[T]=c;return h}onThemeChange(a){typeof a=="function"&&this.themeChangeCallbacks.push(a)}_setupThemeChangeListener(){const a=document.documentElement;new MutationObserver(h=>{h.forEach(T=>{if(T.type==="attributes"&&T.attributeName==="class"){const c=this.getCurrentTheme();if(c!==this.currentTheme){const x=this.currentTheme;this.currentTheme=c,this._notifyThemeChange(c,x)}}})}).observe(a,{attributes:!0,attributeFilter:["class"]}),k("[ThemeAdapter] Theme change listener initialized")}_notifyThemeChange(a,d){k(`[ThemeAdapter] Theme changed: ${d} \u2192 ${a}`),this.themeChangeCallbacks.forEach(h=>{try{h(a,d)}catch(T){b.logError("[ThemeAdapter] Theme Change Callback",T,{function:"_notifyThemeChange"})}})}applyTheme(a){if(!a){console.warn("[ThemeAdapter] No driver instance provided");return}const d=this.getDriverTheme();this._injectDriverStyles(d),k("[ThemeAdapter] Theme applied to driver:",this.currentTheme)}_injectDriverStyles(a){const d=document.getElementById("driver-theme-styles");d&&d.remove();const h=document.createElement("style");h.id="driver-theme-styles",h.textContent=` .driver-popover { background: ${a.backgroundColor} !important; color: ${a.textColor} !important; border: 1px solid ${a.borderColor} !important; border-radius: 12px !important; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important; font-family: ${a.fontFamily} !important; } .driver-popover-title { color: ${a.textColor} !important; font-weight: 600 !important; font-family: ${a.fontFamily} !important; } .driver-popover-description { color: ${a.textColor} !important; font-family: ${a.fontFamily} !important; } .driver-popover-footer button { background: ${a.primaryColor} !important; color: ${a.backgroundColor} !important; border: none !important; font-family: ${a.fontFamily} !important; font-weight: 500 !important; } .driver-popover-footer button:hover { opacity: 0.9 !important; } .driver-popover-close-btn { color: ${a.textColor} !important; } .driver-overlay { background: ${a.overlayColor} !important; } .driver-highlighted-element { outline: 2px solid ${a.highlightColor} !important; outline-offset: 4px !important; } .driver-popover-progress-text { color: ${a.textColor} !important; opacity: 0.7 !important; font-family: ${a.fontFamily} !important; } `,document.head.appendChild(h)}getAvailableThemes(){return Object.keys(o)}isThemeAvailable(a){return o.hasOwnProperty(a)}}v.ThemeAdapter=s,k("[ThemeAdapter] Module loaded")})(window),(function(v){"use strict";const b=new ErrorHandler,k=(...d)=>{v.DASHCADDY_DEBUG&&console.log(...d)};function o(d){const h=[];if((!d.id||typeof d.id!="string")&&h.push("Tooltip must have a valid string id"),d.element||h.push("Tooltip must have an element selector or HTMLElement"),!d.popover||typeof d.popover!="object")h.push("Tooltip must have a popover object");else{if((!d.popover.title||typeof d.popover.title!="string")&&h.push("Tooltip popover must have a valid string title"),(!d.popover.description||typeof d.popover.description!="string")&&h.push("Tooltip popover must have a valid string description"),d.popover.position){const c=["top","bottom","left","right","center"];c.includes(d.popover.position)||h.push(`Invalid position: ${d.popover.position}. Must be one of: ${c.join(", ")}`)}if(d.popover.align){const c=["start","center","end"];c.includes(d.popover.align)||h.push(`Invalid align: ${d.popover.align}. Must be one of: ${c.join(", ")}`)}d.popover.showButtons&&!Array.isArray(d.popover.showButtons)&&h.push("showButtons must be an array"),["onNext","onPrevious","onClose","onSetupNow","onLater"].forEach(c=>{d.popover[c]&&typeof d.popover[c]!="function"&&h.push(`${c} must be a function`)})}return d.condition&&typeof d.condition!="function"&&h.push("condition must be a function"),d.priority!==void 0&&typeof d.priority!="number"&&h.push("priority must be a number"),{valid:h.length===0,errors:h}}function s(d){if(!Array.isArray(d))return{valid:!1,errors:[{tooltip:null,errors:["tooltips must be an array"]}]};const h=[],T=new Set;return d.forEach((c,x)=>{const p=o(c);p.valid||h.push({tooltip:c.id||`index ${x}`,errors:p.errors}),c.id&&(T.has(c.id)&&h.push({tooltip:c.id,errors:[`Duplicate tooltip ID: ${c.id}`]}),T.add(c.id))}),{valid:h.length===0,errors:h}}class t extends Error{constructor(h,T=null){super(h),this.name="TooltipError",this.tooltipId=T}}function a(d){if(!d.valid){const h=d.errors.map(T=>`${T.tooltip}: ${T.errors.join(", ")}`).join(` `);throw b.logError("[TooltipDefinitions] Validation",h,{function:"validateTooltip"}),new t(`Tooltip validation failed: ${h}`)}}v.TooltipValidation={validateTooltipDefinition:o,validateTooltipDefinitions:s,handleValidationErrors:a,TooltipError:t},k("[TooltipDefinitions] Validation module loaded")})(window);const TOOLTIP_DEFINITIONS=[{id:"welcome",element:"#brand",popover:{title:"Welcome to DashCaddy!",description:`

Your unified control panel for Docker, Caddy, and DNS — all in one place.

This tour will walk you through every section so you know exactly where everything is.

You can click your logo anytime to customize it.

`,position:"bottom",align:"start",showButtons:["next"],showProgress:!0},priority:1},{id:"infrastructure",element:".top",popover:{title:"Infrastructure Overview",description:`

This top row shows the backbone of your setup:

These core services are always pinned here, separate from your app grid.

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:2},{id:"service-cards",element:"#cards",popover:{title:"Your App Grid",description:`

Every app you deploy appears here as a card. Each one shows:

Hover over a card to see action buttons: Logs, Restart, Update, Settings, and Open.

`,position:"top",showButtons:["previous","next"],showProgress:!0},priority:3},{id:"app-selector",element:"#add-service-btn",popover:{title:"App Selector — Deploy in One Click",description:`

Browse 50+ self-hosted apps organized by category:

Each app deploys with Docker, Caddy reverse proxy, and DNS — fully configured automatically.

★ Premium: Recipes let you deploy entire stacks (e.g., full media server) in one click with pre-wired configs.

`,position:"top",showButtons:["previous","next"],showProgress:!0},priority:4,condition:()=>document.getElementById("add-service-btn")!==null},{id:"smart-arr",element:"#arr-setup-btn",popover:{title:"Smart Arr Connect",description:`

Automatically wire up your entire media stack:

No manual API key copying — DashCaddy handles it all.

`,position:"top",showButtons:["previous","next"],showProgress:!0},priority:5,condition:()=>document.getElementById("arr-setup-btn")!==null},{id:"add-manual",element:"#add-service",popover:{title:"Add App Manually",description:`

Already have a service running? Add it to your dashboard manually.

You can add:

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:6},{id:"theme-selector",element:"#theme",popover:{title:"Themes",description:`

Switch between 7 built-in themes:

Dark, Light, Blue, Nord, Dracula, Solarized Dark, and Solarized Light.

Your preference is saved automatically. You can also build custom themes with the Theme Builder (in Admin → settings).

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:7},{id:"toolbar-status",element:'.tools-section[data-section="status"]',popover:{title:"Status Tools",description:`

Click Status to expand these tools:

These sections remember whether you left them open or closed.

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:8},{id:"toolbar-tools",element:'.tools-section[data-section="tools"]',popover:{title:"Operational Tools",description:`

Click Tools for day-to-day operations:

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:9},{id:"toolbar-admin",element:'.tools-section[data-section="admin"]',popover:{title:"Admin & Configuration",description:`

Click Admin for setup and maintenance:

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:10},{id:"weather",element:"#weather-widget",popover:{title:"Weather Widget",description:`

Shows current conditions for your location. Click the gear icon to configure your city or switch temperature units.

Uses Open-Meteo — no API key required.

`,position:"bottom",showButtons:["previous","next"],showProgress:!0},priority:11,condition:()=>document.getElementById("weather-widget")!==null},{id:"reload-caddy",element:"#reload-caddy-top",popover:{title:"Reload Caddy",description:`

After changing Caddy configuration (adding reverse proxy rules, SSL settings, etc.), click here to apply the changes live.

This is a graceful reload — existing connections are not dropped.

`,position:"bottom",align:"end",showButtons:["previous","next"],showProgress:!0},priority:12,condition:()=>document.getElementById("reload-caddy-top")!==null},{id:"tour-complete",element:"#brand",popover:{title:"You're All Set!",description:`

That covers the essentials. A few tips to get the most out of DashCaddy:

★ Unlock Premium

Premium adds powerful features for serious homelabbers:

Activate in Admin → License

You can restart this tour anytime from Admin → Help Tour.

`,position:"bottom",align:"start",showButtons:["previous","close"],showProgress:!0},priority:13}];function getTooltipDefinitions(){return TOOLTIP_DEFINITIONS}function getTooltipById(v){return TOOLTIP_DEFINITIONS.find(b=>b.id===v)||null}function getActiveTooltips(){return TOOLTIP_DEFINITIONS.filter(v=>{if(v.condition&&typeof v.condition=="function")try{return v.condition()}catch(b){return errorHandler.logError("[TooltipDefinitions] Condition Eval",b,{function:"evaluateCondition",tooltipId:v.id}),!1}return!0})}function getSortedTooltips(){return getActiveTooltips().sort((b,k)=>{const o=b.priority||999,s=k.priority||999;return o-s})}function getNewFeatureTooltips(){return getActiveTooltips().filter(b=>b.isNewFeature===!0).sort((b,k)=>{const o=b.priority||999,s=k.priority||999;return o-s})}window.TooltipDefinitions={TOOLTIP_DEFINITIONS,getTooltipDefinitions,getTooltipById,getActiveTooltips,getSortedTooltips,getNewFeatureTooltips},debug("[TooltipDefinitions] Definitions loaded:",TOOLTIP_DEFINITIONS.length,"tooltips"),(function(v){"use strict";const b=(...o)=>{v.DASHCADDY_DEBUG&&console.log(...o)};class k{constructor(s){this.progressTracker=s,this.modal=null,this.onTemplateSelected=null,b("[DnsTemplateSelector] Module loaded")}getDnsTemplates(){return[{id:"technitium",name:"Technitium DNS Server",description:"Modern DNS server with web UI for managing private zones",icon:"\u{1F310}",difficulty:"Easy",features:["Web-based management interface","Private zone management for .sami domain","DHCP server integration","DNS-over-HTTPS and DNS-over-TLS support"],recommended:!0},{id:"bind9",name:"BIND9 DNS Server",description:"Industry-standard DNS server - powerful and flexible",icon:"\u{1F527}",difficulty:"Advanced",features:["Industry standard DNS server","Full RFC compliance","Advanced zone management","DNSSEC support"],recommended:!1},{id:"pihole",name:"Pi-hole",description:"Network-wide ad blocker with DNS capabilities",icon:"\u{1F6E1}\uFE0F",difficulty:"Intermediate",features:["Ad blocking at DNS level","Web interface for management","DHCP server included","Query logging and statistics"],recommended:!1},{id:"powerdns",name:"PowerDNS",description:"High-performance DNS server with SQL backend",icon:"\u26A1",difficulty:"Intermediate",features:["SQL database backend","RESTful API for automation","Geographic load balancing","DNSSEC support"],recommended:!1},{id:"coredns",name:"CoreDNS",description:"Cloud-native DNS server - lightweight and flexible",icon:"\u2601\uFE0F",difficulty:"Intermediate",features:["Plugin-based architecture","Kubernetes-native","Lightweight and fast","Prometheus metrics"],recommended:!1}]}showTemplateSelector(){this.modal||this.createModal(),this.populateTemplates(),this.modal.style.display="flex",document.body.style.overflow="hidden"}createModal(){const s=document.createElement("div");s.id="dns-template-modal",s.className="dns-template-modal",s.innerHTML=`

\u{1F310} Choose a DNS Server

Setting up a DNS server is essential for managing your private .sami domain

`,document.body.appendChild(s),this.modal=s,s.querySelector(".dns-template-close").addEventListener("click",()=>this.close()),s.querySelector("#dns-setup-later").addEventListener("click",()=>this.handleSetupLater()),s.addEventListener("click",t=>{t.target===s&&this.close()}),document.addEventListener("keydown",t=>{t.key==="Escape"&&s.style.display==="flex"&&this.close()})}populateTemplates(){const s=document.getElementById("dns-template-grid");if(!s)return;const t=this.getDnsTemplates();s.innerHTML="",t.forEach(a=>{const d=this.createTemplateCard(a);s.appendChild(d)})}createTemplateCard(s){const t=document.createElement("div");t.className="dns-template-card",s.recommended&&t.classList.add("recommended");const a=s.difficulty.toLowerCase();return t.innerHTML=` ${s.recommended?'':""}
${s.icon}

${s.name}

${s.description}

${s.difficulty}
`,t.querySelector(".dns-template-select-btn").addEventListener("click",()=>this.handleTemplateSelection(s)),t}handleTemplateSelection(s){b(`[DnsTemplateSelector] Template selected: ${s.id}`),this.close(),this.onTemplateSelected?this.onTemplateSelected(s):this.openAppSelector(s.id)}handleSetupLater(){b("[DnsTemplateSelector] DNS setup deferred"),this.progressTracker&&this.progressTracker.markDnsSetupDeferred(),this.close(),this.showNotification("DNS setup deferred. You can set it up later from the App Selector.")}openAppSelector(s){const t=document.querySelector('[onclick*="showAppSelector"]');t?(t.click(),setTimeout(()=>{const a=document.querySelector("#app-search");a&&(a.value=s,a.dispatchEvent(new Event("input",{bubbles:!0})))},300)):this.showNotification(`To deploy ${s}, use the App Selector and search for "${s}"`)}showNotification(s){const t=document.createElement("div");t.className="dns-template-notification",t.textContent=s,t.style.cssText=` position: fixed; top: 20px; right: 20px; background: var(--card-base); color: var(--fg); padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 10001; max-width: 300px; `,document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",t.style.transition="opacity 0.3s",setTimeout(()=>t.remove(),300)},3e3)}close(){this.modal&&(this.modal.style.display="none",document.body.style.overflow="")}}v.DnsTemplateSelector=k,b("[DnsTemplateSelector] Module loaded")})(window),(function(v){"use strict";const b=new ErrorHandler,k=(...s)=>{v.DASHCADDY_DEBUG&&console.log(...s)};class o{constructor(t,a,d){this.progressTracker=t,this.themeAdapter=a,this.dnsTemplateSelector=d,this.driver=null,this.currentStepIndex=0,this.isActive=!1,this.resizeHandler=null,this.layoutChangeHandler=null}async initializeDriver(){const t=v.driver?.js?.driver||v.driver?.driver||v.driver;if(typeof t!="function")return b.logError("[TourManager] Driver.js Not Loaded",new Error("Driver.js not loaded or invalid"),{windowDriver:typeof v.driver}),!1;const a=this.themeAdapter.getDriverTheme();return this.driver=t({showProgress:!0,showButtons:["next","previous","close"],allowClose:!0,overlayClickNext:!1,overlayOpacity:.6,stagePadding:12,stageRadius:12,allowKeyboardControl:!0,popoverClass:"dashcaddy-popover",animate:!0,smoothScroll:!0,onDestroyed:()=>this.onTourComplete(),onDestroyStarted:()=>{this.progressTracker.isTourCompleted()||this.onTourSkip()}}),this.themeAdapter.applyTheme(this.driver),this.themeAdapter.onThemeChange(()=>{this.themeAdapter.applyTheme(this.driver)}),this.setupDynamicRepositioning(),!0}shouldAutoStart(){return!this.progressTracker.isInstallOnboardingCompleted()&&!this.progressTracker.isTourCompleted()&&this.progressTracker.getCurrentStep()===0}async startTour(){if(!this.driver&&!await this.initializeDriver())return;const t=v.TooltipDefinitions.getSortedTooltips(),a=this.progressTracker.getCompletedTooltips(),d=t.filter(T=>!a.includes(T.id));if(d.length===0){k("[TourManager] No tooltips to show"),this.progressTracker.markTourCompleted();return}const h=d.map((T,c)=>{const x=c===0,p=c===d.length-1,B={element:T.element,popover:{title:T.popover.title,description:T.popover.description,side:T.popover.position||"bottom",align:T.popover.align||"start",showButtons:this._getButtonsForStep(T,x,p),showProgress:T.popover.showProgress!==!1,onNextClick:()=>{this.progressTracker.markTooltipCompleted(T.id),this.progressTracker.setCurrentStep(c+1),this.currentStepIndex=c+1,this.driver.moveNext()},onPrevClick:()=>{this.progressTracker.setCurrentStep(Math.max(0,c-1)),this.currentStepIndex=Math.max(0,c-1),this.driver.movePrevious()},onCloseClick:()=>{this.skipTour()}}};return T.id==="dns-priority"&&this.dnsTemplateSelector&&(B.popover.onSetupNowClick=()=>{k("[TourManager] Opening DNS template selector"),this.dnsTemplateSelector.showTemplateSelector(),this.progressTracker.markTooltipCompleted(T.id),this.progressTracker.setCurrentStep(c+1),this.currentStepIndex=c+1,this.driver.moveNext()},B.popover.onLaterClick=()=>{k("[TourManager] DNS setup deferred"),this.progressTracker.markDnsSetupDeferred(),this.progressTracker.markTooltipCompleted(T.id),this.progressTracker.setCurrentStep(c+1),this.currentStepIndex=c+1,this.driver.moveNext()}),B});this.isActive=!0,this.driver.setSteps(h),this.driver.drive()}async resumeTour(){this.progressTracker.getCurrentStep()>0?await this.startTour():await this.startTour()}skipTour(){this.driver&&this.driver.destroy(),this.cleanupDynamicRepositioning(),this.isActive=!1}async restartTour(){this.progressTracker.resetProgress(),await this.startTour()}async showTooltip(t){const a=v.TooltipDefinitions.getTooltipById(t);if(!a){b.logError("[TourManager] Tooltip Not Found",new Error(`Tooltip not found: ${t}`),{tooltipId:t});return}this.driver||await this.initializeDriver();const d={element:a.element,popover:{title:a.popover.title,description:a.popover.description,side:a.popover.position||"bottom",align:a.popover.align||"start"}};this.driver.highlight(d)}async showWhatsNew(){if(!this.driver&&!await this.initializeDriver())return;const t=v.TooltipDefinitions.getNewFeatureTooltips();if(t.length===0){k("[TourManager] No new features to show");return}k(`[TourManager] Showing ${t.length} new features`);const a=t.map((d,h)=>{const T=h===0,c=h===t.length-1;return{element:d.element,popover:{title:`\u2728 NEW: ${d.popover.title}`,description:d.popover.description,side:d.popover.position||"bottom",align:d.popover.align||"start",showButtons:this._getButtonsForStep(d,T,c),showProgress:!0,onNextClick:()=>{this.driver.moveNext()},onPrevClick:()=>{this.driver.movePrevious()},onCloseClick:()=>{this.skipTour()}}}});this.isActive=!0,this.driver.setSteps(a),this.driver.drive()}setupDynamicRepositioning(){let t;this.resizeHandler=()=>{clearTimeout(t),t=setTimeout(()=>{this.isActive&&this.driver&&(k("[TourManager] Window resized, repositioning tooltip"),this.driver.refresh())},150)},this.layoutChangeHandler=()=>{this.isActive&&this.driver&&(k("[TourManager] Layout changed, repositioning tooltip"),setTimeout(()=>{this.driver&&this.driver.refresh()},100))},v.addEventListener("resize",this.resizeHandler),this.themeAdapter.onThemeChange(this.layoutChangeHandler)}cleanupDynamicRepositioning(){this.resizeHandler&&v.removeEventListener("resize",this.resizeHandler)}_getButtonsForStep(t,a,d){if(t.popover.showButtons)return t.popover.showButtons;const h=[];return a||h.push("previous"),d?h.push("close"):h.push("next"),h}onTourComplete(){this.progressTracker.markTourCompleted(),this.isActive=!1,k("[TourManager] Tour completed")}onTourSkip(){k("[TourManager] Tour skipped"),this.isActive=!1}}v.TourManager=o,k("[TourManager] Module loaded")})(window),(function(){"use strict";const v=(...c)=>{window.DASHCADDY_DEBUG&&console.log(...c)};let b,k,o,s,t;async function a(){try{if(v("[Onboarding] Initializing system..."),window.__dashcaddySiteConfigLoaded)try{await window.__dashcaddySiteConfigLoaded}catch{}if(t=new ErrorHandler,v("[Onboarding] Error Handler initialized"),b=new ProgressTracker("dashcaddy_onboarding"),v("[Onboarding] Progress Tracker initialized"),k=new ThemeAdapter,v("[Onboarding] Theme Adapter initialized"),s=new DnsTemplateSelector(b),v("[Onboarding] DNS Template Selector initialized"),o=new TourManager(b,k,s),v("[Onboarding] Tour Manager initialized"),o.shouldAutoStart())v("[Onboarding] Auto-starting tour for first-time install"),await b.markInstallOnboardingCompleted(),setTimeout(()=>{o.startTour()},1e3);else{const c=b.isTourCompleted(),x=b.getCurrentStep();v(`[Onboarding] Tour not auto-starting (completed: ${c}, step: ${x})`),!c&&x>0&&v("[Onboarding] Tour in progress, can be resumed manually")}d(),window.DashCaddyOnboarding={startTour:()=>o.startTour(),restartTour:()=>o.restartTour(),showTooltip:c=>o.showTooltip(c),showWhatsNew:()=>o.showWhatsNew(),resetProgress:()=>b.resetProgress(),getErrors:()=>t.getErrors(),getErrorStats:()=>t.getStatistics()},v("[Onboarding] System initialized successfully")}catch(c){t&&t.logError("[Onboarding] Initialization",c),console.warn("[Onboarding] System failed to initialize, dashboard will continue without onboarding")}}function d(){const c=document.querySelector(".tools-primary")||document.querySelector(".tools");if(!c)return;const x=()=>{o?(v("[Onboarding] Starting tour via button click"),o.restartTour()):(t&&t.logError("[Onboarding] Tour Manager Not Initialized",new Error("Tour manager not initialized")),alert(`Tour is not available. Check browser console for errors. Possible issues: - Driver.js library failed to load - JavaScript errors during initialization`))},p=document.getElementById("restart-tour-btn");if(p){p.onclick=x;return}const B=document.createElement("button");B.id="restart-tour-btn",B.textContent="Help Tour",B.title="Restart the onboarding tour",B.onclick=x,c.appendChild(B)}function h(){return typeof(window.driver?.js?.driver||window.driver?.driver||window.driver)!="function"?(console.warn("[Onboarding] Driver.js not loaded yet, will retry... window.driver:",window.driver),!1):!0}function T(){let c=0;const x=10;function p(){h()?a():(c++,c