diff --git a/dist/index.bundle.min.js b/dist/index.bundle.min.js
index 15ab5cb..269389d 100644
--- a/dist/index.bundle.min.js
+++ b/dist/index.bundle.min.js
@@ -1,6 +1,6 @@
/*!
* Lightbox for Bootstrap 5 v1.8.3 (https://trvswgnr.github.io/bs5-lightbox/)
- * Copyright 2023 Travis Aaron Wagner (https://github.com/trvswgnr/)
+ * Copyright 2024 Travis Aaron Wagner (https://github.com/trvswgnr/)
* Licensed under MIT (https://github.com/trvswgnr/bs5-lightbox/blob/main/LICENSE)
- */!function(){"use strict";var t={d:function(e,s){for(var a in s)t.o(s,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:s[a]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};t.d(e,{default:function(){return i}});var s=window.bootstrap;const a={Modal:s.Modal,Carousel:s.Carousel};class o{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},a.Modal.Default),a.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:"",size:"xl",constrain:!0}),this.settings=Object.assign(Object.assign({},this.settings),e),this.modalOptions=(()=>this.setOptionsFromSettings(a.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(a.Carousel.Default))(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target)),this.el=t,this.type=t.dataset.type||"",this.src=this.getSrc(t),this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){let e=t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900";if("html"===t.dataset.type)return e;/\:\/\//.test(e)||(e=window.location.origin+e);const s=new URL(e);return(t.dataset.footer||t.dataset.caption)&&s.searchParams.set("caption",t.dataset.footer||t.dataset.caption),s.toString()}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll('[data-gallery="'.concat(t,'"]')),(t=>"".concat(t.dataset.type?t.dataset.type:"").concat(this.getSrc(t)))))]:["".concat(this.type?this.type:"").concat(this.src)]}getYoutubeId(t){if(!t)return!1;const e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getYoutubeLink(t){const e=this.getYoutubeId(t);if(!e)return!1;const s=t.split("?");let a=s.length>1?"?"+s[1]:"";return"https://www.youtube.com/embed/".concat(e).concat(a)}getInstagramEmbed(t){if(/instagram/.test(t))return t+=/\/embed$/.test(t)?"":"/embed",'')}isEmbed(t){const e=new RegExp("("+o.allowedEmbedTypes.join("|")+")").test(t),s=/\.(png|jpe?g|gif|svg|webp)/i.test(t)||"image"===this.el.dataset.type;return e||!s}createCarousel(){const t=document.createElement("template"),e=o.allowedMediaTypes.join("|"),s=this.sources.map(((t,s)=>{t=t.replace(/\/$/,"");const a=new RegExp("^(".concat(e,")"),"i"),o=/^html/.test(t),i=/^image/.test(t);a.test(t)&&(t=t.replace(a,""));const n=this.settings.constrain?"mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0":"h-100 w-100",l=new URLSearchParams(t.split("?")[1]);let r="",c=t;if(l.get("caption")){try{c=new URL(t),c.searchParams.delete("caption"),c=c.toString()}catch(e){c=t}r='
'.concat(l.get("caption"),"
")}let d='
'),h="";const u=this.getInstagramEmbed(t),m=this.getYoutubeLink(t);this.isEmbed(t)&&!i&&(m&&(t=m,h='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),d=u||'")),o&&(d=t);return'\n\t\t\t\t\n\t\t\t\t\t').concat('
','\n\t\t\t\t\t
').concat(d,"
\n\t\t\t\t\t").concat(r,"\n\t\t\t\t
")})).join(""),i=this.sources.length<2?"":'\n\t\t\t\n\t\t\t');let n="lightbox-carousel carousel slide";"fullscreen"===this.settings.size&&(n+=" position-absolute w-100 translate-middle top-50 start-50");const l='\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t').concat(s,"\n\t\t\t\t
\n\t\t\t\t").concat(i,"\n\t\t\t
");t.innerHTML=l.trim(),this.carouselElement=t.content.firstChild;const r=Object.assign(Object.assign({},this.carouselOptions),{keyboard:!1});this.carousel=new a.Carousel(this.carouselElement,r);const c=this.type&&"image"!==this.type?this.type+this.src:this.src;return this.carousel.to(this.findGalleryItemIndex(this.sources,c)),!0===this.carouselOptions.keyboard&&document.addEventListener("keydown",(t=>{if("ArrowLeft"===t.code){const t=document.getElementById("#lightboxCarousel-".concat(this.hash,"-prev"));return t&&t.click(),!1}if("ArrowRight"===t.code){const t=document.getElementById("#lightboxCarousel-".concat(this.hash,"-next"));return t&&t.click(),!1}})),this.carousel}findGalleryItemIndex(t,e){let s=0;for(const a of t){if(a.includes(e))return s;s++}return 0}createModal(){const t=document.createElement("template"),e='\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
");return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(()=>this.modalElement.remove())),this.modalElement.querySelector("[data-bs-dismiss]").addEventListener("click",(()=>this.modal.hide())),this.modal=new a.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}o.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],o.allowedMediaTypes=[...o.allowedEmbedTypes,"image","html"],o.defaultSelector='[data-toggle="lightbox"]',o.initialize=function(t){t.preventDefault();new o(this).show()},document.querySelectorAll(o.defaultSelector).forEach((t=>t.addEventListener("click",o.initialize))),"undefined"!=typeof window&&window.bootstrap&&(window.bootstrap.Lightbox=o);var i=o;window.Lightbox=e.default}();
+ */!function(){"use strict";var t={d:function(e,s){for(var a in s)t.o(s,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:s[a]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};t.d(e,{default:function(){return i}});var s=window.bootstrap;const a={Modal:s.Modal,Carousel:s.Carousel};class o{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},a.Modal.Default),a.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:"",size:"xl",constrain:!0,ride:"carousel"}),this.settings=Object.assign(Object.assign({},this.settings),e),this.modalOptions=(()=>this.setOptionsFromSettings(a.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(a.Carousel.Default))(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target)),this.el=t,this.type=t.dataset.type||"",this.src=this.getSrc(t),this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){let e=t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900";if("html"===t.dataset.type)return e;/\:\/\//.test(e)||(e=window.location.origin+e);const s=new URL(e);return(t.dataset.footer||t.dataset.caption)&&s.searchParams.set("caption",t.dataset.footer||t.dataset.caption),s.toString()}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll('[data-gallery="'.concat(t,'"]')),(t=>"".concat(t.dataset.type?t.dataset.type:"").concat(this.getSrc(t)))))]:["".concat(this.type?this.type:"").concat(this.src)]}getYoutubeId(t){if(!t)return!1;const e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getYoutubeLink(t){const e=this.getYoutubeId(t);if(!e)return!1;const s=t.split("?");let a=s.length>1?"?"+s[1]:"";return"https://www.youtube.com/embed/".concat(e).concat(a)}getInstagramEmbed(t){if(/instagram/.test(t))return t+=/\/embed$/.test(t)?"":"/embed",'')}isEmbed(t){const e=new RegExp("("+o.allowedEmbedTypes.join("|")+")").test(t),s=/\.(png|jpe?g|gif|svg|webp)/i.test(t)||"image"===this.el.dataset.type;return e||!s}createCarousel(){const t=document.createElement("template"),e=o.allowedMediaTypes.join("|"),s=this.sources.map(((t,s)=>{t=t.replace(/\/$/,"");const a=new RegExp("^(".concat(e,")"),"i"),o=/^html/.test(t),i=/^image/.test(t);a.test(t)&&(t=t.replace(a,""));const n=this.settings.constrain?"mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0":"h-100 w-100",l=new URLSearchParams(t.split("?")[1]);let r="",c=t;if(l.get("caption")){try{c=new URL(t),c.searchParams.delete("caption"),c=c.toString()}catch(e){c=t}r=''.concat(l.get("caption"),"
")}let d='
'),h="";const u=this.getInstagramEmbed(t),m=this.getYoutubeLink(t);this.isEmbed(t)&&!i&&(m&&(t=m,h='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),d=u||'")),o&&(d=t);return'\n\t\t\t\t\n\t\t\t\t\t').concat('
','\n\t\t\t\t\t
').concat(d,"
\n\t\t\t\t\t").concat(r,"\n\t\t\t\t
")})).join(""),i=this.sources.length<2?"":'\n\t\t\t\n\t\t\t');let n="lightbox-carousel carousel slide";"fullscreen"===this.settings.size&&(n+=" position-absolute w-100 translate-middle top-50 start-50");const l='\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t').concat(s,"\n\t\t\t\t
\n\t\t\t\t").concat(i,"\n\t\t\t
");t.innerHTML=l.trim(),this.carouselElement=t.content.firstChild;const r=Object.assign(Object.assign({},this.carouselOptions),{keyboard:!1});this.carousel=new a.Carousel(this.carouselElement,r);const c=this.type&&"image"!==this.type?this.type+this.src:this.src;return this.carousel.to(this.findGalleryItemIndex(this.sources,c)),!0===this.carouselOptions.keyboard&&document.addEventListener("keydown",(t=>{if("ArrowLeft"===t.code){const t=document.getElementById("#lightboxCarousel-".concat(this.hash,"-prev"));return t&&t.click(),!1}if("ArrowRight"===t.code){const t=document.getElementById("#lightboxCarousel-".concat(this.hash,"-next"));return t&&t.click(),!1}})),this.carousel}findGalleryItemIndex(t,e){let s=0;for(const a of t){if(a.includes(e))return s;s++}return 0}createModal(){const t=document.createElement("template"),e='\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
");return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(()=>this.modalElement.remove())),this.modalElement.querySelector("[data-bs-dismiss]").addEventListener("click",(()=>this.modal.hide())),this.modal=new a.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}o.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],o.allowedMediaTypes=[...o.allowedEmbedTypes,"image","html"],o.defaultSelector='[data-toggle="lightbox"]',o.initialize=function(t){t.preventDefault();new o(this).show()},document.querySelectorAll(o.defaultSelector).forEach((t=>t.addEventListener("click",o.initialize))),"undefined"!=typeof window&&window.bootstrap&&(window.bootstrap.Lightbox=o);var i=o;window.Lightbox=e.default}();
//# sourceMappingURL=index.bundle.min.js.map
\ No newline at end of file
diff --git a/dist/index.bundle.min.js.map b/dist/index.bundle.min.js.map
index 2abe6ee..df30cbe 100644
--- a/dist/index.bundle.min.js.map
+++ b/dist/index.bundle.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.bundle.min.js","mappings":";;;;4BACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAH,EAAwB,SAASS,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,G,2CCAtG,IAAI,EAA+BI,OAAkB,UCQrD,MAAMC,EAAY,CACjBC,MAAK,QACLC,SAAQA,EAAAA,UAET,MAAMC,EACLC,YAAYC,GAAkB,IAAdC,EAAU,UAAH,6CAAG,CAAC,EAC1BC,KAAKC,KAAOD,KAAKE,aACjBF,KAAKG,SAAWpB,OAAOqB,OAAOrB,OAAOqB,OAAOrB,OAAOqB,OAAO,CAAC,EAAGX,EAAUC,MAAMW,SAAUZ,EAAUE,SAASU,SAAU,CACpHC,UAAU,EACVC,OAAQ,2BACRC,QAAS,GACTC,KAAM,KACNC,WAAW,IAEZV,KAAKG,SAAWpB,OAAOqB,OAAOrB,OAAOqB,OAAO,CAAC,EAAGJ,KAAKG,UAAWJ,GAChEC,KAAKW,aAAe,KAAOX,KAAKY,uBAAuBnB,EAAUC,MAAMW,SAAnD,GACpBL,KAAKa,gBAAkB,KAAOb,KAAKY,uBAAuBnB,EAAUE,SAASU,SAAtD,GACL,iBAAPP,IACVE,KAAKG,SAASI,OAAST,EACvBA,EAAKgB,SAASC,cAAcf,KAAKG,SAASI,S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,MAAMM,KAAK2B,aAAc3B,KAAKW,cAClDX,KAAK4B,KACb,CACA1B,aAAuB,IAAZsD,EAAS,UAAH,6CAAG,EACnB,OAAOT,MAAMG,KAAK,CAAEM,WAAU,IAAMwD,KAAKC,MAAsB,GAAhBD,KAAKE,UAAerE,SAAS,MAAKqB,KAAK,GACvF,EAEDtE,EAASqE,kBAAoB,CAAC,QAAS,UAAW,QAAS,YAAa,OACxErE,EAAS2E,kBAAoB,IAAI3E,EAASqE,kBAAmB,QAAS,QACtErE,EAASuH,gBAAkB,2BAC3BvH,EAASwH,WAAa,SAAUlC,GAC/BA,EAAEmC,iBACe,IAAIzH,EAASI,MACrBwB,MACV,EACAV,SAASqC,iBAAiBvD,EAASuH,iBAAiBG,SAASxH,GAAOA,EAAGsG,iBAAiB,QAASxG,EAASwH,cACpF,oBAAX5H,QAA0BA,OAAOC,YAC3CD,OAAOC,UAAUG,SAAWA,GAE7B,Q","sources":["webpack://Lightbox/webpack/bootstrap","webpack://Lightbox/webpack/runtime/define property getters","webpack://Lightbox/webpack/runtime/hasOwnProperty shorthand","webpack://Lightbox/external window \"bootstrap\"","webpack://Lightbox/./src/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"bootstrap\"];","/**\n * Lightbox for Bootstrap 5\n *\n * @file Creates a modal with a lightbox carousel.\n * @module bs5-lightbox\n */\n\nimport { Modal, Carousel } from 'bootstrap';\nconst bootstrap = {\n\tModal,\n\tCarousel\n};\nclass Lightbox {\n\tconstructor(el, options = {}) {\n\t\tthis.hash = this.randomHash();\n\t\tthis.settings = Object.assign(Object.assign(Object.assign({}, bootstrap.Modal.Default), bootstrap.Carousel.Default), {\n\t\t\tinterval: false,\n\t\t\ttarget: '[data-toggle=\"lightbox\"]',\n\t\t\tgallery: '',\n\t\t\tsize: 'xl',\n\t\t\tconstrain: true\n\t\t});\n\t\tthis.settings = Object.assign(Object.assign({}, this.settings), options);\n\t\tthis.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))();\n\t\tthis.carouselOptions = (() => this.setOptionsFromSettings(bootstrap.Carousel.Default))();\n\t\tif (typeof el === 'string') {\n\t\t\tthis.settings.target = el;\n\t\t\tel = document.querySelector(this.settings.target);\n\t\t}\n\t\tthis.el = el;\n\t\tthis.type = el.dataset.type || '';\n\n\t\tthis.src = this.getSrc(el);\n\t\tthis.sources = this.getGalleryItems();\n\t\tthis.createCarousel();\n\t\tthis.createModal();\n\t}\n\tshow() {\n\t\tdocument.body.appendChild(this.modalElement);\n\t\tthis.modal.show();\n\t}\n\thide() {\n\t\tthis.modal.hide();\n\t}\n\tsetOptionsFromSettings(obj) {\n\t\treturn Object.keys(obj).reduce((p, c) => Object.assign(p, { [c]: this.settings[c] }), {});\n\t}\n\tgetSrc(el) {\n\t\tlet src = el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900';\n\t\tif (el.dataset.type === 'html') {\n\t\t\treturn src;\n\t\t}\n\t\tif (!/\\:\\/\\//.test(src)) {\n\t\t\tsrc = window.location.origin + src;\n\t\t}\n\t\tconst url = new URL(src);\n\t\tif (el.dataset.footer || el.dataset.caption) {\n\t\t\turl.searchParams.set('caption', el.dataset.footer || el.dataset.caption);\n\t\t}\n\t\treturn url.toString();\n\t}\n\tgetGalleryItems() {\n\t\tlet galleryTarget;\n\t\tif (this.settings.gallery) {\n\t\t\tif (Array.isArray(this.settings.gallery)) {\n\t\t\t\treturn this.settings.gallery;\n\t\t\t}\n\t\t\tgalleryTarget = this.settings.gallery;\n\t\t} else if (this.el.dataset.gallery) {\n\t\t\tgalleryTarget = this.el.dataset.gallery;\n\t\t}\n\t\tconst gallery = galleryTarget\n\t\t\t? [...new Set(Array.from(document.querySelectorAll(`[data-gallery=\"${galleryTarget}\"]`), (v) => `${v.dataset.type ? v.dataset.type : ''}${this.getSrc(v)}`))]\n\t\t\t: [`${this.type ? this.type : ''}${this.src}`];\n\t\treturn gallery;\n\t}\n\tgetYoutubeId(src) {\n\t\tif (!src) return false;\n\t\tconst matches = src.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/);\n\t\treturn matches && matches[2].length === 11 ? matches[2] : false;\n\t}\n\tgetYoutubeLink(src) {\n\t\tconst youtubeId = this.getYoutubeId(src);\n\t\tif (!youtubeId) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst arr = src.split('?');\n\t\tlet params = arr.length > 1 ? '?' + arr[1] : '';\n\t\t\n\t\treturn `https://www.youtube.com/embed/${youtubeId}${params}`;\n\t}\n\tgetInstagramEmbed(src) {\n\t\tif (/instagram/.test(src)) {\n\t\t\tsrc += /\\/embed$/.test(src) ? '' : '/embed';\n\t\t\treturn ``;\n\t\t}\n\t}\n\tisEmbed(src) {\n\t\tconst regex = new RegExp('(' + Lightbox.allowedEmbedTypes.join('|') + ')');\n\t\tconst isEmbed = regex.test(src);\n\t\tconst isImg = /\\.(png|jpe?g|gif|svg|webp)/i.test(src) || this.el.dataset.type === 'image';\n\n\t\treturn isEmbed || !isImg;\n\t}\n\tcreateCarousel() {\n\t\tconst template = document.createElement('template');\n\t\tconst types = Lightbox.allowedMediaTypes.join('|');\n\t\tconst slidesHtml = this.sources\n\t\t\t.map((src, i) => {\n\t\t\t\tsrc = src.replace(/\\/$/, '');\n\t\t\t\tconst regex = new RegExp(`^(${types})`, 'i');\n\t\t\t\tconst isHtml = /^html/.test(src);\n\t\t\t\tconst isForcedImage = /^image/.test(src);\n\n\t\t\t\tif (regex.test(src)) {\n\t\t\t\t\tsrc = src.replace(regex, '');\n\t\t\t\t}\n\t\t\t\tconst imgClasses = this.settings.constrain ? 'mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0' : 'h-100 w-100';\n\t\t\t\tconst params = new URLSearchParams(src.split('?')[1]);\n\t\t\t\tlet caption = '';\n\t\t\t\tlet url = src;\n\t\t\t\tif (params.get('caption')) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\turl = new URL(src);\n\t\t\t\t\t\turl.searchParams.delete('caption');\n\t\t\t\t\t\turl = url.toString();\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\turl = src;\n\t\t\t\t\t}\n\t\t\t\t\tcaption = `${params.get('caption')}
`;\n\t\t\t\t}\n\t\t\t\tlet inner = `
`;\n\t\t\t\tlet attributes = '';\n\t\t\t\tconst instagramEmbed = this.getInstagramEmbed(src);\n\t\t\t\tconst youtubeLink = this.getYoutubeLink(src);\n\t\t\t\tif (this.isEmbed(src) && !isForcedImage) {\n\t\t\t\t\tif (youtubeLink) {\n\t\t\t\t\t\tsrc = youtubeLink;\n\t\t\t\t\t\tattributes = 'title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture\"';\n\t\t\t\t\t}\n\t\t\t\t\tinner = instagramEmbed || ``;\n\t\t\t\t}\n\t\t\t\tif (isHtml) {\n\t\t\t\t\tinner = src;\n\t\t\t\t}\n\t\t\t\tconst spinner = ``;\n\t\t\t\treturn `\n\t\t\t\t\n\t\t\t\t\t${spinner}\n\t\t\t\t\t
${inner}
\n\t\t\t\t\t${caption}\n\t\t\t\t
`;\n\t\t\t})\n\t\t\t.join('');\n\t\tconst controlsHtml =\n\t\t\tthis.sources.length < 2\n\t\t\t\t? ''\n\t\t\t\t: `\n\t\t\t\n\t\t\t`;\n\t\tlet classes = 'lightbox-carousel carousel slide';\n\t\tif (this.settings.size === 'fullscreen') {\n\t\t\tclasses += ' position-absolute w-100 translate-middle top-50 start-50';\n\t\t}\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${slidesHtml}\n\t\t\t\t
\n\t\t\t\t${controlsHtml}\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.carouselElement = template.content.firstChild;\n\t\tconst carouselOptions = Object.assign(Object.assign({}, this.carouselOptions), { keyboard: false });\n\t\tthis.carousel = new bootstrap.Carousel(this.carouselElement, carouselOptions);\n\t\tconst elSrc = this.type && this.type !== 'image' ? this.type + this.src : this.src;\n\t\tthis.carousel.to(this.findGalleryItemIndex(this.sources, elSrc));\n\t\tif (this.carouselOptions.keyboard === true) {\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tif (e.code === 'ArrowLeft') {\n\t\t\t\t\tconst prev = document.getElementById(`#lightboxCarousel-${this.hash}-prev`);\n\t\t\t\t\tif (prev) {\n\t\t\t\t\t\tprev.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (e.code === 'ArrowRight') {\n\t\t\t\t\tconst next = document.getElementById(`#lightboxCarousel-${this.hash}-next`);\n\t\t\t\t\tif (next) {\n\t\t\t\t\t\tnext.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this.carousel;\n\t}\n\tfindGalleryItemIndex(haystack, needle) {\n\t\tlet index = 0;\n\t\tfor (const item of haystack) {\n\t\t\tif (item.includes(needle)) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn 0;\n\t}\n\tcreateModal() {\n\t\tconst template = document.createElement('template');\n\t\tconst btnInner =\n\t\t\t'';\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.modalElement = template.content.firstChild;\n\t\tthis.modalElement.querySelector('.modal-body').appendChild(this.carouselElement);\n\t\tthis.modalElement.addEventListener('hidden.bs.modal', () => this.modalElement.remove());\n\t\tthis.modalElement.querySelector('[data-bs-dismiss]').addEventListener('click', () => this.modal.hide());\n\t\tthis.modal = new bootstrap.Modal(this.modalElement, this.modalOptions);\n\t\treturn this.modal;\n\t}\n\trandomHash(length = 8) {\n\t\treturn Array.from({ length }, () => Math.floor(Math.random() * 36).toString(36)).join('');\n\t}\n}\nLightbox.allowedEmbedTypes = ['embed', 'youtube', 'vimeo', 'instagram', 'url'];\nLightbox.allowedMediaTypes = [...Lightbox.allowedEmbedTypes, 'image', 'html'];\nLightbox.defaultSelector = '[data-toggle=\"lightbox\"]';\nLightbox.initialize = function (e) {\n\te.preventDefault();\n\tconst lightbox = new Lightbox(this);\n\tlightbox.show();\n};\ndocument.querySelectorAll(Lightbox.defaultSelector).forEach((el) => el.addEventListener('click', Lightbox.initialize));\nif (typeof window !== 'undefined' && window.bootstrap) {\n\twindow.bootstrap.Lightbox = Lightbox;\n}\nexport default Lightbox;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","window","bootstrap","Modal","Carousel","Lightbox","constructor","el","options","this","hash","randomHash","settings","assign","Default","interval","target","gallery","size","constrain","modalOptions","setOptionsFromSettings","carouselOptions","document","querySelector","type","dataset","src","getSrc","sources","getGalleryItems","createCarousel","createModal","show","body","appendChild","modalElement","modal","hide","keys","reduce","p","c","remote","href","test","location","origin","url","URL","footer","caption","searchParams","set","toString","galleryTarget","Array","isArray","Set","from","querySelectorAll","v","getYoutubeId","matches","match","length","getYoutubeLink","youtubeId","arr","split","params","getInstagramEmbed","isEmbed","RegExp","allowedEmbedTypes","join","isImg","template","createElement","types","allowedMediaTypes","slidesHtml","map","i","replace","regex","isHtml","isForcedImage","imgClasses","URLSearchParams","delete","e","inner","attributes","instagramEmbed","youtubeLink","controlsHtml","classes","html","innerHTML","trim","carouselElement","content","firstChild","keyboard","carousel","elSrc","to","findGalleryItemIndex","addEventListener","code","prev","getElementById","click","next","haystack","needle","index","item","includes","remove","Math","floor","random","defaultSelector","initialize","preventDefault","forEach"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.bundle.min.js","mappings":";;;;4BACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAH,EAAwB,SAASS,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,G,2CCAtG,IAAI,EAA+BI,OAAkB,UCQrD,MAAMC,EAAY,CACjBC,MAAK,QACLC,SAAQA,EAAAA,UAET,MAAMC,EACLC,WAAAA,CAAYC,GAAkB,IAAdC,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAC,EAC1BG,KAAKC,KAAOD,KAAKE,aACjBF,KAAKG,SAAWvB,OAAOwB,OAAOxB,OAAOwB,OAAOxB,OAAOwB,OAAO,CAAC,EAAGd,EAAUC,MAAMc,SAAUf,EAAUE,SAASa,SAAU,CACpHC,UAAU,EACVC,OAAQ,2BACRC,QAAS,GACTC,KAAM,KACNC,WAAW,EACXC,KAAM,aAEPX,KAAKG,SAAWvB,OAAOwB,OAAOxB,OAAOwB,OAAO,CAAC,EAAGJ,KAAKG,UAAWP,GAChEI,KAAKY,aAAe,KAAOZ,KAAKa,uBAAuBvB,EAAUC,MAAMc,SAAnD,GACpBL,KAAKc,gBAAkB,KAAOd,KAAKa,uBAAuBvB,EAAUE,SAASa,SAAtD,GACL,iBAAPV,IACVK,KAAKG,SAASI,OAASZ,EACvBA,EAAKoB,SAASC,cAAchB,KAAKG,SAASI,SAE3CP,KAAK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1B5F,KAAK4B,aAAeyC,EAASyB,QAAQC,WACrC/F,KAAK4B,aAAaZ,cAAc,eAAeW,YAAY3B,KAAK6F,iBAChE7F,KAAK4B,aAAayE,iBAAiB,mBAAmB,IAAMrG,KAAK4B,aAAaoF,WAC9EhH,KAAK4B,aAAaZ,cAAc,qBAAqBqF,iBAAiB,SAAS,IAAMrG,KAAK6B,MAAMC,SAChG9B,KAAK6B,MAAQ,IAAIvC,EAAUC,MAAMS,KAAK4B,aAAc5B,KAAKY,cAClDZ,KAAK6B,KACb,CACA3B,UAAAA,GAAuB,IAAZJ,EAAMD,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EACnB,OAAOmD,MAAMG,KAAK,CAAErD,WAAU,IAAMmH,KAAKC,MAAsB,GAAhBD,KAAKE,UAAerE,SAAS,MAAKqB,KAAK,GACvF,EAED1E,EAASyE,kBAAoB,CAAC,QAAS,UAAW,QAAS,YAAa,OACxEzE,EAAS+E,kBAAoB,IAAI/E,EAASyE,kBAAmB,QAAS,QACtEzE,EAAS2H,gBAAkB,2BAC3B3H,EAAS4H,WAAa,SAAUlC,GAC/BA,EAAEmC,iBACe,IAAI7H,EAASO,MACrByB,MACV,EACAV,SAASqC,iBAAiB3D,EAAS2H,iBAAiBG,SAAS5H,GAAOA,EAAG0G,iBAAiB,QAAS5G,EAAS4H,cACpF,oBAAXhI,QAA0BA,OAAOC,YAC3CD,OAAOC,UAAUG,SAAWA,GAE7B,Q","sources":["webpack://Lightbox/webpack/bootstrap","webpack://Lightbox/webpack/runtime/define property getters","webpack://Lightbox/webpack/runtime/hasOwnProperty shorthand","webpack://Lightbox/external window \"bootstrap\"","webpack://Lightbox/./src/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"bootstrap\"];","/**\n * Lightbox for Bootstrap 5\n *\n * @file Creates a modal with a lightbox carousel.\n * @module bs5-lightbox\n */\n\nimport { Modal, Carousel } from 'bootstrap';\nconst bootstrap = {\n\tModal,\n\tCarousel\n};\nclass Lightbox {\n\tconstructor(el, options = {}) {\n\t\tthis.hash = this.randomHash();\n\t\tthis.settings = Object.assign(Object.assign(Object.assign({}, bootstrap.Modal.Default), bootstrap.Carousel.Default), {\n\t\t\tinterval: false,\n\t\t\ttarget: '[data-toggle=\"lightbox\"]',\n\t\t\tgallery: '',\n\t\t\tsize: 'xl',\n\t\t\tconstrain: true,\n\t\t\tride: 'carousel'\n\t\t});\n\t\tthis.settings = Object.assign(Object.assign({}, this.settings), options);\n\t\tthis.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))();\n\t\tthis.carouselOptions = (() => this.setOptionsFromSettings(bootstrap.Carousel.Default))();\n\t\tif (typeof el === 'string') {\n\t\t\tthis.settings.target = el;\n\t\t\tel = document.querySelector(this.settings.target);\n\t\t}\n\t\tthis.el = el;\n\t\tthis.type = el.dataset.type || '';\n\n\t\tthis.src = this.getSrc(el);\n\t\tthis.sources = this.getGalleryItems();\n\t\tthis.createCarousel();\n\t\tthis.createModal();\n\t}\n\tshow() {\n\t\tdocument.body.appendChild(this.modalElement);\n\t\tthis.modal.show();\n\t}\n\thide() {\n\t\tthis.modal.hide();\n\t}\n\tsetOptionsFromSettings(obj) {\n\t\treturn Object.keys(obj).reduce((p, c) => Object.assign(p, { [c]: this.settings[c] }), {});\n\t}\n\tgetSrc(el) {\n\t\tlet src = el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900';\n\t\tif (el.dataset.type === 'html') {\n\t\t\treturn src;\n\t\t}\n\t\tif (!/\\:\\/\\//.test(src)) {\n\t\t\tsrc = window.location.origin + src;\n\t\t}\n\t\tconst url = new URL(src);\n\t\tif (el.dataset.footer || el.dataset.caption) {\n\t\t\turl.searchParams.set('caption', el.dataset.footer || el.dataset.caption);\n\t\t}\n\t\treturn url.toString();\n\t}\n\tgetGalleryItems() {\n\t\tlet galleryTarget;\n\t\tif (this.settings.gallery) {\n\t\t\tif (Array.isArray(this.settings.gallery)) {\n\t\t\t\treturn this.settings.gallery;\n\t\t\t}\n\t\t\tgalleryTarget = this.settings.gallery;\n\t\t} else if (this.el.dataset.gallery) {\n\t\t\tgalleryTarget = this.el.dataset.gallery;\n\t\t}\n\t\tconst gallery = galleryTarget\n\t\t\t? [...new Set(Array.from(document.querySelectorAll(`[data-gallery=\"${galleryTarget}\"]`), (v) => `${v.dataset.type ? v.dataset.type : ''}${this.getSrc(v)}`))]\n\t\t\t: [`${this.type ? this.type : ''}${this.src}`];\n\t\treturn gallery;\n\t}\n\tgetYoutubeId(src) {\n\t\tif (!src) return false;\n\t\tconst matches = src.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/);\n\t\treturn matches && matches[2].length === 11 ? matches[2] : false;\n\t}\n\tgetYoutubeLink(src) {\n\t\tconst youtubeId = this.getYoutubeId(src);\n\t\tif (!youtubeId) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst arr = src.split('?');\n\t\tlet params = arr.length > 1 ? '?' + arr[1] : '';\n\t\t\n\t\treturn `https://www.youtube.com/embed/${youtubeId}${params}`;\n\t}\n\tgetInstagramEmbed(src) {\n\t\tif (/instagram/.test(src)) {\n\t\t\tsrc += /\\/embed$/.test(src) ? '' : '/embed';\n\t\t\treturn ``;\n\t\t}\n\t}\n\tisEmbed(src) {\n\t\tconst regex = new RegExp('(' + Lightbox.allowedEmbedTypes.join('|') + ')');\n\t\tconst isEmbed = regex.test(src);\n\t\tconst isImg = /\\.(png|jpe?g|gif|svg|webp)/i.test(src) || this.el.dataset.type === 'image';\n\n\t\treturn isEmbed || !isImg;\n\t}\n\tcreateCarousel() {\n\t\tconst template = document.createElement('template');\n\t\tconst types = Lightbox.allowedMediaTypes.join('|');\n\t\tconst slidesHtml = this.sources\n\t\t\t.map((src, i) => {\n\t\t\t\tsrc = src.replace(/\\/$/, '');\n\t\t\t\tconst regex = new RegExp(`^(${types})`, 'i');\n\t\t\t\tconst isHtml = /^html/.test(src);\n\t\t\t\tconst isForcedImage = /^image/.test(src);\n\n\t\t\t\tif (regex.test(src)) {\n\t\t\t\t\tsrc = src.replace(regex, '');\n\t\t\t\t}\n\t\t\t\tconst imgClasses = this.settings.constrain ? 'mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0' : 'h-100 w-100';\n\t\t\t\tconst params = new URLSearchParams(src.split('?')[1]);\n\t\t\t\tlet caption = '';\n\t\t\t\tlet url = src;\n\t\t\t\tif (params.get('caption')) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\turl = new URL(src);\n\t\t\t\t\t\turl.searchParams.delete('caption');\n\t\t\t\t\t\turl = url.toString();\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\turl = src;\n\t\t\t\t\t}\n\t\t\t\t\tcaption = `${params.get('caption')}
`;\n\t\t\t\t}\n\t\t\t\tlet inner = `
`;\n\t\t\t\tlet attributes = '';\n\t\t\t\tconst instagramEmbed = this.getInstagramEmbed(src);\n\t\t\t\tconst youtubeLink = this.getYoutubeLink(src);\n\t\t\t\tif (this.isEmbed(src) && !isForcedImage) {\n\t\t\t\t\tif (youtubeLink) {\n\t\t\t\t\t\tsrc = youtubeLink;\n\t\t\t\t\t\tattributes = 'title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture\"';\n\t\t\t\t\t}\n\t\t\t\t\tinner = instagramEmbed || ``;\n\t\t\t\t}\n\t\t\t\tif (isHtml) {\n\t\t\t\t\tinner = src;\n\t\t\t\t}\n\t\t\t\tconst spinner = ``;\n\t\t\t\treturn `\n\t\t\t\t\n\t\t\t\t\t${spinner}\n\t\t\t\t\t
${inner}
\n\t\t\t\t\t${caption}\n\t\t\t\t
`;\n\t\t\t})\n\t\t\t.join('');\n\t\tconst controlsHtml =\n\t\t\tthis.sources.length < 2\n\t\t\t\t? ''\n\t\t\t\t: `\n\t\t\t\n\t\t\t`;\n\t\tlet classes = 'lightbox-carousel carousel slide';\n\t\tif (this.settings.size === 'fullscreen') {\n\t\t\tclasses += ' position-absolute w-100 translate-middle top-50 start-50';\n\t\t}\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${slidesHtml}\n\t\t\t\t
\n\t\t\t\t${controlsHtml}\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.carouselElement = template.content.firstChild;\n\t\tconst carouselOptions = Object.assign(Object.assign({}, this.carouselOptions), { keyboard: false });\n\t\tthis.carousel = new bootstrap.Carousel(this.carouselElement, carouselOptions);\n\t\tconst elSrc = this.type && this.type !== 'image' ? this.type + this.src : this.src;\n\t\tthis.carousel.to(this.findGalleryItemIndex(this.sources, elSrc));\n\t\tif (this.carouselOptions.keyboard === true) {\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tif (e.code === 'ArrowLeft') {\n\t\t\t\t\tconst prev = document.getElementById(`#lightboxCarousel-${this.hash}-prev`);\n\t\t\t\t\tif (prev) {\n\t\t\t\t\t\tprev.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (e.code === 'ArrowRight') {\n\t\t\t\t\tconst next = document.getElementById(`#lightboxCarousel-${this.hash}-next`);\n\t\t\t\t\tif (next) {\n\t\t\t\t\t\tnext.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this.carousel;\n\t}\n\tfindGalleryItemIndex(haystack, needle) {\n\t\tlet index = 0;\n\t\tfor (const item of haystack) {\n\t\t\tif (item.includes(needle)) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn 0;\n\t}\n\tcreateModal() {\n\t\tconst template = document.createElement('template');\n\t\tconst btnInner =\n\t\t\t'';\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.modalElement = template.content.firstChild;\n\t\tthis.modalElement.querySelector('.modal-body').appendChild(this.carouselElement);\n\t\tthis.modalElement.addEventListener('hidden.bs.modal', () => this.modalElement.remove());\n\t\tthis.modalElement.querySelector('[data-bs-dismiss]').addEventListener('click', () => this.modal.hide());\n\t\tthis.modal = new bootstrap.Modal(this.modalElement, this.modalOptions);\n\t\treturn this.modal;\n\t}\n\trandomHash(length = 8) {\n\t\treturn Array.from({ length }, () => Math.floor(Math.random() * 36).toString(36)).join('');\n\t}\n}\nLightbox.allowedEmbedTypes = ['embed', 'youtube', 'vimeo', 'instagram', 'url'];\nLightbox.allowedMediaTypes = [...Lightbox.allowedEmbedTypes, 'image', 'html'];\nLightbox.defaultSelector = '[data-toggle=\"lightbox\"]';\nLightbox.initialize = function (e) {\n\te.preventDefault();\n\tconst lightbox = new Lightbox(this);\n\tlightbox.show();\n};\ndocument.querySelectorAll(Lightbox.defaultSelector).forEach((el) => el.addEventListener('click', Lightbox.initialize));\nif (typeof window !== 'undefined' && window.bootstrap) {\n\twindow.bootstrap.Lightbox = Lightbox;\n}\nexport default Lightbox;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","window","bootstrap","Modal","Carousel","Lightbox","constructor","el","options","arguments","length","undefined","this","hash","randomHash","settings","assign","Default","interval","target","gallery","size","constrain","ride","modalOptions","setOptionsFromSettings","carouselOptions","document","querySelector","type","dataset","src","getSrc","sources","getGalleryItems","createCarousel","createModal","show","body","appendChild","modalElement","modal","hide","keys","reduce","p","c","remote","href","test","location","origin","url","URL","footer","caption","searchParams","set","toString","galleryTarget","Array","isArray","Set","from","querySelectorAll","concat","v","getYoutubeId","matches","match","getYoutubeLink","youtubeId","arr","split","params","getInstagramEmbed","isEmbed","RegExp","allowedEmbedTypes","join","isImg","template","createElement","types","allowedMediaTypes","slidesHtml","map","i","replace","regex","isHtml","isForcedImage","imgClasses","URLSearchParams","delete","e","inner","attributes","instagramEmbed","youtubeLink","controlsHtml","classes","html","innerHTML","trim","carouselElement","content","firstChild","keyboard","carousel","elSrc","to","findGalleryItemIndex","addEventListener","code","prev","getElementById","click","next","haystack","needle","index","item","includes","remove","Math","floor","random","defaultSelector","initialize","preventDefault","forEach"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/index.js b/dist/index.js
index 04ea68c..323d842 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,7 +1,7 @@
/*!
* Lightbox for Bootstrap 5 v1.8.3 (https://trvswgnr.github.io/bs5-lightbox/)
- * Copyright 2023 Travis Aaron Wagner (https://github.com/trvswgnr/)
+ * Copyright 2024 Travis Aaron Wagner (https://github.com/trvswgnr/)
* Licensed under MIT (https://github.com/trvswgnr/bs5-lightbox/blob/main/LICENSE)
*/
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("bootstrap")):"function"==typeof define&&define.amd?define("Lightbox",["bootstrap"],e):"object"==typeof exports?exports.Lightbox=e(require("bootstrap")):t.Lightbox=e(t.bootstrap)}(self,(function(t){return function(){"use strict";var e={988:function(e){e.exports=t}},s={};function a(t){var o=s[t];if(void 0!==o)return o.exports;var i=s[t]={exports:{}};return e[t](i,i.exports,a),i.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};return function(){var t=a(988);const e={Modal:t.Modal,Carousel:t.Carousel};class s{constructor(t,s={}){this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},e.Modal.Default),e.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:"",size:"xl",constrain:!0}),this.settings=Object.assign(Object.assign({},this.settings),s),this.modalOptions=(()=>this.setOptionsFromSettings(e.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(e.Carousel.Default))(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target)),this.el=t,this.type=t.dataset.type||"",this.src=this.getSrc(t),this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){let e=t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900";if("html"===t.dataset.type)return e;/\:\/\//.test(e)||(e=window.location.origin+e);const s=new URL(e);return(t.dataset.footer||t.dataset.caption)&&s.searchParams.set("caption",t.dataset.footer||t.dataset.caption),s.toString()}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll(`[data-gallery="${t}"]`),(t=>`${t.dataset.type?t.dataset.type:""}${this.getSrc(t)}`)))]:[`${this.type?this.type:""}${this.src}`]}getYoutubeId(t){if(!t)return!1;const e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getYoutubeLink(t){const e=this.getYoutubeId(t);if(!e)return!1;const s=t.split("?");return`https://www.youtube.com/embed/${e}${s.length>1?"?"+s[1]:""}`}getInstagramEmbed(t){if(/instagram/.test(t))return``}isEmbed(t){const e=new RegExp("("+s.allowedEmbedTypes.join("|")+")").test(t),a=/\.(png|jpe?g|gif|svg|webp)/i.test(t)||"image"===this.el.dataset.type;return e||!a}createCarousel(){const t=document.createElement("template"),a=s.allowedMediaTypes.join("|"),o=this.sources.map(((t,e)=>{t=t.replace(/\/$/,"");const s=new RegExp(`^(${a})`,"i"),o=/^html/.test(t),i=/^image/.test(t);s.test(t)&&(t=t.replace(s,""));const n=this.settings.constrain?"mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0":"h-100 w-100",r=new URLSearchParams(t.split("?")[1]);let l="",d=t;if(r.get("caption")){try{d=new URL(t),d.searchParams.delete("caption"),d=d.toString()}catch(e){d=t}l=`${r.get("caption")}
`}let c=`
`,h="";const u=this.getInstagramEmbed(t),m=this.getYoutubeLink(t);this.isEmbed(t)&&!i&&(m&&(t=m,h='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),c=u||``),o&&(c=t);return`\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
${c}
\n\t\t\t\t\t${l}\n\t\t\t\t
`})).join(""),i=this.sources.length<2?"":`\n\t\t\t\n\t\t\t`;let n="lightbox-carousel carousel slide";"fullscreen"===this.settings.size&&(n+=" position-absolute w-100 translate-middle top-50 start-50");const r=`\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${o}\n\t\t\t\t
\n\t\t\t\t${i}\n\t\t\t
`;t.innerHTML=r.trim(),this.carouselElement=t.content.firstChild;const l=Object.assign(Object.assign({},this.carouselOptions),{keyboard:!1});this.carousel=new e.Carousel(this.carouselElement,l);const d=this.type&&"image"!==this.type?this.type+this.src:this.src;return this.carousel.to(this.findGalleryItemIndex(this.sources,d)),!0===this.carouselOptions.keyboard&&document.addEventListener("keydown",(t=>{if("ArrowLeft"===t.code){const t=document.getElementById(`#lightboxCarousel-${this.hash}-prev`);return t&&t.click(),!1}if("ArrowRight"===t.code){const t=document.getElementById(`#lightboxCarousel-${this.hash}-next`);return t&&t.click(),!1}})),this.carousel}findGalleryItemIndex(t,e){let s=0;for(const a of t){if(a.includes(e))return s;s++}return 0}createModal(){const t=document.createElement("template"),s=`\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;return t.innerHTML=s.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(()=>this.modalElement.remove())),this.modalElement.querySelector("[data-bs-dismiss]").addEventListener("click",(()=>this.modal.hide())),this.modal=new e.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(t=8){return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}s.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],s.allowedMediaTypes=[...s.allowedEmbedTypes,"image","html"],s.defaultSelector='[data-toggle="lightbox"]',s.initialize=function(t){t.preventDefault();new s(this).show()},document.querySelectorAll(s.defaultSelector).forEach((t=>t.addEventListener("click",s.initialize))),"undefined"!=typeof window&&window.bootstrap&&(window.bootstrap.Lightbox=s),o.default=s}(),o=o.default}()}));
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("bootstrap")):"function"==typeof define&&define.amd?define("Lightbox",["bootstrap"],e):"object"==typeof exports?exports.Lightbox=e(require("bootstrap")):t.Lightbox=e(t.bootstrap)}(self,(function(t){return function(){"use strict";var e={814:function(e){e.exports=t}},s={};function a(t){var i=s[t];if(void 0!==i)return i.exports;var o=s[t]={exports:{}};return e[t](o,o.exports,a),o.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={},o=a(814);const n={Modal:o.Modal,Carousel:o.Carousel};class r{constructor(t,e={}){this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},n.Modal.Default),n.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:"",size:"xl",constrain:!0,ride:"carousel"}),this.settings=Object.assign(Object.assign({},this.settings),e),this.modalOptions=(()=>this.setOptionsFromSettings(n.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(n.Carousel.Default))(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target)),this.el=t,this.type=t.dataset.type||"",this.src=this.getSrc(t),this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){let e=t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900";if("html"===t.dataset.type)return e;/\:\/\//.test(e)||(e=window.location.origin+e);const s=new URL(e);return(t.dataset.footer||t.dataset.caption)&&s.searchParams.set("caption",t.dataset.footer||t.dataset.caption),s.toString()}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll(`[data-gallery="${t}"]`),(t=>`${t.dataset.type?t.dataset.type:""}${this.getSrc(t)}`)))]:[`${this.type?this.type:""}${this.src}`]}getYoutubeId(t){if(!t)return!1;const e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getYoutubeLink(t){const e=this.getYoutubeId(t);if(!e)return!1;const s=t.split("?");return`https://www.youtube.com/embed/${e}${s.length>1?"?"+s[1]:""}`}getInstagramEmbed(t){if(/instagram/.test(t))return``}isEmbed(t){const e=new RegExp("("+r.allowedEmbedTypes.join("|")+")").test(t),s=/\.(png|jpe?g|gif|svg|webp)/i.test(t)||"image"===this.el.dataset.type;return e||!s}createCarousel(){const t=document.createElement("template"),e=r.allowedMediaTypes.join("|"),s=this.sources.map(((t,s)=>{t=t.replace(/\/$/,"");const a=new RegExp(`^(${e})`,"i"),i=/^html/.test(t),o=/^image/.test(t);a.test(t)&&(t=t.replace(a,""));const n=this.settings.constrain?"mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0":"h-100 w-100",r=new URLSearchParams(t.split("?")[1]);let l="",d=t;if(r.get("caption")){try{d=new URL(t),d.searchParams.delete("caption"),d=d.toString()}catch(e){d=t}l=`${r.get("caption")}
`}let c=`
`,h="";const u=this.getInstagramEmbed(t),m=this.getYoutubeLink(t);this.isEmbed(t)&&!o&&(m&&(t=m,h='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),c=u||``),i&&(c=t);return`\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
${c}
\n\t\t\t\t\t${l}\n\t\t\t\t
`})).join(""),a=this.sources.length<2?"":`\n\t\t\t\n\t\t\t`;let i="lightbox-carousel carousel slide";"fullscreen"===this.settings.size&&(i+=" position-absolute w-100 translate-middle top-50 start-50");const o=`\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${s}\n\t\t\t\t
\n\t\t\t\t${a}\n\t\t\t
`;t.innerHTML=o.trim(),this.carouselElement=t.content.firstChild;const l=Object.assign(Object.assign({},this.carouselOptions),{keyboard:!1});this.carousel=new n.Carousel(this.carouselElement,l);const d=this.type&&"image"!==this.type?this.type+this.src:this.src;return this.carousel.to(this.findGalleryItemIndex(this.sources,d)),!0===this.carouselOptions.keyboard&&document.addEventListener("keydown",(t=>{if("ArrowLeft"===t.code){const t=document.getElementById(`#lightboxCarousel-${this.hash}-prev`);return t&&t.click(),!1}if("ArrowRight"===t.code){const t=document.getElementById(`#lightboxCarousel-${this.hash}-next`);return t&&t.click(),!1}})),this.carousel}findGalleryItemIndex(t,e){let s=0;for(const a of t){if(a.includes(e))return s;s++}return 0}createModal(){const t=document.createElement("template"),e=`\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(()=>this.modalElement.remove())),this.modalElement.querySelector("[data-bs-dismiss]").addEventListener("click",(()=>this.modal.hide())),this.modal=new n.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(t=8){return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}return r.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],r.allowedMediaTypes=[...r.allowedEmbedTypes,"image","html"],r.defaultSelector='[data-toggle="lightbox"]',r.initialize=function(t){t.preventDefault();new r(this).show()},document.querySelectorAll(r.defaultSelector).forEach((t=>t.addEventListener("click",r.initialize))),"undefined"!=typeof window&&window.bootstrap&&(window.bootstrap.Lightbox=r),i.default=r,i=i.default}()}));
//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/index.js.map b/dist/index.js.map
index 7183fa6..11fed2d 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,WAAY,CAAC,aAAcJ,GACR,iBAAZC,QACdA,QAAkB,SAAID,EAAQG,QAAQ,cAEtCJ,EAAe,SAAIC,EAAQD,EAAg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AAEM,WAAU,IAAMwD,KAAKC,MAAsB,GAAhBD,KAAKE,UAAerE,SAAS,MAAKoB,KAAK,GACvF,EAEDtE,EAASqE,kBAAoB,CAAC,QAAS,UAAW,QAAS,YAAa,OACxErE,EAAS2E,kBAAoB,IAAI3E,EAASqE,kBAAmB,QAAS,QACtErE,EAASwH,gBAAkB,2BAC3BxH,EAASyH,WAAa,SAAUlC,GAC/BA,EAAEmC,iBACe,IAAI1H,EAASI,MACrBwB,MACV,EACAV,SAASsC,iBAAiBxD,EAASwH,iBAAiBG,SAASzH,GAAOA,EAAGuG,iBAAiB,QAASzG,EAASyH,cACpF,oBAAXhF,QAA0BA,OAAO5C,YAC3C4C,OAAO5C,UAAUG,SAAWA,GAE7B,W,gBNlPA,E","sources":["webpack://bs5-lightbox/webpack/universalModuleDefinition","webpack://bs5-lightbox/external umd \"bootstrap\"","webpack://bs5-lightbox/webpack/bootstrap","webpack://bs5-lightbox/webpack/runtime/compat get default export","webpack://bs5-lightbox/webpack/runtime/define property getters","webpack://bs5-lightbox/webpack/runtime/hasOwnProperty shorthand","webpack://bs5-lightbox/./src/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"bootstrap\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Lightbox\", [\"bootstrap\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Lightbox\"] = factory(require(\"bootstrap\"));\n\telse\n\t\troot[\"Lightbox\"] = factory(root[\"bootstrap\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__988__) {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__988__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/**\n * Lightbox for Bootstrap 5\n *\n * @file Creates a modal with a lightbox carousel.\n * @module bs5-lightbox\n */\n\nimport { Modal, Carousel } from 'bootstrap';\nconst bootstrap = {\n\tModal,\n\tCarousel\n};\nclass Lightbox {\n\tconstructor(el, options = {}) {\n\t\tthis.hash = this.randomHash();\n\t\tthis.settings = Object.assign(Object.assign(Object.assign({}, bootstrap.Modal.Default), bootstrap.Carousel.Default), {\n\t\t\tinterval: false,\n\t\t\ttarget: '[data-toggle=\"lightbox\"]',\n\t\t\tgallery: '',\n\t\t\tsize: 'xl',\n\t\t\tconstrain: true\n\t\t});\n\t\tthis.settings = Object.assign(Object.assign({}, this.settings), options);\n\t\tthis.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))();\n\t\tthis.carouselOptions = (() => this.setOptionsFromSettings(bootstrap.Carousel.Default))();\n\t\tif (typeof el === 'string') {\n\t\t\tthis.settings.target = el;\n\t\t\tel = document.querySelector(this.settings.target);\n\t\t}\n\t\tthis.el = el;\n\t\tthis.type = el.dataset.type || '';\n\n\t\tthis.src = this.getSrc(el);\n\t\tthis.sources = this.getGalleryItems();\n\t\tthis.createCarousel();\n\t\tthis.createModal();\n\t}\n\tshow() {\n\t\tdocument.body.appendChild(this.modalElement);\n\t\tthis.modal.show();\n\t}\n\thide() {\n\t\tthis.modal.hide();\n\t}\n\tsetOptionsFromSettings(obj) {\n\t\treturn Object.keys(obj).reduce((p, c) => Object.assign(p, { [c]: this.settings[c] }), {});\n\t}\n\tgetSrc(el) {\n\t\tlet src = el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900';\n\t\tif (el.dataset.type === 'html') {\n\t\t\treturn src;\n\t\t}\n\t\tif (!/\\:\\/\\//.test(src)) {\n\t\t\tsrc = window.location.origin + src;\n\t\t}\n\t\tconst url = new URL(src);\n\t\tif (el.dataset.footer || el.dataset.caption) {\n\t\t\turl.searchParams.set('caption', el.dataset.footer || el.dataset.caption);\n\t\t}\n\t\treturn url.toString();\n\t}\n\tgetGalleryItems() {\n\t\tlet galleryTarget;\n\t\tif (this.settings.gallery) {\n\t\t\tif (Array.isArray(this.settings.gallery)) {\n\t\t\t\treturn this.settings.gallery;\n\t\t\t}\n\t\t\tgalleryTarget = this.settings.gallery;\n\t\t} else if (this.el.dataset.gallery) {\n\t\t\tgalleryTarget = this.el.dataset.gallery;\n\t\t}\n\t\tconst gallery = galleryTarget\n\t\t\t? [...new Set(Array.from(document.querySelectorAll(`[data-gallery=\"${galleryTarget}\"]`), (v) => `${v.dataset.type ? v.dataset.type : ''}${this.getSrc(v)}`))]\n\t\t\t: [`${this.type ? this.type : ''}${this.src}`];\n\t\treturn gallery;\n\t}\n\tgetYoutubeId(src) {\n\t\tif (!src) return false;\n\t\tconst matches = src.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/);\n\t\treturn matches && matches[2].length === 11 ? matches[2] : false;\n\t}\n\tgetYoutubeLink(src) {\n\t\tconst youtubeId = this.getYoutubeId(src);\n\t\tif (!youtubeId) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst arr = src.split('?');\n\t\tlet params = arr.length > 1 ? '?' + arr[1] : '';\n\t\t\n\t\treturn `https://www.youtube.com/embed/${youtubeId}${params}`;\n\t}\n\tgetInstagramEmbed(src) {\n\t\tif (/instagram/.test(src)) {\n\t\t\tsrc += /\\/embed$/.test(src) ? '' : '/embed';\n\t\t\treturn ``;\n\t\t}\n\t}\n\tisEmbed(src) {\n\t\tconst regex = new RegExp('(' + Lightbox.allowedEmbedTypes.join('|') + ')');\n\t\tconst isEmbed = regex.test(src);\n\t\tconst isImg = /\\.(png|jpe?g|gif|svg|webp)/i.test(src) || this.el.dataset.type === 'image';\n\n\t\treturn isEmbed || !isImg;\n\t}\n\tcreateCarousel() {\n\t\tconst template = document.createElement('template');\n\t\tconst types = Lightbox.allowedMediaTypes.join('|');\n\t\tconst slidesHtml = this.sources\n\t\t\t.map((src, i) => {\n\t\t\t\tsrc = src.replace(/\\/$/, '');\n\t\t\t\tconst regex = new RegExp(`^(${types})`, 'i');\n\t\t\t\tconst isHtml = /^html/.test(src);\n\t\t\t\tconst isForcedImage = /^image/.test(src);\n\n\t\t\t\tif (regex.test(src)) {\n\t\t\t\t\tsrc = src.replace(regex, '');\n\t\t\t\t}\n\t\t\t\tconst imgClasses = this.settings.constrain ? 'mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0' : 'h-100 w-100';\n\t\t\t\tconst params = new URLSearchParams(src.split('?')[1]);\n\t\t\t\tlet caption = '';\n\t\t\t\tlet url = src;\n\t\t\t\tif (params.get('caption')) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\turl = new URL(src);\n\t\t\t\t\t\turl.searchParams.delete('caption');\n\t\t\t\t\t\turl = url.toString();\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\turl = src;\n\t\t\t\t\t}\n\t\t\t\t\tcaption = `${params.get('caption')}
`;\n\t\t\t\t}\n\t\t\t\tlet inner = `
`;\n\t\t\t\tlet attributes = '';\n\t\t\t\tconst instagramEmbed = this.getInstagramEmbed(src);\n\t\t\t\tconst youtubeLink = this.getYoutubeLink(src);\n\t\t\t\tif (this.isEmbed(src) && !isForcedImage) {\n\t\t\t\t\tif (youtubeLink) {\n\t\t\t\t\t\tsrc = youtubeLink;\n\t\t\t\t\t\tattributes = 'title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture\"';\n\t\t\t\t\t}\n\t\t\t\t\tinner = instagramEmbed || ``;\n\t\t\t\t}\n\t\t\t\tif (isHtml) {\n\t\t\t\t\tinner = src;\n\t\t\t\t}\n\t\t\t\tconst spinner = ``;\n\t\t\t\treturn `\n\t\t\t\t\n\t\t\t\t\t${spinner}\n\t\t\t\t\t
${inner}
\n\t\t\t\t\t${caption}\n\t\t\t\t
`;\n\t\t\t})\n\t\t\t.join('');\n\t\tconst controlsHtml =\n\t\t\tthis.sources.length < 2\n\t\t\t\t? ''\n\t\t\t\t: `\n\t\t\t\n\t\t\t`;\n\t\tlet classes = 'lightbox-carousel carousel slide';\n\t\tif (this.settings.size === 'fullscreen') {\n\t\t\tclasses += ' position-absolute w-100 translate-middle top-50 start-50';\n\t\t}\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${slidesHtml}\n\t\t\t\t
\n\t\t\t\t${controlsHtml}\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.carouselElement = template.content.firstChild;\n\t\tconst carouselOptions = Object.assign(Object.assign({}, this.carouselOptions), { keyboard: false });\n\t\tthis.carousel = new bootstrap.Carousel(this.carouselElement, carouselOptions);\n\t\tconst elSrc = this.type && this.type !== 'image' ? this.type + this.src : this.src;\n\t\tthis.carousel.to(this.findGalleryItemIndex(this.sources, elSrc));\n\t\tif (this.carouselOptions.keyboard === true) {\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tif (e.code === 'ArrowLeft') {\n\t\t\t\t\tconst prev = document.getElementById(`#lightboxCarousel-${this.hash}-prev`);\n\t\t\t\t\tif (prev) {\n\t\t\t\t\t\tprev.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (e.code === 'ArrowRight') {\n\t\t\t\t\tconst next = document.getElementById(`#lightboxCarousel-${this.hash}-next`);\n\t\t\t\t\tif (next) {\n\t\t\t\t\t\tnext.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this.carousel;\n\t}\n\tfindGalleryItemIndex(haystack, needle) {\n\t\tlet index = 0;\n\t\tfor (const item of haystack) {\n\t\t\tif (item.includes(needle)) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn 0;\n\t}\n\tcreateModal() {\n\t\tconst template = document.createElement('template');\n\t\tconst btnInner =\n\t\t\t'';\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.modalElement = template.content.firstChild;\n\t\tthis.modalElement.querySelector('.modal-body').appendChild(this.carouselElement);\n\t\tthis.modalElement.addEventListener('hidden.bs.modal', () => this.modalElement.remove());\n\t\tthis.modalElement.querySelector('[data-bs-dismiss]').addEventListener('click', () => this.modal.hide());\n\t\tthis.modal = new bootstrap.Modal(this.modalElement, this.modalOptions);\n\t\treturn this.modal;\n\t}\n\trandomHash(length = 8) {\n\t\treturn Array.from({ length }, () => Math.floor(Math.random() * 36).toString(36)).join('');\n\t}\n}\nLightbox.allowedEmbedTypes = ['embed', 'youtube', 'vimeo', 'instagram', 'url'];\nLightbox.allowedMediaTypes = [...Lightbox.allowedEmbedTypes, 'image', 'html'];\nLightbox.defaultSelector = '[data-toggle=\"lightbox\"]';\nLightbox.initialize = function (e) {\n\te.preventDefault();\n\tconst lightbox = new Lightbox(this);\n\tlightbox.show();\n};\ndocument.querySelectorAll(Lightbox.defaultSelector).forEach((el) => el.addEventListener('click', Lightbox.initialize));\nif (typeof window !== 'undefined' && window.bootstrap) {\n\twindow.bootstrap.Lightbox = Lightbox;\n}\nexport default Lightbox;\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__988__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","bootstrap","Modal","Carousel","Lightbox","constructor","el","options","this","hash","randomHash","settings","assign","Default","interval","target","gallery","size","constrain","modalOptions","setOptionsFromSettings","carouselOptions","document","querySelector","type","dataset","src","getSrc","sources","getGalleryItems","createCarousel","createModal","show","body","appendChild","modalElement","modal","hide","keys","reduce","p","c","remote","href","test","window","location","origin","url","URL","footer","caption","searchParams","set","toString","galleryTarget","Array","isArray","Set","from","querySelectorAll","v","getYoutubeId","matches","match","length","getYoutubeLink","youtubeId","arr","split","getInstagramEmbed","isEmbed","RegExp","allowedEmbedTypes","join","isImg","template","createElement","types","allowedMediaTypes","slidesHtml","map","i","replace","regex","isHtml","isForcedImage","imgClasses","params","URLSearchParams","delete","e","inner","attributes","instagramEmbed","youtubeLink","controlsHtml","classes","html","innerHTML","trim","carouselElement","content","firstChild","keyboard","carousel","elSrc","to","findGalleryItemIndex","addEventListener","code","prev","getElementById","click","next","haystack","needle","index","item","includes","remove","Math","floor","random","defaultSelector","initialize","preventDefault","forEach"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,WAAY,CAAC,aAAcJ,GACR,iBAAZC,QACdA,Q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AiB,SAAS,IAAMtG,KAAK6B,MAAMC,SAChG9B,KAAK6B,MAAQ,IAAIpC,EAAUC,MAAMM,KAAK4B,aAAc5B,KAAKY,cAClDZ,KAAK6B,KACb,CACA,UAAA3B,CAAWwD,EAAS,GACnB,OAAOT,MAAMG,KAAK,CAAEM,WAAU,IAAMwD,KAAKC,MAAsB,GAAhBD,KAAKE,UAAerE,SAAS,MAAKoB,KAAK,GACvF,E,OAEDvE,EAASsE,kBAAoB,CAAC,QAAS,UAAW,QAAS,YAAa,OACxEtE,EAAS4E,kBAAoB,IAAI5E,EAASsE,kBAAmB,QAAS,QACtEtE,EAASyH,gBAAkB,2BAC3BzH,EAAS0H,WAAa,SAAUlC,GAC/BA,EAAEmC,iBACe,IAAI3H,EAASI,MACrByB,MACV,EACAV,SAASsC,iBAAiBzD,EAASyH,iBAAiBG,SAAS1H,GAAOA,EAAGwG,iBAAiB,QAAS1G,EAAS0H,cACpF,oBAAXhF,QAA0BA,OAAO7C,YAC3C6C,OAAO7C,UAAUG,SAAWA,GAE7B,Y,YNnPA,E","sources":["webpack://bs5-lightbox/webpack/universalModuleDefinition","webpack://bs5-lightbox/external umd \"bootstrap\"","webpack://bs5-lightbox/webpack/bootstrap","webpack://bs5-lightbox/webpack/runtime/compat get default export","webpack://bs5-lightbox/webpack/runtime/define property getters","webpack://bs5-lightbox/webpack/runtime/hasOwnProperty shorthand","webpack://bs5-lightbox/./src/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"bootstrap\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Lightbox\", [\"bootstrap\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Lightbox\"] = factory(require(\"bootstrap\"));\n\telse\n\t\troot[\"Lightbox\"] = factory(root[\"bootstrap\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__814__) {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__814__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/**\n * Lightbox for Bootstrap 5\n *\n * @file Creates a modal with a lightbox carousel.\n * @module bs5-lightbox\n */\n\nimport { Modal, Carousel } from 'bootstrap';\nconst bootstrap = {\n\tModal,\n\tCarousel\n};\nclass Lightbox {\n\tconstructor(el, options = {}) {\n\t\tthis.hash = this.randomHash();\n\t\tthis.settings = Object.assign(Object.assign(Object.assign({}, bootstrap.Modal.Default), bootstrap.Carousel.Default), {\n\t\t\tinterval: false,\n\t\t\ttarget: '[data-toggle=\"lightbox\"]',\n\t\t\tgallery: '',\n\t\t\tsize: 'xl',\n\t\t\tconstrain: true,\n\t\t\tride: 'carousel'\n\t\t});\n\t\tthis.settings = Object.assign(Object.assign({}, this.settings), options);\n\t\tthis.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))();\n\t\tthis.carouselOptions = (() => this.setOptionsFromSettings(bootstrap.Carousel.Default))();\n\t\tif (typeof el === 'string') {\n\t\t\tthis.settings.target = el;\n\t\t\tel = document.querySelector(this.settings.target);\n\t\t}\n\t\tthis.el = el;\n\t\tthis.type = el.dataset.type || '';\n\n\t\tthis.src = this.getSrc(el);\n\t\tthis.sources = this.getGalleryItems();\n\t\tthis.createCarousel();\n\t\tthis.createModal();\n\t}\n\tshow() {\n\t\tdocument.body.appendChild(this.modalElement);\n\t\tthis.modal.show();\n\t}\n\thide() {\n\t\tthis.modal.hide();\n\t}\n\tsetOptionsFromSettings(obj) {\n\t\treturn Object.keys(obj).reduce((p, c) => Object.assign(p, { [c]: this.settings[c] }), {});\n\t}\n\tgetSrc(el) {\n\t\tlet src = el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900';\n\t\tif (el.dataset.type === 'html') {\n\t\t\treturn src;\n\t\t}\n\t\tif (!/\\:\\/\\//.test(src)) {\n\t\t\tsrc = window.location.origin + src;\n\t\t}\n\t\tconst url = new URL(src);\n\t\tif (el.dataset.footer || el.dataset.caption) {\n\t\t\turl.searchParams.set('caption', el.dataset.footer || el.dataset.caption);\n\t\t}\n\t\treturn url.toString();\n\t}\n\tgetGalleryItems() {\n\t\tlet galleryTarget;\n\t\tif (this.settings.gallery) {\n\t\t\tif (Array.isArray(this.settings.gallery)) {\n\t\t\t\treturn this.settings.gallery;\n\t\t\t}\n\t\t\tgalleryTarget = this.settings.gallery;\n\t\t} else if (this.el.dataset.gallery) {\n\t\t\tgalleryTarget = this.el.dataset.gallery;\n\t\t}\n\t\tconst gallery = galleryTarget\n\t\t\t? [...new Set(Array.from(document.querySelectorAll(`[data-gallery=\"${galleryTarget}\"]`), (v) => `${v.dataset.type ? v.dataset.type : ''}${this.getSrc(v)}`))]\n\t\t\t: [`${this.type ? this.type : ''}${this.src}`];\n\t\treturn gallery;\n\t}\n\tgetYoutubeId(src) {\n\t\tif (!src) return false;\n\t\tconst matches = src.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/);\n\t\treturn matches && matches[2].length === 11 ? matches[2] : false;\n\t}\n\tgetYoutubeLink(src) {\n\t\tconst youtubeId = this.getYoutubeId(src);\n\t\tif (!youtubeId) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst arr = src.split('?');\n\t\tlet params = arr.length > 1 ? '?' + arr[1] : '';\n\t\t\n\t\treturn `https://www.youtube.com/embed/${youtubeId}${params}`;\n\t}\n\tgetInstagramEmbed(src) {\n\t\tif (/instagram/.test(src)) {\n\t\t\tsrc += /\\/embed$/.test(src) ? '' : '/embed';\n\t\t\treturn ``;\n\t\t}\n\t}\n\tisEmbed(src) {\n\t\tconst regex = new RegExp('(' + Lightbox.allowedEmbedTypes.join('|') + ')');\n\t\tconst isEmbed = regex.test(src);\n\t\tconst isImg = /\\.(png|jpe?g|gif|svg|webp)/i.test(src) || this.el.dataset.type === 'image';\n\n\t\treturn isEmbed || !isImg;\n\t}\n\tcreateCarousel() {\n\t\tconst template = document.createElement('template');\n\t\tconst types = Lightbox.allowedMediaTypes.join('|');\n\t\tconst slidesHtml = this.sources\n\t\t\t.map((src, i) => {\n\t\t\t\tsrc = src.replace(/\\/$/, '');\n\t\t\t\tconst regex = new RegExp(`^(${types})`, 'i');\n\t\t\t\tconst isHtml = /^html/.test(src);\n\t\t\t\tconst isForcedImage = /^image/.test(src);\n\n\t\t\t\tif (regex.test(src)) {\n\t\t\t\t\tsrc = src.replace(regex, '');\n\t\t\t\t}\n\t\t\t\tconst imgClasses = this.settings.constrain ? 'mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0' : 'h-100 w-100';\n\t\t\t\tconst params = new URLSearchParams(src.split('?')[1]);\n\t\t\t\tlet caption = '';\n\t\t\t\tlet url = src;\n\t\t\t\tif (params.get('caption')) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\turl = new URL(src);\n\t\t\t\t\t\turl.searchParams.delete('caption');\n\t\t\t\t\t\turl = url.toString();\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\turl = src;\n\t\t\t\t\t}\n\t\t\t\t\tcaption = `${params.get('caption')}
`;\n\t\t\t\t}\n\t\t\t\tlet inner = `
`;\n\t\t\t\tlet attributes = '';\n\t\t\t\tconst instagramEmbed = this.getInstagramEmbed(src);\n\t\t\t\tconst youtubeLink = this.getYoutubeLink(src);\n\t\t\t\tif (this.isEmbed(src) && !isForcedImage) {\n\t\t\t\t\tif (youtubeLink) {\n\t\t\t\t\t\tsrc = youtubeLink;\n\t\t\t\t\t\tattributes = 'title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture\"';\n\t\t\t\t\t}\n\t\t\t\t\tinner = instagramEmbed || ``;\n\t\t\t\t}\n\t\t\t\tif (isHtml) {\n\t\t\t\t\tinner = src;\n\t\t\t\t}\n\t\t\t\tconst spinner = ``;\n\t\t\t\treturn `\n\t\t\t\t\n\t\t\t\t\t${spinner}\n\t\t\t\t\t
${inner}
\n\t\t\t\t\t${caption}\n\t\t\t\t
`;\n\t\t\t})\n\t\t\t.join('');\n\t\tconst controlsHtml =\n\t\t\tthis.sources.length < 2\n\t\t\t\t? ''\n\t\t\t\t: `\n\t\t\t\n\t\t\t`;\n\t\tlet classes = 'lightbox-carousel carousel slide';\n\t\tif (this.settings.size === 'fullscreen') {\n\t\t\tclasses += ' position-absolute w-100 translate-middle top-50 start-50';\n\t\t}\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${slidesHtml}\n\t\t\t\t
\n\t\t\t\t${controlsHtml}\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.carouselElement = template.content.firstChild;\n\t\tconst carouselOptions = Object.assign(Object.assign({}, this.carouselOptions), { keyboard: false });\n\t\tthis.carousel = new bootstrap.Carousel(this.carouselElement, carouselOptions);\n\t\tconst elSrc = this.type && this.type !== 'image' ? this.type + this.src : this.src;\n\t\tthis.carousel.to(this.findGalleryItemIndex(this.sources, elSrc));\n\t\tif (this.carouselOptions.keyboard === true) {\n\t\t\tdocument.addEventListener('keydown', (e) => {\n\t\t\t\tif (e.code === 'ArrowLeft') {\n\t\t\t\t\tconst prev = document.getElementById(`#lightboxCarousel-${this.hash}-prev`);\n\t\t\t\t\tif (prev) {\n\t\t\t\t\t\tprev.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (e.code === 'ArrowRight') {\n\t\t\t\t\tconst next = document.getElementById(`#lightboxCarousel-${this.hash}-next`);\n\t\t\t\t\tif (next) {\n\t\t\t\t\t\tnext.click();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this.carousel;\n\t}\n\tfindGalleryItemIndex(haystack, needle) {\n\t\tlet index = 0;\n\t\tfor (const item of haystack) {\n\t\t\tif (item.includes(needle)) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn 0;\n\t}\n\tcreateModal() {\n\t\tconst template = document.createElement('template');\n\t\tconst btnInner =\n\t\t\t'';\n\t\tconst html = `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`;\n\t\ttemplate.innerHTML = html.trim();\n\t\tthis.modalElement = template.content.firstChild;\n\t\tthis.modalElement.querySelector('.modal-body').appendChild(this.carouselElement);\n\t\tthis.modalElement.addEventListener('hidden.bs.modal', () => this.modalElement.remove());\n\t\tthis.modalElement.querySelector('[data-bs-dismiss]').addEventListener('click', () => this.modal.hide());\n\t\tthis.modal = new bootstrap.Modal(this.modalElement, this.modalOptions);\n\t\treturn this.modal;\n\t}\n\trandomHash(length = 8) {\n\t\treturn Array.from({ length }, () => Math.floor(Math.random() * 36).toString(36)).join('');\n\t}\n}\nLightbox.allowedEmbedTypes = ['embed', 'youtube', 'vimeo', 'instagram', 'url'];\nLightbox.allowedMediaTypes = [...Lightbox.allowedEmbedTypes, 'image', 'html'];\nLightbox.defaultSelector = '[data-toggle=\"lightbox\"]';\nLightbox.initialize = function (e) {\n\te.preventDefault();\n\tconst lightbox = new Lightbox(this);\n\tlightbox.show();\n};\ndocument.querySelectorAll(Lightbox.defaultSelector).forEach((el) => el.addEventListener('click', Lightbox.initialize));\nif (typeof window !== 'undefined' && window.bootstrap) {\n\twindow.bootstrap.Lightbox = Lightbox;\n}\nexport default Lightbox;\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__814__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","bootstrap","Modal","Carousel","Lightbox","constructor","el","options","this","hash","randomHash","settings","assign","Default","interval","target","gallery","size","constrain","ride","modalOptions","setOptionsFromSettings","carouselOptions","document","querySelector","type","dataset","src","getSrc","sources","getGalleryItems","createCarousel","createModal","show","body","appendChild","modalElement","modal","hide","keys","reduce","p","c","remote","href","test","window","location","origin","url","URL","footer","caption","searchParams","set","toString","galleryTarget","Array","isArray","Set","from","querySelectorAll","v","getYoutubeId","matches","match","length","getYoutubeLink","youtubeId","arr","split","getInstagramEmbed","isEmbed","RegExp","allowedEmbedTypes","join","isImg","template","createElement","types","allowedMediaTypes","slidesHtml","map","i","replace","regex","isHtml","isForcedImage","imgClasses","params","URLSearchParams","delete","e","inner","attributes","instagramEmbed","youtubeLink","controlsHtml","classes","html","innerHTML","trim","carouselElement","content","firstChild","keyboard","carousel","elSrc","to","findGalleryItemIndex","addEventListener","code","prev","getElementById","click","next","haystack","needle","index","item","includes","remove","Math","floor","random","defaultSelector","initialize","preventDefault","forEach"],"sourceRoot":""}
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 4a29160..7d4afcf 100644
--- a/src/index.js
+++ b/src/index.js
@@ -18,7 +18,8 @@ class Lightbox {
target: '[data-toggle="lightbox"]',
gallery: '',
size: 'xl',
- constrain: true
+ constrain: true,
+ ride: 'carousel'
});
this.settings = Object.assign(Object.assign({}, this.settings), options);
this.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))();
@@ -170,7 +171,7 @@ class Lightbox {
classes += ' position-absolute w-100 translate-middle top-50 start-50';
}
const html = `
-