@innovastudio/contentbuilder-runtime 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1071 @@
1
+ function Fe(H) {
2
+ return H && H.__esModule && Object.prototype.hasOwnProperty.call(H, "default") ? H.default : H;
3
+ }
4
+ var re = { exports: {} }, Ge = re.exports, Ce;
5
+ function Ze() {
6
+ return Ce || (Ce = 1, (function(H, z) {
7
+ (function(x, q) {
8
+ H.exports = q();
9
+ })(Ge, (function() {
10
+ function x(e, t) {
11
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12
+ }
13
+ function q(e, t) {
14
+ for (var i = 0; i < t.length; i++) {
15
+ var n = t[i];
16
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, V(n.key), n);
17
+ }
18
+ }
19
+ function A(e, t, i) {
20
+ return t && q(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
21
+ }
22
+ function V(e) {
23
+ var t = (function(i, n) {
24
+ if (typeof i != "object" || !i) return i;
25
+ var s = i[Symbol.toPrimitive];
26
+ if (s !== void 0) {
27
+ var r = s.call(i, n);
28
+ if (typeof r != "object") return r;
29
+ throw new TypeError("@@toPrimitive must return a primitive value.");
30
+ }
31
+ return String(i);
32
+ })(e, "string");
33
+ return typeof t == "symbol" ? t : t + "";
34
+ }
35
+ function R(e) {
36
+ return (R = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
37
+ return typeof t;
38
+ } : function(t) {
39
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
40
+ })(e);
41
+ }
42
+ var Z = Date.now();
43
+ function L() {
44
+ var e = {}, t = !0, i = 0, n = arguments.length;
45
+ Object.prototype.toString.call(arguments[0]) === "[object Boolean]" && (t = arguments[0], i++);
46
+ for (var s = function(l) {
47
+ for (var a in l) Object.prototype.hasOwnProperty.call(l, a) && (t && Object.prototype.toString.call(l[a]) === "[object Object]" ? e[a] = L(!0, e[a], l[a]) : e[a] = l[a]);
48
+ }; i < n; i++) {
49
+ var r = arguments[i];
50
+ s(r);
51
+ }
52
+ return e;
53
+ }
54
+ function y(e, t) {
55
+ if ((N(e) || e === window || e === document) && (e = [e]), ve(e) || $(e) || (e = [e]), pe(e) != 0) {
56
+ if (ve(e) && !$(e)) for (var i = e.length, n = 0; n < i && t.call(e[n], e[n], n, e) !== !1; n++) ;
57
+ else if ($(e)) {
58
+ for (var s in e) if (w(e, s) && t.call(e[s], e[s], s, e) === !1) break;
59
+ }
60
+ }
61
+ }
62
+ function F(e) {
63
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, n = e[Z] = e[Z] || [], s = { all: n, evt: null, found: null };
64
+ return t && i && pe(n) > 0 && y(n, (function(r, l) {
65
+ if (r.eventName == t && r.fn.toString() == i.toString()) return s.found = !0, s.evt = l, !1;
66
+ })), s;
67
+ }
68
+ function P(e) {
69
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = t.onElement, n = t.withCallback, s = t.avoidDuplicate, r = s === void 0 || s, l = t.once, a = l !== void 0 && l, h = t.useCapture, o = h !== void 0 && h, d = arguments.length > 2 ? arguments[2] : void 0, c = i || [];
70
+ function u(g) {
71
+ p(n) && n.call(d, g, this), a && u.destroy();
72
+ }
73
+ return K(c) && (c = document.querySelectorAll(c)), u.destroy = function() {
74
+ y(c, (function(g) {
75
+ var f = F(g, e, u);
76
+ f.found && f.all.splice(f.evt, 1), g.removeEventListener && g.removeEventListener(e, u, o);
77
+ }));
78
+ }, y(c, (function(g) {
79
+ var f = F(g, e, u);
80
+ (g.addEventListener && r && !f.found || !r) && (g.addEventListener(e, u, o), f.all.push({ eventName: e, fn: u }));
81
+ })), u;
82
+ }
83
+ function v(e, t) {
84
+ y(t.split(" "), (function(i) {
85
+ return e.classList.add(i);
86
+ }));
87
+ }
88
+ function S(e, t) {
89
+ y(t.split(" "), (function(i) {
90
+ return e.classList.remove(i);
91
+ }));
92
+ }
93
+ function T(e, t) {
94
+ return e.classList.contains(t);
95
+ }
96
+ function X(e, t) {
97
+ for (; e !== document.body; ) {
98
+ if (!(e = e.parentElement)) return !1;
99
+ if (typeof e.matches == "function" ? e.matches(t) : e.msMatchesSelector(t)) return e;
100
+ }
101
+ }
102
+ function U(e) {
103
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", i = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
104
+ if (!e || t === "") return !1;
105
+ if (t === "none") return p(i) && i(), !1;
106
+ var n = Ae(), s = t.split(" ");
107
+ y(s, (function(r) {
108
+ v(e, "g" + r);
109
+ })), P(n, { onElement: e, avoidDuplicate: !1, once: !0, withCallback: function(r, l) {
110
+ y(s, (function(a) {
111
+ S(l, "g" + a);
112
+ })), p(i) && i();
113
+ } });
114
+ }
115
+ function ee(e) {
116
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
117
+ if (t === "") return e.style.webkitTransform = "", e.style.MozTransform = "", e.style.msTransform = "", e.style.OTransform = "", e.style.transform = "", !1;
118
+ e.style.webkitTransform = t, e.style.MozTransform = t, e.style.msTransform = t, e.style.OTransform = t, e.style.transform = t;
119
+ }
120
+ function ce(e) {
121
+ e.style.display = "block";
122
+ }
123
+ function ae(e) {
124
+ e.style.display = "none";
125
+ }
126
+ function G(e) {
127
+ var t = document.createDocumentFragment(), i = document.createElement("div");
128
+ for (i.innerHTML = e; i.firstChild; ) t.appendChild(i.firstChild);
129
+ return t;
130
+ }
131
+ function ue() {
132
+ return { width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight };
133
+ }
134
+ function Ae() {
135
+ var e, t = document.createElement("fakeelement"), i = { animation: "animationend", OAnimation: "oAnimationEnd", MozAnimation: "animationend", WebkitAnimation: "webkitAnimationEnd" };
136
+ for (e in i) if (t.style[e] !== void 0) return i[e];
137
+ }
138
+ function oe(e, t, i, n) {
139
+ if (e()) t();
140
+ else {
141
+ var s;
142
+ i || (i = 100);
143
+ var r = setInterval((function() {
144
+ e() && (clearInterval(r), s && clearTimeout(s), t());
145
+ }), i);
146
+ }
147
+ }
148
+ function ge(e, t, i) {
149
+ if (I(e)) console.error("Inject assets error");
150
+ else if (p(t) && (i = t, t = !1), K(t) && t in window) p(i) && i();
151
+ else {
152
+ var n;
153
+ if (e.indexOf(".css") !== -1) {
154
+ if ((n = document.querySelectorAll('link[href="' + e + '"]')) && n.length > 0) return void (p(i) && i());
155
+ var s = document.getElementsByTagName("head")[0], r = s.querySelectorAll('link[rel="stylesheet"]'), l = document.createElement("link");
156
+ return l.rel = "stylesheet", l.type = "text/css", l.href = e, l.media = "all", r ? s.insertBefore(l, r[0]) : s.appendChild(l), void (p(i) && i());
157
+ }
158
+ if ((n = document.querySelectorAll('script[src="' + e + '"]')) && n.length > 0) {
159
+ if (p(i)) {
160
+ if (K(t)) return oe((function() {
161
+ return window[t] !== void 0;
162
+ }), (function() {
163
+ i();
164
+ })), !1;
165
+ i();
166
+ }
167
+ } else {
168
+ var a = document.createElement("script");
169
+ a.type = "text/javascript", a.src = e, a.onload = function() {
170
+ if (p(i)) {
171
+ if (K(t)) return oe((function() {
172
+ return window[t] !== void 0;
173
+ }), (function() {
174
+ i();
175
+ })), !1;
176
+ i();
177
+ }
178
+ }, document.body.appendChild(a);
179
+ }
180
+ }
181
+ }
182
+ function he() {
183
+ return "navigator" in window && window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i);
184
+ }
185
+ function p(e) {
186
+ return typeof e == "function";
187
+ }
188
+ function K(e) {
189
+ return typeof e == "string";
190
+ }
191
+ function N(e) {
192
+ return !(!e || !e.nodeType || e.nodeType != 1);
193
+ }
194
+ function fe(e) {
195
+ return Array.isArray(e);
196
+ }
197
+ function ve(e) {
198
+ return e && e.length && isFinite(e.length);
199
+ }
200
+ function $(e) {
201
+ return R(e) === "object" && e != null && !p(e) && !fe(e);
202
+ }
203
+ function I(e) {
204
+ return e == null;
205
+ }
206
+ function w(e, t) {
207
+ return e !== null && hasOwnProperty.call(e, t);
208
+ }
209
+ function pe(e) {
210
+ if ($(e)) {
211
+ if (e.keys) return e.keys().length;
212
+ var t = 0;
213
+ for (var i in e) w(e, i) && t++;
214
+ return t;
215
+ }
216
+ return e.length;
217
+ }
218
+ function te(e) {
219
+ return !isNaN(parseFloat(e)) && isFinite(e);
220
+ }
221
+ function me() {
222
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1, t = document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");
223
+ if (!t.length) return !1;
224
+ if (t.length == 1) return t[0];
225
+ typeof e == "string" && (e = parseInt(e));
226
+ var i = [];
227
+ y(t, (function(a) {
228
+ i.push(a.getAttribute("data-taborder"));
229
+ }));
230
+ var n = Math.max.apply(Math, i.map((function(a) {
231
+ return parseInt(a);
232
+ }))), s = e < 0 ? 1 : e + 1;
233
+ s > n && (s = "1");
234
+ var r = i.filter((function(a) {
235
+ return a >= parseInt(s);
236
+ })), l = r.sort()[0];
237
+ return document.querySelector('.gbtn[data-taborder="'.concat(l, '"]'));
238
+ }
239
+ function Le(e) {
240
+ if (e.events.hasOwnProperty("keyboard")) return !1;
241
+ e.events.keyboard = P("keydown", { onElement: window, withCallback: function(t, i) {
242
+ var n = (t = t || window.event).keyCode;
243
+ if (n == 9) {
244
+ var s = document.querySelector(".gbtn.focused");
245
+ if (!s) {
246
+ var r = !(!document.activeElement || !document.activeElement.nodeName) && document.activeElement.nodeName.toLocaleLowerCase();
247
+ if (r == "input" || r == "textarea" || r == "button") return;
248
+ }
249
+ t.preventDefault();
250
+ var l = document.querySelectorAll(".gbtn[data-taborder]");
251
+ if (!l || l.length <= 0) return;
252
+ if (!s) {
253
+ var a = me();
254
+ return void (a && (a.focus(), v(a, "focused")));
255
+ }
256
+ var h = me(s.getAttribute("data-taborder"));
257
+ S(s, "focused"), h && (h.focus(), v(h, "focused"));
258
+ }
259
+ n == 39 && e.nextSlide(), n == 37 && e.prevSlide(), n == 27 && e.close();
260
+ } });
261
+ }
262
+ var Ie = A((function e(t, i) {
263
+ var n = this, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
264
+ if (x(this, e), this.img = t, this.slide = i, this.onclose = s, this.img.setZoomEvents) return !1;
265
+ this.active = !1, this.zoomedIn = !1, this.dragging = !1, this.currentX = null, this.currentY = null, this.initialX = null, this.initialY = null, this.xOffset = 0, this.yOffset = 0, this.img.addEventListener("mousedown", (function(r) {
266
+ return n.dragStart(r);
267
+ }), !1), this.img.addEventListener("mouseup", (function(r) {
268
+ return n.dragEnd(r);
269
+ }), !1), this.img.addEventListener("mousemove", (function(r) {
270
+ return n.drag(r);
271
+ }), !1), this.img.addEventListener("click", (function(r) {
272
+ return n.slide.classList.contains("dragging-nav") ? (n.zoomOut(), !1) : n.zoomedIn ? void (n.zoomedIn && !n.dragging && n.zoomOut()) : n.zoomIn();
273
+ }), !1), this.img.setZoomEvents = !0;
274
+ }), [{ key: "zoomIn", value: function() {
275
+ var e = this.widowWidth();
276
+ if (!(this.zoomedIn || e <= 768)) {
277
+ var t = this.img;
278
+ if (t.setAttribute("data-style", t.getAttribute("style")), t.style.maxWidth = t.naturalWidth + "px", t.style.maxHeight = t.naturalHeight + "px", t.naturalWidth > e) {
279
+ var i = e / 2 - t.naturalWidth / 2;
280
+ this.setTranslate(this.img.parentNode, i, 0);
281
+ }
282
+ this.slide.classList.add("zoomed"), this.zoomedIn = !0;
283
+ }
284
+ } }, { key: "zoomOut", value: function() {
285
+ this.img.parentNode.setAttribute("style", ""), this.img.setAttribute("style", this.img.getAttribute("data-style")), this.slide.classList.remove("zoomed"), this.zoomedIn = !1, this.currentX = null, this.currentY = null, this.initialX = null, this.initialY = null, this.xOffset = 0, this.yOffset = 0, this.onclose && typeof this.onclose == "function" && this.onclose();
286
+ } }, { key: "dragStart", value: function(e) {
287
+ e.preventDefault(), this.zoomedIn ? (e.type === "touchstart" ? (this.initialX = e.touches[0].clientX - this.xOffset, this.initialY = e.touches[0].clientY - this.yOffset) : (this.initialX = e.clientX - this.xOffset, this.initialY = e.clientY - this.yOffset), e.target === this.img && (this.active = !0, this.img.classList.add("dragging"))) : this.active = !1;
288
+ } }, { key: "dragEnd", value: function(e) {
289
+ var t = this;
290
+ e.preventDefault(), this.initialX = this.currentX, this.initialY = this.currentY, this.active = !1, setTimeout((function() {
291
+ t.dragging = !1, t.img.isDragging = !1, t.img.classList.remove("dragging");
292
+ }), 100);
293
+ } }, { key: "drag", value: function(e) {
294
+ this.active && (e.preventDefault(), e.type === "touchmove" ? (this.currentX = e.touches[0].clientX - this.initialX, this.currentY = e.touches[0].clientY - this.initialY) : (this.currentX = e.clientX - this.initialX, this.currentY = e.clientY - this.initialY), this.xOffset = this.currentX, this.yOffset = this.currentY, this.img.isDragging = !0, this.dragging = !0, this.setTranslate(this.img, this.currentX, this.currentY));
295
+ } }, { key: "onMove", value: function(e) {
296
+ if (this.zoomedIn) {
297
+ var t = e.clientX - this.img.naturalWidth / 2, i = e.clientY - this.img.naturalHeight / 2;
298
+ this.setTranslate(this.img, t, i);
299
+ }
300
+ } }, { key: "setTranslate", value: function(e, t, i) {
301
+ e.style.transform = "translate3d(" + t + "px, " + i + "px, 0)";
302
+ } }, { key: "widowWidth", value: function() {
303
+ return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
304
+ } }]), ye = A((function e() {
305
+ var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
306
+ x(this, e);
307
+ var n = i.dragEl, s = i.toleranceX, r = s === void 0 ? 40 : s, l = i.toleranceY, a = l === void 0 ? 65 : l, h = i.slide, o = h === void 0 ? null : h, d = i.instance, c = d === void 0 ? null : d;
308
+ this.el = n, this.active = !1, this.dragging = !1, this.currentX = null, this.currentY = null, this.initialX = null, this.initialY = null, this.xOffset = 0, this.yOffset = 0, this.direction = null, this.lastDirection = null, this.toleranceX = r, this.toleranceY = a, this.toleranceReached = !1, this.dragContainer = this.el, this.slide = o, this.instance = c, this.el.addEventListener("mousedown", (function(u) {
309
+ return t.dragStart(u);
310
+ }), !1), this.el.addEventListener("mouseup", (function(u) {
311
+ return t.dragEnd(u);
312
+ }), !1), this.el.addEventListener("mousemove", (function(u) {
313
+ return t.drag(u);
314
+ }), !1);
315
+ }), [{ key: "dragStart", value: function(e) {
316
+ if (this.slide.classList.contains("zoomed")) this.active = !1;
317
+ else {
318
+ e.type === "touchstart" ? (this.initialX = e.touches[0].clientX - this.xOffset, this.initialY = e.touches[0].clientY - this.yOffset) : (this.initialX = e.clientX - this.xOffset, this.initialY = e.clientY - this.yOffset);
319
+ var t = e.target.nodeName.toLowerCase();
320
+ e.target.classList.contains("nodrag") || X(e.target, ".nodrag") || ["input", "select", "textarea", "button", "a"].indexOf(t) !== -1 ? this.active = !1 : (e.preventDefault(), (e.target === this.el || t !== "img" && X(e.target, ".gslide-inline")) && (this.active = !0, this.el.classList.add("dragging"), this.dragContainer = X(e.target, ".ginner-container")));
321
+ }
322
+ } }, { key: "dragEnd", value: function(e) {
323
+ var t = this;
324
+ e && e.preventDefault(), this.initialX = 0, this.initialY = 0, this.currentX = null, this.currentY = null, this.initialX = null, this.initialY = null, this.xOffset = 0, this.yOffset = 0, this.active = !1, this.doSlideChange && (this.instance.preventOutsideClick = !0, this.doSlideChange == "right" && this.instance.prevSlide(), this.doSlideChange == "left" && this.instance.nextSlide()), this.doSlideClose && this.instance.close(), this.toleranceReached || this.setTranslate(this.dragContainer, 0, 0, !0), setTimeout((function() {
325
+ t.instance.preventOutsideClick = !1, t.toleranceReached = !1, t.lastDirection = null, t.dragging = !1, t.el.isDragging = !1, t.el.classList.remove("dragging"), t.slide.classList.remove("dragging-nav"), t.dragContainer.style.transform = "", t.dragContainer.style.transition = "";
326
+ }), 100);
327
+ } }, { key: "drag", value: function(e) {
328
+ if (this.active) {
329
+ e.preventDefault(), this.slide.classList.add("dragging-nav"), e.type === "touchmove" ? (this.currentX = e.touches[0].clientX - this.initialX, this.currentY = e.touches[0].clientY - this.initialY) : (this.currentX = e.clientX - this.initialX, this.currentY = e.clientY - this.initialY), this.xOffset = this.currentX, this.yOffset = this.currentY, this.el.isDragging = !0, this.dragging = !0, this.doSlideChange = !1, this.doSlideClose = !1;
330
+ var t = Math.abs(this.currentX), i = Math.abs(this.currentY);
331
+ if (t > 0 && t >= Math.abs(this.currentY) && (!this.lastDirection || this.lastDirection == "x")) {
332
+ this.yOffset = 0, this.lastDirection = "x", this.setTranslate(this.dragContainer, this.currentX, 0);
333
+ var n = this.shouldChange();
334
+ if (!this.instance.settings.dragAutoSnap && n && (this.doSlideChange = n), this.instance.settings.dragAutoSnap && n) return this.instance.preventOutsideClick = !0, this.toleranceReached = !0, this.active = !1, this.instance.preventOutsideClick = !0, this.dragEnd(null), n == "right" && this.instance.prevSlide(), void (n == "left" && this.instance.nextSlide());
335
+ }
336
+ if (this.toleranceY > 0 && i > 0 && i >= t && (!this.lastDirection || this.lastDirection == "y")) {
337
+ this.xOffset = 0, this.lastDirection = "y", this.setTranslate(this.dragContainer, 0, this.currentY);
338
+ var s = this.shouldClose();
339
+ return !this.instance.settings.dragAutoSnap && s && (this.doSlideClose = !0), void (this.instance.settings.dragAutoSnap && s && this.instance.close());
340
+ }
341
+ }
342
+ } }, { key: "shouldChange", value: function() {
343
+ var e = !1;
344
+ if (Math.abs(this.currentX) >= this.toleranceX) {
345
+ var t = this.currentX > 0 ? "right" : "left";
346
+ (t == "left" && this.slide !== this.slide.parentNode.lastChild || t == "right" && this.slide !== this.slide.parentNode.firstChild) && (e = t);
347
+ }
348
+ return e;
349
+ } }, { key: "shouldClose", value: function() {
350
+ var e = !1;
351
+ return Math.abs(this.currentY) >= this.toleranceY && (e = !0), e;
352
+ } }, { key: "setTranslate", value: function(e, t, i) {
353
+ var n = arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
354
+ e.style.transition = n ? "all .2s ease" : "", e.style.transform = "translate3d(".concat(t, "px, ").concat(i, "px, 0)");
355
+ } }]);
356
+ function Oe(e, t, i, n) {
357
+ var s = e.querySelector(".gslide-media"), r = new Image(), l = "gSlideTitle_" + i, a = "gSlideDesc_" + i;
358
+ r.addEventListener("load", (function() {
359
+ p(n) && n();
360
+ }), !1), r.src = t.href, t.sizes != "" && t.srcset != "" && (r.sizes = t.sizes, r.srcset = t.srcset), r.alt = "", I(t.alt) || t.alt === "" || (r.alt = t.alt), t.title !== "" && r.setAttribute("aria-labelledby", l), t.description !== "" && r.setAttribute("aria-describedby", a), t.hasOwnProperty("_hasCustomWidth") && t._hasCustomWidth && (r.style.width = t.width), t.hasOwnProperty("_hasCustomHeight") && t._hasCustomHeight && (r.style.height = t.height), s.insertBefore(r, s.firstChild);
361
+ }
362
+ function Pe(e, t, i, n) {
363
+ var s = this, r = e.querySelector(".ginner-container"), l = "gvideo" + i, a = e.querySelector(".gslide-media"), h = this.getAllPlayers();
364
+ v(r, "gvideo-container"), a.insertBefore(G('<div class="gvideo-wrapper"></div>'), a.firstChild);
365
+ var o = e.querySelector(".gvideo-wrapper");
366
+ ge(this.settings.plyr.css, "Plyr");
367
+ var d = t.href, c = t?.videoProvider, u = !1;
368
+ a.style.maxWidth = t.width, ge(this.settings.plyr.js, "Plyr", (function() {
369
+ if (!c && d.match(/vimeo\.com\/([0-9]*)/) && (c = "vimeo"), !c && (d.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || d.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || d.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/) || d.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)) && (c = "youtube"), c === "local" || !c) {
370
+ c = "local";
371
+ var g = '<video id="' + l + '" ';
372
+ g += 'style="background:#000; max-width: '.concat(t.width, ';" '), g += 'preload="metadata" ', g += 'x-webkit-airplay="allow" ', g += "playsinline ", g += "controls ", g += 'class="gvideo-local">', g += '<source src="'.concat(d, '">'), u = G(g += "</video>");
373
+ }
374
+ var f = u || G('<div id="'.concat(l, '" data-plyr-provider="').concat(c, '" data-plyr-embed-id="').concat(d, '"></div>'));
375
+ v(o, "".concat(c, "-video gvideo")), o.appendChild(f), o.setAttribute("data-id", l), o.setAttribute("data-index", i);
376
+ var b = w(s.settings.plyr, "config") ? s.settings.plyr.config : {}, M = new Plyr("#" + l, b);
377
+ M.on("ready", (function(O) {
378
+ h[l] = O.detail.plyr, p(n) && n();
379
+ })), oe((function() {
380
+ return e.querySelector("iframe") && e.querySelector("iframe").dataset.ready == "true";
381
+ }), (function() {
382
+ s.resize(e);
383
+ })), M.on("enterfullscreen", be), M.on("exitfullscreen", be);
384
+ }));
385
+ }
386
+ function be(e) {
387
+ var t = X(e.target, ".gslide-media");
388
+ e.type === "enterfullscreen" && v(t, "fullscreen"), e.type === "exitfullscreen" && S(t, "fullscreen");
389
+ }
390
+ function Me(e, t, i, n) {
391
+ var s, r = this, l = e.querySelector(".gslide-media"), a = !(!w(t, "href") || !t.href) && t.href.split("#").pop().trim(), h = !(!w(t, "content") || !t.content) && t.content;
392
+ if (h && (K(h) && (s = G('<div class="ginlined-content">'.concat(h, "</div>"))), N(h))) {
393
+ h.style.display == "none" && (h.style.display = "block");
394
+ var o = document.createElement("div");
395
+ o.className = "ginlined-content", o.appendChild(h), s = o;
396
+ }
397
+ if (a) {
398
+ var d = document.getElementById(a);
399
+ if (!d) return !1;
400
+ var c = d.cloneNode(!0);
401
+ c.style.height = t.height, c.style.maxWidth = t.width, v(c, "ginlined-content"), s = c;
402
+ }
403
+ if (!s) return console.error("Unable to append inline slide content", t), !1;
404
+ l.style.height = t.height, l.style.width = t.width, l.appendChild(s), this.events["inlineclose" + a] = P("click", { onElement: l.querySelectorAll(".gtrigger-close"), withCallback: function(u) {
405
+ u.preventDefault(), r.close();
406
+ } }), p(n) && n();
407
+ }
408
+ function ze(e, t, i, n) {
409
+ var s = e.querySelector(".gslide-media"), r = (function(l) {
410
+ var a = l.url, h = l.allow, o = l.callback, d = l.appendTo, c = document.createElement("iframe");
411
+ return c.className = "vimeo-video gvideo", c.src = a, c.style.width = "100%", c.style.height = "100%", h && c.setAttribute("allow", h), c.onload = function() {
412
+ c.onload = null, v(c, "node-ready"), p(o) && o();
413
+ }, d && d.appendChild(c), c;
414
+ })({ url: t.href, callback: n });
415
+ s.parentNode.style.maxWidth = t.width, s.parentNode.style.height = t.height, s.appendChild(r);
416
+ }
417
+ var qe = A((function e() {
418
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
419
+ x(this, e), this.defaults = { href: "", sizes: "", srcset: "", title: "", type: "", videoProvider: "", description: "", alt: "", descPosition: "bottom", effect: "", width: "", height: "", content: !1, zoomable: !0, draggable: !0 }, $(t) && (this.defaults = L(this.defaults, t));
420
+ }), [{ key: "sourceType", value: function(e) {
421
+ var t = e;
422
+ return (e = e.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/) !== null ? "image" : e.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || e.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/) || e.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/) || e.match(/vimeo\.com\/([0-9]*)/) || e.match(/\.(mp4|ogg|webm|mov)/) !== null ? "video" : e.match(/\.(mp3|wav|wma|aac|ogg)/) !== null ? "audio" : e.indexOf("#") > -1 && t.split("#").pop().trim() !== "" ? "inline" : e.indexOf("goajax=true") > -1 ? "ajax" : "external";
423
+ } }, { key: "parseConfig", value: function(e, t) {
424
+ var i = this, n = L({ descPosition: t.descPosition }, this.defaults);
425
+ if ($(e) && !N(e)) {
426
+ w(e, "type") || (w(e, "content") && e.content ? e.type = "inline" : w(e, "href") && (e.type = this.sourceType(e.href)));
427
+ var s = L(n, e);
428
+ return this.setSize(s, t), s;
429
+ }
430
+ var r = "", l = e.getAttribute("data-glightbox"), a = e.nodeName.toLowerCase();
431
+ if (a === "a" && (r = e.href), a === "img" && (r = e.src, n.alt = e.alt), n.href = r, y(n, (function(g, f) {
432
+ w(t, f) && f !== "width" && (n[f] = t[f]);
433
+ var b = e.dataset[f];
434
+ I(b) || (n[f] = i.sanitizeValue(b));
435
+ })), n.content && (n.type = "inline"), !n.type && r && (n.type = this.sourceType(r)), I(l)) {
436
+ if (!n.title && a == "a") {
437
+ var h = e.title;
438
+ I(h) || h === "" || (n.title = h);
439
+ }
440
+ if (!n.title && a == "img") {
441
+ var o = e.alt;
442
+ I(o) || o === "" || (n.title = o);
443
+ }
444
+ } else {
445
+ var d = [];
446
+ y(n, (function(g, f) {
447
+ d.push(";\\s?" + f);
448
+ })), d = d.join("\\s?:|"), l.trim() !== "" && y(n, (function(g, f) {
449
+ var b = l, M = new RegExp("s?" + f + "s?:s?(.*?)(" + d + "s?:|$)"), O = b.match(M);
450
+ if (O && O.length && O[1]) {
451
+ var D = O[1].trim().replace(/;\s*$/, "");
452
+ n[f] = i.sanitizeValue(D);
453
+ }
454
+ }));
455
+ }
456
+ if (n.description && n.description.substring(0, 1) === ".") {
457
+ var c;
458
+ try {
459
+ c = document.querySelector(n.description).innerHTML;
460
+ } catch (g) {
461
+ if (!(g instanceof DOMException)) throw g;
462
+ }
463
+ c && (n.description = c);
464
+ }
465
+ if (!n.description) {
466
+ var u = e.querySelector(".glightbox-desc");
467
+ u && (n.description = u.innerHTML);
468
+ }
469
+ return this.setSize(n, t, e), this.slideConfig = n, n;
470
+ } }, { key: "setSize", value: function(e, t) {
471
+ var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, n = e.type == "video" ? this.checkSize(t.videosWidth) : this.checkSize(t.width), s = this.checkSize(t.height);
472
+ return e.width = w(e, "width") && e.width !== "" ? this.checkSize(e.width) : n, e.height = w(e, "height") && e.height !== "" ? this.checkSize(e.height) : s, i && e.type == "image" && (e._hasCustomWidth = !!i.dataset.width, e._hasCustomHeight = !!i.dataset.height), e;
473
+ } }, { key: "checkSize", value: function(e) {
474
+ return te(e) ? "".concat(e, "px") : e;
475
+ } }, { key: "sanitizeValue", value: function(e) {
476
+ return e !== "true" && e !== "false" ? e : e === "true";
477
+ } }]), ie = A((function e(t, i, n) {
478
+ x(this, e), this.element = t, this.instance = i, this.index = n;
479
+ }), [{ key: "setContent", value: function() {
480
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, i = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
481
+ if (T(t, "loaded")) return !1;
482
+ var n = this.instance.settings, s = this.slideConfig, r = he();
483
+ p(n.beforeSlideLoad) && n.beforeSlideLoad({ index: this.index, slide: t, player: !1 });
484
+ var l = s.type, a = s.descPosition, h = t.querySelector(".gslide-media"), o = t.querySelector(".gslide-title"), d = t.querySelector(".gslide-desc"), c = t.querySelector(".gdesc-inner"), u = i, g = "gSlideTitle_" + this.index, f = "gSlideDesc_" + this.index;
485
+ if (p(n.afterSlideLoad) && (u = function() {
486
+ p(i) && i(), n.afterSlideLoad({ index: e.index, slide: t, player: e.instance.getSlidePlayerInstance(e.index) });
487
+ }), s.title == "" && s.description == "" ? c && c.parentNode.parentNode.removeChild(c.parentNode) : (o && s.title !== "" ? (o.id = g, o.innerHTML = s.title) : o.parentNode.removeChild(o), d && s.description !== "" ? (d.id = f, r && n.moreLength > 0 ? (s.smallDescription = this.slideShortDesc(s.description, n.moreLength, n.moreText), d.innerHTML = s.smallDescription, this.descriptionEvents(d, s)) : d.innerHTML = s.description) : d.parentNode.removeChild(d), v(h.parentNode, "desc-".concat(a)), v(c.parentNode, "description-".concat(a))), v(h, "gslide-".concat(l)), v(t, "loaded"), l !== "video") {
488
+ if (l !== "external") return l === "inline" ? (Me.apply(this.instance, [t, s, this.index, u]), void (s.draggable && new ye({ dragEl: t.querySelector(".gslide-inline"), toleranceX: n.dragToleranceX, toleranceY: n.dragToleranceY, slide: t, instance: this.instance }))) : void (l !== "image" ? p(u) && u() : Oe(t, s, this.index, (function() {
489
+ var b = t.querySelector("img");
490
+ s.draggable && new ye({ dragEl: b, toleranceX: n.dragToleranceX, toleranceY: n.dragToleranceY, slide: t, instance: e.instance }), s.zoomable && b.naturalWidth > b.offsetWidth && (v(b, "zoomable"), new Ie(b, t, (function() {
491
+ e.instance.resize();
492
+ }))), p(u) && u();
493
+ })));
494
+ ze.apply(this, [t, s, this.index, u]);
495
+ } else Pe.apply(this.instance, [t, s, this.index, u]);
496
+ } }, { key: "slideShortDesc", value: function(e) {
497
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50, i = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], n = document.createElement("div");
498
+ n.innerHTML = e;
499
+ var s = n.innerText, r = i;
500
+ if ((e = s.trim()).length <= t) return e;
501
+ var l = e.substr(0, t - 1);
502
+ return r ? (n = null, l + '... <a href="#" class="desc-more">' + i + "</a>") : l;
503
+ } }, { key: "descriptionEvents", value: function(e, t) {
504
+ var i = this, n = e.querySelector(".desc-more");
505
+ if (!n) return !1;
506
+ P("click", { onElement: n, withCallback: function(s, r) {
507
+ s.preventDefault();
508
+ var l = document.body, a = X(r, ".gslide-desc");
509
+ if (!a) return !1;
510
+ a.innerHTML = t.description, v(l, "gdesc-open");
511
+ var h = P("click", { onElement: [l, X(a, ".gslide-description")], withCallback: function(o, d) {
512
+ o.target.nodeName.toLowerCase() !== "a" && (S(l, "gdesc-open"), v(l, "gdesc-closed"), a.innerHTML = t.smallDescription, i.descriptionEvents(a, t), setTimeout((function() {
513
+ S(l, "gdesc-closed");
514
+ }), 400), h.destroy());
515
+ } });
516
+ } });
517
+ } }, { key: "create", value: function() {
518
+ return G(this.instance.settings.slideHTML);
519
+ } }, { key: "getConfig", value: function() {
520
+ N(this.element) || this.element.hasOwnProperty("draggable") || (this.element.draggable = this.instance.settings.draggable);
521
+ var e = new qe(this.instance.settings.slideExtraAttributes);
522
+ return this.slideConfig = e.parseConfig(this.element, this.instance.settings), this.slideConfig;
523
+ } }]);
524
+ function ne(e) {
525
+ return Math.sqrt(e.x * e.x + e.y * e.y);
526
+ }
527
+ function Xe(e, t) {
528
+ var i = (function(n, s) {
529
+ var r = ne(n) * ne(s);
530
+ if (r === 0) return 0;
531
+ var l = (function(a, h) {
532
+ return a.x * h.x + a.y * h.y;
533
+ })(n, s) / r;
534
+ return l > 1 && (l = 1), Math.acos(l);
535
+ })(e, t);
536
+ return (function(n, s) {
537
+ return n.x * s.y - s.x * n.y;
538
+ })(e, t) > 0 && (i *= -1), 180 * i / Math.PI;
539
+ }
540
+ var Ye = A((function e(t) {
541
+ x(this, e), this.handlers = [], this.el = t;
542
+ }), [{ key: "add", value: function(e) {
543
+ this.handlers.push(e);
544
+ } }, { key: "del", value: function(e) {
545
+ e || (this.handlers = []);
546
+ for (var t = this.handlers.length; t >= 0; t--) this.handlers[t] === e && this.handlers.splice(t, 1);
547
+ } }, { key: "dispatch", value: function() {
548
+ for (var e = 0, t = this.handlers.length; e < t; e++) {
549
+ var i = this.handlers[e];
550
+ typeof i == "function" && i.apply(this.el, arguments);
551
+ }
552
+ } }]);
553
+ function C(e, t) {
554
+ var i = new Ye(e);
555
+ return i.add(t), i;
556
+ }
557
+ var _e = A((function e(t, i) {
558
+ x(this, e), this.element = typeof t == "string" ? document.querySelector(t) : t, this.start = this.start.bind(this), this.move = this.move.bind(this), this.end = this.end.bind(this), this.cancel = this.cancel.bind(this), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), this.preV = { x: null, y: null }, this.pinchStartLen = null, this.zoom = 1, this.isDoubleTap = !1;
559
+ var n = function() {
560
+ };
561
+ this.rotate = C(this.element, i.rotate || n), this.touchStart = C(this.element, i.touchStart || n), this.multipointStart = C(this.element, i.multipointStart || n), this.multipointEnd = C(this.element, i.multipointEnd || n), this.pinch = C(this.element, i.pinch || n), this.swipe = C(this.element, i.swipe || n), this.tap = C(this.element, i.tap || n), this.doubleTap = C(this.element, i.doubleTap || n), this.longTap = C(this.element, i.longTap || n), this.singleTap = C(this.element, i.singleTap || n), this.pressMove = C(this.element, i.pressMove || n), this.twoFingerPressMove = C(this.element, i.twoFingerPressMove || n), this.touchMove = C(this.element, i.touchMove || n), this.touchEnd = C(this.element, i.touchEnd || n), this.touchCancel = C(this.element, i.touchCancel || n), this.translateContainer = this.element, this._cancelAllHandler = this.cancelAll.bind(this), window.addEventListener("scroll", this._cancelAllHandler), this.delta = null, this.last = null, this.now = null, this.tapTimeout = null, this.singleTapTimeout = null, this.longTapTimeout = null, this.swipeTimeout = null, this.x1 = this.x2 = this.y1 = this.y2 = null, this.preTapPosition = { x: null, y: null };
562
+ }), [{ key: "start", value: function(e) {
563
+ if (e.touches) if (e.target && e.target.nodeName && ["a", "button", "input"].indexOf(e.target.nodeName.toLowerCase()) >= 0) console.log("ignore drag for this touched element", e.target.nodeName.toLowerCase());
564
+ else {
565
+ this.now = Date.now(), this.x1 = e.touches[0].pageX, this.y1 = e.touches[0].pageY, this.delta = this.now - (this.last || this.now), this.touchStart.dispatch(e, this.element), this.preTapPosition.x !== null && (this.isDoubleTap = this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30, this.isDoubleTap && clearTimeout(this.singleTapTimeout)), this.preTapPosition.x = this.x1, this.preTapPosition.y = this.y1, this.last = this.now;
566
+ var t = this.preV;
567
+ if (e.touches.length > 1) {
568
+ this._cancelLongTap(), this._cancelSingleTap();
569
+ var i = { x: e.touches[1].pageX - this.x1, y: e.touches[1].pageY - this.y1 };
570
+ t.x = i.x, t.y = i.y, this.pinchStartLen = ne(t), this.multipointStart.dispatch(e, this.element);
571
+ }
572
+ this._preventTap = !1, this.longTapTimeout = setTimeout((function() {
573
+ this.longTap.dispatch(e, this.element), this._preventTap = !0;
574
+ }).bind(this), 750);
575
+ }
576
+ } }, { key: "move", value: function(e) {
577
+ if (e.touches) {
578
+ var t = this.preV, i = e.touches.length, n = e.touches[0].pageX, s = e.touches[0].pageY;
579
+ if (this.isDoubleTap = !1, i > 1) {
580
+ var r = e.touches[1].pageX, l = e.touches[1].pageY, a = { x: e.touches[1].pageX - n, y: e.touches[1].pageY - s };
581
+ t.x !== null && (this.pinchStartLen > 0 && (e.zoom = ne(a) / this.pinchStartLen, this.pinch.dispatch(e, this.element)), e.angle = Xe(a, t), this.rotate.dispatch(e, this.element)), t.x = a.x, t.y = a.y, this.x2 !== null && this.sx2 !== null ? (e.deltaX = (n - this.x2 + r - this.sx2) / 2, e.deltaY = (s - this.y2 + l - this.sy2) / 2) : (e.deltaX = 0, e.deltaY = 0), this.twoFingerPressMove.dispatch(e, this.element), this.sx2 = r, this.sy2 = l;
582
+ } else {
583
+ if (this.x2 !== null) {
584
+ e.deltaX = n - this.x2, e.deltaY = s - this.y2;
585
+ var h = Math.abs(this.x1 - this.x2), o = Math.abs(this.y1 - this.y2);
586
+ (h > 10 || o > 10) && (this._preventTap = !0);
587
+ } else e.deltaX = 0, e.deltaY = 0;
588
+ this.pressMove.dispatch(e, this.element);
589
+ }
590
+ this.touchMove.dispatch(e, this.element), this._cancelLongTap(), this.x2 = n, this.y2 = s, i > 1 && e.preventDefault();
591
+ }
592
+ } }, { key: "end", value: function(e) {
593
+ if (e.changedTouches) {
594
+ this._cancelLongTap();
595
+ var t = this;
596
+ e.touches.length < 2 && (this.multipointEnd.dispatch(e, this.element), this.sx2 = this.sy2 = null), this.x2 && Math.abs(this.x1 - this.x2) > 30 || this.y2 && Math.abs(this.y1 - this.y2) > 30 ? (e.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2), this.swipeTimeout = setTimeout((function() {
597
+ t.swipe.dispatch(e, t.element);
598
+ }), 0)) : (this.tapTimeout = setTimeout((function() {
599
+ t._preventTap || t.tap.dispatch(e, t.element), t.isDoubleTap && (t.doubleTap.dispatch(e, t.element), t.isDoubleTap = !1);
600
+ }), 0), t.isDoubleTap || (t.singleTapTimeout = setTimeout((function() {
601
+ t.singleTap.dispatch(e, t.element);
602
+ }), 250))), this.touchEnd.dispatch(e, this.element), this.preV.x = 0, this.preV.y = 0, this.zoom = 1, this.pinchStartLen = null, this.x1 = this.x2 = this.y1 = this.y2 = null;
603
+ }
604
+ } }, { key: "cancelAll", value: function() {
605
+ this._preventTap = !0, clearTimeout(this.singleTapTimeout), clearTimeout(this.tapTimeout), clearTimeout(this.longTapTimeout), clearTimeout(this.swipeTimeout);
606
+ } }, { key: "cancel", value: function(e) {
607
+ this.cancelAll(), this.touchCancel.dispatch(e, this.element);
608
+ } }, { key: "_cancelLongTap", value: function() {
609
+ clearTimeout(this.longTapTimeout);
610
+ } }, { key: "_cancelSingleTap", value: function() {
611
+ clearTimeout(this.singleTapTimeout);
612
+ } }, { key: "_swipeDirection", value: function(e, t, i, n) {
613
+ return Math.abs(e - t) >= Math.abs(i - n) ? e - t > 0 ? "Left" : "Right" : i - n > 0 ? "Up" : "Down";
614
+ } }, { key: "on", value: function(e, t) {
615
+ this[e] && this[e].add(t);
616
+ } }, { key: "off", value: function(e, t) {
617
+ this[e] && this[e].del(t);
618
+ } }, { key: "destroy", value: function() {
619
+ return this.singleTapTimeout && clearTimeout(this.singleTapTimeout), this.tapTimeout && clearTimeout(this.tapTimeout), this.longTapTimeout && clearTimeout(this.longTapTimeout), this.swipeTimeout && clearTimeout(this.swipeTimeout), this.element.removeEventListener("touchstart", this.start), this.element.removeEventListener("touchmove", this.move), this.element.removeEventListener("touchend", this.end), this.element.removeEventListener("touchcancel", this.cancel), this.rotate.del(), this.touchStart.del(), this.multipointStart.del(), this.multipointEnd.del(), this.pinch.del(), this.swipe.del(), this.tap.del(), this.doubleTap.del(), this.longTap.del(), this.singleTap.del(), this.pressMove.del(), this.twoFingerPressMove.del(), this.touchMove.del(), this.touchEnd.del(), this.touchCancel.del(), this.preV = this.pinchStartLen = this.zoom = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = this.twoFingerPressMove = null, window.removeEventListener("scroll", this._cancelAllHandler), null;
620
+ } }]);
621
+ function de(e) {
622
+ var t = (function() {
623
+ var l, a = document.createElement("fakeelement"), h = { transition: "transitionend", OTransition: "oTransitionEnd", MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd" };
624
+ for (l in h) if (a.style[l] !== void 0) return h[l];
625
+ })(), i = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, n = T(e, "gslide-media") ? e : e.querySelector(".gslide-media"), s = X(n, ".ginner-container"), r = e.querySelector(".gslide-description");
626
+ i > 769 && (n = s), v(n, "greset"), ee(n, "translate3d(0, 0, 0)"), P(t, { onElement: n, once: !0, withCallback: function(l, a) {
627
+ S(n, "greset");
628
+ } }), n.style.opacity = "", r && (r.style.opacity = "");
629
+ }
630
+ function Ne(e) {
631
+ if (e.events.hasOwnProperty("touch")) return !1;
632
+ var t, i, n, s = ue(), r = s.width, l = s.height, a = !1, h = null, o = null, d = null, c = !1, u = 1, g = 1, f = !1, b = !1, M = null, O = null, D = null, k = null, B = 0, W = 0, Q = !1, J = !1, Y = {}, _ = {}, ke = 0, Te = 0, We = document.getElementById("glightbox-slider"), se = document.querySelector(".goverlay"), He = new _e(We, { touchStart: function(m) {
633
+ if (a = !0, (T(m.targetTouches[0].target, "ginner-container") || X(m.targetTouches[0].target, ".gslide-desc") || m.targetTouches[0].target.nodeName.toLowerCase() == "a") && (a = !1), X(m.targetTouches[0].target, ".gslide-inline") && !T(m.targetTouches[0].target.parentNode, "gslide-inline") && (a = !1), a) {
634
+ if (_ = m.targetTouches[0], Y.pageX = m.targetTouches[0].pageX, Y.pageY = m.targetTouches[0].pageY, ke = m.targetTouches[0].clientX, Te = m.targetTouches[0].clientY, h = e.activeSlide, o = h.querySelector(".gslide-media"), n = h.querySelector(".gslide-inline"), d = null, T(o, "gslide-image") && (d = o.querySelector("img")), (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) > 769 && (o = h.querySelector(".ginner-container")), S(se, "greset"), m.pageX > 20 && m.pageX < window.innerWidth - 20) return;
635
+ m.preventDefault();
636
+ }
637
+ }, touchMove: function(m) {
638
+ if (a && (_ = m.targetTouches[0], !f && !b)) {
639
+ if (n && n.offsetHeight > l) {
640
+ var E = Y.pageX - _.pageX;
641
+ if (Math.abs(E) <= 13) return !1;
642
+ }
643
+ c = !0;
644
+ var j, le = m.targetTouches[0].clientX, je = m.targetTouches[0].clientY, Ve = ke - le, Re = Te - je;
645
+ if (Math.abs(Ve) > Math.abs(Re) ? (Q = !1, J = !0) : (J = !1, Q = !0), t = _.pageX - Y.pageX, B = 100 * t / r, i = _.pageY - Y.pageY, W = 100 * i / l, Q && d && (j = 1 - Math.abs(i) / l, se.style.opacity = j, e.settings.touchFollowAxis && (B = 0)), J && (j = 1 - Math.abs(t) / r, o.style.opacity = j, e.settings.touchFollowAxis && (W = 0)), !d) return ee(o, "translate3d(".concat(B, "%, 0, 0)"));
646
+ ee(o, "translate3d(".concat(B, "%, ").concat(W, "%, 0)"));
647
+ }
648
+ }, touchEnd: function() {
649
+ if (a) {
650
+ if (c = !1, b || f) return D = M, void (k = O);
651
+ var m = Math.abs(parseInt(W)), E = Math.abs(parseInt(B));
652
+ if (!(m > 29 && d)) return m < 29 && E < 25 ? (v(se, "greset"), se.style.opacity = 1, de(o)) : void 0;
653
+ e.close();
654
+ }
655
+ }, multipointEnd: function() {
656
+ setTimeout((function() {
657
+ f = !1;
658
+ }), 50);
659
+ }, multipointStart: function() {
660
+ f = !0, u = g || 1;
661
+ }, pinch: function(m) {
662
+ if (!d || c) return !1;
663
+ f = !0, d.scaleX = d.scaleY = u * m.zoom;
664
+ var E = u * m.zoom;
665
+ if (b = !0, E <= 1) return b = !1, E = 1, k = null, D = null, M = null, O = null, void d.setAttribute("style", "");
666
+ E > 4.5 && (E = 4.5), d.style.transform = "scale3d(".concat(E, ", ").concat(E, ", 1)"), g = E;
667
+ }, pressMove: function(m) {
668
+ if (b && !f) {
669
+ var E = _.pageX - Y.pageX, j = _.pageY - Y.pageY;
670
+ D && (E += D), k && (j += k), M = E, O = j;
671
+ var le = "translate3d(".concat(E, "px, ").concat(j, "px, 0)");
672
+ g && (le += " scale3d(".concat(g, ", ").concat(g, ", 1)")), ee(d, le);
673
+ }
674
+ }, swipe: function(m) {
675
+ if (!b) if (f) f = !1;
676
+ else {
677
+ if (m.direction == "Left") {
678
+ if (e.index == e.elements.length - 1) return de(o);
679
+ e.nextSlide();
680
+ }
681
+ if (m.direction == "Right") {
682
+ if (e.index == 0) return de(o);
683
+ e.prevSlide();
684
+ }
685
+ }
686
+ } });
687
+ e.events.touch = He;
688
+ }
689
+ var xe = he(), Se = he() !== null || document.createTouch !== void 0 || "ontouchstart" in window || "onmsgesturechange" in window || navigator.msMaxTouchPoints, we = document.getElementsByTagName("html")[0], De = { selector: ".glightbox", elements: null, skin: "clean", theme: "clean", closeButton: !0, startAt: null, autoplayVideos: !0, autofocusVideos: !0, descPosition: "bottom", width: "900px", height: "506px", videosWidth: "960px", beforeSlideChange: null, afterSlideChange: null, beforeSlideLoad: null, afterSlideLoad: null, slideInserted: null, slideRemoved: null, slideExtraAttributes: null, onOpen: null, onClose: null, loop: !1, zoomable: !0, draggable: !0, dragAutoSnap: !1, dragToleranceX: 40, dragToleranceY: 65, preload: !0, oneSlidePerOpen: !1, touchNavigation: !0, touchFollowAxis: !0, keyboardNavigation: !0, closeOnOutsideClick: !0, plugins: !1, plyr: { css: "https://cdn.plyr.io/3.6.12/plyr.css", js: "https://cdn.plyr.io/3.6.12/plyr.js", config: { ratio: "16:9", fullscreen: { enabled: !0, iosNative: !0 }, youtube: { noCookie: !0, rel: 0, showinfo: 0, iv_load_policy: 3 }, vimeo: { byline: !1, portrait: !1, title: !1, transparent: !1 } } }, openEffect: "zoom", closeEffect: "zoom", slideEffect: "slide", moreText: "See more", moreLength: 60, cssEfects: { fade: { in: "fadeIn", out: "fadeOut" }, zoom: { in: "zoomIn", out: "zoomOut" }, slide: { in: "slideInRight", out: "slideOutLeft" }, slideBack: { in: "slideInLeft", out: "slideOutRight" }, none: { in: "none", out: "none" } }, svg: { close: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>', next: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>', prev: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>' }, slideHTML: `<div class="gslide">
690
+ <div class="gslide-inner-content">
691
+ <div class="ginner-container">
692
+ <div class="gslide-media">
693
+ </div>
694
+ <div class="gslide-description">
695
+ <div class="gdesc-inner">
696
+ <h4 class="gslide-title"></h4>
697
+ <div class="gslide-desc"></div>
698
+ </div>
699
+ </div>
700
+ </div>
701
+ </div>
702
+ </div>`, lightboxHTML: `<div id="glightbox-body" class="glightbox-container" tabindex="-1" role="dialog" aria-hidden="false">
703
+ <div class="gloader visible"></div>
704
+ <div class="goverlay"></div>
705
+ <div class="gcontainer">
706
+ <div id="glightbox-slider" class="gslider"></div>
707
+ <button class="gclose gbtn" aria-label="Close" data-taborder="3">{closeSVG}</button>
708
+ <button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
709
+ <button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
710
+ </div>
711
+ </div>` }, Be = A((function e() {
712
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
713
+ x(this, e), this.customOptions = t, this.settings = L(De, t), this.effectsClasses = this.getAnimationClasses(), this.videoPlayers = {}, this.apiEvents = [], this.fullElementsList = !1;
714
+ }), [{ key: "init", value: function() {
715
+ var e = this, t = this.getSelector();
716
+ t && (this.baseEvents = P("click", { onElement: t, withCallback: function(i, n) {
717
+ i.preventDefault(), e.open(n);
718
+ } })), this.elements = this.getElements();
719
+ } }, { key: "open", value: function() {
720
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
721
+ if (this.elements.length === 0) return !1;
722
+ this.activeSlide = null, this.prevActiveSlideIndex = null, this.prevActiveSlide = null;
723
+ var i = te(t) ? t : this.settings.startAt;
724
+ if (N(e)) {
725
+ var n = e.getAttribute("data-gallery");
726
+ n && (this.fullElementsList = this.elements, this.elements = this.getGalleryElements(this.elements, n)), I(i) && (i = this.getElementIndex(e)) < 0 && (i = 0);
727
+ }
728
+ te(i) || (i = 0), this.build(), U(this.overlay, this.settings.openEffect === "none" ? "none" : this.settings.cssEfects.fade.in);
729
+ var s = document.body, r = window.innerWidth - document.documentElement.clientWidth;
730
+ if (r > 0) {
731
+ var l = document.createElement("style");
732
+ l.type = "text/css", l.className = "gcss-styles", l.innerText = ".gscrollbar-fixer {margin-right: ".concat(r, "px}"), document.head.appendChild(l), v(s, "gscrollbar-fixer");
733
+ }
734
+ v(s, "glightbox-open"), v(we, "glightbox-open"), xe && (v(document.body, "glightbox-mobile"), this.settings.slideEffect = "slide"), this.showSlide(i, !0), this.elements.length === 1 ? (v(this.prevButton, "glightbox-button-hidden"), v(this.nextButton, "glightbox-button-hidden")) : (S(this.prevButton, "glightbox-button-hidden"), S(this.nextButton, "glightbox-button-hidden")), this.lightboxOpen = !0, this.trigger("open"), p(this.settings.onOpen) && this.settings.onOpen(), Se && this.settings.touchNavigation && Ne(this), this.settings.keyboardNavigation && Le(this);
735
+ } }, { key: "openAt", value: function() {
736
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
737
+ this.open(null, e);
738
+ } }, { key: "showSlide", value: function() {
739
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, i = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
740
+ ce(this.loader), this.index = parseInt(t);
741
+ var n = this.slidesContainer.querySelector(".current");
742
+ n && S(n, "current"), this.slideAnimateOut();
743
+ var s = this.slidesContainer.querySelectorAll(".gslide")[t];
744
+ if (T(s, "loaded")) this.slideAnimateIn(s, i), ae(this.loader);
745
+ else {
746
+ ce(this.loader);
747
+ var r = this.elements[t], l = { index: this.index, slide: s, slideNode: s, slideConfig: r.slideConfig, slideIndex: this.index, trigger: r.node, player: null };
748
+ this.trigger("slide_before_load", l), r.instance.setContent(s, (function() {
749
+ ae(e.loader), e.resize(), e.slideAnimateIn(s, i), e.trigger("slide_after_load", l);
750
+ }));
751
+ }
752
+ this.slideDescription = s.querySelector(".gslide-description"), this.slideDescriptionContained = this.slideDescription && T(this.slideDescription.parentNode, "gslide-media"), this.settings.preload && (this.preloadSlide(t + 1), this.preloadSlide(t - 1)), this.updateNavigationClasses(), this.activeSlide = s;
753
+ } }, { key: "preloadSlide", value: function(e) {
754
+ var t = this;
755
+ if (e < 0 || e > this.elements.length - 1 || I(this.elements[e])) return !1;
756
+ var i = this.slidesContainer.querySelectorAll(".gslide")[e];
757
+ if (T(i, "loaded")) return !1;
758
+ var n = this.elements[e], s = n.type, r = { index: e, slide: i, slideNode: i, slideConfig: n.slideConfig, slideIndex: e, trigger: n.node, player: null };
759
+ this.trigger("slide_before_load", r), s === "video" || s === "external" ? setTimeout((function() {
760
+ n.instance.setContent(i, (function() {
761
+ t.trigger("slide_after_load", r);
762
+ }));
763
+ }), 200) : n.instance.setContent(i, (function() {
764
+ t.trigger("slide_after_load", r);
765
+ }));
766
+ } }, { key: "prevSlide", value: function() {
767
+ this.goToSlide(this.index - 1);
768
+ } }, { key: "nextSlide", value: function() {
769
+ this.goToSlide(this.index + 1);
770
+ } }, { key: "goToSlide", value: function() {
771
+ var e = arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
772
+ if (this.prevActiveSlide = this.activeSlide, this.prevActiveSlideIndex = this.index, !this.loop() && (e < 0 || e > this.elements.length - 1)) return !1;
773
+ e < 0 ? e = this.elements.length - 1 : e >= this.elements.length && (e = 0), this.showSlide(e);
774
+ } }, { key: "insertSlide", value: function() {
775
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1;
776
+ t < 0 && (t = this.elements.length);
777
+ var i = new ie(e, this, t), n = i.getConfig(), s = L({}, n), r = i.create(), l = this.elements.length - 1;
778
+ s.index = t, s.node = !1, s.instance = i, s.slideConfig = n, this.elements.splice(t, 0, s);
779
+ var a = null, h = null;
780
+ if (this.slidesContainer) {
781
+ if (t > l) this.slidesContainer.appendChild(r);
782
+ else {
783
+ var o = this.slidesContainer.querySelectorAll(".gslide")[t];
784
+ this.slidesContainer.insertBefore(r, o);
785
+ }
786
+ (this.settings.preload && this.index == 0 && t == 0 || this.index - 1 == t || this.index + 1 == t) && this.preloadSlide(t), this.index === 0 && t === 0 && (this.index = 1), this.updateNavigationClasses(), a = this.slidesContainer.querySelectorAll(".gslide")[t], h = this.getSlidePlayerInstance(t), s.slideNode = a;
787
+ }
788
+ this.trigger("slide_inserted", { index: t, slide: a, slideNode: a, slideConfig: n, slideIndex: t, trigger: null, player: h }), p(this.settings.slideInserted) && this.settings.slideInserted({ index: t, slide: a, player: h });
789
+ } }, { key: "removeSlide", value: function() {
790
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
791
+ if (e < 0 || e > this.elements.length - 1) return !1;
792
+ var t = this.slidesContainer && this.slidesContainer.querySelectorAll(".gslide")[e];
793
+ t && (this.getActiveSlideIndex() == e && (e == this.elements.length - 1 ? this.prevSlide() : this.nextSlide()), t.parentNode.removeChild(t)), this.elements.splice(e, 1), this.trigger("slide_removed", e), p(this.settings.slideRemoved) && this.settings.slideRemoved(e);
794
+ } }, { key: "slideAnimateIn", value: function(e, t) {
795
+ var i = this, n = e.querySelector(".gslide-media"), s = e.querySelector(".gslide-description"), r = { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlide, slideConfig: I(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: I(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, l = { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideConfig: this.elements[this.index].slideConfig, slideIndex: this.index, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) };
796
+ if (n.offsetWidth > 0 && s && (ae(s), s.style.display = ""), S(e, this.effectsClasses), t) U(e, this.settings.cssEfects[this.settings.openEffect].in, (function() {
797
+ i.settings.autoplayVideos && i.slidePlayerPlay(e), i.trigger("slide_changed", { prev: r, current: l }), p(i.settings.afterSlideChange) && i.settings.afterSlideChange.apply(i, [r, l]);
798
+ }));
799
+ else {
800
+ var a = this.settings.slideEffect, h = a !== "none" ? this.settings.cssEfects[a].in : a;
801
+ this.prevActiveSlideIndex > this.index && this.settings.slideEffect == "slide" && (h = this.settings.cssEfects.slideBack.in), U(e, h, (function() {
802
+ i.settings.autoplayVideos && i.slidePlayerPlay(e), i.trigger("slide_changed", { prev: r, current: l }), p(i.settings.afterSlideChange) && i.settings.afterSlideChange.apply(i, [r, l]);
803
+ }));
804
+ }
805
+ setTimeout((function() {
806
+ i.resize(e);
807
+ }), 100), v(e, "current");
808
+ } }, { key: "slideAnimateOut", value: function() {
809
+ if (!this.prevActiveSlide) return !1;
810
+ var e = this.prevActiveSlide;
811
+ S(e, this.effectsClasses), v(e, "prev");
812
+ var t = this.settings.slideEffect, i = t !== "none" ? this.settings.cssEfects[t].out : t;
813
+ this.slidePlayerPause(e), this.trigger("slide_before_change", { prev: { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlideIndex, slideConfig: I(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: I(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, current: { index: this.index, slide: this.activeSlide, slideNode: this.activeSlide, slideIndex: this.index, slideConfig: this.elements[this.index].slideConfig, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) } }), p(this.settings.beforeSlideChange) && this.settings.beforeSlideChange.apply(this, [{ index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, { index: this.index, slide: this.activeSlide, player: this.getSlidePlayerInstance(this.index) }]), this.prevActiveSlideIndex > this.index && this.settings.slideEffect == "slide" && (i = this.settings.cssEfects.slideBack.out), U(e, i, (function() {
814
+ var n = e.querySelector(".ginner-container"), s = e.querySelector(".gslide-media"), r = e.querySelector(".gslide-description");
815
+ n.style.transform = "", s.style.transform = "", S(s, "greset"), s.style.opacity = "", r && (r.style.opacity = ""), S(e, "prev");
816
+ }));
817
+ } }, { key: "getAllPlayers", value: function() {
818
+ return this.videoPlayers;
819
+ } }, { key: "getSlidePlayerInstance", value: function(e) {
820
+ var t = "gvideo" + e, i = this.getAllPlayers();
821
+ return !(!w(i, t) || !i[t]) && i[t];
822
+ } }, { key: "stopSlideVideo", value: function(e) {
823
+ if (N(e)) {
824
+ var t = e.querySelector(".gvideo-wrapper");
825
+ t && (e = t.getAttribute("data-index"));
826
+ }
827
+ console.log("stopSlideVideo is deprecated, use slidePlayerPause");
828
+ var i = this.getSlidePlayerInstance(e);
829
+ i && i.playing && i.pause();
830
+ } }, { key: "slidePlayerPause", value: function(e) {
831
+ if (N(e)) {
832
+ var t = e.querySelector(".gvideo-wrapper");
833
+ t && (e = t.getAttribute("data-index"));
834
+ }
835
+ var i = this.getSlidePlayerInstance(e);
836
+ i && i.playing && i.pause();
837
+ } }, { key: "playSlideVideo", value: function(e) {
838
+ if (N(e)) {
839
+ var t = e.querySelector(".gvideo-wrapper");
840
+ t && (e = t.getAttribute("data-index"));
841
+ }
842
+ console.log("playSlideVideo is deprecated, use slidePlayerPlay");
843
+ var i = this.getSlidePlayerInstance(e);
844
+ i && !i.playing && i.play();
845
+ } }, { key: "slidePlayerPlay", value: function(e) {
846
+ var t;
847
+ if (!xe || (t = this.settings.plyr.config) !== null && t !== void 0 && t.muted) {
848
+ if (N(e)) {
849
+ var i = e.querySelector(".gvideo-wrapper");
850
+ i && (e = i.getAttribute("data-index"));
851
+ }
852
+ var n = this.getSlidePlayerInstance(e);
853
+ n && !n.playing && (n.play(), this.settings.autofocusVideos && n.elements.container.focus());
854
+ }
855
+ } }, { key: "setElements", value: function(e) {
856
+ var t = this;
857
+ this.settings.elements = !1;
858
+ var i = [];
859
+ e && e.length && y(e, (function(n, s) {
860
+ var r = new ie(n, t, s), l = r.getConfig(), a = L({}, l);
861
+ a.slideConfig = l, a.instance = r, a.index = s, i.push(a);
862
+ })), this.elements = i, this.lightboxOpen && (this.slidesContainer.innerHTML = "", this.elements.length && (y(this.elements, (function() {
863
+ var n = G(t.settings.slideHTML);
864
+ t.slidesContainer.appendChild(n);
865
+ })), this.showSlide(0, !0)));
866
+ } }, { key: "getElementIndex", value: function(e) {
867
+ var t = !1;
868
+ return y(this.elements, (function(i, n) {
869
+ if (w(i, "node") && i.node == e) return t = n, !0;
870
+ })), t;
871
+ } }, { key: "getElements", value: function() {
872
+ var e = this, t = [];
873
+ this.elements = this.elements ? this.elements : [], !I(this.settings.elements) && fe(this.settings.elements) && this.settings.elements.length && y(this.settings.elements, (function(n, s) {
874
+ var r = new ie(n, e, s), l = r.getConfig(), a = L({}, l);
875
+ a.node = !1, a.index = s, a.instance = r, a.slideConfig = l, t.push(a);
876
+ }));
877
+ var i = !1;
878
+ return this.getSelector() && (i = document.querySelectorAll(this.getSelector())), i && y(i, (function(n, s) {
879
+ var r = new ie(n, e, s), l = r.getConfig(), a = L({}, l);
880
+ a.node = n, a.index = s, a.instance = r, a.slideConfig = l, a.gallery = n.getAttribute("data-gallery"), t.push(a);
881
+ })), t;
882
+ } }, { key: "getGalleryElements", value: function(e, t) {
883
+ return e.filter((function(i) {
884
+ return i.gallery == t;
885
+ }));
886
+ } }, { key: "getSelector", value: function() {
887
+ return !this.settings.elements && (this.settings.selector && this.settings.selector.substring(0, 5) == "data-" ? "*[".concat(this.settings.selector, "]") : this.settings.selector);
888
+ } }, { key: "getActiveSlide", value: function() {
889
+ return this.slidesContainer.querySelectorAll(".gslide")[this.index];
890
+ } }, { key: "getActiveSlideIndex", value: function() {
891
+ return this.index;
892
+ } }, { key: "getAnimationClasses", value: function() {
893
+ var e = [];
894
+ for (var t in this.settings.cssEfects) if (this.settings.cssEfects.hasOwnProperty(t)) {
895
+ var i = this.settings.cssEfects[t];
896
+ e.push("g".concat(i.in)), e.push("g".concat(i.out));
897
+ }
898
+ return e.join(" ");
899
+ } }, { key: "build", value: function() {
900
+ var e = this;
901
+ if (this.built) return !1;
902
+ var t = document.body.childNodes, i = [];
903
+ y(t, (function(o) {
904
+ o.parentNode == document.body && o.nodeName.charAt(0) !== "#" && o.hasAttribute && !o.hasAttribute("aria-hidden") && (i.push(o), o.setAttribute("aria-hidden", "true"));
905
+ }));
906
+ var n = w(this.settings.svg, "next") ? this.settings.svg.next : "", s = w(this.settings.svg, "prev") ? this.settings.svg.prev : "", r = w(this.settings.svg, "close") ? this.settings.svg.close : "", l = this.settings.lightboxHTML;
907
+ l = G(l = (l = (l = l.replace(/{nextSVG}/g, n)).replace(/{prevSVG}/g, s)).replace(/{closeSVG}/g, r)), document.body.appendChild(l);
908
+ var a = document.getElementById("glightbox-body");
909
+ this.modal = a;
910
+ var h = a.querySelector(".gclose");
911
+ this.prevButton = a.querySelector(".gprev"), this.nextButton = a.querySelector(".gnext"), this.overlay = a.querySelector(".goverlay"), this.loader = a.querySelector(".gloader"), this.slidesContainer = document.getElementById("glightbox-slider"), this.bodyHiddenChildElms = i, this.events = {}, v(this.modal, "glightbox-" + this.settings.skin), this.settings.closeButton && h && (this.events.close = P("click", { onElement: h, withCallback: function(o, d) {
912
+ o.preventDefault(), e.close();
913
+ } })), h && !this.settings.closeButton && h.parentNode.removeChild(h), this.nextButton && (this.events.next = P("click", { onElement: this.nextButton, withCallback: function(o, d) {
914
+ o.preventDefault(), e.nextSlide();
915
+ } })), this.prevButton && (this.events.prev = P("click", { onElement: this.prevButton, withCallback: function(o, d) {
916
+ o.preventDefault(), e.prevSlide();
917
+ } })), this.settings.closeOnOutsideClick && (this.events.outClose = P("click", { onElement: a, withCallback: function(o, d) {
918
+ e.preventOutsideClick || T(document.body, "glightbox-mobile") || X(o.target, ".ginner-container") || X(o.target, ".gbtn") || T(o.target, "gnext") || T(o.target, "gprev") || e.close();
919
+ } })), y(this.elements, (function(o, d) {
920
+ e.slidesContainer.appendChild(o.instance.create()), o.slideNode = e.slidesContainer.querySelectorAll(".gslide")[d];
921
+ })), Se && v(document.body, "glightbox-touch"), this.events.resize = P("resize", { onElement: window, withCallback: function() {
922
+ e.resize();
923
+ } }), this.built = !0;
924
+ } }, { key: "resize", value: function() {
925
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
926
+ if ((e = e || this.activeSlide) && !T(e, "zoomed")) {
927
+ var t = ue(), i = e.querySelector(".gvideo-wrapper"), n = e.querySelector(".gslide-image"), s = this.slideDescription, r = t.width, l = t.height;
928
+ if (r <= 768 ? v(document.body, "glightbox-mobile") : S(document.body, "glightbox-mobile"), i || n) {
929
+ var a = !1;
930
+ if (s && (T(s, "description-bottom") || T(s, "description-top")) && !T(s, "gabsolute") && (a = !0), n) {
931
+ if (r <= 768) n.querySelector("img");
932
+ else if (a) {
933
+ var h, o, d = s.offsetHeight, c = n.querySelector("img"), u = (h = this.elements[this.index]) === null || h === void 0 ? void 0 : h.node, g = "100vh";
934
+ u && (g = (o = u.getAttribute("data-height")) !== null && o !== void 0 ? o : g), c.setAttribute("style", "max-height: calc(".concat(g, " - ").concat(d, "px)")), s.setAttribute("style", "max-width: ".concat(c.offsetWidth, "px;"));
935
+ }
936
+ }
937
+ if (i) {
938
+ var f = w(this.settings.plyr.config, "ratio") ? this.settings.plyr.config.ratio : "";
939
+ if (!f) {
940
+ var b = i.clientWidth, M = i.clientHeight, O = b / M;
941
+ f = "".concat(b / O, ":").concat(M / O);
942
+ }
943
+ var D = f.split(":"), k = this.settings.videosWidth, B = this.settings.videosWidth, W = (B = te(k) || k.indexOf("px") !== -1 ? parseInt(k) : k.indexOf("vw") !== -1 ? r * parseInt(k) / 100 : k.indexOf("vh") !== -1 ? l * parseInt(k) / 100 : k.indexOf("%") !== -1 ? r * parseInt(k) / 100 : parseInt(i.clientWidth)) / (parseInt(D[0]) / parseInt(D[1]));
944
+ if (W = Math.floor(W), a && (l -= s.offsetHeight), B > r || W > l || l < W && r > B) {
945
+ var Q = i.offsetWidth, J = i.offsetHeight, Y = l / J, _ = { width: Q * Y, height: J * Y };
946
+ i.parentNode.setAttribute("style", "max-width: ".concat(_.width, "px")), a && s.setAttribute("style", "max-width: ".concat(_.width, "px;"));
947
+ } else i.parentNode.style.maxWidth = "".concat(k), a && s.setAttribute("style", "max-width: ".concat(k, ";"));
948
+ }
949
+ }
950
+ }
951
+ } }, { key: "reload", value: function() {
952
+ this.init();
953
+ } }, { key: "updateNavigationClasses", value: function() {
954
+ var e = this.loop();
955
+ S(this.nextButton, "disabled"), S(this.prevButton, "disabled"), this.index == 0 && this.elements.length - 1 == 0 ? (v(this.prevButton, "disabled"), v(this.nextButton, "disabled")) : this.index !== 0 || e ? this.index !== this.elements.length - 1 || e || v(this.nextButton, "disabled") : v(this.prevButton, "disabled");
956
+ } }, { key: "loop", value: function() {
957
+ var e = w(this.settings, "loopAtEnd") ? this.settings.loopAtEnd : null;
958
+ return e = w(this.settings, "loop") ? this.settings.loop : e, e;
959
+ } }, { key: "close", value: function() {
960
+ var e = this;
961
+ if (!this.lightboxOpen) {
962
+ if (this.events) {
963
+ for (var t in this.events) this.events.hasOwnProperty(t) && this.events[t].destroy();
964
+ this.events = null;
965
+ }
966
+ return !1;
967
+ }
968
+ if (this.closing) return !1;
969
+ this.closing = !0, this.slidePlayerPause(this.activeSlide), this.fullElementsList && (this.elements = this.fullElementsList), this.bodyHiddenChildElms.length && y(this.bodyHiddenChildElms, (function(i) {
970
+ i.removeAttribute("aria-hidden");
971
+ })), v(this.modal, "glightbox-closing"), U(this.overlay, this.settings.openEffect == "none" ? "none" : this.settings.cssEfects.fade.out), U(this.activeSlide, this.settings.cssEfects[this.settings.closeEffect].out, (function() {
972
+ if (e.activeSlide = null, e.prevActiveSlideIndex = null, e.prevActiveSlide = null, e.built = !1, e.events) {
973
+ for (var i in e.events) e.events.hasOwnProperty(i) && e.events[i].destroy();
974
+ e.events = null;
975
+ }
976
+ var n = document.body;
977
+ S(we, "glightbox-open"), S(n, "glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"), e.modal.parentNode.removeChild(e.modal), e.trigger("close"), p(e.settings.onClose) && e.settings.onClose();
978
+ var s = document.querySelector(".gcss-styles");
979
+ s && s.parentNode.removeChild(s), e.lightboxOpen = !1, e.closing = null;
980
+ }));
981
+ } }, { key: "destroy", value: function() {
982
+ this.close(), this.clearAllEvents(), this.baseEvents && this.baseEvents.destroy();
983
+ } }, { key: "on", value: function(e, t) {
984
+ var i = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
985
+ if (!e || !p(t)) throw new TypeError("Event name and callback must be defined");
986
+ this.apiEvents.push({ evt: e, once: i, callback: t });
987
+ } }, { key: "once", value: function(e, t) {
988
+ this.on(e, t, !0);
989
+ } }, { key: "trigger", value: function(e) {
990
+ var t = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, n = [];
991
+ y(this.apiEvents, (function(s, r) {
992
+ var l = s.evt, a = s.once, h = s.callback;
993
+ l == e && (h(i), a && n.push(r));
994
+ })), n.length && y(n, (function(s) {
995
+ return t.apiEvents.splice(s, 1);
996
+ }));
997
+ } }, { key: "clearAllEvents", value: function() {
998
+ this.apiEvents.splice(0, this.apiEvents.length);
999
+ } }, { key: "version", value: function() {
1000
+ return "3.3.1";
1001
+ } }]);
1002
+ return function() {
1003
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = new Be(e);
1004
+ return t.init(), t;
1005
+ };
1006
+ }));
1007
+ })(re)), re.exports;
1008
+ }
1009
+ var Ue = Ze();
1010
+ const Ee = /* @__PURE__ */ Fe(Ue);
1011
+ class $e {
1012
+ constructor(z = {}) {
1013
+ const x = {
1014
+ skin: "light"
1015
+ };
1016
+ this.settings = { ...x, ...z };
1017
+ }
1018
+ init() {
1019
+ const z = {
1020
+ touchNavigation: !0,
1021
+ selector: ".glightbox",
1022
+ // do not use .is-lightbox if used for programmatically open
1023
+ loop: !0,
1024
+ autoplayVideos: !0,
1025
+ zoomable: !0,
1026
+ slideEffect: "slide",
1027
+ descPosition: "bottom",
1028
+ skin: this.settings.skin
1029
+ };
1030
+ this.refreshLightbox(z), document.querySelectorAll(".is-lightbox,.block-click").forEach((q) => {
1031
+ const A = (V) => {
1032
+ let R = q.getAttribute("href") || q.getAttribute("data-modal-url");
1033
+ this.openLightbox(R, q, z), V.preventDefault(), V.stopImmediatePropagation();
1034
+ };
1035
+ q.addEventListener("click", A), q._lightboxHandler = A;
1036
+ });
1037
+ }
1038
+ refreshLightbox(z) {
1039
+ this.glightbox && this.glightbox.destroy(), this.glightbox = Ee(z), window.GLightbox = Ee;
1040
+ }
1041
+ openLightbox(z, x, q) {
1042
+ let A = [], V = 0;
1043
+ if (x) {
1044
+ const R = x.closest("[data-gallery]");
1045
+ let Z = [];
1046
+ R ? Z = R.querySelectorAll(".is-lightbox") : document.querySelectorAll(".is-lightbox,.block-click").forEach((y) => {
1047
+ y.closest("[data-gallery]") || Z.push(y);
1048
+ }), Z.forEach((L, y) => {
1049
+ let F = L.getAttribute("href");
1050
+ F || (F = L.getAttribute("data-modal-url")), A.push({
1051
+ href: F
1052
+ }), z === F && (V = y);
1053
+ });
1054
+ }
1055
+ A.length > 0 ? (this.glightbox.setElements(A), this.glightbox.openAt(V)) : (this.glightbox.setElements([
1056
+ {
1057
+ href: z
1058
+ }
1059
+ ]), this.glightbox.open()), this.glightbox.on("close", () => {
1060
+ this.refreshLightbox(q);
1061
+ });
1062
+ }
1063
+ destroy() {
1064
+ this.glightbox && (this.glightbox.destroy(), this.glightbox = null), document.querySelectorAll(".is-lightbox,.block-click").forEach((x) => {
1065
+ x._lightboxHandler && (x.removeEventListener("click", x._lightboxHandler), delete x._lightboxHandler);
1066
+ });
1067
+ }
1068
+ }
1069
+ export {
1070
+ $e as default
1071
+ };