{"version":3,"file":"intro.min.js","sources":["../../src/util/cloneObject.ts","../../src/util/queryElement.ts","../../src/packages/hint/dataAttributes.ts","../../src/packages/hint/hintItem.ts","../../src/option.ts","../../src/util/isFunction.ts","../../src/util/DOMEvent.ts","../../src/packages/dom/index.ts","../../src/util/containerElement.ts","../../src/packages/hint/hide.ts","../../src/packages/hint/show.ts","../../src/packages/hint/className.ts","../../src/util/getPropValue.ts","../../src/util/isFixed.ts","../../src/util/getOffset.ts","../../src/packages/hint/position.ts","../../src/packages/hint/components/HintIcon.ts","../../src/util/className.ts","../../src/util/style.ts","../../src/util/positionRelativeTo.ts","../../src/util/getWindowSize.ts","../../src/packages/tour/classNames.ts","../../src/util/removeEntry.ts","../../src/packages/tooltip/tooltipPosition.ts","../../src/packages/tooltip/tooltip.ts","../../src/packages/hint/components/HintTooltip.ts","../../src/packages/hint/components/ReferenceLayer.ts","../../src/packages/hint/components/HintsRoot.ts","../../src/packages/hint/hint.ts","../../src/packages/hint/option.ts","../../src/util/debounce.ts","../../src/packages/tour/dataAttributes.ts","../../src/packages/tour/showElement.ts","../../src/packages/tour/steps.ts","../../src/packages/tour/start.ts","../../src/packages/tour/exitIntro.ts","../../src/util/cookie.ts","../../src/packages/tour/dontShowAgain.ts","../../src/packages/tour/onKeyDown.ts","../../src/packages/tour/position.ts","../../src/util/scrollParentToElement.ts","../../src/util/getScrollParent.ts","../../src/util/scrollTo.ts","../../src/util/elementInViewport.ts","../../src/packages/tour/components/TourTooltip.ts","../../src/packages/tour/components/ReferenceLayer.ts","../../src/packages/tour/components/HelperLayer.ts","../../src/packages/tour/components/DisableInteraction.ts","../../src/packages/tour/components/OverlayLayer.ts","../../src/packages/tour/components/TourRoot.ts","../../src/packages/tour/components/FloatingElement.ts","../../src/packages/tour/tour.ts","../../src/packages/tour/option.ts","../../src/index.ts"],"sourcesContent":["/**\n * Makes a copy of an object\n * @api private\n */\nexport default function cloneObject(source: T): T {\n if (source === null || typeof source !== \"object\" || \"nodeType\" in source) {\n return source;\n }\n\n const temp = {} as T;\n\n for (const key in source) {\n if (\n \"jQuery\" in window &&\n window.jQuery &&\n source[key] instanceof (window.jQuery as any)\n ) {\n temp[key] = source[key];\n } else {\n temp[key] = cloneObject(source[key]);\n }\n }\n return temp;\n}\n","export const queryElement = (\n selector: string,\n container?: HTMLElement | null\n): HTMLElement | null => {\n return (container ?? document).querySelector(selector);\n};\n\nexport const queryElements = (\n selector: string,\n container?: HTMLElement | null\n): NodeListOf => {\n return (container ?? document).querySelectorAll(selector);\n};\n\nexport const queryElementsByClassName = (\n className: string,\n container?: HTMLElement | null\n): NodeListOf => {\n return queryElements(`.${className}`, container);\n};\n\nexport const getElement = (\n selector: string,\n container?: HTMLElement | null\n) => {\n const element = queryElement(selector, container);\n\n if (!element) {\n throw new Error(`Element with selector ${selector} not found`);\n }\n\n return element;\n};\n","export const dataHintAttribute = \"data-hint\";\nexport const dataStepAttribute = \"data-step\";\nexport const dataHintPositionAttribute = \"data-hint-position\";\nexport const dataTooltipClassAttribute = \"data-tooltip-class\";\n","import { TooltipPosition } from \"../../packages/tooltip\";\nimport { Hint } from \"./hint\";\nimport cloneObject from \"../../util/cloneObject\";\nimport { queryElement, queryElements } from \"../../util/queryElement\";\nimport {\n dataHintAttribute,\n dataHintPositionAttribute,\n dataTooltipClassAttribute,\n} from \"./dataAttributes\";\nimport { State } from \"../dom\";\n\nexport type HintPosition =\n | \"top-left\"\n | \"top-right\"\n | \"top-middle\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"bottom-middle\"\n | \"middle-left\"\n | \"middle-right\"\n | \"middle-middle\";\n\nexport type HintItem = {\n element?: HTMLElement | string | null;\n tooltipClass?: string;\n position: TooltipPosition;\n hint?: string;\n // this is the HintIcon element for this particular hint\n // used for positioning the HintTooltip\n hintTooltipElement?: HTMLElement;\n hintAnimation?: boolean;\n hintPosition: HintPosition;\n isActive?: State;\n};\n\nexport const fetchHintItems = (hint: Hint) => {\n hint.setHints([]);\n\n const targetElement = hint.getTargetElement();\n const hints = hint.getOption(\"hints\");\n\n if (hints && hints.length > 0) {\n for (const _hint of hints) {\n const hintItem = cloneObject(_hint);\n\n if (typeof hintItem.element === \"string\") {\n // grab the element with given selector from the page\n hintItem.element = queryElement(hintItem.element);\n }\n\n hintItem.hintPosition =\n hintItem.hintPosition || hint.getOption(\"hintPosition\");\n hintItem.hintAnimation =\n hintItem.hintAnimation || hint.getOption(\"hintAnimation\");\n\n if (hintItem.element !== null) {\n hint.addHint(hintItem as HintItem);\n }\n }\n } else {\n const elements = Array.from(\n queryElements(`*[${dataHintAttribute}]`, targetElement)\n );\n\n if (!elements || !elements.length) {\n return false;\n }\n\n //first add intro items with data-step\n for (const element of elements) {\n // hint animation\n let hintAnimationAttr = element.getAttribute(dataHintPositionAttribute);\n\n let hintAnimation: boolean = hint.getOption(\"hintAnimation\");\n if (hintAnimationAttr) {\n hintAnimation = hintAnimationAttr === \"true\";\n }\n\n hint.addHint({\n element: element,\n hint: element.getAttribute(dataHintAttribute) || \"\",\n hintPosition: (element.getAttribute(dataHintPositionAttribute) ||\n hint.getOption(\"hintPosition\")) as HintPosition,\n hintAnimation,\n tooltipClass:\n element.getAttribute(dataTooltipClassAttribute) || undefined,\n position: (element.getAttribute(\"data-position\") ||\n hint.getOption(\"tooltipPosition\")) as TooltipPosition,\n });\n }\n }\n\n return true;\n};\n","export function setOption(\n options: T,\n key: K,\n value: T[K]\n): T {\n options[key] = value;\n return options;\n}\n\nexport function setOptions(options: T, partialOptions: Partial): T {\n for (const [key, value] of Object.entries(partialOptions)) {\n options = setOption(options, key as keyof T, value as T[keyof T]);\n }\n return options;\n}\n","// Returns true if the given parameter is a function\nexport default (x: any): x is Function => typeof x === \"function\";\n","/**\n * DOMEvent Handles all DOM events\n *\n * methods:\n *\n * on - add event handler\n * off - remove event\n */\n\ninterface Events {\n keydown: KeyboardEvent;\n resize: Event;\n scroll: Event;\n click: MouseEvent;\n}\n\ntype Listener = (e: T) => void | undefined | string | Promise;\n\nclass DOMEvent {\n /**\n * Adds event listener\n */\n public on(\n obj: EventTarget,\n type: T,\n listener: Listener,\n useCapture: boolean\n ) {\n if (\"addEventListener\" in obj) {\n obj.addEventListener(type, listener, useCapture);\n } else if (\"attachEvent\" in obj) {\n (obj as any).attachEvent(`on${type}`, listener);\n }\n }\n\n /**\n * Removes event listener\n */\n public off(\n obj: EventTarget,\n type: T,\n listener: Listener,\n useCapture: boolean\n ) {\n if (\"removeEventListener\" in obj) {\n obj.removeEventListener(type, listener, useCapture);\n } else if (\"detachEvent\" in obj) {\n (obj as any).detachEvent(`on${type}`, listener);\n }\n }\n}\n\nexport default new DOMEvent();\n","/**\n * A TypeScript and modified version of the VanJS project.\n * Credits: https://github.com/vanjs-org/van & https://github.com/ge3224/van-ts\n */\n\n/**\n * A type representing primitive JavaScript types.\n */\nexport type Primitive = string | number | boolean | bigint;\n\n/**\n * A type representing a property value which can be a primitive, a function,\n * or null.\n */\nexport type PropValue = Primitive | ((e: T) => void) | null;\n\n/**\n * A type representing valid child DOM values.\n */\nexport type ValidChildDomValue = Primitive | Node | null | undefined;\n\n/**\n * A type representing functions that generate DOM values.\n */\nexport type BindingFunc =\n | ((dom?: Node) => ValidChildDomValue)\n | ((dom?: Element) => Element);\n\n/**\n * A type representing various possible child DOM values.\n */\nexport type ChildDom =\n | ValidChildDomValue\n | StateView\n | BindingFunc\n | readonly ChildDom[];\n\ntype ConnectedDom = { isConnected: number };\n\ntype Binding = {\n f: BindingFunc;\n _dom: HTMLElement | null | undefined;\n};\n\ntype Listener = {\n f: BindingFunc;\n s: State;\n _dom?: HTMLElement | null | undefined;\n};\n\ntype Connectable = Listener | Binding;\n\n/**\n * Interface representing a state object with various properties and bindings.\n */\nexport interface State {\n val: T | undefined;\n readonly oldVal: T | undefined;\n rawVal: T | undefined;\n _oldVal: T | undefined;\n _bindings: Array;\n _listeners: Array>;\n}\n\n/**\n * A type representing a read-only view of a `State` object.\n */\nexport type StateView = Readonly>;\n\n/**\n * A type representing a value that can be either a `State` object or a direct\n * value of type `T`.\n */\nexport type Val = State | T;\n\n/**\n * A type representing a property value, a state view of a property value, or a\n * function returning a property value.\n */\nexport type PropValueOrDerived =\n | PropValue\n | StateView\n | (() => PropValue);\n\n/**\n * A type representing partial props with known keys for a specific\n * element type.\n */\nexport type Props = Record & {\n class?: PropValueOrDerived;\n};\n\nexport type PropsWithKnownKeys = Partial<{\n [K in keyof ElementType]: PropValueOrDerived;\n}>;\n\n/**\n * Represents a function type that constructs a tagged result using provided\n * properties and children.\n */\nexport type TagFunc = (\n first?: (Props & PropsWithKnownKeys) | ChildDom,\n ...rest: readonly ChildDom[]\n) => Result;\n\n/**\n * Interface representing dependencies with sets for getters and setters.\n */\ninterface Dependencies {\n _getters: Set>;\n _setters: Set>;\n}\n\n/**\n * A function type for searching property descriptors in a prototype chain.\n */\ntype PropertyDescriptorSearchFn = (\n proto: T\n) => ReturnType | undefined;\n\n/**\n * A function type for setting event listeners.\n */\ntype EventSetterFn = (\n v: EventListenerOrEventListenerObject,\n oldV?: EventListenerOrEventListenerObject\n) => void;\n\n/**\n * A function type for setting property values.\n */\ntype PropSetterFn = (value: any) => void;\n\n/**\n * Represents a function type for creating a namespace-specific collection of\n * tag functions.\n *\n * @param {string} namespaceURI\n * - The URI of the namespace for which the tag functions are being created.\n *\n * @returns {Readonly>>}\n * - A readonly record of string keys to TagFunc functions,\n * representing the collection of tag functions within the specified\n * namespace.\n */\nexport type NamespaceFunction = (\n namespaceURI: string\n) => Readonly>>;\n\n/**\n * Represents a type for a collection of tag functions.\n *\n * This type includes:\n * - A readonly record of string keys to TagFunc functions, enabling\n * the creation of generic HTML elements.\n * - Specific tag functions for each HTML element type as defined in\n * HTMLElementTagNameMap, with the return type corresponding to the specific\n * type of the HTML element (e.g., HTMLDivElement for 'div',\n * HTMLAnchorElement for 'a').\n *\n * Usage of this type allows for type-safe creation of HTML elements with\n * specific properties and child elements.\n */\nexport type Tags = Readonly>> & {\n [K in keyof HTMLElementTagNameMap]: TagFunc;\n};\n\n/**\n * While VanJS prefers using `let` instead of `const` to help reduce bundle\n * size, this project employs the `const` keyword. Bundle sizes are managed\n * during TypeScript compilation and bundling, incorporating minification and\n * tree shaking.\n *\n * The following are global variables used by VanJS to alias some builtin\n * symbols and reduce the bundle size.\n */\n\n/**\n * Set containing changed states.\n */\nlet changedStates: Set> | undefined;\n\n/**\n * Set containing derived states.\n */\nlet derivedStates: Set>;\n\n/**\n * Current dependencies object, containing getters and setters.\n */\nlet curDeps: Dependencies;\n\n/**\n * Array containing current new derivations.\n */\nlet curNewDerives: Array;\n\n/**\n * Set containing objects marked for garbage collection.\n */\nlet forGarbageCollection: Set | undefined;\n\n/**\n * Alias for the built-in primitive value `undefined`. This variable is used to\n * reduce bundle size. Since it is never initialized, its value equals\n * `undefined`. During minification, variable names are shortened.\n */\nlet _undefined: undefined;\n\n/**\n * Alias for the keyword `Object`. This is used to reduce bundle size during\n * minification.\n */\nconst _object = Object;\n\n/**\n * Alias for the keyword `document`. This is used to reduce bundle size during\n * minification.\n */\nconst _document = document;\n\n/**\n * A constant function returning the prototype of an object.\n */\nconst protoOf = _object.getPrototypeOf;\n\n/**\n * Constant representing a DOM object that is always considered connected.\n */\nconst alwaysConnectedDom: ConnectedDom = { isConnected: 1 };\n\n/**\n * Constant representing the garbage collection cycle duration in milliseconds.\n */\nconst gcCycleInMs = 1000;\n\n/**\n * Cache object for property setters.\n */\nconst propSetterCache: { [key: string]: ((v: T) => void) | 0 } = {};\n\n/**\n * Prototype of the `alwaysConnectedDom` object.\n */\nconst objProto = protoOf(alwaysConnectedDom);\n\n/**\n * Prototype of the `Function` object.\n */\nconst funcProto = Function.prototype;\n\n/**\n * Adds a state object to a set and schedules an associated function to be\n * executed after a specified delay if the set is initially undefined.\n */\nconst addAndScheduleOnFirst = (\n set: Set> | undefined,\n state: State,\n fn: () => void,\n waitMs?: number\n): Set> => {\n if (set === undefined) {\n setTimeout(fn, waitMs);\n set = new Set>();\n }\n set.add(state);\n return set;\n};\n\n/**\n * Executes a function with a given argument and tracks dependencies during\n * its execution.\n */\nconst runAndCaptureDependencies = (\n fn: Function,\n deps: Dependencies,\n arg: T\n): T => {\n let prevDeps = curDeps;\n curDeps = deps;\n\n try {\n return fn(arg);\n } catch (e) {\n console.error(e);\n return arg;\n } finally {\n curDeps = prevDeps;\n }\n};\n\n/**\n * Filters an array of Connectable objects, returning only those whose `_dom`\n * property is connected to the current document.\n */\nconst keepConnected = >(l: T[]): T[] => {\n return l.filter((b) => b._dom?.isConnected);\n};\n\n/**\n * Adds a state object to a collection that will be processed for\n * garbage collection.\n */\nconst addForGarbageCollection = (discard: State): void => {\n forGarbageCollection = addAndScheduleOnFirst(\n forGarbageCollection,\n discard,\n () => {\n if (forGarbageCollection) {\n for (let s of forGarbageCollection) {\n s._bindings = keepConnected(s._bindings);\n s._listeners = keepConnected(s._listeners);\n }\n forGarbageCollection = _undefined; // Resets `forGarbageCollection` after processing\n }\n },\n gcCycleInMs\n );\n};\n\n/**\n * Prototype for state objects, providing getter and setter for `val` and\n * `oldVal`.\n */\nconst stateProto = {\n get val() {\n const state = this as State;\n curDeps?._getters?.add(state);\n return state.rawVal;\n },\n\n get oldVal() {\n const state = this as State;\n curDeps?._getters?.add(state);\n return state._oldVal;\n },\n\n set val(v) {\n const state = this as State;\n curDeps?._setters?.add(state);\n if (v !== state.rawVal) {\n state.rawVal = v;\n state._bindings.length + state._listeners.length\n ? (derivedStates?.add(state),\n (changedStates = addAndScheduleOnFirst(\n changedStates,\n state,\n updateDoms\n )))\n : (state._oldVal = v);\n }\n },\n};\n\n/**\n * Generates a property descriptor with preset characteristics for properties\n * of a state object.\n */\nconst statePropertyDescriptor = (value: T): PropertyDescriptor => {\n return {\n writable: true,\n configurable: true,\n enumerable: true,\n value: value,\n };\n};\n\n/**\n * Creates a state object with optional initial value. The properties of the\n * created object are configured to be enumerable, writable, and configurable.\n *\n * @template\n * @param {T} [initVal] - Optional initial value for the state.\n * @returns {State} A state object.\n */\nconst state = (initVal?: T): State => {\n // In contrast to the VanJS implementation (above), where reducing the bundle\n // size is a key priority, we use the `Object.create` method instead of the\n // `Object.prototype.__proto__` accessor since the latter is no longer\n // recommended.\n //\n // [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto)\n return _object.create(stateProto, {\n rawVal: statePropertyDescriptor(initVal),\n _oldVal: statePropertyDescriptor(initVal),\n _bindings: statePropertyDescriptor([]),\n _listeners: statePropertyDescriptor([]),\n });\n};\n\n/**\n * Binds a function to a DOM element, capturing its dependencies and updating\n * the DOM as needed.\n *\n * @template T\n * @param {Function} f - The function to bind.\n * @param {T | undefined} [dom] - Optional DOM element or undefined.\n * @returns {T} The resulting DOM element or text node.*\n */\nconst bind = (f: Function, dom?: T | undefined): T => {\n let deps: Dependencies = { _getters: new Set(), _setters: new Set() };\n let binding: { [key: string]: any } = { f };\n let prevNewDerives = curNewDerives;\n\n curNewDerives = [];\n let newDom = runAndCaptureDependencies(f, deps, dom);\n\n newDom = ((newDom ?? _document) as Node).nodeType\n ? newDom\n : new Text(newDom as string | undefined);\n\n for (let d of deps._getters)\n deps._setters.has(d) ||\n (addForGarbageCollection(d as any), (d as any)._bindings.push(binding));\n for (let l of curNewDerives) l._dom = newDom;\n curNewDerives = prevNewDerives;\n return (binding._dom = newDom);\n};\n\n/**\n * Derives a State based on a function and optional paremeters.\n *\n * @template T - The type of value returned by the derivation function.\n * @param {() => T} f - The derivation that computes the value.\n * @param {State} [s] - Optional initial State object to store the derived value.\n * @param {ChildDom} [dom] - Optional DOM element or ChildDom to associate with the derivation.\n * @returns {State} The State object containing the derived value and associated dependencies.\n */\nconst derive = (f: () => T, s?: State, dom?: ChildDom): State => {\n s = s ?? state();\n let deps: Dependencies = { _getters: new Set(), _setters: new Set() };\n let listener: { [key: string]: any } = { f, s };\n listener._dom = dom ?? curNewDerives?.push(listener) ?? alwaysConnectedDom;\n s.val = runAndCaptureDependencies(f, deps, s.rawVal);\n for (let d of deps._getters)\n deps._setters.has(d) ||\n (addForGarbageCollection(d), d._listeners.push(listener as Listener));\n return s;\n};\n\n/**\n * Appends child elements to a DOM element and returns said DOM element.\n *\n * @param {Element} dom - The DOM element to which children will be added.\n * @param {readonly ChildDom[]} children - An array of child elements or arrays of child elements to add.\n * @returns {Element} The modified DOM element after adding all children.\n */\nconst add = (dom: Element, ...children: readonly ChildDom[]): Element => {\n for (let c of (children as any).flat(Infinity)) {\n const protoOfC = protoOf(c ?? 0);\n const child =\n protoOfC === stateProto\n ? bind(() => c.val)\n : protoOfC === funcProto\n ? bind(c)\n : c;\n child != _undefined && dom.append(child);\n }\n return dom;\n};\n\n/**\n * Creates a new DOM element with specified namespace, tag name, properties,\n * and children.\n */\nconst tag = (ns: string | null, name: string, ...args: any): Element => {\n const [props, ...children] =\n protoOf(args[0] ?? 0) === objProto ? args : [{}, ...args];\n\n const dom: Element | HTMLElement = ns\n ? _document.createElementNS(ns, name)\n : _document.createElement(name);\n\n for (let [k, v] of _object.entries(props)) {\n const getDesc: PropertyDescriptorSearchFn = (proto: any) =>\n proto\n ? _object.getOwnPropertyDescriptor(proto, k as PropertyKey) ??\n getDesc(protoOf(proto))\n : _undefined;\n\n const cacheKey = `${name},${k}`;\n\n const propSetter =\n propSetterCache[cacheKey] ??\n (propSetterCache[cacheKey] = getDesc(protoOf(dom))?.set ?? 0);\n\n const setter: PropSetterFn | EventSetterFn = k.startsWith(\"on\")\n ? (\n v: EventListenerOrEventListenerObject,\n oldV?: EventListenerOrEventListenerObject\n ) => {\n const event = k.slice(2);\n if (oldV) dom.removeEventListener(event, oldV);\n dom.addEventListener(event, v);\n }\n : propSetter\n ? propSetter.bind(dom)\n : dom.setAttribute.bind(dom, k);\n\n let protoOfV = protoOf(v ?? 0);\n\n k.startsWith(\"on\") ||\n (protoOfV === funcProto &&\n ((v = derive(v as BindingFunc)), (protoOfV = stateProto)));\n\n protoOfV === stateProto\n ? bind(() => (setter((v as any).val, (v as any)._oldVal), dom))\n : setter(v as EventListenerOrEventListenerObject);\n }\n\n return add(dom, ...children);\n};\n\n/**\n * Creates a proxy handler object for intercepting the 'get' property access\n * operation. The handler wraps the access in a function call that binds the\n * accessed property name along with an optional namespace.\n */\nconst proxyHandler = (namespace?: string): ProxyHandler => {\n return {\n get: (_: never, name: string) =>\n tag.bind(_undefined, namespace ?? null, name),\n };\n};\n\n/**\n * Creates a Proxy-based Tags object with optional namespace functionality.\n *\n * @function\n * @param {string} [namespace] - Optional namespace for organizing tags.\n * @returns {Tags & NamespaceFunction} A Proxy object representing tags and namespaces.\n */\nconst tags = new Proxy(\n (namespace?: string) =>\n new Proxy(tag, proxyHandler(namespace)) as NamespaceFunction,\n proxyHandler()\n) as Tags & NamespaceFunction;\n\n/**\n * Updates a DOM element with a new DOM element, replacing the old one or\n * removing it if newDom is null or undefined.\n *\n * @template T\n * @param {T} dom - The current DOM element to update.\n * @param {T} newDom - The new DOM element to replace with.\n * @returns {void}\n */\nconst update = (dom: T, newDom: T): void => {\n newDom\n ? newDom !== dom &&\n (dom as HTMLElement).replaceWith(newDom as string | Node)\n : (dom as HTMLElement).remove();\n};\n\n/**\n * Updates DOM elements based on changed and derived states.\n */\nconst updateDoms = () => {\n let iter = 0,\n derivedStatesArray = changedStates\n ? [...changedStates].filter((s) => s.rawVal !== s._oldVal)\n : [];\n do {\n derivedStates = new Set();\n for (let l of new Set(\n derivedStatesArray.flatMap(\n (s) => (s._listeners = keepConnected(s._listeners))\n )\n ))\n derive(l.f, l.s, l._dom), (l._dom = _undefined);\n } while (++iter < 100 && (derivedStatesArray = [...derivedStates]).length);\n let changedStatesArray = changedStates\n ? [...changedStates].filter((s) => s.rawVal !== s._oldVal)\n : [];\n changedStates = _undefined;\n for (let b of new Set(\n changedStatesArray.flatMap(\n (s) => (s._bindings = keepConnected(s._bindings))\n )\n ))\n b._dom && update(b._dom, bind(b.f, b._dom)), (b._dom = _undefined);\n\n for (let s of changedStatesArray) s._oldVal = s.rawVal;\n};\n\n/**\n * Hydrates a DOM element with a function that updates its content.\n *\n * @template T\n * @param {T} dom - The DOM node to hydrate.\n * @param {(dom: T) => T | null | undefined} updateFn - The function to update the DOM node.\n * @returns {T | void} The updated DOM node or void if update fails.\n */\nconst hydrate = (\n dom: T,\n updateFn: (dom: T) => T | null | undefined\n): T | void => {\n return update(dom, bind(updateFn, dom));\n};\n\nexport default { add, tags, state, derive, hydrate };\n","import { getElement } from \"./queryElement\";\n\n/**\n * Given an element or a selector, tries to find the appropriate container element.\n */\nexport const getContainerElement = (\n elementOrSelector?: string | HTMLElement\n) => {\n if (!elementOrSelector) {\n return document.body;\n }\n\n if (typeof elementOrSelector === \"string\") {\n return getElement(elementOrSelector);\n }\n\n return elementOrSelector;\n};\n","import { Hint } from \"./hint\";\nimport { HintItem } from \"./hintItem\";\n\n/**\n * Hide a hint\n *\n * @api private\n */\nexport async function hideHint(hint: Hint, hintItem: HintItem) {\n const isActiveSignal = hintItem.isActive;\n\n if (isActiveSignal) {\n isActiveSignal.val = false;\n }\n\n hint.hideHintDialog();\n\n // call the callback function (if any)\n hint.callback(\"hintClose\")?.call(hint, hintItem);\n}\n\n/**\n * Hide all hints\n *\n * @api private\n */\nexport async function hideHints(hint: Hint) {\n for (const hintItem of hint.getHints()) {\n await hideHint(hint, hintItem);\n }\n}\n","import { Hint } from \"./hint\";\nimport { HintItem } from \"./hintItem\";\n\n/**\n * Show all hints\n *\n * @api private\n */\nexport async function showHints(hint: Hint) {\n if (hint.isRendered()) {\n for (const hintItem of hint.getHints()) {\n showHint(hintItem);\n }\n } else {\n // or render hints if there are none\n await hint.render();\n }\n}\n\n/**\n * Show a hint\n *\n * @api private\n */\nexport function showHint(hintItem: HintItem) {\n const activeSignal = hintItem.isActive;\n\n if (activeSignal) {\n activeSignal.val = true;\n }\n}\n","export const hintsClassName = \"introjs-hints\";\nexport const hintClassName = \"introjs-hint\";\nexport const arrowClassName = \"introjs-arrow\";\nexport const tooltipClassName = \"introjs-tooltip\";\nexport const hideHintClassName = \"introjs-hidehint\";\nexport const tooltipReferenceLayerClassName = \"introjs-tooltipReferenceLayer\";\nexport const tooltipTextClassName = \"introjs-tooltiptext\";\nexport const hintReferenceClassName = \"introjs-hintReference\";\nexport const hintNoAnimationClassName = \"introjs-hint-no-anim\";\nexport const fixedHintClassName = \"introjs-fixedhint\";\nexport const hintDotClassName = \"introjs-hint-dot\";\nexport const hintPulseClassName = \"introjs-hint-pulse\";\n","/**\n * Get an element CSS property on the page\n * Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml\n *\n * @api private\n * @returns string property value\n */\nexport default function getPropValue(\n element: HTMLElement,\n propName: string\n): string {\n let propValue = \"\";\n if (\"currentStyle\" in element) {\n //IE\n // @ts-ignore\n propValue = element.currentStyle[propName];\n } else if (document.defaultView && document.defaultView.getComputedStyle) {\n //Others\n propValue = document.defaultView\n .getComputedStyle(element, null)\n .getPropertyValue(propName);\n }\n\n //Prevent exception in IE\n if (propValue && propValue.toLowerCase) {\n return propValue.toLowerCase();\n } else {\n return propValue;\n }\n}\n","import getPropValue from \"./getPropValue\";\n\n/**\n * Checks to see if target element (or parents) position is fixed or not\n *\n * @api private\n */\nexport default function isFixed(element: HTMLElement): boolean {\n const parent = element.parentElement;\n\n if (!parent || parent.nodeName === \"HTML\") {\n return false;\n }\n\n if (getPropValue(element, \"position\") === \"fixed\") {\n return true;\n }\n\n return isFixed(parent);\n}\n","import getPropValue from \"./getPropValue\";\nimport isFixed from \"./isFixed\";\n\nexport type Offset = {\n width: number;\n height: number;\n left: number;\n right: number;\n top: number;\n bottom: number;\n absoluteTop: number;\n absoluteLeft: number;\n absoluteRight: number;\n absoluteBottom: number;\n};\n\n/**\n * Get an element position on the page relative to another element (or body) including scroll offset\n * Thanks to `meouw`: http://stackoverflow.com/a/442474/375966\n *\n * @api private\n * @returns Element's position info\n */\nexport default function getOffset(\n element: HTMLElement,\n relativeEl?: HTMLElement\n): Offset {\n const body = document.body;\n const docEl = document.documentElement;\n const scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\n const scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;\n\n relativeEl = relativeEl || body;\n\n const x = element.getBoundingClientRect();\n const xr = relativeEl.getBoundingClientRect();\n const relativeElPosition = getPropValue(relativeEl, \"position\");\n\n let obj: { top: number; left: number } = { top: 0, left: 0 };\n\n if (\n (relativeEl.tagName.toLowerCase() !== \"body\" &&\n relativeElPosition === \"relative\") ||\n relativeElPosition === \"sticky\"\n ) {\n // when the container of our target element is _not_ body and has either \"relative\" or \"sticky\" position, we should not\n // consider the scroll position but we need to include the relative x/y of the container element\n obj = Object.assign(obj, {\n top: x.top - xr.top,\n left: x.left - xr.left,\n });\n } else {\n if (isFixed(element)) {\n obj = Object.assign(obj, {\n top: x.top,\n left: x.left,\n });\n } else {\n obj = Object.assign(obj, {\n top: x.top + scrollTop,\n left: x.left + scrollLeft,\n });\n }\n }\n\n return {\n ...obj,\n ...{\n width: x.width,\n height: x.height,\n bottom: obj.top + x.height,\n right: obj.left + x.width,\n absoluteTop: x.top,\n absoluteLeft: x.left,\n absoluteBottom: x.bottom,\n absoluteRight: x.right,\n },\n };\n}\n","import getOffset from \"../../util/getOffset\";\nimport { HintPosition } from \"./hintItem\";\n\n/**\n * Aligns hint position\n *\n * @api private\n */\nexport const alignHintPosition = (\n position: HintPosition,\n hintElement: HTMLElement,\n targetElement?: HTMLElement\n) => {\n if (typeof targetElement === \"undefined\") {\n return;\n }\n\n // get/calculate offset of target element\n const offset = getOffset(targetElement);\n const iconWidth = 20;\n const iconHeight = 20;\n\n // align the hint element\n switch (position) {\n default:\n case \"top-left\":\n hintElement.style.left = `${offset.left}px`;\n hintElement.style.top = `${offset.top}px`;\n break;\n case \"top-right\":\n hintElement.style.left = `${offset.left + offset.width - iconWidth}px`;\n hintElement.style.top = `${offset.top}px`;\n break;\n case \"bottom-left\":\n hintElement.style.left = `${offset.left}px`;\n hintElement.style.top = `${offset.top + offset.height - iconHeight}px`;\n break;\n case \"bottom-right\":\n hintElement.style.left = `${offset.left + offset.width - iconWidth}px`;\n hintElement.style.top = `${offset.top + offset.height - iconHeight}px`;\n break;\n case \"middle-left\":\n hintElement.style.left = `${offset.left}px`;\n hintElement.style.top = `${\n offset.top + (offset.height - iconHeight) / 2\n }px`;\n break;\n case \"middle-right\":\n hintElement.style.left = `${offset.left + offset.width - iconWidth}px`;\n hintElement.style.top = `${\n offset.top + (offset.height - iconHeight) / 2\n }px`;\n break;\n case \"middle-middle\":\n hintElement.style.left = `${\n offset.left + (offset.width - iconWidth) / 2\n }px`;\n hintElement.style.top = `${\n offset.top + (offset.height - iconHeight) / 2\n }px`;\n break;\n case \"bottom-middle\":\n hintElement.style.left = `${\n offset.left + (offset.width - iconWidth) / 2\n }px`;\n hintElement.style.top = `${offset.top + offset.height - iconHeight}px`;\n break;\n case \"top-middle\":\n hintElement.style.left = `${\n offset.left + (offset.width - iconWidth) / 2\n }px`;\n hintElement.style.top = `${offset.top}px`;\n break;\n }\n};\n","import isFixed from \"../../../util/isFixed\";\nimport dom, { State } from \"../../dom\";\nimport {\n fixedHintClassName,\n hideHintClassName,\n hintClassName,\n hintDotClassName,\n hintNoAnimationClassName,\n hintPulseClassName,\n} from \"../className\";\nimport { HintItem, HintPosition } from \"../hintItem\";\nimport { dataStepAttribute } from \"../dataAttributes\";\nimport { alignHintPosition } from \"../position\";\n\nconst { a, div } = dom.tags;\n\nexport type HintProps = {\n index: number;\n hintItem: HintItem;\n refreshesSignal: State;\n onClick: (e: any) => void;\n};\n\nconst className = (hintItem: HintItem) => {\n const classNames = [hintClassName];\n\n if (!hintItem.hintAnimation) {\n classNames.push(hintNoAnimationClassName);\n }\n\n if (isFixed(hintItem.element as HTMLElement)) {\n classNames.push(fixedHintClassName);\n }\n\n if (!hintItem.isActive?.val) {\n classNames.push(hideHintClassName);\n }\n\n return classNames.join(\" \");\n};\n\nconst HintDot = () => div({ className: hintDotClassName });\nconst HintPulse = () => div({ className: hintPulseClassName });\n\nexport const HintIcon = ({\n index,\n hintItem,\n onClick,\n refreshesSignal,\n}: HintProps) => {\n const hintElement = a(\n {\n [dataStepAttribute]: index.toString(),\n className: () => className(hintItem),\n role: \"button\",\n tabindex: 0,\n onclick: onClick,\n },\n HintDot(),\n HintPulse()\n );\n\n dom.derive(() => {\n if (refreshesSignal.val === undefined) return;\n\n alignHintPosition(\n hintItem.hintPosition as HintPosition,\n hintElement,\n hintItem.element as HTMLElement\n );\n });\n\n return hintElement;\n};\n","/**\n * Append CSS classes to an element\n * @api private\n */\nexport const addClass = (\n element: HTMLElement | SVGElement,\n ...classNames: string[]\n) => {\n for (const className of classNames) {\n if (element instanceof SVGElement) {\n // svg\n const pre = element.getAttribute(\"class\") || \"\";\n\n if (!pre.match(className)) {\n // check if element doesn't already have className\n setClass(element, pre, className);\n }\n } else {\n if (element.classList !== undefined) {\n // check for modern classList property\n element.classList.add(className);\n } else if (!element.className.match(className)) {\n // check if element doesn't already have className\n setClass(element, element.className, className);\n }\n }\n }\n};\n\n/**\n * Set CSS classes to an element\n * @param element element to set class\n * @param classNames list of class names\n */\nexport const setClass = (\n element: HTMLElement | SVGElement,\n ...classNames: string[]\n) => {\n const className = classNames.filter(Boolean).join(\" \");\n\n if (element instanceof SVGElement) {\n element.setAttribute(\"class\", className);\n } else {\n if (element.classList !== undefined) {\n element.classList.value = className;\n } else {\n element.className = className;\n }\n }\n};\n\n/**\n * Remove a class from an element\n *\n * @api private\n */\nexport const removeClass = (\n element: HTMLElement | SVGElement,\n classNameRegex: RegExp | string\n) => {\n if (element instanceof SVGElement) {\n const pre = element.getAttribute(\"class\") || \"\";\n\n element.setAttribute(\n \"class\",\n pre.replace(classNameRegex, \"\").replace(/\\s\\s+/g, \" \").trim()\n );\n } else {\n element.className = element.className\n .replace(classNameRegex, \"\")\n .replace(/\\s\\s+/g, \" \")\n .trim();\n }\n};\n","/**\n * Converts a style object to a css text\n * @param style style object\n * @returns css text\n */\nexport const style = (style: { [key: string]: string | number }): string => {\n let cssText = \"\";\n\n for (const rule in style) {\n cssText += `${rule}:${style[rule]};`;\n }\n\n return cssText;\n};\n\n/**\n * Sets the style of an DOM element\n */\nexport default function setStyle(\n element: HTMLElement,\n styles: string | { [key: string]: string | number }\n) {\n let cssText = \"\";\n\n if (element.style.cssText) {\n cssText += element.style.cssText;\n }\n\n if (typeof styles === \"string\") {\n cssText += styles;\n } else {\n cssText += style(styles);\n }\n\n element.style.cssText = cssText;\n}\n","import getOffset from \"./getOffset\";\nimport isFixed from \"./isFixed\";\nimport { removeClass, addClass } from \"./className\";\nimport setStyle from \"./style\";\n\nexport const getPositionRelativeTo = (\n relativeElement: HTMLElement,\n element: HTMLElement,\n targetElement: HTMLElement,\n padding: number\n) => {\n if (!element || !relativeElement || !targetElement) {\n return;\n }\n\n // If the target element is fixed, the tooltip should be fixed as well.\n // Otherwise, remove a fixed class that may be left over from the previous\n // step.\n if (targetElement instanceof Element && isFixed(targetElement)) {\n addClass(element, \"introjs-fixedTooltip\");\n } else {\n removeClass(element, \"introjs-fixedTooltip\");\n }\n\n const position = getOffset(targetElement, relativeElement);\n\n return {\n width: `${position.width + padding}px`,\n height: `${position.height + padding}px`,\n top: `${position.top - padding / 2}px`,\n left: `${position.left - padding / 2}px`,\n };\n};\n\n/**\n * Sets the position of the element relative to the target element\n * @api private\n */\nexport const setPositionRelativeTo = (\n relativeElement: HTMLElement,\n element: HTMLElement,\n targetElement: HTMLElement,\n padding: number\n) => {\n const styles = getPositionRelativeTo(\n relativeElement,\n element,\n targetElement,\n padding\n );\n\n if (!styles) return;\n\n //set new position to helper layer\n setStyle(element, styles);\n};\n","/**\n * Provides a cross-browser way to get the screen dimensions\n * via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight\n *\n * @api private\n */\nexport default function getWinSize(): { width: number; height: number } {\n if (window.innerWidth !== undefined) {\n return { width: window.innerWidth, height: window.innerHeight };\n } else {\n const D = document.documentElement;\n return { width: D.clientWidth, height: D.clientHeight };\n }\n}\n","export const overlayClassName = \"introjs-overlay\";\nexport const disableInteractionClassName = \"introjs-disableInteraction\";\nexport const bulletsClassName = \"introjs-bullets\";\nexport const progressClassName = \"introjs-progress\";\nexport const progressBarClassName = \"introjs-progressbar\";\nexport const helperLayerClassName = \"introjs-helperLayer\";\nexport const tooltipReferenceLayerClassName = \"introjs-tooltipReferenceLayer\";\nexport const helperNumberLayerClassName = \"introjs-helperNumberLayer\";\nexport const tooltipClassName = \"introjs-tooltip\";\nexport const tooltipHeaderClassName = \"introjs-tooltip-header\";\nexport const tooltipTextClassName = \"introjs-tooltiptext\";\nexport const tooltipTitleClassName = \"introjs-tooltip-title\";\nexport const tooltipButtonsClassName = \"introjs-tooltipbuttons\";\nexport const arrowClassName = \"introjs-arrow\";\nexport const skipButtonClassName = \"introjs-skipbutton\";\nexport const previousButtonClassName = \"introjs-prevbutton\";\nexport const nextButtonClassName = \"introjs-nextbutton\";\nexport const doneButtonClassName = \"introjs-donebutton\";\nexport const dontShowAgainClassName = \"introjs-dontShowAgain\";\nexport const hiddenButtonClassName = \"introjs-hidden\";\nexport const disabledButtonClassName = \"introjs-disabled\";\nexport const fullButtonClassName = \"introjs-fullbutton\";\nexport const activeClassName = \"active\";\nexport const fixedTooltipClassName = \"introjs-fixedTooltip\";\nexport const floatingElementClassName = \"introjsFloatingElement\";\nexport const showElementClassName = \"introjs-showElement\";\n","/**\n * Remove an entry from a string array if it's there, does nothing if it isn't there.\n */\nexport default function removeEntry(stringArray: K[], stringToRemove: K) {\n if (stringArray.includes(stringToRemove)) {\n stringArray.splice(stringArray.indexOf(stringToRemove), 1);\n }\n}\n","import removeEntry from \"../../util/removeEntry\";\nimport { Offset } from \"../../util/getOffset\";\n\nexport type TooltipPosition =\n | \"floating\"\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-right-aligned\"\n | \"top-left-aligned\"\n | \"top-middle-aligned\"\n | \"bottom-right-aligned\"\n | \"bottom-left-aligned\"\n | \"bottom-middle-aligned\";\n\n/**\n * auto-determine alignment\n */\nfunction determineAutoAlignment(\n offsetLeft: number,\n tooltipWidth: number,\n windowWidth: number,\n desiredAlignment: TooltipPosition[]\n): TooltipPosition | null {\n const halfTooltipWidth = tooltipWidth / 2;\n const winWidth = Math.min(windowWidth, window.screen.width);\n\n // valid left must be at least a tooltipWidth\n // away from right side\n if (winWidth - offsetLeft < tooltipWidth) {\n removeEntry(desiredAlignment, \"top-left-aligned\");\n removeEntry(desiredAlignment, \"bottom-left-aligned\");\n }\n\n // valid middle must be at least half\n // width away from both sides\n if (\n offsetLeft < halfTooltipWidth ||\n winWidth - offsetLeft < halfTooltipWidth\n ) {\n removeEntry(desiredAlignment, \"top-middle-aligned\");\n removeEntry(desiredAlignment, \"bottom-middle-aligned\");\n }\n\n // valid right must be at least a tooltipWidth\n // width away from left side\n if (offsetLeft < tooltipWidth) {\n removeEntry(desiredAlignment, \"top-right-aligned\");\n removeEntry(desiredAlignment, \"bottom-right-aligned\");\n }\n\n if (desiredAlignment.length) {\n return desiredAlignment[0];\n }\n\n return null;\n}\n\n/**\n * Determines the position of the tooltip based on the position precedence and availability\n * of screen space.\n */\nexport function determineAutoPosition(\n positionPrecedence: TooltipPosition[],\n targetOffset: Offset,\n tooltipWidth: number,\n tooltipHeight: number,\n desiredTooltipPosition: TooltipPosition,\n windowSize: { width: number; height: number }\n): TooltipPosition {\n // Take a clone of position precedence. These will be the available\n const possiblePositions = positionPrecedence.slice();\n\n // Add some padding to the tooltip height and width for better positioning\n tooltipHeight = tooltipHeight + 10;\n tooltipWidth = tooltipWidth + 20;\n\n // If we check all the possible areas, and there are no valid places for the tooltip, the element\n // must take up most of the screen real estate. Show the tooltip floating in the middle of the screen.\n let calculatedPosition: TooltipPosition = \"floating\";\n\n /*\n * auto determine position\n */\n\n // Check for space below\n if (targetOffset.absoluteBottom + tooltipHeight > windowSize.height) {\n removeEntry(possiblePositions, \"bottom\");\n }\n\n // Check for space above\n if (targetOffset.absoluteTop - tooltipHeight < 0) {\n removeEntry(possiblePositions, \"top\");\n }\n\n // Check for space to the right\n if (targetOffset.absoluteRight + tooltipWidth > windowSize.width) {\n removeEntry(possiblePositions, \"right\");\n }\n\n // Check for space to the left\n if (targetOffset.absoluteLeft - tooltipWidth < 0) {\n removeEntry(possiblePositions, \"left\");\n }\n\n // strip alignment from position\n if (desiredTooltipPosition) {\n // ex: \"bottom-right-aligned\"\n // should return 'bottom'\n desiredTooltipPosition = desiredTooltipPosition.split(\n \"-\"\n )[0] as TooltipPosition;\n }\n\n if (possiblePositions.length) {\n // Pick the first valid position, in order\n calculatedPosition = possiblePositions[0];\n\n if (possiblePositions.includes(desiredTooltipPosition)) {\n // If the requested position is in the list, choose that\n calculatedPosition = desiredTooltipPosition;\n }\n }\n\n // only \"top\" and \"bottom\" positions have optional alignments\n if (calculatedPosition === \"top\" || calculatedPosition === \"bottom\") {\n let defaultAlignment: TooltipPosition;\n let desiredAlignment: TooltipPosition[] = [];\n\n if (calculatedPosition === \"top\") {\n // if screen width is too small\n // for ANY alignment, middle is\n // probably the best for visibility\n defaultAlignment = \"top-middle-aligned\";\n\n desiredAlignment = [\n \"top-left-aligned\",\n \"top-middle-aligned\",\n \"top-right-aligned\",\n ];\n } else {\n defaultAlignment = \"bottom-middle-aligned\";\n\n desiredAlignment = [\n \"bottom-left-aligned\",\n \"bottom-middle-aligned\",\n \"bottom-right-aligned\",\n ];\n }\n\n calculatedPosition =\n determineAutoAlignment(\n targetOffset.absoluteLeft,\n tooltipWidth,\n windowSize.width,\n desiredAlignment\n ) || defaultAlignment;\n }\n\n return calculatedPosition;\n}\n","import getOffset, { Offset } from \"../../util/getOffset\";\nimport getWindowSize from \"../../util/getWindowSize\";\nimport dom, { ChildDom, State } from \"../dom\";\nimport { arrowClassName, tooltipClassName } from \"../tour/classNames\";\nimport { determineAutoPosition, TooltipPosition } from \"./tooltipPosition\";\n\nconst { div } = dom.tags;\n\nexport const TooltipArrow = (props: {\n tooltipPosition: State;\n tooltipBottomOverflow: State;\n}) => {\n const classNames = dom.derive(() => {\n const classNames = [arrowClassName];\n\n switch (props.tooltipPosition.val) {\n case \"top-right-aligned\":\n classNames.push(\"bottom-right\");\n break;\n\n case \"top-middle-aligned\":\n classNames.push(\"bottom-middle\");\n break;\n\n case \"top-left-aligned\":\n // top-left-aligned is the same as the default top\n case \"top\":\n classNames.push(\"bottom\");\n break;\n case \"right\":\n if (props.tooltipBottomOverflow.val) {\n // In this case, right would have fallen below the bottom of the screen.\n // Modify so that the bottom of the tooltip connects with the target\n classNames.push(\"left-bottom\");\n } else {\n classNames.push(\"left\");\n }\n break;\n case \"left\":\n if (props.tooltipBottomOverflow.val) {\n // In this case, left would have fallen below the bottom of the screen.\n // Modify so that the bottom of the tooltip connects with the target\n classNames.push(\"right-bottom\");\n } else {\n classNames.push(\"right\");\n }\n\n break;\n case \"floating\":\n // no arrow element for floating tooltips\n break;\n case \"bottom-right-aligned\":\n classNames.push(\"top-right\");\n break;\n\n case \"bottom-middle-aligned\":\n classNames.push(\"top-middle\");\n break;\n\n // case 'bottom-left-aligned':\n // Bottom-left-aligned is the same as the default bottom\n // case 'bottom':\n // Bottom going to follow the default behavior\n default:\n classNames.push(\"top\");\n }\n\n return classNames;\n });\n\n return div({\n className: () => classNames.val?.filter(Boolean).join(\" \"),\n style: () =>\n `display: ${\n props.tooltipPosition.val === \"floating\" ? \"none\" : \"block\"\n };`,\n });\n};\n\n/**\n * Set tooltip right so it doesn't go off the left side of the window\n *\n * @return boolean true, if tooltipLayerStyleRight is ok. false, otherwise.\n */\nfunction checkLeft(\n targetOffset: {\n top: number;\n left: number;\n width: number;\n height: number;\n },\n tooltipLayerStyleRight: number,\n tooltipWidth: number,\n tooltipLeft: State,\n tooltipRight: State\n): boolean {\n if (\n targetOffset.left +\n targetOffset.width -\n tooltipLayerStyleRight -\n tooltipWidth <\n 0\n ) {\n // off the left side of the window\n tooltipLeft.val = `-${targetOffset.left}px`;\n return false;\n }\n tooltipRight.val = `${tooltipLayerStyleRight}px`;\n return true;\n}\n\n/**\n * Set tooltip left so it doesn't go off the right side of the window\n *\n * @return boolean true, if tooltipLayerStyleLeft is ok. false, otherwise.\n */\nfunction checkRight(\n targetOffset: {\n top: number;\n left: number;\n width: number;\n height: number;\n },\n windowSize: {\n width: number;\n height: number;\n },\n tooltipLayerStyleLeft: number,\n tooltipWidth: number,\n tooltipLeft: State\n): boolean {\n if (\n targetOffset.left + tooltipLayerStyleLeft + tooltipWidth >\n windowSize.width\n ) {\n // off the right side of the window\n tooltipLeft.val = `${\n windowSize.width - tooltipWidth - targetOffset.left\n }px`;\n return false;\n }\n\n tooltipLeft.val = `${tooltipLayerStyleLeft}px`;\n return true;\n}\n\nconst alignTooltip = (\n position: TooltipPosition,\n targetOffset: { width: number; height: number; left: number; top: number },\n windowSize: { width: number; height: number },\n tooltipWidth: number,\n tooltipHeight: number,\n tooltipTop: State,\n tooltipBottom: State,\n tooltipLeft: State,\n tooltipRight: State,\n tooltipMarginLeft: State,\n tooltipMarginTop: State,\n tooltipBottomOverflow: State,\n showStepNumbers: boolean,\n hintMode: boolean\n) => {\n tooltipTop.val = \"auto\";\n tooltipBottom.val = \"auto\";\n tooltipLeft.val = \"auto\";\n tooltipRight.val = \"auto\";\n tooltipMarginLeft.val = \"0\";\n tooltipMarginTop.val = \"0\";\n\n let tooltipLayerStyleLeftRight = targetOffset.width / 2 - tooltipWidth / 2;\n\n switch (position) {\n case \"top-right-aligned\":\n let tooltipLayerStyleRight = 0;\n checkLeft(\n targetOffset,\n tooltipLayerStyleRight,\n tooltipWidth,\n tooltipLeft,\n tooltipRight\n );\n tooltipBottom.val = `${targetOffset.height + 20}px`;\n break;\n\n case \"top-middle-aligned\":\n // a fix for middle aligned hints\n if (hintMode) {\n tooltipLayerStyleLeftRight += 5;\n }\n\n if (\n checkLeft(\n targetOffset,\n tooltipLayerStyleLeftRight,\n tooltipWidth,\n tooltipLeft,\n tooltipRight\n )\n ) {\n tooltipRight.val = undefined;\n checkRight(\n targetOffset,\n windowSize,\n tooltipLayerStyleLeftRight,\n tooltipWidth,\n tooltipLeft\n );\n }\n tooltipBottom.val = `${targetOffset.height + 20}px`;\n break;\n\n case \"top-left-aligned\":\n // top-left-aligned is the same as the default top\n case \"top\":\n const tooltipLayerStyleLeft = hintMode ? 0 : 15;\n\n checkRight(\n targetOffset,\n windowSize,\n tooltipLayerStyleLeft,\n tooltipWidth,\n tooltipLeft\n );\n tooltipBottom.val = `${targetOffset.height + 20}px`;\n break;\n case \"right\":\n tooltipLeft.val = `${targetOffset.width + 20}px`;\n\n if (tooltipBottomOverflow.val) {\n // In this case, right would have fallen below the bottom of the screen.\n // Modify so that the bottom of the tooltip connects with the target\n tooltipTop.val = `-${tooltipHeight - targetOffset.height - 20}px`;\n }\n break;\n case \"left\":\n if (!hintMode && showStepNumbers === true) {\n tooltipTop.val = \"15px\";\n }\n\n if (tooltipBottomOverflow.val) {\n // In this case, left would have fallen below the bottom of the screen.\n // Modify so that the bottom of the tooltip connects with the target\n tooltipTop.val = `-${tooltipHeight - targetOffset.height - 20}px`;\n }\n tooltipRight.val = `${targetOffset.width + 20}px`;\n\n break;\n case \"floating\":\n //we have to adjust the top and left of layer manually for intro items without element\n tooltipLeft.val = \"50%\";\n tooltipTop.val = \"50%\";\n tooltipMarginLeft.val = `-${tooltipWidth / 2}px`;\n tooltipMarginTop.val = `-${tooltipHeight / 2}px`;\n\n break;\n case \"bottom-right-aligned\":\n tooltipLayerStyleRight = 0;\n checkLeft(\n targetOffset,\n tooltipLayerStyleRight,\n tooltipWidth,\n tooltipLeft,\n tooltipRight\n );\n tooltipTop.val = `${targetOffset.height + 20}px`;\n break;\n\n case \"bottom-middle-aligned\":\n // a fix for middle aligned hints\n if (hintMode) {\n tooltipLayerStyleLeftRight += 5;\n }\n\n if (\n checkLeft(\n targetOffset,\n tooltipLayerStyleLeftRight,\n tooltipWidth,\n tooltipLeft,\n tooltipRight\n )\n ) {\n tooltipRight.val = \"\";\n checkRight(\n targetOffset,\n windowSize,\n tooltipLayerStyleLeftRight,\n tooltipWidth,\n tooltipLeft\n );\n }\n tooltipTop.val = `${targetOffset.height + 20}px`;\n break;\n\n // case 'bottom-left-aligned':\n // Bottom-left-aligned is the same as the default bottom\n // case 'bottom':\n // Bottom going to follow the default behavior\n default:\n checkRight(targetOffset, windowSize, 0, tooltipWidth, tooltipLeft);\n tooltipTop.val = `${targetOffset.height + 20}px`;\n }\n};\n\nexport type TooltipProps = {\n position: TooltipPosition;\n element: HTMLElement;\n refreshes: State;\n hintMode: boolean;\n showStepNumbers: boolean;\n\n transitionDuration?: number;\n\n // auto-alignment properties\n autoPosition: boolean;\n positionPrecedence: TooltipPosition[];\n\n onClick?: (e: any) => void;\n};\n\nexport const Tooltip = (\n {\n position: initialPosition,\n element,\n refreshes,\n hintMode = false,\n showStepNumbers = false,\n\n transitionDuration = 0,\n\n // auto-alignment properties\n autoPosition = true,\n positionPrecedence = [],\n\n onClick,\n }: TooltipProps,\n children?: ChildDom[]\n) => {\n const top = dom.state(\"auto\");\n const right = dom.state(\"auto\");\n const bottom = dom.state(\"auto\");\n const left = dom.state(\"auto\");\n const marginLeft = dom.state(\"0\");\n const marginTop = dom.state(\"0\");\n const opacity = dom.state(0);\n // setting a default height for the tooltip instead of 0 to avoid flickering\n // this default is coming from the CSS class and is overridden after the tooltip is rendered\n const tooltipHeight = dom.state(250);\n // max width of the tooltip according to its CSS class\n // this default is coming from the CSS class and is overridden after the tooltip is rendered\n const tooltipWidth = dom.state(300);\n const position = dom.state(initialPosition);\n // windowSize can change if the window is resized\n const windowSize = dom.state(getWindowSize());\n const targetOffset = dom.state(getOffset(element));\n const tooltipBottomOverflow = dom.derive(\n () => targetOffset.val!.top + tooltipHeight.val! > windowSize.val!.height\n );\n\n dom.derive(() => {\n // set the new windowSize and targetOffset if the refreshes signal changes\n if (refreshes.val !== undefined) {\n windowSize.val = getWindowSize();\n targetOffset.val = getOffset(element);\n }\n });\n\n // auto-align tooltip based on position precedence and target offset\n dom.derive(() => {\n if (\n position.val !== undefined &&\n initialPosition !== \"floating\" &&\n autoPosition &&\n tooltipWidth.val &&\n tooltipHeight.val &&\n targetOffset.val &&\n windowSize.val\n ) {\n position.val = determineAutoPosition(\n positionPrecedence,\n targetOffset.val,\n tooltipWidth.val,\n tooltipHeight.val,\n initialPosition,\n windowSize.val\n );\n }\n });\n\n // align tooltip based on position and target offset\n dom.derive(() => {\n if (\n tooltipWidth.val !== undefined &&\n tooltipHeight.val !== undefined &&\n tooltipBottomOverflow.val !== undefined &&\n position.val !== undefined &&\n targetOffset.val !== undefined &&\n windowSize.val !== undefined\n ) {\n alignTooltip(\n position.val,\n targetOffset.val,\n windowSize.val,\n tooltipWidth.val,\n tooltipHeight.val,\n top,\n bottom,\n left,\n right,\n marginLeft,\n marginTop,\n tooltipBottomOverflow,\n showStepNumbers,\n hintMode\n );\n }\n });\n\n const tooltip = div(\n {\n style: () =>\n `top: ${top.val}; right: ${right.val}; bottom: ${bottom.val}; left: ${left.val}; margin-left: ${marginLeft.val}; margin-top: ${marginTop.val};opacity: ${opacity.val}`,\n className: () => `${tooltipClassName} introjs-${position.val}`,\n role: \"dialog\",\n onclick: onClick ?? null,\n },\n [\n TooltipArrow({\n tooltipPosition: position,\n tooltipBottomOverflow: tooltipBottomOverflow,\n }),\n [children],\n ]\n );\n\n // apply the transition effect\n setTimeout(() => {\n opacity.val = 1;\n }, transitionDuration);\n\n setTimeout(() => {\n // set the correct height and width of the tooltip after it has been rendered\n tooltipHeight.val = tooltip.offsetHeight;\n tooltipWidth.val = tooltip.offsetWidth;\n }, 1);\n\n return tooltip;\n};\n","import { Tooltip, TooltipProps } from \"../../tooltip/tooltip\";\nimport dom from \"../../dom\";\nimport { tooltipTextClassName } from \"../className\";\nimport { HintItem } from \"../hintItem\";\n\nconst { a, p, div } = dom.tags;\n\nexport type HintTooltipProps = Omit<\n TooltipProps,\n \"hintMode\" | \"element\" | \"position\"\n> & {\n hintItem: HintItem;\n closeButtonEnabled: boolean;\n closeButtonOnClick: (hintItem: HintItem) => void;\n closeButtonLabel: string;\n closeButtonClassName: string;\n};\n\nexport const HintTooltip = ({\n hintItem,\n closeButtonEnabled,\n closeButtonOnClick,\n closeButtonLabel,\n closeButtonClassName,\n ...props\n}: HintTooltipProps) => {\n return Tooltip(\n {\n ...props,\n element: hintItem.hintTooltipElement as HTMLElement,\n position: hintItem.position,\n hintMode: true,\n onClick: (e: Event) => {\n //IE9 & Other Browsers\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n //IE8 and Lower\n else {\n e.cancelBubble = true;\n }\n },\n },\n [\n div(\n { className: tooltipTextClassName },\n p(hintItem.hint || \"\"),\n closeButtonEnabled\n ? a(\n {\n className: closeButtonClassName,\n role: \"button\",\n onclick: () => closeButtonOnClick(hintItem),\n },\n closeButtonLabel\n )\n : null\n ),\n ]\n );\n};\n","import { setPositionRelativeTo } from \"../../../util/positionRelativeTo\";\nimport dom, { State } from \"../../dom\";\nimport {\n hintReferenceClassName,\n tooltipReferenceLayerClassName,\n} from \"../className\";\nimport { dataStepAttribute } from \"../dataAttributes\";\nimport { HintTooltip, HintTooltipProps } from \"./HintTooltip\";\n\nconst { div } = dom.tags;\n\nexport type ReferenceLayerProps = HintTooltipProps & {\n activeHintSignal: State;\n targetElement: HTMLElement;\n helperElementPadding: number;\n};\n\nexport const ReferenceLayer = ({\n activeHintSignal,\n targetElement,\n helperElementPadding,\n ...props\n}: ReferenceLayerProps) => {\n const initialActiveHintSignal = activeHintSignal.val;\n\n return () => {\n // remove the reference layer if the active hint signal is set to undefined\n // e.g. when the user clicks outside the hint\n if (activeHintSignal.val == undefined) return null;\n\n // remove the reference layer if the active hint signal changes\n // and the initial active hint signal is not same as the current active hint signal (e.g. when the user clicks on another hint)\n if (initialActiveHintSignal !== activeHintSignal.val) return null;\n\n const referenceLayer = div(\n {\n [dataStepAttribute]: activeHintSignal.val,\n className: `${tooltipReferenceLayerClassName} ${hintReferenceClassName}`,\n },\n HintTooltip(props)\n );\n\n setTimeout(() => {\n setPositionRelativeTo(\n targetElement,\n referenceLayer,\n props.hintItem.hintTooltipElement as HTMLElement,\n helperElementPadding\n );\n }, 1);\n\n return referenceLayer;\n };\n};\n","import dom from \"../../dom\";\nimport { hintsClassName } from \"../className\";\nimport { hideHint } from \"../hide\";\nimport { Hint } from \"../hint\";\nimport { HintItem } from \"../hintItem\";\nimport { HintIcon } from \"./HintIcon\";\nimport { ReferenceLayer } from \"./ReferenceLayer\";\n\nconst { div } = dom.tags;\n\nexport type HintsRootProps = {\n hint: Hint;\n};\n\n/**\n * Returns an event handler unique to the hint iteration\n */\nconst getHintClick = (hint: Hint, i: number) => (e: Event) => {\n const evt = e ? e : window.event;\n\n if (evt && evt.stopPropagation) {\n evt.stopPropagation();\n }\n\n if (evt && evt.cancelBubble !== null) {\n evt.cancelBubble = true;\n }\n\n hint.showHintDialog(i);\n};\n\nexport const HintsRoot = ({ hint }: HintsRootProps) => {\n const hintElements = [];\n\n for (const [i, hintItem] of hint.getHints().entries()) {\n const hintTooltipElement = HintIcon({\n index: i,\n hintItem,\n onClick: getHintClick(hint, i),\n refreshesSignal: hint.getRefreshesSignal(),\n });\n\n // store the hint tooltip element in the hint item\n // because we need to position the reference layer relative to the HintIcon\n hintItem.hintTooltipElement = hintTooltipElement;\n\n hintElements.push(hintTooltipElement);\n }\n\n const root = div(\n {\n className: hintsClassName,\n },\n ...hintElements\n );\n\n dom.derive(() => {\n const activeHintSignal = hint.getActiveHintSignal();\n if (activeHintSignal.val === undefined) return;\n\n const stepId = activeHintSignal.val;\n const hints = hint.getHints();\n const hintItem = hints[stepId];\n\n if (!hintItem) return;\n\n const referenceLayer = ReferenceLayer({\n activeHintSignal,\n hintItem,\n\n helperElementPadding: hint.getOption(\"helperElementPadding\"),\n targetElement: hint.getTargetElement(),\n\n refreshes: hint.getRefreshesSignal(),\n\n // hints don't have step numbers\n showStepNumbers: false,\n\n autoPosition: hint.getOption(\"autoPosition\"),\n positionPrecedence: hint.getOption(\"positionPrecedence\"),\n\n closeButtonEnabled: hint.getOption(\"hintShowButton\"),\n closeButtonLabel: hint.getOption(\"hintButtonLabel\"),\n closeButtonClassName: hint.getOption(\"buttonClass\"),\n closeButtonOnClick: (hintItem: HintItem) => hideHint(hint, hintItem),\n });\n\n dom.add(root, referenceLayer);\n });\n\n return root;\n};\n","import { Package } from \"../package\";\nimport { getDefaultHintOptions, HintOptions } from \"./option\";\nimport { fetchHintItems, HintItem } from \"./hintItem\";\nimport { setOption, setOptions } from \"../../option\";\nimport isFunction from \"../../util/isFunction\";\nimport debounce from \"../../util/debounce\";\nimport DOMEvent from \"../../util/DOMEvent\";\nimport { getContainerElement } from \"../../util/containerElement\";\nimport { hideHint, hideHints } from \"./hide\";\nimport { showHint, showHints } from \"./show\";\nimport dom from \"../dom\";\nimport { HintsRoot } from \"./components/HintsRoot\";\n\ntype hintsAddedCallback = (this: Hint) => void | Promise;\ntype hintClickCallback = (this: Hint, item: HintItem) => void | Promise;\ntype hintCloseCallback = (this: Hint, item: HintItem) => void | Promise;\n\nexport class Hint implements Package {\n private _root: HTMLElement | undefined;\n private _hints: HintItem[] = [];\n private readonly _targetElement: HTMLElement;\n private _options: HintOptions;\n private _activeHintSignal = dom.state(undefined);\n private _refreshesSignal = dom.state(0);\n\n private readonly callbacks: {\n hintsAdded?: hintsAddedCallback;\n hintClick?: hintClickCallback;\n hintClose?: hintCloseCallback;\n } = {};\n\n // Event handlers\n private _hintsAutoRefreshFunction?: () => void;\n // The hint close function used when the user clicks outside the hint\n private _windowClickFunction?: () => void;\n\n /**\n * Create a new Hint instance\n * @param elementOrSelector Optional target element or CSS query to start the Hint on\n * @param options Optional Hint options\n */\n public constructor(\n elementOrSelector?: string | HTMLElement,\n options?: Partial\n ) {\n this._targetElement = getContainerElement(elementOrSelector);\n this._options = options\n ? setOptions(this._options, options)\n : getDefaultHintOptions();\n }\n\n /**\n * Get the callback function for the provided callback name\n * @param callbackName The name of the callback\n */\n callback(\n callbackName: K\n ): (typeof this.callbacks)[K] | undefined {\n const callback = this.callbacks[callbackName];\n if (isFunction(callback)) {\n return callback;\n }\n return undefined;\n }\n\n /**\n * Get the target element for the Hint\n */\n getTargetElement(): HTMLElement {\n return this._targetElement;\n }\n\n /**\n * Get the Hint items\n */\n getHints(): HintItem[] {\n return this._hints;\n }\n\n /**\n * Get the Hint item for the provided step ID\n * @param stepId The step ID\n */\n getHint(stepId: number): HintItem | undefined {\n return this._hints[stepId];\n }\n\n /**\n * Set the Hint items\n * @param hints The Hint items\n */\n setHints(hints: HintItem[]): this {\n this._hints = hints;\n return this;\n }\n\n /**\n * Add a Hint item\n * @param hint The Hint item\n */\n addHint(hint: HintItem): this {\n // always set isActive to true\n hint.isActive = dom.state(true);\n this._hints.push(hint);\n return this;\n }\n\n /**\n * Get the active hint signal\n * This is meant to be used internally by the Hint package\n */\n getActiveHintSignal() {\n return this._activeHintSignal;\n }\n\n /**\n * Returns the underlying state of the refreshes\n * This is an internal method and should not be used outside of the package.\n */\n getRefreshesSignal() {\n return this._refreshesSignal;\n }\n\n /**\n * Returns true if the hints are rendered\n */\n isRendered() {\n return this._root !== undefined;\n }\n\n private createRoot() {\n this._root = HintsRoot({ hint: this });\n dom.add(this._targetElement, this._root);\n }\n\n private recreateRoot() {\n if (this._root) {\n this._root.remove();\n this.createRoot();\n }\n }\n\n /**\n * Render hints on the page\n */\n async render(): Promise {\n if (!this.isActive()) {\n return this;\n }\n\n if (this.isRendered()) {\n return this;\n }\n\n fetchHintItems(this);\n this.createRoot();\n\n this.callback(\"hintsAdded\")?.call(this);\n\n this.enableHintAutoRefresh();\n this.enableCloseDialogOnWindowClick();\n\n return this;\n }\n\n /**\n * Enable closing the dialog when the user clicks outside the hint\n */\n enableCloseDialogOnWindowClick() {\n this._windowClickFunction = () => {\n this._activeHintSignal.val = undefined;\n };\n\n DOMEvent.on(document, \"click\", this._windowClickFunction, false);\n }\n\n /**\n * Disable closing the dialog when the user clicks outside the hint\n */\n disableCloseDialogOnWindowClick() {\n if (this._windowClickFunction) {\n DOMEvent.off(document, \"click\", this._windowClickFunction, false);\n }\n }\n\n /**\n * @deprecated renderHints() is deprecated, please use render() instead\n */\n async addHints() {\n return this.render();\n }\n\n /**\n * Hide a specific hint on the page\n * @param stepId The hint step ID\n */\n async hideHint(stepId: number) {\n const hintItem = this.getHint(stepId);\n\n if (hintItem) {\n await hideHint(this, hintItem);\n }\n\n return this;\n }\n\n /**\n * Hide all hints on the page\n */\n async hideHints() {\n await hideHints(this);\n return this;\n }\n\n /**\n * Show a specific hint on the page\n * @param stepId The hint step ID\n */\n showHint(stepId: number) {\n const hintItem = this.getHint(stepId);\n\n if (hintItem) {\n showHint(hintItem);\n }\n\n return this;\n }\n\n /**\n * Show all hints on the page\n */\n async showHints() {\n await showHints(this);\n return this;\n }\n\n /**\n * Destroys and removes all hint elements on the page\n * Useful when you want to destroy the elements and add them again (e.g. a modal or popup)\n */\n destroy() {\n if (this._root) {\n this._root.remove();\n this._root = undefined;\n }\n\n this.disableHintAutoRefresh();\n this.disableCloseDialogOnWindowClick();\n\n return this;\n }\n\n /**\n * @deprecated removeHints() is deprecated, please use destroy() instead\n */\n removeHints() {\n this.destroy();\n return this;\n }\n\n /**\n * Remove one single hint element from the page\n * Useful when you want to destroy the element and add them again (e.g. a modal or popup)\n * Use removeHints if you want to remove all elements.\n *\n * @param stepId The hint step ID\n */\n removeHint(stepId: number) {\n this._hints = this._hints.filter((_, i) => i !== stepId);\n this.recreateRoot();\n\n return this;\n }\n\n /**\n * Show hint dialog for a specific hint\n * @param stepId The hint step ID\n */\n async showHintDialog(stepId: number) {\n const item = this.getHint(stepId);\n\n if (!item) return;\n\n if (this._activeHintSignal.val !== stepId) {\n this._activeHintSignal.val = stepId;\n\n // call the callback function (if any)\n await this.callback(\"hintClick\")?.call(this, item);\n } else {\n // to toggle the hint dialog if the same hint is clicked again\n this._activeHintSignal.val = undefined;\n }\n\n return this;\n }\n\n /**\n * Hide hint dialog from the page\n */\n hideHintDialog() {\n this._activeHintSignal.val = undefined;\n return this;\n }\n\n /**\n * Refresh the hints on the page\n */\n public refresh() {\n if (!this.isRendered()) {\n return this;\n }\n\n if (this._refreshesSignal.val !== undefined) {\n this._refreshesSignal.val += 1;\n }\n\n return this;\n }\n\n /**\n * Enable hint auto refresh on page scroll and resize for hints\n */\n enableHintAutoRefresh(): this {\n const hintAutoRefreshInterval = this.getOption(\"hintAutoRefreshInterval\");\n if (hintAutoRefreshInterval >= 0) {\n this._hintsAutoRefreshFunction = debounce(\n () => this.refresh(),\n hintAutoRefreshInterval\n );\n\n DOMEvent.on(window, \"scroll\", this._hintsAutoRefreshFunction, true);\n DOMEvent.on(window, \"resize\", this._hintsAutoRefreshFunction, true);\n }\n\n return this;\n }\n\n /**\n * Disable hint auto refresh on page scroll and resize for hints\n */\n disableHintAutoRefresh(): this {\n if (this._hintsAutoRefreshFunction) {\n DOMEvent.off(window, \"scroll\", this._hintsAutoRefreshFunction, true);\n DOMEvent.on(window, \"resize\", this._hintsAutoRefreshFunction, true);\n\n this._hintsAutoRefreshFunction = undefined;\n }\n\n return this;\n }\n\n /**\n * Get specific Hint option\n * @param key The option key\n */\n getOption(key: K): HintOptions[K] {\n return this._options[key];\n }\n\n /**\n * Set Hint options\n * @param partialOptions Hint options\n */\n setOptions(partialOptions: Partial): this {\n this._options = setOptions(this._options, partialOptions);\n return this;\n }\n\n /**\n * Set specific Hint option\n * @param key Option key\n * @param value Option value\n */\n setOption(key: K, value: HintOptions[K]): this {\n this._options = setOption(this._options, key, value);\n return this;\n }\n\n /**\n * Clone the Hint instance\n */\n clone(): ThisType {\n return new Hint(this._targetElement, this._options);\n }\n\n /**\n * Returns true if the Hint is active\n */\n isActive(): boolean {\n return this.getOption(\"isActive\");\n }\n\n onHintsAdded(providedCallback: hintsAddedCallback) {\n if (!isFunction(providedCallback)) {\n throw new Error(\"Provided callback for onhintsadded was not a function.\");\n }\n\n this.callbacks.hintsAdded = providedCallback;\n return this;\n }\n\n /**\n * @deprecated onhintsadded is deprecated, please use onHintsAdded instead\n * @param providedCallback callback function\n */\n onhintsadded(providedCallback: hintsAddedCallback) {\n this.onHintsAdded(providedCallback);\n }\n\n /**\n * Callback for when hint items are clicked\n * @param providedCallback callback function\n */\n onHintClick(providedCallback: hintClickCallback) {\n if (!isFunction(providedCallback)) {\n throw new Error(\"Provided callback for onhintclick was not a function.\");\n }\n\n this.callbacks.hintClick = providedCallback;\n return this;\n }\n\n /**\n * @deprecated onhintclick is deprecated, please use onHintClick instead\n * @param providedCallback\n */\n onhintclick(providedCallback: hintClickCallback) {\n this.onHintClick(providedCallback);\n }\n\n /**\n * Callback for when hint items are closed\n * @param providedCallback callback function\n */\n onHintClose(providedCallback: hintCloseCallback) {\n if (isFunction(providedCallback)) {\n this.callbacks.hintClose = providedCallback;\n } else {\n throw new Error(\"Provided callback for onhintclose was not a function.\");\n }\n return this;\n }\n\n /**\n * @deprecated onhintclose is deprecated, please use onHintClose instead\n * @param providedCallback\n */\n onhintclose(providedCallback: hintCloseCallback) {\n this.onHintClose(providedCallback);\n }\n}\n","import { TooltipPosition } from \"../../packages/tooltip\";\nimport { HintItem, HintPosition } from \"./hintItem\";\n\nexport interface HintOptions {\n /* List of all HintItems */\n hints: Partial[];\n /* True if the Hint instance is set to active */\n isActive: boolean;\n /* Default tooltip box position */\n tooltipPosition: string;\n /* Next CSS class for tooltip boxes */\n tooltipClass: string;\n /* Default hint position */\n hintPosition: HintPosition;\n /* Hint button label */\n hintButtonLabel: string;\n /* Display the \"Got it\" button? */\n hintShowButton: boolean;\n /* Hints auto-refresh interval in ms (set to -1 to disable) */\n hintAutoRefreshInterval: number;\n /* Adding animation to hints? */\n hintAnimation: boolean;\n /* additional classes to put on the buttons */\n buttonClass: string;\n /* Set how much padding to be used around helper element */\n helperElementPadding: number;\n /* To determine the tooltip position automatically based on the window.width/height */\n autoPosition: boolean;\n /* Precedence of positions, when auto is enabled */\n positionPrecedence: TooltipPosition[];\n}\n\nexport function getDefaultHintOptions(): HintOptions {\n return {\n hints: [],\n isActive: true,\n tooltipPosition: \"bottom\",\n tooltipClass: \"\",\n hintPosition: \"top-middle\",\n hintButtonLabel: \"Got it\",\n hintShowButton: true,\n hintAutoRefreshInterval: 10,\n hintAnimation: true,\n buttonClass: \"introjs-button\",\n helperElementPadding: 10,\n autoPosition: true,\n positionPrecedence: [\"bottom\", \"top\", \"right\", \"left\"],\n };\n}\n","export default function debounce(\n func: Function,\n timeout: number\n): (...args: any) => void {\n let timer: number;\n\n return (...args) => {\n window.clearTimeout(timer);\n\n timer = window.setTimeout(() => {\n func(args);\n }, timeout);\n };\n}\n","export const dataStepNumberAttribute = \"data-step-number\";\nexport const dataIntroAttribute = \"data-intro\";\nexport const dataStepAttribute = \"data-step\";\nexport const dataIntroGroupAttribute = \"data-intro-group\";\nexport const dataDisableInteraction = \"data-disable-interaction\";\nexport const dataTitleAttribute = \"data-title\";\nexport const dataTooltipClass = \"data-tooltip-class\";\nexport const dataHighlightClass = \"data-highlight-class\";\nexport const dataPosition = \"data-position\";\nexport const dataScrollTo = \"data-scroll-to\";\n","import { addClass } from \"../../util/className\";\nimport { TourStep } from \"./steps\";\nimport { Tour } from \"./tour\";\nimport getPropValue from \"../../util/getPropValue\";\nimport { queryElementsByClassName } from \"../../util/queryElement\";\nimport { removeClass } from \"../../util/className\";\nimport { showElementClassName } from \"./classNames\";\n\n/**\n * To set the show element\n * This function set a relative (in most cases) position and changes the z-index\n *\n * @api private\n */\nfunction setShowElement(targetElement: HTMLElement) {\n addClass(targetElement, \"introjs-showElement\");\n\n const currentElementPosition = getPropValue(targetElement, \"position\");\n if (\n currentElementPosition !== \"absolute\" &&\n currentElementPosition !== \"relative\" &&\n currentElementPosition !== \"sticky\" &&\n currentElementPosition !== \"fixed\"\n ) {\n //change to new intro item\n addClass(targetElement, \"introjs-relativePosition\");\n }\n}\n\n/**\n * Show an element on the page\n *\n * @api private\n */\nexport async function showElement(tour: Tour, step: TourStep) {\n tour.callback(\"change\")?.call(tour, step.element);\n\n //remove old classes if the element still exist\n removeShowElement();\n\n setShowElement(step.element as HTMLElement);\n\n await tour.callback(\"afterChange\")?.call(tour, step.element);\n}\n\n/**\n * To remove all show element(s)\n *\n * @api private\n */\nexport function removeShowElement() {\n const elms = Array.from(queryElementsByClassName(showElementClassName));\n\n for (const elm of elms) {\n removeClass(elm, /introjs-[a-zA-Z]+/g);\n }\n}\n","import { TooltipPosition } from \"../../packages/tooltip\";\nimport { queryElement, queryElements } from \"../../util/queryElement\";\nimport cloneObject from \"../../util/cloneObject\";\nimport { Tour } from \"./tour\";\nimport {\n dataDisableInteraction,\n dataHighlightClass,\n dataIntroAttribute,\n dataIntroGroupAttribute,\n dataPosition,\n dataScrollTo,\n dataStepAttribute,\n dataTitleAttribute,\n dataTooltipClass,\n} from \"./dataAttributes\";\nimport { showElement } from \"./showElement\";\n\nexport type ScrollTo = \"off\" | \"element\" | \"tooltip\";\n\nexport type TourStep = {\n step: number;\n title: string;\n intro: string;\n tooltipClass?: string;\n highlightClass?: string;\n element?: Element | HTMLElement | string | null;\n position: TooltipPosition;\n scrollTo: ScrollTo;\n disableInteraction?: boolean;\n};\n\n/**\n * Go to next step on intro\n *\n * @api private\n */\nexport async function nextStep(tour: Tour) {\n tour.incrementCurrentStep();\n\n const currentStep = tour.getCurrentStep();\n\n if (currentStep === undefined) {\n return false;\n }\n\n const nextStep = tour.getStep(currentStep);\n let continueStep: boolean | undefined = true;\n\n continueStep = await tour\n .callback(\"beforeChange\")\n ?.call(\n tour,\n nextStep && (nextStep.element as HTMLElement),\n tour.getCurrentStep(),\n tour.getDirection()\n );\n\n // if `onBeforeChange` returned `false`, stop displaying the element\n if (continueStep === false) {\n tour.decrementCurrentStep();\n return false;\n }\n\n if (tour.isEnd()) {\n // check if any callback is defined\n await tour.callback(\"complete\")?.call(tour, tour.getCurrentStep(), \"end\");\n await tour.exit();\n\n return false;\n }\n\n await showElement(tour, nextStep);\n\n return true;\n}\n\n/**\n * Go to previous step on intro\n *\n * @api private\n */\nexport async function previousStep(tour: Tour) {\n let currentStep = tour.getCurrentStep();\n\n if (currentStep === undefined || currentStep <= 0) {\n return false;\n }\n\n tour.decrementCurrentStep();\n // update the current step after decrementing\n currentStep = tour.getCurrentStep();\n\n if (currentStep === undefined) {\n return false;\n }\n\n const nextStep = tour.getStep(currentStep);\n let continueStep: boolean | undefined = true;\n\n continueStep = await tour\n .callback(\"beforeChange\")\n ?.call(\n tour,\n nextStep && (nextStep.element as HTMLElement),\n tour.getCurrentStep(),\n tour.getDirection()\n );\n\n // if `onBeforeChange` returned `false`, stop displaying the element\n if (continueStep === false) {\n tour.incrementCurrentStep();\n return false;\n }\n\n await showElement(tour, nextStep);\n\n return true;\n}\n\n/**\n * Finds all Intro steps from the data-* attributes and the options.steps array\n *\n * @api private\n */\nexport const fetchSteps = (tour: Tour) => {\n let steps: TourStep[] = [];\n\n if (tour.getOption(\"steps\")?.length) {\n //use steps passed programmatically\n for (const _step of tour.getOption(\"steps\")) {\n const step = cloneObject(_step);\n\n //set the step\n step.step = steps.length + 1;\n\n step.title = step.title || \"\";\n\n //use querySelector function only when developer used CSS selector\n if (typeof step.element === \"string\") {\n //grab the element with given selector from the page\n step.element = queryElement(step.element) || undefined;\n }\n\n // tour without element\n if (!step.element) {\n step.element = tour.appendFloatingElement();\n step.position = \"floating\";\n }\n\n step.position = step.position || tour.getOption(\"tooltipPosition\");\n step.scrollTo = step.scrollTo || tour.getOption(\"scrollTo\");\n\n if (typeof step.disableInteraction === \"undefined\") {\n step.disableInteraction = tour.getOption(\"disableInteraction\");\n }\n\n if (step.element !== null) {\n steps.push(step as TourStep);\n }\n }\n } else {\n const elements = Array.from(\n queryElements(`*[${dataIntroAttribute}]`, tour.getTargetElement())\n );\n\n // if there's no element to intro\n if (elements.length < 1) {\n return [];\n }\n\n const itemsWithoutStep: TourStep[] = [];\n\n for (const element of elements) {\n // start intro for groups of elements\n if (\n tour.getOption(\"group\") &&\n element.getAttribute(dataIntroGroupAttribute) !==\n tour.getOption(\"group\")\n ) {\n continue;\n }\n\n // skip hidden elements\n if (element.style.display === \"none\") {\n continue;\n }\n\n // get the step for the current element or set as 0 if is not present\n const stepIndex = parseInt(\n element.getAttribute(dataStepAttribute) || \"0\",\n 10\n );\n\n let disableInteraction = tour.getOption(\"disableInteraction\");\n if (element.hasAttribute(dataDisableInteraction)) {\n disableInteraction = !!element.getAttribute(dataDisableInteraction);\n }\n\n const newIntroStep: TourStep = {\n step: stepIndex,\n element,\n title: element.getAttribute(dataTitleAttribute) || \"\",\n intro: element.getAttribute(dataIntroAttribute) || \"\",\n tooltipClass: element.getAttribute(dataTooltipClass) || undefined,\n highlightClass: element.getAttribute(dataHighlightClass) || undefined,\n position: (element.getAttribute(dataPosition) ||\n tour.getOption(\"tooltipPosition\")) as TooltipPosition,\n scrollTo:\n (element.getAttribute(dataScrollTo) as ScrollTo) ||\n tour.getOption(\"scrollTo\"),\n disableInteraction,\n };\n\n if (stepIndex > 0) {\n steps[stepIndex - 1] = newIntroStep;\n } else {\n itemsWithoutStep.push(newIntroStep);\n }\n }\n\n // fill items without step in blanks and update their step\n for (let i = 0; itemsWithoutStep.length > 0; i++) {\n if (typeof steps[i] === \"undefined\") {\n const newStep = itemsWithoutStep.shift();\n if (!newStep) break;\n\n newStep.step = i + 1;\n steps[i] = newStep;\n }\n }\n }\n\n // removing undefined/null elements\n steps = steps.filter((n) => n);\n\n // Sort all items with given steps\n steps.sort((a, b) => a.step - b.step);\n\n return steps;\n};\n","import { nextStep } from \"./steps\";\nimport { fetchSteps } from \"./steps\";\nimport { Tour } from \"./tour\";\n\n/**\n * Initiate a new tour the page\n *\n * @api private\n */\nexport const start = async (tour: Tour): Promise => {\n // don't start the tour if the instance is not active\n if (!tour.isActive()) {\n return false;\n }\n\n // don't start the tour if it's already started\n if (tour.hasStarted()) {\n return false;\n }\n\n await tour.callback(\"start\")?.call(tour, tour.getTargetElement());\n\n //set it to the introJs object\n const steps = fetchSteps(tour);\n\n if (steps.length === 0) {\n return false;\n }\n\n tour.setSteps(steps);\n\n //then, start the show\n await nextStep(tour);\n\n return true;\n};\n","import { removeShowElement } from \"./showElement\";\nimport { Tour } from \"./tour\";\n\n/**\n * Exit from intro\n *\n * @api private\n * @param {Boolean} force - Setting to `true` will skip the result of beforeExit callback\n */\nexport default async function exitIntro(\n tour: Tour,\n force: boolean = false\n): Promise {\n const targetElement = tour.getTargetElement();\n let continueExit: boolean | undefined = true;\n\n // calling the onBeforeExit callback if it is defined\n // If this callback return `false`, it would halt the process\n continueExit = await tour.callback(\"beforeExit\")?.call(tour, targetElement);\n\n // skip this check if `force` parameter is `true`\n // otherwise, if `onBeforEexit` returned `false`, don't exit the intro\n if (!force && continueExit === false) return false;\n\n removeShowElement();\n\n //check if any callback is defined\n await tour.callback(\"exit\")?.call(tour);\n\n // set the step to default\n // this would update the signal to the tour that the tour has ended\n // and the corresponding components would be updated\n tour.resetCurrentStep();\n\n return true;\n}\n","export function setCookie(name: string, value: string, days?: number) {\n const cookie: {\n [name: string]: string | undefined;\n path: string;\n expires: string | undefined;\n } = { [name]: value, path: \"/\", expires: undefined };\n\n if (days) {\n let date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n cookie.expires = date.toUTCString();\n }\n\n let arr = [];\n for (let key in cookie) {\n arr.push(`${key}=${cookie[key]}`);\n }\n\n document.cookie = arr.join(\"; \");\n\n return getCookie(name);\n}\n\nexport function getAllCookies() {\n let cookie: { [name: string]: string } = {};\n\n document.cookie.split(\";\").forEach((el) => {\n let [k, v] = el.split(\"=\");\n cookie[k.trim()] = v;\n });\n\n return cookie;\n}\n\nexport function getCookie(name: string) {\n return getAllCookies()[name];\n}\n\nexport function deleteCookie(name: string) {\n setCookie(name, \"\", -1);\n}\n","import { deleteCookie, getCookie, setCookie } from \"../../util/cookie\";\n\nconst dontShowAgainCookieValue = \"true\";\n\n/**\n * Set the \"Don't show again\" state\n *\n * @api private\n */\nexport function setDontShowAgain(\n dontShowAgain: boolean,\n cookieName: string,\n cookieDays: number\n) {\n if (dontShowAgain) {\n setCookie(cookieName, dontShowAgainCookieValue, cookieDays);\n } else {\n deleteCookie(cookieName);\n }\n}\n\n/**\n * Get the \"Don't show again\" state from cookies\n *\n * @api private\n */\nexport function getDontShowAgain(cookieName: string): boolean {\n const dontShowCookie = getCookie(cookieName);\n return dontShowCookie !== \"\" && dontShowCookie === dontShowAgainCookieValue;\n}\n","import { nextStep, previousStep } from \"./steps\";\nimport { Tour } from \"./tour\";\nimport { previousButtonClassName, skipButtonClassName } from \"./classNames\";\nimport { dataStepNumberAttribute } from \"./dataAttributes\";\n\n/**\n * on keyCode:\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n * This feature has been removed from the Web standards.\n * Though some browsers may still support it, it is in\n * the process of being dropped.\n * Instead, you should use KeyboardEvent.code,\n * if it's implemented.\n *\n * jQuery's approach is to test for\n * (1) e.which, then\n * (2) e.charCode, then\n * (3) e.keyCode\n * https://github.com/jquery/jquery/blob/a6b0705294d336ae2f63f7276de0da1195495363/src/event.js#L638\n */\nexport default async function onKeyDown(tour: Tour, e: KeyboardEvent) {\n let code = e.code === undefined ? e.which : e.code;\n\n // if e.which is null\n if (code === null) {\n code = e.charCode === null ? e.keyCode : e.charCode;\n }\n\n if (\n (code === \"Escape\" || code === 27) &&\n tour.getOption(\"exitOnEsc\") === true\n ) {\n //escape key pressed, exit the intro\n //check if exit callback is defined\n await tour.exit();\n } else if (code === \"ArrowLeft\" || code === 37) {\n //left arrow\n await previousStep(tour);\n } else if (code === \"ArrowRight\" || code === 39) {\n //right arrow\n await nextStep(tour);\n } else if (code === \"Enter\" || code === \"NumpadEnter\" || code === 13) {\n //srcElement === ie\n const target = (e.target || e.srcElement) as HTMLElement;\n if (target && target.className.match(previousButtonClassName)) {\n //user hit enter while focusing on previous button\n await previousStep(tour);\n } else if (target && target.className.match(skipButtonClassName)) {\n // user hit enter while focusing on skip button\n if (tour.isEnd()) {\n await tour\n .callback(\"complete\")\n ?.call(tour, tour.getCurrentStep(), \"skip\");\n }\n\n await tour.exit();\n } else if (target && target.getAttribute(dataStepNumberAttribute)) {\n // user hit enter while focusing on step bullet\n target.click();\n } else {\n //default behavior for responding to enter\n await nextStep(tour);\n }\n\n //prevent default behaviour on hitting Enter, to prevent steps being skipped in some browsers\n if (e.preventDefault) {\n e.preventDefault();\n } else {\n e.returnValue = false;\n }\n }\n}\n","import { setPositionRelativeTo } from \"../../util/positionRelativeTo\";\nimport { TourStep } from \"./steps\";\n\n/**\n * Sets the position of the element relative to the TourStep\n * @api private\n */\nexport const setPositionRelativeToStep = (\n relativeElement: HTMLElement,\n element: HTMLElement,\n step: TourStep,\n padding: number\n) => {\n setPositionRelativeTo(\n relativeElement,\n element,\n step.element as HTMLElement,\n step.position === \"floating\" ? 0 : padding\n );\n};\n","import getScrollParent from \"./getScrollParent\";\n\n/**\n * scroll a scrollable element to a child element\n */\nexport default function scrollParentToElement(\n scrollToElement: boolean,\n targetElement: HTMLElement\n) {\n if (!scrollToElement) return;\n\n const parent = getScrollParent(targetElement);\n\n if (parent === document.body) return;\n\n parent.scrollTop = targetElement.offsetTop - parent.offsetTop;\n}\n","/**\n * Find the nearest scrollable parent\n * copied from https://stackoverflow.com/questions/35939886/find-first-scrollable-parent\n */\nexport default function getScrollParent(element: HTMLElement): HTMLElement {\n let style = window.getComputedStyle(element);\n const excludeStaticParent = style.position === \"absolute\";\n const overflowRegex = /(auto|scroll)/;\n\n if (style.position === \"fixed\") return document.body;\n\n for (\n let parent: HTMLElement | null = element;\n (parent = parent.parentElement);\n\n ) {\n style = window.getComputedStyle(parent);\n if (excludeStaticParent && style.position === \"static\") {\n continue;\n }\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX))\n return parent;\n }\n\n return document.body;\n}\n","import elementInViewport from \"./elementInViewport\";\nimport getWindowSize from \"./getWindowSize\";\nimport { ScrollTo } from \"../packages/tour/steps\";\n\n/**\n * To change the scroll of `window` after highlighting an element\n *\n * @api private\n */\nexport default function scrollTo(\n scrollToElement: boolean,\n scrollTo: ScrollTo,\n scrollPadding: number,\n targetElement: HTMLElement,\n tooltipLayer: HTMLElement\n) {\n if (scrollTo === \"off\") return;\n let rect: DOMRect;\n\n if (!scrollToElement) return;\n\n if (scrollTo === \"tooltip\") {\n rect = tooltipLayer.getBoundingClientRect();\n } else {\n rect = targetElement.getBoundingClientRect();\n }\n\n if (!elementInViewport(targetElement)) {\n const winHeight = getWindowSize().height;\n const top = rect.bottom - (rect.bottom - rect.top);\n\n // TODO (afshinm): do we need scroll padding now?\n // I have changed the scroll option and now it scrolls the window to\n // the center of the target element or tooltip.\n\n if (top < 0 || targetElement.clientHeight > winHeight) {\n window.scrollBy(\n 0,\n rect.top - (winHeight / 2 - rect.height / 2) - scrollPadding\n ); // 30px padding from edge to look nice\n\n //Scroll down\n } else {\n window.scrollBy(\n 0,\n rect.top - (winHeight / 2 - rect.height / 2) + scrollPadding\n ); // 30px padding from edge to look nice\n }\n }\n}\n","/**\n * Check to see if the element is in the viewport or not\n * http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport\n *\n * @api private\n */\nexport default function elementInViewport(el: HTMLElement): boolean {\n const rect = el.getBoundingClientRect();\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom + 80 <= window.innerHeight && // add 80 to get the text right\n rect.right <= window.innerWidth\n );\n}\n","import { Tooltip, type TooltipProps } from \"../../tooltip/tooltip\";\nimport dom, { PropValueOrDerived } from \"../../dom\";\nimport {\n activeClassName,\n bulletsClassName,\n disabledButtonClassName,\n doneButtonClassName,\n dontShowAgainClassName,\n fullButtonClassName,\n helperNumberLayerClassName,\n hiddenButtonClassName,\n nextButtonClassName,\n previousButtonClassName,\n progressBarClassName,\n progressClassName,\n skipButtonClassName,\n tooltipButtonsClassName,\n tooltipHeaderClassName,\n tooltipTextClassName,\n tooltipTitleClassName,\n} from \"../classNames\";\nimport { TourStep } from \"../steps\";\nimport { dataStepNumberAttribute } from \"../dataAttributes\";\nimport scrollParentToElement from \"../../../util/scrollParentToElement\";\nimport scrollTo from \"../../../util/scrollTo\";\n\nconst { h1, div, input, label, ul, li, a } = dom.tags;\n\nconst DontShowAgain = ({\n dontShowAgainLabel,\n onDontShowAgainChange,\n}: {\n dontShowAgainLabel: string;\n onDontShowAgainChange: (checked: boolean) => void;\n}) => {\n return div({ className: dontShowAgainClassName }, [\n input({\n type: \"checkbox\",\n id: dontShowAgainClassName,\n name: dontShowAgainClassName,\n onchange: (e: any) => {\n onDontShowAgainChange((e.target as HTMLInputElement).checked);\n },\n }),\n label({ for: dontShowAgainClassName }, dontShowAgainLabel),\n ]);\n};\n\nconst Bullets = ({\n step,\n steps,\n onBulletClick,\n}: {\n step: TourStep;\n steps: TourStep[];\n onBulletClick: (stepNumber: number) => void;\n}): HTMLElement => {\n return div({ className: bulletsClassName }, [\n ul({ role: \"tablist\" }, [\n ...steps.map(({ step: stepNumber }) => {\n const innerLi = li(\n {\n role: \"presentation\",\n },\n [\n a({\n role: \"tab\",\n className: () =>\n `${step.step === stepNumber ? activeClassName : \"\"}`,\n onclick: (e: any) => {\n const stepNumberAttribute = (\n e.target as HTMLElement\n ).getAttribute(dataStepNumberAttribute);\n if (!stepNumberAttribute) return;\n\n onBulletClick(parseInt(stepNumberAttribute, 10));\n },\n innerHTML: \" \",\n [dataStepNumberAttribute]: stepNumber,\n }),\n ]\n );\n\n return innerLi;\n }),\n ]),\n ]);\n};\n\nconst ProgressBar = ({\n steps,\n currentStep,\n progressBarAdditionalClass,\n}: {\n steps: TourStep[];\n currentStep: number;\n progressBarAdditionalClass: string;\n}) => {\n const progress = ((currentStep + 1) / steps.length) * 100;\n\n return div({ className: progressClassName }, [\n div({\n className: `${progressBarClassName} ${\n progressBarAdditionalClass ? progressBarAdditionalClass : \"\"\n }`,\n role: \"progress\",\n \"aria-valuemin\": \"0\",\n \"aria-valuemax\": \"100\",\n \"aria-valuenow\": () => progress.toString(),\n style: `width:${progress}%;`,\n }),\n ]);\n};\n\nconst StepNumber = ({\n step,\n steps,\n stepNumbersOfLabel,\n}: {\n step: TourStep;\n steps: TourStep[];\n stepNumbersOfLabel: string;\n}) => {\n return div({ className: helperNumberLayerClassName }, [\n `${step.step} ${stepNumbersOfLabel} ${steps.length}`,\n ]);\n};\n\nconst Button = ({\n label,\n onClick,\n disabled,\n className,\n}: {\n label: string;\n onClick: (e: any) => void;\n disabled?: PropValueOrDerived;\n className?: PropValueOrDerived;\n}) => {\n return a(\n {\n role: \"button\",\n tabIndex: 0,\n ariaDisabled: disabled ?? false,\n onclick: onClick,\n className: className ?? \"\",\n },\n [label]\n );\n};\n\nconst NextButton = ({\n steps,\n currentStep,\n\n nextLabel,\n doneLabel,\n\n hideNext,\n hidePrev,\n nextToDone,\n onClick,\n buttonClass,\n}: {\n steps: TourStep[];\n currentStep: number;\n\n nextLabel: string;\n doneLabel: string;\n\n hideNext: boolean;\n hidePrev: boolean;\n nextToDone: boolean;\n onClick: (e: any) => void;\n buttonClass: string;\n}) => {\n const isFullButton = currentStep === 0 && steps.length > 1 && hidePrev;\n const isLastStep = currentStep === steps.length - 1 || steps.length === 1;\n\n const isDisabled = dom.derive(() => {\n // when the current step is the last one or there is only one step to show\n return isLastStep && !hideNext && !nextToDone;\n });\n\n const isDoneButton = dom.derive(() => {\n return isLastStep && !hideNext && nextToDone;\n });\n\n const nextButton = Button({\n label: isDoneButton.val ? doneLabel : nextLabel,\n onClick,\n className: () => {\n const classNames = [buttonClass, nextButtonClassName];\n\n if (isDoneButton.val) {\n classNames.push(doneButtonClassName);\n }\n\n if (isDisabled.val) {\n classNames.push(disabledButtonClassName);\n }\n\n if (isFullButton) {\n classNames.push(fullButtonClassName);\n }\n\n return classNames.filter(Boolean).join(\" \");\n },\n });\n\n // wait for the button to be rendered\n setTimeout(() => {\n nextButton.focus();\n }, 1);\n\n return nextButton;\n};\n\nconst PrevButton = ({\n label,\n steps,\n currentStep,\n hidePrev,\n hideNext,\n onClick,\n buttonClass,\n}: {\n label: string;\n steps: TourStep[];\n currentStep: number;\n hidePrev: boolean;\n hideNext: boolean;\n onClick: (e: any) => void;\n buttonClass: string;\n}) => {\n const isFirstStep = currentStep === 0 && steps.length > 1;\n // when the current step is the first one and there are more steps to show\n const isDisabled = isFirstStep && !hidePrev;\n const isHidden = isFirstStep && hidePrev;\n // when the current step is the last one or there is only one step to show\n const isFullButton =\n (currentStep === steps.length - 1 || steps.length === 1) && hideNext;\n\n return Button({\n label,\n onClick,\n disabled: isDisabled,\n className: () => {\n const classNames = [buttonClass, previousButtonClassName];\n\n if (isFullButton) {\n classNames.push(fullButtonClassName);\n }\n\n if (isDisabled) {\n classNames.push(disabledButtonClassName);\n }\n\n if (isHidden) {\n classNames.push(hiddenButtonClassName);\n }\n\n return classNames.filter(Boolean).join(\" \");\n },\n });\n};\n\nconst Buttons = ({\n steps,\n currentStep,\n\n buttonClass,\n\n nextToDone,\n doneLabel,\n\n hideNext,\n nextLabel,\n onNextClick,\n\n hidePrev,\n prevLabel,\n onPrevClick,\n}: {\n steps: TourStep[];\n currentStep: number;\n\n buttonClass: string;\n\n nextToDone: boolean;\n doneLabel: string;\n\n hideNext: boolean;\n nextLabel: string;\n onNextClick: (e: any) => void;\n\n hidePrev: boolean;\n prevLabel: string;\n onPrevClick: (e: any) => void;\n}) => {\n return div(\n { className: tooltipButtonsClassName },\n steps.length > 1\n ? PrevButton({\n label: prevLabel,\n steps,\n currentStep,\n hidePrev,\n hideNext,\n onClick: onPrevClick,\n buttonClass,\n })\n : null,\n NextButton({\n currentStep,\n steps,\n doneLabel,\n nextLabel,\n onClick: onNextClick,\n hideNext,\n hidePrev,\n nextToDone,\n buttonClass,\n })\n );\n};\n\nconst Header = ({\n title,\n\n skipLabel,\n onSkipClick,\n}: {\n title: string;\n\n skipLabel: string;\n onSkipClick: (e: any) => void;\n}) => {\n return div({ className: tooltipHeaderClassName }, [\n h1({ className: tooltipTitleClassName }, title),\n Button({\n className: skipButtonClassName,\n label: skipLabel,\n onClick: onSkipClick,\n }),\n ]);\n};\n\nconst scroll = ({\n step,\n tooltip,\n scrollToElement,\n scrollPadding,\n}: {\n step: TourStep;\n tooltip: HTMLElement;\n scrollToElement: boolean;\n scrollPadding: number;\n}) => {\n // when target is within a scrollable element\n scrollParentToElement(scrollToElement, step.element as HTMLElement);\n\n // change the scroll of the window, if needed\n scrollTo(\n scrollToElement,\n step.scrollTo,\n scrollPadding,\n step.element as HTMLElement,\n tooltip\n );\n};\n\nexport type TourTooltipProps = Omit<\n TooltipProps,\n \"hintMode\" | \"position\" | \"element\"\n> & {\n step: TourStep;\n steps: TourStep[];\n currentStep: number;\n\n bullets: boolean;\n onBulletClick: (stepNumber: number) => void;\n\n buttons: boolean;\n nextLabel: string;\n onNextClick: (e: any) => void;\n prevLabel: string;\n onPrevClick: (e: any) => void;\n skipLabel: string;\n onSkipClick: (e: any) => void;\n buttonClass: string;\n nextToDone: boolean;\n doneLabel: string;\n hideNext: boolean;\n hidePrev: boolean;\n\n progress: boolean;\n progressBarAdditionalClass: string;\n\n stepNumbers: boolean;\n stepNumbersOfLabel: string;\n\n scrollToElement: boolean;\n scrollPadding: number;\n\n dontShowAgain: boolean;\n dontShowAgainLabel: string;\n onDontShowAgainChange: (checked: boolean) => void;\n};\n\nexport const TourTooltip = ({\n step,\n currentStep,\n steps,\n\n onBulletClick,\n\n bullets,\n\n buttons,\n nextLabel,\n onNextClick,\n prevLabel,\n onPrevClick,\n skipLabel,\n onSkipClick,\n buttonClass,\n nextToDone,\n doneLabel,\n hideNext,\n hidePrev,\n\n progress,\n progressBarAdditionalClass,\n\n stepNumbers,\n stepNumbersOfLabel,\n\n scrollToElement,\n scrollPadding,\n\n dontShowAgain,\n onDontShowAgainChange,\n dontShowAgainLabel,\n ...props\n}: TourTooltipProps) => {\n const children = [];\n const title = step.title;\n const text = step.intro;\n const position = step.position;\n\n children.push(Header({ title, skipLabel, onSkipClick }));\n\n children.push(div({ className: tooltipTextClassName }, text));\n\n if (dontShowAgain) {\n children.push(DontShowAgain({ dontShowAgainLabel, onDontShowAgainChange }));\n }\n\n if (bullets) {\n children.push(Bullets({ step, steps, onBulletClick }));\n }\n\n if (progress) {\n children.push(\n ProgressBar({ steps, currentStep, progressBarAdditionalClass })\n );\n }\n\n if (stepNumbers) {\n children.push(StepNumber({ step, steps, stepNumbersOfLabel }));\n }\n\n if (buttons) {\n children.push(\n Buttons({\n steps,\n currentStep,\n\n nextLabel: nextLabel,\n onNextClick: onNextClick,\n\n prevLabel: prevLabel,\n onPrevClick: onPrevClick,\n\n buttonClass,\n nextToDone,\n doneLabel,\n hideNext,\n hidePrev,\n })\n );\n }\n\n const tooltip = Tooltip(\n {\n ...props,\n element: step.element as HTMLElement,\n hintMode: false,\n position,\n },\n children\n );\n\n scroll({\n step,\n tooltip,\n scrollToElement: scrollToElement,\n scrollPadding: scrollPadding,\n });\n\n return tooltip;\n};\n","import dom from \"../../dom\";\nimport { tooltipReferenceLayerClassName } from \"../classNames\";\nimport { setPositionRelativeToStep } from \"../position\";\nimport { TourTooltip, TourTooltipProps } from \"./TourTooltip\";\n\nconst { div } = dom.tags;\n\nexport type ReferenceLayerProps = TourTooltipProps & {\n targetElement: HTMLElement;\n helperElementPadding: number;\n};\n\nexport const ReferenceLayer = ({\n targetElement,\n helperElementPadding,\n ...props\n}: ReferenceLayerProps) => {\n const referenceLayer = div(\n {\n className: tooltipReferenceLayerClassName,\n },\n TourTooltip(props)\n );\n\n dom.derive(() => {\n // set the position of the reference layer if the refreshes signal changes\n if (props.refreshes.val == undefined) return;\n\n setPositionRelativeToStep(\n targetElement,\n referenceLayer,\n props.step,\n helperElementPadding\n );\n });\n\n return referenceLayer;\n};\n","import { style } from \"../../../util/style\";\nimport dom, { State } from \"../../dom\";\nimport { helperLayerClassName } from \"../classNames\";\nimport { setPositionRelativeToStep } from \"../position\";\nimport { TourStep } from \"../steps\";\n\nconst { div } = dom.tags;\n\nconst getClassName = ({\n step,\n tourHighlightClass,\n}: {\n step: State;\n tourHighlightClass: string;\n}) => {\n let highlightClass = helperLayerClassName;\n\n // check for a current step highlight class\n if (step.val && typeof step.val.highlightClass === \"string\") {\n highlightClass += ` ${step.val.highlightClass}`;\n }\n\n // check for options highlight class\n if (typeof tourHighlightClass === \"string\") {\n highlightClass += ` ${tourHighlightClass}`;\n }\n\n return highlightClass;\n};\n\nexport type HelperLayerProps = {\n currentStep: State;\n steps: TourStep[];\n refreshes: State;\n targetElement: HTMLElement;\n tourHighlightClass: string;\n overlayOpacity: number;\n helperLayerPadding: number;\n};\n\nexport const HelperLayer = ({\n currentStep,\n steps,\n refreshes,\n targetElement,\n tourHighlightClass,\n overlayOpacity,\n helperLayerPadding,\n}: HelperLayerProps) => {\n const step = dom.derive(() =>\n currentStep.val !== undefined ? steps[currentStep.val] : null\n );\n\n const helperLayer = div({\n className: () => getClassName({ step, tourHighlightClass }),\n style: style({\n // the inner box shadow is the border for the highlighted element\n // the outer box shadow is the overlay effect\n \"box-shadow\": `0 0 1px 2px rgba(33, 33, 33, 0.8), rgba(33, 33, 33, ${overlayOpacity.toString()}) 0 0 0 5000px`,\n }),\n });\n\n dom.derive(() => {\n // set the new position if the step or refreshes change\n if (!step.val || refreshes.val === undefined) return;\n\n setPositionRelativeToStep(\n targetElement,\n helperLayer,\n step.val,\n helperLayerPadding\n );\n });\n\n return helperLayer;\n};\n","import dom, { State } from \"../../dom\";\nimport { disableInteractionClassName } from \"../classNames\";\nimport { setPositionRelativeToStep } from \"../position\";\nimport { TourStep } from \"../steps\";\n\nconst { div } = dom.tags;\n\nexport type HelperLayerProps = {\n currentStep: State;\n steps: TourStep[];\n refreshes: State;\n targetElement: HTMLElement;\n helperElementPadding: number;\n};\n\nexport const DisableInteraction = ({\n currentStep,\n steps,\n refreshes,\n targetElement,\n helperElementPadding,\n}: HelperLayerProps) => {\n const step = dom.derive(() =>\n currentStep.val !== undefined ? steps[currentStep.val] : null\n );\n\n return () => {\n if (!step.val) {\n return null;\n }\n\n const disableInteraction = div({\n className: disableInteractionClassName,\n });\n\n dom.derive(() => {\n // set the position of the reference layer if the refreshes signal changes\n if (!step.val || refreshes.val == undefined) return;\n\n setPositionRelativeToStep(\n targetElement,\n disableInteraction,\n step.val,\n helperElementPadding\n );\n });\n\n return disableInteraction;\n };\n};\n","import { style } from \"../../../util/style\";\nimport { overlayClassName } from \"../classNames\";\nimport dom from \"../../dom\";\nimport { Tour } from \"../tour\";\n\nconst { div } = dom.tags;\n\nexport type OverlayLayerProps = {\n exitOnOverlayClick: boolean;\n onExitTour: () => Promise;\n};\n\nexport const OverlayLayer = ({\n exitOnOverlayClick,\n onExitTour,\n}: OverlayLayerProps) => {\n const overlayLayer = div({\n className: overlayClassName,\n style: style({\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n position: \"fixed\",\n cursor: exitOnOverlayClick ? \"pointer\" : \"auto\",\n }),\n });\n\n if (exitOnOverlayClick) {\n overlayLayer.onclick = async () => {\n await onExitTour();\n };\n }\n\n return overlayLayer;\n};\n","import dom from \"../../dom\";\nimport { ReferenceLayer } from \"./ReferenceLayer\";\nimport { HelperLayer } from \"./HelperLayer\";\nimport { Tour } from \"../tour\";\nimport { DisableInteraction } from \"./DisableInteraction\";\nimport { OverlayLayer } from \"./OverlayLayer\";\nimport { nextStep, previousStep } from \"../steps\";\nimport { doneButtonClassName } from \"../classNames\";\nimport { style } from \"../../../util/style\";\n\nconst { div } = dom.tags;\n\nexport type TourRootProps = {\n tour: Tour;\n};\n\nexport const TourRoot = ({ tour }: TourRootProps) => {\n const currentStepSignal = tour.getCurrentStepSignal();\n const refreshesSignal = tour.getRefreshesSignal();\n const steps = tour.getSteps();\n\n const helperLayer = HelperLayer({\n currentStep: currentStepSignal,\n steps,\n refreshes: refreshesSignal,\n targetElement: tour.getTargetElement(),\n tourHighlightClass: tour.getOption(\"highlightClass\"),\n overlayOpacity: tour.getOption(\"overlayOpacity\"),\n helperLayerPadding: tour.getOption(\"helperElementPadding\"),\n });\n\n const opacity = dom.state(0);\n // render the tooltip immediately when the tour starts\n // but we reset the transition duration to 300ms when the tooltip is rendered for the first time\n let tooltipTransitionDuration = 0;\n\n const root = div(\n {\n className: \"introjs-tour\",\n style: () => style({ opacity: `${opacity.val}` }),\n },\n // helperLayer should not be re-rendered when the state changes for the transition to work\n helperLayer,\n () => {\n // do not remove this check, it is necessary for this state-binding to work\n // and render the entire section every time the state changes\n if (currentStepSignal.val === undefined) {\n return null;\n }\n\n const step = dom.derive(() =>\n currentStepSignal.val !== undefined\n ? steps[currentStepSignal.val]\n : null\n );\n\n if (!step.val) {\n return null;\n }\n\n const exitOnOverlayClick = tour.getOption(\"exitOnOverlayClick\") === true;\n const overlayLayer = OverlayLayer({\n exitOnOverlayClick,\n onExitTour: async () => {\n return tour.exit();\n },\n });\n\n const referenceLayer = ReferenceLayer({\n step: step.val,\n targetElement: tour.getTargetElement(),\n refreshes: refreshesSignal,\n helperElementPadding: tour.getOption(\"helperElementPadding\"),\n\n transitionDuration: tooltipTransitionDuration,\n\n positionPrecedence: tour.getOption(\"positionPrecedence\"),\n autoPosition: tour.getOption(\"autoPosition\"),\n showStepNumbers: tour.getOption(\"showStepNumbers\"),\n\n steps: tour.getSteps(),\n currentStep: currentStepSignal.val,\n\n onBulletClick: (stepNumber: number) => {\n tour.goToStep(stepNumber);\n },\n\n bullets: tour.getOption(\"showBullets\"),\n\n buttons: tour.getOption(\"showButtons\"),\n nextLabel: \"Next\",\n onNextClick: async (e: any) => {\n if (!tour.isLastStep()) {\n await nextStep(tour);\n } else if (\n new RegExp(doneButtonClassName, \"gi\").test(\n (e.target as HTMLElement).className\n )\n ) {\n await tour\n .callback(\"complete\")\n ?.call(tour, tour.getCurrentStep(), \"done\");\n\n await tour.exit();\n }\n },\n prevLabel: tour.getOption(\"prevLabel\"),\n onPrevClick: async () => {\n const currentStep = tour.getCurrentStep();\n if (currentStep !== undefined && currentStep > 0) {\n await previousStep(tour);\n }\n },\n skipLabel: tour.getOption(\"skipLabel\"),\n onSkipClick: async () => {\n if (tour.isLastStep()) {\n await tour\n .callback(\"complete\")\n ?.call(tour, tour.getCurrentStep(), \"skip\");\n }\n\n await tour.callback(\"skip\")?.call(tour, tour.getCurrentStep());\n\n await tour.exit();\n },\n buttonClass: tour.getOption(\"buttonClass\"),\n nextToDone: tour.getOption(\"nextToDone\"),\n doneLabel: tour.getOption(\"doneLabel\"),\n hideNext: tour.getOption(\"hideNext\"),\n hidePrev: tour.getOption(\"hidePrev\"),\n\n progress: tour.getOption(\"showProgress\"),\n progressBarAdditionalClass: tour.getOption(\n \"progressBarAdditionalClass\"\n ),\n\n stepNumbers: tour.getOption(\"showStepNumbers\"),\n stepNumbersOfLabel: tour.getOption(\"stepNumbersOfLabel\"),\n\n scrollToElement: tour.getOption(\"scrollToElement\"),\n scrollPadding: tour.getOption(\"scrollPadding\"),\n\n dontShowAgain: tour.getOption(\"dontShowAgain\"),\n onDontShowAgainChange: (checked: boolean) => {\n tour.setDontShowAgain(checked);\n },\n dontShowAgainLabel: tour.getOption(\"dontShowAgainLabel\"),\n });\n\n const disableInteraction = step.val.disableInteraction\n ? DisableInteraction({\n currentStep: currentStepSignal,\n steps: tour.getSteps(),\n refreshes: refreshesSignal,\n targetElement: tour.getTargetElement(),\n helperElementPadding: tour.getOption(\"helperElementPadding\"),\n })\n : null;\n\n // wait for the helper layer to be rendered before showing the tooltip\n // this is to prevent the tooltip from flickering when the helper layer is transitioning\n // the 300ms delay is coming from the helper layer transition duration\n tooltipTransitionDuration = 300;\n\n return div(overlayLayer, referenceLayer, disableInteraction);\n }\n );\n\n dom.derive(() => {\n // to clean up the root element when the tour is done\n if (currentStepSignal.val === undefined) {\n opacity.val = 0;\n\n setTimeout(() => {\n root.remove();\n }, 250);\n }\n });\n\n setTimeout(() => {\n // fade in the root element\n opacity.val = 1;\n }, 1);\n\n return root;\n};\n","import dom, { State } from \"../../dom\";\nimport { floatingElementClassName } from \"../classNames\";\n\nconst { div } = dom.tags;\n\nexport type FloatingElementProps = {\n currentStep: State;\n};\n\nexport const FloatingElement = ({ currentStep }: FloatingElementProps) => {\n const floatingElement = div({\n className: floatingElementClassName,\n });\n\n dom.derive(() => {\n // meaning the tour has ended so we should remove the floating element\n if (currentStep.val === undefined) {\n floatingElement.remove();\n }\n });\n\n return floatingElement;\n};\n","import { fetchSteps, nextStep, previousStep, TourStep } from \"./steps\";\nimport { Package } from \"../package\";\nimport {\n introAfterChangeCallback,\n introBeforeChangeCallback,\n introBeforeExitCallback,\n introChangeCallback,\n introCompleteCallback,\n introExitCallback,\n introSkipCallback,\n introStartCallback,\n} from \"./callback\";\nimport { getDefaultTourOptions, TourOptions } from \"./option\";\nimport { setOptions, setOption } from \"../../option\";\nimport { start } from \"./start\";\nimport exitIntro from \"./exitIntro\";\nimport isFunction from \"../../util/isFunction\";\nimport { getDontShowAgain, setDontShowAgain } from \"./dontShowAgain\";\nimport { getContainerElement } from \"../../util/containerElement\";\nimport DOMEvent from \"../../util/DOMEvent\";\nimport onKeyDown from \"./onKeyDown\";\nimport dom from \"../dom\";\nimport { TourRoot } from \"./components/TourRoot\";\nimport { FloatingElement } from \"./components/FloatingElement\";\n\n/**\n * Intro.js Tour class\n */\nexport class Tour implements Package {\n private _steps: TourStep[] = [];\n private _currentStepSignal = dom.state(undefined);\n private _refreshesSignal = dom.state(0);\n private _root: Element | undefined;\n private _direction: \"forward\" | \"backward\";\n private readonly _targetElement: HTMLElement;\n private _options: TourOptions;\n private _floatingElement: Element | undefined;\n\n private readonly callbacks: {\n beforeChange?: introBeforeChangeCallback;\n change?: introChangeCallback;\n afterChange?: introAfterChangeCallback;\n complete?: introCompleteCallback;\n start?: introStartCallback;\n exit?: introExitCallback;\n skip?: introSkipCallback;\n beforeExit?: introBeforeExitCallback;\n } = {};\n\n // Event handlers\n private _keyboardNavigationHandler?: (e: KeyboardEvent) => Promise;\n private _refreshOnResizeHandler?: (e: Event) => void;\n\n /**\n * Create a new Tour instance\n * @param elementOrSelector Optional target element or CSS query to start the Tour on\n * @param options Optional Tour options\n */\n public constructor(\n elementOrSelector?: string | HTMLElement,\n options?: Partial\n ) {\n this._targetElement = getContainerElement(elementOrSelector);\n this._options = options\n ? setOptions(this._options, options)\n : getDefaultTourOptions();\n }\n\n /**\n * Get a specific callback function\n * @param callbackName callback name\n */\n callback(\n callbackName: K\n ): (typeof this.callbacks)[K] | undefined {\n const callback = this.callbacks[callbackName];\n if (isFunction(callback)) {\n return callback;\n }\n return undefined;\n }\n\n /**\n * Go to a specific step of the tour\n * @param step step number\n */\n async goToStep(step: number) {\n // step - 2 because steps starts from zero index and nextStep() increments the step\n this.setCurrentStep(step - 2);\n await nextStep(this);\n return this;\n }\n\n /**\n * Go to a specific step of the tour with the explicit [data-step] number\n * @param stepNumber [data-step] value of the step\n */\n async goToStepNumber(stepNumber: number) {\n for (let i = 0; i < this._steps.length; i++) {\n const item = this._steps[i];\n\n if (item.step === stepNumber) {\n // i - 1 because nextStep() increments the step\n this.setCurrentStep(i - 1);\n break;\n }\n }\n\n await nextStep(this);\n\n return this;\n }\n\n /**\n * Add a step to the tour options.\n * This method should be used in conjunction with the `start()` method.\n * @param step step to add\n */\n addStep(step: Partial) {\n if (!this._options.steps) {\n this._options.steps = [];\n }\n\n this._options.steps.push(step);\n\n return this;\n }\n\n /**\n * Add multiple steps to the tour options.\n * This method should be used in conjunction with the `start()` method.\n * @param steps steps to add\n */\n addSteps(steps: Partial[]) {\n if (!steps.length) return this;\n\n for (const step of steps) {\n this.addStep(step);\n }\n\n return this;\n }\n\n /**\n * Set the steps of the tour\n * @param steps steps to set\n */\n setSteps(steps: TourStep[]): this {\n this._steps = steps;\n return this;\n }\n\n /**\n * Get all available steps of the tour\n */\n getSteps(): TourStep[] {\n return this._steps;\n }\n\n /**\n * Get a specific step of the tour\n * @param {number} step step number\n */\n getStep(step: number): TourStep {\n return this._steps[step];\n }\n\n /**\n * Returns the underlying state of the current step\n * This is an internal method and should not be used outside of the package.\n */\n getCurrentStepSignal() {\n return this._currentStepSignal;\n }\n\n /**\n * Returns the underlying state of the refreshes\n * This is an internal method and should not be used outside of the package.\n */\n getRefreshesSignal() {\n return this._refreshesSignal;\n }\n\n /**\n * Get the current step of the tour\n */\n getCurrentStep(): number | undefined {\n return this._currentStepSignal.val;\n }\n\n /**\n * @deprecated `currentStep()` is deprecated, please use `getCurrentStep()` instead.\n */\n currentStep(): number | undefined {\n return this._currentStepSignal.val;\n }\n\n resetCurrentStep() {\n this._currentStepSignal.val = undefined;\n }\n\n /**\n * Set the current step of the tour and the direction of the tour\n * @param step\n */\n setCurrentStep(step: number): this {\n if (\n this._currentStepSignal.val === undefined ||\n step >= this._currentStepSignal.val\n ) {\n this._direction = \"forward\";\n } else {\n this._direction = \"backward\";\n }\n\n this._currentStepSignal.val = step;\n return this;\n }\n\n /**\n * Increment the current step of the tour (does not start the tour step, must be called in conjunction with `nextStep`)\n */\n incrementCurrentStep(): this {\n const currentStep = this.getCurrentStep();\n if (currentStep === undefined) {\n this.setCurrentStep(0);\n } else {\n this.setCurrentStep(currentStep + 1);\n }\n\n return this;\n }\n\n /**\n * Decrement the current step of the tour (does not start the tour step, must be in conjunction with `previousStep`)\n */\n decrementCurrentStep(): this {\n const currentStep = this.getCurrentStep();\n if (currentStep !== undefined && currentStep > 0) {\n this.setCurrentStep(currentStep - 1);\n }\n\n return this;\n }\n\n /**\n * Get the direction of the tour (forward or backward)\n */\n getDirection() {\n return this._direction;\n }\n\n /**\n * Go to the next step of the tour\n */\n async nextStep() {\n await nextStep(this);\n return this;\n }\n\n /**\n * Go to the previous step of the tour\n */\n async previousStep() {\n await previousStep(this);\n return this;\n }\n\n /**\n * Check if the current step is the last step\n */\n isEnd(): boolean {\n const currentStep = this.getCurrentStep();\n return currentStep !== undefined && currentStep >= this._steps.length;\n }\n\n /**\n * Check if the current step is the last step of the tour\n */\n isLastStep(): boolean {\n return this.getCurrentStep() === this._steps.length - 1;\n }\n\n /**\n * Get the target element of the tour\n */\n getTargetElement(): HTMLElement {\n return this._targetElement;\n }\n\n /**\n * Set the options for the tour\n * @param partialOptions key/value pair of options\n */\n setOptions(partialOptions: Partial): this {\n this._options = setOptions(this._options, partialOptions);\n return this;\n }\n\n /**\n * Set a specific option for the tour\n * @param key option key\n * @param value option value\n */\n setOption(key: K, value: TourOptions[K]): this {\n this._options = setOption(this._options, key, value);\n return this;\n }\n\n /**\n * Get a specific option for the tour\n * @param key option key\n */\n getOption(key: K): TourOptions[K] {\n return this._options[key];\n }\n\n /**\n * Clone the current tour instance\n */\n clone(): ThisType {\n return new Tour(this._targetElement, this._options);\n }\n\n /**\n * Returns true if the tour instance is active\n */\n isActive(): boolean {\n if (\n this.getOption(\"dontShowAgain\") &&\n getDontShowAgain(this.getOption(\"dontShowAgainCookie\"))\n ) {\n return false;\n }\n\n return this.getOption(\"isActive\");\n }\n\n /**\n * Returns true if the tour has started\n */\n hasStarted(): boolean {\n return this.getCurrentStep() !== undefined;\n }\n\n /**\n * Set the `dontShowAgain` option for the tour so that the tour does not show twice to the same user\n * This is a persistent option that is stored in the browser's cookies\n *\n * @param dontShowAgain boolean value to set the `dontShowAgain` option\n */\n setDontShowAgain(dontShowAgain: boolean) {\n setDontShowAgain(\n dontShowAgain,\n this.getOption(\"dontShowAgainCookie\"),\n this.getOption(\"dontShowAgainCookieDays\")\n );\n return this;\n }\n\n /**\n * Enable keyboard navigation for the tour\n */\n enableKeyboardNavigation() {\n if (this.getOption(\"keyboardNavigation\")) {\n this._keyboardNavigationHandler = (e: KeyboardEvent) =>\n onKeyDown(this, e);\n DOMEvent.on(window, \"keydown\", this._keyboardNavigationHandler, true);\n }\n\n return this;\n }\n\n /**\n * Disable keyboard navigation for the tour\n */\n disableKeyboardNavigation() {\n if (this._keyboardNavigationHandler) {\n DOMEvent.off(window, \"keydown\", this._keyboardNavigationHandler, true);\n this._keyboardNavigationHandler = undefined;\n }\n\n return this;\n }\n\n /**\n * Enable refresh on window resize for the tour\n */\n enableRefreshOnResize() {\n this._refreshOnResizeHandler = (_: Event) => this.refresh();\n DOMEvent.on(window, \"resize\", this._refreshOnResizeHandler, true);\n }\n\n /**\n * Disable refresh on window resize for the tour\n */\n disableRefreshOnResize() {\n if (this._refreshOnResizeHandler) {\n DOMEvent.off(window, \"resize\", this._refreshOnResizeHandler, true);\n this._refreshOnResizeHandler = undefined;\n }\n }\n\n /**\n * Append the floating element to the target element.\n * Floating element is a helper element that is used when the step does not have a target element.\n * For internal use only.\n */\n appendFloatingElement() {\n if (!this._floatingElement) {\n this._floatingElement = FloatingElement({\n currentStep: this.getCurrentStepSignal(),\n });\n\n // only add the floating element once per tour instance\n dom.add(this.getTargetElement(), this._floatingElement);\n }\n\n return this._floatingElement;\n }\n\n /**\n * Create the root element for the tour\n */\n private createRoot() {\n if (!this._root) {\n this._root = TourRoot({ tour: this });\n dom.add(this.getTargetElement(), this._root);\n }\n }\n\n /**\n * Deletes the root element and recreates it\n */\n private recreateRoot() {\n if (this._root) {\n this._root.remove();\n this._root = undefined;\n this.createRoot();\n }\n }\n\n /**\n * Starts the tour and shows the first step\n */\n async start() {\n if (await start(this)) {\n this.createRoot();\n this.enableKeyboardNavigation();\n this.enableRefreshOnResize();\n }\n\n return this;\n }\n\n /**\n * Exit the tour\n * @param {boolean} force whether to force exit the tour\n */\n async exit(force?: boolean) {\n if (await exitIntro(this, force ?? false)) {\n this.disableKeyboardNavigation();\n this.disableRefreshOnResize();\n }\n\n return this;\n }\n\n /**\n * Refresh the tour\n * @param {boolean} refreshSteps whether to refresh the tour steps\n */\n refresh(refreshSteps?: boolean) {\n const currentStep = this.getCurrentStep();\n\n if (currentStep === undefined) {\n return this;\n }\n\n if (this._refreshesSignal.val !== undefined) {\n this._refreshesSignal.val += 1;\n }\n\n // fetch new steps and recreate the root element\n if (refreshSteps) {\n this.setSteps(fetchSteps(this));\n this.recreateRoot();\n }\n\n return this;\n }\n\n /**\n * @deprecated onbeforechange is deprecated, please use onBeforeChange instead.\n */\n onbeforechange(callback: introBeforeChangeCallback) {\n return this.onBeforeChange(callback);\n }\n\n /**\n * Add a callback to be called before the tour changes steps\n * @param {Function} callback callback function to be called\n */\n onBeforeChange(callback: introBeforeChangeCallback) {\n if (!isFunction(callback)) {\n throw new Error(\n \"Provided callback for onBeforeChange was not a function\"\n );\n }\n\n this.callbacks.beforeChange = callback;\n return this;\n }\n\n /**\n * @deprecated onchange is deprecated, please use onChange instead.\n */\n onchange(callback: introChangeCallback) {\n this.onChange(callback);\n }\n\n /**\n * Add a callback to be called when the tour changes steps\n * @param {Function} callback callback function to be called\n */\n onChange(callback: introChangeCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for onChange was not a function.\");\n }\n\n this.callbacks.change = callback;\n return this;\n }\n\n /**\n * @deprecated onafterchange is deprecated, please use onAfterChange instead.\n */\n onafterchange(callback: introAfterChangeCallback) {\n this.onAfterChange(callback);\n }\n\n /**\n * Add a callback to be called after the tour changes steps\n * @param {Function} callback callback function to be called\n */\n onAfterChange(callback: introAfterChangeCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for onAfterChange was not a function\");\n }\n\n this.callbacks.afterChange = callback;\n return this;\n }\n\n /**\n * @deprecated oncomplete is deprecated, please use onComplete instead.\n */\n oncomplete(callback: introCompleteCallback) {\n return this.onComplete(callback);\n }\n\n /**\n * Add a callback to be called when the tour is completed\n * @param {Function} callback callback function to be called\n */\n onComplete(callback: introCompleteCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for oncomplete was not a function.\");\n }\n\n this.callbacks.complete = callback;\n return this;\n }\n\n /**\n * @deprecated onstart is deprecated, please use onStart instead.\n */\n onstart(callback: introStartCallback) {\n return this.onStart(callback);\n }\n\n /**\n * Add a callback to be called when the tour is started\n * @param {Function} callback callback function to be called\n */\n onStart(callback: introStartCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for onstart was not a function.\");\n }\n\n this.callbacks.start = callback;\n return this;\n }\n\n /**\n * @deprecated onexit is deprecated, please use onExit instead.\n */\n onexit(callback: introExitCallback) {\n return this.onExit(callback);\n }\n\n /**\n * Add a callback to be called when the tour is exited\n * @param {Function} callback callback function to be called\n */\n onExit(callback: introExitCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for onexit was not a function.\");\n }\n\n this.callbacks.exit = callback;\n return this;\n }\n\n /**\n * @deprecated onskip is deprecated, please use onSkip instead.\n */\n onskip(callback: introSkipCallback) {\n return this.onSkip(callback);\n }\n\n /**\n * Add a callback to be called when the tour is skipped\n * @param {Function} callback callback function to be called\n */\n onSkip(callback: introSkipCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for onskip was not a function.\");\n }\n\n this.callbacks.skip = callback;\n return this;\n }\n\n /**\n * @deprecated onbeforeexit is deprecated, please use onBeforeExit instead.\n */\n onbeforeexit(callback: introBeforeExitCallback) {\n return this.onBeforeExit(callback);\n }\n\n /**\n * Add a callback to be called before the tour is exited\n * @param {Function} callback callback function to be called\n */\n onBeforeExit(callback: introBeforeExitCallback) {\n if (!isFunction(callback)) {\n throw new Error(\"Provided callback for onbeforeexit was not a function.\");\n }\n\n this.callbacks.beforeExit = callback;\n return this;\n }\n}\n","import { TooltipPosition } from \"../../packages/tooltip\";\nimport { TourStep, ScrollTo } from \"./steps\";\n\nexport interface TourOptions {\n steps: Partial[];\n /* Is this tour instance active? Don't show the tour again if this flag is set to false */\n isActive: boolean;\n /* Next button label in tooltip box */\n nextLabel: string;\n /* Previous button label in tooltip box */\n prevLabel: string;\n /* Skip button label in tooltip box */\n skipLabel: string;\n /* Done button label in tooltip box */\n doneLabel: string;\n /* Hide previous button in the first step? Otherwise, it will be disabled button. */\n hidePrev: boolean;\n /* Hide next button in the last step? Otherwise, it will be disabled button (note: this will also hide the \"Done\" button) */\n hideNext: boolean;\n /* Change the Next button to Done in the last step of the intro? otherwise, it will render a disabled button */\n nextToDone: boolean;\n /* Default tooltip box position */\n tooltipPosition: TooltipPosition;\n /* Next CSS class for tooltip boxes */\n tooltipClass: string;\n /* Start intro for a group of elements */\n group: string;\n /* CSS class that is added to the helperLayer */\n highlightClass: string;\n /* Close introduction when pressing Escape button? */\n exitOnEsc: boolean;\n /* Close introduction when clicking on overlay layer? */\n exitOnOverlayClick: boolean;\n /* Display the pagination detail */\n showStepNumbers: boolean;\n /* Pagination \"of\" label */\n stepNumbersOfLabel: string;\n /* Let user use keyboard to navigate the tour? */\n keyboardNavigation: boolean;\n /* Show tour control buttons? */\n showButtons: boolean;\n /* Show tour bullets? */\n showBullets: boolean;\n /* Show tour progress? */\n showProgress: boolean;\n /* Scroll to highlighted element? */\n scrollToElement: boolean;\n /*\n * Should we scroll the tooltip or target element?\n * Options are: 'element', 'tooltip' or 'off'\n */\n scrollTo: ScrollTo;\n /* Padding to add after scrolling when element is not in the viewport (in pixels) */\n scrollPadding: number;\n /* Set the overlay opacity */\n overlayOpacity: number;\n /* To determine the tooltip position automatically based on the window.width/height */\n autoPosition: boolean;\n /* Precedence of positions, when auto is enabled */\n positionPrecedence: TooltipPosition[];\n /* Disable an interaction with element? */\n disableInteraction: boolean;\n /* To display the \"Don't show again\" checkbox in the tour */\n dontShowAgain: boolean;\n dontShowAgainLabel: string;\n /* \"Don't show again\" cookie name and expiry (in days) */\n dontShowAgainCookie: string;\n dontShowAgainCookieDays: number;\n /* Set how much padding to be used around helper element */\n helperElementPadding: number;\n /* additional classes to put on the buttons */\n buttonClass: string;\n /* additional classes to put on progress bar */\n progressBarAdditionalClass: string;\n}\n\nexport function getDefaultTourOptions(): TourOptions {\n return {\n steps: [],\n isActive: true,\n nextLabel: \"Next\",\n prevLabel: \"Back\",\n skipLabel: \"×\",\n doneLabel: \"Done\",\n hidePrev: false,\n hideNext: false,\n nextToDone: true,\n tooltipPosition: \"bottom\",\n tooltipClass: \"\",\n group: \"\",\n highlightClass: \"\",\n exitOnEsc: true,\n exitOnOverlayClick: true,\n showStepNumbers: false,\n stepNumbersOfLabel: \"of\",\n keyboardNavigation: true,\n showButtons: true,\n showBullets: true,\n showProgress: false,\n scrollToElement: true,\n scrollTo: \"element\",\n scrollPadding: 30,\n overlayOpacity: 0.5,\n autoPosition: true,\n positionPrecedence: [\"bottom\", \"top\", \"right\", \"left\"],\n disableInteraction: false,\n\n dontShowAgain: false,\n dontShowAgainLabel: \"Don't show this again\",\n dontShowAgainCookie: \"introjs-dontShowAgain\",\n dontShowAgainCookieDays: 365,\n helperElementPadding: 10,\n\n buttonClass: \"introjs-button\",\n progressBarAdditionalClass: \"\",\n };\n}\n","import { version } from \"../package.json\";\nimport { Hint } from \"./packages/hint\";\nimport { Tour } from \"./packages/tour\";\n\nclass LegacyIntroJs extends Tour {\n /**\n * @deprecated introJs().addHints() is deprecated, please use introJs.hint().addHints() instead\n * @param args\n */\n addHints(..._: any[]) {\n console.error(\n \"introJs().addHints() is deprecated, please use introJs.hint.addHints() instead.\"\n );\n }\n\n /**\n * @deprecated introJs().addHint() is deprecated, please use introJs.hint.addHint() instead\n * @param args\n */\n addHint(..._: any[]) {\n console.error(\n \"introJs().addHint() is deprecated, please use introJs.hint.addHint() instead.\"\n );\n }\n\n /**\n * @deprecated introJs().removeHints() is deprecated, please use introJs.hint.hideHints() instead\n * @param args\n */\n removeHints(..._: any[]) {\n console.error(\n \"introJs().removeHints() is deprecated, please use introJs.hint.removeHints() instead.\"\n );\n }\n}\n\n/**\n * Intro.js module\n */\nconst introJs = (elementOrSelector?: string | HTMLElement) => {\n console.warn(\n \"introJs() is deprecated. Please use introJs.tour() or introJs.hint() instead.\"\n );\n return new LegacyIntroJs(elementOrSelector);\n};\n\n/**\n * Create a new Intro.js Tour instance\n * @param elementOrSelector Optional target element to start the Tour on\n */\nintroJs.tour = (elementOrSelector?: string | HTMLElement) =>\n new Tour(elementOrSelector);\n\n/**\n * Create a new Intro.js Hint instance\n * @param elementOrSelector Optional target element to start the Hint on\n */\nintroJs.hint = (elementOrSelector?: string | HTMLElement) =>\n new Hint(elementOrSelector);\n\n/**\n * Current Intro.js version\n */\nintroJs.version = version;\n\nexport default introJs;\n"],"names":["cloneObject","source","_typeof","temp","key","window","jQuery","queryElement","selector","container","document","querySelector","queryElements","querySelectorAll","dataHintAttribute","dataStepAttribute","dataHintPositionAttribute","fetchHintItems","hint","setHints","targetElement","getTargetElement","hints","getOption","length","_step","_iterator","_createForOfIteratorHelper","s","n","done","hintItem","value","element","hintPosition","hintAnimation","addHint","err","e","f","elements","Array","from","concat","_i","_elements","hintAnimationAttr","getAttribute","tooltipClass","undefined","position","setOption","options","setOptions","partialOptions","_Object$entries","Object","entries","_Object$entries$_i","_slicedToArray","isFunction","x","changedStates","derivedStates","curDeps","curNewDerives","forGarbageCollection","_undefined","DOMEvent$1","DOMEvent","_classCallCheck","_createClass","obj","type","listener","useCapture","addEventListener","attachEvent","removeEventListener","detachEvent","getContainerElement","elementOrSelector","Error","getElement","body","hideHint","_x","_x2","_hideHint","apply","this","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_hint$callback","isActiveSignal","wrap","_context","prev","next","isActive","val","hideHintDialog","callback","call","stop","hideHints","_x3","_hideHints","_callee2","_context2","getHints","t0","finish","showHints","_showHints","isRendered","showHint","render","activeSignal","_object","_document","protoOf","getPrototypeOf","alwaysConnectedDom","isConnected","propSetterCache","objProto","funcProto","Function","prototype","addAndScheduleOnFirst","set","state","fn","waitMs","setTimeout","Set","add","runAndCaptureDependencies","deps","arg","prevDeps","console","error","keepConnected","l","filter","b","_b$_dom","_dom","addForGarbageCollection","discard","_bindings","_listeners","stateProto","_curDeps","_getters","rawVal","oldVal","_curDeps2","_oldVal","v","_curDeps3","_derivedStates","_setters","updateDoms","statePropertyDescriptor","writable","configurable","enumerable","initVal","create","bind","dom","_newDom","binding","prevNewDerives","newDom","nodeType","Text","_step2","_iterator2","d","has","push","_step3","_iterator3","derive","_s","_ref","_curNewDerives","_step4","_iterator4","_len","children","_key","_step5","_iterator5","flat","Infinity","_loop","c","protoOfC","child","append","tag","ns","name","_args$","_len2","args","_key2","_step6","_ref2","_ref3","_toArray","props","slice","createElementNS","createElement","_iterator6","_loop2","_propSetterCache$cach","_getDesc$set","_getDesc","_v","_step6$value","k","cacheKey","propSetter","getDesc","proto","_object$getOwnPropert","getOwnPropertyDescriptor","setter","startsWith","oldV","event","setAttribute","protoOfV","_toConsumableArray","proxyHandler","namespace","get","_","tags","Proxy","update","replaceWith","remove","iter","derivedStatesArray","_step7","_iterator7","flatMap","changedStatesArray","_step8","_iterator8","_step9","_iterator9","hydrate","updateFn","hintsClassName","getPropValue","propName","propValue","currentStyle","defaultView","getComputedStyle","getPropertyValue","toLowerCase","isFixed","parent","parentElement","nodeName","getOffset","relativeEl","docEl","documentElement","scrollTop","pageYOffset","scrollLeft","pageXOffset","getBoundingClientRect","xr","relativeElPosition","top","left","_objectSpread","tagName","assign","width","height","bottom","right","absoluteTop","absoluteLeft","absoluteBottom","absoluteRight","_dom$tags","a","div","HintIcon","_a","index","onClick","refreshesSignal","hintElement","_defineProperty","toString","_hintItem$isActive","classNames","join","className","offset","iconWidth","iconHeight","style","alignHintPosition","addClass","_classNames","SVGElement","pre","match","setClass","classList","Boolean","removeClass","classNameRegex","replace","trim","cssText","rule","setPositionRelativeTo","relativeElement","padding","styles","Element","getPositionRelativeTo","setStyle","getWinSize","innerWidth","innerHeight","D","clientWidth","clientHeight","skipButtonClassName","previousButtonClassName","doneButtonClassName","dontShowAgainClassName","disabledButtonClassName","fullButtonClassName","removeEntry","stringArray","stringToRemove","includes","splice","indexOf","determineAutoPosition","positionPrecedence","targetOffset","tooltipWidth","tooltipHeight","desiredTooltipPosition","windowSize","possiblePositions","calculatedPosition","split","defaultAlignment","desiredAlignment","offsetLeft","windowWidth","halfTooltipWidth","winWidth","Math","min","screen","determineAutoAlignment","checkLeft","tooltipLayerStyleRight","tooltipLeft","tooltipRight","checkRight","tooltipLayerStyleLeft","Tooltip","initialPosition","refreshes","_ref$hintMode","hintMode","_ref$showStepNumbers","showStepNumbers","_ref$transitionDurati","transitionDuration","_ref$autoPosition","autoPosition","_ref$positionPreceden","marginLeft","marginTop","opacity","getWindowSize","tooltipBottomOverflow","tooltipTop","tooltipBottom","tooltipMarginLeft","tooltipMarginTop","tooltipLayerStyleLeftRight","alignTooltip","tooltip","role","onclick","tooltipPosition","_classNames$val","offsetHeight","offsetWidth","p","ReferenceLayer","activeHintSignal","helperElementPadding","_objectWithoutProperties","_excluded","initialActiveHintSignal","_div","referenceLayer","closeButtonEnabled","closeButtonOnClick","closeButtonLabel","closeButtonClassName","hintTooltipElement","stopPropagation","cancelBubble","HintTooltip","getHintClick","i","evt","showHintDialog","Hint","_targetElement","_options","hintButtonLabel","hintShowButton","hintAutoRefreshInterval","buttonClass","_showHintDialog","_showHints2","_hideHints2","_hideHint2","_addHints","_render","callbackName","callbacks","_hints","stepId","_activeHintSignal","_refreshesSignal","_root","hintElements","_step$value","getRefreshesSignal","root","getActiveHintSignal","HintsRoot","createRoot","_this$callback","abrupt","enableHintAutoRefresh","enableCloseDialogOnWindowClick","_this","_windowClickFunction","on","off","_callee3","_context3","getHint","_callee4","_context4","_callee5","_context5","disableHintAutoRefresh","disableCloseDialogOnWindowClick","destroy","recreateRoot","_callee6","item","_this$callback2","_context6","func","timeout","timer","_this2","_hintsAutoRefreshFunction","refresh","clearTimeout","providedCallback","hintsAdded","onHintsAdded","hintClick","onHintClick","hintClose","onHintClose","dataStepNumberAttribute","dataIntroAttribute","dataDisableInteraction","setShowElement","currentElementPosition","showElement","_showElement","tour","step","_tour$callback","_tour$callback2","removeShowElement","_elms","elm","nextStep","_nextStep","currentStep","incrementCurrentStep","getCurrentStep","getStep","getDirection","sent","decrementCurrentStep","isEnd","exit","previousStep","_previousStep","_tour$callback3","fetchSteps","_tour$getOption","steps","title","appendFloatingElement","scrollTo","disableInteraction","itemsWithoutStep","display","stepIndex","parseInt","hasAttribute","newIntroStep","intro","highlightClass","newStep","shift","sort","start","hasStarted","setSteps","exitIntro","_exitIntro","force","continueExit","_args","resetCurrentStep","setCookie","days","_cookie","cookie","date","Date","setTime","getTime","expires","toUTCString","arr","getCookie","forEach","el","_el$split2","dontShowAgainCookieValue","setDontShowAgain","dontShowAgain","cookieName","cookieDays","_onKeyDown","code","target","which","charCode","keyCode","srcElement","click","preventDefault","returnValue","setPositionRelativeToStep","scrollParentToElement","scrollToElement","excludeStaticParent","overflowRegex","test","overflow","overflowY","overflowX","getScrollParent","offsetTop","scrollPadding","tooltipLayer","rect","elementInViewport","winHeight","scrollBy","h1","input","label","ul","li","Button","_ref6","disabled","tabIndex","ariaDisabled","Buttons","_ref9","nextToDone","doneLabel","hideNext","nextLabel","onNextClick","hidePrev","prevLabel","onPrevClick","_ref8","isFirstStep","isDisabled","isHidden","isFullButton","PrevButton","_ref7","isLastStep","isDoneButton","nextButton","focus","NextButton","TourTooltip","_ref12","onBulletClick","bullets","buttons","skipLabel","onSkipClick","progress","progressBarAdditionalClass","stepNumbers","stepNumbersOfLabel","onDontShowAgainChange","dontShowAgainLabel","text","_ref10","Header","id","onchange","checked","for","DontShowAgain","map","stepNumber","stepNumberAttribute","innerHTML","Bullets","_ref4","ProgressBar","_ref5","StepNumber","_ref11","scroll","TourRoot","currentStepSignal","getCurrentStepSignal","getSteps","helperLayer","tourHighlightClass","overlayOpacity","helperLayerPadding","getClassName","HelperLayer","tooltipTransitionDuration","_onExitTour","_onSkipClick","_onPrevClick","_onNextClick","overlayLayer","exitOnOverlayClick","onExitTour","cursor","OverlayLayer","goToStep","RegExp","DisableInteraction","Tour","group","exitOnEsc","keyboardNavigation","showButtons","showBullets","showProgress","dontShowAgainCookie","dontShowAgainCookieDays","_exit","_start2","_previousStep2","_nextStep2","_goToStepNumber","_goToStep","setCurrentStep","_steps","addStep","_currentStepSignal","_direction","dontShowCookie","_keyboardNavigationHandler","onKeyDown","_refreshOnResizeHandler","floatingElement","_floatingElement","enableKeyboardNavigation","enableRefreshOnResize","disableKeyboardNavigation","disableRefreshOnResize","refreshSteps","onBeforeChange","beforeChange","onChange","change","onAfterChange","afterChange","onComplete","complete","onStart","onExit","onSkip","skip","onBeforeExit","beforeExit","LegacyIntroJs","_T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