Your IP : 216.73.216.95


Current Path : /var/www/ljmtc/cbt/admin/tool/usertours/amd/build/
Upload File :
Current File : /var/www/ljmtc/cbt/admin/tool/usertours/amd/build/tour.min.js.map

{"version":3,"sources":["../src/tour.js"],"names":["Tour","config","init","eventHandlers","reset","originalConfiguration","configure","apply","arguments","storage","window","sessionStorage","storageKey","tourName","e","hide","resetStepListeners","steps","currentStepNumber","eventName","forEach","handler","addEventHandler","resetStepDefaults","template","templateContent","checkMinimumRequirements","Error","length","loadOriginalConfiguration","stepDefaults","setStepDefaults","$","extend","element","placement","delay","moveOnClick","moveAfterTime","orphan","direction","parseInt","stepNumber","setItem","code","DOMException","QUOTA_EXCEEDED_ERR","removeItem","getCurrentStepNumber","nextStepNumber","isStepPotentiallyVisible","getStepConfig","previousStepNumber","getNextStepNumber","getPreviousStepNumber","stepConfig","isStepActuallyVisible","target","getStepTarget","is","gotoStep","endTour","_gotoStep","delayed","setTimeout","bind","fn","fireEventHandlers","renderStep","normalizeStepConfig","reflex","moveAfterClick","content","body","attachTo","attachPoint","first","data","thisEvent","call","push","listeners","node","currentStepNode","args","proxy","next","previous","handleKeyDown","targetNode","parents","listener","on","off","currentStepConfig","setCurrentStepNumber","getTemplateContent","find","html","title","isFirstStep","prop","isLastStep","removeClass","addClass","attr","addStepToPage","processStepListeners","clone","animationTarget","stop","zIndex","calculateZIndex","css","positionBackdrop","document","append","top","left","animate","scrollTop","calculateScrollTop","promise","then","positionStep","revealStep","catch","isOrphan","offset","calculateStepPositionInPage","currentStepPopper","Popper","removeOnDestroy","arrowElement","modifiers","enabled","applyStyle","onLoad","fadeIn","announceStep","focus","stepId","bodyRegion","headerRegion","accessibilityShow","tabbableSelector","keyCode","hasBackdrop","activeElement","stepTarget","tabbableNodes","dialogContainer","currentIndex","filter","index","has","each","nextIndex","nextNode","focusRelevant","shiftKey","closest","last","preventDefault","startAt","storageStartValue","getItem","storageStartAt","startTour","previousTarget","transition","destroy","fadeTime","remove","removeAttr","fadeOut","currentStepElement","accessibilityHide","viewportHeight","height","Math","max","min","ceil","stepHeight","viewportWidth","width","stepWidth","flipBehavior","flip","behaviour","arrow","onCreate","recalculateArrowPosition","onUpdate","split","isVertical","indexOf","instance","popper","querySelector","stepElement","arrowHeight","parseFloat","getComputedStyle","arrowOffset","popperHeight","popperOffset","popperBorderWidth","popperBorderRadiusWidth","arrowPos","maxPos","minPos","newArrowPos","arrowWidth","popperWidth","background","backdrop","insertAfter","buffer","colorNode","outerWidth","outerHeight","backgroundColor","calculateInherittedBackgroundColor","targetRadius","targetPosition","calculatePosition","fader","opacity","elem","position","value","isNaN","parent","fakeNode","fakeElemColor","color","hideFunction","child","flexitourRole","hidden","Aria","siblings","parentsUntil","showFunction","unhide"],"mappings":"8KAsBA,OACA,OACA,O,kqCAOqBA,CAAAA,C,YAIjB,WAAYC,CAAZ,CAAoB,WAChB,KAAKC,IAAL,CAAUD,CAAV,CACH,C,qCAUIA,C,CAAQ,CAET,KAAKE,aAAL,CAAqB,EAArB,CAGA,KAAKC,KAAL,GAGA,KAAKC,qBAAL,CAA6BJ,CAAM,EAAI,EAAvC,CAGA,KAAKK,SAAL,CAAeC,KAAf,CAAqB,IAArB,CAA2BC,SAA3B,EAEA,GAAI,CACA,KAAKC,OAAL,CAAeC,MAAM,CAACC,cAAtB,CACA,KAAKC,UAAL,CAAkB,aAAe,KAAKC,QACzC,CAAC,MAAOC,CAAP,CAAU,CACR,KAAKL,OAAL,IACA,KAAKG,UAAL,CAAkB,EACrB,CAED,MAAO,KACV,C,qCASO,CAEJ,KAAKG,IAAL,GAGA,KAAKZ,aAAL,CAAqB,EAArB,CAGA,KAAKa,kBAAL,GAGA,KAAKX,qBAAL,CAA6B,EAA7B,CAGA,KAAKY,KAAL,CAAa,EAAb,CAGA,KAAKC,iBAAL,CAAyB,CAAzB,CAEA,MAAO,KACV,C,4CAUSjB,C,CAAQ,YACd,GAAsB,QAAlB,KAAOA,CAAP,CAAJ,CAAgC,CAE5B,GAA+B,WAA3B,QAA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CAAY,CAAG,SAASC,CAAT,CAAgB,CAC/B,GAAIC,CAAAA,CAAa,CAAGD,CAAK,CAAClK,IAAN,CAAW,WAAX,CAApB,CACA,GAAImK,CAAJ,CAAmB,CACf,OAAQA,CAAR,EACI,IAAK,WAAL,CACA,IAAK,QAAL,CACI,OAHR,CAKH,CAED,GAAIC,CAAAA,CAAM,CAAGF,CAAK,CAACtI,IAAN,CAXF,aAWE,CAAb,CACA,GAAI,CAACwI,CAAL,CAAa,CACTF,CAAK,CAACtI,IAAN,uBACAyI,CAAI,CAACnO,IAAL,CAAUgO,CAAV,CACH,CACJ,CAlBe,CAoBhB,KAAK5J,eAAL,CAAqBgK,QAArB,GAAgCvF,IAAhC,CAAqC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CACvD4J,CAAY,CAAC,cAAE5J,CAAF,CAAD,CACf,CAFD,EAGA,KAAKC,eAAL,CAAqBiK,YAArB,CAAkC,MAAlC,EAA0CD,QAA1C,GAAqDvF,IAArD,CAA0D,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAC5E4J,CAAY,CAAC,cAAE5J,CAAF,CAAD,CACf,CAFD,CAGH,C,6DASmB,IAEZmK,CAAAA,CAAY,CAAG,SAASN,CAAT,CAAgB,CAC/B,GAAIE,CAAAA,CAAM,CAAGF,CAAK,CAACtI,IAAN,mBAAb,CACA,GAAsB,WAAlB,QAAOwI,CAAAA,CAAX,CAAmC,CAC/BF,CAAK,CAACjE,UAAN,oBACAoE,CAAI,CAACI,MAAL,CAAYP,CAAZ,CACH,CACJ,CARe,CAUhB,mCAA2BnF,IAA3B,CAAgC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAClDmK,CAAY,CAAC,cAAEnK,CAAF,CAAD,CACf,CAFD,CAGH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Manage user tours in Moodle.\n *\n * @copyright  2018 Andrew Nicols <andrew@nicols.co.uk>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport * as Aria from 'core/aria';\nimport Popper from 'core/popper';\n\n/**\n * A Tour.\n *\n * @class Tour\n */\nexport default class Tour {\n    /**\n     * @param   {object}    config  The configuration object.\n     */\n    constructor(config) {\n        this.init(config);\n    }\n\n    /**\n     * Initialise the tour.\n     *\n     * @method  init\n     * @param   {Object}    config  The configuration object.\n     * @chainable\n     * @return {Object} this.\n     */\n    init(config) {\n        // Unset all handlers.\n        this.eventHandlers = {};\n\n        // Reset the current tour states.\n        this.reset();\n\n        // Store the initial configuration.\n        this.originalConfiguration = config || {};\n\n        // Apply configuration.\n        this.configure.apply(this, arguments);\n\n        try {\n            this.storage = window.sessionStorage;\n            this.storageKey = 'tourstate_' + this.tourName;\n        } catch (e) {\n            this.storage = false;\n            this.storageKey = '';\n        }\n\n        return this;\n    }\n\n    /**\n     * Reset the current tour state.\n     *\n     * @method  reset\n     * @chainable\n     * @return {Object} this.\n     */\n    reset() {\n        // Hide the current step.\n        this.hide();\n\n        // Unset all handlers.\n        this.eventHandlers = [];\n\n        // Unset all listeners.\n        this.resetStepListeners();\n\n        // Unset the original configuration.\n        this.originalConfiguration = {};\n\n        // Reset the current step number and list of steps.\n        this.steps = [];\n\n        // Reset the current step number.\n        this.currentStepNumber = 0;\n\n        return this;\n    }\n\n    /**\n     * Prepare tour configuration.\n     *\n     * @method  configure\n     * @param {Object} config The configuration object.\n     * @chainable\n     * @return {Object} this.\n     */\n    configure(config) {\n        if (typeof config === 'object') {\n            // Tour name.\n            if (typeof config.tourName !== 'undefined') {\n                this.tourName = config.tourName;\n            }\n\n            // Set up eventHandlers.\n            if (config.eventHandlers) {\n                for (let eventName in config.eventHandlers) {\n                    config.eventHandlers[eventName].forEach(function(handler) {\n                        this.addEventHandler(eventName, handler);\n                    }, this);\n                }\n            }\n\n            // Reset the step configuration.\n            this.resetStepDefaults(true);\n\n            // Configure the steps.\n            if (typeof config.steps === 'object') {\n                this.steps = config.steps;\n            }\n\n            if (typeof config.template !== 'undefined') {\n                this.templateContent = config.template;\n            }\n        }\n\n        // Check that we have enough to start the tour.\n        this.checkMinimumRequirements();\n\n        return this;\n    }\n\n    /**\n     * Check that the configuration meets the minimum requirements.\n     *\n     * @method  checkMinimumRequirements\n     */\n    checkMinimumRequirements() {\n        // Need a tourName.\n        if (!this.tourName) {\n            throw new Error(\"Tour Name required\");\n        }\n\n        // Need a minimum of one step.\n        if (!this.steps || !this.steps.length) {\n            throw new Error(\"Steps must be specified\");\n        }\n    }\n\n    /**\n     * Reset step default configuration.\n     *\n     * @method  resetStepDefaults\n     * @param   {Boolean}   loadOriginalConfiguration   Whether to load the original configuration supplied with the Tour.\n     * @chainable\n     * @return {Object} this.\n     */\n    resetStepDefaults(loadOriginalConfiguration) {\n        if (typeof loadOriginalConfiguration === 'undefined') {\n            loadOriginalConfiguration = true;\n        }\n\n        this.stepDefaults = {};\n        if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {\n            this.setStepDefaults({});\n        } else {\n            this.setStepDefaults(this.originalConfiguration.stepDefaults);\n        }\n\n        return this;\n    }\n\n    /**\n     * Set the step defaults.\n     *\n     * @method  setStepDefaults\n     * @param   {Object}    stepDefaults                The step defaults to apply to all steps\n     * @chainable\n     * @return {Object} this.\n     */\n    setStepDefaults(stepDefaults) {\n        if (!this.stepDefaults) {\n            this.stepDefaults = {};\n        }\n        $.extend(\n            this.stepDefaults,\n            {\n                element:        '',\n                placement:      'top',\n                delay:          0,\n                moveOnClick:    false,\n                moveAfterTime:  0,\n                orphan:         false,\n                direction:      1,\n            },\n            stepDefaults\n        );\n\n        return this;\n    }\n\n    /**\n     * Retrieve the current step number.\n     *\n     * @method  getCurrentStepNumber\n     * @return  {Integer}                   The current step number\n     */\n    getCurrentStepNumber() {\n        return parseInt(this.currentStepNumber, 10);\n    }\n\n    /**\n     * Store the current step number.\n     *\n     * @method  setCurrentStepNumber\n     * @param   {Integer}   stepNumber      The current step number\n     * @chainable\n     */\n    setCurrentStepNumber(stepNumber) {\n        this.currentStepNumber = stepNumber;\n        if (this.storage) {\n            try {\n                this.storage.setItem(this.storageKey, stepNumber);\n            } catch (e) {\n                if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {\n                    this.storage.removeItem(this.storageKey);\n                }\n            }\n        }\n    }\n\n    /**\n     * Get the next step number after the currently displayed step.\n     *\n     * @method  getNextStepNumber\n     * @param   {Integer}   stepNumber      The current step number\n     * @return  {Integer}    The next step number to display\n     */\n    getNextStepNumber(stepNumber) {\n        if (typeof stepNumber === 'undefined') {\n            stepNumber = this.getCurrentStepNumber();\n        }\n        let nextStepNumber = stepNumber + 1;\n\n        // Keep checking the remaining steps.\n        while (nextStepNumber <= this.steps.length) {\n            if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {\n                return nextStepNumber;\n            }\n            nextStepNumber++;\n        }\n\n        return null;\n    }\n\n    /**\n     * Get the previous step number before the currently displayed step.\n     *\n     * @method  getPreviousStepNumber\n     * @param   {Integer}   stepNumber      The current step number\n     * @return  {Integer}    The previous step number to display\n     */\n    getPreviousStepNumber(stepNumber) {\n        if (typeof stepNumber === 'undefined') {\n            stepNumber = this.getCurrentStepNumber();\n        }\n        let previousStepNumber = stepNumber - 1;\n\n        // Keep checking the remaining steps.\n        while (previousStepNumber >= 0) {\n            if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {\n                return previousStepNumber;\n            }\n            previousStepNumber--;\n        }\n\n        return null;\n    }\n\n    /**\n     * Is the step the final step number?\n     *\n     * @method  isLastStep\n     * @param   {Integer}   stepNumber  Step number to test\n     * @return  {Boolean}               Whether the step is the final step\n     */\n    isLastStep(stepNumber) {\n        let nextStepNumber = this.getNextStepNumber(stepNumber);\n\n        return nextStepNumber === null;\n    }\n\n    /**\n     * Is the step the first step number?\n     *\n     * @method  isFirstStep\n     * @param   {Integer}   stepNumber  Step number to test\n     * @return  {Boolean}               Whether the step is the first step\n     */\n    isFirstStep(stepNumber) {\n        let previousStepNumber = this.getPreviousStepNumber(stepNumber);\n\n        return previousStepNumber === null;\n    }\n\n    /**\n     * Is this step potentially visible?\n     *\n     * @method  isStepPotentiallyVisible\n     * @param   {Object}    stepConfig      The step configuration to normalise\n     * @return  {Boolean}               Whether the step is the potentially visible\n     */\n    isStepPotentiallyVisible(stepConfig) {\n        if (!stepConfig) {\n            // Without step config, there can be no step.\n            return false;\n        }\n\n        if (this.isStepActuallyVisible(stepConfig)) {\n            // If it is actually visible, it is already potentially visible.\n            return true;\n        }\n\n        if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {\n            // Orphan steps have no target. They are always visible.\n            return true;\n        }\n\n        if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {\n            // Only return true if the activated has not been used yet.\n            return true;\n        }\n\n        // Not theoretically, or actually visible.\n        return false;\n    }\n\n    /**\n     * Is this step actually visible?\n     *\n     * @method  isStepActuallyVisible\n     * @param   {Object}    stepConfig      The step configuration to normalise\n     * @return  {Boolean}               Whether the step is actually visible\n     */\n    isStepActuallyVisible(stepConfig) {\n        if (!stepConfig) {\n            // Without step config, there can be no step.\n            return false;\n        }\n\n        let target = this.getStepTarget(stepConfig);\n        if (target && target.length && target.is(':visible')) {\n            // Without a target, there can be no step.\n            return !!target.length;\n        }\n\n        return false;\n    }\n\n    /**\n     * Go to the next step in the tour.\n     *\n     * @method  next\n     * @chainable\n     * @return {Object} this.\n     */\n    next() {\n        return this.gotoStep(this.getNextStepNumber());\n    }\n\n    /**\n     * Go to the previous step in the tour.\n     *\n     * @method  previous\n     * @chainable\n     * @return {Object} this.\n     */\n    previous() {\n        return this.gotoStep(this.getPreviousStepNumber(), -1);\n    }\n\n    /**\n     * Go to the specified step in the tour.\n     *\n     * @method  gotoStep\n     * @param   {Integer}   stepNumber     The step number to display\n     * @param   {Integer}   direction      Next or previous step\n     * @chainable\n     * @return {Object} this.\n     */\n    gotoStep(stepNumber, direction) {\n        if (stepNumber < 0) {\n            return this.endTour();\n        }\n\n        let stepConfig = this.getStepConfig(stepNumber);\n        if (stepConfig === null) {\n            return this.endTour();\n        }\n\n        return this._gotoStep(stepConfig, direction);\n    }\n\n    _gotoStep(stepConfig, direction) {\n        if (!stepConfig) {\n            return this.endTour();\n        }\n\n        if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {\n            stepConfig.delayed = true;\n            window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);\n\n            return this;\n        } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {\n            let fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';\n            return this.gotoStep(this[fn](stepConfig.stepNumber), direction);\n        }\n\n        this.hide();\n\n        this.fireEventHandlers('beforeRender', stepConfig);\n        this.renderStep(stepConfig);\n        this.fireEventHandlers('afterRender', stepConfig);\n\n        return this;\n    }\n\n    /**\n     * Fetch the normalised step configuration for the specified step number.\n     *\n     * @method  getStepConfig\n     * @param   {Integer}   stepNumber      The step number to fetch configuration for\n     * @return  {Object}                    The step configuration\n     */\n    getStepConfig(stepNumber) {\n        if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {\n            return null;\n        }\n\n        // Normalise the step configuration.\n        let stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);\n\n        // Add the stepNumber to the stepConfig.\n        stepConfig = $.extend(stepConfig, {stepNumber: stepNumber});\n\n        return stepConfig;\n    }\n\n    /**\n     * Normalise the supplied step configuration.\n     *\n     * @method  normalizeStepConfig\n     * @param   {Object}    stepConfig      The step configuration to normalise\n     * @return  {Object}                    The normalised step configuration\n     */\n    normalizeStepConfig(stepConfig) {\n\n        if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {\n            stepConfig.moveAfterClick = stepConfig.reflex;\n        }\n\n        if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {\n            stepConfig.target = stepConfig.element;\n        }\n\n        if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {\n            stepConfig.body = stepConfig.content;\n        }\n\n        stepConfig = $.extend({}, this.stepDefaults, stepConfig);\n\n        stepConfig = $.extend({}, {\n            attachTo: stepConfig.target,\n            attachPoint: 'after',\n        }, stepConfig);\n\n        if (stepConfig.attachTo) {\n            stepConfig.attachTo = $(stepConfig.attachTo).first();\n        }\n\n        return stepConfig;\n    }\n\n    /**\n     * Fetch the actual step target from the selector.\n     *\n     * This should not be called until after any delay has completed.\n     *\n     * @method  getStepTarget\n     * @param   {Object}    stepConfig      The step configuration\n     * @return  {$}\n     */\n    getStepTarget(stepConfig) {\n        if (stepConfig.target) {\n            return $(stepConfig.target);\n        }\n\n        return null;\n    }\n\n    /**\n     * Fire any event handlers for the specified event.\n     *\n     * @param   {String}    eventName       The name of the event to handle\n     * @param   {Object}    data            Any data to pass to the event\n     * @chainable\n     * @return {Object} this.\n     */\n    fireEventHandlers(eventName, data) {\n        if (typeof this.eventHandlers[eventName] === 'undefined') {\n            return this;\n        }\n\n        this.eventHandlers[eventName].forEach(function(thisEvent) {\n            thisEvent.call(this, data);\n        }, this);\n\n        return this;\n    }\n\n    /**\n     * @method addEventHandler\n     * @param  {string}      eventName       The name of the event to listen for\n     * @param  {function}    handler         The event handler to call\n     * @return {Object} this.\n     */\n    addEventHandler(eventName, handler) {\n        if (typeof this.eventHandlers[eventName] === 'undefined') {\n            this.eventHandlers[eventName] = [];\n        }\n\n        this.eventHandlers[eventName].push(handler);\n\n        return this;\n    }\n\n    /**\n     * Process listeners for the step being shown.\n     *\n     * @method  processStepListeners\n     * @param   {object}    stepConfig      The configuration for the step\n     * @chainable\n     * @return {Object} this.\n     */\n    processStepListeners(stepConfig) {\n        this.listeners.push(\n        // Next/Previous buttons.\n        {\n            node: this.currentStepNode,\n            args: ['click', '[data-role=\"next\"]', $.proxy(this.next, this)]\n        }, {\n            node: this.currentStepNode,\n            args: ['click', '[data-role=\"previous\"]', $.proxy(this.previous, this)]\n        },\n\n        // Close and end tour buttons.\n        {\n            node: this.currentStepNode,\n            args: ['click', '[data-role=\"end\"]', $.proxy(this.endTour, this)]\n        },\n\n        // Click backdrop and hide tour.\n        {\n            node: $('[data-flexitour=\"backdrop\"]'),\n            args: ['click', $.proxy(this.hide, this)]\n        },\n\n        // Keypresses.\n        {\n            node: $('body'),\n            args: ['keydown', $.proxy(this.handleKeyDown, this)]\n        });\n\n        if (stepConfig.moveOnClick) {\n            var targetNode = this.getStepTarget(stepConfig);\n            this.listeners.push({\n                node: targetNode,\n                args: ['click', $.proxy(function(e) {\n                    if ($(e.target).parents('[data-flexitour=\"container\"]').length === 0) {\n                        // Ignore clicks when they are in the flexitour.\n                        window.setTimeout($.proxy(this.next, this), 500);\n                    }\n                }, this)]\n            });\n        }\n\n        this.listeners.forEach(function(listener) {\n            listener.node.on.apply(listener.node, listener.args);\n        });\n\n        return this;\n    }\n\n    /**\n     * Reset step listeners.\n     *\n     * @method  resetStepListeners\n     * @chainable\n     * @return {Object} this.\n     */\n    resetStepListeners() {\n        // Stop listening to all external handlers.\n        if (this.listeners) {\n            this.listeners.forEach(function(listener) {\n                listener.node.off.apply(listener.node, listener.args);\n            });\n        }\n        this.listeners = [];\n\n        return this;\n    }\n\n    /**\n     * The standard step renderer.\n     *\n     * @method  renderStep\n     * @param   {Object}    stepConfig      The step configuration of the step\n     * @chainable\n     * @return {Object} this.\n     */\n    renderStep(stepConfig) {\n        // Store the current step configuration for later.\n        this.currentStepConfig = stepConfig;\n        this.setCurrentStepNumber(stepConfig.stepNumber);\n\n        // Fetch the template and convert it to a $ object.\n        let template = $(this.getTemplateContent());\n\n        // Title.\n        template.find('[data-placeholder=\"title\"]')\n            .html(stepConfig.title);\n\n        // Body.\n        template.find('[data-placeholder=\"body\"]')\n            .html(stepConfig.body);\n\n        // Is this the first step?\n        if (this.isFirstStep(stepConfig.stepNumber)) {\n            template.find('[data-role=\"previous\"]').hide();\n        } else {\n            template.find('[data-role=\"previous\"]').prop('disabled', false);\n        }\n\n        // Is this the final step?\n        if (this.isLastStep(stepConfig.stepNumber)) {\n            template.find('[data-role=\"next\"]').hide();\n            template.find('[data-role=\"end\"]').removeClass(\"btn-secondary\").addClass(\"btn-primary\");\n        } else {\n            template.find('[data-role=\"next\"]').prop('disabled', false);\n        }\n\n        template.find('[data-role=\"previous\"]').attr('role', 'button');\n        template.find('[data-role=\"next\"]').attr('role', 'button');\n        template.find('[data-role=\"end\"]').attr('role', 'button');\n\n        // Replace the template with the updated version.\n        stepConfig.template = template;\n\n        // Add to the page.\n        this.addStepToPage(stepConfig);\n\n        // Process step listeners after adding to the page.\n        // This uses the currentNode.\n        this.processStepListeners(stepConfig);\n\n        return this;\n    }\n\n    /**\n     * Getter for the template content.\n     *\n     * @method  getTemplateContent\n     * @return  {$}\n     */\n    getTemplateContent() {\n        return $(this.templateContent).clone();\n    }\n\n    /**\n     * Helper to add a step to the page.\n     *\n     * @method  addStepToPage\n     * @param   {Object}    stepConfig      The step configuration of the step\n     * @chainable\n     * @return {Object} this.\n     */\n    addStepToPage(stepConfig) {\n        // Create the stepNode from the template data.\n        let currentStepNode = $('<span data-flexitour=\"container\"></span>')\n            .html(stepConfig.template)\n            .hide();\n\n        // The scroll animation occurs on the body or html.\n        let animationTarget = $('body, html')\n            .stop(true, true);\n\n        if (this.isStepActuallyVisible(stepConfig)) {\n            let targetNode = this.getStepTarget(stepConfig);\n\n            targetNode.data('flexitour', 'target');\n\n            let zIndex = this.calculateZIndex(targetNode);\n            if (zIndex) {\n                stepConfig.zIndex = zIndex + 1;\n            }\n\n            if (stepConfig.zIndex) {\n                currentStepNode.css('zIndex', stepConfig.zIndex + 1);\n            }\n\n            // Add the backdrop.\n            this.positionBackdrop(stepConfig);\n\n            $(document.body).append(currentStepNode);\n            this.currentStepNode = currentStepNode;\n\n            // Ensure that the step node is positioned.\n            // Some situations mean that the value is not properly calculated without this step.\n            this.currentStepNode.css({\n                top: 0,\n                left: 0,\n            });\n\n            animationTarget\n                .animate({\n                    scrollTop: this.calculateScrollTop(stepConfig),\n                }).promise().then(function() {\n                        this.positionStep(stepConfig);\n                        this.revealStep(stepConfig);\n                        return;\n                    }.bind(this))\n                    .catch(function() {\n                        // Silently fail.\n                    });\n\n        } else if (stepConfig.orphan) {\n            stepConfig.isOrphan = true;\n\n            // This will be appended to the body instead.\n            stepConfig.attachTo = $('body').first();\n            stepConfig.attachPoint = 'append';\n\n            // Add the backdrop.\n            this.positionBackdrop(stepConfig);\n\n            // This is an orphaned step.\n            currentStepNode.addClass('orphan');\n\n            // It lives in the body.\n            $(document.body).append(currentStepNode);\n            this.currentStepNode = currentStepNode;\n\n            this.currentStepNode.offset(this.calculateStepPositionInPage());\n            this.currentStepNode.css('position', 'fixed');\n\n            this.currentStepPopper = new Popper(\n                $('body'),\n                this.currentStepNode[0], {\n                    removeOnDestroy: true,\n                    placement: stepConfig.placement + '-start',\n                    arrowElement: '[data-role=\"arrow\"]',\n                    // Empty the modifiers. We've already placed the step and don't want it moved.\n                    modifiers: {\n                        hide: {\n                            enabled: false,\n                        },\n                        applyStyle: {\n                            onLoad: null,\n                            enabled: false,\n                        },\n                    }\n                }\n            );\n\n            this.revealStep(stepConfig);\n        }\n\n        return this;\n    }\n\n    /**\n     * Make the given step visible.\n     *\n     * @method revealStep\n     * @param {Object} stepConfig The step configuration of the step\n     * @chainable\n     * @return {Object} this.\n     */\n    revealStep(stepConfig) {\n        // Fade the step in.\n        this.currentStepNode.fadeIn('', $.proxy(function() {\n                // Announce via ARIA.\n                this.announceStep(stepConfig);\n\n                // Focus on the current step Node.\n                this.currentStepNode.focus();\n                window.setTimeout($.proxy(function() {\n                    // After a brief delay, focus again.\n                    // There seems to be an issue with Jaws where it only reads the dialogue title initially.\n                    // This second focus helps it to read the full dialogue.\n                    if (this.currentStepNode) {\n                        this.currentStepNode.focus();\n                    }\n                }, this), 100);\n\n            }, this));\n\n        return this;\n    }\n\n    /**\n     * Helper to announce the step on the page.\n     *\n     * @method  announceStep\n     * @param   {Object}    stepConfig      The step configuration of the step\n     * @chainable\n     * @return {Object} this.\n     */\n    announceStep(stepConfig) {\n        // Setup the step Dialogue as per:\n        // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal\n        // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal\n\n        // Generate an ID for the current step node.\n        let stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;\n        this.currentStepNode.attr('id', stepId);\n\n        let bodyRegion = this.currentStepNode.find('[data-placeholder=\"body\"]').first();\n        bodyRegion.attr('id', stepId + '-body');\n        bodyRegion.attr('role', 'document');\n\n        let headerRegion = this.currentStepNode.find('[data-placeholder=\"title\"]').first();\n        headerRegion.attr('id', stepId + '-title');\n        headerRegion.attr('aria-labelledby', stepId + '-body');\n\n        // Generally, a modal dialog has a role of dialog.\n        this.currentStepNode.attr('role', 'dialog');\n        this.currentStepNode.attr('tabindex', 0);\n        this.currentStepNode.attr('aria-labelledby', stepId + '-title');\n        this.currentStepNode.attr('aria-describedby', stepId + '-body');\n\n        // Configure ARIA attributes on the target.\n        let target = this.getStepTarget(stepConfig);\n        if (target) {\n            if (!target.attr('tabindex')) {\n                target.attr('tabindex', 0);\n            }\n\n            target\n                .data('original-describedby', target.attr('aria-describedby'))\n                .attr('aria-describedby', stepId + '-body')\n                ;\n        }\n\n        this.accessibilityShow(stepConfig);\n\n        return this;\n    }\n\n    /**\n     * Handle key down events.\n     *\n     * @method  handleKeyDown\n     * @param   {EventFacade} e\n     */\n    handleKeyDown(e) {\n        let tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], ';\n        tabbableSelector += ':input:enabled, [tabindex], button:enabled';\n        switch (e.keyCode) {\n            case 27:\n                this.endTour();\n                break;\n\n            // 9 == Tab - trap focus for items with a backdrop.\n            case 9:\n                // Tab must be handled on key up only in this instance.\n                (function() {\n                    if (!this.currentStepConfig.hasBackdrop) {\n                        // Trapping tab focus is only handled for those steps with a backdrop.\n                        return;\n                    }\n\n                    // Find all tabbable locations.\n                    let activeElement = $(document.activeElement);\n                    let stepTarget = this.getStepTarget(this.currentStepConfig);\n                    let tabbableNodes = $(tabbableSelector);\n                    let dialogContainer = $('span[data-flexitour=\"container\"]');\n                    let currentIndex;\n                    // Filter out element which is not belong to target section or dialogue.\n                    if (stepTarget) {\n                        tabbableNodes = tabbableNodes.filter(function(index, element) {\n                            return stepTarget !== null\n                                && (stepTarget.has(element).length\n                                    || dialogContainer.has(element).length\n                                    || stepTarget.is(element)\n                                    || dialogContainer.is(element));\n                        });\n                    }\n\n                    // Find index of focusing element.\n                    tabbableNodes.each(function(index, element) {\n                        if (activeElement.is(element)) {\n                            currentIndex = index;\n                            return false;\n                        }\n                        // Keep looping.\n                        return true;\n                    });\n\n                    let nextIndex;\n                    let nextNode;\n                    let focusRelevant;\n                    if (currentIndex != void 0) {\n                        let direction = 1;\n                        if (e.shiftKey) {\n                            direction = -1;\n                        }\n                        nextIndex = currentIndex;\n                        do {\n                            nextIndex += direction;\n                            nextNode = $(tabbableNodes[nextIndex]);\n                        } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));\n                        if (nextNode.length) {\n                            // A new f\n                            focusRelevant = nextNode.closest(stepTarget).length;\n                            focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;\n                        } else {\n                            // Unable to find the target somehow.\n                            focusRelevant = false;\n                        }\n                    }\n\n                    if (focusRelevant) {\n                        nextNode.focus();\n                    } else {\n                        if (e.shiftKey) {\n                            // Focus on the last tabbable node in the step.\n                            this.currentStepNode.find(tabbableSelector).last().focus();\n                        } else {\n                            if (this.currentStepConfig.isOrphan) {\n                                // Focus on the step - there is no target.\n                                this.currentStepNode.focus();\n                            } else {\n                                // Focus on the step target.\n                                stepTarget.focus();\n                            }\n                        }\n                    }\n                    e.preventDefault();\n                }).call(this);\n                break;\n        }\n    }\n\n    /**\n     * Start the current tour.\n     *\n     * @method  startTour\n     * @param   {Integer}   startAt     Which step number to start at. If not specified, starts at the last point.\n     * @chainable\n     * @return {Object} this.\n     */\n    startTour(startAt) {\n        if (this.storage && typeof startAt === 'undefined') {\n            let storageStartValue = this.storage.getItem(this.storageKey);\n            if (storageStartValue) {\n                let storageStartAt = parseInt(storageStartValue, 10);\n                if (storageStartAt <= this.steps.length) {\n                    startAt = storageStartAt;\n                }\n            }\n        }\n\n        if (typeof startAt === 'undefined') {\n            startAt = this.getCurrentStepNumber();\n        }\n\n        this.fireEventHandlers('beforeStart', startAt);\n        this.gotoStep(startAt);\n        this.fireEventHandlers('afterStart', startAt);\n\n        return this;\n    }\n\n    /**\n     * Restart the tour from the beginning, resetting the completionlag.\n     *\n     * @method  restartTour\n     * @chainable\n     * @return {Object} this.\n     */\n    restartTour() {\n        return this.startTour(0);\n    }\n\n    /**\n     * End the current tour.\n     *\n     * @method  endTour\n     * @chainable\n     * @return {Object} this.\n     */\n    endTour() {\n        this.fireEventHandlers('beforeEnd');\n\n        if (this.currentStepConfig) {\n            let previousTarget = this.getStepTarget(this.currentStepConfig);\n            if (previousTarget) {\n                if (!previousTarget.attr('tabindex')) {\n                    previousTarget.attr('tabindex', '-1');\n                }\n                previousTarget.focus();\n            }\n        }\n\n        this.hide(true);\n\n        this.fireEventHandlers('afterEnd');\n\n        return this;\n    }\n\n    /**\n     * Hide any currently visible steps.\n     *\n     * @method hide\n     * @param {Bool} transition Animate the visibility change\n     * @chainable\n     * @return {Object} this.\n     */\n    hide(transition) {\n        this.fireEventHandlers('beforeHide');\n\n        if (this.currentStepNode && this.currentStepNode.length) {\n            this.currentStepNode.hide();\n            if (this.currentStepPopper) {\n                this.currentStepPopper.destroy();\n            }\n        }\n\n        // Restore original target configuration.\n        if (this.currentStepConfig) {\n            let target = this.getStepTarget(this.currentStepConfig);\n            if (target) {\n                if (target.data('original-labelledby')) {\n                    target.attr('aria-labelledby', target.data('original-labelledby'));\n                }\n\n                if (target.data('original-describedby')) {\n                    target.attr('aria-describedby', target.data('original-describedby'));\n                }\n\n                if (target.data('original-tabindex')) {\n                    target.attr('tabindex', target.data('tabindex'));\n                }\n            }\n\n            // Clear the step configuration.\n            this.currentStepConfig = null;\n        }\n\n        let fadeTime = 0;\n        if (transition) {\n            fadeTime = 400;\n        }\n\n        // Remove the backdrop features.\n        $('[data-flexitour=\"step-background\"]').remove();\n        $('[data-flexitour=\"step-backdrop\"]').removeAttr('data-flexitour');\n        $('[data-flexitour=\"backdrop\"]').fadeOut(fadeTime, function() {\n            $(this).remove();\n        });\n\n        // Remove aria-describedby and tabindex attributes.\n        if (this.currentStepNode && this.currentStepNode.length) {\n            let stepId = this.currentStepNode.attr('id');\n            if (stepId) {\n                let currentStepElement = '[aria-describedby=\"' + stepId + '-body\"]';\n                $(currentStepElement).removeAttr('tabindex');\n                $(currentStepElement).removeAttr('aria-describedby');\n            }\n        }\n\n        // Reset the listeners.\n        this.resetStepListeners();\n\n        this.accessibilityHide();\n\n        this.fireEventHandlers('afterHide');\n\n        this.currentStepNode = null;\n        this.currentStepPopper = null;\n        return this;\n    }\n\n    /**\n     * Show the current steps.\n     *\n     * @method show\n     * @chainable\n     * @return {Object} this.\n     */\n    show() {\n        // Show the current step.\n        let startAt = this.getCurrentStepNumber();\n\n        return this.gotoStep(startAt);\n    }\n\n    /**\n     * Return the current step node.\n     *\n     * @method  getStepContainer\n     * @return  {jQuery}\n     */\n    getStepContainer() {\n        return $(this.currentStepNode);\n    }\n\n    /**\n     * Calculate scrollTop.\n     *\n     * @method  calculateScrollTop\n     * @param   {Object}    stepConfig      The step configuration of the step\n     * @return  {Number}\n     */\n    calculateScrollTop(stepConfig) {\n        let scrollTop = $(window).scrollTop();\n        let viewportHeight = $(window).height();\n        let targetNode = this.getStepTarget(stepConfig);\n\n        if (stepConfig.placement === 'top') {\n            // If the placement is top, center scroll at the top of the target.\n            scrollTop = targetNode.offset().top - (viewportHeight / 2);\n        } else if (stepConfig.placement === 'bottom') {\n            // If the placement is bottom, center scroll at the bottom of the target.\n            scrollTop = targetNode.offset().top + targetNode.height() - (viewportHeight / 2);\n        } else if (targetNode.height() <= (viewportHeight * 0.8)) {\n            // If the placement is left/right, and the target fits in the viewport, centre screen on the target\n            scrollTop = targetNode.offset().top - ((viewportHeight - targetNode.height()) / 2);\n        } else {\n            // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer\n            // and change step attachmentTarget to top+.\n            scrollTop = targetNode.offset().top - (viewportHeight * 0.2);\n        }\n\n        // Never scroll over the top.\n        scrollTop = Math.max(0, scrollTop);\n\n        // Never scroll beyond the bottom.\n        scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);\n\n        return Math.ceil(scrollTop);\n    }\n\n    /**\n     * Calculate dialogue position for page middle.\n     *\n     * @method  calculateScrollTop\n     * @return  {Number}\n     */\n    calculateStepPositionInPage() {\n        let viewportHeight = $(window).height();\n        let stepHeight = this.currentStepNode.height();\n\n        let viewportWidth = $(window).width();\n        let stepWidth = this.currentStepNode.width();\n\n        return {\n            top: Math.ceil((viewportHeight - stepHeight) / 2),\n            left: Math.ceil((viewportWidth - stepWidth) / 2)\n        };\n    }\n\n    /**\n     * Position the step on the page.\n     *\n     * @method  positionStep\n     * @param   {Object}    stepConfig      The step configuration of the step\n     * @chainable\n     * @return {Object} this.\n     */\n    positionStep(stepConfig) {\n        let content = this.currentStepNode;\n        if (!content || !content.length) {\n            // Unable to find the step node.\n            return this;\n        }\n\n        let flipBehavior;\n        switch (stepConfig.placement) {\n            case 'left':\n                flipBehavior = ['left', 'right', 'top', 'bottom'];\n                break;\n            case 'right':\n                flipBehavior = ['right', 'left', 'top', 'bottom'];\n                break;\n            case 'top':\n                flipBehavior = ['top', 'bottom', 'right', 'left'];\n                break;\n            case 'bottom':\n                flipBehavior = ['bottom', 'top', 'right', 'left'];\n                break;\n            default:\n                flipBehavior = 'flip';\n                break;\n        }\n\n        let target = this.getStepTarget(stepConfig);\n        var config = {\n            placement: stepConfig.placement + '-start',\n            removeOnDestroy: true,\n            modifiers: {\n                flip: {\n                    behaviour: flipBehavior,\n                },\n                arrow: {\n                    element: '[data-role=\"arrow\"]',\n                },\n            },\n            onCreate: function(data) {\n                recalculateArrowPosition(data);\n            },\n            onUpdate: function(data) {\n                recalculateArrowPosition(data);\n            },\n        };\n\n        let recalculateArrowPosition = function(data) {\n            let placement = data.placement.split('-')[0];\n            const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n            const arrowElement = data.instance.popper.querySelector('[data-role=\"arrow\"]');\n            const stepElement = $(data.instance.popper.querySelector('[data-role=\"flexitour-step\"]'));\n            if (isVertical) {\n                let arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);\n                let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);\n                let popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);\n                let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);\n                let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n                let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n                let arrowPos = arrowOffset + (arrowHeight / 2);\n                let maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n                let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n                if (arrowPos >= maxPos || arrowPos <= minPos) {\n                    let newArrowPos = 0;\n                    if (arrowPos > (popperHeight / 2)) {\n                        newArrowPos = maxPos - arrowHeight;\n                    } else {\n                        newArrowPos = minPos + arrowHeight;\n                    }\n                    $(arrowElement).css('top', newArrowPos);\n                }\n            } else {\n                let arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);\n                let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);\n                let popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);\n                let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);\n                let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n                let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n                let arrowPos = arrowOffset + (arrowWidth / 2);\n                let maxPos = popperWidth + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n                let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n                if (arrowPos >= maxPos || arrowPos <= minPos) {\n                    let newArrowPos = 0;\n                    if (arrowPos > (popperWidth / 2)) {\n                        newArrowPos = maxPos - arrowWidth;\n                    } else {\n                        newArrowPos = minPos + arrowWidth;\n                    }\n                    $(arrowElement).css('left', newArrowPos);\n                }\n            }\n        };\n\n        let background = $('[data-flexitour=\"step-background\"]');\n        if (background.length) {\n            target = background;\n        }\n        this.currentStepPopper = new Popper(target, content[0], config);\n\n        return this;\n    }\n\n    /**\n     * Add the backdrop.\n     *\n     * @method  positionBackdrop\n     * @param   {Object}    stepConfig      The step configuration of the step\n     * @chainable\n     * @return {Object} this.\n     */\n    positionBackdrop(stepConfig) {\n        if (stepConfig.backdrop) {\n            this.currentStepConfig.hasBackdrop = true;\n            let backdrop = $('<div data-flexitour=\"backdrop\"></div>');\n\n            if (stepConfig.zIndex) {\n                if (stepConfig.attachPoint === 'append') {\n                    stepConfig.attachTo.append(backdrop);\n                } else {\n                    backdrop.insertAfter(stepConfig.attachTo);\n                }\n            } else {\n                $('body').append(backdrop);\n            }\n\n            if (this.isStepActuallyVisible(stepConfig)) {\n                // The step has a visible target.\n                // Punch a hole through the backdrop.\n                let background = $('<div data-flexitour=\"step-background\"></div>');\n\n                let targetNode = this.getStepTarget(stepConfig);\n\n                let buffer = 10;\n\n                let colorNode = targetNode;\n                if (buffer) {\n                    colorNode = $('body');\n                }\n\n                background.css({\n                    width: targetNode.outerWidth() + buffer + buffer,\n                    height: targetNode.outerHeight() + buffer + buffer,\n                    left: targetNode.offset().left - buffer,\n                    top: targetNode.offset().top - buffer,\n                    backgroundColor: this.calculateInherittedBackgroundColor(colorNode),\n                });\n\n                if (targetNode.offset().left < buffer) {\n                    background.css({\n                        width: targetNode.outerWidth() + targetNode.offset().left + buffer,\n                        left: targetNode.offset().left,\n                    });\n                }\n\n                if (targetNode.offset().top < buffer) {\n                    background.css({\n                        height: targetNode.outerHeight() + targetNode.offset().top + buffer,\n                        top: targetNode.offset().top,\n                    });\n                }\n\n                let targetRadius = targetNode.css('borderRadius');\n                if (targetRadius && targetRadius !== $('body').css('borderRadius')) {\n                    background.css('borderRadius', targetRadius);\n                }\n\n                let targetPosition = this.calculatePosition(targetNode);\n                if (targetPosition === 'fixed') {\n                    background.css('top', 0);\n                } else if (targetPosition === 'absolute') {\n                    background.css('position', 'fixed');\n                }\n\n                let fader = background.clone();\n                fader.css({\n                    backgroundColor: backdrop.css('backgroundColor'),\n                    opacity: backdrop.css('opacity'),\n                });\n                fader.attr('data-flexitour', 'step-background-fader');\n\n                if (stepConfig.zIndex) {\n                    if (stepConfig.attachPoint === 'append') {\n                        stepConfig.attachTo.append(background);\n                    } else {\n                        fader.insertAfter(stepConfig.attachTo);\n                        background.insertAfter(stepConfig.attachTo);\n                    }\n                } else {\n                    $('body').append(fader);\n                    $('body').append(background);\n                }\n\n                // Add the backdrop data to the actual target.\n                // This is the part which actually does the work.\n                targetNode.attr('data-flexitour', 'step-backdrop');\n\n                if (stepConfig.zIndex) {\n                    backdrop.css('zIndex', stepConfig.zIndex);\n                    background.css('zIndex', stepConfig.zIndex + 1);\n                    targetNode.css('zIndex', stepConfig.zIndex + 2);\n                }\n\n                fader.fadeOut('2000', function() {\n                    $(this).remove();\n                });\n            }\n        }\n        return this;\n    }\n\n    /**\n     * Calculate the inheritted z-index.\n     *\n     * @method  calculateZIndex\n     * @param   {jQuery}    elem                        The element to calculate z-index for\n     * @return  {Number}                                Calculated z-index\n     */\n    calculateZIndex(elem) {\n        elem = $(elem);\n        while (elem.length && elem[0] !== document) {\n            // Ignore z-index if position is set to a value where z-index is ignored by the browser\n            // This makes behavior of this function consistent across browsers\n            // WebKit always returns auto if the element is positioned.\n            let position = elem.css(\"position\");\n            if (position === \"absolute\" || position === \"relative\" || position === \"fixed\") {\n                // IE returns 0 when zIndex is not specified\n                // other browsers return a string\n                // we ignore the case of nested elements with an explicit value of 0\n                // <div style=\"z-index: -10;\"><div style=\"z-index: 0;\"></div></div>\n                let value = parseInt(elem.css(\"zIndex\"), 10);\n                if (!isNaN(value) && value !== 0) {\n                    return value;\n                }\n            }\n            elem = elem.parent();\n        }\n\n        return 0;\n    }\n\n    /**\n     * Calculate the inheritted background colour.\n     *\n     * @method  calculateInherittedBackgroundColor\n     * @param   {jQuery}    elem                        The element to calculate colour for\n     * @return  {String}                                Calculated background colour\n     */\n    calculateInherittedBackgroundColor(elem) {\n        // Use a fake node to compare each element against.\n        let fakeNode = $('<div>').hide();\n        $('body').append(fakeNode);\n        let fakeElemColor = fakeNode.css('backgroundColor');\n        fakeNode.remove();\n\n        elem = $(elem);\n        while (elem.length && elem[0] !== document) {\n            let color = elem.css('backgroundColor');\n            if (color !== fakeElemColor) {\n                return color;\n            }\n            elem = elem.parent();\n        }\n\n        return null;\n    }\n\n    /**\n     * Calculate the inheritted position.\n     *\n     * @method  calculatePosition\n     * @param   {jQuery}    elem                        The element to calculate position for\n     * @return  {String}                                Calculated position\n     */\n    calculatePosition(elem) {\n        elem = $(elem);\n        while (elem.length && elem[0] !== document) {\n            let position = elem.css('position');\n            if (position !== 'static') {\n                return position;\n            }\n            elem = elem.parent();\n        }\n\n        return null;\n    }\n\n    /**\n     * Perform accessibility changes for step shown.\n     *\n     * This will add aria-hidden=\"true\" to all siblings and parent siblings.\n     *\n     * @method  accessibilityShow\n     */\n    accessibilityShow() {\n        let stateHolder = 'data-has-hidden';\n        let attrName = 'aria-hidden';\n        let hideFunction = function(child) {\n            let flexitourRole = child.data('flexitour');\n            if (flexitourRole) {\n                switch (flexitourRole) {\n                    case 'container':\n                    case 'target':\n                        return;\n                }\n            }\n\n            let hidden = child.attr(attrName);\n            if (!hidden) {\n                child.attr(stateHolder, true);\n                Aria.hide(child);\n            }\n        };\n\n        this.currentStepNode.siblings().each(function(index, node) {\n            hideFunction($(node));\n        });\n        this.currentStepNode.parentsUntil('body').siblings().each(function(index, node) {\n            hideFunction($(node));\n        });\n    }\n\n    /**\n     * Perform accessibility changes for step hidden.\n     *\n     * This will remove any newly added aria-hidden=\"true\".\n     *\n     * @method  accessibilityHide\n     */\n    accessibilityHide() {\n        let stateHolder = 'data-has-hidden';\n        let showFunction = function(child) {\n            let hidden = child.attr(stateHolder);\n            if (typeof hidden !== 'undefined') {\n                child.removeAttr(stateHolder);\n                Aria.unhide(child);\n            }\n        };\n\n        $('[' + stateHolder + ']').each(function(index, node) {\n            showFunction($(node));\n        });\n    }\n}\n"],"file":"tour.min.js"}