/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ };
/******/
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "js/legacy-presentation": 0
/******/ };
/******/
/******/
/******/
/******/ // script path function
/******/ function jsonpScriptSrc(chunkId) {
/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".bundle.js"
/******/ }
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
/******/ var promises = [];
/******/
/******/
/******/ // JSONP chunk loading for javascript
/******/
/******/ var installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var script = document.createElement('script');
/******/ var onScriptComplete;
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = jsonpScriptSrc(chunkId);
/******/
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ onScriptComplete = function (event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var chunk = installedChunks[chunkId];
/******/ if(chunk !== 0) {
/******/ if(chunk) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ chunk[1](error);
/******/ }
/******/ installedChunks[chunkId] = undefined;
/******/ }
/******/ };
/******/ var timeout = setTimeout(function(){
/******/ onScriptComplete({ type: 'timeout', target: script });
/******/ }, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ document.head.appendChild(script);
/******/ }
/******/ }
/******/ return Promise.all(promises);
/******/ };
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ // on error function for async loading
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/client/js/legacy/crowi-presentation.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/reveal.js/js/reveal.js":
/*!*********************************************!*\
!*** ./node_modules/reveal.js/js/reveal.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * reveal.js\n * http://revealjs.com\n * MIT licensed\n *\n * Copyright (C) 2017 Hakim El Hattab, http://hakim.se\n */\n(function( root, factory ) {\n\tif( true ) {\n\t\t// AMD. Register as an anonymous module.\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\t\troot.Reveal = factory();\n\t\t\treturn root.Reveal;\n\t\t}).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n}( this, function() {\n\n\t'use strict';\n\n\tvar Reveal;\n\n\t// The reveal.js version\n\tvar VERSION = '3.6.0';\n\n\tvar SLIDES_SELECTOR = '.slides section',\n\t\tHORIZONTAL_SLIDES_SELECTOR = '.slides>section',\n\t\tVERTICAL_SLIDES_SELECTOR = '.slides>section.present>section',\n\t\tHOME_SLIDE_SELECTOR = '.slides>section:first-of-type',\n\t\tUA = navigator.userAgent,\n\n\t\t// Configuration defaults, can be overridden at initialization time\n\t\tconfig = {\n\n\t\t\t// The \"normal\" size of the presentation, aspect ratio will be preserved\n\t\t\t// when the presentation is scaled to fit different resolutions\n\t\t\twidth: 960,\n\t\t\theight: 700,\n\n\t\t\t// Factor of the display size that should remain empty around the content\n\t\t\tmargin: 0.04,\n\n\t\t\t// Bounds for smallest/largest possible scale to apply to content\n\t\t\tminScale: 0.2,\n\t\t\tmaxScale: 2.0,\n\n\t\t\t// Display presentation control arrows\n\t\t\tcontrols: true,\n\n\t\t\t// Help the user learn the controls by providing hints, for example by\n\t\t\t// bouncing the down arrow when they first encounter a vertical slide\n\t\t\tcontrolsTutorial: true,\n\n\t\t\t// Determines where controls appear, \"edges\" or \"bottom-right\"\n\t\t\tcontrolsLayout: 'bottom-right',\n\n\t\t\t// Visibility rule for backwards navigation arrows; \"faded\", \"hidden\"\n\t\t\t// or \"visible\"\n\t\t\tcontrolsBackArrows: 'faded',\n\n\t\t\t// Display a presentation progress bar\n\t\t\tprogress: true,\n\n\t\t\t// Display the page number of the current slide\n\t\t\tslideNumber: false,\n\n\t\t\t// Determine which displays to show the slide number on\n\t\t\tshowSlideNumber: 'all',\n\n\t\t\t// Push each slide change to the browser history\n\t\t\thistory: false,\n\n\t\t\t// Enable keyboard shortcuts for navigation\n\t\t\tkeyboard: true,\n\n\t\t\t// Optional function that blocks keyboard events when retuning false\n\t\t\tkeyboardCondition: null,\n\n\t\t\t// Enable the slide overview mode\n\t\t\toverview: true,\n\n\t\t\t// Vertical centering of slides\n\t\t\tcenter: true,\n\n\t\t\t// Enables touch navigation on devices with touch input\n\t\t\ttouch: true,\n\n\t\t\t// Loop the presentation\n\t\t\tloop: false,\n\n\t\t\t// Change the presentation direction to be RTL\n\t\t\trtl: false,\n\n\t\t\t// Randomizes the order of slides each time the presentation loads\n\t\t\tshuffle: false,\n\n\t\t\t// Turns fragments on and off globally\n\t\t\tfragments: true,\n\n\t\t\t// Flags if the presentation is running in an embedded mode,\n\t\t\t// i.e. contained within a limited portion of the screen\n\t\t\tembedded: false,\n\n\t\t\t// Flags if we should show a help overlay when the question-mark\n\t\t\t// key is pressed\n\t\t\thelp: true,\n\n\t\t\t// Flags if it should be possible to pause the presentation (blackout)\n\t\t\tpause: true,\n\n\t\t\t// Flags if speaker notes should be visible to all viewers\n\t\t\tshowNotes: false,\n\n\t\t\t// Global override for autolaying embedded media (video/audio/iframe)\n\t\t\t// - null: Media will only autoplay if data-autoplay is present\n\t\t\t// - true: All media will autoplay, regardless of individual setting\n\t\t\t// - false: No media will autoplay, regardless of individual setting\n\t\t\tautoPlayMedia: null,\n\n\t\t\t// Controls automatic progression to the next slide\n\t\t\t// - 0: Auto-sliding only happens if the data-autoslide HTML attribute\n\t\t\t// is present on the current slide or fragment\n\t\t\t// - 1+: All slides will progress automatically at the given interval\n\t\t\t// - false: No auto-sliding, even if data-autoslide is present\n\t\t\tautoSlide: 0,\n\n\t\t\t// Stop auto-sliding after user input\n\t\t\tautoSlideStoppable: true,\n\n\t\t\t// Use this method for navigation when auto-sliding (defaults to navigateNext)\n\t\t\tautoSlideMethod: null,\n\n\t\t\t// Enable slide navigation via mouse wheel\n\t\t\tmouseWheel: false,\n\n\t\t\t// Apply a 3D roll to links on hover\n\t\t\trollingLinks: false,\n\n\t\t\t// Hides the address bar on mobile devices\n\t\t\thideAddressBar: true,\n\n\t\t\t// Opens links in an iframe preview overlay\n\t\t\tpreviewLinks: false,\n\n\t\t\t// Exposes the reveal.js API through window.postMessage\n\t\t\tpostMessage: true,\n\n\t\t\t// Dispatches all reveal.js events to the parent window through postMessage\n\t\t\tpostMessageEvents: false,\n\n\t\t\t// Focuses body when page changes visibility to ensure keyboard shortcuts work\n\t\t\tfocusBodyOnPageVisibilityChange: true,\n\n\t\t\t// Transition style\n\t\t\ttransition: 'slide', // none/fade/slide/convex/concave/zoom\n\n\t\t\t// Transition speed\n\t\t\ttransitionSpeed: 'default', // default/fast/slow\n\n\t\t\t// Transition style for full page slide backgrounds\n\t\t\tbackgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom\n\n\t\t\t// Parallax background image\n\t\t\tparallaxBackgroundImage: '', // CSS syntax, e.g. \"a.jpg\"\n\n\t\t\t// Parallax background size\n\t\t\tparallaxBackgroundSize: '', // CSS syntax, e.g. \"3000px 2000px\"\n\n\t\t\t// Amount of pixels to move the parallax background per slide step\n\t\t\tparallaxBackgroundHorizontal: null,\n\t\t\tparallaxBackgroundVertical: null,\n\n\t\t\t// The maximum number of pages a single slide can expand onto when printing\n\t\t\t// to PDF, unlimited by default\n\t\t\tpdfMaxPagesPerSlide: Number.POSITIVE_INFINITY,\n\n\t\t\t// Offset used to reduce the height of content within exported PDF pages.\n\t\t\t// This exists to account for environment differences based on how you\n\t\t\t// print to PDF. CLI printing options, like phantomjs and wkpdf, can end\n\t\t\t// on precisely the total height of the document whereas in-browser\n\t\t\t// printing has to end one pixel before.\n\t\t\tpdfPageHeightOffset: -1,\n\n\t\t\t// Number of slides away from the current that are visible\n\t\t\tviewDistance: 3,\n\n\t\t\t// The display mode that will be used to show slides\n\t\t\tdisplay: 'block',\n\n\t\t\t// Script dependencies to load\n\t\t\tdependencies: []\n\n\t\t},\n\n\t\t// Flags if Reveal.initialize() has been called\n\t\tinitialized = false,\n\n\t\t// Flags if reveal.js is loaded (has dispatched the 'ready' event)\n\t\tloaded = false,\n\n\t\t// Flags if the overview mode is currently active\n\t\toverview = false,\n\n\t\t// Holds the dimensions of our overview slides, including margins\n\t\toverviewSlideWidth = null,\n\t\toverviewSlideHeight = null,\n\n\t\t// The horizontal and vertical index of the currently active slide\n\t\tindexh,\n\t\tindexv,\n\n\t\t// The previous and current slide HTML elements\n\t\tpreviousSlide,\n\t\tcurrentSlide,\n\n\t\tpreviousBackground,\n\n\t\t// Remember which directions that the user has navigated towards\n\t\thasNavigatedRight = false,\n\t\thasNavigatedDown = false,\n\n\t\t// Slides may hold a data-state attribute which we pick up and apply\n\t\t// as a class to the body. This list contains the combined state of\n\t\t// all current slides.\n\t\tstate = [],\n\n\t\t// The current scale of the presentation (see width/height config)\n\t\tscale = 1,\n\n\t\t// CSS transform that is currently applied to the slides container,\n\t\t// split into two groups\n\t\tslidesTransform = { layout: '', overview: '' },\n\n\t\t// Cached references to DOM elements\n\t\tdom = {},\n\n\t\t// Features supported by the browser, see #checkCapabilities()\n\t\tfeatures = {},\n\n\t\t// Client is a mobile device, see #checkCapabilities()\n\t\tisMobileDevice,\n\n\t\t// Client is a desktop Chrome, see #checkCapabilities()\n\t\tisChrome,\n\n\t\t// Throttles mouse wheel navigation\n\t\tlastMouseWheelStep = 0,\n\n\t\t// Delays updates to the URL due to a Chrome thumbnailer bug\n\t\twriteURLTimeout = 0,\n\n\t\t// Flags if the interaction event listeners are bound\n\t\teventsAreBound = false,\n\n\t\t// The current auto-slide duration\n\t\tautoSlide = 0,\n\n\t\t// Auto slide properties\n\t\tautoSlidePlayer,\n\t\tautoSlideTimeout = 0,\n\t\tautoSlideStartTime = -1,\n\t\tautoSlidePaused = false,\n\n\t\t// Holds information about the currently ongoing touch input\n\t\ttouch = {\n\t\t\tstartX: 0,\n\t\t\tstartY: 0,\n\t\t\tstartSpan: 0,\n\t\t\tstartCount: 0,\n\t\t\tcaptured: false,\n\t\t\tthreshold: 40\n\t\t},\n\n\t\t// Holds information about the keyboard shortcuts\n\t\tkeyboardShortcuts = {\n\t\t\t'N , SPACE':\t\t\t'Next slide',\n\t\t\t'P':\t\t\t\t\t'Previous slide',\n\t\t\t'← , H':\t\t'Navigate left',\n\t\t\t'→ , L':\t\t'Navigate right',\n\t\t\t'↑ , K':\t\t'Navigate up',\n\t\t\t'↓ , J':\t\t'Navigate down',\n\t\t\t'Home':\t\t\t\t\t'First slide',\n\t\t\t'End':\t\t\t\t\t'Last slide',\n\t\t\t'B , .':\t\t\t\t'Pause',\n\t\t\t'F':\t\t\t\t\t'Fullscreen',\n\t\t\t'ESC, O':\t\t\t\t'Slide overview'\n\t\t};\n\n\t/**\n\t * Starts up the presentation if the client is capable.\n\t */\n\tfunction initialize( options ) {\n\n\t\t// Make sure we only initialize once\n\t\tif( initialized === true ) return;\n\n\t\tinitialized = true;\n\n\t\tcheckCapabilities();\n\n\t\tif( !features.transforms2d && !features.transforms3d ) {\n\t\t\tdocument.body.setAttribute( 'class', 'no-transforms' );\n\n\t\t\t// Since JS won't be running any further, we load all lazy\n\t\t\t// loading elements upfront\n\t\t\tvar images = toArray( document.getElementsByTagName( 'img' ) ),\n\t\t\t\tiframes = toArray( document.getElementsByTagName( 'iframe' ) );\n\n\t\t\tvar lazyLoadable = images.concat( iframes );\n\n\t\t\tfor( var i = 0, len = lazyLoadable.length; i < len; i++ ) {\n\t\t\t\tvar element = lazyLoadable[i];\n\t\t\t\tif( element.getAttribute( 'data-src' ) ) {\n\t\t\t\t\telement.setAttribute( 'src', element.getAttribute( 'data-src' ) );\n\t\t\t\t\telement.removeAttribute( 'data-src' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the browser doesn't support core features we won't be\n\t\t\t// using JavaScript to control the presentation\n\t\t\treturn;\n\t\t}\n\n\t\t// Cache references to key DOM elements\n\t\tdom.wrapper = document.querySelector( '.reveal' );\n\t\tdom.slides = document.querySelector( '.reveal .slides' );\n\n\t\t// Force a layout when the whole page, incl fonts, has loaded\n\t\twindow.addEventListener( 'load', layout, false );\n\n\t\tvar query = Reveal.getQueryHash();\n\n\t\t// Do not accept new dependencies via query config to avoid\n\t\t// the potential of malicious script injection\n\t\tif( typeof query['dependencies'] !== 'undefined' ) delete query['dependencies'];\n\n\t\t// Copy options over to our config object\n\t\textend( config, options );\n\t\textend( config, query );\n\n\t\t// Hide the address bar in mobile browsers\n\t\thideAddressBar();\n\n\t\t// Loads the dependencies and continues to #start() once done\n\t\tload();\n\n\t}\n\n\t/**\n\t * Inspect the client to see what it's capable of, this\n\t * should only happens once per runtime.\n\t */\n\tfunction checkCapabilities() {\n\n\t\tisMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA );\n\t\tisChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );\n\n\t\tvar testElement = document.createElement( 'div' );\n\n\t\tfeatures.transforms3d = 'WebkitPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'MozPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'msPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'OPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'perspective' in testElement.style;\n\n\t\tfeatures.transforms2d = 'WebkitTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'MozTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'msTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'OTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'transform' in testElement.style;\n\n\t\tfeatures.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n\t\tfeatures.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function';\n\n\t\tfeatures.canvas = !!document.createElement( 'canvas' ).getContext;\n\n\t\t// Transitions in the overview are disabled in desktop and\n\t\t// Safari due to lag\n\t\tfeatures.overviewTransitions = !/Version\\/[\\d\\.]+.*Safari/.test( UA );\n\n\t\t// Flags if we should use zoom instead of transform to scale\n\t\t// up slides. Zoom produces crisper results but has a lot of\n\t\t// xbrowser quirks so we only use it in whitelsited browsers.\n\t\tfeatures.zoom = 'zoom' in testElement.style && !isMobileDevice &&\n\t\t\t\t\t\t( isChrome || /Version\\/[\\d\\.]+.*Safari/.test( UA ) );\n\n\t}\n\n /**\n * Loads the dependencies of reveal.js. Dependencies are\n * defined via the configuration option 'dependencies'\n * and will be loaded prior to starting/binding reveal.js.\n * Some dependencies may have an 'async' flag, if so they\n * will load after reveal.js has been started up.\n */\n\tfunction load() {\n\n\t\tvar scripts = [],\n\t\t\tscriptsAsync = [],\n\t\t\tscriptsToPreload = 0;\n\n\t\t// Called once synchronous scripts finish loading\n\t\tfunction proceed() {\n\t\t\tif( scriptsAsync.length ) {\n\t\t\t\t// Load asynchronous scripts\n\t\t\t\thead.js.apply( null, scriptsAsync );\n\t\t\t}\n\n\t\t\tstart();\n\t\t}\n\n\t\tfunction loadScript( s ) {\n\t\t\thead.ready( s.src.match( /([\\w\\d_\\-]*)\\.?js$|[^\\\\\\/]*$/i )[0], function() {\n\t\t\t\t// Extension may contain callback functions\n\t\t\t\tif( typeof s.callback === 'function' ) {\n\t\t\t\t\ts.callback.apply( this );\n\t\t\t\t}\n\n\t\t\t\tif( --scriptsToPreload === 0 ) {\n\t\t\t\t\tproceed();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor( var i = 0, len = config.dependencies.length; i < len; i++ ) {\n\t\t\tvar s = config.dependencies[i];\n\n\t\t\t// Load if there's no condition or the condition is truthy\n\t\t\tif( !s.condition || s.condition() ) {\n\t\t\t\tif( s.async ) {\n\t\t\t\t\tscriptsAsync.push( s.src );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscripts.push( s.src );\n\t\t\t\t}\n\n\t\t\t\tloadScript( s );\n\t\t\t}\n\t\t}\n\n\t\tif( scripts.length ) {\n\t\t\tscriptsToPreload = scripts.length;\n\n\t\t\t// Load synchronous scripts\n\t\t\thead.js.apply( null, scripts );\n\t\t}\n\t\telse {\n\t\t\tproceed();\n\t\t}\n\n\t}\n\n\t/**\n\t * Starts up reveal.js by binding input events and navigating\n\t * to the current URL deeplink if there is one.\n\t */\n\tfunction start() {\n\n\t\tloaded = true;\n\n\t\t// Make sure we've got all the DOM elements we need\n\t\tsetupDOM();\n\n\t\t// Listen to messages posted to this window\n\t\tsetupPostMessage();\n\n\t\t// Prevent the slides from being scrolled out of view\n\t\tsetupScrollPrevention();\n\n\t\t// Resets all vertical slides so that only the first is visible\n\t\tresetVerticalSlides();\n\n\t\t// Updates the presentation to match the current configuration values\n\t\tconfigure();\n\n\t\t// Read the initial hash\n\t\treadURL();\n\n\t\t// Update all backgrounds\n\t\tupdateBackground( true );\n\n\t\t// Notify listeners that the presentation is ready but use a 1ms\n\t\t// timeout to ensure it's not fired synchronously after #initialize()\n\t\tsetTimeout( function() {\n\t\t\t// Enable transitions now that we're loaded\n\t\t\tdom.slides.classList.remove( 'no-transition' );\n\n\t\t\tdom.wrapper.classList.add( 'ready' );\n\n\t\t\tdispatchEvent( 'ready', {\n\t\t\t\t'indexh': indexh,\n\t\t\t\t'indexv': indexv,\n\t\t\t\t'currentSlide': currentSlide\n\t\t\t} );\n\t\t}, 1 );\n\n\t\t// Special setup and config is required when printing to PDF\n\t\tif( isPrintingPDF() ) {\n\t\t\tremoveEventListeners();\n\n\t\t\t// The document needs to have loaded for the PDF layout\n\t\t\t// measurements to be accurate\n\t\t\tif( document.readyState === 'complete' ) {\n\t\t\t\tsetupPDF();\n\t\t\t}\n\t\t\telse {\n\t\t\t\twindow.addEventListener( 'load', setupPDF );\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Finds and stores references to DOM elements which are\n\t * required by the presentation. If a required element is\n\t * not found, it is created.\n\t */\n\tfunction setupDOM() {\n\n\t\t// Prevent transitions while we're loading\n\t\tdom.slides.classList.add( 'no-transition' );\n\n\t\tif( isMobileDevice ) {\n\t\t\tdom.wrapper.classList.add( 'no-hover' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'no-hover' );\n\t\t}\n\n\t\tif( /iphone/gi.test( UA ) ) {\n\t\t\tdom.wrapper.classList.add( 'ua-iphone' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'ua-iphone' );\n\t\t}\n\n\t\t// Background element\n\t\tdom.background = createSingletonNode( dom.wrapper, 'div', 'backgrounds', null );\n\n\t\t// Progress bar\n\t\tdom.progress = createSingletonNode( dom.wrapper, 'div', 'progress', '' );\n\t\tdom.progressbar = dom.progress.querySelector( 'span' );\n\n\t\t// Arrow controls\n\t\tdom.controls = createSingletonNode( dom.wrapper, 'aside', 'controls',\n\t\t\t'' +\n\t\t\t'' +\n\t\t\t'' +\n\t\t\t'' );\n\n\t\t// Slide number\n\t\tdom.slideNumber = createSingletonNode( dom.wrapper, 'div', 'slide-number', '' );\n\n\t\t// Element containing notes that are visible to the audience\n\t\tdom.speakerNotes = createSingletonNode( dom.wrapper, 'div', 'speaker-notes', null );\n\t\tdom.speakerNotes.setAttribute( 'data-prevent-swipe', '' );\n\t\tdom.speakerNotes.setAttribute( 'tabindex', '0' );\n\n\t\t// Overlay graphic which is displayed during the paused mode\n\t\tcreateSingletonNode( dom.wrapper, 'div', 'pause-overlay', null );\n\n\t\tdom.wrapper.setAttribute( 'role', 'application' );\n\n\t\t// There can be multiple instances of controls throughout the page\n\t\tdom.controlsLeft = toArray( document.querySelectorAll( '.navigate-left' ) );\n\t\tdom.controlsRight = toArray( document.querySelectorAll( '.navigate-right' ) );\n\t\tdom.controlsUp = toArray( document.querySelectorAll( '.navigate-up' ) );\n\t\tdom.controlsDown = toArray( document.querySelectorAll( '.navigate-down' ) );\n\t\tdom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) );\n\t\tdom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) );\n\n\t\t// The right and down arrows in the standard reveal.js controls\n\t\tdom.controlsRightArrow = dom.controls.querySelector( '.navigate-right' );\n\t\tdom.controlsDownArrow = dom.controls.querySelector( '.navigate-down' );\n\n\t\tdom.statusDiv = createStatusDiv();\n\t}\n\n\t/**\n\t * Creates a hidden div with role aria-live to announce the\n\t * current slide content. Hide the div off-screen to make it\n\t * available only to Assistive Technologies.\n\t *\n\t * @return {HTMLElement}\n\t */\n\tfunction createStatusDiv() {\n\n\t\tvar statusDiv = document.getElementById( 'aria-status-div' );\n\t\tif( !statusDiv ) {\n\t\t\tstatusDiv = document.createElement( 'div' );\n\t\t\tstatusDiv.style.position = 'absolute';\n\t\t\tstatusDiv.style.height = '1px';\n\t\t\tstatusDiv.style.width = '1px';\n\t\t\tstatusDiv.style.overflow = 'hidden';\n\t\t\tstatusDiv.style.clip = 'rect( 1px, 1px, 1px, 1px )';\n\t\t\tstatusDiv.setAttribute( 'id', 'aria-status-div' );\n\t\t\tstatusDiv.setAttribute( 'aria-live', 'polite' );\n\t\t\tstatusDiv.setAttribute( 'aria-atomic','true' );\n\t\t\tdom.wrapper.appendChild( statusDiv );\n\t\t}\n\t\treturn statusDiv;\n\n\t}\n\n\t/**\n\t * Converts the given HTML element into a string of text\n\t * that can be announced to a screen reader. Hidden\n\t * elements are excluded.\n\t */\n\tfunction getStatusText( node ) {\n\n\t\tvar text = '';\n\n\t\t// Text node\n\t\tif( node.nodeType === 3 ) {\n\t\t\ttext += node.textContent;\n\t\t}\n\t\t// Element node\n\t\telse if( node.nodeType === 1 ) {\n\n\t\t\tvar isAriaHidden = node.getAttribute( 'aria-hidden' );\n\t\t\tvar isDisplayHidden = window.getComputedStyle( node )['display'] === 'none';\n\t\t\tif( isAriaHidden !== 'true' && !isDisplayHidden ) {\n\n\t\t\t\ttoArray( node.childNodes ).forEach( function( child ) {\n\t\t\t\t\ttext += getStatusText( child );\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn text;\n\n\t}\n\n\t/**\n\t * Configures the presentation for printing to a static\n\t * PDF.\n\t */\n\tfunction setupPDF() {\n\n\t\tvar slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight );\n\n\t\t// Dimensions of the PDF pages\n\t\tvar pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ),\n\t\t\tpageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) );\n\n\t\t// Dimensions of slides within the pages\n\t\tvar slideWidth = slideSize.width,\n\t\t\tslideHeight = slideSize.height;\n\n\t\t// Let the browser know what page size we want to print\n\t\tinjectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0px;}' );\n\n\t\t// Limit the size of certain elements to the dimensions of the slide\n\t\tinjectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' );\n\n\t\tdocument.body.classList.add( 'print-pdf' );\n\t\tdocument.body.style.width = pageWidth + 'px';\n\t\tdocument.body.style.height = pageHeight + 'px';\n\n\t\t// Make sure stretch elements fit on slide\n\t\tlayoutSlideContents( slideWidth, slideHeight );\n\n\t\t// Add each slide's index as attributes on itself, we need these\n\t\t// indices to generate slide numbers below\n\t\ttoArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) {\n\t\t\thslide.setAttribute( 'data-index-h', h );\n\n\t\t\tif( hslide.classList.contains( 'stack' ) ) {\n\t\t\t\ttoArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) {\n\t\t\t\t\tvslide.setAttribute( 'data-index-h', h );\n\t\t\t\t\tvslide.setAttribute( 'data-index-v', v );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\t// Slide and slide background layout\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {\n\n\t\t\t// Vertical stacks are not centred since their section\n\t\t\t// children will be\n\t\t\tif( slide.classList.contains( 'stack' ) === false ) {\n\t\t\t\t// Center the slide inside of the page, giving the slide some margin\n\t\t\t\tvar left = ( pageWidth - slideWidth ) / 2,\n\t\t\t\t\ttop = ( pageHeight - slideHeight ) / 2;\n\n\t\t\t\tvar contentHeight = slide.scrollHeight;\n\t\t\t\tvar numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 );\n\n\t\t\t\t// Adhere to configured pages per slide limit\n\t\t\t\tnumberOfPages = Math.min( numberOfPages, config.pdfMaxPagesPerSlide );\n\n\t\t\t\t// Center slides vertically\n\t\t\t\tif( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) {\n\t\t\t\t\ttop = Math.max( ( pageHeight - contentHeight ) / 2, 0 );\n\t\t\t\t}\n\n\t\t\t\t// Wrap the slide in a page element and hide its overflow\n\t\t\t\t// so that no page ever flows onto another\n\t\t\t\tvar page = document.createElement( 'div' );\n\t\t\t\tpage.className = 'pdf-page';\n\t\t\t\tpage.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px';\n\t\t\t\tslide.parentNode.insertBefore( page, slide );\n\t\t\t\tpage.appendChild( slide );\n\n\t\t\t\t// Position the slide inside of the page\n\t\t\t\tslide.style.left = left + 'px';\n\t\t\t\tslide.style.top = top + 'px';\n\t\t\t\tslide.style.width = slideWidth + 'px';\n\n\t\t\t\tif( slide.slideBackgroundElement ) {\n\t\t\t\t\tpage.insertBefore( slide.slideBackgroundElement, slide );\n\t\t\t\t}\n\n\t\t\t\t// Inject notes if `showNotes` is enabled\n\t\t\t\tif( config.showNotes ) {\n\n\t\t\t\t\t// Are there notes for this slide?\n\t\t\t\t\tvar notes = getSlideNotes( slide );\n\t\t\t\t\tif( notes ) {\n\n\t\t\t\t\t\tvar notesSpacing = 8;\n\t\t\t\t\t\tvar notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline';\n\t\t\t\t\t\tvar notesElement = document.createElement( 'div' );\n\t\t\t\t\t\tnotesElement.classList.add( 'speaker-notes' );\n\t\t\t\t\t\tnotesElement.classList.add( 'speaker-notes-pdf' );\n\t\t\t\t\t\tnotesElement.setAttribute( 'data-layout', notesLayout );\n\t\t\t\t\t\tnotesElement.innerHTML = notes;\n\n\t\t\t\t\t\tif( notesLayout === 'separate-page' ) {\n\t\t\t\t\t\t\tpage.parentNode.insertBefore( notesElement, page.nextSibling );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnotesElement.style.left = notesSpacing + 'px';\n\t\t\t\t\t\t\tnotesElement.style.bottom = notesSpacing + 'px';\n\t\t\t\t\t\t\tnotesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px';\n\t\t\t\t\t\t\tpage.appendChild( notesElement );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Inject slide numbers if `slideNumbers` are enabled\n\t\t\t\tif( config.slideNumber && /all|print/i.test( config.showSlideNumber ) ) {\n\t\t\t\t\tvar slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1,\n\t\t\t\t\t\tslideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1;\n\n\t\t\t\t\tvar numberElement = document.createElement( 'div' );\n\t\t\t\t\tnumberElement.classList.add( 'slide-number' );\n\t\t\t\t\tnumberElement.classList.add( 'slide-number-pdf' );\n\t\t\t\t\tnumberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV );\n\t\t\t\t\tpage.appendChild( numberElement );\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\n\t\t// Show all fragments\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' .fragment' ) ).forEach( function( fragment ) {\n\t\t\tfragment.classList.add( 'visible' );\n\t\t} );\n\n\t\t// Notify subscribers that the PDF layout is good to go\n\t\tdispatchEvent( 'pdf-ready' );\n\n\t}\n\n\t/**\n\t * This is an unfortunate necessity. Some actions – such as\n\t * an input field being focused in an iframe or using the\n\t * keyboard to expand text selection beyond the bounds of\n\t * a slide – can trigger our content to be pushed out of view.\n\t * This scrolling can not be prevented by hiding overflow in\n\t * CSS (we already do) so we have to resort to repeatedly\n\t * checking if the slides have been offset :(\n\t */\n\tfunction setupScrollPrevention() {\n\n\t\tsetInterval( function() {\n\t\t\tif( dom.wrapper.scrollTop !== 0 || dom.wrapper.scrollLeft !== 0 ) {\n\t\t\t\tdom.wrapper.scrollTop = 0;\n\t\t\t\tdom.wrapper.scrollLeft = 0;\n\t\t\t}\n\t\t}, 1000 );\n\n\t}\n\n\t/**\n\t * Creates an HTML element and returns a reference to it.\n\t * If the element already exists the existing instance will\n\t * be returned.\n\t *\n\t * @param {HTMLElement} container\n\t * @param {string} tagname\n\t * @param {string} classname\n\t * @param {string} innerHTML\n\t *\n\t * @return {HTMLElement}\n\t */\n\tfunction createSingletonNode( container, tagname, classname, innerHTML ) {\n\n\t\t// Find all nodes matching the description\n\t\tvar nodes = container.querySelectorAll( '.' + classname );\n\n\t\t// Check all matches to find one which is a direct child of\n\t\t// the specified container\n\t\tfor( var i = 0; i < nodes.length; i++ ) {\n\t\t\tvar testNode = nodes[i];\n\t\t\tif( testNode.parentNode === container ) {\n\t\t\t\treturn testNode;\n\t\t\t}\n\t\t}\n\n\t\t// If no node was found, create it now\n\t\tvar node = document.createElement( tagname );\n\t\tnode.className = classname;\n\t\tif( typeof innerHTML === 'string' ) {\n\t\t\tnode.innerHTML = innerHTML;\n\t\t}\n\t\tcontainer.appendChild( node );\n\n\t\treturn node;\n\n\t}\n\n\t/**\n\t * Creates the slide background elements and appends them\n\t * to the background container. One element is created per\n\t * slide no matter if the given slide has visible background.\n\t */\n\tfunction createBackgrounds() {\n\n\t\tvar printMode = isPrintingPDF();\n\n\t\t// Clear prior backgrounds\n\t\tdom.background.innerHTML = '';\n\t\tdom.background.classList.add( 'no-transition' );\n\n\t\t// Iterate over all horizontal slides\n\t\ttoArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( slideh ) {\n\n\t\t\tvar backgroundStack = createBackground( slideh, dom.background );\n\n\t\t\t// Iterate over all vertical slides\n\t\t\ttoArray( slideh.querySelectorAll( 'section' ) ).forEach( function( slidev ) {\n\n\t\t\t\tcreateBackground( slidev, backgroundStack );\n\n\t\t\t\tbackgroundStack.classList.add( 'stack' );\n\n\t\t\t} );\n\n\t\t} );\n\n\t\t// Add parallax background if specified\n\t\tif( config.parallaxBackgroundImage ) {\n\n\t\t\tdom.background.style.backgroundImage = 'url(\"' + config.parallaxBackgroundImage + '\")';\n\t\t\tdom.background.style.backgroundSize = config.parallaxBackgroundSize;\n\n\t\t\t// Make sure the below properties are set on the element - these properties are\n\t\t\t// needed for proper transitions to be set on the element via CSS. To remove\n\t\t\t// annoying background slide-in effect when the presentation starts, apply\n\t\t\t// these properties after short time delay\n\t\t\tsetTimeout( function() {\n\t\t\t\tdom.wrapper.classList.add( 'has-parallax-background' );\n\t\t\t}, 1 );\n\n\t\t}\n\t\telse {\n\n\t\t\tdom.background.style.backgroundImage = '';\n\t\t\tdom.wrapper.classList.remove( 'has-parallax-background' );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Creates a background for the given slide.\n\t *\n\t * @param {HTMLElement} slide\n\t * @param {HTMLElement} container The element that the background\n\t * should be appended to\n\t * @return {HTMLElement} New background div\n\t */\n\tfunction createBackground( slide, container ) {\n\n\t\tvar data = {\n\t\t\tbackground: slide.getAttribute( 'data-background' ),\n\t\t\tbackgroundSize: slide.getAttribute( 'data-background-size' ),\n\t\t\tbackgroundImage: slide.getAttribute( 'data-background-image' ),\n\t\t\tbackgroundVideo: slide.getAttribute( 'data-background-video' ),\n\t\t\tbackgroundIframe: slide.getAttribute( 'data-background-iframe' ),\n\t\t\tbackgroundColor: slide.getAttribute( 'data-background-color' ),\n\t\t\tbackgroundRepeat: slide.getAttribute( 'data-background-repeat' ),\n\t\t\tbackgroundPosition: slide.getAttribute( 'data-background-position' ),\n\t\t\tbackgroundTransition: slide.getAttribute( 'data-background-transition' )\n\t\t};\n\n\t\tvar element = document.createElement( 'div' );\n\n\t\t// Carry over custom classes from the slide to the background\n\t\telement.className = 'slide-background ' + slide.className.replace( /present|past|future/, '' );\n\n\t\tif( data.background ) {\n\t\t\t// Auto-wrap image urls in url(...)\n\t\t\tif( /^(http|file|\\/\\/)/gi.test( data.background ) || /\\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test( data.background ) ) {\n\t\t\t\tslide.setAttribute( 'data-background-image', data.background );\n\t\t\t}\n\t\t\telse {\n\t\t\t\telement.style.background = data.background;\n\t\t\t}\n\t\t}\n\n\t\t// Create a hash for this combination of background settings.\n\t\t// This is used to determine when two slide backgrounds are\n\t\t// the same.\n\t\tif( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo || data.backgroundIframe ) {\n\t\t\telement.setAttribute( 'data-background-hash', data.background +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundSize +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundImage +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundVideo +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundIframe +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundColor +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundRepeat +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundPosition +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata.backgroundTransition );\n\t\t}\n\n\t\t// Additional and optional background properties\n\t\tif( data.backgroundSize ) element.style.backgroundSize = data.backgroundSize;\n\t\tif( data.backgroundSize ) element.setAttribute( 'data-background-size', data.backgroundSize );\n\t\tif( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor;\n\t\tif( data.backgroundRepeat ) element.style.backgroundRepeat = data.backgroundRepeat;\n\t\tif( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition;\n\t\tif( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition );\n\n\t\tcontainer.appendChild( element );\n\n\t\t// If backgrounds are being recreated, clear old classes\n\t\tslide.classList.remove( 'has-dark-background' );\n\t\tslide.classList.remove( 'has-light-background' );\n\n\t\tslide.slideBackgroundElement = element;\n\n\t\t// If this slide has a background color, add a class that\n\t\t// signals if it is light or dark. If the slide has no background\n\t\t// color, no class will be set\n\t\tvar computedBackgroundStyle = window.getComputedStyle( element );\n\t\tif( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {\n\t\t\tvar rgb = colorToRgb( computedBackgroundStyle.backgroundColor );\n\n\t\t\t// Ignore fully transparent backgrounds. Some browsers return\n\t\t\t// rgba(0,0,0,0) when reading the computed background color of\n\t\t\t// an element with no background\n\t\t\tif( rgb && rgb.a !== 0 ) {\n\t\t\t\tif( colorBrightness( computedBackgroundStyle.backgroundColor ) < 128 ) {\n\t\t\t\t\tslide.classList.add( 'has-dark-background' );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tslide.classList.add( 'has-light-background' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn element;\n\n\t}\n\n\t/**\n\t * Registers a listener to postMessage events, this makes it\n\t * possible to call all reveal.js API methods from another\n\t * window. For example:\n\t *\n\t * revealWindow.postMessage( JSON.stringify({\n\t * method: 'slide',\n\t * args: [ 2 ]\n\t * }), '*' );\n\t */\n\tfunction setupPostMessage() {\n\n\t\tif( config.postMessage ) {\n\t\t\twindow.addEventListener( 'message', function ( event ) {\n\t\t\t\tvar data = event.data;\n\n\t\t\t\t// Make sure we're dealing with JSON\n\t\t\t\tif( typeof data === 'string' && data.charAt( 0 ) === '{' && data.charAt( data.length - 1 ) === '}' ) {\n\t\t\t\t\tdata = JSON.parse( data );\n\n\t\t\t\t\t// Check if the requested method can be found\n\t\t\t\t\tif( data.method && typeof Reveal[data.method] === 'function' ) {\n\t\t\t\t\t\tReveal[data.method].apply( Reveal, data.args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, false );\n\t\t}\n\n\t}\n\n\t/**\n\t * Applies the configuration settings from the config\n\t * object. May be called multiple times.\n\t *\n\t * @param {object} options\n\t */\n\tfunction configure( options ) {\n\n\t\tvar oldTransition = config.transition;\n\n\t\t// New config options may be passed when this method\n\t\t// is invoked through the API after initialization\n\t\tif( typeof options === 'object' ) extend( config, options );\n\n\t\t// Abort if reveal.js hasn't finished loading, config\n\t\t// changes will be applied automatically once loading\n\t\t// finishes\n\t\tif( loaded === false ) return;\n\n\t\tvar numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length;\n\n\t\t// Remove the previously configured transition class\n\t\tdom.wrapper.classList.remove( oldTransition );\n\n\t\t// Force linear transition based on browser capabilities\n\t\tif( features.transforms3d === false ) config.transition = 'linear';\n\n\t\tdom.wrapper.classList.add( config.transition );\n\n\t\tdom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed );\n\t\tdom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );\n\n\t\tdom.controls.style.display = config.controls ? 'block' : 'none';\n\t\tdom.progress.style.display = config.progress ? 'block' : 'none';\n\n\t\tdom.controls.setAttribute( 'data-controls-layout', config.controlsLayout );\n\t\tdom.controls.setAttribute( 'data-controls-back-arrows', config.controlsBackArrows );\n\n\t\tif( config.shuffle ) {\n\t\t\tshuffle();\n\t\t}\n\n\t\tif( config.rtl ) {\n\t\t\tdom.wrapper.classList.add( 'rtl' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'rtl' );\n\t\t}\n\n\t\tif( config.center ) {\n\t\t\tdom.wrapper.classList.add( 'center' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'center' );\n\t\t}\n\n\t\t// Exit the paused mode if it was configured off\n\t\tif( config.pause === false ) {\n\t\t\tresume();\n\t\t}\n\n\t\tif( config.showNotes ) {\n\t\t\tdom.speakerNotes.setAttribute( 'data-layout', typeof config.showNotes === 'string' ? config.showNotes : 'inline' );\n\t\t}\n\n\t\tif( config.mouseWheel ) {\n\t\t\tdocument.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF\n\t\t\tdocument.addEventListener( 'mousewheel', onDocumentMouseScroll, false );\n\t\t}\n\t\telse {\n\t\t\tdocument.removeEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF\n\t\t\tdocument.removeEventListener( 'mousewheel', onDocumentMouseScroll, false );\n\t\t}\n\n\t\t// Rolling 3D links\n\t\tif( config.rollingLinks ) {\n\t\t\tenableRollingLinks();\n\t\t}\n\t\telse {\n\t\t\tdisableRollingLinks();\n\t\t}\n\n\t\t// Iframe link previews\n\t\tif( config.previewLinks ) {\n\t\t\tenablePreviewLinks();\n\t\t\tdisablePreviewLinks( '[data-preview-link=false]' );\n\t\t}\n\t\telse {\n\t\t\tdisablePreviewLinks();\n\t\t\tenablePreviewLinks( '[data-preview-link]:not([data-preview-link=false])' );\n\t\t}\n\n\t\t// Remove existing auto-slide controls\n\t\tif( autoSlidePlayer ) {\n\t\t\tautoSlidePlayer.destroy();\n\t\t\tautoSlidePlayer = null;\n\t\t}\n\n\t\t// Generate auto-slide controls if needed\n\t\tif( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) {\n\t\t\tautoSlidePlayer = new Playback( dom.wrapper, function() {\n\t\t\t\treturn Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );\n\t\t\t} );\n\n\t\t\tautoSlidePlayer.on( 'click', onAutoSlidePlayerClick );\n\t\t\tautoSlidePaused = false;\n\t\t}\n\n\t\t// When fragments are turned off they should be visible\n\t\tif( config.fragments === false ) {\n\t\t\ttoArray( dom.slides.querySelectorAll( '.fragment' ) ).forEach( function( element ) {\n\t\t\t\telement.classList.add( 'visible' );\n\t\t\t\telement.classList.remove( 'current-fragment' );\n\t\t\t} );\n\t\t}\n\n\t\t// Slide numbers\n\t\tvar slideNumberDisplay = 'none';\n\t\tif( config.slideNumber && !isPrintingPDF() ) {\n\t\t\tif( config.showSlideNumber === 'all' ) {\n\t\t\t\tslideNumberDisplay = 'block';\n\t\t\t}\n\t\t\telse if( config.showSlideNumber === 'speaker' && isSpeakerNotes() ) {\n\t\t\t\tslideNumberDisplay = 'block';\n\t\t\t}\n\t\t}\n\n\t\tdom.slideNumber.style.display = slideNumberDisplay;\n\n\t\tsync();\n\n\t}\n\n\t/**\n\t * Binds all event listeners.\n\t */\n\tfunction addEventListeners() {\n\n\t\teventsAreBound = true;\n\n\t\twindow.addEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.addEventListener( 'resize', onWindowResize, false );\n\n\t\tif( config.touch ) {\n\t\t\tdom.wrapper.addEventListener( 'touchstart', onTouchStart, false );\n\t\t\tdom.wrapper.addEventListener( 'touchmove', onTouchMove, false );\n\t\t\tdom.wrapper.addEventListener( 'touchend', onTouchEnd, false );\n\n\t\t\t// Support pointer-style touch interaction as well\n\t\t\tif( window.navigator.pointerEnabled ) {\n\t\t\t\t// IE 11 uses un-prefixed version of pointer events\n\t\t\t\tdom.wrapper.addEventListener( 'pointerdown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'pointermove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'pointerup', onPointerUp, false );\n\t\t\t}\n\t\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\t\t// IE 10 uses prefixed version of pointer events\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t\t}\n\t\t}\n\n\t\tif( config.keyboard ) {\n\t\t\tdocument.addEventListener( 'keydown', onDocumentKeyDown, false );\n\t\t\tdocument.addEventListener( 'keypress', onDocumentKeyPress, false );\n\t\t}\n\n\t\tif( config.progress && dom.progress ) {\n\t\t\tdom.progress.addEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\tif( config.focusBodyOnPageVisibilityChange ) {\n\t\t\tvar visibilityChange;\n\n\t\t\tif( 'hidden' in document ) {\n\t\t\t\tvisibilityChange = 'visibilitychange';\n\t\t\t}\n\t\t\telse if( 'msHidden' in document ) {\n\t\t\t\tvisibilityChange = 'msvisibilitychange';\n\t\t\t}\n\t\t\telse if( 'webkitHidden' in document ) {\n\t\t\t\tvisibilityChange = 'webkitvisibilitychange';\n\t\t\t}\n\n\t\t\tif( visibilityChange ) {\n\t\t\t\tdocument.addEventListener( visibilityChange, onPageVisibilityChange, false );\n\t\t\t}\n\t\t}\n\n\t\t// Listen to both touch and click events, in case the device\n\t\t// supports both\n\t\tvar pointerEvents = [ 'touchstart', 'click' ];\n\n\t\t// Only support touch for Android, fixes double navigations in\n\t\t// stock browser\n\t\tif( UA.match( /android/gi ) ) {\n\t\t\tpointerEvents = [ 'touchstart' ];\n\t\t}\n\n\t\tpointerEvents.forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}\n\n\t/**\n\t * Unbinds all event listeners.\n\t */\n\tfunction removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t// IE11\n\t\tif( window.navigator.pointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t}\n\t\t// IE10\n\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}\n\n\t/**\n\t * Extend object a with the properties of object b.\n\t * If there's a conflict, object b takes precedence.\n\t *\n\t * @param {object} a\n\t * @param {object} b\n\t */\n\tfunction extend( a, b ) {\n\n\t\tfor( var i in b ) {\n\t\t\ta[ i ] = b[ i ];\n\t\t}\n\n\t\treturn a;\n\n\t}\n\n\t/**\n\t * Converts the target object to an array.\n\t *\n\t * @param {object} o\n\t * @return {object[]}\n\t */\n\tfunction toArray( o ) {\n\n\t\treturn Array.prototype.slice.call( o );\n\n\t}\n\n\t/**\n\t * Utility for deserializing a value.\n\t *\n\t * @param {*} value\n\t * @return {*}\n\t */\n\tfunction deserialize( value ) {\n\n\t\tif( typeof value === 'string' ) {\n\t\t\tif( value === 'null' ) return null;\n\t\t\telse if( value === 'true' ) return true;\n\t\t\telse if( value === 'false' ) return false;\n\t\t\telse if( value.match( /^-?[\\d\\.]+$/ ) ) return parseFloat( value );\n\t\t}\n\n\t\treturn value;\n\n\t}\n\n\t/**\n\t * Measures the distance in pixels between point a\n\t * and point b.\n\t *\n\t * @param {object} a point with x/y properties\n\t * @param {object} b point with x/y properties\n\t *\n\t * @return {number}\n\t */\n\tfunction distanceBetween( a, b ) {\n\n\t\tvar dx = a.x - b.x,\n\t\t\tdy = a.y - b.y;\n\n\t\treturn Math.sqrt( dx*dx + dy*dy );\n\n\t}\n\n\t/**\n\t * Applies a CSS transform to the target element.\n\t *\n\t * @param {HTMLElement} element\n\t * @param {string} transform\n\t */\n\tfunction transformElement( element, transform ) {\n\n\t\telement.style.WebkitTransform = transform;\n\t\telement.style.MozTransform = transform;\n\t\telement.style.msTransform = transform;\n\t\telement.style.transform = transform;\n\n\t}\n\n\t/**\n\t * Applies CSS transforms to the slides container. The container\n\t * is transformed from two separate sources: layout and the overview\n\t * mode.\n\t *\n\t * @param {object} transforms\n\t */\n\tfunction transformSlides( transforms ) {\n\n\t\t// Pick up new transforms from arguments\n\t\tif( typeof transforms.layout === 'string' ) slidesTransform.layout = transforms.layout;\n\t\tif( typeof transforms.overview === 'string' ) slidesTransform.overview = transforms.overview;\n\n\t\t// Apply the transforms to the slides container\n\t\tif( slidesTransform.layout ) {\n\t\t\ttransformElement( dom.slides, slidesTransform.layout + ' ' + slidesTransform.overview );\n\t\t}\n\t\telse {\n\t\t\ttransformElement( dom.slides, slidesTransform.overview );\n\t\t}\n\n\t}\n\n\t/**\n\t * Injects the given CSS styles into the DOM.\n\t *\n\t * @param {string} value\n\t */\n\tfunction injectStyleSheet( value ) {\n\n\t\tvar tag = document.createElement( 'style' );\n\t\ttag.type = 'text/css';\n\t\tif( tag.styleSheet ) {\n\t\t\ttag.styleSheet.cssText = value;\n\t\t}\n\t\telse {\n\t\t\ttag.appendChild( document.createTextNode( value ) );\n\t\t}\n\t\tdocument.getElementsByTagName( 'head' )[0].appendChild( tag );\n\n\t}\n\n\t/**\n\t * Find the closest parent that matches the given\n\t * selector.\n\t *\n\t * @param {HTMLElement} target The child element\n\t * @param {String} selector The CSS selector to match\n\t * the parents against\n\t *\n\t * @return {HTMLElement} The matched parent or null\n\t * if no matching parent was found\n\t */\n\tfunction closestParent( target, selector ) {\n\n\t\tvar parent = target.parentNode;\n\n\t\twhile( parent ) {\n\n\t\t\t// There's some overhead doing this each time, we don't\n\t\t\t// want to rewrite the element prototype but should still\n\t\t\t// be enough to feature detect once at startup...\n\t\t\tvar matchesMethod = parent.matches || parent.matchesSelector || parent.msMatchesSelector;\n\n\t\t\t// If we find a match, we're all set\n\t\t\tif( matchesMethod && matchesMethod.call( parent, selector ) ) {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\t// Keep searching\n\t\t\tparent = parent.parentNode;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Converts various color input formats to an {r:0,g:0,b:0} object.\n\t *\n\t * @param {string} color The string representation of a color\n\t * @example\n\t * colorToRgb('#000');\n\t * @example\n\t * colorToRgb('#000000');\n\t * @example\n\t * colorToRgb('rgb(0,0,0)');\n\t * @example\n\t * colorToRgb('rgba(0,0,0)');\n\t *\n\t * @return {{r: number, g: number, b: number, [a]: number}|null}\n\t */\n\tfunction colorToRgb( color ) {\n\n\t\tvar hex3 = color.match( /^#([0-9a-f]{3})$/i );\n\t\tif( hex3 && hex3[1] ) {\n\t\t\thex3 = hex3[1];\n\t\t\treturn {\n\t\t\t\tr: parseInt( hex3.charAt( 0 ), 16 ) * 0x11,\n\t\t\t\tg: parseInt( hex3.charAt( 1 ), 16 ) * 0x11,\n\t\t\t\tb: parseInt( hex3.charAt( 2 ), 16 ) * 0x11\n\t\t\t};\n\t\t}\n\n\t\tvar hex6 = color.match( /^#([0-9a-f]{6})$/i );\n\t\tif( hex6 && hex6[1] ) {\n\t\t\thex6 = hex6[1];\n\t\t\treturn {\n\t\t\t\tr: parseInt( hex6.substr( 0, 2 ), 16 ),\n\t\t\t\tg: parseInt( hex6.substr( 2, 2 ), 16 ),\n\t\t\t\tb: parseInt( hex6.substr( 4, 2 ), 16 )\n\t\t\t};\n\t\t}\n\n\t\tvar rgb = color.match( /^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/i );\n\t\tif( rgb ) {\n\t\t\treturn {\n\t\t\t\tr: parseInt( rgb[1], 10 ),\n\t\t\t\tg: parseInt( rgb[2], 10 ),\n\t\t\t\tb: parseInt( rgb[3], 10 )\n\t\t\t};\n\t\t}\n\n\t\tvar rgba = color.match( /^rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\,\\s*([\\d]+|[\\d]*.[\\d]+)\\s*\\)$/i );\n\t\tif( rgba ) {\n\t\t\treturn {\n\t\t\t\tr: parseInt( rgba[1], 10 ),\n\t\t\t\tg: parseInt( rgba[2], 10 ),\n\t\t\t\tb: parseInt( rgba[3], 10 ),\n\t\t\t\ta: parseFloat( rgba[4] )\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Calculates brightness on a scale of 0-255.\n\t *\n\t * @param {string} color See colorToRgb for supported formats.\n\t * @see {@link colorToRgb}\n\t */\n\tfunction colorBrightness( color ) {\n\n\t\tif( typeof color === 'string' ) color = colorToRgb( color );\n\n\t\tif( color ) {\n\t\t\treturn ( color.r * 299 + color.g * 587 + color.b * 114 ) / 1000;\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Returns the remaining height within the parent of the\n\t * target element.\n\t *\n\t * remaining height = [ configured parent height ] - [ current parent height ]\n\t *\n\t * @param {HTMLElement} element\n\t * @param {number} [height]\n\t */\n\tfunction getRemainingHeight( element, height ) {\n\n\t\theight = height || 0;\n\n\t\tif( element ) {\n\t\t\tvar newHeight, oldHeight = element.style.height;\n\n\t\t\t// Change the .stretch element height to 0 in order find the height of all\n\t\t\t// the other elements\n\t\t\telement.style.height = '0px';\n\t\t\tnewHeight = height - element.parentNode.offsetHeight;\n\n\t\t\t// Restore the old height, just in case\n\t\t\telement.style.height = oldHeight + 'px';\n\n\t\t\treturn newHeight;\n\t\t}\n\n\t\treturn height;\n\n\t}\n\n\t/**\n\t * Checks if this instance is being used to print a PDF.\n\t */\n\tfunction isPrintingPDF() {\n\n\t\treturn ( /print-pdf/gi ).test( window.location.search );\n\n\t}\n\n\t/**\n\t * Hides the address bar if we're on a mobile device.\n\t */\n\tfunction hideAddressBar() {\n\n\t\tif( config.hideAddressBar && isMobileDevice ) {\n\t\t\t// Events that should trigger the address bar to hide\n\t\t\twindow.addEventListener( 'load', removeAddressBar, false );\n\t\t\twindow.addEventListener( 'orientationchange', removeAddressBar, false );\n\t\t}\n\n\t}\n\n\t/**\n\t * Causes the address bar to hide on mobile devices,\n\t * more vertical space ftw.\n\t */\n\tfunction removeAddressBar() {\n\n\t\tsetTimeout( function() {\n\t\t\twindow.scrollTo( 0, 1 );\n\t\t}, 10 );\n\n\t}\n\n\t/**\n\t * Dispatches an event of the specified type from the\n\t * reveal DOM element.\n\t */\n\tfunction dispatchEvent( type, args ) {\n\n\t\tvar event = document.createEvent( 'HTMLEvents', 1, 2 );\n\t\tevent.initEvent( type, true, true );\n\t\textend( event, args );\n\t\tdom.wrapper.dispatchEvent( event );\n\n\t\t// If we're in an iframe, post each reveal.js event to the\n\t\t// parent window. Used by the notes plugin\n\t\tif( config.postMessageEvents && window.parent !== window.self ) {\n\t\t\twindow.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' );\n\t\t}\n\n\t}\n\n\t/**\n\t * Wrap all links in 3D goodness.\n\t */\n\tfunction enableRollingLinks() {\n\n\t\tif( features.transforms3d && !( 'msPerspective' in document.body.style ) ) {\n\t\t\tvar anchors = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' a' );\n\n\t\t\tfor( var i = 0, len = anchors.length; i < len; i++ ) {\n\t\t\t\tvar anchor = anchors[i];\n\n\t\t\t\tif( anchor.textContent && !anchor.querySelector( '*' ) && ( !anchor.className || !anchor.classList.contains( anchor, 'roll' ) ) ) {\n\t\t\t\t\tvar span = document.createElement('span');\n\t\t\t\t\tspan.setAttribute('data-title', anchor.text);\n\t\t\t\t\tspan.innerHTML = anchor.innerHTML;\n\n\t\t\t\t\tanchor.classList.add( 'roll' );\n\t\t\t\t\tanchor.innerHTML = '';\n\t\t\t\t\tanchor.appendChild(span);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Unwrap all 3D links.\n\t */\n\tfunction disableRollingLinks() {\n\n\t\tvar anchors = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' a.roll' );\n\n\t\tfor( var i = 0, len = anchors.length; i < len; i++ ) {\n\t\t\tvar anchor = anchors[i];\n\t\t\tvar span = anchor.querySelector( 'span' );\n\n\t\t\tif( span ) {\n\t\t\t\tanchor.classList.remove( 'roll' );\n\t\t\t\tanchor.innerHTML = span.innerHTML;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Bind preview frame links.\n\t *\n\t * @param {string} [selector=a] - selector for anchors\n\t */\n\tfunction enablePreviewLinks( selector ) {\n\n\t\tvar anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.addEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}\n\n\t/**\n\t * Unbind preview frame links.\n\t */\n\tfunction disablePreviewLinks( selector ) {\n\n\t\tvar anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.removeEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}\n\n\t/**\n\t * Opens a preview window for the target URL.\n\t *\n\t * @param {string} url - url for preview iframe src\n\t */\n\tfunction showPreview( url ) {\n\n\t\tcloseOverlay();\n\n\t\tdom.overlay = document.createElement( 'div' );\n\t\tdom.overlay.classList.add( 'overlay' );\n\t\tdom.overlay.classList.add( 'overlay-preview' );\n\t\tdom.wrapper.appendChild( dom.overlay );\n\n\t\tdom.overlay.innerHTML = [\n\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t'',\n\t\t\t'
',\n\t\t\t'
',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t\t'Unable to load iframe. This is likely due to the site\\'s policy (x-frame-options).',\n\t\t\t\t'',\n\t\t\t'
'\n\t\t].join('');\n\n\t\tdom.overlay.querySelector( 'iframe' ).addEventListener( 'load', function( event ) {\n\t\t\tdom.overlay.classList.add( 'loaded' );\n\t\t}, false );\n\n\t\tdom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) {\n\t\t\tcloseOverlay();\n\t\t\tevent.preventDefault();\n\t\t}, false );\n\n\t\tdom.overlay.querySelector( '.external' ).addEventListener( 'click', function( event ) {\n\t\t\tcloseOverlay();\n\t\t}, false );\n\n\t\tsetTimeout( function() {\n\t\t\tdom.overlay.classList.add( 'visible' );\n\t\t}, 1 );\n\n\t}\n\n\t/**\n\t * Open or close help overlay window.\n\t *\n\t * @param {Boolean} [override] Flag which overrides the\n\t * toggle logic and forcibly sets the desired state. True means\n\t * help is open, false means it's closed.\n\t */\n\tfunction toggleHelp( override ){\n\n\t\tif( typeof override === 'boolean' ) {\n\t\t\toverride ? showHelp() : closeOverlay();\n\t\t}\n\t\telse {\n\t\t\tif( dom.overlay ) {\n\t\t\t\tcloseOverlay();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tshowHelp();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Opens an overlay window with help material.\n\t */\n\tfunction showHelp() {\n\n\t\tif( config.help ) {\n\n\t\t\tcloseOverlay();\n\n\t\t\tdom.overlay = document.createElement( 'div' );\n\t\t\tdom.overlay.classList.add( 'overlay' );\n\t\t\tdom.overlay.classList.add( 'overlay-help' );\n\t\t\tdom.wrapper.appendChild( dom.overlay );\n\n\t\t\tvar html = '
Keyboard Shortcuts
';\n\n\t\t\thtml += '
KEY
ACTION
';\n\t\t\tfor( var key in keyboardShortcuts ) {\n\t\t\t\thtml += '
'\n\t\t\t].join('');\n\n\t\t\tdom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) {\n\t\t\t\tcloseOverlay();\n\t\t\t\tevent.preventDefault();\n\t\t\t}, false );\n\n\t\t\tsetTimeout( function() {\n\t\t\t\tdom.overlay.classList.add( 'visible' );\n\t\t\t}, 1 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Closes any currently open overlay.\n\t */\n\tfunction closeOverlay() {\n\n\t\tif( dom.overlay ) {\n\t\t\tdom.overlay.parentNode.removeChild( dom.overlay );\n\t\t\tdom.overlay = null;\n\t\t}\n\n\t}\n\n\t/**\n\t * Applies JavaScript-controlled layout rules to the\n\t * presentation.\n\t */\n\tfunction layout() {\n\n\t\tif( dom.wrapper && !isPrintingPDF() ) {\n\n\t\t\tvar size = getComputedSlideSize();\n\n\t\t\t// Layout the contents of the slides\n\t\t\tlayoutSlideContents( config.width, config.height );\n\n\t\t\tdom.slides.style.width = size.width + 'px';\n\t\t\tdom.slides.style.height = size.height + 'px';\n\n\t\t\t// Determine scale of content to fit within available space\n\t\t\tscale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height );\n\n\t\t\t// Respect max/min scale settings\n\t\t\tscale = Math.max( scale, config.minScale );\n\t\t\tscale = Math.min( scale, config.maxScale );\n\n\t\t\t// Don't apply any scaling styles if scale is 1\n\t\t\tif( scale === 1 ) {\n\t\t\t\tdom.slides.style.zoom = '';\n\t\t\t\tdom.slides.style.left = '';\n\t\t\t\tdom.slides.style.top = '';\n\t\t\t\tdom.slides.style.bottom = '';\n\t\t\t\tdom.slides.style.right = '';\n\t\t\t\ttransformSlides( { layout: '' } );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Prefer zoom for scaling up so that content remains crisp.\n\t\t\t\t// Don't use zoom to scale down since that can lead to shifts\n\t\t\t\t// in text layout/line breaks.\n\t\t\t\tif( scale > 1 && features.zoom ) {\n\t\t\t\t\tdom.slides.style.zoom = scale;\n\t\t\t\t\tdom.slides.style.left = '';\n\t\t\t\t\tdom.slides.style.top = '';\n\t\t\t\t\tdom.slides.style.bottom = '';\n\t\t\t\t\tdom.slides.style.right = '';\n\t\t\t\t\ttransformSlides( { layout: '' } );\n\t\t\t\t}\n\t\t\t\t// Apply scale transform as a fallback\n\t\t\t\telse {\n\t\t\t\t\tdom.slides.style.zoom = '';\n\t\t\t\t\tdom.slides.style.left = '50%';\n\t\t\t\t\tdom.slides.style.top = '50%';\n\t\t\t\t\tdom.slides.style.bottom = 'auto';\n\t\t\t\t\tdom.slides.style.right = 'auto';\n\t\t\t\t\ttransformSlides( { layout: 'translate(-50%, -50%) scale('+ scale +')' } );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all slides, vertical and horizontal\n\t\t\tvar slides = toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) );\n\n\t\t\tfor( var i = 0, len = slides.length; i < len; i++ ) {\n\t\t\t\tvar slide = slides[ i ];\n\n\t\t\t\t// Don't bother updating invisible slides\n\t\t\t\tif( slide.style.display === 'none' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif( config.center || slide.classList.contains( 'center' ) ) {\n\t\t\t\t\t// Vertical stacks are not centred since their section\n\t\t\t\t\t// children will be\n\t\t\t\t\tif( slide.classList.contains( 'stack' ) ) {\n\t\t\t\t\t\tslide.style.top = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tslide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tslide.style.top = '';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tupdateProgress();\n\t\t\tupdateParallax();\n\n\t\t\tif( isOverview() ) {\n\t\t\t\tupdateOverview();\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Applies layout logic to the contents of all slides in\n\t * the presentation.\n\t *\n\t * @param {string|number} width\n\t * @param {string|number} height\n\t */\n\tfunction layoutSlideContents( width, height ) {\n\n\t\t// Handle sizing of elements with the 'stretch' class\n\t\ttoArray( dom.slides.querySelectorAll( 'section > .stretch' ) ).forEach( function( element ) {\n\n\t\t\t// Determine how much vertical space we can use\n\t\t\tvar remainingHeight = getRemainingHeight( element, height );\n\n\t\t\t// Consider the aspect ratio of media elements\n\t\t\tif( /(img|video)/gi.test( element.nodeName ) ) {\n\t\t\t\tvar nw = element.naturalWidth || element.videoWidth,\n\t\t\t\t\tnh = element.naturalHeight || element.videoHeight;\n\n\t\t\t\tvar es = Math.min( width / nw, remainingHeight / nh );\n\n\t\t\t\telement.style.width = ( nw * es ) + 'px';\n\t\t\t\telement.style.height = ( nh * es ) + 'px';\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\telement.style.width = width + 'px';\n\t\t\t\telement.style.height = remainingHeight + 'px';\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Calculates the computed pixel size of our slides. These\n\t * values are based on the width and height configuration\n\t * options.\n\t *\n\t * @param {number} [presentationWidth=dom.wrapper.offsetWidth]\n\t * @param {number} [presentationHeight=dom.wrapper.offsetHeight]\n\t */\n\tfunction getComputedSlideSize( presentationWidth, presentationHeight ) {\n\n\t\tvar size = {\n\t\t\t// Slide size\n\t\t\twidth: config.width,\n\t\t\theight: config.height,\n\n\t\t\t// Presentation size\n\t\t\tpresentationWidth: presentationWidth || dom.wrapper.offsetWidth,\n\t\t\tpresentationHeight: presentationHeight || dom.wrapper.offsetHeight\n\t\t};\n\n\t\t// Reduce available space by margin\n\t\tsize.presentationWidth -= ( size.presentationWidth * config.margin );\n\t\tsize.presentationHeight -= ( size.presentationHeight * config.margin );\n\n\t\t// Slide width may be a percentage of available width\n\t\tif( typeof size.width === 'string' && /%$/.test( size.width ) ) {\n\t\t\tsize.width = parseInt( size.width, 10 ) / 100 * size.presentationWidth;\n\t\t}\n\n\t\t// Slide height may be a percentage of available height\n\t\tif( typeof size.height === 'string' && /%$/.test( size.height ) ) {\n\t\t\tsize.height = parseInt( size.height, 10 ) / 100 * size.presentationHeight;\n\t\t}\n\n\t\treturn size;\n\n\t}\n\n\t/**\n\t * Stores the vertical index of a stack so that the same\n\t * vertical slide can be selected when navigating to and\n\t * from the stack.\n\t *\n\t * @param {HTMLElement} stack The vertical stack element\n\t * @param {string|number} [v=0] Index to memorize\n\t */\n\tfunction setPreviousVerticalIndex( stack, v ) {\n\n\t\tif( typeof stack === 'object' && typeof stack.setAttribute === 'function' ) {\n\t\t\tstack.setAttribute( 'data-previous-indexv', v || 0 );\n\t\t}\n\n\t}\n\n\t/**\n\t * Retrieves the vertical index which was stored using\n\t * #setPreviousVerticalIndex() or 0 if no previous index\n\t * exists.\n\t *\n\t * @param {HTMLElement} stack The vertical stack element\n\t */\n\tfunction getPreviousVerticalIndex( stack ) {\n\n\t\tif( typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains( 'stack' ) ) {\n\t\t\t// Prefer manually defined start-indexv\n\t\t\tvar attributeName = stack.hasAttribute( 'data-start-indexv' ) ? 'data-start-indexv' : 'data-previous-indexv';\n\n\t\t\treturn parseInt( stack.getAttribute( attributeName ) || 0, 10 );\n\t\t}\n\n\t\treturn 0;\n\n\t}\n\n\t/**\n\t * Displays the overview of slides (quick nav) by scaling\n\t * down and arranging all slide elements.\n\t */\n\tfunction activateOverview() {\n\n\t\t// Only proceed if enabled in config\n\t\tif( config.overview && !isOverview() ) {\n\n\t\t\toverview = true;\n\n\t\t\tdom.wrapper.classList.add( 'overview' );\n\t\t\tdom.wrapper.classList.remove( 'overview-deactivating' );\n\n\t\t\tif( features.overviewTransitions ) {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tdom.wrapper.classList.add( 'overview-animated' );\n\t\t\t\t}, 1 );\n\t\t\t}\n\n\t\t\t// Don't auto-slide while in overview mode\n\t\t\tcancelAutoSlide();\n\n\t\t\t// Move the backgrounds element into the slide container to\n\t\t\t// that the same scaling is applied\n\t\t\tdom.slides.appendChild( dom.background );\n\n\t\t\t// Clicking on an overview slide navigates to it\n\t\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {\n\t\t\t\tif( !slide.classList.contains( 'stack' ) ) {\n\t\t\t\t\tslide.addEventListener( 'click', onOverviewSlideClicked, true );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Calculate slide sizes\n\t\t\tvar margin = 70;\n\t\t\tvar slideSize = getComputedSlideSize();\n\t\t\toverviewSlideWidth = slideSize.width + margin;\n\t\t\toverviewSlideHeight = slideSize.height + margin;\n\n\t\t\t// Reverse in RTL mode\n\t\t\tif( config.rtl ) {\n\t\t\t\toverviewSlideWidth = -overviewSlideWidth;\n\t\t\t}\n\n\t\t\tupdateSlidesVisibility();\n\t\t\tlayoutOverview();\n\t\t\tupdateOverview();\n\n\t\t\tlayout();\n\n\t\t\t// Notify observers of the overview showing\n\t\t\tdispatchEvent( 'overviewshown', {\n\t\t\t\t'indexh': indexh,\n\t\t\t\t'indexv': indexv,\n\t\t\t\t'currentSlide': currentSlide\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Uses CSS transforms to position all slides in a grid for\n\t * display inside of the overview mode.\n\t */\n\tfunction layoutOverview() {\n\n\t\t// Layout slides\n\t\ttoArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) {\n\t\t\thslide.setAttribute( 'data-index-h', h );\n\t\t\ttransformElement( hslide, 'translate3d(' + ( h * overviewSlideWidth ) + 'px, 0, 0)' );\n\n\t\t\tif( hslide.classList.contains( 'stack' ) ) {\n\n\t\t\t\ttoArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) {\n\t\t\t\t\tvslide.setAttribute( 'data-index-h', h );\n\t\t\t\t\tvslide.setAttribute( 'data-index-v', v );\n\n\t\t\t\t\ttransformElement( vslide, 'translate3d(0, ' + ( v * overviewSlideHeight ) + 'px, 0)' );\n\t\t\t\t} );\n\n\t\t\t}\n\t\t} );\n\n\t\t// Layout slide backgrounds\n\t\ttoArray( dom.background.childNodes ).forEach( function( hbackground, h ) {\n\t\t\ttransformElement( hbackground, 'translate3d(' + ( h * overviewSlideWidth ) + 'px, 0, 0)' );\n\n\t\t\ttoArray( hbackground.querySelectorAll( '.slide-background' ) ).forEach( function( vbackground, v ) {\n\t\t\t\ttransformElement( vbackground, 'translate3d(0, ' + ( v * overviewSlideHeight ) + 'px, 0)' );\n\t\t\t} );\n\t\t} );\n\n\t}\n\n\t/**\n\t * Moves the overview viewport to the current slides.\n\t * Called each time the current slide changes.\n\t */\n\tfunction updateOverview() {\n\n\t\tvar vmin = Math.min( window.innerWidth, window.innerHeight );\n\t\tvar scale = Math.max( vmin / 5, 150 ) / vmin;\n\n\t\ttransformSlides( {\n\t\t\toverview: [\n\t\t\t\t'scale('+ scale +')',\n\t\t\t\t'translateX('+ ( -indexh * overviewSlideWidth ) +'px)',\n\t\t\t\t'translateY('+ ( -indexv * overviewSlideHeight ) +'px)'\n\t\t\t].join( ' ' )\n\t\t} );\n\n\t}\n\n\t/**\n\t * Exits the slide overview and enters the currently\n\t * active slide.\n\t */\n\tfunction deactivateOverview() {\n\n\t\t// Only proceed if enabled in config\n\t\tif( config.overview ) {\n\n\t\t\toverview = false;\n\n\t\t\tdom.wrapper.classList.remove( 'overview' );\n\t\t\tdom.wrapper.classList.remove( 'overview-animated' );\n\n\t\t\t// Temporarily add a class so that transitions can do different things\n\t\t\t// depending on whether they are exiting/entering overview, or just\n\t\t\t// moving from slide to slide\n\t\t\tdom.wrapper.classList.add( 'overview-deactivating' );\n\n\t\t\tsetTimeout( function () {\n\t\t\t\tdom.wrapper.classList.remove( 'overview-deactivating' );\n\t\t\t}, 1 );\n\n\t\t\t// Move the background element back out\n\t\t\tdom.wrapper.appendChild( dom.background );\n\n\t\t\t// Clean up changes made to slides\n\t\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {\n\t\t\t\ttransformElement( slide, '' );\n\n\t\t\t\tslide.removeEventListener( 'click', onOverviewSlideClicked, true );\n\t\t\t} );\n\n\t\t\t// Clean up changes made to backgrounds\n\t\t\ttoArray( dom.background.querySelectorAll( '.slide-background' ) ).forEach( function( background ) {\n\t\t\t\ttransformElement( background, '' );\n\t\t\t} );\n\n\t\t\ttransformSlides( { overview: '' } );\n\n\t\t\tslide( indexh, indexv );\n\n\t\t\tlayout();\n\n\t\t\tcueAutoSlide();\n\n\t\t\t// Notify observers of the overview hiding\n\t\t\tdispatchEvent( 'overviewhidden', {\n\t\t\t\t'indexh': indexh,\n\t\t\t\t'indexv': indexv,\n\t\t\t\t'currentSlide': currentSlide\n\t\t\t} );\n\n\t\t}\n\t}\n\n\t/**\n\t * Toggles the slide overview mode on and off.\n\t *\n\t * @param {Boolean} [override] Flag which overrides the\n\t * toggle logic and forcibly sets the desired state. True means\n\t * overview is open, false means it's closed.\n\t */\n\tfunction toggleOverview( override ) {\n\n\t\tif( typeof override === 'boolean' ) {\n\t\t\toverride ? activateOverview() : deactivateOverview();\n\t\t}\n\t\telse {\n\t\t\tisOverview() ? deactivateOverview() : activateOverview();\n\t\t}\n\n\t}\n\n\t/**\n\t * Checks if the overview is currently active.\n\t *\n\t * @return {Boolean} true if the overview is active,\n\t * false otherwise\n\t */\n\tfunction isOverview() {\n\n\t\treturn overview;\n\n\t}\n\n\t/**\n\t * Checks if the current or specified slide is vertical\n\t * (nested within another slide).\n\t *\n\t * @param {HTMLElement} [slide=currentSlide] The slide to check\n\t * orientation of\n\t * @return {Boolean}\n\t */\n\tfunction isVerticalSlide( slide ) {\n\n\t\t// Prefer slide argument, otherwise use current slide\n\t\tslide = slide ? slide : currentSlide;\n\n\t\treturn slide && slide.parentNode && !!slide.parentNode.nodeName.match( /section/i );\n\n\t}\n\n\t/**\n\t * Handling the fullscreen functionality via the fullscreen API\n\t *\n\t * @see http://fullscreen.spec.whatwg.org/\n\t * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode\n\t */\n\tfunction enterFullscreen() {\n\n\t\tvar element = document.documentElement;\n\n\t\t// Check which implementation is available\n\t\tvar requestMethod = element.requestFullscreen ||\n\t\t\t\t\t\t\telement.webkitRequestFullscreen ||\n\t\t\t\t\t\t\telement.webkitRequestFullScreen ||\n\t\t\t\t\t\t\telement.mozRequestFullScreen ||\n\t\t\t\t\t\t\telement.msRequestFullscreen;\n\n\t\tif( requestMethod ) {\n\t\t\trequestMethod.apply( element );\n\t\t}\n\n\t}\n\n\t/**\n\t * Enters the paused mode which fades everything on screen to\n\t * black.\n\t */\n\tfunction pause() {\n\n\t\tif( config.pause ) {\n\t\t\tvar wasPaused = dom.wrapper.classList.contains( 'paused' );\n\n\t\t\tcancelAutoSlide();\n\t\t\tdom.wrapper.classList.add( 'paused' );\n\n\t\t\tif( wasPaused === false ) {\n\t\t\t\tdispatchEvent( 'paused' );\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Exits from the paused mode.\n\t */\n\tfunction resume() {\n\n\t\tvar wasPaused = dom.wrapper.classList.contains( 'paused' );\n\t\tdom.wrapper.classList.remove( 'paused' );\n\n\t\tcueAutoSlide();\n\n\t\tif( wasPaused ) {\n\t\t\tdispatchEvent( 'resumed' );\n\t\t}\n\n\t}\n\n\t/**\n\t * Toggles the paused mode on and off.\n\t */\n\tfunction togglePause( override ) {\n\n\t\tif( typeof override === 'boolean' ) {\n\t\t\toverride ? pause() : resume();\n\t\t}\n\t\telse {\n\t\t\tisPaused() ? resume() : pause();\n\t\t}\n\n\t}\n\n\t/**\n\t * Checks if we are currently in the paused mode.\n\t *\n\t * @return {Boolean}\n\t */\n\tfunction isPaused() {\n\n\t\treturn dom.wrapper.classList.contains( 'paused' );\n\n\t}\n\n\t/**\n\t * Toggles the auto slide mode on and off.\n\t *\n\t * @param {Boolean} [override] Flag which sets the desired state.\n\t * True means autoplay starts, false means it stops.\n\t */\n\n\tfunction toggleAutoSlide( override ) {\n\n\t\tif( typeof override === 'boolean' ) {\n\t\t\toverride ? resumeAutoSlide() : pauseAutoSlide();\n\t\t}\n\n\t\telse {\n\t\t\tautoSlidePaused ? resumeAutoSlide() : pauseAutoSlide();\n\t\t}\n\n\t}\n\n\t/**\n\t * Checks if the auto slide mode is currently on.\n\t *\n\t * @return {Boolean}\n\t */\n\tfunction isAutoSliding() {\n\n\t\treturn !!( autoSlide && !autoSlidePaused );\n\n\t}\n\n\t/**\n\t * Steps from the current point in the presentation to the\n\t * slide which matches the specified horizontal and vertical\n\t * indices.\n\t *\n\t * @param {number} [h=indexh] Horizontal index of the target slide\n\t * @param {number} [v=indexv] Vertical index of the target slide\n\t * @param {number} [f] Index of a fragment within the\n\t * target slide to activate\n\t * @param {number} [o] Origin for use in multimaster environments\n\t */\n\tfunction slide( h, v, f, o ) {\n\n\t\t// Remember where we were at before\n\t\tpreviousSlide = currentSlide;\n\n\t\t// Query all horizontal slides in the deck\n\t\tvar horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );\n\n\t\t// Abort if there are no slides\n\t\tif( horizontalSlides.length === 0 ) return;\n\n\t\t// If no vertical index is specified and the upcoming slide is a\n\t\t// stack, resume at its previous vertical index\n\t\tif( v === undefined && !isOverview() ) {\n\t\t\tv = getPreviousVerticalIndex( horizontalSlides[ h ] );\n\t\t}\n\n\t\t// If we were on a vertical stack, remember what vertical index\n\t\t// it was on so we can resume at the same position when returning\n\t\tif( previousSlide && previousSlide.parentNode && previousSlide.parentNode.classList.contains( 'stack' ) ) {\n\t\t\tsetPreviousVerticalIndex( previousSlide.parentNode, indexv );\n\t\t}\n\n\t\t// Remember the state before this slide\n\t\tvar stateBefore = state.concat();\n\n\t\t// Reset the state array\n\t\tstate.length = 0;\n\n\t\tvar indexhBefore = indexh || 0,\n\t\t\tindexvBefore = indexv || 0;\n\n\t\t// Activate and transition to the new slide\n\t\tindexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h );\n\t\tindexv = updateSlides( VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v );\n\n\t\t// Update the visibility of slides now that the indices have changed\n\t\tupdateSlidesVisibility();\n\n\t\tlayout();\n\n\t\t// Apply the new state\n\t\tstateLoop: for( var i = 0, len = state.length; i < len; i++ ) {\n\t\t\t// Check if this state existed on the previous slide. If it\n\t\t\t// did, we will avoid adding it repeatedly\n\t\t\tfor( var j = 0; j < stateBefore.length; j++ ) {\n\t\t\t\tif( stateBefore[j] === state[i] ) {\n\t\t\t\t\tstateBefore.splice( j, 1 );\n\t\t\t\t\tcontinue stateLoop;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdocument.documentElement.classList.add( state[i] );\n\n\t\t\t// Dispatch custom event matching the state's name\n\t\t\tdispatchEvent( state[i] );\n\t\t}\n\n\t\t// Clean up the remains of the previous state\n\t\twhile( stateBefore.length ) {\n\t\t\tdocument.documentElement.classList.remove( stateBefore.pop() );\n\t\t}\n\n\t\t// Update the overview if it's currently active\n\t\tif( isOverview() ) {\n\t\t\tupdateOverview();\n\t\t}\n\n\t\t// Find the current horizontal slide and any possible vertical slides\n\t\t// within it\n\t\tvar currentHorizontalSlide = horizontalSlides[ indexh ],\n\t\t\tcurrentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );\n\n\t\t// Store references to the previous and current slides\n\t\tcurrentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;\n\n\t\t// Show fragment, if specified\n\t\tif( typeof f !== 'undefined' ) {\n\t\t\tnavigateFragment( f );\n\t\t}\n\n\t\t// Dispatch an event if the slide changed\n\t\tvar slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore );\n\t\tif( slideChanged ) {\n\t\t\tdispatchEvent( 'slidechanged', {\n\t\t\t\t'indexh': indexh,\n\t\t\t\t'indexv': indexv,\n\t\t\t\t'previousSlide': previousSlide,\n\t\t\t\t'currentSlide': currentSlide,\n\t\t\t\t'origin': o\n\t\t\t} );\n\t\t}\n\t\telse {\n\t\t\t// Ensure that the previous slide is never the same as the current\n\t\t\tpreviousSlide = null;\n\t\t}\n\n\t\t// Solves an edge case where the previous slide maintains the\n\t\t// 'present' class when navigating between adjacent vertical\n\t\t// stacks\n\t\tif( previousSlide ) {\n\t\t\tpreviousSlide.classList.remove( 'present' );\n\t\t\tpreviousSlide.setAttribute( 'aria-hidden', 'true' );\n\n\t\t\t// Reset all slides upon navigate to home\n\t\t\t// Issue: #285\n\t\t\tif ( dom.wrapper.querySelector( HOME_SLIDE_SELECTOR ).classList.contains( 'present' ) ) {\n\t\t\t\t// Launch async task\n\t\t\t\tsetTimeout( function () {\n\t\t\t\t\tvar slides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.stack') ), i;\n\t\t\t\t\tfor( i in slides ) {\n\t\t\t\t\t\tif( slides[i] ) {\n\t\t\t\t\t\t\t// Reset stack\n\t\t\t\t\t\t\tsetPreviousVerticalIndex( slides[i], 0 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, 0 );\n\t\t\t}\n\t\t}\n\n\t\t// Handle embedded content\n\t\tif( slideChanged || !previousSlide ) {\n\t\t\tstopEmbeddedContent( previousSlide );\n\t\t\tstartEmbeddedContent( currentSlide );\n\t\t}\n\n\t\t// Announce the current slide contents, for screen readers\n\t\tdom.statusDiv.textContent = getStatusText( currentSlide );\n\n\t\tupdateControls();\n\t\tupdateProgress();\n\t\tupdateBackground();\n\t\tupdateParallax();\n\t\tupdateSlideNumber();\n\t\tupdateNotes();\n\n\t\t// Update the URL hash\n\t\twriteURL();\n\n\t\tcueAutoSlide();\n\n\t}\n\n\t/**\n\t * Syncs the presentation with the current DOM. Useful\n\t * when new slides or control elements are added or when\n\t * the configuration has changed.\n\t */\n\tfunction sync() {\n\n\t\t// Subscribe to input\n\t\tremoveEventListeners();\n\t\taddEventListeners();\n\n\t\t// Force a layout to make sure the current config is accounted for\n\t\tlayout();\n\n\t\t// Reflect the current autoSlide value\n\t\tautoSlide = config.autoSlide;\n\n\t\t// Start auto-sliding if it's enabled\n\t\tcueAutoSlide();\n\n\t\t// Re-create the slide backgrounds\n\t\tcreateBackgrounds();\n\n\t\t// Write the current hash to the URL\n\t\twriteURL();\n\n\t\tsortAllFragments();\n\n\t\tupdateControls();\n\t\tupdateProgress();\n\t\tupdateSlideNumber();\n\t\tupdateSlidesVisibility();\n\t\tupdateBackground( true );\n\t\tupdateNotesVisibility();\n\t\tupdateNotes();\n\n\t\tformatEmbeddedContent();\n\n\t\t// Start or stop embedded content depending on global config\n\t\tif( config.autoPlayMedia === false ) {\n\t\t\tstopEmbeddedContent( currentSlide, { unloadIframes: false } );\n\t\t}\n\t\telse {\n\t\t\tstartEmbeddedContent( currentSlide );\n\t\t}\n\n\t\tif( isOverview() ) {\n\t\t\tlayoutOverview();\n\t\t}\n\n\t}\n\n\t/**\n\t * Resets all vertical slides so that only the first\n\t * is visible.\n\t */\n\tfunction resetVerticalSlides() {\n\n\t\tvar horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );\n\t\thorizontalSlides.forEach( function( horizontalSlide ) {\n\n\t\t\tvar verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );\n\t\t\tverticalSlides.forEach( function( verticalSlide, y ) {\n\n\t\t\t\tif( y > 0 ) {\n\t\t\t\t\tverticalSlide.classList.remove( 'present' );\n\t\t\t\t\tverticalSlide.classList.remove( 'past' );\n\t\t\t\t\tverticalSlide.classList.add( 'future' );\n\t\t\t\t\tverticalSlide.setAttribute( 'aria-hidden', 'true' );\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Sorts and formats all of fragments in the\n\t * presentation.\n\t */\n\tfunction sortAllFragments() {\n\n\t\tvar horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );\n\t\thorizontalSlides.forEach( function( horizontalSlide ) {\n\n\t\t\tvar verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );\n\t\t\tverticalSlides.forEach( function( verticalSlide, y ) {\n\n\t\t\t\tsortFragments( verticalSlide.querySelectorAll( '.fragment' ) );\n\n\t\t\t} );\n\n\t\t\tif( verticalSlides.length === 0 ) sortFragments( horizontalSlide.querySelectorAll( '.fragment' ) );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Randomly shuffles all slides in the deck.\n\t */\n\tfunction shuffle() {\n\n\t\tvar slides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );\n\n\t\tslides.forEach( function( slide ) {\n\n\t\t\t// Insert this slide next to another random slide. This may\n\t\t\t// cause the slide to insert before itself but that's fine.\n\t\t\tdom.slides.insertBefore( slide, slides[ Math.floor( Math.random() * slides.length ) ] );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Updates one dimension of slides by showing the slide\n\t * with the specified index.\n\t *\n\t * @param {string} selector A CSS selector that will fetch\n\t * the group of slides we are working with\n\t * @param {number} index The index of the slide that should be\n\t * shown\n\t *\n\t * @return {number} The index of the slide that is now shown,\n\t * might differ from the passed in index if it was out of\n\t * bounds.\n\t */\n\tfunction updateSlides( selector, index ) {\n\n\t\t// Select all slides and convert the NodeList result to\n\t\t// an array\n\t\tvar slides = toArray( dom.wrapper.querySelectorAll( selector ) ),\n\t\t\tslidesLength = slides.length;\n\n\t\tvar printMode = isPrintingPDF();\n\n\t\tif( slidesLength ) {\n\n\t\t\t// Should the index loop?\n\t\t\tif( config.loop ) {\n\t\t\t\tindex %= slidesLength;\n\n\t\t\t\tif( index < 0 ) {\n\t\t\t\t\tindex = slidesLength + index;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Enforce max and minimum index bounds\n\t\t\tindex = Math.max( Math.min( index, slidesLength - 1 ), 0 );\n\n\t\t\tfor( var i = 0; i < slidesLength; i++ ) {\n\t\t\t\tvar element = slides[i];\n\n\t\t\t\tvar reverse = config.rtl && !isVerticalSlide( element );\n\n\t\t\t\telement.classList.remove( 'past' );\n\t\t\t\telement.classList.remove( 'present' );\n\t\t\t\telement.classList.remove( 'future' );\n\n\t\t\t\t// http://www.w3.org/html/wg/drafts/html/master/editing.html#the-hidden-attribute\n\t\t\t\telement.setAttribute( 'hidden', '' );\n\t\t\t\telement.setAttribute( 'aria-hidden', 'true' );\n\n\t\t\t\t// If this element contains vertical slides\n\t\t\t\tif( element.querySelector( 'section' ) ) {\n\t\t\t\t\telement.classList.add( 'stack' );\n\t\t\t\t}\n\n\t\t\t\t// If we're printing static slides, all slides are \"present\"\n\t\t\t\tif( printMode ) {\n\t\t\t\t\telement.classList.add( 'present' );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif( i < index ) {\n\t\t\t\t\t// Any element previous to index is given the 'past' class\n\t\t\t\t\telement.classList.add( reverse ? 'future' : 'past' );\n\n\t\t\t\t\tif( config.fragments ) {\n\t\t\t\t\t\tvar pastFragments = toArray( element.querySelectorAll( '.fragment' ) );\n\n\t\t\t\t\t\t// Show all fragments on prior slides\n\t\t\t\t\t\twhile( pastFragments.length ) {\n\t\t\t\t\t\t\tvar pastFragment = pastFragments.pop();\n\t\t\t\t\t\t\tpastFragment.classList.add( 'visible' );\n\t\t\t\t\t\t\tpastFragment.classList.remove( 'current-fragment' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if( i > index ) {\n\t\t\t\t\t// Any element subsequent to index is given the 'future' class\n\t\t\t\t\telement.classList.add( reverse ? 'past' : 'future' );\n\n\t\t\t\t\tif( config.fragments ) {\n\t\t\t\t\t\tvar futureFragments = toArray( element.querySelectorAll( '.fragment.visible' ) );\n\n\t\t\t\t\t\t// No fragments in future slides should be visible ahead of time\n\t\t\t\t\t\twhile( futureFragments.length ) {\n\t\t\t\t\t\t\tvar futureFragment = futureFragments.pop();\n\t\t\t\t\t\t\tfutureFragment.classList.remove( 'visible' );\n\t\t\t\t\t\t\tfutureFragment.classList.remove( 'current-fragment' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Mark the current slide as present\n\t\t\tslides[index].classList.add( 'present' );\n\t\t\tslides[index].removeAttribute( 'hidden' );\n\t\t\tslides[index].removeAttribute( 'aria-hidden' );\n\n\t\t\t// If this slide has a state associated with it, add it\n\t\t\t// onto the current state of the deck\n\t\t\tvar slideState = slides[index].getAttribute( 'data-state' );\n\t\t\tif( slideState ) {\n\t\t\t\tstate = state.concat( slideState.split( ' ' ) );\n\t\t\t}\n\n\t\t}\n\t\telse {\n\t\t\t// Since there are no slides we can't be anywhere beyond the\n\t\t\t// zeroth index\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn index;\n\n\t}\n\n\t/**\n\t * Optimization method; hide all slides that are far away\n\t * from the present slide.\n\t */\n\tfunction updateSlidesVisibility() {\n\n\t\t// Select all slides and convert the NodeList result to\n\t\t// an array\n\t\tvar horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ),\n\t\t\thorizontalSlidesLength = horizontalSlides.length,\n\t\t\tdistanceX,\n\t\t\tdistanceY;\n\n\t\tif( horizontalSlidesLength && typeof indexh !== 'undefined' ) {\n\n\t\t\t// The number of steps away from the present slide that will\n\t\t\t// be visible\n\t\t\tvar viewDistance = isOverview() ? 10 : config.viewDistance;\n\n\t\t\t// Limit view distance on weaker devices\n\t\t\tif( isMobileDevice ) {\n\t\t\t\tviewDistance = isOverview() ? 6 : 2;\n\t\t\t}\n\n\t\t\t// All slides need to be visible when exporting to PDF\n\t\t\tif( isPrintingPDF() ) {\n\t\t\t\tviewDistance = Number.MAX_VALUE;\n\t\t\t}\n\n\t\t\tfor( var x = 0; x < horizontalSlidesLength; x++ ) {\n\t\t\t\tvar horizontalSlide = horizontalSlides[x];\n\n\t\t\t\tvar verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ),\n\t\t\t\t\tverticalSlidesLength = verticalSlides.length;\n\n\t\t\t\t// Determine how far away this slide is from the present\n\t\t\t\tdistanceX = Math.abs( ( indexh || 0 ) - x ) || 0;\n\n\t\t\t\t// If the presentation is looped, distance should measure\n\t\t\t\t// 1 between the first and last slides\n\t\t\t\tif( config.loop ) {\n\t\t\t\t\tdistanceX = Math.abs( ( ( indexh || 0 ) - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0;\n\t\t\t\t}\n\n\t\t\t\t// Show the horizontal slide if it's within the view distance\n\t\t\t\tif( distanceX < viewDistance ) {\n\t\t\t\t\tloadSlide( horizontalSlide );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tunloadSlide( horizontalSlide );\n\t\t\t\t}\n\n\t\t\t\tif( verticalSlidesLength ) {\n\n\t\t\t\t\tvar oy = getPreviousVerticalIndex( horizontalSlide );\n\n\t\t\t\t\tfor( var y = 0; y < verticalSlidesLength; y++ ) {\n\t\t\t\t\t\tvar verticalSlide = verticalSlides[y];\n\n\t\t\t\t\t\tdistanceY = x === ( indexh || 0 ) ? Math.abs( ( indexv || 0 ) - y ) : Math.abs( y - oy );\n\n\t\t\t\t\t\tif( distanceX + distanceY < viewDistance ) {\n\t\t\t\t\t\t\tloadSlide( verticalSlide );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tunloadSlide( verticalSlide );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Flag if there are ANY vertical slides, anywhere in the deck\n\t\t\tif( dom.wrapper.querySelectorAll( '.slides>section>section' ).length ) {\n\t\t\t\tdom.wrapper.classList.add( 'has-vertical-slides' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdom.wrapper.classList.remove( 'has-vertical-slides' );\n\t\t\t}\n\n\t\t\t// Flag if there are ANY horizontal slides, anywhere in the deck\n\t\t\tif( dom.wrapper.querySelectorAll( '.slides>section' ).length > 1 ) {\n\t\t\t\tdom.wrapper.classList.add( 'has-horizontal-slides' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdom.wrapper.classList.remove( 'has-horizontal-slides' );\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Pick up notes from the current slide and display them\n\t * to the viewer.\n\t *\n\t * @see {@link config.showNotes}\n\t */\n\tfunction updateNotes() {\n\n\t\tif( config.showNotes && dom.speakerNotes && currentSlide && !isPrintingPDF() ) {\n\n\t\t\tdom.speakerNotes.innerHTML = getSlideNotes() || 'No notes on this slide.';\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the visibility of the speaker notes sidebar that\n\t * is used to share annotated slides. The notes sidebar is\n\t * only visible if showNotes is true and there are notes on\n\t * one or more slides in the deck.\n\t */\n\tfunction updateNotesVisibility() {\n\n\t\tif( config.showNotes && hasNotes() ) {\n\t\t\tdom.wrapper.classList.add( 'show-notes' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'show-notes' );\n\t\t}\n\n\t}\n\n\t/**\n\t * Checks if there are speaker notes for ANY slide in the\n\t * presentation.\n\t */\n\tfunction hasNotes() {\n\n\t\treturn dom.slides.querySelectorAll( '[data-notes], aside.notes' ).length > 0;\n\n\t}\n\n\t/**\n\t * Updates the progress bar to reflect the current slide.\n\t */\n\tfunction updateProgress() {\n\n\t\t// Update progress if enabled\n\t\tif( config.progress && dom.progressbar ) {\n\n\t\t\tdom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the slide number div to reflect the current slide.\n\t *\n\t * The following slide number formats are available:\n\t * \"h.v\":\thorizontal . vertical slide number (default)\n\t * \"h/v\":\thorizontal / vertical slide number\n\t * \"c\":\tflattened slide number\n\t * \"c/t\":\tflattened slide number / total slides\n\t */\n\tfunction updateSlideNumber() {\n\n\t\t// Update slide number if enabled\n\t\tif( config.slideNumber && dom.slideNumber ) {\n\n\t\t\tvar value = [];\n\t\t\tvar format = 'h.v';\n\n\t\t\t// Check if a custom number format is available\n\t\t\tif( typeof config.slideNumber === 'string' ) {\n\t\t\t\tformat = config.slideNumber;\n\t\t\t}\n\n\t\t\tswitch( format ) {\n\t\t\t\tcase 'c':\n\t\t\t\t\tvalue.push( getSlidePastCount() + 1 );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'c/t':\n\t\t\t\t\tvalue.push( getSlidePastCount() + 1, '/', getTotalSlides() );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h/v':\n\t\t\t\t\tvalue.push( indexh + 1 );\n\t\t\t\t\tif( isVerticalSlide() ) value.push( '/', indexv + 1 );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalue.push( indexh + 1 );\n\t\t\t\t\tif( isVerticalSlide() ) value.push( '.', indexv + 1 );\n\t\t\t}\n\n\t\t\tdom.slideNumber.innerHTML = formatSlideNumber( value[0], value[1], value[2] );\n\t\t}\n\n\t}\n\n\t/**\n\t * Applies HTML formatting to a slide number before it's\n\t * written to the DOM.\n\t *\n\t * @param {number} a Current slide\n\t * @param {string} delimiter Character to separate slide numbers\n\t * @param {(number|*)} b Total slides\n\t * @return {string} HTML string fragment\n\t */\n\tfunction formatSlideNumber( a, delimiter, b ) {\n\n\t\tif( typeof b === 'number' && !isNaN( b ) ) {\n\t\t\treturn ''+ a +'' +\n\t\t\t\t\t''+ delimiter +'' +\n\t\t\t\t\t''+ b +'';\n\t\t}\n\t\telse {\n\t\t\treturn ''+ a +'';\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the state of all control/navigation arrows.\n\t */\n\tfunction updateControls() {\n\n\t\tvar routes = availableRoutes();\n\t\tvar fragments = availableFragments();\n\n\t\t// Remove the 'enabled' class from all directions\n\t\tdom.controlsLeft.concat( dom.controlsRight )\n\t\t\t\t\t\t.concat( dom.controlsUp )\n\t\t\t\t\t\t.concat( dom.controlsDown )\n\t\t\t\t\t\t.concat( dom.controlsPrev )\n\t\t\t\t\t\t.concat( dom.controlsNext ).forEach( function( node ) {\n\t\t\tnode.classList.remove( 'enabled' );\n\t\t\tnode.classList.remove( 'fragmented' );\n\n\t\t\t// Set 'disabled' attribute on all directions\n\t\t\tnode.setAttribute( 'disabled', 'disabled' );\n\t\t} );\n\n\t\t// Add the 'enabled' class to the available routes; remove 'disabled' attribute to enable buttons\n\t\tif( routes.left ) dom.controlsLeft.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\tif( routes.right ) dom.controlsRight.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\tif( routes.up ) dom.controlsUp.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\tif( routes.down ) dom.controlsDown.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\n\t\t// Prev/next buttons\n\t\tif( routes.left || routes.up ) dom.controlsPrev.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\tif( routes.right || routes.down ) dom.controlsNext.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\n\t\t// Highlight fragment directions\n\t\tif( currentSlide ) {\n\n\t\t\t// Always apply fragment decorator to prev/next buttons\n\t\t\tif( fragments.prev ) dom.controlsPrev.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\t\tif( fragments.next ) dom.controlsNext.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\n\t\t\t// Apply fragment decorators to directional buttons based on\n\t\t\t// what slide axis they are in\n\t\t\tif( isVerticalSlide( currentSlide ) ) {\n\t\t\t\tif( fragments.prev ) dom.controlsUp.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\t\t\tif( fragments.next ) dom.controlsDown.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif( fragments.prev ) dom.controlsLeft.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\t\t\tif( fragments.next ) dom.controlsRight.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );\n\t\t\t}\n\n\t\t}\n\n\t\tif( config.controlsTutorial ) {\n\n\t\t\t// Highlight control arrows with an animation to ensure\n\t\t\t// that the viewer knows how to navigate\n\t\t\tif( !hasNavigatedDown && routes.down ) {\n\t\t\t\tdom.controlsDownArrow.classList.add( 'highlight' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdom.controlsDownArrow.classList.remove( 'highlight' );\n\n\t\t\t\tif( !hasNavigatedRight && routes.right && indexv === 0 ) {\n\t\t\t\t\tdom.controlsRightArrow.classList.add( 'highlight' );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdom.controlsRightArrow.classList.remove( 'highlight' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the background elements to reflect the current\n\t * slide.\n\t *\n\t * @param {boolean} includeAll If true, the backgrounds of\n\t * all vertical slides (not just the present) will be updated.\n\t */\n\tfunction updateBackground( includeAll ) {\n\n\t\tvar currentBackground = null;\n\n\t\t// Reverse past/future classes when in RTL mode\n\t\tvar horizontalPast = config.rtl ? 'future' : 'past',\n\t\t\thorizontalFuture = config.rtl ? 'past' : 'future';\n\n\t\t// Update the classes of all backgrounds to match the\n\t\t// states of their slides (past/present/future)\n\t\ttoArray( dom.background.childNodes ).forEach( function( backgroundh, h ) {\n\n\t\t\tbackgroundh.classList.remove( 'past' );\n\t\t\tbackgroundh.classList.remove( 'present' );\n\t\t\tbackgroundh.classList.remove( 'future' );\n\n\t\t\tif( h < indexh ) {\n\t\t\t\tbackgroundh.classList.add( horizontalPast );\n\t\t\t}\n\t\t\telse if ( h > indexh ) {\n\t\t\t\tbackgroundh.classList.add( horizontalFuture );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbackgroundh.classList.add( 'present' );\n\n\t\t\t\t// Store a reference to the current background element\n\t\t\t\tcurrentBackground = backgroundh;\n\t\t\t}\n\n\t\t\tif( includeAll || h === indexh ) {\n\t\t\t\ttoArray( backgroundh.querySelectorAll( '.slide-background' ) ).forEach( function( backgroundv, v ) {\n\n\t\t\t\t\tbackgroundv.classList.remove( 'past' );\n\t\t\t\t\tbackgroundv.classList.remove( 'present' );\n\t\t\t\t\tbackgroundv.classList.remove( 'future' );\n\n\t\t\t\t\tif( v < indexv ) {\n\t\t\t\t\t\tbackgroundv.classList.add( 'past' );\n\t\t\t\t\t}\n\t\t\t\t\telse if ( v > indexv ) {\n\t\t\t\t\t\tbackgroundv.classList.add( 'future' );\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tbackgroundv.classList.add( 'present' );\n\n\t\t\t\t\t\t// Only if this is the present horizontal and vertical slide\n\t\t\t\t\t\tif( h === indexh ) currentBackground = backgroundv;\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\t\t\t}\n\n\t\t} );\n\n\t\t// Stop content inside of previous backgrounds\n\t\tif( previousBackground ) {\n\n\t\t\tstopEmbeddedContent( previousBackground );\n\n\t\t}\n\n\t\t// Start content in the current background\n\t\tif( currentBackground ) {\n\n\t\t\tstartEmbeddedContent( currentBackground );\n\n\t\t\tvar backgroundImageURL = currentBackground.style.backgroundImage || '';\n\n\t\t\t// Restart GIFs (doesn't work in Firefox)\n\t\t\tif( /\\.gif/i.test( backgroundImageURL ) ) {\n\t\t\t\tcurrentBackground.style.backgroundImage = '';\n\t\t\t\twindow.getComputedStyle( currentBackground ).opacity;\n\t\t\t\tcurrentBackground.style.backgroundImage = backgroundImageURL;\n\t\t\t}\n\n\t\t\t// Don't transition between identical backgrounds. This\n\t\t\t// prevents unwanted flicker.\n\t\t\tvar previousBackgroundHash = previousBackground ? previousBackground.getAttribute( 'data-background-hash' ) : null;\n\t\t\tvar currentBackgroundHash = currentBackground.getAttribute( 'data-background-hash' );\n\t\t\tif( currentBackgroundHash && currentBackgroundHash === previousBackgroundHash && currentBackground !== previousBackground ) {\n\t\t\t\tdom.background.classList.add( 'no-transition' );\n\t\t\t}\n\n\t\t\tpreviousBackground = currentBackground;\n\n\t\t}\n\n\t\t// If there's a background brightness flag for this slide,\n\t\t// bubble it to the .reveal container\n\t\tif( currentSlide ) {\n\t\t\t[ 'has-light-background', 'has-dark-background' ].forEach( function( classToBubble ) {\n\t\t\t\tif( currentSlide.classList.contains( classToBubble ) ) {\n\t\t\t\t\tdom.wrapper.classList.add( classToBubble );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdom.wrapper.classList.remove( classToBubble );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Allow the first background to apply without transition\n\t\tsetTimeout( function() {\n\t\t\tdom.background.classList.remove( 'no-transition' );\n\t\t}, 1 );\n\n\t}\n\n\t/**\n\t * Updates the position of the parallax background based\n\t * on the current slide index.\n\t */\n\tfunction updateParallax() {\n\n\t\tif( config.parallaxBackgroundImage ) {\n\n\t\t\tvar horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ),\n\t\t\t\tverticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR );\n\n\t\t\tvar backgroundSize = dom.background.style.backgroundSize.split( ' ' ),\n\t\t\t\tbackgroundWidth, backgroundHeight;\n\n\t\t\tif( backgroundSize.length === 1 ) {\n\t\t\t\tbackgroundWidth = backgroundHeight = parseInt( backgroundSize[0], 10 );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbackgroundWidth = parseInt( backgroundSize[0], 10 );\n\t\t\t\tbackgroundHeight = parseInt( backgroundSize[1], 10 );\n\t\t\t}\n\n\t\t\tvar slideWidth = dom.background.offsetWidth,\n\t\t\t\thorizontalSlideCount = horizontalSlides.length,\n\t\t\t\thorizontalOffsetMultiplier,\n\t\t\t\thorizontalOffset;\n\n\t\t\tif( typeof config.parallaxBackgroundHorizontal === 'number' ) {\n\t\t\t\thorizontalOffsetMultiplier = config.parallaxBackgroundHorizontal;\n\t\t\t}\n\t\t\telse {\n\t\t\t\thorizontalOffsetMultiplier = horizontalSlideCount > 1 ? ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 ) : 0;\n\t\t\t}\n\n\t\t\thorizontalOffset = horizontalOffsetMultiplier * indexh * -1;\n\n\t\t\tvar slideHeight = dom.background.offsetHeight,\n\t\t\t\tverticalSlideCount = verticalSlides.length,\n\t\t\t\tverticalOffsetMultiplier,\n\t\t\t\tverticalOffset;\n\n\t\t\tif( typeof config.parallaxBackgroundVertical === 'number' ) {\n\t\t\t\tverticalOffsetMultiplier = config.parallaxBackgroundVertical;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tverticalOffsetMultiplier = ( backgroundHeight - slideHeight ) / ( verticalSlideCount-1 );\n\t\t\t}\n\n\t\t\tverticalOffset = verticalSlideCount > 0 ? verticalOffsetMultiplier * indexv : 0;\n\n\t\t\tdom.background.style.backgroundPosition = horizontalOffset + 'px ' + -verticalOffset + 'px';\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Called when the given slide is within the configured view\n\t * distance. Shows the slide element and loads any content\n\t * that is set to load lazily (data-src).\n\t *\n\t * @param {HTMLElement} slide Slide to show\n\t */\n\tfunction loadSlide( slide, options ) {\n\n\t\toptions = options || {};\n\n\t\t// Show the slide element\n\t\tslide.style.display = config.display;\n\n\t\t// Media elements with data-src attributes\n\t\ttoArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src]' ) ).forEach( function( element ) {\n\t\t\telement.setAttribute( 'src', element.getAttribute( 'data-src' ) );\n\t\t\telement.setAttribute( 'data-lazy-loaded', '' );\n\t\t\telement.removeAttribute( 'data-src' );\n\t\t} );\n\n\t\t// Media elements with children\n\t\ttoArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( media ) {\n\t\t\tvar sources = 0;\n\n\t\t\ttoArray( media.querySelectorAll( 'source[data-src]' ) ).forEach( function( source ) {\n\t\t\t\tsource.setAttribute( 'src', source.getAttribute( 'data-src' ) );\n\t\t\t\tsource.removeAttribute( 'data-src' );\n\t\t\t\tsource.setAttribute( 'data-lazy-loaded', '' );\n\t\t\t\tsources += 1;\n\t\t\t} );\n\n\t\t\t// If we rewrote sources for this video/audio element, we need\n\t\t\t// to manually tell it to load from its new origin\n\t\t\tif( sources > 0 ) {\n\t\t\t\tmedia.load();\n\t\t\t}\n\t\t} );\n\n\n\t\t// Show the corresponding background element\n\t\tvar indices = getIndices( slide );\n\t\tvar background = getSlideBackground( indices.h, indices.v );\n\t\tif( background ) {\n\t\t\tbackground.style.display = 'block';\n\n\t\t\t// If the background contains media, load it\n\t\t\tif( background.hasAttribute( 'data-loaded' ) === false ) {\n\t\t\t\tbackground.setAttribute( 'data-loaded', 'true' );\n\n\t\t\t\tvar backgroundImage = slide.getAttribute( 'data-background-image' ),\n\t\t\t\t\tbackgroundVideo = slide.getAttribute( 'data-background-video' ),\n\t\t\t\t\tbackgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ),\n\t\t\t\t\tbackgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ),\n\t\t\t\t\tbackgroundIframe = slide.getAttribute( 'data-background-iframe' );\n\n\t\t\t\t// Images\n\t\t\t\tif( backgroundImage ) {\n\t\t\t\t\tbackground.style.backgroundImage = 'url('+ backgroundImage +')';\n\t\t\t\t}\n\t\t\t\t// Videos\n\t\t\t\telse if ( backgroundVideo && !isSpeakerNotes() ) {\n\t\t\t\t\tvar video = document.createElement( 'video' );\n\n\t\t\t\t\tif( backgroundVideoLoop ) {\n\t\t\t\t\t\tvideo.setAttribute( 'loop', '' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif( backgroundVideoMuted ) {\n\t\t\t\t\t\tvideo.muted = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Inline video playback works (at least in Mobile Safari) as\n\t\t\t\t\t// long as the video is muted and the `playsinline` attribute is\n\t\t\t\t\t// present\n\t\t\t\t\tif( isMobileDevice ) {\n\t\t\t\t\t\tvideo.muted = true;\n\t\t\t\t\t\tvideo.autoplay = true;\n\t\t\t\t\t\tvideo.setAttribute( 'playsinline', '' );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support comma separated lists of video sources\n\t\t\t\t\tbackgroundVideo.split( ',' ).forEach( function( source ) {\n\t\t\t\t\t\tvideo.innerHTML += '';\n\t\t\t\t\t} );\n\n\t\t\t\t\tbackground.appendChild( video );\n\t\t\t\t}\n\t\t\t\t// Iframes\n\t\t\t\telse if( backgroundIframe && options.excludeIframes !== true ) {\n\t\t\t\t\tvar iframe = document.createElement( 'iframe' );\n\t\t\t\t\tiframe.setAttribute( 'allowfullscreen', '' );\n\t\t\t\t\tiframe.setAttribute( 'mozallowfullscreen', '' );\n\t\t\t\t\tiframe.setAttribute( 'webkitallowfullscreen', '' );\n\n\t\t\t\t\t// Only load autoplaying content when the slide is shown to\n\t\t\t\t\t// avoid having it play in the background\n\t\t\t\t\tif( /autoplay=(1|true|yes)/gi.test( backgroundIframe ) ) {\n\t\t\t\t\t\tiframe.setAttribute( 'data-src', backgroundIframe );\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tiframe.setAttribute( 'src', backgroundIframe );\n\t\t\t\t\t}\n\n\t\t\t\t\tiframe.style.width = '100%';\n\t\t\t\t\tiframe.style.height = '100%';\n\t\t\t\t\tiframe.style.maxHeight = '100%';\n\t\t\t\t\tiframe.style.maxWidth = '100%';\n\n\t\t\t\t\tbackground.appendChild( iframe );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Unloads and hides the given slide. This is called when the\n\t * slide is moved outside of the configured view distance.\n\t *\n\t * @param {HTMLElement} slide\n\t */\n\tfunction unloadSlide( slide ) {\n\n\t\t// Hide the slide element\n\t\tslide.style.display = 'none';\n\n\t\t// Hide the corresponding background element\n\t\tvar indices = getIndices( slide );\n\t\tvar background = getSlideBackground( indices.h, indices.v );\n\t\tif( background ) {\n\t\t\tbackground.style.display = 'none';\n\t\t}\n\n\t\t// Reset lazy-loaded media elements with src attributes\n\t\ttoArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src]' ) ).forEach( function( element ) {\n\t\t\telement.setAttribute( 'data-src', element.getAttribute( 'src' ) );\n\t\t\telement.removeAttribute( 'src' );\n\t\t} );\n\n\t\t// Reset lazy-loaded media elements with children\n\t\ttoArray( slide.querySelectorAll( 'video[data-lazy-loaded] source[src], audio source[src]' ) ).forEach( function( source ) {\n\t\t\tsource.setAttribute( 'data-src', source.getAttribute( 'src' ) );\n\t\t\tsource.removeAttribute( 'src' );\n\t\t} );\n\n\t}\n\n\t/**\n\t * Determine what available routes there are for navigation.\n\t *\n\t * @return {{left: boolean, right: boolean, up: boolean, down: boolean}}\n\t */\n\tfunction availableRoutes() {\n\n\t\tvar horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ),\n\t\t\tverticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR );\n\n\t\tvar routes = {\n\t\t\tleft: indexh > 0 || config.loop,\n\t\t\tright: indexh < horizontalSlides.length - 1 || config.loop,\n\t\t\tup: indexv > 0,\n\t\t\tdown: indexv < verticalSlides.length - 1\n\t\t};\n\n\t\t// reverse horizontal controls for rtl\n\t\tif( config.rtl ) {\n\t\t\tvar left = routes.left;\n\t\t\troutes.left = routes.right;\n\t\t\troutes.right = left;\n\t\t}\n\n\t\treturn routes;\n\n\t}\n\n\t/**\n\t * Returns an object describing the available fragment\n\t * directions.\n\t *\n\t * @return {{prev: boolean, next: boolean}}\n\t */\n\tfunction availableFragments() {\n\n\t\tif( currentSlide && config.fragments ) {\n\t\t\tvar fragments = currentSlide.querySelectorAll( '.fragment' );\n\t\t\tvar hiddenFragments = currentSlide.querySelectorAll( '.fragment:not(.visible)' );\n\n\t\t\treturn {\n\t\t\t\tprev: fragments.length - hiddenFragments.length > 0,\n\t\t\t\tnext: !!hiddenFragments.length\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\treturn { prev: false, next: false };\n\t\t}\n\n\t}\n\n\t/**\n\t * Enforces origin-specific format rules for embedded media.\n\t */\n\tfunction formatEmbeddedContent() {\n\n\t\tvar _appendParamToIframeSource = function( sourceAttribute, sourceURL, param ) {\n\t\t\ttoArray( dom.slides.querySelectorAll( 'iframe['+ sourceAttribute +'*=\"'+ sourceURL +'\"]' ) ).forEach( function( el ) {\n\t\t\t\tvar src = el.getAttribute( sourceAttribute );\n\t\t\t\tif( src && src.indexOf( param ) === -1 ) {\n\t\t\t\t\tel.setAttribute( sourceAttribute, src + ( !/\\?/.test( src ) ? '?' : '&' ) + param );\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// YouTube frames must include \"?enablejsapi=1\"\n\t\t_appendParamToIframeSource( 'src', 'youtube.com/embed/', 'enablejsapi=1' );\n\t\t_appendParamToIframeSource( 'data-src', 'youtube.com/embed/', 'enablejsapi=1' );\n\n\t\t// Vimeo frames must include \"?api=1\"\n\t\t_appendParamToIframeSource( 'src', 'player.vimeo.com/', 'api=1' );\n\t\t_appendParamToIframeSource( 'data-src', 'player.vimeo.com/', 'api=1' );\n\n\t\t// Always show media controls on mobile devices\n\t\tif( isMobileDevice ) {\n\t\t\ttoArray( dom.slides.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {\n\t\t\t\tel.controls = true;\n\t\t\t} );\n\t\t}\n\n\t}\n\n\t/**\n\t * Start playback of any embedded content inside of\n\t * the given element.\n\t *\n\t * @param {HTMLElement} element\n\t */\n\tfunction startEmbeddedContent( element ) {\n\n\t\tif( element && !isSpeakerNotes() ) {\n\n\t\t\t// Restart GIFs\n\t\t\ttoArray( element.querySelectorAll( 'img[src$=\".gif\"]' ) ).forEach( function( el ) {\n\t\t\t\t// Setting the same unchanged source like this was confirmed\n\t\t\t\t// to work in Chrome, FF & Safari\n\t\t\t\tel.setAttribute( 'src', el.getAttribute( 'src' ) );\n\t\t\t} );\n\n\t\t\t// HTML5 media elements\n\t\t\ttoArray( element.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {\n\t\t\t\tif( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Prefer an explicit global autoplay setting\n\t\t\t\tvar autoplay = config.autoPlayMedia;\n\n\t\t\t\t// If no global setting is available, fall back on the element's\n\t\t\t\t// own autoplay setting\n\t\t\t\tif( typeof autoplay !== 'boolean' ) {\n\t\t\t\t\tautoplay = el.hasAttribute( 'data-autoplay' ) || !!closestParent( el, '.slide-background' );\n\t\t\t\t}\n\n\t\t\t\tif( autoplay && typeof el.play === 'function' ) {\n\n\t\t\t\t\tif( el.readyState > 1 ) {\n\t\t\t\t\t\tstartEmbeddedMedia( { target: el } );\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tel.removeEventListener( 'loadeddata', startEmbeddedMedia ); // remove first to avoid dupes\n\t\t\t\t\t\tel.addEventListener( 'loadeddata', startEmbeddedMedia );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Normal iframes\n\t\t\ttoArray( element.querySelectorAll( 'iframe[src]' ) ).forEach( function( el ) {\n\t\t\t\tif( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartEmbeddedIframe( { target: el } );\n\t\t\t} );\n\n\t\t\t// Lazy loading iframes\n\t\t\ttoArray( element.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) {\n\t\t\t\tif( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif( el.getAttribute( 'src' ) !== el.getAttribute( 'data-src' ) ) {\n\t\t\t\t\tel.removeEventListener( 'load', startEmbeddedIframe ); // remove first to avoid dupes\n\t\t\t\t\tel.addEventListener( 'load', startEmbeddedIframe );\n\t\t\t\t\tel.setAttribute( 'src', el.getAttribute( 'data-src' ) );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Starts playing an embedded video/audio element after\n\t * it has finished loading.\n\t *\n\t * @param {object} event\n\t */\n\tfunction startEmbeddedMedia( event ) {\n\n\t\tvar isAttachedToDOM = !!closestParent( event.target, 'html' ),\n\t\t\tisVisible \t\t= !!closestParent( event.target, '.present' );\n\n\t\tif( isAttachedToDOM && isVisible ) {\n\t\t\tevent.target.currentTime = 0;\n\t\t\tevent.target.play();\n\t\t}\n\n\t\tevent.target.removeEventListener( 'loadeddata', startEmbeddedMedia );\n\n\t}\n\n\t/**\n\t * \"Starts\" the content of an embedded iframe using the\n\t * postMessage API.\n\t *\n\t * @param {object} event\n\t */\n\tfunction startEmbeddedIframe( event ) {\n\n\t\tvar iframe = event.target;\n\n\t\tif( iframe && iframe.contentWindow ) {\n\n\t\t\tvar isAttachedToDOM = !!closestParent( event.target, 'html' ),\n\t\t\t\tisVisible \t\t= !!closestParent( event.target, '.present' );\n\n\t\t\tif( isAttachedToDOM && isVisible ) {\n\n\t\t\t\t// Prefer an explicit global autoplay setting\n\t\t\t\tvar autoplay = config.autoPlayMedia;\n\n\t\t\t\t// If no global setting is available, fall back on the element's\n\t\t\t\t// own autoplay setting\n\t\t\t\tif( typeof autoplay !== 'boolean' ) {\n\t\t\t\t\tautoplay = iframe.hasAttribute( 'data-autoplay' ) || !!closestParent( iframe, '.slide-background' );\n\t\t\t\t}\n\n\t\t\t\t// YouTube postMessage API\n\t\t\t\tif( /youtube\\.com\\/embed\\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) {\n\t\t\t\t\tiframe.contentWindow.postMessage( '{\"event\":\"command\",\"func\":\"playVideo\",\"args\":\"\"}', '*' );\n\t\t\t\t}\n\t\t\t\t// Vimeo postMessage API\n\t\t\t\telse if( /player\\.vimeo\\.com\\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) {\n\t\t\t\t\tiframe.contentWindow.postMessage( '{\"method\":\"play\"}', '*' );\n\t\t\t\t}\n\t\t\t\t// Generic postMessage API\n\t\t\t\telse {\n\t\t\t\t\tiframe.contentWindow.postMessage( 'slide:start', '*' );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Stop playback of any embedded content inside of\n\t * the targeted slide.\n\t *\n\t * @param {HTMLElement} element\n\t */\n\tfunction stopEmbeddedContent( element, options ) {\n\n\t\toptions = extend( {\n\t\t\t// Defaults\n\t\t\tunloadIframes: true\n\t\t}, options || {} );\n\n\t\tif( element && element.parentNode ) {\n\t\t\t// HTML5 media elements\n\t\t\ttoArray( element.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {\n\t\t\t\tif( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) {\n\t\t\t\t\tel.setAttribute('data-paused-by-reveal', '');\n\t\t\t\t\tel.pause();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Generic postMessage API for non-lazy loaded iframes\n\t\t\ttoArray( element.querySelectorAll( 'iframe' ) ).forEach( function( el ) {\n\t\t\t\tif( el.contentWindow ) el.contentWindow.postMessage( 'slide:stop', '*' );\n\t\t\t\tel.removeEventListener( 'load', startEmbeddedIframe );\n\t\t\t});\n\n\t\t\t// YouTube postMessage API\n\t\t\ttoArray( element.querySelectorAll( 'iframe[src*=\"youtube.com/embed/\"]' ) ).forEach( function( el ) {\n\t\t\t\tif( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) {\n\t\t\t\t\tel.contentWindow.postMessage( '{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}', '*' );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Vimeo postMessage API\n\t\t\ttoArray( element.querySelectorAll( 'iframe[src*=\"player.vimeo.com/\"]' ) ).forEach( function( el ) {\n\t\t\t\tif( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) {\n\t\t\t\t\tel.contentWindow.postMessage( '{\"method\":\"pause\"}', '*' );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif( options.unloadIframes === true ) {\n\t\t\t\t// Unload lazy-loaded iframes\n\t\t\t\ttoArray( element.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) {\n\t\t\t\t\t// Only removing the src doesn't actually unload the frame\n\t\t\t\t\t// in all browsers (Firefox) so we set it to blank first\n\t\t\t\t\tel.setAttribute( 'src', 'about:blank' );\n\t\t\t\t\tel.removeAttribute( 'src' );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the number of past slides. This can be used as a global\n\t * flattened index for slides.\n\t *\n\t * @return {number} Past slide count\n\t */\n\tfunction getSlidePastCount() {\n\n\t\tvar horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );\n\n\t\t// The number of past slides\n\t\tvar pastCount = 0;\n\n\t\t// Step through all slides and count the past ones\n\t\tmainLoop: for( var i = 0; i < horizontalSlides.length; i++ ) {\n\n\t\t\tvar horizontalSlide = horizontalSlides[i];\n\t\t\tvar verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );\n\n\t\t\tfor( var j = 0; j < verticalSlides.length; j++ ) {\n\n\t\t\t\t// Stop as soon as we arrive at the present\n\t\t\t\tif( verticalSlides[j].classList.contains( 'present' ) ) {\n\t\t\t\t\tbreak mainLoop;\n\t\t\t\t}\n\n\t\t\t\tpastCount++;\n\n\t\t\t}\n\n\t\t\t// Stop as soon as we arrive at the present\n\t\t\tif( horizontalSlide.classList.contains( 'present' ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Don't count the wrapping section for vertical slides\n\t\t\tif( horizontalSlide.classList.contains( 'stack' ) === false ) {\n\t\t\t\tpastCount++;\n\t\t\t}\n\n\t\t}\n\n\t\treturn pastCount;\n\n\t}\n\n\t/**\n\t * Returns a value ranging from 0-1 that represents\n\t * how far into the presentation we have navigated.\n\t *\n\t * @return {number}\n\t */\n\tfunction getProgress() {\n\n\t\t// The number of past and total slides\n\t\tvar totalCount = getTotalSlides();\n\t\tvar pastCount = getSlidePastCount();\n\n\t\tif( currentSlide ) {\n\n\t\t\tvar allFragments = currentSlide.querySelectorAll( '.fragment' );\n\n\t\t\t// If there are fragments in the current slide those should be\n\t\t\t// accounted for in the progress.\n\t\t\tif( allFragments.length > 0 ) {\n\t\t\t\tvar visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' );\n\n\t\t\t\t// This value represents how big a portion of the slide progress\n\t\t\t\t// that is made up by its fragments (0-1)\n\t\t\t\tvar fragmentWeight = 0.9;\n\n\t\t\t\t// Add fragment progress to the past slide count\n\t\t\t\tpastCount += ( visibleFragments.length / allFragments.length ) * fragmentWeight;\n\t\t\t}\n\n\t\t}\n\n\t\treturn pastCount / ( totalCount - 1 );\n\n\t}\n\n\t/**\n\t * Checks if this presentation is running inside of the\n\t * speaker notes window.\n\t *\n\t * @return {boolean}\n\t */\n\tfunction isSpeakerNotes() {\n\n\t\treturn !!window.location.search.match( /receiver/gi );\n\n\t}\n\n\t/**\n\t * Reads the current URL (hash) and navigates accordingly.\n\t */\n\tfunction readURL() {\n\n\t\tvar hash = window.location.hash;\n\n\t\t// Attempt to parse the hash as either an index or name\n\t\tvar bits = hash.slice( 2 ).split( '/' ),\n\t\t\tname = hash.replace( /#|\\//gi, '' );\n\n\t\t// If the first bit is invalid and there is a name we can\n\t\t// assume that this is a named link\n\t\tif( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {\n\t\t\tvar element;\n\n\t\t\t// Ensure the named link is a valid HTML ID attribute\n\t\t\tif( /^[a-zA-Z][\\w:.-]*$/.test( name ) ) {\n\t\t\t\t// Find the slide with the specified ID\n\t\t\t\telement = document.getElementById( name );\n\t\t\t}\n\n\t\t\tif( element ) {\n\t\t\t\t// Find the position of the named slide and navigate to it\n\t\t\t\tvar indices = Reveal.getIndices( element );\n\t\t\t\tslide( indices.h, indices.v );\n\t\t\t}\n\t\t\t// If the slide doesn't exist, navigate to the current slide\n\t\t\telse {\n\t\t\t\tslide( indexh || 0, indexv || 0 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Read the index components of the hash\n\t\t\tvar h = parseInt( bits[0], 10 ) || 0,\n\t\t\t\tv = parseInt( bits[1], 10 ) || 0;\n\n\t\t\tif( h !== indexh || v !== indexv ) {\n\t\t\t\tslide( h, v );\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the page URL (hash) to reflect the current\n\t * state.\n\t *\n\t * @param {number} delay The time in ms to wait before\n\t * writing the hash\n\t */\n\tfunction writeURL( delay ) {\n\n\t\tif( config.history ) {\n\n\t\t\t// Make sure there's never more than one timeout running\n\t\t\tclearTimeout( writeURLTimeout );\n\n\t\t\t// If a delay is specified, timeout this call\n\t\t\tif( typeof delay === 'number' ) {\n\t\t\t\twriteURLTimeout = setTimeout( writeURL, delay );\n\t\t\t}\n\t\t\telse if( currentSlide ) {\n\t\t\t\tvar url = '/';\n\n\t\t\t\t// Attempt to create a named link based on the slide's ID\n\t\t\t\tvar id = currentSlide.getAttribute( 'id' );\n\t\t\t\tif( id ) {\n\t\t\t\t\tid = id.replace( /[^a-zA-Z0-9\\-\\_\\:\\.]/g, '' );\n\t\t\t\t}\n\n\t\t\t\t// If the current slide has an ID, use that as a named link\n\t\t\t\tif( typeof id === 'string' && id.length ) {\n\t\t\t\t\turl = '/' + id;\n\t\t\t\t}\n\t\t\t\t// Otherwise use the /h/v index\n\t\t\t\telse {\n\t\t\t\t\tif( indexh > 0 || indexv > 0 ) url += indexh;\n\t\t\t\t\tif( indexv > 0 ) url += '/' + indexv;\n\t\t\t\t}\n\n\t\t\t\twindow.location.hash = url;\n\t\t\t}\n\t\t}\n\n\t}\n\t/**\n\t * Retrieves the h/v location and fragment of the current,\n\t * or specified, slide.\n\t *\n\t * @param {HTMLElement} [slide] If specified, the returned\n\t * index will be for this slide rather than the currently\n\t * active one\n\t *\n\t * @return {{h: number, v: number, f: number}}\n\t */\n\tfunction getIndices( slide ) {\n\n\t\t// By default, return the current indices\n\t\tvar h = indexh,\n\t\t\tv = indexv,\n\t\t\tf;\n\n\t\t// If a slide is specified, return the indices of that slide\n\t\tif( slide ) {\n\t\t\tvar isVertical = isVerticalSlide( slide );\n\t\t\tvar slideh = isVertical ? slide.parentNode : slide;\n\n\t\t\t// Select all horizontal slides\n\t\t\tvar horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );\n\n\t\t\t// Now that we know which the horizontal slide is, get its index\n\t\t\th = Math.max( horizontalSlides.indexOf( slideh ), 0 );\n\n\t\t\t// Assume we're not vertical\n\t\t\tv = undefined;\n\n\t\t\t// If this is a vertical slide, grab the vertical index\n\t\t\tif( isVertical ) {\n\t\t\t\tv = Math.max( toArray( slide.parentNode.querySelectorAll( 'section' ) ).indexOf( slide ), 0 );\n\t\t\t}\n\t\t}\n\n\t\tif( !slide && currentSlide ) {\n\t\t\tvar hasFragments = currentSlide.querySelectorAll( '.fragment' ).length > 0;\n\t\t\tif( hasFragments ) {\n\t\t\t\tvar currentFragment = currentSlide.querySelector( '.current-fragment' );\n\t\t\t\tif( currentFragment && currentFragment.hasAttribute( 'data-fragment-index' ) ) {\n\t\t\t\t\tf = parseInt( currentFragment.getAttribute( 'data-fragment-index' ), 10 );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tf = currentSlide.querySelectorAll( '.fragment.visible' ).length - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { h: h, v: v, f: f };\n\n\t}\n\n\t/**\n\t * Retrieves all slides in this presentation.\n\t */\n\tfunction getSlides() {\n\n\t\treturn toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ));\n\n\t}\n\n\t/**\n\t * Retrieves the total number of slides in this presentation.\n\t *\n\t * @return {number}\n\t */\n\tfunction getTotalSlides() {\n\n\t\treturn getSlides().length;\n\n\t}\n\n\t/**\n\t * Returns the slide element matching the specified index.\n\t *\n\t * @return {HTMLElement}\n\t */\n\tfunction getSlide( x, y ) {\n\n\t\tvar horizontalSlide = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR )[ x ];\n\t\tvar verticalSlides = horizontalSlide && horizontalSlide.querySelectorAll( 'section' );\n\n\t\tif( verticalSlides && verticalSlides.length && typeof y === 'number' ) {\n\t\t\treturn verticalSlides ? verticalSlides[ y ] : undefined;\n\t\t}\n\n\t\treturn horizontalSlide;\n\n\t}\n\n\t/**\n\t * Returns the background element for the given slide.\n\t * All slides, even the ones with no background properties\n\t * defined, have a background element so as long as the\n\t * index is valid an element will be returned.\n\t *\n\t * @param {number} x Horizontal background index\n\t * @param {number} y Vertical background index\n\t * @return {(HTMLElement[]|*)}\n\t */\n\tfunction getSlideBackground( x, y ) {\n\n\t\tvar slide = getSlide( x, y );\n\t\tif( slide ) {\n\t\t\treturn slide.slideBackgroundElement;\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\t/**\n\t * Retrieves the speaker notes from a slide. Notes can be\n\t * defined in two ways:\n\t * 1. As a data-notes attribute on the slide \n\t * 2. As an