{"version":3,"sources":["webpack:///slick_lightbox.js","webpack:///webpack/bootstrap 4c2d895580f737b97b17","webpack:///./src/slick_lightbox.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","229","_typeof","Symbol","iterator","obj","constructor","$","SlickLightbox","defaults","element","options","that","this","didInit","on","itemSelector","e","preventDefault","init","find","index","detectIE","createModal","bindEvents","initSlick","open","createModalItems","a","createItem","links","images","map","img","_this","el","caption","src","getElementCaption","getElementSrc","detectImage","slice","each","push","html","isIE","background","captionPosition","join","modalElement","append","slick","trigger","setTimeout","getTransitionDuration","removeClass","close","addClass","destroy","resizeSlides","h","height","css","Math","round","window","closeOnEscape","navigateByKeyboard","document","code","keyCode","which","slideSlick","closeOnBackdropClick","stopPropagation","direction","test","navigator","userAgent","Number","RegExp","$1","data","attr","href","url","match","unbindEvents","off","unbindAnchors","remove","destroyTimeout","destroyPrevious","children","duration","transitionDuration","indexOf","parseFloat","fn","slickLightbox","extend","unslickLightbox","jQuery"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,W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AE0D,QAAQuB,IAAI,kBACdjF,EAAE6D,UAAUoB,IAAI,kBACT3E,KAAKoC,aAAauC,IAAI,mBAG/BhF,EAAcX,UAAU6D,QAAU,SAAS+B,GAczC,GAbqB,MAAjBA,IACFA,GAAgB,GAId5E,KAAKC,UACPD,KAAK0E,eACLlC,WAAa,SAASnB,GACpB,MAAO,YACL,MAAOA,GAAMe,aAAayC,WAE3B7E,MAAQA,KAAKF,QAAQgF,iBAEtBF,EAEF,MADA5E,MAAKH,QAAQ8E,IAAI,kBACV3E,KAAKH,QAAQ8E,IAAI,iBAAkB3E,KAAKF,QAAQK,eAI3DR,EAAcX,UAAU+F,gBAAkB,WAGxC,MAAOrF,GAAE,QAAQsF,SAAS,mBAAmBzC,QAAQ,0BAGvD5C,EAAcX,UAAUyD,sBAAwB,WAG9C,GAAIwC,EACJ,OAAIjF,MAAKkF,mBACAlF,KAAKkF,oBAEdD,EAAWjF,KAAKoC,aAAaa,IAAI,uBAExBjD,KAAKkF,uBADU,KAAbD,EACwB,IAEAA,EAASE,QAAQ,OAAS,EAAIC,WAAWH,GAAmC,IAAvBG,WAAWH,KAI9FtF,KAGTC,GACEqC,WAAY,iBACZoB,eAAe,EACfO,sBAAsB,EACtBkB,eAAgB,IAChB3E,aAAc,IACdmD,oBAAoB,EACpB9B,KAAK,EACLD,SAAS,EACTW,gBAAiB,UACjBhB,QAAQ,EACRoB,UAEF5C,EAAE2F,GAAGC,cAAgB,SAASxF,GAK5B,MAFAA,GAAUJ,EAAE6F,UAAW3F,EAAUE,GACjC,GAAIH,GAAcK,KAAMF,GACjBE,MAEFN,EAAE2F,GAAGG,gBAAkB,WAG5B,MAAO9F,GAAEM,MAAMuC,QAAQ,2BAExBkD","file":"slick_lightbox.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/2019jamieoliver/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 229);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 229:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/*\n * SlickLightbox documentation #\n\nDocumentation generated by [CoffeeDoc](http://github.com/omarkhan/coffeedoc)\n */\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function ($) {\n var SlickLightbox, defaults;\n SlickLightbox = function () {\n\n /*\n \t\tThe one and only class used.\n */\n function SlickLightbox(element, options) {\n var that;\n this.options = options;\n\n /* Binds the plugin. */\n this.element = $(element);\n this.didInit = false;\n that = this;\n this.element.on('click.slickLightbox', this.options.itemSelector, function (e) {\n e.preventDefault();\n return that.init(that.element.find(that.options.itemSelector).index($(this)));\n });\n }\n\n SlickLightbox.prototype.init = function (index) {\n\n /* Creates the lightbox, opens it, binds events and calls `slick`. Accepts `index` of the element, that triggered it (so that we know, on which slide to start slick). */\n this.didInit = true;\n this.detectIE();\n this.createModal(index);\n this.bindEvents();\n this.initSlick();\n return this.open();\n };\n\n SlickLightbox.prototype.createModalItems = function (index) {\n\n /* Creates individual slides to be used with slick. If `options.images` array is specified, it uses it's contents, otherwise loops through elements' `options.itemSelector`. */\n var a, createItem, links;\n if (this.options.images) {\n links = $.map(this.options.images, function (img) {\n return \"
\";\n });\n } else {\n createItem = function (_this) {\n return function (el) {\n var caption, src;\n caption = _this.getElementCaption(el);\n src = _this.getElementSrc(el);\n if (_this.detectImage(src)) {\n return \"
\" + caption + \"
\";\n } else {\n return \"
\" + caption + \"
\";\n }\n };\n }(this);\n a = this.element.find(this.options.itemSelector);\n if (index === 0 || index === -1) {\n links = $.map(a, createItem);\n } else {\n links = $.map(a.slice(index), createItem);\n $.each(a.slice(0, index), function (i, el) {\n return links.push(createItem(el));\n });\n }\n }\n return links;\n };\n\n SlickLightbox.prototype.createModal = function (index) {\n\n /* Creates a `slick`-friendly modal. Rearranges the items so that the `index`-th item is placed first. */\n var html, links;\n links = this.createModalItems(index);\n html = \"
\\n\t
\\n\t\t
\" + links.join('') + \"
\\n\t\t\\n\t
\\n
\";\n this.modalElement = $(html);\n return $('body').append(this.modalElement);\n };\n\n SlickLightbox.prototype.initSlick = function (index) {\n\n /* Runs slick by default, using `options.slick` if provided. If `options.slick` is a function, it gets fired instead of us initializing slick. */\n if (this.options.slick != null) {\n if (typeof this.options.slick === 'function') {\n\n /* Function expected to return slick instance. */\n this.slick = this.options.slick(this.modalElement);\n } else {\n this.slick = this.modalElement.find('.slick-lightbox-slick').slick(this.options.slick);\n }\n } else {\n this.slick = this.modalElement.find('.slick-lightbox-slick').slick();\n }\n return this.modalElement.trigger('init.slickLightbox');\n };\n\n SlickLightbox.prototype.open = function () {\n\n /* Opens the lightbox. */\n this.element.trigger('show.slickLightbox');\n setTimeout(function (_this) {\n return function () {\n return _this.element.trigger('shown.slickLightbox');\n };\n }(this), this.getTransitionDuration());\n return this.modalElement.removeClass('slick-hide-init');\n };\n\n SlickLightbox.prototype.close = function () {\n\n /* Closes the lightbox and destroys it, maintaining the original element bindings. */\n this.element.trigger('hide.slickLightbox');\n setTimeout(function (_this) {\n return function () {\n return _this.element.trigger('hidden.slickLightbox');\n };\n }(this), this.getTransitionDuration());\n this.modalElement.addClass('slick-hide');\n return this.destroy();\n };\n\n SlickLightbox.prototype.bindEvents = function () {\n\n /* Binds global events. */\n var resizeSlides;\n resizeSlides = function (_this) {\n return function () {\n var h;\n h = _this.modalElement.find('.slick-lightbox-inner').height();\n _this.modalElement.find('.slick-lightbox-slick-item').height(h);\n return _this.modalElement.find('.slick-lightbox-slick-img').css('max-height', Math.round(0.9 * h));\n };\n }(this);\n $(window).on('orientationchange.slickLightbox resize.slickLightbox', resizeSlides);\n this.modalElement.on('init.slickLightbox', resizeSlides);\n this.modalElement.on('destroy.slickLightbox', function (_this) {\n return function () {\n return _this.destroy();\n };\n }(this));\n this.element.on('destroy.slickLightbox', function (_this) {\n return function () {\n return _this.destroy(true);\n };\n }(this));\n this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-close', function (_this) {\n return function (e) {\n e.preventDefault();\n return _this.close();\n };\n }(this));\n if (this.options.closeOnEscape || this.options.navigateByKeyboard) {\n $(document).on('keydown.slickLightbox', function (_this) {\n return function (e) {\n var code;\n code = e.keyCode ? e.keyCode : e.which;\n if (_this.options.navigateByKeyboard) {\n if (code === 37) {\n _this.slideSlick('left');\n } else if (code === 39) {\n _this.slideSlick('right');\n }\n }\n if (_this.options.closeOnEscape) {\n if (code === 27) {\n return _this.close();\n }\n }\n };\n }(this));\n }\n if (this.options.closeOnBackdropClick) {\n this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-img', function (_this) {\n return function (e) {\n return e.stopPropagation();\n };\n }(this));\n this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-iframe-wrap', function (_this) {\n return function (e) {\n return e.stopPropagation();\n };\n }(this));\n return this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-item', function (_this) {\n return function (e) {\n e.preventDefault();\n return _this.close();\n };\n }(this));\n }\n };\n\n SlickLightbox.prototype.slideSlick = function (direction) {\n\n /* Moves the slick prev or next. */\n if (direction === 'left') {\n return this.slick.slick('slickPrev');\n } else {\n return this.slick.slick('slickNext');\n }\n };\n\n SlickLightbox.prototype.detectIE = function () {\n\n /* Detects usage of IE8 and lower. */\n var ieversion;\n this.isIE = false;\n if (/MSIE (\\d+\\.\\d+);/.test(navigator.userAgent)) {\n ieversion = new Number(RegExp.$1);\n if (ieversion < 9) {\n return this.isIE = true;\n }\n }\n };\n\n SlickLightbox.prototype.getElementCaption = function (el) {\n\n /* Returns caption for each slide based on the type of `options.caption`. */\n var c;\n if (!this.options.caption) {\n return '';\n }\n c = function () {\n switch (_typeof(this.options.caption)) {\n case 'function':\n return this.options.caption(el);\n case 'string':\n return $(el).data(this.options.caption);\n }\n }.call(this);\n return \"\" + c + \"\";\n };\n\n SlickLightbox.prototype.getElementSrc = function (el) {\n\n /* Returns src for each slide image based on the type of `options.src`. */\n switch (_typeof(this.options.src)) {\n case 'function':\n return this.options.src(el);\n case 'string':\n return $(el).attr(this.options.src);\n default:\n return el.href;\n }\n };\n\n SlickLightbox.prototype.detectImage = function (url) {\n\n /* Returns true if finds image file extension */\n //return url.match(/\\.(jpeg|jpg|gif|png)$/) !== null;\n return url.match(/\\.(jpeg|jpg|gif|png).?(\\w*)$/) !== null;\n };\n\n SlickLightbox.prototype.unbindEvents = function () {\n\n /* Unbinds global events. */\n $(window).off('.slickLightbox');\n $(document).off('.slickLightbox');\n return this.modalElement.off('.slickLightbox');\n };\n\n SlickLightbox.prototype.destroy = function (unbindAnchors) {\n if (unbindAnchors == null) {\n unbindAnchors = false;\n }\n\n /* Destroys the lightbox and unbinds global events. If `true` is passed as an argument, unbinds the original element as well. */\n if (this.didInit) {\n this.unbindEvents();\n setTimeout(function (_this) {\n return function () {\n return _this.modalElement.remove();\n };\n }(this), this.options.destroyTimeout);\n }\n if (unbindAnchors) {\n this.element.off('.slickLightbox');\n return this.element.off('.slickLightbox', this.options.itemSelector);\n }\n };\n\n SlickLightbox.prototype.destroyPrevious = function () {\n\n /* Destroys lightboxes currently in DOM. */\n return $('body').children('.slick-lightbox').trigger('destroy.slickLightbox');\n };\n\n SlickLightbox.prototype.getTransitionDuration = function () {\n\n /* Detects the transition duration to know when to remove stuff from DOM etc. */\n var duration;\n if (this.transitionDuration) {\n return this.transitionDuration;\n }\n duration = this.modalElement.css('transition-duration');\n if (typeof duration === 'undefined') {\n return this.transitionDuration = 500;\n } else {\n return this.transitionDuration = duration.indexOf('ms') > -1 ? parseFloat(duration) : parseFloat(duration) * 1000;\n }\n };\n\n return SlickLightbox;\n }();\n defaults = {\n background: 'rgba(0,0,0,.8)',\n closeOnEscape: true,\n closeOnBackdropClick: true,\n destroyTimeout: 500,\n itemSelector: 'a',\n navigateByKeyboard: true,\n src: false,\n caption: false,\n captionPosition: 'dynamic',\n images: false,\n slick: {}\n };\n $.fn.slickLightbox = function (options) {\n\n /* Fires the plugin. */\n options = $.extend({}, defaults, options);\n new SlickLightbox(this, options);\n return this;\n };\n return $.fn.unslickLightbox = function () {\n\n /* Removes everything. */\n return $(this).trigger('destroy.slickLightbox');\n };\n})(jQuery);\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// slick_lightbox.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/2019jamieoliver/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 229);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4c2d895580f737b97b17","'use strict';\n\n/*\n * SlickLightbox documentation #\n\nDocumentation generated by [CoffeeDoc](http://github.com/omarkhan/coffeedoc)\n */\n(function($) {\n var SlickLightbox, defaults;\n SlickLightbox = (function() {\n\n /*\n \t\tThe one and only class used.\n */\n function SlickLightbox(element, options) {\n var that;\n this.options = options;\n\n /* Binds the plugin. */\n this.element = $(element);\n this.didInit = false;\n that = this;\n this.element.on('click.slickLightbox', this.options.itemSelector, function(e) {\n e.preventDefault();\n return that.init(that.element.find(that.options.itemSelector).index($(this)));\n });\n }\n\n SlickLightbox.prototype.init = function(index) {\n\n /* Creates the lightbox, opens it, binds events and calls `slick`. Accepts `index` of the element, that triggered it (so that we know, on which slide to start slick). */\n this.didInit = true;\n this.detectIE();\n this.createModal(index);\n this.bindEvents();\n this.initSlick();\n return this.open();\n };\n\n SlickLightbox.prototype.createModalItems = function(index) {\n\n /* Creates individual slides to be used with slick. If `options.images` array is specified, it uses it's contents, otherwise loops through elements' `options.itemSelector`. */\n var a, createItem, links;\n if (this.options.images) {\n links = $.map(this.options.images, function(img) {\n return \"
\";\n });\n } else {\n createItem = (function(_this) {\n return function(el) {\n var caption, src;\n caption = _this.getElementCaption(el);\n src = _this.getElementSrc(el);\n if (_this.detectImage(src)) {\n return \"
\" + caption + \"
\";\n } else {\n return \"
\" + caption + \"
\";\n }\n };\n })(this);\n a = this.element.find(this.options.itemSelector);\n if (index === 0 || index === -1) {\n links = $.map(a, createItem);\n } else {\n links = $.map(a.slice(index), createItem);\n $.each(a.slice(0, index), function(i, el) {\n return links.push(createItem(el));\n });\n }\n }\n return links;\n };\n\n SlickLightbox.prototype.createModal = function(index) {\n\n /* Creates a `slick`-friendly modal. Rearranges the items so that the `index`-th item is placed first. */\n var html, links;\n links = this.createModalItems(index);\n html = \"
\\n\t
\\n\t\t
\" + (links.join('')) + \"
\\n\t\t\\n\t
\\n
\";\n this.modalElement = $(html);\n return $('body').append(this.modalElement);\n };\n\n SlickLightbox.prototype.initSlick = function(index) {\n\n /* Runs slick by default, using `options.slick` if provided. If `options.slick` is a function, it gets fired instead of us initializing slick. */\n if (this.options.slick != null) {\n if (typeof this.options.slick === 'function') {\n\n /* Function expected to return slick instance. */\n this.slick = this.options.slick(this.modalElement);\n } else {\n this.slick = this.modalElement.find('.slick-lightbox-slick').slick(this.options.slick);\n }\n } else {\n this.slick = this.modalElement.find('.slick-lightbox-slick').slick();\n }\n return this.modalElement.trigger('init.slickLightbox');\n };\n\n SlickLightbox.prototype.open = function() {\n\n /* Opens the lightbox. */\n this.element.trigger('show.slickLightbox');\n setTimeout(((function(_this) {\n return function() {\n return _this.element.trigger('shown.slickLightbox');\n };\n })(this)), this.getTransitionDuration());\n return this.modalElement.removeClass('slick-hide-init');\n };\n\n SlickLightbox.prototype.close = function() {\n\n /* Closes the lightbox and destroys it, maintaining the original element bindings. */\n this.element.trigger('hide.slickLightbox');\n setTimeout(((function(_this) {\n return function() {\n return _this.element.trigger('hidden.slickLightbox');\n };\n })(this)), this.getTransitionDuration());\n this.modalElement.addClass('slick-hide');\n return this.destroy();\n };\n\n SlickLightbox.prototype.bindEvents = function() {\n\n /* Binds global events. */\n var resizeSlides;\n resizeSlides = (function(_this) {\n return function() {\n var h;\n h = _this.modalElement.find('.slick-lightbox-inner').height();\n _this.modalElement.find('.slick-lightbox-slick-item').height(h);\n return _this.modalElement.find('.slick-lightbox-slick-img').css('max-height', Math.round(0.9 * h));\n };\n })(this);\n $(window).on('orientationchange.slickLightbox resize.slickLightbox', resizeSlides);\n this.modalElement.on('init.slickLightbox', resizeSlides);\n this.modalElement.on('destroy.slickLightbox', (function(_this) {\n return function() {\n return _this.destroy();\n };\n })(this));\n this.element.on('destroy.slickLightbox', (function(_this) {\n return function() {\n return _this.destroy(true);\n };\n })(this));\n this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-close', (function(_this) {\n return function(e) {\n e.preventDefault();\n return _this.close();\n };\n })(this));\n if (this.options.closeOnEscape || this.options.navigateByKeyboard) {\n $(document).on('keydown.slickLightbox', (function(_this) {\n return function(e) {\n var code;\n code = e.keyCode ? e.keyCode : e.which;\n if (_this.options.navigateByKeyboard) {\n if (code === 37) {\n _this.slideSlick('left');\n } else if (code === 39) {\n _this.slideSlick('right');\n }\n }\n if (_this.options.closeOnEscape) {\n if (code === 27) {\n return _this.close();\n }\n }\n };\n })(this));\n }\n if (this.options.closeOnBackdropClick) {\n this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-img', (function(_this) {\n return function(e) {\n return e.stopPropagation();\n };\n })(this));\n this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-iframe-wrap', (function(_this) {\n return function(e) {\n return e.stopPropagation();\n };\n })(this));\n return this.modalElement.on('click.slickLightbox touchstart.slickLightbox', '.slick-lightbox-slick-item', (function(_this) {\n return function(e) {\n e.preventDefault();\n return _this.close();\n };\n })(this));\n }\n };\n\n SlickLightbox.prototype.slideSlick = function(direction) {\n\n /* Moves the slick prev or next. */\n if (direction === 'left') {\n return this.slick.slick('slickPrev');\n } else {\n return this.slick.slick('slickNext');\n }\n };\n\n SlickLightbox.prototype.detectIE = function() {\n\n /* Detects usage of IE8 and lower. */\n var ieversion;\n this.isIE = false;\n if (/MSIE (\\d+\\.\\d+);/.test(navigator.userAgent)) {\n ieversion = new Number(RegExp.$1);\n if (ieversion < 9) {\n return this.isIE = true;\n }\n }\n };\n\n SlickLightbox.prototype.getElementCaption = function(el) {\n\n /* Returns caption for each slide based on the type of `options.caption`. */\n var c;\n if (!this.options.caption) {\n return '';\n }\n c = (function() {\n switch (typeof this.options.caption) {\n case 'function':\n return this.options.caption(el);\n case 'string':\n return $(el).data(this.options.caption);\n }\n }).call(this);\n return \"\" + c + \"\";\n };\n\n SlickLightbox.prototype.getElementSrc = function(el) {\n\n /* Returns src for each slide image based on the type of `options.src`. */\n switch (typeof this.options.src) {\n case 'function':\n return this.options.src(el);\n case 'string':\n return $(el).attr(this.options.src);\n default:\n return el.href;\n }\n };\n\n SlickLightbox.prototype.detectImage = function(url) {\n\n /* Returns true if finds image file extension */\n //return url.match(/\\.(jpeg|jpg|gif|png)$/) !== null;\n return url.match(/\\.(jpeg|jpg|gif|png).?(\\w*)$/) !== null;\n };\n\n SlickLightbox.prototype.unbindEvents = function() {\n\n /* Unbinds global events. */\n $(window).off('.slickLightbox');\n $(document).off('.slickLightbox');\n return this.modalElement.off('.slickLightbox');\n };\n\n SlickLightbox.prototype.destroy = function(unbindAnchors) {\n if (unbindAnchors == null) {\n unbindAnchors = false;\n }\n\n /* Destroys the lightbox and unbinds global events. If `true` is passed as an argument, unbinds the original element as well. */\n if (this.didInit) {\n this.unbindEvents();\n setTimeout(((function(_this) {\n return function() {\n return _this.modalElement.remove();\n };\n })(this)), this.options.destroyTimeout);\n }\n if (unbindAnchors) {\n this.element.off('.slickLightbox');\n return this.element.off('.slickLightbox', this.options.itemSelector);\n }\n };\n\n SlickLightbox.prototype.destroyPrevious = function() {\n\n /* Destroys lightboxes currently in DOM. */\n return $('body').children('.slick-lightbox').trigger('destroy.slickLightbox');\n };\n\n SlickLightbox.prototype.getTransitionDuration = function() {\n\n /* Detects the transition duration to know when to remove stuff from DOM etc. */\n var duration;\n if (this.transitionDuration) {\n return this.transitionDuration;\n }\n duration = this.modalElement.css('transition-duration');\n if (typeof duration === 'undefined') {\n return this.transitionDuration = 500;\n } else {\n return this.transitionDuration = duration.indexOf('ms') > -1 ? parseFloat(duration) : parseFloat(duration) * 1000;\n }\n };\n\n return SlickLightbox;\n\n })();\n defaults = {\n background: 'rgba(0,0,0,.8)',\n closeOnEscape: true,\n closeOnBackdropClick: true,\n destroyTimeout: 500,\n itemSelector: 'a',\n navigateByKeyboard: true,\n src: false,\n caption: false,\n captionPosition: 'dynamic',\n images: false,\n slick: {}\n };\n $.fn.slickLightbox = function(options) {\n\n /* Fires the plugin. */\n options = $.extend({}, defaults, options);\n new SlickLightbox(this, options);\n return this;\n };\n return $.fn.unslickLightbox = function() {\n\n /* Removes everything. */\n return $(this).trigger('destroy.slickLightbox');\n };\n})(jQuery);\n\n\n// WEBPACK FOOTER //\n// ./src/slick_lightbox.js"],"sourceRoot":""}