@diabolic/pointy 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Pointy=e()}(this,function(){"use strict";class t{static EASINGS={default:"cubic-bezier(0, 0.55, 0.45, 1)",standard:"cubic-bezier(0.4, 0, 0.2, 1)",decelerate:"cubic-bezier(0, 0, 0.2, 1)",accelerate:"cubic-bezier(0.4, 0, 1, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",elastic:"cubic-bezier(0.68, -0.6, 0.32, 1.6)",smooth:"cubic-bezier(0.45, 0, 0.55, 1)",snap:"cubic-bezier(0.5, 0, 0.1, 1)","expo-out":"cubic-bezier(0.19, 1, 0.22, 1)","circ-out":"cubic-bezier(0.075, 0.82, 0.165, 1)","back-out":"cubic-bezier(0.175, 0.885, 0.32, 1.275)"};static POINTER_SVG='\n <svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" fill="none" viewBox="0 0 33 33">\n <g filter="url(#pointy-shadow)">\n <path fill="currentColor" d="m18.65 24.262 6.316-14.905c.467-1.103-.645-2.215-1.748-1.747L8.313 13.925c-1.088.461-1.083 2.004.008 2.459l5.049 2.104c.325.135.583.393.718.718l2.104 5.049c.454 1.09 1.997 1.095 2.458.007"/>\n </g>\n <defs>\n <filter id="pointy-shadow" width="32.576" height="32.575" x="0" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>\n <feOffset/>\n <feGaussianBlur stdDeviation="3.75"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/>\n <feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>\n </filter>\n </defs>\n </svg>\n ';static DEFAULT_CLASS_PREFIX="pointy";static DEFAULT_CLASS_SUFFIXES={container:"container",pointer:"pointer",bubble:"bubble",bubbleText:"bubble-text",hidden:"hidden",visible:"visible",moving:"moving"};static generateClassNames(e=t.DEFAULT_CLASS_PREFIX,s={}){const i={...t.DEFAULT_CLASS_SUFFIXES,...s};return{container:`${e}-${i.container}`,pointer:`${e}-${i.pointer}`,bubble:`${e}-${i.bubble}`,bubbleText:`${e}-${i.bubbleText}`,hidden:`${e}-${i.hidden}`,visible:`${e}-${i.visible}`,moving:`${e}-${i.moving}`}}static DEFAULT_CSS_VAR_PREFIX="pointy";static generateStyles(t,e="pointy"){const s=t,i=e;return`\n @keyframes ${s.container}-float {\n 0%, 100% {\n transform: translateY(0px);\n }\n 50% {\n transform: translateY(-8px);\n }\n }\n\n .${s.container} {\n position: absolute;\n font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --${i}-duration: 1000ms;\n --${i}-easing: cubic-bezier(0, 0.55, 0.45, 1);\n --${i}-bubble-fade: 500ms;\n --${i}-bubble-bg: #0a1551;\n --${i}-bubble-color: white;\n --${i}-bubble-max-width: min(400px, 90vw);\n --${i}-pointer-color: #0a1551;\n transition: left var(--${i}-duration) var(--${i}-easing), top var(--${i}-duration) var(--${i}-easing), opacity 0.3s ease;\n animation: ${s.container}-float 3s ease-in-out infinite;\n }\n\n .${s.container}.${s.moving} {\n animation-play-state: paused;\n }\n\n .${s.container}.${s.hidden} {\n opacity: 0;\n pointer-events: none;\n }\n\n .${s.container}.${s.visible} {\n opacity: 1;\n }\n\n .${s.pointer} {\n width: 33px;\n height: 33px;\n color: var(--${i}-pointer-color);\n transition: transform var(--${i}-duration) var(--${i}-easing), color 0.3s ease;\n }\n\n .${s.bubble} {\n position: absolute;\n right: 26px;\n left: auto;\n top: 0;\n background: var(--${i}-bubble-bg);\n color: var(--${i}-bubble-color);\n padding: 4px 12px;\n border-radius: 14px;\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);\n width: max-content;\n max-width: var(--${i}-bubble-max-width);\n overflow: hidden;\n transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform var(--${i}-duration) var(--${i}-easing), opacity var(--${i}-bubble-fade) ease, left var(--${i}-duration) var(--${i}-easing), right var(--${i}-duration) var(--${i}-easing), background 0.3s ease, color 0.3s ease;\n }\n\n .${s.bubbleText} {\n display: block;\n word-break: break-word;\n }\n `}static injectedStyleKeys=new Set;static injectStyles(e,s="pointy"){const i=JSON.stringify(e)+s;if(t.injectedStyleKeys.has(i))return;if(!t.fontInjected){const e=document.createElement("link");e.href="https://cdn.jotfor.ms/fonts/?family=Circular",e.rel="stylesheet",document.head.appendChild(e),t.fontInjected=!0}const n=document.createElement("style");n.id=`pointy-styles-${i.length}`,n.textContent=t.generateStyles(e,s),document.head.appendChild(n),t.injectedStyleKeys.add(i)}static fontInjected=!1;static getTargetElement(t){return"string"==typeof t?document.querySelector(t):t}static animateText(e,s,i=500,n=null,a=null){const o=.4*i,r=.6*i;let h=null,l=null;if(n){const e=window.getComputedStyle(n).maxWidth,i=document.createElement("div");i.style.cssText=`visibility: hidden; position: absolute; padding: 4px 12px; width: max-content; max-width: ${e};`,t.renderContent(i,s),n.appendChild(i),h=i.offsetWidth,l=i.offsetHeight,n.removeChild(i);const a=n.offsetWidth,o=n.offsetHeight;n.style.width=a+"px",n.style.height=o+"px",n.offsetHeight,n.style.width=h+"px",n.style.height=l+"px"}e.style.transition=`clip-path ${o}ms ease-in`,e.style.clipPath="inset(0 0 0 100%)";const u=Math.max(o,300);setTimeout(()=>{t.renderContent(e,s),e.style.transition="none",e.style.clipPath="inset(0 100% 0 0)",e.offsetHeight,e.style.transition=`clip-path ${r}ms ease-out`,e.style.clipPath="inset(0 0 0 0)",n&&setTimeout(()=>{n.style.width="",n.style.height=""},r+50),a&&a()},u)}static renderContent(t,e){if(e&&"object"==typeof e&&e.$$typeof)if("undefined"!=typeof ReactDOM&&ReactDOM.createRoot){const s=ReactDOM.createRoot(t);s.render(e),t._reactRoot=s}else"undefined"!=typeof ReactDOM&&ReactDOM.render?ReactDOM.render(e,t):(console.warn("Pointy: React element passed but ReactDOM not found"),t.innerHTML=String(e));else t.innerHTML=e}constructor(e={}){if(this.classPrefix=e.classPrefix||t.DEFAULT_CLASS_PREFIX,this.classNames=t.generateClassNames(this.classPrefix,e.classSuffixes),e.classNames&&(this.classNames={...this.classNames,...e.classNames}),this.cssVarPrefix=e.cssVarPrefix||this.classPrefix,this.pointerSvg=e.pointerSvg||t.POINTER_SVG,t.injectStyles(this.classNames,this.cssVarPrefix),this.steps=e.steps||[],this.zIndex=void 0!==e.zIndex?e.zIndex:9999,this.viewportThresholdX=40,this.viewportThresholdY=60,"object"==typeof e.stayInViewport&&null!==e.stayInViewport?(this.stayInViewport=!0,void 0!==e.stayInViewport.x&&(this.viewportThresholdX=e.stayInViewport.x),void 0!==e.stayInViewport.y&&(this.viewportThresholdY=e.stayInViewport.y)):this.stayInViewport=void 0===e.stayInViewport||e.stayInViewport,this.offsetX=void 0!==e.offsetX?e.offsetX:20,this.offsetY=void 0!==e.offsetY?e.offsetY:16,this.tracking=void 0===e.tracking||e.tracking,this.trackingFps=void 0!==e.trackingFps?e.trackingFps:60,this.animationDuration=void 0!==e.animationDuration?e.animationDuration:1e3,this.introFadeDuration=void 0!==e.introFadeDuration?e.introFadeDuration:1e3,this.bubbleFadeDuration=void 0!==e.bubbleFadeDuration?e.bubbleFadeDuration:500,this.messageTransitionDuration=void 0!==e.messageTransitionDuration?e.messageTransitionDuration:500,this.easing=void 0!==e.easing?e.easing:"default",this.resetOnComplete=void 0===e.resetOnComplete||e.resetOnComplete,this.floatingAnimation=void 0===e.floatingAnimation||e.floatingAnimation,this.initialPosition=e.initialPosition||"center",this.initialPositionOffset=void 0!==e.initialPositionOffset?e.initialPositionOffset:32,this.resetPositionOnHide=void 0!==e.resetPositionOnHide&&e.resetPositionOnHide,this.autoplay=e.autoplay||null,this.autoplayEnabled=void 0!==e.autoplayEnabled&&e.autoplayEnabled,this.autoplayWaitForMessages=void 0===e.autoplayWaitForMessages||e.autoplayWaitForMessages,this.hideOnComplete=void 0===e.hideOnComplete||e.hideOnComplete,this.hideOnCompleteDelay=void 0!==e.hideOnCompleteDelay?e.hideOnCompleteDelay:null,this.bubbleBackgroundColor=e.bubbleBackgroundColor||null,this.bubbleTextColor=e.bubbleTextColor||null,this.bubbleMaxWidth=e.bubbleMaxWidth||null,this.pointerColor=e.pointerColor||null,this._autoplayTimeoutId=null,this._autoplayPaused=!1,this._messagesCompletedForStep=!1,this._hideOnCompleteTimeoutId=null,this.onStepChange=e.onStepChange,this.onComplete=e.onComplete,this._eventListeners={},this.targetElement=e.target?t.getTargetElement(e.target):null,this.currentStepIndex=0,this.currentMessageIndex=0,this.currentMessages=[],this.messageInterval=e.messageInterval||null,this._messageIntervalId=null,this.isVisible=!1,this.isPointingUp=!0,this.isPointingLeft=!0,this.lastTargetY=null,this._targetYHistory=[],this._lastDirectionChangeTime=0,this.manualHorizontalDirection=null,this.manualVerticalDirection=null,this._autoDirectionLocked=!1,this._lastTargetElement=null,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.moveTimeout=null,this._hasShownBefore=!1,this.steps.length>0&&(this.targetElement=t.getTargetElement(this.steps[0].target)),this.container=document.createElement("div"),this.container.className=`${this.classNames.container} ${this.classNames.hidden}`,this.container.style.zIndex=this.zIndex,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${this.animationDuration}ms`),this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(this.easing)),this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${this.bubbleFadeDuration}ms`),this.bubbleBackgroundColor&&this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-bg`,this.bubbleBackgroundColor),this.bubbleTextColor&&this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-color`,this.bubbleTextColor),this.bubbleMaxWidth&&this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-max-width`,this.bubbleMaxWidth),this.pointerColor&&this.container.style.setProperty(`--${this.cssVarPrefix}-pointer-color`,this.pointerColor),this.floatingAnimation||(this.container.style.animationPlayState="paused"),this.pointer=document.createElement("div"),this.pointer.className=this.classNames.pointer,t.renderContent(this.pointer,this.pointerSvg),this.bubble=document.createElement("div"),this.bubble.className=this.classNames.bubble,this.bubble.style.transform="translateY(28px)",this.bubbleText=document.createElement("span"),this.bubbleText.className=this.classNames.bubbleText,this.steps.length>0){const e=this.steps[0].content;this.currentMessages=Array.isArray(e)?e:[e],t.renderContent(this.bubbleText,this.currentMessages[0])}else{const s=e.content||"";this.currentMessages=Array.isArray(s)?s:[s],t.renderContent(this.bubbleText,this.currentMessages[0])}this.currentMessageIndex=0,this.bubble.appendChild(this.bubbleText),this.container.appendChild(this.pointer),this.container.appendChild(this.bubble),this.updatePosition=this.updatePosition.bind(this),this._trackPosition=this._trackPosition.bind(this),this._lastTrackTime=0,window.addEventListener("resize",this.updatePosition),window.addEventListener("scroll",this.updatePosition)}_trackPosition(){if(this.isVisible&&this.targetElement){if(this.trackingFps>0){const t=performance.now(),e=1e3/this.trackingFps;t-this._lastTrackTime>=e&&(this._lastTrackTime=t,this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:t}))}else this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:performance.now()});this._rafId=requestAnimationFrame(this._trackPosition)}else this._rafId=null}_startTracking(){this.tracking&&(this._rafId||this._trackPosition())}_stopTracking(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}updatePosition(){if(!this.targetElement)return;const t=this.targetElement.getBoundingClientRect(),e=window.scrollX,s=window.scrollY,i=window.innerWidth,n=window.innerHeight;this.bubble.offsetWidth;const a=this.bubble.offsetHeight||28;if(null!==this.manualHorizontalDirection&&(this.isPointingLeft="left"===this.manualHorizontalDirection),null!==this.manualVerticalDirection)this.isPointingUp="up"===this.manualVerticalDirection;else{const e=t.top+s,i=Date.now();this._targetYHistory.push({y:e,time:i});const n=200;if(this._targetYHistory=this._targetYHistory.filter(t=>i-t.time<n),this._targetYHistory.length>=2){const t=this._targetYHistory[0],e=this._targetYHistory[this._targetYHistory.length-1],s=e.y-t.y;e.time,t.time;const n=30,a=300;if(Math.abs(s)>n&&i-this._lastDirectionChangeTime>a){const t=s<0;t!==this.isPointingUp&&(this.isPointingUp=t,this._lastDirectionChangeTime=i)}}this.lastTargetY=e}if(this._lastTargetElement!==this.targetElement&&(this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth="",this._lastTargetElement=this.targetElement),this.stayInViewport&&!this._autoDirectionLocked){const e=this.isPointingLeft,s=this.isPointingUp;if(null===this.manualHorizontalDirection){const e=t.left-this.viewportThresholdX,s=i-t.right-this.viewportThresholdX,n=20;this.isPointingLeft=e+n>=s}if(null===this.manualVerticalDirection){const e=n-t.bottom-this.viewportThresholdY,s=t.top-this.viewportThresholdY,i=10;this.isPointingUp=e+i>=s}this._autoDirectionLocked=!0,e!==this.isPointingLeft&&this._emit("flipHorizontal",{from:e?"left":"right",to:this.isPointingLeft?"left":"right"}),s!==this.isPointingUp&&this._emit("flipVertical",{from:s?"up":"down",to:this.isPointingUp?"up":"down"})}let o,r,h,l;this.isPointingLeft?(this.isPointingUp?(h="rotate(0deg)",o=t.left+e-25+this.offsetX,r=t.bottom+s-8-this.offsetY,l="translateY(28px)"):(h="rotate(90deg)",o=t.left+e-25+this.offsetX,r=t.top+s-25+this.offsetY,l=`translateY(-${a}px)`),this.bubble.style.right="26px",this.bubble.style.left="auto"):(this.isPointingUp?(h="rotate(-90deg)",o=t.right+e-8-this.offsetX,r=t.bottom+s-25-this.offsetY,l="translateY(28px)"):(h="rotate(180deg)",o=t.right+e-8-this.offsetX,r=t.top+s-8+this.offsetY,l=`translateY(-${a}px)`),this.bubble.style.left="26px",this.bubble.style.right="auto"),this.pointer.style.transform=h,this.bubble.style.transform=l;const u=e+8,c=e+i-40;o=Math.max(u,Math.min(o,c)),this.container.style.left=`${o}px`,this.container.style.top=`${r}px`;const d=o-e;this._constrainBubbleToViewport(d,i)}_constrainBubbleToViewport(t,e){if(this._bubbleConstraintApplied)return;const s=this.bubble.style.maxWidth;this.bubble.style.maxWidth="";const i=this.bubble.offsetWidth||100;this._cachedBubbleNaturalWidth=i;let n=!1,a=0;if(this.isPointingLeft){if(t-i+26<8){const e=t+26-8;a=Math.max(e,80),n=!0}}else{if(t+26+i>e-8){const s=e-t-26-8;a=Math.max(s,80),n=!0}}this.bubble.style.maxWidth=n?`${a}px`:s||"",this._bubbleConstraintApplied=!0}show(){if(this._emit("beforeShow",{target:this.targetElement}),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),document.body.contains(this.container)||document.body.appendChild(this.container),!this._hasShownBefore){this._hasShownBefore=!0;const t="first-step"===this.initialPosition,e=this._getInitialPosition(),s=e.x,i=e.y;if(this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.pointer.style.transition="none",this.bubble.style.transition="none",this.bubble.style.opacity="0",this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,t&&void 0!==e.isPointingUp)if(this.isPointingUp=e.isPointingUp,this.isPointingUp)this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";else{this.pointer.style.transform="rotate(90deg)";const t=this.bubble.offsetHeight||28;this.bubble.style.transform=`translateY(-${t}px)`}else this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";return this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this._emit("introAnimationStart",{duration:this.introFadeDuration,initialPosition:{x:s,y:i}}),void setTimeout(()=>{if(this._emit("introAnimationEnd",{initialPosition:{x:s,y:i}}),t){this.container.style.transition="none",this.pointer.style.transition="none",this._startTracking();const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition=`opacity ${this.bubbleFadeDuration}ms ease`,t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),setTimeout(()=>{this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition=""},this.bubbleFadeDuration),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay(),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!0})}else this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition="none",this.updatePosition(),this._startTracking(),setTimeout(()=>{const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition="",t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay()},this.animationDuration),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!1})},this.introFadeDuration)}this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this.updatePosition(),this._startTracking(),this._messageCyclePausedByHide&&this.messageInterval&&this.currentMessages.length>1?(this._startMessageCycle(),this._messageCyclePausedByHide=!1):this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._wasAutoplayActiveBeforeHide&&(this._scheduleAutoplay(),this._wasAutoplayActiveBeforeHide=!1),this._emit("show",{target:this.targetElement,isIntro:!1})}hide(){this._emit("beforeHide",{target:this.targetElement}),this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this.isVisible=!1,this.resetPositionOnHide&&(this._hasShownBefore=!1),this._stopTracking(),this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePausedByHide=!0),this._wasAutoplayActiveBeforeHide=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused,this._stopAutoplay(),this._emit("hide",{target:this.targetElement})}restart(){this._emit("beforeRestart",{}),this._hasShownBefore=!1,this.isVisible?(this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this._stopTracking(),this._stopMessageCycle(),this.isVisible=!1,setTimeout(()=>{this.goToStep(0),this.show(),this._emit("restart",{})},50)):(this.goToStep(0),this.show(),this._emit("restart",{}))}destroy(){this._emit("destroy",{}),document.body.contains(this.container)&&document.body.removeChild(this.container),window.removeEventListener("resize",this.updatePosition),window.removeEventListener("scroll",this.updatePosition),this._stopTracking(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this._eventListeners={}}reset(e=!0){this._emit("beforeReset",{currentStep:this.currentStepIndex}),this._stopMessageCycle(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const{x:s,y:i}=this._getInitialPosition();if(this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,this.bubble.style.opacity="0",e&&this.steps.length>0){this.currentStepIndex=0;const e=this.steps[0];this.targetElement=t.getTargetElement(e.target),this.currentMessages=Array.isArray(e.content)?e.content:[e.content],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0]),this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth=""}this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._hasShownBefore=!1,this._emit("reset",{stepIndex:this.currentStepIndex})},this.animationDuration)}setResetOnComplete(t){const e=this.resetOnComplete;e!==t&&(this.resetOnComplete=t,this._emit("resetOnCompleteChange",{from:e,to:t}))}setFloatingAnimation(t){const e=this.floatingAnimation;e!==t&&(this.floatingAnimation=t,this.container.style.animationPlayState=t?"":"paused",this._emit("floatingAnimationChange",{from:e,to:t}))}isFloatingAnimationEnabled(){return this.floatingAnimation}setTracking(t){const e=this.tracking;e!==t&&(this.tracking=t,t&&this.isVisible?this._startTracking():t||this._stopTracking(),this._emit("trackingChange",{from:e,to:t}))}setTrackingFps(t){const e=this.trackingFps;e!==t&&(this.trackingFps=t,this._emit("trackingFpsChange",{from:e,to:t}))}isTrackingEnabled(){return this.tracking}updateContent(e,s=!0){if(""===e||null==e||Array.isArray(e)&&0===e.length||Array.isArray(e)&&e.every(t=>""===t||null==t))return this.bubble.style.opacity="0",void(this.bubble.style.pointerEvents="none");if("0"===this.bubble.style.opacity&&this.isVisible){const t=this.bubble.style.transition,e=this.pointer.style.transition;this.bubble.style.transition="none",this.pointer.style.transition="none",this.bubble.style.opacity="1",this.bubble.style.pointerEvents="",this.bubble.offsetHeight,this.updatePosition(),this.bubble.offsetHeight,requestAnimationFrame(()=>{this.bubble.style.transition=t,this.pointer.style.transition=e})}"string"==typeof e&&this.bubbleText.innerHTML===e||(s?t.animateText(this.bubbleText,e,this.messageTransitionDuration,this.bubble,()=>{this.updatePosition()}):(t.renderContent(this.bubbleText,e),this.updatePosition()))}_applyMessages(t,e=!1){const s=null!==this._messageIntervalId;this._stopMessageCycle(),this.currentMessages=Array.isArray(t)?t:[t],this.currentMessageIndex=0,this.updateContent(this.currentMessages[0]),e&&this.messageInterval&&this.currentMessages.length>1?this._startMessageCycle():s&&this.currentMessages.length>1&&(this._messageCyclePaused=!0),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,cyclePaused:!0===this._messageCyclePaused})}_startMessageCycle(){this._messagesCompletedForStep=!1,this._messageIntervalId=setInterval(()=>{this.currentMessageIndex===this.currentMessages.length-1&&this.autoplay&&this.autoplayWaitForMessages?(this._stopMessageCycle(),this._messagesCompletedForStep=!0,this._emit("messageCycleComplete",{stepIndex:this.currentStepIndex,totalMessages:this.currentMessages.length}),this._scheduleAutoplayAfterMessages()):this.nextMessage(!0)},this.messageInterval),this._emit("messageCycleStart",{interval:this.messageInterval,totalMessages:this.currentMessages.length})}_stopMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._emit("messageCycleStop",{currentIndex:this.currentMessageIndex}))}pauseMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._messageCyclePaused=!0,this._emit("messageCyclePause",{currentIndex:this.currentMessageIndex}))}resumeMessageCycle(){return!!(this._messageCyclePaused&&this.messageInterval&&this.currentMessages.length>1)&&(this._messageCyclePaused=!1,this._startMessageCycle(),this._emit("messageCycleResume",{currentIndex:this.currentMessageIndex}),!0)}startMessageCycle(t){return!this._messageIntervalId&&(!(this.currentMessages.length<=1)&&(void 0!==t&&(this.messageInterval=t),!!this.messageInterval&&(this._messageCyclePaused=!1,this._startMessageCycle(),!0)))}stopMessageCycle(){return!!this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePaused=!1,!0)}isMessageCycleActive(){return null!==this._messageIntervalId}isMessageCyclePaused(){return!0===this._messageCyclePaused}nextMessage(t=!1){if(this.currentMessages.length<=1)return!1;const e=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex+1)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length,isAuto:t}),!0}prevMessage(){if(this.currentMessages.length<=1)return!1;const t=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex-1+this.currentMessages.length)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:t,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length}),!0}goToMessage(t){if(t<0||t>=this.currentMessages.length)return;const e=this.currentMessageIndex;this.currentMessageIndex=t,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length})}getCurrentMessage(){return this.currentMessageIndex}getTotalMessages(){return this.currentMessages.length}setCurrentMessage(t,e=!0){const s=this.currentMessages[this.currentMessageIndex];this.currentMessages[this.currentMessageIndex]=t,this.updateContent(t,e),e||this.updatePosition(),this._emit("currentMessageUpdate",{index:this.currentMessageIndex,message:t,oldMessage:s,total:this.currentMessages.length,animated:e})}setMessage(t,e=!0){this.setMessages(t,e)}setMessages(e,s=!0){const i=null!==this._messageIntervalId;s?this._applyMessages(e,!1):(this._stopMessageCycle(),this.currentMessages=Array.isArray(e)?e:[e],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0]),this.updatePosition(),i&&this.currentMessages.length>1&&(this._messageCyclePaused=!0)),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,animated:s,cyclePaused:!0===this._messageCyclePaused})}setMessageInterval(t){const e=this.messageInterval;e!==t&&(this.messageInterval=t,this._stopMessageCycle(),t&&this.currentMessages.length>1&&this._startMessageCycle(),this._emit("messageIntervalChange",{from:e,to:t}))}updateTarget(e){const s=this.targetElement;this.targetElement=t.getTargetElement(e),this.updatePosition(),this._emit("targetChange",{from:s,to:this.targetElement})}setZIndex(t){const e=this.zIndex;e!==t&&(this.zIndex=t,this.container.style.zIndex=t,this._emit("zIndexChange",{from:e,to:t}))}setStayInViewport(t,e){const s=this.stayInViewport,i=this.viewportThresholdX,n=this.viewportThresholdY;this.stayInViewport=t,e&&"object"==typeof e&&(void 0!==e.x&&(this.viewportThresholdX=e.x),void 0!==e.y&&(this.viewportThresholdY=e.y)),t||(this.isPointingLeft=!0,this.isPointingUp=!0),this.updatePosition(),this._emit("stayInViewportChange",{from:{enabled:s,x:i,y:n},to:{enabled:t,x:this.viewportThresholdX,y:this.viewportThresholdY}})}_parseDirection(t){if(!t)return this.manualHorizontalDirection=null,void(this.manualVerticalDirection=null);const e=t.toLowerCase();e.includes("left")?this.manualHorizontalDirection="left":e.includes("right")?this.manualHorizontalDirection="right":this.manualHorizontalDirection=null,e.includes("up")?this.manualVerticalDirection="up":e.includes("down")?this.manualVerticalDirection="down":this.manualVerticalDirection=null}setDirection(t){const e=this.manualHorizontalDirection,s=this.manualVerticalDirection;this._parseDirection(t),this.updatePosition(),this._emit("directionChange",{from:{horizontal:e,vertical:s},to:{horizontal:this.manualHorizontalDirection,vertical:this.manualVerticalDirection}})}setHorizontalDirection(t){const e=this.manualHorizontalDirection;e!==t&&(this.manualHorizontalDirection=t,this.updatePosition(),this._emit("horizontalDirectionChange",{from:e,to:t}))}setVerticalDirection(t){const e=this.manualVerticalDirection;e!==t&&(this.manualVerticalDirection=t,this.updatePosition(),this._emit("verticalDirectionChange",{from:e,to:t}))}setOffset(t,e){const s=this.offsetX,i=this.offsetY;s===t&&i===e||(this.offsetX=t,this.offsetY=e,this.updatePosition(),this._emit("offsetChange",{from:{x:s,y:i},to:{x:t,y:e}}))}setAnimationDuration(t){const e=this.animationDuration;e!==t&&(this.animationDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${t}ms`),this._emit("animationDurationChange",{from:e,to:t}))}setIntroFadeDuration(t){const e=this.introFadeDuration;e!==t&&(this.introFadeDuration=t,this._emit("introFadeDurationChange",{from:e,to:t}))}setBubbleFadeDuration(t){const e=this.bubbleFadeDuration;e!==t&&(this.bubbleFadeDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${t}ms`),this._emit("bubbleFadeDurationChange",{from:e,to:t}))}setBubbleBackgroundColor(t){const e=this.bubbleBackgroundColor;e!==t&&(this.bubbleBackgroundColor=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-bg`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-bubble-bg`),this._emit("bubbleBackgroundColorChange",{from:e,to:t}))}setBubbleTextColor(t){const e=this.bubbleTextColor;e!==t&&(this.bubbleTextColor=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-color`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-bubble-color`),this._emit("bubbleTextColorChange",{from:e,to:t}))}setBubbleMaxWidth(t){const e=this.bubbleMaxWidth;e!==t&&(this.bubbleMaxWidth=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-max-width`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-bubble-max-width`),this._emit("bubbleMaxWidthChange",{from:e,to:t}))}setPointerColor(t){const e=this.pointerColor;e!==t&&(this.pointerColor=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-pointer-color`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-pointer-color`),this._emit("pointerColorChange",{from:e,to:t}))}_getInitialPosition(){const e=this.initialPositionOffset,s=window.innerWidth,i=window.innerHeight;if("first-step"===this.initialPosition&&this.steps.length>0){const e=this.steps[0],s=t.getTargetElement(e.target);if(s){const t=s.getBoundingClientRect(),i=window.scrollX,n=window.scrollY,a="down"!==e.direction;let o,r;return a?(o=t.left+i-25+this.offsetX,r=t.bottom+n-8-this.offsetY):(o=t.left+i-25+this.offsetX,r=t.top+n-25+this.offsetY),{x:o,y:r,isPointingUp:a}}}if(this.initialPosition&&"string"!=typeof this.initialPosition){const t=this.initialPosition.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}if("string"==typeof this.initialPosition&&(this.initialPosition.startsWith("#")||this.initialPosition.startsWith("."))){const t=document.querySelector(this.initialPosition);if(t){const e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}}const n={center:{x:s/2,y:i/2},"top-left":{x:e,y:e},"top-center":{x:s/2,y:e},"top-right":{x:s-e,y:e},"middle-left":{x:e,y:i/2},"middle-right":{x:s-e,y:i/2},"bottom-left":{x:e,y:i-e},"bottom-center":{x:s/2,y:i-e},"bottom-right":{x:s-e,y:i-e}};return n[this.initialPosition]||n.center}setInitialPosition(t){const e=["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"];if("string"==typeof t&&!t.startsWith("#")&&!t.startsWith(".")&&!e.includes(t))return void console.warn(`Invalid initial position: ${t}. Valid presets: ${e.join(", ")}. Or use a CSS selector or DOM element.`);const s=this.initialPosition;s!==t&&(this.initialPosition=t,this._emit("initialPositionChange",{from:s,to:t}))}animateToInitialPosition(){if(!this.isVisible)return;const{x:t,y:e}=this._getInitialPosition();this._stopTracking(),this.container.style.cssText=`\n position: fixed;\n left: ${t}px;\n top: ${e}px;\n opacity: 0;\n transition: none;\n `,this.bubble.style.opacity="0",this.bubble.style.transition="none",this.container.offsetHeight,this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.container.style.opacity="1",setTimeout(()=>{this.container.style.transition="",this.container.style.cssText="",this.container.style.left=`${t}px`,this.container.style.top=`${e}px`,this.container.offsetHeight,this.updatePosition(),this._startTracking(),setTimeout(()=>{this.bubble.style.transition="",this.bubble.style.opacity="1"},this.animationDuration)},this.introFadeDuration)}setInitialPositionOffset(t){const e=this.initialPositionOffset;e!==t&&(this.initialPositionOffset=t,this._emit("initialPositionOffsetChange",{from:e,to:t}))}_resolveEasing(e){return t.EASINGS[e]?t.EASINGS[e]:e}setEasing(t){const e=this.easing;e!==t&&(this.easing=t,this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(t)),this._emit("easingChange",{from:e,to:t}))}setMessageTransitionDuration(t){const e=this.messageTransitionDuration;e!==t&&(this.messageTransitionDuration=t,this._emit("messageTransitionDurationChange",{from:e,to:t}))}setPointerSvg(e){const s=this.pointerSvg;s!==e&&(this.pointerSvg=e,t.renderContent(this.pointer,e),this._emit("pointerSvgChange",{from:s,to:e}))}getPointerSvg(){return this.pointerSvg}getClassNames(){return{...this.classNames}}getClassPrefix(){return this.classPrefix}getCssVarPrefix(){return this.cssVarPrefix}static getEasingPresets(){return Object.keys(t.EASINGS)}static getInitialPositions(){return["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"]}goToStep(e){if(0===this.steps.length||e<0||e>=this.steps.length)return;this._stopAutoplay(),this._messagesCompletedForStep=!1;const s=this.currentStepIndex,i=this.targetElement;this.currentStepIndex=e;const n=this.steps[this.currentStepIndex];this._emit("beforeStepChange",{fromIndex:s,toIndex:e,step:n,fromTarget:i}),this._parseDirection(n.direction),this._targetYHistory=[],this.lastTargetY=null,this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth="",this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout),this._emit("animationStart",{fromTarget:i,toTarget:t.getTargetElement(n.target),type:"step",stepIndex:e}),this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("moveComplete",{index:e,step:n,target:this.targetElement}),this._emit("animationEnd",{fromTarget:i,toTarget:this.targetElement,type:"step",stepIndex:e}),this._scheduleAutoplay()},this.animationDuration),this._emit("move",{index:e,step:n}),this._applyMessages(n.content,!0),this.targetElement=t.getTargetElement(n.target),this.updatePosition(),this._emit("stepChange",{fromIndex:s,toIndex:e,step:n,target:this.targetElement}),this.onStepChange&&this.onStepChange(this.currentStepIndex,n)}_scheduleAutoplay(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;const t=this.steps[this.currentStepIndex],e=this.currentMessages.length>1&&this.messageInterval;if(this.autoplayWaitForMessages&&e)return;const s=void 0!==t.duration?t.duration:this.autoplay;s&&s>0&&(this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this.autoplayEnabled&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,duration:s}),this.next())},s))}_scheduleAutoplayAfterMessages(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this._messagesCompletedForStep&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,afterMessages:!0}),this.next())},300)}_stopAutoplay(){this._autoplayTimeoutId&&(clearTimeout(this._autoplayTimeoutId),this._autoplayTimeoutId=null)}startAutoplay(){this.autoplay&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this._emit("autoplayStart",{}),this._scheduleAutoplay())}stopAutoplay(){this._stopAutoplay(),this.autoplayEnabled=!1,this._autoplayPaused=!1,this._emit("autoplayStop",{})}pauseAutoplay(){this._stopAutoplay(),this._autoplayPaused=!0,this._emit("autoplayPause",{})}resumeAutoplay(){this._autoplayPaused&&(this._autoplayPaused=!1,this._emit("autoplayResume",{}),this._scheduleAutoplay())}isAutoplayActive(){return this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused}isAutoplayPaused(){return this._autoplayPaused}setAutoplayInterval(t){const e=this.autoplay;e!==t&&(this.autoplay=t,this._emit("autoplayChange",{from:e,to:t}),this.autoplayEnabled&&t&&this.isVisible?(this._stopAutoplay(),this._scheduleAutoplay()):t||(this._stopAutoplay(),this.autoplayEnabled=!1))}setAutoplay(t){this.setAutoplayInterval(t),t&&this.isVisible&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this.restart())}setAutoplayWaitForMessages(t){const e=this.autoplayWaitForMessages;e!==t&&(this.autoplayWaitForMessages=t,this._emit("autoplayWaitForMessagesChange",{from:e,to:t}))}setHideOnComplete(t){const e=this.hideOnComplete;e!==t&&(this.hideOnComplete=t,this._emit("hideOnCompleteChange",{from:e,to:t}))}setHideOnCompleteDelay(t){const e=this.hideOnCompleteDelay;e!==t&&(this.hideOnCompleteDelay=t,this._emit("hideOnCompleteDelayChange",{from:e,to:t}))}next(){if(0!==this.steps.length)if(this.currentStepIndex<this.steps.length-1)this._emit("next",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex+1}),this.goToStep(this.currentStepIndex+1);else{const t=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused;if(this._emit("complete",{totalSteps:this.steps.length,source:t?"autoplay":"manual"}),t&&(this._stopAutoplay(),this.autoplayEnabled=!1,this._emit("autoplayComplete",{totalSteps:this.steps.length})),this.resetOnComplete){if(this.reset(),this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},this.animationDuration+e)}}else if(this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},e)}this.onComplete&&this.onComplete()}}prev(){0!==this.steps.length&&this.currentStepIndex>0&&(this._emit("prev",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex-1}),this.goToStep(this.currentStepIndex-1))}getCurrentStep(){return this.currentStepIndex}getTotalSteps(){return this.steps.length}pointTo(e,s,i){const n=this.targetElement,a=i||"auto";this._emit("beforePointTo",{target:t.getTargetElement(e),content:s,direction:a,fromTarget:n}),this._parseDirection(i),this._targetYHistory=[],this.lastTargetY=null,this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth="",this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const o=t.getTargetElement(e);this._emit("animationStart",{fromTarget:n,toTarget:o,type:"pointTo",content:s}),this.targetElement=o,void 0!==s&&this._applyMessages(s,!1),this.updatePosition();const r=this.isPointingUp?"up":"down";this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("pointToComplete",{target:this.targetElement,content:s,direction:r}),this._emit("animationEnd",{fromTarget:n,toTarget:this.targetElement,type:"pointTo",content:s})},this.animationDuration),this._emit("pointTo",{target:this.targetElement,content:s,direction:r}),this.isVisible||this.show()}on(t,e){return this._eventListeners[t]||(this._eventListeners[t]=[]),this._eventListeners[t].push(e),this}off(t,e){return this._eventListeners[t]?(e?this._eventListeners[t]=this._eventListeners[t].filter(t=>t!==e):delete this._eventListeners[t],this):this}_emit(e,s){const i={...s,type:e,pointy:this};this._eventListeners[e]&&this._eventListeners[e].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${e} event handler:`,t)}});const n=t.getEventGroup(e);n&&this._eventListeners[n]&&this._eventListeners[n].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${n} group handler for ${e}:`,t)}}),["*","all"].forEach(t=>{this._eventListeners[t]&&this._eventListeners[t].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in wildcard handler for ${e}:`,t)}})})}static getEventGroup(e){for(const[s,i]of Object.entries(t.EVENT_GROUPS))if(i.includes(e))return s;return e.endsWith("Change")?"config":null}static getEventsInGroup(e){return t.EVENT_GROUPS[e]||[]}}return t.EVENT_GROUPS={lifecycle:["beforeShow","show","beforeHide","hide","destroy","beforeRestart","restart","beforeReset","reset"],navigation:["beforeStepChange","stepChange","next","prev","complete"],animation:["animationStart","animationEnd","move","moveComplete","introAnimationStart","introAnimationEnd"],content:["contentSet","messagesSet","messageChange"],messageCycle:["messageCycleStart","messageCycleStop","messageCyclePause","messageCycleResume","messageCycleComplete"],pointing:["beforePointTo","pointTo","pointToComplete"],tracking:["track","targetChange","trackingChange","trackingFpsChange"],autoplay:["autoplayStart","autoplayStop","autoplayPause","autoplayResume","autoplayNext","autoplayComplete","autoHide","autoplayChange","autoplayWaitForMessagesChange"]},t});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Pointy=e()}(this,function(){"use strict";class t{static EASINGS={default:"cubic-bezier(0, 0.55, 0.45, 1)",standard:"cubic-bezier(0.4, 0, 0.2, 1)",decelerate:"cubic-bezier(0, 0, 0.2, 1)",accelerate:"cubic-bezier(0.4, 0, 1, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",elastic:"cubic-bezier(0.68, -0.6, 0.32, 1.6)",smooth:"cubic-bezier(0.45, 0, 0.55, 1)",snap:"cubic-bezier(0.5, 0, 0.1, 1)","expo-out":"cubic-bezier(0.19, 1, 0.22, 1)","circ-out":"cubic-bezier(0.075, 0.82, 0.165, 1)","back-out":"cubic-bezier(0.175, 0.885, 0.32, 1.275)"};static POINTER_SVG='\n <svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" fill="none" viewBox="0 0 33 33">\n <g filter="url(#pointy-shadow)">\n <path fill="currentColor" d="m18.65 24.262 6.316-14.905c.467-1.103-.645-2.215-1.748-1.747L8.313 13.925c-1.088.461-1.083 2.004.008 2.459l5.049 2.104c.325.135.583.393.718.718l2.104 5.049c.454 1.09 1.997 1.095 2.458.007"/>\n </g>\n <defs>\n <filter id="pointy-shadow" width="32.576" height="32.575" x="0" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>\n <feOffset/>\n <feGaussianBlur stdDeviation="3.75"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/>\n <feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>\n </filter>\n </defs>\n </svg>\n ';static DEFAULT_CLASS_PREFIX="pointy";static DEFAULT_CLASS_SUFFIXES={container:"container",pointer:"pointer",bubble:"bubble",bubbleText:"bubble-text",hidden:"hidden",visible:"visible",moving:"moving"};static generateClassNames(e=t.DEFAULT_CLASS_PREFIX,s={}){const i={...t.DEFAULT_CLASS_SUFFIXES,...s};return{container:`${e}-${i.container}`,pointer:`${e}-${i.pointer}`,bubble:`${e}-${i.bubble}`,bubbleText:`${e}-${i.bubbleText}`,hidden:`${e}-${i.hidden}`,visible:`${e}-${i.visible}`,moving:`${e}-${i.moving}`}}static DEFAULT_CSS_VAR_PREFIX="pointy";static generateStyles(t,e="pointy"){const s=t,i=e;return`\n @keyframes ${s.container}-float {\n 0%, 100% {\n transform: translateY(0px);\n }\n 50% {\n transform: translateY(-8px);\n }\n }\n\n .${s.container} {\n position: absolute;\n font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --${i}-duration: 1000ms;\n --${i}-easing: cubic-bezier(0, 0.55, 0.45, 1);\n --${i}-bubble-fade: 500ms;\n --${i}-bubble-bg: #0a1551;\n --${i}-bubble-color: white;\n --${i}-bubble-max-width: min(400px, 90vw);\n --${i}-pointer-color: #0a1551;\n transition: left var(--${i}-duration) var(--${i}-easing), top var(--${i}-duration) var(--${i}-easing), opacity 0.3s ease;\n animation: ${s.container}-float 3s ease-in-out infinite;\n }\n\n .${s.container}.${s.moving} {\n animation-play-state: paused;\n }\n\n .${s.container}.${s.hidden} {\n opacity: 0;\n pointer-events: none;\n }\n\n .${s.container}.${s.visible} {\n opacity: 1;\n }\n\n .${s.pointer} {\n width: 33px;\n height: 33px;\n color: var(--${i}-pointer-color);\n transition: transform var(--${i}-duration) var(--${i}-easing), color 0.3s ease;\n }\n\n .${s.bubble} {\n position: absolute;\n right: 26px;\n left: auto;\n top: 0;\n background: var(--${i}-bubble-bg);\n color: var(--${i}-bubble-color);\n padding: 4px 12px;\n border-radius: 14px;\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);\n width: max-content;\n max-width: var(--${i}-bubble-max-width);\n overflow: hidden;\n transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform var(--${i}-duration) var(--${i}-easing), opacity var(--${i}-bubble-fade) ease, left var(--${i}-duration) var(--${i}-easing), right var(--${i}-duration) var(--${i}-easing), background 0.3s ease, color 0.3s ease;\n }\n\n .${s.bubbleText} {\n display: block;\n word-break: break-word;\n }\n `}static injectedStyleKeys=new Set;static injectStyles(e,s="pointy"){const i=JSON.stringify(e)+s;if(t.injectedStyleKeys.has(i))return;if(!t.fontInjected){const e=document.createElement("link");e.href="https://cdn.jotfor.ms/fonts/?family=Circular",e.rel="stylesheet",document.head.appendChild(e),t.fontInjected=!0}const n=document.createElement("style");n.id=`pointy-styles-${i.length}`,n.textContent=t.generateStyles(e,s),document.head.appendChild(n),t.injectedStyleKeys.add(i)}static fontInjected=!1;static getTargetElement(t){return"string"==typeof t?document.querySelector(t):t}static animateText(e,s,i=500,n=null,a=null){const o=.4*i,r=.6*i;let h=null,l=null;if(n){const e=window.getComputedStyle(n).maxWidth,i=document.createElement("div");i.style.cssText=`visibility: hidden; position: absolute; padding: 4px 12px; width: max-content; max-width: ${e};`,t.renderContent(i,s),n.appendChild(i),h=i.offsetWidth,l=i.offsetHeight,n.removeChild(i);const a=n.offsetWidth,o=n.offsetHeight;n.style.width=a+"px",n.style.height=o+"px",n.offsetHeight,n.style.width=h+"px",n.style.height=l+"px"}e.style.transition=`clip-path ${o}ms ease-in`,e.style.clipPath="inset(0 0 0 100%)";const c=Math.max(o,300);setTimeout(()=>{t.renderContent(e,s),e.style.transition="none",e.style.clipPath="inset(0 100% 0 0)",e.offsetHeight,e.style.transition=`clip-path ${r}ms ease-out`,e.style.clipPath="inset(0 0 0 0)",n&&setTimeout(()=>{n.style.width="",n.style.height=""},r+50),a&&a()},c)}static renderContent(t,e){if(e&&"object"==typeof e&&e.$$typeof)if("undefined"!=typeof ReactDOM&&ReactDOM.createRoot){let s=t._reactRoot;s||(s=ReactDOM.createRoot(t),t._reactRoot=s),"function"==typeof ReactDOM.flushSync?ReactDOM.flushSync(()=>{s.render(e)}):s.render(e)}else"undefined"!=typeof ReactDOM&&ReactDOM.render?ReactDOM.render(e,t):(console.warn("Pointy: React element passed but ReactDOM not found"),t.innerHTML=String(e));else t._reactRoot&&(t._reactRoot.unmount(),t._reactRoot=null),t.innerHTML=e}constructor(e={}){if(this.classPrefix=e.classPrefix||t.DEFAULT_CLASS_PREFIX,this.classNames=t.generateClassNames(this.classPrefix,e.classSuffixes),e.classNames&&(this.classNames={...this.classNames,...e.classNames}),this.cssVarPrefix=e.cssVarPrefix||this.classPrefix,this.pointerSvg=e.pointerSvg||t.POINTER_SVG,t.injectStyles(this.classNames,this.cssVarPrefix),this.steps=e.steps||[],this.zIndex=void 0!==e.zIndex?e.zIndex:9999,this.viewportThresholdX=40,this.viewportThresholdY=60,"object"==typeof e.stayInViewport&&null!==e.stayInViewport?(this.stayInViewport=!0,void 0!==e.stayInViewport.x&&(this.viewportThresholdX=e.stayInViewport.x),void 0!==e.stayInViewport.y&&(this.viewportThresholdY=e.stayInViewport.y)):this.stayInViewport=void 0===e.stayInViewport||e.stayInViewport,this.offsetX=void 0!==e.offsetX?e.offsetX:20,this.offsetY=void 0!==e.offsetY?e.offsetY:16,this.tracking=void 0===e.tracking||e.tracking,this.trackingFps=void 0!==e.trackingFps?e.trackingFps:60,this.animationDuration=void 0!==e.animationDuration?e.animationDuration:1e3,this.introFadeDuration=void 0!==e.introFadeDuration?e.introFadeDuration:1e3,this.bubbleFadeDuration=void 0!==e.bubbleFadeDuration?e.bubbleFadeDuration:500,this.messageTransitionDuration=void 0!==e.messageTransitionDuration?e.messageTransitionDuration:500,this.easing=void 0!==e.easing?e.easing:"default",this.resetOnComplete=void 0===e.resetOnComplete||e.resetOnComplete,this.floatingAnimation=void 0===e.floatingAnimation||e.floatingAnimation,this.initialPosition=e.initialPosition||"center",this.initialPositionOffset=void 0!==e.initialPositionOffset?e.initialPositionOffset:32,this.resetPositionOnHide=void 0!==e.resetPositionOnHide&&e.resetPositionOnHide,this.autoplay=e.autoplay||null,this.autoplayEnabled=void 0!==e.autoplayEnabled&&e.autoplayEnabled,this.autoplayWaitForMessages=void 0===e.autoplayWaitForMessages||e.autoplayWaitForMessages,this.hideOnComplete=void 0===e.hideOnComplete||e.hideOnComplete,this.hideOnCompleteDelay=void 0!==e.hideOnCompleteDelay?e.hideOnCompleteDelay:null,this.bubbleBackgroundColor=e.bubbleBackgroundColor||null,this.bubbleTextColor=e.bubbleTextColor||null,this.bubbleMaxWidth=e.bubbleMaxWidth||null,this.pointerColor=e.pointerColor||null,this._autoplayTimeoutId=null,this._autoplayPaused=!1,this._messagesCompletedForStep=!1,this._hideOnCompleteTimeoutId=null,this.onStepChange=e.onStepChange,this.onComplete=e.onComplete,this._eventListeners={},this.targetElement=e.target?t.getTargetElement(e.target):null,this.currentStepIndex=0,this.currentMessageIndex=0,this.currentMessages=[],this.messageInterval=e.messageInterval||null,this._messageIntervalId=null,this.isVisible=!1,this.isPointingUp=!0,this.isPointingLeft=!0,this.lastTargetY=null,this._targetYHistory=[],this._lastDirectionChangeTime=0,this.manualHorizontalDirection=null,this.manualVerticalDirection=null,this._autoDirectionLocked=!1,this._lastTargetElement=null,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.moveTimeout=null,this._hasShownBefore=!1,this.steps.length>0&&(this.targetElement=t.getTargetElement(this.steps[0].target)),this.container=document.createElement("div"),this.container.className=`${this.classNames.container} ${this.classNames.hidden}`,this.container.style.zIndex=this.zIndex,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${this.animationDuration}ms`),this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(this.easing)),this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${this.bubbleFadeDuration}ms`),this.bubbleBackgroundColor&&this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-bg`,this.bubbleBackgroundColor),this.bubbleTextColor&&this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-color`,this.bubbleTextColor),this.bubbleMaxWidth&&this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-max-width`,this.bubbleMaxWidth),this.pointerColor&&this.container.style.setProperty(`--${this.cssVarPrefix}-pointer-color`,this.pointerColor),this.floatingAnimation||(this.container.style.animationPlayState="paused"),this.pointer=document.createElement("div"),this.pointer.className=this.classNames.pointer,t.renderContent(this.pointer,this.pointerSvg),this.bubble=document.createElement("div"),this.bubble.className=this.classNames.bubble,this.bubble.style.transform="translateY(28px)",this.bubbleText=document.createElement("span"),this.bubbleText.className=this.classNames.bubbleText,this.steps.length>0){const e=this.steps[0].content;this.currentMessages=Array.isArray(e)?e:[e],t.renderContent(this.bubbleText,this.currentMessages[0])}else{const s=e.content||"";this.currentMessages=Array.isArray(s)?s:[s],t.renderContent(this.bubbleText,this.currentMessages[0])}this.currentMessageIndex=0,this.bubble.appendChild(this.bubbleText),this.container.appendChild(this.pointer),this.container.appendChild(this.bubble),this.updatePosition=this.updatePosition.bind(this),this._trackPosition=this._trackPosition.bind(this),this._lastTrackTime=0,window.addEventListener("resize",this.updatePosition),window.addEventListener("scroll",this.updatePosition)}_trackPosition(){if(this.isVisible&&this.targetElement){if(this.trackingFps>0){const t=performance.now(),e=1e3/this.trackingFps;t-this._lastTrackTime>=e&&(this._lastTrackTime=t,this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:t}))}else this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:performance.now()});this._rafId=requestAnimationFrame(this._trackPosition)}else this._rafId=null}_startTracking(){this.tracking&&(this._rafId||this._trackPosition())}_stopTracking(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}updatePosition(){if(!this.targetElement)return;const t=this.targetElement.getBoundingClientRect(),e=window.scrollX,s=window.scrollY,i=window.innerWidth,n=window.innerHeight;this.bubble.offsetWidth;const a=this.bubble.offsetHeight||28;if(null!==this.manualHorizontalDirection&&(this.isPointingLeft="left"===this.manualHorizontalDirection),null!==this.manualVerticalDirection)this.isPointingUp="up"===this.manualVerticalDirection;else{const e=t.top+s,i=Date.now();this._targetYHistory.push({y:e,time:i});const n=200;if(this._targetYHistory=this._targetYHistory.filter(t=>i-t.time<n),this._targetYHistory.length>=2){const t=this._targetYHistory[0],e=this._targetYHistory[this._targetYHistory.length-1],s=e.y-t.y;e.time,t.time;const n=30,a=300;if(Math.abs(s)>n&&i-this._lastDirectionChangeTime>a){const t=s<0;t!==this.isPointingUp&&(this.isPointingUp=t,this._lastDirectionChangeTime=i)}}this.lastTargetY=e}if(this._lastTargetElement!==this.targetElement&&(this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth="",this._lastTargetElement=this.targetElement),this.stayInViewport&&!this._autoDirectionLocked){const e=this.isPointingLeft,s=this.isPointingUp;if(null===this.manualHorizontalDirection){const e=t.left-this.viewportThresholdX,s=i-t.right-this.viewportThresholdX,n=20;this.isPointingLeft=e+n>=s}if(null===this.manualVerticalDirection){const e=n-t.bottom-this.viewportThresholdY,s=t.top-this.viewportThresholdY,i=10;this.isPointingUp=e+i>=s}this._autoDirectionLocked=!0,e!==this.isPointingLeft&&this._emit("flipHorizontal",{from:e?"left":"right",to:this.isPointingLeft?"left":"right"}),s!==this.isPointingUp&&this._emit("flipVertical",{from:s?"up":"down",to:this.isPointingUp?"up":"down"})}let o,r,h,l;this.isPointingLeft?(this.isPointingUp?(h="rotate(0deg)",o=t.left+e-25+this.offsetX,r=t.bottom+s-8-this.offsetY,l="translateY(28px)"):(h="rotate(90deg)",o=t.left+e-25+this.offsetX,r=t.top+s-25+this.offsetY,l=`translateY(-${a}px)`),this.bubble.style.right="26px",this.bubble.style.left="auto"):(this.isPointingUp?(h="rotate(-90deg)",o=t.right+e-8-this.offsetX,r=t.bottom+s-25-this.offsetY,l="translateY(28px)"):(h="rotate(180deg)",o=t.right+e-8-this.offsetX,r=t.top+s-8+this.offsetY,l=`translateY(-${a}px)`),this.bubble.style.left="26px",this.bubble.style.right="auto"),this.pointer.style.transform=h,this.bubble.style.transform=l;const c=e+8,u=e+i-40;o=Math.max(c,Math.min(o,u)),this.container.style.left=`${o}px`,this.container.style.top=`${r}px`;const d=o-e;this._constrainBubbleToViewport(d,i)}_constrainBubbleToViewport(t,e){if(this._bubbleConstraintApplied)return;const s=this.bubble.style.maxWidth;this.bubble.style.maxWidth="";const i=this.bubble.offsetWidth||100;this._cachedBubbleNaturalWidth=i;let n=!1,a=0;if(this.isPointingLeft){if(t-i+26<8){const e=t+26-8;a=Math.max(e,80),n=!0}}else{if(t+26+i>e-8){const s=e-t-26-8;a=Math.max(s,80),n=!0}}this.bubble.style.maxWidth=n?`${a}px`:s||"",this._bubbleConstraintApplied=!0}show(){if(this._emit("beforeShow",{target:this.targetElement}),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),document.body.contains(this.container)||document.body.appendChild(this.container),!this._hasShownBefore){this._hasShownBefore=!0;const t="first-step"===this.initialPosition,e=this._getInitialPosition(),s=e.x,i=e.y;if(this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.pointer.style.transition="none",this.bubble.style.transition="none",this.bubble.style.opacity="0",this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,t&&void 0!==e.isPointingUp)if(this.isPointingUp=e.isPointingUp,this.isPointingUp)this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";else{this.pointer.style.transform="rotate(90deg)";const t=this.bubble.offsetHeight||28;this.bubble.style.transform=`translateY(-${t}px)`}else this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";return this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this._emit("introAnimationStart",{duration:this.introFadeDuration,initialPosition:{x:s,y:i}}),void setTimeout(()=>{if(this._emit("introAnimationEnd",{initialPosition:{x:s,y:i}}),t){this.container.style.transition="none",this.pointer.style.transition="none",this._startTracking();const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition=`opacity ${this.bubbleFadeDuration}ms ease`,t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),setTimeout(()=>{this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition=""},this.bubbleFadeDuration),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay(),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!0})}else this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition="none",this.updatePosition(),this._startTracking(),setTimeout(()=>{const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition="",t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay()},this.animationDuration),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!1})},this.introFadeDuration)}this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this.updatePosition(),this._startTracking(),this._messageCyclePausedByHide&&this.messageInterval&&this.currentMessages.length>1?(this._startMessageCycle(),this._messageCyclePausedByHide=!1):this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._wasAutoplayActiveBeforeHide&&(this._scheduleAutoplay(),this._wasAutoplayActiveBeforeHide=!1),this._emit("show",{target:this.targetElement,isIntro:!1})}hide(){this._emit("beforeHide",{target:this.targetElement}),this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this.isVisible=!1,this.resetPositionOnHide&&(this._hasShownBefore=!1),this._stopTracking(),this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePausedByHide=!0),this._wasAutoplayActiveBeforeHide=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused,this._stopAutoplay(),this._emit("hide",{target:this.targetElement})}restart(){this._emit("beforeRestart",{}),this._hasShownBefore=!1,this.isVisible?(this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this._stopTracking(),this._stopMessageCycle(),this.isVisible=!1,setTimeout(()=>{this.goToStep(0),this.show(),this._emit("restart",{})},50)):(this.goToStep(0),this.show(),this._emit("restart",{}))}destroy(){this._emit("destroy",{}),document.body.contains(this.container)&&document.body.removeChild(this.container),window.removeEventListener("resize",this.updatePosition),window.removeEventListener("scroll",this.updatePosition),this._stopTracking(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this._eventListeners={}}reset(e=!0){this._emit("beforeReset",{currentStep:this.currentStepIndex}),this._stopMessageCycle(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const{x:s,y:i}=this._getInitialPosition();if(this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,this.bubble.style.opacity="0",e&&this.steps.length>0){this.currentStepIndex=0;const e=this.steps[0];this.targetElement=t.getTargetElement(e.target),this.currentMessages=Array.isArray(e.content)?e.content:[e.content],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0]),this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth=""}this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._hasShownBefore=!1,this._emit("reset",{stepIndex:this.currentStepIndex})},this.animationDuration)}setResetOnComplete(t){const e=this.resetOnComplete;e!==t&&(this.resetOnComplete=t,this._emit("resetOnCompleteChange",{from:e,to:t}))}setFloatingAnimation(t){const e=this.floatingAnimation;e!==t&&(this.floatingAnimation=t,this.container.style.animationPlayState=t?"":"paused",this._emit("floatingAnimationChange",{from:e,to:t}))}isFloatingAnimationEnabled(){return this.floatingAnimation}setTracking(t){const e=this.tracking;e!==t&&(this.tracking=t,t&&this.isVisible?this._startTracking():t||this._stopTracking(),this._emit("trackingChange",{from:e,to:t}))}setTrackingFps(t){const e=this.trackingFps;e!==t&&(this.trackingFps=t,this._emit("trackingFpsChange",{from:e,to:t}))}isTrackingEnabled(){return this.tracking}updateContent(e,s=!0){if(""===e||null==e||Array.isArray(e)&&0===e.length||Array.isArray(e)&&e.every(t=>""===t||null==t))return this.bubble.style.opacity="0",void(this.bubble.style.pointerEvents="none");if("0"===this.bubble.style.opacity&&this.isVisible){const t=this.bubble.style.transition,e=this.pointer.style.transition;this.bubble.style.transition="none",this.pointer.style.transition="none",this.bubble.style.opacity="1",this.bubble.style.pointerEvents="",this.bubble.offsetHeight,this.updatePosition(),this.bubble.offsetHeight,requestAnimationFrame(()=>{this.bubble.style.transition=t,this.pointer.style.transition=e})}"string"==typeof e&&this.bubbleText.innerHTML===e||(s?t.animateText(this.bubbleText,e,this.messageTransitionDuration,this.bubble,()=>{this.updatePosition()}):(t.renderContent(this.bubbleText,e),this.updatePosition()))}static _generateReactKey(t){const e="function"==typeof t.type?t.type.name||"Component":t.type||"unknown";let s="";try{s=JSON.stringify(t.props,(t,e)=>{if("children"!==t&&"function"!=typeof e&&"symbol"!=typeof e)return e&&"object"==typeof e&&e.$$typeof?"[ReactElement]":e})||""}catch(e){s=String(Object.keys(t.props||{}).length)}let i=0;const n=e+s;for(let t=0;t<n.length;t++){i=(i<<5)-i+n.charCodeAt(t),i&=i}return`pointy-${e}-${Math.abs(i).toString(36)}`}_applyMessages(e,s=!1){const i=null!==this._messageIntervalId;this._stopMessageCycle();let n=Array.isArray(e)?e:[e];if("undefined"!=typeof React&&React.cloneElement&&n.length>1){const e=new Map;n=n.map(s=>{if(s&&"object"==typeof s&&s.$$typeof&&null==s.key){const i=t._generateReactKey(s),n=e.get(i)||0;e.set(i,n+1);const a=n>0?`${i}-${n}`:i;return React.cloneElement(s,{key:a})}return s})}this.currentMessages=n,this.currentMessageIndex=0,this.updateContent(this.currentMessages[0]),s&&this.messageInterval&&this.currentMessages.length>1?this._startMessageCycle():i&&this.currentMessages.length>1&&(this._messageCyclePaused=!0),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,cyclePaused:!0===this._messageCyclePaused})}_startMessageCycle(t,e=!0){const s=t||this.messageInterval;this._messagesCompletedForStep=!1,this._shouldCycleMessages=e,this._messageIntervalId=setInterval(()=>{this.currentMessageIndex===this.currentMessages.length-1?this.autoplay&&this.autoplayWaitForMessages?(this._stopMessageCycle(),this._messagesCompletedForStep=!0,this._emit("messageCycleComplete",{stepIndex:this.currentStepIndex,totalMessages:this.currentMessages.length}),this._scheduleAutoplayAfterMessages()):this._shouldCycleMessages?this.nextMessage(!0):(this._stopMessageCycle(),this._emit("messageCycleComplete",{totalMessages:this.currentMessages.length})):this.nextMessage(!0)},s),this._emit("messageCycleStart",{interval:s,totalMessages:this.currentMessages.length,cycle:e})}_stopMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._emit("messageCycleStop",{currentIndex:this.currentMessageIndex}))}pauseMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._messageCyclePaused=!0,this._emit("messageCyclePause",{currentIndex:this.currentMessageIndex}))}resumeMessageCycle(){return!!(this._messageCyclePaused&&this.messageInterval&&this.currentMessages.length>1)&&(this._messageCyclePaused=!1,this._startMessageCycle(),this._emit("messageCycleResume",{currentIndex:this.currentMessageIndex}),!0)}startMessageCycle(t){return!this._messageIntervalId&&(!(this.currentMessages.length<=1)&&(void 0!==t&&(this.messageInterval=t),!!this.messageInterval&&(this._messageCyclePaused=!1,this._startMessageCycle(),!0)))}stopMessageCycle(){return!!this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePaused=!1,!0)}isMessageCycleActive(){return null!==this._messageIntervalId}isMessageCyclePaused(){return!0===this._messageCyclePaused}nextMessage(t=!1){if(this.currentMessages.length<=1)return!1;const e=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex+1)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length,isAuto:t}),!0}prevMessage(){if(this.currentMessages.length<=1)return!1;const t=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex-1+this.currentMessages.length)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:t,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length}),!0}goToMessage(t){if(t<0||t>=this.currentMessages.length)return;const e=this.currentMessageIndex;this.currentMessageIndex=t,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length})}getCurrentMessage(){return this.currentMessageIndex}getTotalMessages(){return this.currentMessages.length}setCurrentMessage(t,e=!0){const s=this.currentMessages[this.currentMessageIndex];this.currentMessages[this.currentMessageIndex]=t,this.updateContent(t,e),e||this.updatePosition(),this._emit("currentMessageUpdate",{index:this.currentMessageIndex,message:t,oldMessage:s,total:this.currentMessages.length,animated:e})}setMessage(t,e=!0){this.setMessages(t,e)}setMessages(e,s=!0){const i=null!==this._messageIntervalId;s?this._applyMessages(e,!1):(this._stopMessageCycle(),this.currentMessages=Array.isArray(e)?e:[e],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0]),this.updatePosition(),i&&this.currentMessages.length>1&&(this._messageCyclePaused=!0)),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,animated:s,cyclePaused:!0===this._messageCyclePaused})}setMessageInterval(t){const e=this.messageInterval;e!==t&&(this.messageInterval=t,this._stopMessageCycle(),t&&this.currentMessages.length>1&&this._startMessageCycle(),this._emit("messageIntervalChange",{from:e,to:t}))}updateTarget(e){const s=this.targetElement;this.targetElement=t.getTargetElement(e),this.updatePosition(),this._emit("targetChange",{from:s,to:this.targetElement})}setZIndex(t){const e=this.zIndex;e!==t&&(this.zIndex=t,this.container.style.zIndex=t,this._emit("zIndexChange",{from:e,to:t}))}setStayInViewport(t,e){const s=this.stayInViewport,i=this.viewportThresholdX,n=this.viewportThresholdY;this.stayInViewport=t,e&&"object"==typeof e&&(void 0!==e.x&&(this.viewportThresholdX=e.x),void 0!==e.y&&(this.viewportThresholdY=e.y)),t||(this.isPointingLeft=!0,this.isPointingUp=!0),this.updatePosition(),this._emit("stayInViewportChange",{from:{enabled:s,x:i,y:n},to:{enabled:t,x:this.viewportThresholdX,y:this.viewportThresholdY}})}_parseDirection(t){if(!t)return this.manualHorizontalDirection=null,void(this.manualVerticalDirection=null);const e=t.toLowerCase();e.includes("left")?this.manualHorizontalDirection="left":e.includes("right")?this.manualHorizontalDirection="right":this.manualHorizontalDirection=null,e.includes("up")?this.manualVerticalDirection="up":e.includes("down")?this.manualVerticalDirection="down":this.manualVerticalDirection=null}setDirection(t){const e=this.manualHorizontalDirection,s=this.manualVerticalDirection;this._parseDirection(t),this.updatePosition(),this._emit("directionChange",{from:{horizontal:e,vertical:s},to:{horizontal:this.manualHorizontalDirection,vertical:this.manualVerticalDirection}})}setHorizontalDirection(t){const e=this.manualHorizontalDirection;e!==t&&(this.manualHorizontalDirection=t,this.updatePosition(),this._emit("horizontalDirectionChange",{from:e,to:t}))}setVerticalDirection(t){const e=this.manualVerticalDirection;e!==t&&(this.manualVerticalDirection=t,this.updatePosition(),this._emit("verticalDirectionChange",{from:e,to:t}))}setOffset(t,e){const s=this.offsetX,i=this.offsetY;s===t&&i===e||(this.offsetX=t,this.offsetY=e,this.updatePosition(),this._emit("offsetChange",{from:{x:s,y:i},to:{x:t,y:e}}))}setAnimationDuration(t){const e=this.animationDuration;e!==t&&(this.animationDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${t}ms`),this._emit("animationDurationChange",{from:e,to:t}))}setIntroFadeDuration(t){const e=this.introFadeDuration;e!==t&&(this.introFadeDuration=t,this._emit("introFadeDurationChange",{from:e,to:t}))}setBubbleFadeDuration(t){const e=this.bubbleFadeDuration;e!==t&&(this.bubbleFadeDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${t}ms`),this._emit("bubbleFadeDurationChange",{from:e,to:t}))}setBubbleBackgroundColor(t){const e=this.bubbleBackgroundColor;e!==t&&(this.bubbleBackgroundColor=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-bg`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-bubble-bg`),this._emit("bubbleBackgroundColorChange",{from:e,to:t}))}setBubbleTextColor(t){const e=this.bubbleTextColor;e!==t&&(this.bubbleTextColor=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-color`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-bubble-color`),this._emit("bubbleTextColorChange",{from:e,to:t}))}setBubbleMaxWidth(t){const e=this.bubbleMaxWidth;e!==t&&(this.bubbleMaxWidth=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-max-width`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-bubble-max-width`),this._emit("bubbleMaxWidthChange",{from:e,to:t}))}setPointerColor(t){const e=this.pointerColor;e!==t&&(this.pointerColor=t,t?this.container.style.setProperty(`--${this.cssVarPrefix}-pointer-color`,t):this.container.style.removeProperty(`--${this.cssVarPrefix}-pointer-color`),this._emit("pointerColorChange",{from:e,to:t}))}_getInitialPosition(){const e=this.initialPositionOffset,s=window.innerWidth,i=window.innerHeight;if("first-step"===this.initialPosition&&this.steps.length>0){const e=this.steps[0],s=t.getTargetElement(e.target);if(s){const t=s.getBoundingClientRect(),i=window.scrollX,n=window.scrollY,a="down"!==e.direction;let o,r;return a?(o=t.left+i-25+this.offsetX,r=t.bottom+n-8-this.offsetY):(o=t.left+i-25+this.offsetX,r=t.top+n-25+this.offsetY),{x:o,y:r,isPointingUp:a}}}if(this.initialPosition&&"string"!=typeof this.initialPosition){const t=this.initialPosition.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}if("string"==typeof this.initialPosition&&(this.initialPosition.startsWith("#")||this.initialPosition.startsWith("."))){const t=document.querySelector(this.initialPosition);if(t){const e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}}const n={center:{x:s/2,y:i/2},"top-left":{x:e,y:e},"top-center":{x:s/2,y:e},"top-right":{x:s-e,y:e},"middle-left":{x:e,y:i/2},"middle-right":{x:s-e,y:i/2},"bottom-left":{x:e,y:i-e},"bottom-center":{x:s/2,y:i-e},"bottom-right":{x:s-e,y:i-e}};return n[this.initialPosition]||n.center}setInitialPosition(t){const e=["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"];if("string"==typeof t&&!t.startsWith("#")&&!t.startsWith(".")&&!e.includes(t))return void console.warn(`Invalid initial position: ${t}. Valid presets: ${e.join(", ")}. Or use a CSS selector or DOM element.`);const s=this.initialPosition;s!==t&&(this.initialPosition=t,this._emit("initialPositionChange",{from:s,to:t}))}animateToInitialPosition(){if(!this.isVisible)return;const{x:t,y:e}=this._getInitialPosition();this._stopTracking(),this.container.style.cssText=`\n position: fixed;\n left: ${t}px;\n top: ${e}px;\n opacity: 0;\n transition: none;\n `,this.bubble.style.opacity="0",this.bubble.style.transition="none",this.container.offsetHeight,this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.container.style.opacity="1",setTimeout(()=>{this.container.style.transition="",this.container.style.cssText="",this.container.style.left=`${t}px`,this.container.style.top=`${e}px`,this.container.offsetHeight,this.updatePosition(),this._startTracking(),setTimeout(()=>{this.bubble.style.transition="",this.bubble.style.opacity="1"},this.animationDuration)},this.introFadeDuration)}setInitialPositionOffset(t){const e=this.initialPositionOffset;e!==t&&(this.initialPositionOffset=t,this._emit("initialPositionOffsetChange",{from:e,to:t}))}_resolveEasing(e){return t.EASINGS[e]?t.EASINGS[e]:e}setEasing(t){const e=this.easing;e!==t&&(this.easing=t,this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(t)),this._emit("easingChange",{from:e,to:t}))}setMessageTransitionDuration(t){const e=this.messageTransitionDuration;e!==t&&(this.messageTransitionDuration=t,this._emit("messageTransitionDurationChange",{from:e,to:t}))}setPointerSvg(e){const s=this.pointerSvg;s!==e&&(this.pointerSvg=e,t.renderContent(this.pointer,e),this._emit("pointerSvgChange",{from:s,to:e}))}getPointerSvg(){return this.pointerSvg}getClassNames(){return{...this.classNames}}getClassPrefix(){return this.classPrefix}getCssVarPrefix(){return this.cssVarPrefix}static getEasingPresets(){return Object.keys(t.EASINGS)}static getInitialPositions(){return["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"]}goToStep(e){if(0===this.steps.length||e<0||e>=this.steps.length)return;this._stopAutoplay(),this._messagesCompletedForStep=!1;const s=this.currentStepIndex,i=this.targetElement;this.currentStepIndex=e;const n=this.steps[this.currentStepIndex];this._emit("beforeStepChange",{fromIndex:s,toIndex:e,step:n,fromTarget:i}),this._parseDirection(n.direction),this._targetYHistory=[],this.lastTargetY=null,this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth="",this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout),this._emit("animationStart",{fromTarget:i,toTarget:t.getTargetElement(n.target),type:"step",stepIndex:e}),this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("moveComplete",{index:e,step:n,target:this.targetElement}),this._emit("animationEnd",{fromTarget:i,toTarget:this.targetElement,type:"step",stepIndex:e}),this._scheduleAutoplay()},this.animationDuration),this._emit("move",{index:e,step:n}),this._applyMessages(n.content,!0),this.targetElement=t.getTargetElement(n.target),this.updatePosition(),this._emit("stepChange",{fromIndex:s,toIndex:e,step:n,target:this.targetElement}),this.onStepChange&&this.onStepChange(this.currentStepIndex,n)}_scheduleAutoplay(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;const t=this.steps[this.currentStepIndex],e=this.currentMessages.length>1&&this.messageInterval;if(this.autoplayWaitForMessages&&e)return;const s=void 0!==t.duration?t.duration:this.autoplay;s&&s>0&&(this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this.autoplayEnabled&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,duration:s}),this.next())},s))}_scheduleAutoplayAfterMessages(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this._messagesCompletedForStep&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,afterMessages:!0}),this.next())},300)}_stopAutoplay(){this._autoplayTimeoutId&&(clearTimeout(this._autoplayTimeoutId),this._autoplayTimeoutId=null)}startAutoplay(){this.autoplay&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this._emit("autoplayStart",{}),this._scheduleAutoplay())}stopAutoplay(){this._stopAutoplay(),this.autoplayEnabled=!1,this._autoplayPaused=!1,this._emit("autoplayStop",{})}pauseAutoplay(){this._stopAutoplay(),this._autoplayPaused=!0,this._emit("autoplayPause",{})}resumeAutoplay(){this._autoplayPaused&&(this._autoplayPaused=!1,this._emit("autoplayResume",{}),this._scheduleAutoplay())}isAutoplayActive(){return this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused}isAutoplayPaused(){return this._autoplayPaused}setAutoplayInterval(t){const e=this.autoplay;e!==t&&(this.autoplay=t,this._emit("autoplayChange",{from:e,to:t}),this.autoplayEnabled&&t&&this.isVisible?(this._stopAutoplay(),this._scheduleAutoplay()):t||(this._stopAutoplay(),this.autoplayEnabled=!1))}setAutoplay(t){this.setAutoplayInterval(t),t&&this.isVisible&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this.restart())}setAutoplayWaitForMessages(t){const e=this.autoplayWaitForMessages;e!==t&&(this.autoplayWaitForMessages=t,this._emit("autoplayWaitForMessagesChange",{from:e,to:t}))}setHideOnComplete(t){const e=this.hideOnComplete;e!==t&&(this.hideOnComplete=t,this._emit("hideOnCompleteChange",{from:e,to:t}))}setHideOnCompleteDelay(t){const e=this.hideOnCompleteDelay;e!==t&&(this.hideOnCompleteDelay=t,this._emit("hideOnCompleteDelayChange",{from:e,to:t}))}next(){if(0!==this.steps.length)if(this.currentStepIndex<this.steps.length-1)this._emit("next",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex+1}),this.goToStep(this.currentStepIndex+1);else{const t=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused;if(this._emit("complete",{totalSteps:this.steps.length,source:t?"autoplay":"manual"}),t&&(this._stopAutoplay(),this.autoplayEnabled=!1,this._emit("autoplayComplete",{totalSteps:this.steps.length})),this.resetOnComplete){if(this.reset(),this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},this.animationDuration+e)}}else if(this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},e)}this.onComplete&&this.onComplete()}}prev(){0!==this.steps.length&&this.currentStepIndex>0&&(this._emit("prev",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex-1}),this.goToStep(this.currentStepIndex-1))}getCurrentStep(){return this.currentStepIndex}getTotalSteps(){return this.steps.length}pointTo(e,s,i={}){const n=i.direction||null,a=!0===i.autoplay,o=i.interval||null,r=!1!==i.cycle,h=this.targetElement,l=n||"auto";this._emit("beforePointTo",{target:t.getTargetElement(e),content:s,direction:l,fromTarget:h}),this._parseDirection(n),this._targetYHistory=[],this.lastTargetY=null,this._autoDirectionLocked=!1,this._bubbleConstraintApplied=!1,this._cachedBubbleNaturalWidth=null,this.bubble.style.maxWidth="",this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const c=t.getTargetElement(e);this._emit("animationStart",{fromTarget:h,toTarget:c,type:"pointTo",content:s}),this.targetElement=c,void 0!==s&&(this._applyMessages(s,!1),a&&Array.isArray(s)&&s.length>1&&this._startMessageCycle(o,r)),this.updatePosition();const u=this.isPointingUp?"up":"down";this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("pointToComplete",{target:this.targetElement,content:s,direction:u}),this._emit("animationEnd",{fromTarget:h,toTarget:this.targetElement,type:"pointTo",content:s})},this.animationDuration),this._emit("pointTo",{target:this.targetElement,content:s,direction:u}),this.isVisible||this.show()}on(t,e){return this._eventListeners[t]||(this._eventListeners[t]=[]),this._eventListeners[t].push(e),this}off(t,e){return this._eventListeners[t]?(e?this._eventListeners[t]=this._eventListeners[t].filter(t=>t!==e):delete this._eventListeners[t],this):this}_emit(e,s){const i={...s,type:e,pointy:this};this._eventListeners[e]&&this._eventListeners[e].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${e} event handler:`,t)}});const n=t.getEventGroup(e);n&&this._eventListeners[n]&&this._eventListeners[n].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${n} group handler for ${e}:`,t)}}),["*","all"].forEach(t=>{this._eventListeners[t]&&this._eventListeners[t].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in wildcard handler for ${e}:`,t)}})})}static getEventGroup(e){for(const[s,i]of Object.entries(t.EVENT_GROUPS))if(i.includes(e))return s;return e.endsWith("Change")?"config":null}static getEventsInGroup(e){return t.EVENT_GROUPS[e]||[]}}return t.EVENT_GROUPS={lifecycle:["beforeShow","show","beforeHide","hide","destroy","beforeRestart","restart","beforeReset","reset"],navigation:["beforeStepChange","stepChange","next","prev","complete"],animation:["animationStart","animationEnd","move","moveComplete","introAnimationStart","introAnimationEnd"],content:["contentSet","messagesSet","messageChange"],messageCycle:["messageCycleStart","messageCycleStop","messageCyclePause","messageCycleResume","messageCycleComplete"],pointing:["beforePointTo","pointTo","pointToComplete"],tracking:["track","targetChange","trackingChange","trackingFpsChange"],autoplay:["autoplayStart","autoplayStop","autoplayPause","autoplayResume","autoplayNext","autoplayComplete","autoHide","autoplayChange","autoplayWaitForMessagesChange"]},t});
2
2
  //# sourceMappingURL=pointy.min.js.map