@tarsis/toolkit 0.4.8 → 0.5.0

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.
Files changed (97) hide show
  1. package/dist/fonts/GT-Flexa-VF-Trial.woff2 +0 -0
  2. package/dist/fonts/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
  3. package/dist/fonts/GT-Maru-Light-Trial.woff2 +0 -0
  4. package/dist/fonts/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
  5. package/dist/fonts/GT-Maru-Medium-Trial.woff2 +0 -0
  6. package/dist/fonts/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
  7. package/dist/fonts/GT-Maru-Mono-Black-Trial.woff2 +0 -0
  8. package/dist/fonts/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
  9. package/dist/fonts/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
  10. package/dist/fonts/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
  11. package/dist/fonts/GT-Maru-Mono-Light-Trial.woff2 +0 -0
  12. package/dist/fonts/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
  13. package/dist/fonts/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
  14. package/dist/fonts/gt/maru/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
  15. package/dist/fonts/gt/maru/GT-Maru-Light-Trial.woff2 +0 -0
  16. package/dist/fonts/gt/maru/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
  17. package/dist/fonts/gt/maru/GT-Maru-Medium-Trial.woff2 +0 -0
  18. package/dist/fonts/gt/maru/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
  19. package/dist/fonts/gt/maru/GT-Maru-Mono-Black-Trial.woff2 +0 -0
  20. package/dist/fonts/gt/maru/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
  21. package/dist/fonts/gt/maru/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
  22. package/dist/fonts/gt/maru/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
  23. package/dist/fonts/gt/maru/GT-Maru-Mono-Light-Trial.woff2 +0 -0
  24. package/dist/fonts/gt/maru/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
  25. package/dist/fonts/gt/maru/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
  26. package/dist/fonts/gt/maru/gt-maru-black-oblique.woff2 +0 -0
  27. package/dist/fonts/gt/maru/gt-maru-black.woff2 +0 -0
  28. package/dist/fonts/gt/maru/gt-maru-bold-oblique.woff2 +0 -0
  29. package/dist/fonts/gt/maru/gt-maru-bold.woff2 +0 -0
  30. package/dist/fonts/gt/maru/gt-maru-mega-l.woff2 +0 -0
  31. package/dist/fonts/gt/maru/gt-maru-mega-m.woff2 +0 -0
  32. package/dist/fonts/gt/maru/gt-maru-mega-s.woff2 +0 -0
  33. package/dist/fonts/gt/maru/gt-maru-mono-regular-oblique.woff2 +0 -0
  34. package/dist/fonts/gt/maru/gt-maru-mono-regular.woff2 +0 -0
  35. package/dist/fonts/gt/maru/gt-maru-regular-oblique.woff2 +0 -0
  36. package/dist/fonts/gt/maru/gt-maru-regular.woff2 +0 -0
  37. package/dist/fonts/gt-flexa/GT-Flexa-VF-Trial.woff2 +0 -0
  38. package/dist/fonts/gt-maru-black-oblique.woff2 +0 -0
  39. package/dist/fonts/gt-maru-black.woff2 +0 -0
  40. package/dist/fonts/gt-maru-bold-oblique.woff2 +0 -0
  41. package/dist/fonts/gt-maru-bold.woff2 +0 -0
  42. package/dist/fonts/gt-maru-mega-l.woff2 +0 -0
  43. package/dist/fonts/gt-maru-mega-m.woff2 +0 -0
  44. package/dist/fonts/gt-maru-mega-s.woff2 +0 -0
  45. package/dist/fonts/gt-maru-mono-regular-oblique.woff2 +0 -0
  46. package/dist/fonts/gt-maru-mono-regular.woff2 +0 -0
  47. package/dist/fonts/gt-maru-regular-oblique.woff2 +0 -0
  48. package/dist/fonts/gt-maru-regular.woff2 +0 -0
  49. package/dist/fonts/maru/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
  50. package/dist/fonts/maru/GT-Maru-Light-Trial.woff2 +0 -0
  51. package/dist/fonts/maru/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
  52. package/dist/fonts/maru/GT-Maru-Medium-Trial.woff2 +0 -0
  53. package/dist/fonts/maru/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
  54. package/dist/fonts/maru/GT-Maru-Mono-Black-Trial.woff2 +0 -0
  55. package/dist/fonts/maru/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
  56. package/dist/fonts/maru/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
  57. package/dist/fonts/maru/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
  58. package/dist/fonts/maru/GT-Maru-Mono-Light-Trial.woff2 +0 -0
  59. package/dist/fonts/maru/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
  60. package/dist/fonts/maru/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
  61. package/dist/fonts/maru/gt-maru-black-oblique.woff2 +0 -0
  62. package/dist/fonts/maru/gt-maru-black.woff2 +0 -0
  63. package/dist/fonts/maru/gt-maru-bold-oblique.woff2 +0 -0
  64. package/dist/fonts/maru/gt-maru-bold.woff2 +0 -0
  65. package/dist/fonts/maru/gt-maru-mega-l.woff2 +0 -0
  66. package/dist/fonts/maru/gt-maru-mega-m.woff2 +0 -0
  67. package/dist/fonts/maru/gt-maru-mega-s.woff2 +0 -0
  68. package/dist/fonts/maru/gt-maru-mono-regular-oblique.woff2 +0 -0
  69. package/dist/fonts/maru/gt-maru-mono-regular.woff2 +0 -0
  70. package/dist/fonts/maru/gt-maru-regular-oblique.woff2 +0 -0
  71. package/dist/fonts/maru/gt-maru-regular.woff2 +0 -0
  72. package/dist/gl-BlKJDzVL.cjs +3262 -0
  73. package/dist/gl-DA94DTyS.js +3258 -0
  74. package/dist/hooks.cjs +24 -0
  75. package/dist/hooks.d.ts +190 -0
  76. package/dist/hooks.js +1 -0
  77. package/dist/index-B9O5nl2I.js +113847 -0
  78. package/dist/index-B_kRoqUz.cjs +3912 -0
  79. package/dist/index-BlpASwt4.js +3910 -0
  80. package/dist/index-DrShaNFt.cjs +114199 -0
  81. package/dist/index.cjs +343 -41240
  82. package/dist/index.d.ts +470 -354
  83. package/dist/index.js +4 -40894
  84. package/dist/server.cjs +0 -3
  85. package/dist/server.d.ts +0 -2
  86. package/dist/server.js +1 -3
  87. package/dist/styles.css +961 -647
  88. package/dist/svg-6fNe-PW5.cjs +68 -0
  89. package/dist/svg-C0Ykxk94.js +60 -0
  90. package/dist/useWindowReady-CESjx5iD.cjs +9275 -0
  91. package/dist/useWindowReady-CIGrizO6.js +9185 -0
  92. package/dist/utils.cjs +39 -0
  93. package/dist/utils.d.ts +90 -0
  94. package/dist/utils.js +2 -0
  95. package/package.json +71 -70
  96. package/dist/gl-BytuN41l.cjs +0 -380
  97. package/dist/gl-D_Ly48gx.js +0 -357
@@ -0,0 +1,3910 @@
1
+ import { g as getDefaultExportFromCjs } from './index-B9O5nl2I.js';
2
+
3
+ function _mergeNamespaces(n, m) {
4
+ for (var i = 0; i < m.length; i++) {
5
+ const e = m[i];
6
+ if (typeof e !== 'string' && !Array.isArray(e)) { for (const k in e) {
7
+ if (k !== 'default' && !(k in n)) {
8
+ const d = Object.getOwnPropertyDescriptor(e, k);
9
+ if (d) {
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: () => e[k]
13
+ });
14
+ }
15
+ }
16
+ } }
17
+ }
18
+ return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }));
19
+ }
20
+
21
+ var js = {exports: {}};
22
+
23
+ var flickity = {exports: {}};
24
+
25
+ var evEmitter$1 = {exports: {}};
26
+
27
+ /**
28
+ * EvEmitter v1.1.0
29
+ * Lil' event emitter
30
+ * MIT License
31
+ */
32
+ var evEmitter = evEmitter$1.exports;
33
+
34
+ var hasRequiredEvEmitter;
35
+
36
+ function requireEvEmitter () {
37
+ if (hasRequiredEvEmitter) return evEmitter$1.exports;
38
+ hasRequiredEvEmitter = 1;
39
+ (function (module) {
40
+ /* jshint unused: true, undef: true, strict: true */
41
+
42
+ ( function( global, factory ) {
43
+ // universal module definition
44
+ /* jshint strict: false */ /* globals define, module, window */
45
+ if ( module.exports ) {
46
+ // CommonJS - Browserify, Webpack
47
+ module.exports = factory();
48
+ } else {
49
+ // Browser globals
50
+ global.EvEmitter = factory();
51
+ }
52
+
53
+ }( typeof window != 'undefined' ? window : evEmitter, function() {
54
+
55
+ function EvEmitter() {}
56
+
57
+ var proto = EvEmitter.prototype;
58
+
59
+ proto.on = function( eventName, listener ) {
60
+ if ( !eventName || !listener ) {
61
+ return;
62
+ }
63
+ // set events hash
64
+ var events = this._events = this._events || {};
65
+ // set listeners array
66
+ var listeners = events[ eventName ] = events[ eventName ] || [];
67
+ // only add once
68
+ if ( listeners.indexOf( listener ) == -1 ) {
69
+ listeners.push( listener );
70
+ }
71
+
72
+ return this;
73
+ };
74
+
75
+ proto.once = function( eventName, listener ) {
76
+ if ( !eventName || !listener ) {
77
+ return;
78
+ }
79
+ // add event
80
+ this.on( eventName, listener );
81
+ // set once flag
82
+ // set onceEvents hash
83
+ var onceEvents = this._onceEvents = this._onceEvents || {};
84
+ // set onceListeners object
85
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
86
+ // set flag
87
+ onceListeners[ listener ] = true;
88
+
89
+ return this;
90
+ };
91
+
92
+ proto.off = function( eventName, listener ) {
93
+ var listeners = this._events && this._events[ eventName ];
94
+ if ( !listeners || !listeners.length ) {
95
+ return;
96
+ }
97
+ var index = listeners.indexOf( listener );
98
+ if ( index != -1 ) {
99
+ listeners.splice( index, 1 );
100
+ }
101
+
102
+ return this;
103
+ };
104
+
105
+ proto.emitEvent = function( eventName, args ) {
106
+ var listeners = this._events && this._events[ eventName ];
107
+ if ( !listeners || !listeners.length ) {
108
+ return;
109
+ }
110
+ // copy over to avoid interference if .off() in listener
111
+ listeners = listeners.slice(0);
112
+ args = args || [];
113
+ // once stuff
114
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
115
+
116
+ for ( var i=0; i < listeners.length; i++ ) {
117
+ var listener = listeners[i];
118
+ var isOnce = onceListeners && onceListeners[ listener ];
119
+ if ( isOnce ) {
120
+ // remove listener
121
+ // remove before trigger to prevent recursion
122
+ this.off( eventName, listener );
123
+ // unset once flag
124
+ delete onceListeners[ listener ];
125
+ }
126
+ // trigger listener
127
+ listener.apply( this, args );
128
+ }
129
+
130
+ return this;
131
+ };
132
+
133
+ proto.allOff = function() {
134
+ delete this._events;
135
+ delete this._onceEvents;
136
+ };
137
+
138
+ return EvEmitter;
139
+
140
+ }));
141
+ } (evEmitter$1));
142
+ return evEmitter$1.exports;
143
+ }
144
+
145
+ var getSize = {exports: {}};
146
+
147
+ /*!
148
+ * getSize v2.0.3
149
+ * measure size of elements
150
+ * MIT license
151
+ */
152
+
153
+ var hasRequiredGetSize;
154
+
155
+ function requireGetSize () {
156
+ if (hasRequiredGetSize) return getSize.exports;
157
+ hasRequiredGetSize = 1;
158
+ (function (module) {
159
+ /* jshint browser: true, strict: true, undef: true, unused: true */
160
+ /* globals console: false */
161
+
162
+ ( function( window, factory ) {
163
+ /* jshint strict: false */ /* globals define, module */
164
+ if ( module.exports ) {
165
+ // CommonJS
166
+ module.exports = factory();
167
+ } else {
168
+ // browser global
169
+ window.getSize = factory();
170
+ }
171
+
172
+ })( window, function factory() {
173
+
174
+ // -------------------------- helpers -------------------------- //
175
+
176
+ // get a number from a string, not a percentage
177
+ function getStyleSize( value ) {
178
+ var num = parseFloat( value );
179
+ // not a percent like '100%', and a number
180
+ var isValid = value.indexOf('%') == -1 && !isNaN( num );
181
+ return isValid && num;
182
+ }
183
+
184
+ function noop() {}
185
+
186
+ var logError = typeof console == 'undefined' ? noop :
187
+ function( message ) {
188
+ console.error( message );
189
+ };
190
+
191
+ // -------------------------- measurements -------------------------- //
192
+
193
+ var measurements = [
194
+ 'paddingLeft',
195
+ 'paddingRight',
196
+ 'paddingTop',
197
+ 'paddingBottom',
198
+ 'marginLeft',
199
+ 'marginRight',
200
+ 'marginTop',
201
+ 'marginBottom',
202
+ 'borderLeftWidth',
203
+ 'borderRightWidth',
204
+ 'borderTopWidth',
205
+ 'borderBottomWidth'
206
+ ];
207
+
208
+ var measurementsLength = measurements.length;
209
+
210
+ function getZeroSize() {
211
+ var size = {
212
+ width: 0,
213
+ height: 0,
214
+ innerWidth: 0,
215
+ innerHeight: 0,
216
+ outerWidth: 0,
217
+ outerHeight: 0
218
+ };
219
+ for ( var i=0; i < measurementsLength; i++ ) {
220
+ var measurement = measurements[i];
221
+ size[ measurement ] = 0;
222
+ }
223
+ return size;
224
+ }
225
+
226
+ // -------------------------- getStyle -------------------------- //
227
+
228
+ /**
229
+ * getStyle, get style of element, check for Firefox bug
230
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
231
+ */
232
+ function getStyle( elem ) {
233
+ var style = getComputedStyle( elem );
234
+ if ( !style ) {
235
+ logError( 'Style returned ' + style +
236
+ '. Are you running this code in a hidden iframe on Firefox? ' +
237
+ 'See https://bit.ly/getsizebug1' );
238
+ }
239
+ return style;
240
+ }
241
+
242
+ // -------------------------- setup -------------------------- //
243
+
244
+ var isSetup = false;
245
+
246
+ var isBoxSizeOuter;
247
+
248
+ /**
249
+ * setup
250
+ * check isBoxSizerOuter
251
+ * do on first getSize() rather than on page load for Firefox bug
252
+ */
253
+ function setup() {
254
+ // setup once
255
+ if ( isSetup ) {
256
+ return;
257
+ }
258
+ isSetup = true;
259
+
260
+ // -------------------------- box sizing -------------------------- //
261
+
262
+ /**
263
+ * Chrome & Safari measure the outer-width on style.width on border-box elems
264
+ * IE11 & Firefox<29 measures the inner-width
265
+ */
266
+ var div = document.createElement('div');
267
+ div.style.width = '200px';
268
+ div.style.padding = '1px 2px 3px 4px';
269
+ div.style.borderStyle = 'solid';
270
+ div.style.borderWidth = '1px 2px 3px 4px';
271
+ div.style.boxSizing = 'border-box';
272
+
273
+ var body = document.body || document.documentElement;
274
+ body.appendChild( div );
275
+ var style = getStyle( div );
276
+ // round value for browser zoom. desandro/masonry#928
277
+ isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;
278
+ getSize.isBoxSizeOuter = isBoxSizeOuter;
279
+
280
+ body.removeChild( div );
281
+ }
282
+
283
+ // -------------------------- getSize -------------------------- //
284
+
285
+ function getSize( elem ) {
286
+ setup();
287
+
288
+ // use querySeletor if elem is string
289
+ if ( typeof elem == 'string' ) {
290
+ elem = document.querySelector( elem );
291
+ }
292
+
293
+ // do not proceed on non-objects
294
+ if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
295
+ return;
296
+ }
297
+
298
+ var style = getStyle( elem );
299
+
300
+ // if hidden, everything is 0
301
+ if ( style.display == 'none' ) {
302
+ return getZeroSize();
303
+ }
304
+
305
+ var size = {};
306
+ size.width = elem.offsetWidth;
307
+ size.height = elem.offsetHeight;
308
+
309
+ var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
310
+
311
+ // get all measurements
312
+ for ( var i=0; i < measurementsLength; i++ ) {
313
+ var measurement = measurements[i];
314
+ var value = style[ measurement ];
315
+ var num = parseFloat( value );
316
+ // any 'auto', 'medium' value will be 0
317
+ size[ measurement ] = !isNaN( num ) ? num : 0;
318
+ }
319
+
320
+ var paddingWidth = size.paddingLeft + size.paddingRight;
321
+ var paddingHeight = size.paddingTop + size.paddingBottom;
322
+ var marginWidth = size.marginLeft + size.marginRight;
323
+ var marginHeight = size.marginTop + size.marginBottom;
324
+ var borderWidth = size.borderLeftWidth + size.borderRightWidth;
325
+ var borderHeight = size.borderTopWidth + size.borderBottomWidth;
326
+
327
+ var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
328
+
329
+ // overwrite width and height if we can get it from style
330
+ var styleWidth = getStyleSize( style.width );
331
+ if ( styleWidth !== false ) {
332
+ size.width = styleWidth +
333
+ // add padding and border unless it's already including it
334
+ ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
335
+ }
336
+
337
+ var styleHeight = getStyleSize( style.height );
338
+ if ( styleHeight !== false ) {
339
+ size.height = styleHeight +
340
+ // add padding and border unless it's already including it
341
+ ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
342
+ }
343
+
344
+ size.innerWidth = size.width - ( paddingWidth + borderWidth );
345
+ size.innerHeight = size.height - ( paddingHeight + borderHeight );
346
+
347
+ size.outerWidth = size.width + marginWidth;
348
+ size.outerHeight = size.height + marginHeight;
349
+
350
+ return size;
351
+ }
352
+
353
+ return getSize;
354
+
355
+ });
356
+ } (getSize));
357
+ return getSize.exports;
358
+ }
359
+
360
+ var utils = {exports: {}};
361
+
362
+ var matchesSelector = {exports: {}};
363
+
364
+ /**
365
+ * matchesSelector v2.0.2
366
+ * matchesSelector( element, '.selector' )
367
+ * MIT license
368
+ */
369
+
370
+ var hasRequiredMatchesSelector;
371
+
372
+ function requireMatchesSelector () {
373
+ if (hasRequiredMatchesSelector) return matchesSelector.exports;
374
+ hasRequiredMatchesSelector = 1;
375
+ (function (module) {
376
+ /*jshint browser: true, strict: true, undef: true, unused: true */
377
+
378
+ ( function( window, factory ) {
379
+ // universal module definition
380
+ if ( module.exports ) {
381
+ // CommonJS
382
+ module.exports = factory();
383
+ } else {
384
+ // browser global
385
+ window.matchesSelector = factory();
386
+ }
387
+
388
+ }( window, function factory() {
389
+
390
+ var matchesMethod = ( function() {
391
+ var ElemProto = window.Element.prototype;
392
+ // check for the standard method name first
393
+ if ( ElemProto.matches ) {
394
+ return 'matches';
395
+ }
396
+ // check un-prefixed
397
+ if ( ElemProto.matchesSelector ) {
398
+ return 'matchesSelector';
399
+ }
400
+ // check vendor prefixes
401
+ var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
402
+
403
+ for ( var i=0; i < prefixes.length; i++ ) {
404
+ var prefix = prefixes[i];
405
+ var method = prefix + 'MatchesSelector';
406
+ if ( ElemProto[ method ] ) {
407
+ return method;
408
+ }
409
+ }
410
+ })();
411
+
412
+ return function matchesSelector( elem, selector ) {
413
+ return elem[ matchesMethod ]( selector );
414
+ };
415
+
416
+ }));
417
+ } (matchesSelector));
418
+ return matchesSelector.exports;
419
+ }
420
+
421
+ /**
422
+ * Fizzy UI utils v2.0.7
423
+ * MIT license
424
+ */
425
+
426
+ var hasRequiredUtils;
427
+
428
+ function requireUtils () {
429
+ if (hasRequiredUtils) return utils.exports;
430
+ hasRequiredUtils = 1;
431
+ (function (module) {
432
+ /*jshint browser: true, undef: true, unused: true, strict: true */
433
+
434
+ ( function( window, factory ) {
435
+ // universal module definition
436
+ /*jshint strict: false */ /*globals define, module, require */
437
+
438
+ if ( module.exports ) {
439
+ // CommonJS
440
+ module.exports = factory(
441
+ window,
442
+ requireMatchesSelector()
443
+ );
444
+ } else {
445
+ // browser global
446
+ window.fizzyUIUtils = factory(
447
+ window,
448
+ window.matchesSelector
449
+ );
450
+ }
451
+
452
+ }( window, function factory( window, matchesSelector ) {
453
+
454
+ var utils = {};
455
+
456
+ // ----- extend ----- //
457
+
458
+ // extends objects
459
+ utils.extend = function( a, b ) {
460
+ for ( var prop in b ) {
461
+ a[ prop ] = b[ prop ];
462
+ }
463
+ return a;
464
+ };
465
+
466
+ // ----- modulo ----- //
467
+
468
+ utils.modulo = function( num, div ) {
469
+ return ( ( num % div ) + div ) % div;
470
+ };
471
+
472
+ // ----- makeArray ----- //
473
+
474
+ var arraySlice = Array.prototype.slice;
475
+
476
+ // turn element or nodeList into an array
477
+ utils.makeArray = function( obj ) {
478
+ if ( Array.isArray( obj ) ) {
479
+ // use object if already an array
480
+ return obj;
481
+ }
482
+ // return empty array if undefined or null. #6
483
+ if ( obj === null || obj === undefined ) {
484
+ return [];
485
+ }
486
+
487
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
488
+ if ( isArrayLike ) {
489
+ // convert nodeList to array
490
+ return arraySlice.call( obj );
491
+ }
492
+
493
+ // array of single index
494
+ return [ obj ];
495
+ };
496
+
497
+ // ----- removeFrom ----- //
498
+
499
+ utils.removeFrom = function( ary, obj ) {
500
+ var index = ary.indexOf( obj );
501
+ if ( index != -1 ) {
502
+ ary.splice( index, 1 );
503
+ }
504
+ };
505
+
506
+ // ----- getParent ----- //
507
+
508
+ utils.getParent = function( elem, selector ) {
509
+ while ( elem.parentNode && elem != document.body ) {
510
+ elem = elem.parentNode;
511
+ if ( matchesSelector( elem, selector ) ) {
512
+ return elem;
513
+ }
514
+ }
515
+ };
516
+
517
+ // ----- getQueryElement ----- //
518
+
519
+ // use element as selector string
520
+ utils.getQueryElement = function( elem ) {
521
+ if ( typeof elem == 'string' ) {
522
+ return document.querySelector( elem );
523
+ }
524
+ return elem;
525
+ };
526
+
527
+ // ----- handleEvent ----- //
528
+
529
+ // enable .ontype to trigger from .addEventListener( elem, 'type' )
530
+ utils.handleEvent = function( event ) {
531
+ var method = 'on' + event.type;
532
+ if ( this[ method ] ) {
533
+ this[ method ]( event );
534
+ }
535
+ };
536
+
537
+ // ----- filterFindElements ----- //
538
+
539
+ utils.filterFindElements = function( elems, selector ) {
540
+ // make array of elems
541
+ elems = utils.makeArray( elems );
542
+ var ffElems = [];
543
+
544
+ elems.forEach( function( elem ) {
545
+ // check that elem is an actual element
546
+ if ( !( elem instanceof HTMLElement ) ) {
547
+ return;
548
+ }
549
+ // add elem if no selector
550
+ if ( !selector ) {
551
+ ffElems.push( elem );
552
+ return;
553
+ }
554
+ // filter & find items if we have a selector
555
+ // filter
556
+ if ( matchesSelector( elem, selector ) ) {
557
+ ffElems.push( elem );
558
+ }
559
+ // find children
560
+ var childElems = elem.querySelectorAll( selector );
561
+ // concat childElems to filterFound array
562
+ for ( var i=0; i < childElems.length; i++ ) {
563
+ ffElems.push( childElems[i] );
564
+ }
565
+ });
566
+
567
+ return ffElems;
568
+ };
569
+
570
+ // ----- debounceMethod ----- //
571
+
572
+ utils.debounceMethod = function( _class, methodName, threshold ) {
573
+ threshold = threshold || 100;
574
+ // original method
575
+ var method = _class.prototype[ methodName ];
576
+ var timeoutName = methodName + 'Timeout';
577
+
578
+ _class.prototype[ methodName ] = function() {
579
+ var timeout = this[ timeoutName ];
580
+ clearTimeout( timeout );
581
+
582
+ var args = arguments;
583
+ var _this = this;
584
+ this[ timeoutName ] = setTimeout( function() {
585
+ method.apply( _this, args );
586
+ delete _this[ timeoutName ];
587
+ }, threshold );
588
+ };
589
+ };
590
+
591
+ // ----- docReady ----- //
592
+
593
+ utils.docReady = function( callback ) {
594
+ var readyState = document.readyState;
595
+ if ( readyState == 'complete' || readyState == 'interactive' ) {
596
+ // do async to allow for other scripts to run. metafizzy/flickity#441
597
+ setTimeout( callback );
598
+ } else {
599
+ document.addEventListener( 'DOMContentLoaded', callback );
600
+ }
601
+ };
602
+
603
+ // ----- htmlInit ----- //
604
+
605
+ // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
606
+ utils.toDashed = function( str ) {
607
+ return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
608
+ return $1 + '-' + $2;
609
+ }).toLowerCase();
610
+ };
611
+
612
+ var console = window.console;
613
+ /**
614
+ * allow user to initialize classes via [data-namespace] or .js-namespace class
615
+ * htmlInit( Widget, 'widgetName' )
616
+ * options are parsed from data-namespace-options
617
+ */
618
+ utils.htmlInit = function( WidgetClass, namespace ) {
619
+ utils.docReady( function() {
620
+ var dashedNamespace = utils.toDashed( namespace );
621
+ var dataAttr = 'data-' + dashedNamespace;
622
+ var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
623
+ var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
624
+ var elems = utils.makeArray( dataAttrElems )
625
+ .concat( utils.makeArray( jsDashElems ) );
626
+ var dataOptionsAttr = dataAttr + '-options';
627
+ var jQuery = window.jQuery;
628
+
629
+ elems.forEach( function( elem ) {
630
+ var attr = elem.getAttribute( dataAttr ) ||
631
+ elem.getAttribute( dataOptionsAttr );
632
+ var options;
633
+ try {
634
+ options = attr && JSON.parse( attr );
635
+ } catch ( error ) {
636
+ // log error, do not initialize
637
+ if ( console ) {
638
+ console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
639
+ ': ' + error );
640
+ }
641
+ return;
642
+ }
643
+ // initialize
644
+ var instance = new WidgetClass( elem, options );
645
+ // make available via $().data('namespace')
646
+ if ( jQuery ) {
647
+ jQuery.data( elem, namespace, instance );
648
+ }
649
+ });
650
+
651
+ });
652
+ };
653
+
654
+ // ----- ----- //
655
+
656
+ return utils;
657
+
658
+ }));
659
+ } (utils));
660
+ return utils.exports;
661
+ }
662
+
663
+ var cell = {exports: {}};
664
+
665
+ var hasRequiredCell;
666
+
667
+ function requireCell () {
668
+ if (hasRequiredCell) return cell.exports;
669
+ hasRequiredCell = 1;
670
+ (function (module) {
671
+ // Flickity.Cell
672
+ ( function( window, factory ) {
673
+ // universal module definition
674
+ if ( module.exports ) {
675
+ // CommonJS
676
+ module.exports = factory(
677
+ window,
678
+ requireGetSize()
679
+ );
680
+ } else {
681
+ // browser global
682
+ window.Flickity = window.Flickity || {};
683
+ window.Flickity.Cell = factory(
684
+ window,
685
+ window.getSize
686
+ );
687
+ }
688
+
689
+ }( window, function factory( window, getSize ) {
690
+
691
+ function Cell( elem, parent ) {
692
+ this.element = elem;
693
+ this.parent = parent;
694
+
695
+ this.create();
696
+ }
697
+
698
+ var proto = Cell.prototype;
699
+
700
+ proto.create = function() {
701
+ this.element.style.position = 'absolute';
702
+ this.element.setAttribute( 'aria-hidden', 'true' );
703
+ this.x = 0;
704
+ this.shift = 0;
705
+ this.element.style[ this.parent.originSide ] = 0;
706
+ };
707
+
708
+ proto.destroy = function() {
709
+ // reset style
710
+ this.unselect();
711
+ this.element.style.position = '';
712
+ var side = this.parent.originSide;
713
+ this.element.style[ side ] = '';
714
+ this.element.style.transform = '';
715
+ this.element.removeAttribute('aria-hidden');
716
+ };
717
+
718
+ proto.getSize = function() {
719
+ this.size = getSize( this.element );
720
+ };
721
+
722
+ proto.setPosition = function( x ) {
723
+ this.x = x;
724
+ this.updateTarget();
725
+ this.renderPosition( x );
726
+ };
727
+
728
+ // setDefaultTarget v1 method, backwards compatibility, remove in v3
729
+ proto.updateTarget = proto.setDefaultTarget = function() {
730
+ var marginProperty = this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight';
731
+ this.target = this.x + this.size[ marginProperty ] +
732
+ this.size.width * this.parent.cellAlign;
733
+ };
734
+
735
+ proto.renderPosition = function( x ) {
736
+ // render position of cell with in slider
737
+ var sideOffset = this.parent.originSide === 'left' ? 1 : -1;
738
+
739
+ var adjustedX = this.parent.options.percentPosition ?
740
+ x * sideOffset * ( this.parent.size.innerWidth / this.size.width ) :
741
+ x * sideOffset;
742
+
743
+ this.element.style.transform = 'translateX(' +
744
+ this.parent.getPositionValue( adjustedX ) + ')';
745
+ };
746
+
747
+ proto.select = function() {
748
+ this.element.classList.add('is-selected');
749
+ this.element.removeAttribute('aria-hidden');
750
+ };
751
+
752
+ proto.unselect = function() {
753
+ this.element.classList.remove('is-selected');
754
+ this.element.setAttribute( 'aria-hidden', 'true' );
755
+ };
756
+
757
+ /**
758
+ * @param {Integer} shift - 0, 1, or -1
759
+ */
760
+ proto.wrapShift = function( shift ) {
761
+ this.shift = shift;
762
+ this.renderPosition( this.x + this.parent.slideableWidth * shift );
763
+ };
764
+
765
+ proto.remove = function() {
766
+ this.element.parentNode.removeChild( this.element );
767
+ };
768
+
769
+ return Cell;
770
+
771
+ } ) );
772
+ } (cell));
773
+ return cell.exports;
774
+ }
775
+
776
+ var slide = {exports: {}};
777
+
778
+ var hasRequiredSlide;
779
+
780
+ function requireSlide () {
781
+ if (hasRequiredSlide) return slide.exports;
782
+ hasRequiredSlide = 1;
783
+ (function (module) {
784
+ // slide
785
+ ( function( window, factory ) {
786
+ // universal module definition
787
+ if ( module.exports ) {
788
+ // CommonJS
789
+ module.exports = factory();
790
+ } else {
791
+ // browser global
792
+ window.Flickity = window.Flickity || {};
793
+ window.Flickity.Slide = factory();
794
+ }
795
+
796
+ }( window, function factory() {
797
+
798
+ function Slide( parent ) {
799
+ this.parent = parent;
800
+ this.isOriginLeft = parent.originSide == 'left';
801
+ this.cells = [];
802
+ this.outerWidth = 0;
803
+ this.height = 0;
804
+ }
805
+
806
+ var proto = Slide.prototype;
807
+
808
+ proto.addCell = function( cell ) {
809
+ this.cells.push( cell );
810
+ this.outerWidth += cell.size.outerWidth;
811
+ this.height = Math.max( cell.size.outerHeight, this.height );
812
+ // first cell stuff
813
+ if ( this.cells.length == 1 ) {
814
+ this.x = cell.x; // x comes from first cell
815
+ var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight';
816
+ this.firstMargin = cell.size[ beginMargin ];
817
+ }
818
+ };
819
+
820
+ proto.updateTarget = function() {
821
+ var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft';
822
+ var lastCell = this.getLastCell();
823
+ var lastMargin = lastCell ? lastCell.size[ endMargin ] : 0;
824
+ var slideWidth = this.outerWidth - ( this.firstMargin + lastMargin );
825
+ this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign;
826
+ };
827
+
828
+ proto.getLastCell = function() {
829
+ return this.cells[ this.cells.length - 1 ];
830
+ };
831
+
832
+ proto.select = function() {
833
+ this.cells.forEach( function( cell ) {
834
+ cell.select();
835
+ } );
836
+ };
837
+
838
+ proto.unselect = function() {
839
+ this.cells.forEach( function( cell ) {
840
+ cell.unselect();
841
+ } );
842
+ };
843
+
844
+ proto.getCellElements = function() {
845
+ return this.cells.map( function( cell ) {
846
+ return cell.element;
847
+ } );
848
+ };
849
+
850
+ return Slide;
851
+
852
+ } ) );
853
+ } (slide));
854
+ return slide.exports;
855
+ }
856
+
857
+ var animate = {exports: {}};
858
+
859
+ var hasRequiredAnimate;
860
+
861
+ function requireAnimate () {
862
+ if (hasRequiredAnimate) return animate.exports;
863
+ hasRequiredAnimate = 1;
864
+ (function (module) {
865
+ // animate
866
+ ( function( window, factory ) {
867
+ // universal module definition
868
+ if ( module.exports ) {
869
+ // CommonJS
870
+ module.exports = factory(
871
+ window,
872
+ requireUtils()
873
+ );
874
+ } else {
875
+ // browser global
876
+ window.Flickity = window.Flickity || {};
877
+ window.Flickity.animatePrototype = factory(
878
+ window,
879
+ window.fizzyUIUtils
880
+ );
881
+ }
882
+
883
+ }( window, function factory( window, utils ) {
884
+
885
+ // -------------------------- animate -------------------------- //
886
+
887
+ var proto = {};
888
+
889
+ proto.startAnimation = function() {
890
+ if ( this.isAnimating ) {
891
+ return;
892
+ }
893
+
894
+ this.isAnimating = true;
895
+ this.restingFrames = 0;
896
+ this.animate();
897
+ };
898
+
899
+ proto.animate = function() {
900
+ this.applyDragForce();
901
+ this.applySelectedAttraction();
902
+
903
+ var previousX = this.x;
904
+
905
+ this.integratePhysics();
906
+ this.positionSlider();
907
+ this.settle( previousX );
908
+ // animate next frame
909
+ if ( this.isAnimating ) {
910
+ var _this = this;
911
+ requestAnimationFrame( function animateFrame() {
912
+ _this.animate();
913
+ } );
914
+ }
915
+ };
916
+
917
+ proto.positionSlider = function() {
918
+ var x = this.x;
919
+ // wrap position around
920
+ if ( this.options.wrapAround && this.cells.length > 1 ) {
921
+ x = utils.modulo( x, this.slideableWidth );
922
+ x -= this.slideableWidth;
923
+ this.shiftWrapCells( x );
924
+ }
925
+
926
+ this.setTranslateX( x, this.isAnimating );
927
+ this.dispatchScrollEvent();
928
+ };
929
+
930
+ proto.setTranslateX = function( x, is3d ) {
931
+ x += this.cursorPosition;
932
+ // reverse if right-to-left and using transform
933
+ x = this.options.rightToLeft ? -x : x;
934
+ var translateX = this.getPositionValue( x );
935
+ // use 3D transforms for hardware acceleration on iOS
936
+ // but use 2D when settled, for better font-rendering
937
+ this.slider.style.transform = is3d ?
938
+ 'translate3d(' + translateX + ',0,0)' : 'translateX(' + translateX + ')';
939
+ };
940
+
941
+ proto.dispatchScrollEvent = function() {
942
+ var firstSlide = this.slides[0];
943
+ if ( !firstSlide ) {
944
+ return;
945
+ }
946
+ var positionX = -this.x - firstSlide.target;
947
+ var progress = positionX / this.slidesWidth;
948
+ this.dispatchEvent( 'scroll', null, [ progress, positionX ] );
949
+ };
950
+
951
+ proto.positionSliderAtSelected = function() {
952
+ if ( !this.cells.length ) {
953
+ return;
954
+ }
955
+ this.x = -this.selectedSlide.target;
956
+ this.velocity = 0; // stop wobble
957
+ this.positionSlider();
958
+ };
959
+
960
+ proto.getPositionValue = function( position ) {
961
+ if ( this.options.percentPosition ) {
962
+ // percent position, round to 2 digits, like 12.34%
963
+ return ( Math.round( ( position / this.size.innerWidth ) * 10000 ) * 0.01 ) + '%';
964
+ } else {
965
+ // pixel positioning
966
+ return Math.round( position ) + 'px';
967
+ }
968
+ };
969
+
970
+ proto.settle = function( previousX ) {
971
+ // keep track of frames where x hasn't moved
972
+ var isResting = !this.isPointerDown &&
973
+ Math.round( this.x * 100 ) == Math.round( previousX * 100 );
974
+ if ( isResting ) {
975
+ this.restingFrames++;
976
+ }
977
+ // stop animating if resting for 3 or more frames
978
+ if ( this.restingFrames > 2 ) {
979
+ this.isAnimating = false;
980
+ delete this.isFreeScrolling;
981
+ // render position with translateX when settled
982
+ this.positionSlider();
983
+ this.dispatchEvent( 'settle', null, [ this.selectedIndex ] );
984
+ }
985
+ };
986
+
987
+ proto.shiftWrapCells = function( x ) {
988
+ // shift before cells
989
+ var beforeGap = this.cursorPosition + x;
990
+ this._shiftCells( this.beforeShiftCells, beforeGap, -1 );
991
+ // shift after cells
992
+ var afterGap = this.size.innerWidth - ( x + this.slideableWidth + this.cursorPosition );
993
+ this._shiftCells( this.afterShiftCells, afterGap, 1 );
994
+ };
995
+
996
+ proto._shiftCells = function( cells, gap, shift ) {
997
+ for ( var i = 0; i < cells.length; i++ ) {
998
+ var cell = cells[i];
999
+ var cellShift = gap > 0 ? shift : 0;
1000
+ cell.wrapShift( cellShift );
1001
+ gap -= cell.size.outerWidth;
1002
+ }
1003
+ };
1004
+
1005
+ proto._unshiftCells = function( cells ) {
1006
+ if ( !cells || !cells.length ) {
1007
+ return;
1008
+ }
1009
+ for ( var i = 0; i < cells.length; i++ ) {
1010
+ cells[i].wrapShift( 0 );
1011
+ }
1012
+ };
1013
+
1014
+ // -------------------------- physics -------------------------- //
1015
+
1016
+ proto.integratePhysics = function() {
1017
+ this.x += this.velocity;
1018
+ this.velocity *= this.getFrictionFactor();
1019
+ };
1020
+
1021
+ proto.applyForce = function( force ) {
1022
+ this.velocity += force;
1023
+ };
1024
+
1025
+ proto.getFrictionFactor = function() {
1026
+ return 1 - this.options[ this.isFreeScrolling ? 'freeScrollFriction' : 'friction' ];
1027
+ };
1028
+
1029
+ proto.getRestingPosition = function() {
1030
+ // my thanks to Steven Wittens, who simplified this math greatly
1031
+ return this.x + this.velocity / ( 1 - this.getFrictionFactor() );
1032
+ };
1033
+
1034
+ proto.applyDragForce = function() {
1035
+ if ( !this.isDraggable || !this.isPointerDown ) {
1036
+ return;
1037
+ }
1038
+ // change the position to drag position by applying force
1039
+ var dragVelocity = this.dragX - this.x;
1040
+ var dragForce = dragVelocity - this.velocity;
1041
+ this.applyForce( dragForce );
1042
+ };
1043
+
1044
+ proto.applySelectedAttraction = function() {
1045
+ // do not attract if pointer down or no slides
1046
+ var dragDown = this.isDraggable && this.isPointerDown;
1047
+ if ( dragDown || this.isFreeScrolling || !this.slides.length ) {
1048
+ return;
1049
+ }
1050
+ var distance = this.selectedSlide.target * -1 - this.x;
1051
+ var force = distance * this.options.selectedAttraction;
1052
+ this.applyForce( force );
1053
+ };
1054
+
1055
+ return proto;
1056
+
1057
+ } ) );
1058
+ } (animate));
1059
+ return animate.exports;
1060
+ }
1061
+
1062
+ var hasRequiredFlickity;
1063
+
1064
+ function requireFlickity () {
1065
+ if (hasRequiredFlickity) return flickity.exports;
1066
+ hasRequiredFlickity = 1;
1067
+ (function (module) {
1068
+ // Flickity main
1069
+ /* eslint-disable max-params */
1070
+ ( function( window, factory ) {
1071
+ // universal module definition
1072
+ if ( module.exports ) {
1073
+ // CommonJS
1074
+ module.exports = factory(
1075
+ window,
1076
+ requireEvEmitter(),
1077
+ requireGetSize(),
1078
+ requireUtils(),
1079
+ requireCell(),
1080
+ requireSlide(),
1081
+ requireAnimate()
1082
+ );
1083
+ } else {
1084
+ // browser global
1085
+ var _Flickity = window.Flickity;
1086
+
1087
+ window.Flickity = factory(
1088
+ window,
1089
+ window.EvEmitter,
1090
+ window.getSize,
1091
+ window.fizzyUIUtils,
1092
+ _Flickity.Cell,
1093
+ _Flickity.Slide,
1094
+ _Flickity.animatePrototype
1095
+ );
1096
+ }
1097
+
1098
+ }( window, function factory( window, EvEmitter, getSize,
1099
+ utils, Cell, Slide, animatePrototype ) {
1100
+
1101
+ // vars
1102
+ var jQuery = window.jQuery;
1103
+ var getComputedStyle = window.getComputedStyle;
1104
+ var console = window.console;
1105
+
1106
+ function moveElements( elems, toElem ) {
1107
+ elems = utils.makeArray( elems );
1108
+ while ( elems.length ) {
1109
+ toElem.appendChild( elems.shift() );
1110
+ }
1111
+ }
1112
+
1113
+ // -------------------------- Flickity -------------------------- //
1114
+
1115
+ // globally unique identifiers
1116
+ var GUID = 0;
1117
+ // internal store of all Flickity intances
1118
+ var instances = {};
1119
+
1120
+ function Flickity( element, options ) {
1121
+ var queryElement = utils.getQueryElement( element );
1122
+ if ( !queryElement ) {
1123
+ if ( console ) {
1124
+ console.error( 'Bad element for Flickity: ' + ( queryElement || element ) );
1125
+ }
1126
+ return;
1127
+ }
1128
+ this.element = queryElement;
1129
+ // do not initialize twice on same element
1130
+ if ( this.element.flickityGUID ) {
1131
+ var instance = instances[ this.element.flickityGUID ];
1132
+ if ( instance ) instance.option( options );
1133
+ return instance;
1134
+ }
1135
+
1136
+ // add jQuery
1137
+ if ( jQuery ) {
1138
+ this.$element = jQuery( this.element );
1139
+ }
1140
+ // options
1141
+ this.options = utils.extend( {}, this.constructor.defaults );
1142
+ this.option( options );
1143
+
1144
+ // kick things off
1145
+ this._create();
1146
+ }
1147
+
1148
+ Flickity.defaults = {
1149
+ accessibility: true,
1150
+ // adaptiveHeight: false,
1151
+ cellAlign: 'center',
1152
+ // cellSelector: undefined,
1153
+ // contain: false,
1154
+ freeScrollFriction: 0.075, // friction when free-scrolling
1155
+ friction: 0.28, // friction when selecting
1156
+ namespaceJQueryEvents: true,
1157
+ // initialIndex: 0,
1158
+ percentPosition: true,
1159
+ resize: true,
1160
+ selectedAttraction: 0.025,
1161
+ setGallerySize: true,
1162
+ // watchCSS: false,
1163
+ // wrapAround: false
1164
+ };
1165
+
1166
+ // hash of methods triggered on _create()
1167
+ Flickity.createMethods = [];
1168
+
1169
+ var proto = Flickity.prototype;
1170
+ // inherit EventEmitter
1171
+ utils.extend( proto, EvEmitter.prototype );
1172
+
1173
+ proto._create = function() {
1174
+ // add id for Flickity.data
1175
+ var id = this.guid = ++GUID;
1176
+ this.element.flickityGUID = id; // expando
1177
+ instances[ id ] = this; // associate via id
1178
+ // initial properties
1179
+ this.selectedIndex = 0;
1180
+ // how many frames slider has been in same position
1181
+ this.restingFrames = 0;
1182
+ // initial physics properties
1183
+ this.x = 0;
1184
+ this.velocity = 0;
1185
+ this.originSide = this.options.rightToLeft ? 'right' : 'left';
1186
+ // create viewport & slider
1187
+ this.viewport = document.createElement('div');
1188
+ this.viewport.className = 'flickity-viewport';
1189
+ this._createSlider();
1190
+
1191
+ if ( this.options.resize || this.options.watchCSS ) {
1192
+ window.addEventListener( 'resize', this );
1193
+ }
1194
+
1195
+ // add listeners from on option
1196
+ for ( var eventName in this.options.on ) {
1197
+ var listener = this.options.on[ eventName ];
1198
+ this.on( eventName, listener );
1199
+ }
1200
+
1201
+ Flickity.createMethods.forEach( function( method ) {
1202
+ this[ method ]();
1203
+ }, this );
1204
+
1205
+ if ( this.options.watchCSS ) {
1206
+ this.watchCSS();
1207
+ } else {
1208
+ this.activate();
1209
+ }
1210
+
1211
+ };
1212
+
1213
+ /**
1214
+ * set options
1215
+ * @param {Object} opts - options to extend
1216
+ */
1217
+ proto.option = function( opts ) {
1218
+ utils.extend( this.options, opts );
1219
+ };
1220
+
1221
+ proto.activate = function() {
1222
+ if ( this.isActive ) {
1223
+ return;
1224
+ }
1225
+ this.isActive = true;
1226
+ this.element.classList.add('flickity-enabled');
1227
+ if ( this.options.rightToLeft ) {
1228
+ this.element.classList.add('flickity-rtl');
1229
+ }
1230
+
1231
+ this.getSize();
1232
+ // move initial cell elements so they can be loaded as cells
1233
+ var cellElems = this._filterFindCellElements( this.element.children );
1234
+ moveElements( cellElems, this.slider );
1235
+ this.viewport.appendChild( this.slider );
1236
+ this.element.appendChild( this.viewport );
1237
+ // get cells from children
1238
+ this.reloadCells();
1239
+
1240
+ if ( this.options.accessibility ) {
1241
+ // allow element to focusable
1242
+ this.element.tabIndex = 0;
1243
+ // listen for key presses
1244
+ this.element.addEventListener( 'keydown', this );
1245
+ }
1246
+
1247
+ this.emitEvent('activate');
1248
+ this.selectInitialIndex();
1249
+ // flag for initial activation, for using initialIndex
1250
+ this.isInitActivated = true;
1251
+ // ready event. #493
1252
+ this.dispatchEvent('ready');
1253
+ };
1254
+
1255
+ // slider positions the cells
1256
+ proto._createSlider = function() {
1257
+ // slider element does all the positioning
1258
+ var slider = document.createElement('div');
1259
+ slider.className = 'flickity-slider';
1260
+ slider.style[ this.originSide ] = 0;
1261
+ this.slider = slider;
1262
+ };
1263
+
1264
+ proto._filterFindCellElements = function( elems ) {
1265
+ return utils.filterFindElements( elems, this.options.cellSelector );
1266
+ };
1267
+
1268
+ // goes through all children
1269
+ proto.reloadCells = function() {
1270
+ // collection of item elements
1271
+ this.cells = this._makeCells( this.slider.children );
1272
+ this.positionCells();
1273
+ this._getWrapShiftCells();
1274
+ this.setGallerySize();
1275
+ };
1276
+
1277
+ /**
1278
+ * turn elements into Flickity.Cells
1279
+ * @param {[Array, NodeList, HTMLElement]} elems - elements to make into cells
1280
+ * @returns {Array} items - collection of new Flickity Cells
1281
+ */
1282
+ proto._makeCells = function( elems ) {
1283
+ var cellElems = this._filterFindCellElements( elems );
1284
+
1285
+ // create new Flickity for collection
1286
+ var cells = cellElems.map( function( cellElem ) {
1287
+ return new Cell( cellElem, this );
1288
+ }, this );
1289
+
1290
+ return cells;
1291
+ };
1292
+
1293
+ proto.getLastCell = function() {
1294
+ return this.cells[ this.cells.length - 1 ];
1295
+ };
1296
+
1297
+ proto.getLastSlide = function() {
1298
+ return this.slides[ this.slides.length - 1 ];
1299
+ };
1300
+
1301
+ // positions all cells
1302
+ proto.positionCells = function() {
1303
+ // size all cells
1304
+ this._sizeCells( this.cells );
1305
+ // position all cells
1306
+ this._positionCells( 0 );
1307
+ };
1308
+
1309
+ /**
1310
+ * position certain cells
1311
+ * @param {Integer} index - which cell to start with
1312
+ */
1313
+ proto._positionCells = function( index ) {
1314
+ index = index || 0;
1315
+ // also measure maxCellHeight
1316
+ // start 0 if positioning all cells
1317
+ this.maxCellHeight = index ? this.maxCellHeight || 0 : 0;
1318
+ var cellX = 0;
1319
+ // get cellX
1320
+ if ( index > 0 ) {
1321
+ var startCell = this.cells[ index - 1 ];
1322
+ cellX = startCell.x + startCell.size.outerWidth;
1323
+ }
1324
+ var len = this.cells.length;
1325
+ for ( var i = index; i < len; i++ ) {
1326
+ var cell = this.cells[i];
1327
+ cell.setPosition( cellX );
1328
+ cellX += cell.size.outerWidth;
1329
+ this.maxCellHeight = Math.max( cell.size.outerHeight, this.maxCellHeight );
1330
+ }
1331
+ // keep track of cellX for wrap-around
1332
+ this.slideableWidth = cellX;
1333
+ // slides
1334
+ this.updateSlides();
1335
+ // contain slides target
1336
+ this._containSlides();
1337
+ // update slidesWidth
1338
+ this.slidesWidth = len ? this.getLastSlide().target - this.slides[0].target : 0;
1339
+ };
1340
+
1341
+ /**
1342
+ * cell.getSize() on multiple cells
1343
+ * @param {Array} cells - cells to size
1344
+ */
1345
+ proto._sizeCells = function( cells ) {
1346
+ cells.forEach( function( cell ) {
1347
+ cell.getSize();
1348
+ } );
1349
+ };
1350
+
1351
+ // -------------------------- -------------------------- //
1352
+
1353
+ proto.updateSlides = function() {
1354
+ this.slides = [];
1355
+ if ( !this.cells.length ) {
1356
+ return;
1357
+ }
1358
+
1359
+ var slide = new Slide( this );
1360
+ this.slides.push( slide );
1361
+ var isOriginLeft = this.originSide == 'left';
1362
+ var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft';
1363
+
1364
+ var canCellFit = this._getCanCellFit();
1365
+
1366
+ this.cells.forEach( function( cell, i ) {
1367
+ // just add cell if first cell in slide
1368
+ if ( !slide.cells.length ) {
1369
+ slide.addCell( cell );
1370
+ return;
1371
+ }
1372
+
1373
+ var slideWidth = ( slide.outerWidth - slide.firstMargin ) +
1374
+ ( cell.size.outerWidth - cell.size[ nextMargin ] );
1375
+
1376
+ if ( canCellFit.call( this, i, slideWidth ) ) {
1377
+ slide.addCell( cell );
1378
+ } else {
1379
+ // doesn't fit, new slide
1380
+ slide.updateTarget();
1381
+
1382
+ slide = new Slide( this );
1383
+ this.slides.push( slide );
1384
+ slide.addCell( cell );
1385
+ }
1386
+ }, this );
1387
+ // last slide
1388
+ slide.updateTarget();
1389
+ // update .selectedSlide
1390
+ this.updateSelectedSlide();
1391
+ };
1392
+
1393
+ proto._getCanCellFit = function() {
1394
+ var groupCells = this.options.groupCells;
1395
+ if ( !groupCells ) {
1396
+ return function() {
1397
+ return false;
1398
+ };
1399
+ } else if ( typeof groupCells == 'number' ) {
1400
+ // group by number. 3 -> [0,1,2], [3,4,5], ...
1401
+ var number = parseInt( groupCells, 10 );
1402
+ return function( i ) {
1403
+ return ( i % number ) !== 0;
1404
+ };
1405
+ }
1406
+ // default, group by width of slide
1407
+ // parse '75%
1408
+ var percentMatch = typeof groupCells == 'string' &&
1409
+ groupCells.match( /^(\d+)%$/ );
1410
+ var percent = percentMatch ? parseInt( percentMatch[1], 10 ) / 100 : 1;
1411
+ return function( i, slideWidth ) {
1412
+ /* eslint-disable-next-line no-invalid-this */
1413
+ return slideWidth <= ( this.size.innerWidth + 1 ) * percent;
1414
+ };
1415
+ };
1416
+
1417
+ // alias _init for jQuery plugin .flickity()
1418
+ proto._init =
1419
+ proto.reposition = function() {
1420
+ this.positionCells();
1421
+ this.positionSliderAtSelected();
1422
+ };
1423
+
1424
+ proto.getSize = function() {
1425
+ this.size = getSize( this.element );
1426
+ this.setCellAlign();
1427
+ this.cursorPosition = this.size.innerWidth * this.cellAlign;
1428
+ };
1429
+
1430
+ var cellAlignShorthands = {
1431
+ // cell align, then based on origin side
1432
+ center: {
1433
+ left: 0.5,
1434
+ right: 0.5,
1435
+ },
1436
+ left: {
1437
+ left: 0,
1438
+ right: 1,
1439
+ },
1440
+ right: {
1441
+ right: 0,
1442
+ left: 1,
1443
+ },
1444
+ };
1445
+
1446
+ proto.setCellAlign = function() {
1447
+ var shorthand = cellAlignShorthands[ this.options.cellAlign ];
1448
+ this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign;
1449
+ };
1450
+
1451
+ proto.setGallerySize = function() {
1452
+ if ( this.options.setGallerySize ) {
1453
+ var height = this.options.adaptiveHeight && this.selectedSlide ?
1454
+ this.selectedSlide.height : this.maxCellHeight;
1455
+ this.viewport.style.height = height + 'px';
1456
+ }
1457
+ };
1458
+
1459
+ proto._getWrapShiftCells = function() {
1460
+ // only for wrap-around
1461
+ if ( !this.options.wrapAround ) {
1462
+ return;
1463
+ }
1464
+ // unshift previous cells
1465
+ this._unshiftCells( this.beforeShiftCells );
1466
+ this._unshiftCells( this.afterShiftCells );
1467
+ // get before cells
1468
+ // initial gap
1469
+ var gapX = this.cursorPosition;
1470
+ var cellIndex = this.cells.length - 1;
1471
+ this.beforeShiftCells = this._getGapCells( gapX, cellIndex, -1 );
1472
+ // get after cells
1473
+ // ending gap between last cell and end of gallery viewport
1474
+ gapX = this.size.innerWidth - this.cursorPosition;
1475
+ // start cloning at first cell, working forwards
1476
+ this.afterShiftCells = this._getGapCells( gapX, 0, 1 );
1477
+ };
1478
+
1479
+ proto._getGapCells = function( gapX, cellIndex, increment ) {
1480
+ // keep adding cells until the cover the initial gap
1481
+ var cells = [];
1482
+ while ( gapX > 0 ) {
1483
+ var cell = this.cells[ cellIndex ];
1484
+ if ( !cell ) {
1485
+ break;
1486
+ }
1487
+ cells.push( cell );
1488
+ cellIndex += increment;
1489
+ gapX -= cell.size.outerWidth;
1490
+ }
1491
+ return cells;
1492
+ };
1493
+
1494
+ // ----- contain ----- //
1495
+
1496
+ // contain cell targets so no excess sliding
1497
+ proto._containSlides = function() {
1498
+ if ( !this.options.contain || this.options.wrapAround || !this.cells.length ) {
1499
+ return;
1500
+ }
1501
+ var isRightToLeft = this.options.rightToLeft;
1502
+ var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft';
1503
+ var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight';
1504
+ var contentWidth = this.slideableWidth - this.getLastCell().size[ endMargin ];
1505
+ // content is less than gallery size
1506
+ var isContentSmaller = contentWidth < this.size.innerWidth;
1507
+ // bounds
1508
+ var beginBound = this.cursorPosition + this.cells[0].size[ beginMargin ];
1509
+ var endBound = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign );
1510
+ // contain each cell target
1511
+ this.slides.forEach( function( slide ) {
1512
+ if ( isContentSmaller ) {
1513
+ // all cells fit inside gallery
1514
+ slide.target = contentWidth * this.cellAlign;
1515
+ } else {
1516
+ // contain to bounds
1517
+ slide.target = Math.max( slide.target, beginBound );
1518
+ slide.target = Math.min( slide.target, endBound );
1519
+ }
1520
+ }, this );
1521
+ };
1522
+
1523
+ // ----- ----- //
1524
+
1525
+ /**
1526
+ * emits events via eventEmitter and jQuery events
1527
+ * @param {String} type - name of event
1528
+ * @param {Event} event - original event
1529
+ * @param {Array} args - extra arguments
1530
+ */
1531
+ proto.dispatchEvent = function( type, event, args ) {
1532
+ var emitArgs = event ? [ event ].concat( args ) : args;
1533
+ this.emitEvent( type, emitArgs );
1534
+
1535
+ if ( jQuery && this.$element ) {
1536
+ // default trigger with type if no event
1537
+ type += this.options.namespaceJQueryEvents ? '.flickity' : '';
1538
+ var $event = type;
1539
+ if ( event ) {
1540
+ // create jQuery event
1541
+ var jQEvent = new jQuery.Event( event );
1542
+ jQEvent.type = type;
1543
+ $event = jQEvent;
1544
+ }
1545
+ this.$element.trigger( $event, args );
1546
+ }
1547
+ };
1548
+
1549
+ // -------------------------- select -------------------------- //
1550
+
1551
+ /**
1552
+ * @param {Integer} index - index of the slide
1553
+ * @param {Boolean} isWrap - will wrap-around to last/first if at the end
1554
+ * @param {Boolean} isInstant - will immediately set position at selected cell
1555
+ */
1556
+ proto.select = function( index, isWrap, isInstant ) {
1557
+ if ( !this.isActive ) {
1558
+ return;
1559
+ }
1560
+ index = parseInt( index, 10 );
1561
+ this._wrapSelect( index );
1562
+
1563
+ if ( this.options.wrapAround || isWrap ) {
1564
+ index = utils.modulo( index, this.slides.length );
1565
+ }
1566
+ // bail if invalid index
1567
+ if ( !this.slides[ index ] ) {
1568
+ return;
1569
+ }
1570
+ var prevIndex = this.selectedIndex;
1571
+ this.selectedIndex = index;
1572
+ this.updateSelectedSlide();
1573
+ if ( isInstant ) {
1574
+ this.positionSliderAtSelected();
1575
+ } else {
1576
+ this.startAnimation();
1577
+ }
1578
+ if ( this.options.adaptiveHeight ) {
1579
+ this.setGallerySize();
1580
+ }
1581
+ // events
1582
+ this.dispatchEvent( 'select', null, [ index ] );
1583
+ // change event if new index
1584
+ if ( index != prevIndex ) {
1585
+ this.dispatchEvent( 'change', null, [ index ] );
1586
+ }
1587
+ // old v1 event name, remove in v3
1588
+ this.dispatchEvent('cellSelect');
1589
+ };
1590
+
1591
+ // wraps position for wrapAround, to move to closest slide. #113
1592
+ proto._wrapSelect = function( index ) {
1593
+ var len = this.slides.length;
1594
+ var isWrapping = this.options.wrapAround && len > 1;
1595
+ if ( !isWrapping ) {
1596
+ return index;
1597
+ }
1598
+ var wrapIndex = utils.modulo( index, len );
1599
+ // go to shortest
1600
+ var delta = Math.abs( wrapIndex - this.selectedIndex );
1601
+ var backWrapDelta = Math.abs( ( wrapIndex + len ) - this.selectedIndex );
1602
+ var forewardWrapDelta = Math.abs( ( wrapIndex - len ) - this.selectedIndex );
1603
+ if ( !this.isDragSelect && backWrapDelta < delta ) {
1604
+ index += len;
1605
+ } else if ( !this.isDragSelect && forewardWrapDelta < delta ) {
1606
+ index -= len;
1607
+ }
1608
+ // wrap position so slider is within normal area
1609
+ if ( index < 0 ) {
1610
+ this.x -= this.slideableWidth;
1611
+ } else if ( index >= len ) {
1612
+ this.x += this.slideableWidth;
1613
+ }
1614
+ };
1615
+
1616
+ proto.previous = function( isWrap, isInstant ) {
1617
+ this.select( this.selectedIndex - 1, isWrap, isInstant );
1618
+ };
1619
+
1620
+ proto.next = function( isWrap, isInstant ) {
1621
+ this.select( this.selectedIndex + 1, isWrap, isInstant );
1622
+ };
1623
+
1624
+ proto.updateSelectedSlide = function() {
1625
+ var slide = this.slides[ this.selectedIndex ];
1626
+ // selectedIndex could be outside of slides, if triggered before resize()
1627
+ if ( !slide ) {
1628
+ return;
1629
+ }
1630
+ // unselect previous selected slide
1631
+ this.unselectSelectedSlide();
1632
+ // update new selected slide
1633
+ this.selectedSlide = slide;
1634
+ slide.select();
1635
+ this.selectedCells = slide.cells;
1636
+ this.selectedElements = slide.getCellElements();
1637
+ // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility
1638
+ // Remove in v3?
1639
+ this.selectedCell = slide.cells[0];
1640
+ this.selectedElement = this.selectedElements[0];
1641
+ };
1642
+
1643
+ proto.unselectSelectedSlide = function() {
1644
+ if ( this.selectedSlide ) {
1645
+ this.selectedSlide.unselect();
1646
+ }
1647
+ };
1648
+
1649
+ proto.selectInitialIndex = function() {
1650
+ var initialIndex = this.options.initialIndex;
1651
+ // already activated, select previous selectedIndex
1652
+ if ( this.isInitActivated ) {
1653
+ this.select( this.selectedIndex, false, true );
1654
+ return;
1655
+ }
1656
+ // select with selector string
1657
+ if ( initialIndex && typeof initialIndex == 'string' ) {
1658
+ var cell = this.queryCell( initialIndex );
1659
+ if ( cell ) {
1660
+ this.selectCell( initialIndex, false, true );
1661
+ return;
1662
+ }
1663
+ }
1664
+
1665
+ var index = 0;
1666
+ // select with number
1667
+ if ( initialIndex && this.slides[ initialIndex ] ) {
1668
+ index = initialIndex;
1669
+ }
1670
+ // select instantly
1671
+ this.select( index, false, true );
1672
+ };
1673
+
1674
+ /**
1675
+ * select slide from number or cell element
1676
+ * @param {[Element, Number]} value - zero-based index or element to select
1677
+ * @param {Boolean} isWrap - enables wrapping around for extra index
1678
+ * @param {Boolean} isInstant - disables slide animation
1679
+ */
1680
+ proto.selectCell = function( value, isWrap, isInstant ) {
1681
+ // get cell
1682
+ var cell = this.queryCell( value );
1683
+ if ( !cell ) {
1684
+ return;
1685
+ }
1686
+
1687
+ var index = this.getCellSlideIndex( cell );
1688
+ this.select( index, isWrap, isInstant );
1689
+ };
1690
+
1691
+ proto.getCellSlideIndex = function( cell ) {
1692
+ // get index of slides that has cell
1693
+ for ( var i = 0; i < this.slides.length; i++ ) {
1694
+ var slide = this.slides[i];
1695
+ var index = slide.cells.indexOf( cell );
1696
+ if ( index != -1 ) {
1697
+ return i;
1698
+ }
1699
+ }
1700
+ };
1701
+
1702
+ // -------------------------- get cells -------------------------- //
1703
+
1704
+ /**
1705
+ * get Flickity.Cell, given an Element
1706
+ * @param {Element} elem - matching cell element
1707
+ * @returns {Flickity.Cell} cell - matching cell
1708
+ */
1709
+ proto.getCell = function( elem ) {
1710
+ // loop through cells to get the one that matches
1711
+ for ( var i = 0; i < this.cells.length; i++ ) {
1712
+ var cell = this.cells[i];
1713
+ if ( cell.element == elem ) {
1714
+ return cell;
1715
+ }
1716
+ }
1717
+ };
1718
+
1719
+ /**
1720
+ * get collection of Flickity.Cells, given Elements
1721
+ * @param {[Element, Array, NodeList]} elems - multiple elements
1722
+ * @returns {Array} cells - Flickity.Cells
1723
+ */
1724
+ proto.getCells = function( elems ) {
1725
+ elems = utils.makeArray( elems );
1726
+ var cells = [];
1727
+ elems.forEach( function( elem ) {
1728
+ var cell = this.getCell( elem );
1729
+ if ( cell ) {
1730
+ cells.push( cell );
1731
+ }
1732
+ }, this );
1733
+ return cells;
1734
+ };
1735
+
1736
+ /**
1737
+ * get cell elements
1738
+ * @returns {Array} cellElems
1739
+ */
1740
+ proto.getCellElements = function() {
1741
+ return this.cells.map( function( cell ) {
1742
+ return cell.element;
1743
+ } );
1744
+ };
1745
+
1746
+ /**
1747
+ * get parent cell from an element
1748
+ * @param {Element} elem - child element
1749
+ * @returns {Flickit.Cell} cell - parent cell
1750
+ */
1751
+ proto.getParentCell = function( elem ) {
1752
+ // first check if elem is cell
1753
+ var cell = this.getCell( elem );
1754
+ if ( cell ) {
1755
+ return cell;
1756
+ }
1757
+ // try to get parent cell elem
1758
+ elem = utils.getParent( elem, '.flickity-slider > *' );
1759
+ return this.getCell( elem );
1760
+ };
1761
+
1762
+ /**
1763
+ * get cells adjacent to a slide
1764
+ * @param {Integer} adjCount - number of adjacent slides
1765
+ * @param {Integer} index - index of slide to start
1766
+ * @returns {Array} cells - array of Flickity.Cells
1767
+ */
1768
+ proto.getAdjacentCellElements = function( adjCount, index ) {
1769
+ if ( !adjCount ) {
1770
+ return this.selectedSlide.getCellElements();
1771
+ }
1772
+ index = index === undefined ? this.selectedIndex : index;
1773
+
1774
+ var len = this.slides.length;
1775
+ if ( 1 + ( adjCount * 2 ) >= len ) {
1776
+ return this.getCellElements();
1777
+ }
1778
+
1779
+ var cellElems = [];
1780
+ for ( var i = index - adjCount; i <= index + adjCount; i++ ) {
1781
+ var slideIndex = this.options.wrapAround ? utils.modulo( i, len ) : i;
1782
+ var slide = this.slides[ slideIndex ];
1783
+ if ( slide ) {
1784
+ cellElems = cellElems.concat( slide.getCellElements() );
1785
+ }
1786
+ }
1787
+ return cellElems;
1788
+ };
1789
+
1790
+ /**
1791
+ * select slide from number or cell element
1792
+ * @param {[Element, String, Number]} selector - element, selector string, or index
1793
+ * @returns {Flickity.Cell} - matching cell
1794
+ */
1795
+ proto.queryCell = function( selector ) {
1796
+ if ( typeof selector == 'number' ) {
1797
+ // use number as index
1798
+ return this.cells[ selector ];
1799
+ }
1800
+ if ( typeof selector == 'string' ) {
1801
+ // do not select invalid selectors from hash: #123, #/. #791
1802
+ if ( selector.match( /^[#.]?[\d/]/ ) ) {
1803
+ return;
1804
+ }
1805
+ // use string as selector, get element
1806
+ selector = this.element.querySelector( selector );
1807
+ }
1808
+ // get cell from element
1809
+ return this.getCell( selector );
1810
+ };
1811
+
1812
+ // -------------------------- events -------------------------- //
1813
+
1814
+ proto.uiChange = function() {
1815
+ this.emitEvent('uiChange');
1816
+ };
1817
+
1818
+ // keep focus on element when child UI elements are clicked
1819
+ proto.childUIPointerDown = function( event ) {
1820
+ // HACK iOS does not allow touch events to bubble up?!
1821
+ if ( event.type != 'touchstart' ) {
1822
+ event.preventDefault();
1823
+ }
1824
+ this.focus();
1825
+ };
1826
+
1827
+ // ----- resize ----- //
1828
+
1829
+ proto.onresize = function() {
1830
+ this.watchCSS();
1831
+ this.resize();
1832
+ };
1833
+
1834
+ utils.debounceMethod( Flickity, 'onresize', 150 );
1835
+
1836
+ proto.resize = function() {
1837
+ // #1177 disable resize behavior when animating or dragging for iOS 15
1838
+ if ( !this.isActive || this.isAnimating || this.isDragging ) {
1839
+ return;
1840
+ }
1841
+ this.getSize();
1842
+ // wrap values
1843
+ if ( this.options.wrapAround ) {
1844
+ this.x = utils.modulo( this.x, this.slideableWidth );
1845
+ }
1846
+ this.positionCells();
1847
+ this._getWrapShiftCells();
1848
+ this.setGallerySize();
1849
+ this.emitEvent('resize');
1850
+ // update selected index for group slides, instant
1851
+ // TODO: position can be lost between groups of various numbers
1852
+ var selectedElement = this.selectedElements && this.selectedElements[0];
1853
+ this.selectCell( selectedElement, false, true );
1854
+ };
1855
+
1856
+ // watches the :after property, activates/deactivates
1857
+ proto.watchCSS = function() {
1858
+ var watchOption = this.options.watchCSS;
1859
+ if ( !watchOption ) {
1860
+ return;
1861
+ }
1862
+
1863
+ var afterContent = getComputedStyle( this.element, ':after' ).content;
1864
+ // activate if :after { content: 'flickity' }
1865
+ if ( afterContent.indexOf('flickity') != -1 ) {
1866
+ this.activate();
1867
+ } else {
1868
+ this.deactivate();
1869
+ }
1870
+ };
1871
+
1872
+ // ----- keydown ----- //
1873
+
1874
+ // go previous/next if left/right keys pressed
1875
+ proto.onkeydown = function( event ) {
1876
+ // only work if element is in focus
1877
+ var isNotFocused = document.activeElement && document.activeElement != this.element;
1878
+ if ( !this.options.accessibility || isNotFocused ) {
1879
+ return;
1880
+ }
1881
+
1882
+ var handler = Flickity.keyboardHandlers[ event.keyCode ];
1883
+ if ( handler ) {
1884
+ handler.call( this );
1885
+ }
1886
+ };
1887
+
1888
+ Flickity.keyboardHandlers = {
1889
+ // left arrow
1890
+ 37: function() {
1891
+ var leftMethod = this.options.rightToLeft ? 'next' : 'previous';
1892
+ this.uiChange();
1893
+ this[ leftMethod ]();
1894
+ },
1895
+ // right arrow
1896
+ 39: function() {
1897
+ var rightMethod = this.options.rightToLeft ? 'previous' : 'next';
1898
+ this.uiChange();
1899
+ this[ rightMethod ]();
1900
+ },
1901
+ };
1902
+
1903
+ // ----- focus ----- //
1904
+
1905
+ proto.focus = function() {
1906
+ // TODO remove scrollTo once focus options gets more support
1907
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus ...
1908
+ // #Browser_compatibility
1909
+ var prevScrollY = window.pageYOffset;
1910
+ this.element.focus({ preventScroll: true });
1911
+ // hack to fix scroll jump after focus, #76
1912
+ if ( window.pageYOffset != prevScrollY ) {
1913
+ window.scrollTo( window.pageXOffset, prevScrollY );
1914
+ }
1915
+ };
1916
+
1917
+ // -------------------------- destroy -------------------------- //
1918
+
1919
+ // deactivate all Flickity functionality, but keep stuff available
1920
+ proto.deactivate = function() {
1921
+ if ( !this.isActive ) {
1922
+ return;
1923
+ }
1924
+ this.element.classList.remove('flickity-enabled');
1925
+ this.element.classList.remove('flickity-rtl');
1926
+ this.unselectSelectedSlide();
1927
+ // destroy cells
1928
+ this.cells.forEach( function( cell ) {
1929
+ cell.destroy();
1930
+ } );
1931
+ this.element.removeChild( this.viewport );
1932
+ // move child elements back into element
1933
+ moveElements( this.slider.children, this.element );
1934
+ if ( this.options.accessibility ) {
1935
+ this.element.removeAttribute('tabIndex');
1936
+ this.element.removeEventListener( 'keydown', this );
1937
+ }
1938
+ // set flags
1939
+ this.isActive = false;
1940
+ this.emitEvent('deactivate');
1941
+ };
1942
+
1943
+ proto.destroy = function() {
1944
+ this.deactivate();
1945
+ window.removeEventListener( 'resize', this );
1946
+ this.allOff();
1947
+ this.emitEvent('destroy');
1948
+ if ( jQuery && this.$element ) {
1949
+ jQuery.removeData( this.element, 'flickity' );
1950
+ }
1951
+ delete this.element.flickityGUID;
1952
+ delete instances[ this.guid ];
1953
+ };
1954
+
1955
+ // -------------------------- prototype -------------------------- //
1956
+
1957
+ utils.extend( proto, animatePrototype );
1958
+
1959
+ // -------------------------- extras -------------------------- //
1960
+
1961
+ /**
1962
+ * get Flickity instance from element
1963
+ * @param {[Element, String]} elem - element or selector string
1964
+ * @returns {Flickity} - Flickity instance
1965
+ */
1966
+ Flickity.data = function( elem ) {
1967
+ elem = utils.getQueryElement( elem );
1968
+ var id = elem && elem.flickityGUID;
1969
+ return id && instances[ id ];
1970
+ };
1971
+
1972
+ utils.htmlInit( Flickity, 'flickity' );
1973
+
1974
+ if ( jQuery && jQuery.bridget ) {
1975
+ jQuery.bridget( 'flickity', Flickity );
1976
+ }
1977
+
1978
+ // set internal jQuery, for Webpack + jQuery v3, #478
1979
+ Flickity.setJQuery = function( jq ) {
1980
+ jQuery = jq;
1981
+ };
1982
+
1983
+ Flickity.Cell = Cell;
1984
+ Flickity.Slide = Slide;
1985
+
1986
+ return Flickity;
1987
+
1988
+ } ) );
1989
+ } (flickity));
1990
+ return flickity.exports;
1991
+ }
1992
+
1993
+ var drag = {exports: {}};
1994
+
1995
+ var unidragger = {exports: {}};
1996
+
1997
+ var unipointer = {exports: {}};
1998
+
1999
+ /*!
2000
+ * Unipointer v2.4.0
2001
+ * base class for doing one thing with pointer event
2002
+ * MIT license
2003
+ */
2004
+
2005
+ var hasRequiredUnipointer;
2006
+
2007
+ function requireUnipointer () {
2008
+ if (hasRequiredUnipointer) return unipointer.exports;
2009
+ hasRequiredUnipointer = 1;
2010
+ (function (module) {
2011
+ /*jshint browser: true, undef: true, unused: true, strict: true */
2012
+
2013
+ ( function( window, factory ) {
2014
+ // universal module definition
2015
+ /* jshint strict: false */ /*global define, module, require */
2016
+ if ( module.exports ) {
2017
+ // CommonJS
2018
+ module.exports = factory(
2019
+ window,
2020
+ requireEvEmitter()
2021
+ );
2022
+ } else {
2023
+ // browser global
2024
+ window.Unipointer = factory(
2025
+ window,
2026
+ window.EvEmitter
2027
+ );
2028
+ }
2029
+
2030
+ }( window, function factory( window, EvEmitter ) {
2031
+
2032
+ function noop() {}
2033
+
2034
+ function Unipointer() {}
2035
+
2036
+ // inherit EvEmitter
2037
+ var proto = Unipointer.prototype = Object.create( EvEmitter.prototype );
2038
+
2039
+ proto.bindStartEvent = function( elem ) {
2040
+ this._bindStartEvent( elem, true );
2041
+ };
2042
+
2043
+ proto.unbindStartEvent = function( elem ) {
2044
+ this._bindStartEvent( elem, false );
2045
+ };
2046
+
2047
+ /**
2048
+ * Add or remove start event
2049
+ * @param {Boolean} isAdd - remove if falsey
2050
+ */
2051
+ proto._bindStartEvent = function( elem, isAdd ) {
2052
+ // munge isAdd, default to true
2053
+ isAdd = isAdd === undefined ? true : isAdd;
2054
+ var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
2055
+
2056
+ // default to mouse events
2057
+ var startEvent = 'mousedown';
2058
+ if ( 'ontouchstart' in window ) {
2059
+ // HACK prefer Touch Events as you can preventDefault on touchstart to
2060
+ // disable scroll in iOS & mobile Chrome metafizzy/flickity#1177
2061
+ startEvent = 'touchstart';
2062
+ } else if ( window.PointerEvent ) {
2063
+ // Pointer Events
2064
+ startEvent = 'pointerdown';
2065
+ }
2066
+ elem[ bindMethod ]( startEvent, this );
2067
+ };
2068
+
2069
+ // trigger handler methods for events
2070
+ proto.handleEvent = function( event ) {
2071
+ var method = 'on' + event.type;
2072
+ if ( this[ method ] ) {
2073
+ this[ method ]( event );
2074
+ }
2075
+ };
2076
+
2077
+ // returns the touch that we're keeping track of
2078
+ proto.getTouch = function( touches ) {
2079
+ for ( var i=0; i < touches.length; i++ ) {
2080
+ var touch = touches[i];
2081
+ if ( touch.identifier == this.pointerIdentifier ) {
2082
+ return touch;
2083
+ }
2084
+ }
2085
+ };
2086
+
2087
+ // ----- start event ----- //
2088
+
2089
+ proto.onmousedown = function( event ) {
2090
+ // dismiss clicks from right or middle buttons
2091
+ var button = event.button;
2092
+ if ( button && ( button !== 0 && button !== 1 ) ) {
2093
+ return;
2094
+ }
2095
+ this._pointerDown( event, event );
2096
+ };
2097
+
2098
+ proto.ontouchstart = function( event ) {
2099
+ this._pointerDown( event, event.changedTouches[0] );
2100
+ };
2101
+
2102
+ proto.onpointerdown = function( event ) {
2103
+ this._pointerDown( event, event );
2104
+ };
2105
+
2106
+ /**
2107
+ * pointer start
2108
+ * @param {Event} event
2109
+ * @param {Event or Touch} pointer
2110
+ */
2111
+ proto._pointerDown = function( event, pointer ) {
2112
+ // dismiss right click and other pointers
2113
+ // button = 0 is okay, 1-4 not
2114
+ if ( event.button || this.isPointerDown ) {
2115
+ return;
2116
+ }
2117
+
2118
+ this.isPointerDown = true;
2119
+ // save pointer identifier to match up touch events
2120
+ this.pointerIdentifier = pointer.pointerId !== undefined ?
2121
+ // pointerId for pointer events, touch.indentifier for touch events
2122
+ pointer.pointerId : pointer.identifier;
2123
+
2124
+ this.pointerDown( event, pointer );
2125
+ };
2126
+
2127
+ proto.pointerDown = function( event, pointer ) {
2128
+ this._bindPostStartEvents( event );
2129
+ this.emitEvent( 'pointerDown', [ event, pointer ] );
2130
+ };
2131
+
2132
+ // hash of events to be bound after start event
2133
+ var postStartEvents = {
2134
+ mousedown: [ 'mousemove', 'mouseup' ],
2135
+ touchstart: [ 'touchmove', 'touchend', 'touchcancel' ],
2136
+ pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ],
2137
+ };
2138
+
2139
+ proto._bindPostStartEvents = function( event ) {
2140
+ if ( !event ) {
2141
+ return;
2142
+ }
2143
+ // get proper events to match start event
2144
+ var events = postStartEvents[ event.type ];
2145
+ // bind events to node
2146
+ events.forEach( function( eventName ) {
2147
+ window.addEventListener( eventName, this );
2148
+ }, this );
2149
+ // save these arguments
2150
+ this._boundPointerEvents = events;
2151
+ };
2152
+
2153
+ proto._unbindPostStartEvents = function() {
2154
+ // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug)
2155
+ if ( !this._boundPointerEvents ) {
2156
+ return;
2157
+ }
2158
+ this._boundPointerEvents.forEach( function( eventName ) {
2159
+ window.removeEventListener( eventName, this );
2160
+ }, this );
2161
+
2162
+ delete this._boundPointerEvents;
2163
+ };
2164
+
2165
+ // ----- move event ----- //
2166
+
2167
+ proto.onmousemove = function( event ) {
2168
+ this._pointerMove( event, event );
2169
+ };
2170
+
2171
+ proto.onpointermove = function( event ) {
2172
+ if ( event.pointerId == this.pointerIdentifier ) {
2173
+ this._pointerMove( event, event );
2174
+ }
2175
+ };
2176
+
2177
+ proto.ontouchmove = function( event ) {
2178
+ var touch = this.getTouch( event.changedTouches );
2179
+ if ( touch ) {
2180
+ this._pointerMove( event, touch );
2181
+ }
2182
+ };
2183
+
2184
+ /**
2185
+ * pointer move
2186
+ * @param {Event} event
2187
+ * @param {Event or Touch} pointer
2188
+ * @private
2189
+ */
2190
+ proto._pointerMove = function( event, pointer ) {
2191
+ this.pointerMove( event, pointer );
2192
+ };
2193
+
2194
+ // public
2195
+ proto.pointerMove = function( event, pointer ) {
2196
+ this.emitEvent( 'pointerMove', [ event, pointer ] );
2197
+ };
2198
+
2199
+ // ----- end event ----- //
2200
+
2201
+
2202
+ proto.onmouseup = function( event ) {
2203
+ this._pointerUp( event, event );
2204
+ };
2205
+
2206
+ proto.onpointerup = function( event ) {
2207
+ if ( event.pointerId == this.pointerIdentifier ) {
2208
+ this._pointerUp( event, event );
2209
+ }
2210
+ };
2211
+
2212
+ proto.ontouchend = function( event ) {
2213
+ var touch = this.getTouch( event.changedTouches );
2214
+ if ( touch ) {
2215
+ this._pointerUp( event, touch );
2216
+ }
2217
+ };
2218
+
2219
+ /**
2220
+ * pointer up
2221
+ * @param {Event} event
2222
+ * @param {Event or Touch} pointer
2223
+ * @private
2224
+ */
2225
+ proto._pointerUp = function( event, pointer ) {
2226
+ this._pointerDone();
2227
+ this.pointerUp( event, pointer );
2228
+ };
2229
+
2230
+ // public
2231
+ proto.pointerUp = function( event, pointer ) {
2232
+ this.emitEvent( 'pointerUp', [ event, pointer ] );
2233
+ };
2234
+
2235
+ // ----- pointer done ----- //
2236
+
2237
+ // triggered on pointer up & pointer cancel
2238
+ proto._pointerDone = function() {
2239
+ this._pointerReset();
2240
+ this._unbindPostStartEvents();
2241
+ this.pointerDone();
2242
+ };
2243
+
2244
+ proto._pointerReset = function() {
2245
+ // reset properties
2246
+ this.isPointerDown = false;
2247
+ delete this.pointerIdentifier;
2248
+ };
2249
+
2250
+ proto.pointerDone = noop;
2251
+
2252
+ // ----- pointer cancel ----- //
2253
+
2254
+ proto.onpointercancel = function( event ) {
2255
+ if ( event.pointerId == this.pointerIdentifier ) {
2256
+ this._pointerCancel( event, event );
2257
+ }
2258
+ };
2259
+
2260
+ proto.ontouchcancel = function( event ) {
2261
+ var touch = this.getTouch( event.changedTouches );
2262
+ if ( touch ) {
2263
+ this._pointerCancel( event, touch );
2264
+ }
2265
+ };
2266
+
2267
+ /**
2268
+ * pointer cancel
2269
+ * @param {Event} event
2270
+ * @param {Event or Touch} pointer
2271
+ * @private
2272
+ */
2273
+ proto._pointerCancel = function( event, pointer ) {
2274
+ this._pointerDone();
2275
+ this.pointerCancel( event, pointer );
2276
+ };
2277
+
2278
+ // public
2279
+ proto.pointerCancel = function( event, pointer ) {
2280
+ this.emitEvent( 'pointerCancel', [ event, pointer ] );
2281
+ };
2282
+
2283
+ // ----- ----- //
2284
+
2285
+ // utility function for getting x/y coords from event
2286
+ Unipointer.getPointerPoint = function( pointer ) {
2287
+ return {
2288
+ x: pointer.pageX,
2289
+ y: pointer.pageY
2290
+ };
2291
+ };
2292
+
2293
+ // ----- ----- //
2294
+
2295
+ return Unipointer;
2296
+
2297
+ }));
2298
+ } (unipointer));
2299
+ return unipointer.exports;
2300
+ }
2301
+
2302
+ /*!
2303
+ * Unidragger v2.4.0
2304
+ * Draggable base class
2305
+ * MIT license
2306
+ */
2307
+
2308
+ var hasRequiredUnidragger;
2309
+
2310
+ function requireUnidragger () {
2311
+ if (hasRequiredUnidragger) return unidragger.exports;
2312
+ hasRequiredUnidragger = 1;
2313
+ (function (module) {
2314
+ /*jshint browser: true, unused: true, undef: true, strict: true */
2315
+
2316
+ ( function( window, factory ) {
2317
+ // universal module definition
2318
+ /*jshint strict: false */ /*globals define, module, require */
2319
+
2320
+ if ( module.exports ) {
2321
+ // CommonJS
2322
+ module.exports = factory(
2323
+ window,
2324
+ requireUnipointer()
2325
+ );
2326
+ } else {
2327
+ // browser global
2328
+ window.Unidragger = factory(
2329
+ window,
2330
+ window.Unipointer
2331
+ );
2332
+ }
2333
+
2334
+ }( window, function factory( window, Unipointer ) {
2335
+
2336
+ // -------------------------- Unidragger -------------------------- //
2337
+
2338
+ function Unidragger() {}
2339
+
2340
+ // inherit Unipointer & EvEmitter
2341
+ var proto = Unidragger.prototype = Object.create( Unipointer.prototype );
2342
+
2343
+ // ----- bind start ----- //
2344
+
2345
+ proto.bindHandles = function() {
2346
+ this._bindHandles( true );
2347
+ };
2348
+
2349
+ proto.unbindHandles = function() {
2350
+ this._bindHandles( false );
2351
+ };
2352
+
2353
+ /**
2354
+ * Add or remove start event
2355
+ * @param {Boolean} isAdd
2356
+ */
2357
+ proto._bindHandles = function( isAdd ) {
2358
+ // munge isAdd, default to true
2359
+ isAdd = isAdd === undefined ? true : isAdd;
2360
+ // bind each handle
2361
+ var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
2362
+ var touchAction = isAdd ? this._touchActionValue : '';
2363
+ for ( var i=0; i < this.handles.length; i++ ) {
2364
+ var handle = this.handles[i];
2365
+ this._bindStartEvent( handle, isAdd );
2366
+ handle[ bindMethod ]( 'click', this );
2367
+ // touch-action: none to override browser touch gestures. metafizzy/flickity#540
2368
+ if ( window.PointerEvent ) {
2369
+ handle.style.touchAction = touchAction;
2370
+ }
2371
+ }
2372
+ };
2373
+
2374
+ // prototype so it can be overwriteable by Flickity
2375
+ proto._touchActionValue = 'none';
2376
+
2377
+ // ----- start event ----- //
2378
+
2379
+ /**
2380
+ * pointer start
2381
+ * @param {Event} event
2382
+ * @param {Event or Touch} pointer
2383
+ */
2384
+ proto.pointerDown = function( event, pointer ) {
2385
+ var isOkay = this.okayPointerDown( event );
2386
+ if ( !isOkay ) {
2387
+ return;
2388
+ }
2389
+ // track start event position
2390
+ // Safari 9 overrides pageX and pageY. These values needs to be copied. flickity#842
2391
+ this.pointerDownPointer = {
2392
+ pageX: pointer.pageX,
2393
+ pageY: pointer.pageY,
2394
+ };
2395
+
2396
+ event.preventDefault();
2397
+ this.pointerDownBlur();
2398
+ // bind move and end events
2399
+ this._bindPostStartEvents( event );
2400
+ this.emitEvent( 'pointerDown', [ event, pointer ] );
2401
+ };
2402
+
2403
+ // nodes that have text fields
2404
+ var cursorNodes = {
2405
+ TEXTAREA: true,
2406
+ INPUT: true,
2407
+ SELECT: true,
2408
+ OPTION: true,
2409
+ };
2410
+
2411
+ // input types that do not have text fields
2412
+ var clickTypes = {
2413
+ radio: true,
2414
+ checkbox: true,
2415
+ button: true,
2416
+ submit: true,
2417
+ image: true,
2418
+ file: true,
2419
+ };
2420
+
2421
+ // dismiss inputs with text fields. flickity#403, flickity#404
2422
+ proto.okayPointerDown = function( event ) {
2423
+ var isCursorNode = cursorNodes[ event.target.nodeName ];
2424
+ var isClickType = clickTypes[ event.target.type ];
2425
+ var isOkay = !isCursorNode || isClickType;
2426
+ if ( !isOkay ) {
2427
+ this._pointerReset();
2428
+ }
2429
+ return isOkay;
2430
+ };
2431
+
2432
+ // kludge to blur previously focused input
2433
+ proto.pointerDownBlur = function() {
2434
+ var focused = document.activeElement;
2435
+ // do not blur body for IE10, metafizzy/flickity#117
2436
+ var canBlur = focused && focused.blur && focused != document.body;
2437
+ if ( canBlur ) {
2438
+ focused.blur();
2439
+ }
2440
+ };
2441
+
2442
+ // ----- move event ----- //
2443
+
2444
+ /**
2445
+ * drag move
2446
+ * @param {Event} event
2447
+ * @param {Event or Touch} pointer
2448
+ */
2449
+ proto.pointerMove = function( event, pointer ) {
2450
+ var moveVector = this._dragPointerMove( event, pointer );
2451
+ this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] );
2452
+ this._dragMove( event, pointer, moveVector );
2453
+ };
2454
+
2455
+ // base pointer move logic
2456
+ proto._dragPointerMove = function( event, pointer ) {
2457
+ var moveVector = {
2458
+ x: pointer.pageX - this.pointerDownPointer.pageX,
2459
+ y: pointer.pageY - this.pointerDownPointer.pageY
2460
+ };
2461
+ // start drag if pointer has moved far enough to start drag
2462
+ if ( !this.isDragging && this.hasDragStarted( moveVector ) ) {
2463
+ this._dragStart( event, pointer );
2464
+ }
2465
+ return moveVector;
2466
+ };
2467
+
2468
+ // condition if pointer has moved far enough to start drag
2469
+ proto.hasDragStarted = function( moveVector ) {
2470
+ return Math.abs( moveVector.x ) > 3 || Math.abs( moveVector.y ) > 3;
2471
+ };
2472
+
2473
+ // ----- end event ----- //
2474
+
2475
+ /**
2476
+ * pointer up
2477
+ * @param {Event} event
2478
+ * @param {Event or Touch} pointer
2479
+ */
2480
+ proto.pointerUp = function( event, pointer ) {
2481
+ this.emitEvent( 'pointerUp', [ event, pointer ] );
2482
+ this._dragPointerUp( event, pointer );
2483
+ };
2484
+
2485
+ proto._dragPointerUp = function( event, pointer ) {
2486
+ if ( this.isDragging ) {
2487
+ this._dragEnd( event, pointer );
2488
+ } else {
2489
+ // pointer didn't move enough for drag to start
2490
+ this._staticClick( event, pointer );
2491
+ }
2492
+ };
2493
+
2494
+ // -------------------------- drag -------------------------- //
2495
+
2496
+ // dragStart
2497
+ proto._dragStart = function( event, pointer ) {
2498
+ this.isDragging = true;
2499
+ // prevent clicks
2500
+ this.isPreventingClicks = true;
2501
+ this.dragStart( event, pointer );
2502
+ };
2503
+
2504
+ proto.dragStart = function( event, pointer ) {
2505
+ this.emitEvent( 'dragStart', [ event, pointer ] );
2506
+ };
2507
+
2508
+ // dragMove
2509
+ proto._dragMove = function( event, pointer, moveVector ) {
2510
+ // do not drag if not dragging yet
2511
+ if ( !this.isDragging ) {
2512
+ return;
2513
+ }
2514
+
2515
+ this.dragMove( event, pointer, moveVector );
2516
+ };
2517
+
2518
+ proto.dragMove = function( event, pointer, moveVector ) {
2519
+ event.preventDefault();
2520
+ this.emitEvent( 'dragMove', [ event, pointer, moveVector ] );
2521
+ };
2522
+
2523
+ // dragEnd
2524
+ proto._dragEnd = function( event, pointer ) {
2525
+ // set flags
2526
+ this.isDragging = false;
2527
+ // re-enable clicking async
2528
+ setTimeout( function() {
2529
+ delete this.isPreventingClicks;
2530
+ }.bind( this ) );
2531
+
2532
+ this.dragEnd( event, pointer );
2533
+ };
2534
+
2535
+ proto.dragEnd = function( event, pointer ) {
2536
+ this.emitEvent( 'dragEnd', [ event, pointer ] );
2537
+ };
2538
+
2539
+ // ----- onclick ----- //
2540
+
2541
+ // handle all clicks and prevent clicks when dragging
2542
+ proto.onclick = function( event ) {
2543
+ if ( this.isPreventingClicks ) {
2544
+ event.preventDefault();
2545
+ }
2546
+ };
2547
+
2548
+ // ----- staticClick ----- //
2549
+
2550
+ // triggered after pointer down & up with no/tiny movement
2551
+ proto._staticClick = function( event, pointer ) {
2552
+ // ignore emulated mouse up clicks
2553
+ if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {
2554
+ return;
2555
+ }
2556
+
2557
+ this.staticClick( event, pointer );
2558
+
2559
+ // set flag for emulated clicks 300ms after touchend
2560
+ if ( event.type != 'mouseup' ) {
2561
+ this.isIgnoringMouseUp = true;
2562
+ // reset flag after 300ms
2563
+ setTimeout( function() {
2564
+ delete this.isIgnoringMouseUp;
2565
+ }.bind( this ), 400 );
2566
+ }
2567
+ };
2568
+
2569
+ proto.staticClick = function( event, pointer ) {
2570
+ this.emitEvent( 'staticClick', [ event, pointer ] );
2571
+ };
2572
+
2573
+ // ----- utils ----- //
2574
+
2575
+ Unidragger.getPointerPoint = Unipointer.getPointerPoint;
2576
+
2577
+ // ----- ----- //
2578
+
2579
+ return Unidragger;
2580
+
2581
+ }));
2582
+ } (unidragger));
2583
+ return unidragger.exports;
2584
+ }
2585
+
2586
+ var hasRequiredDrag;
2587
+
2588
+ function requireDrag () {
2589
+ if (hasRequiredDrag) return drag.exports;
2590
+ hasRequiredDrag = 1;
2591
+ (function (module) {
2592
+ // drag
2593
+ ( function( window, factory ) {
2594
+ // universal module definition
2595
+ if ( module.exports ) {
2596
+ // CommonJS
2597
+ module.exports = factory(
2598
+ window,
2599
+ requireFlickity(),
2600
+ requireUnidragger(),
2601
+ requireUtils()
2602
+ );
2603
+ } else {
2604
+ // browser global
2605
+ window.Flickity = factory(
2606
+ window,
2607
+ window.Flickity,
2608
+ window.Unidragger,
2609
+ window.fizzyUIUtils
2610
+ );
2611
+ }
2612
+
2613
+ }( window, function factory( window, Flickity, Unidragger, utils ) {
2614
+
2615
+ // ----- defaults ----- //
2616
+
2617
+ utils.extend( Flickity.defaults, {
2618
+ draggable: '>1',
2619
+ dragThreshold: 3,
2620
+ } );
2621
+
2622
+ // ----- create ----- //
2623
+
2624
+ Flickity.createMethods.push('_createDrag');
2625
+
2626
+ // -------------------------- drag prototype -------------------------- //
2627
+
2628
+ var proto = Flickity.prototype;
2629
+ utils.extend( proto, Unidragger.prototype );
2630
+ proto._touchActionValue = 'pan-y';
2631
+
2632
+ // -------------------------- -------------------------- //
2633
+
2634
+ proto._createDrag = function() {
2635
+ this.on( 'activate', this.onActivateDrag );
2636
+ this.on( 'uiChange', this._uiChangeDrag );
2637
+ this.on( 'deactivate', this.onDeactivateDrag );
2638
+ this.on( 'cellChange', this.updateDraggable );
2639
+ // TODO updateDraggable on resize? if groupCells & slides change
2640
+ };
2641
+
2642
+ proto.onActivateDrag = function() {
2643
+ this.handles = [ this.viewport ];
2644
+ this.bindHandles();
2645
+ this.updateDraggable();
2646
+ };
2647
+
2648
+ proto.onDeactivateDrag = function() {
2649
+ this.unbindHandles();
2650
+ this.element.classList.remove('is-draggable');
2651
+ };
2652
+
2653
+ proto.updateDraggable = function() {
2654
+ // disable dragging if less than 2 slides. #278
2655
+ if ( this.options.draggable == '>1' ) {
2656
+ this.isDraggable = this.slides.length > 1;
2657
+ } else {
2658
+ this.isDraggable = this.options.draggable;
2659
+ }
2660
+ if ( this.isDraggable ) {
2661
+ this.element.classList.add('is-draggable');
2662
+ } else {
2663
+ this.element.classList.remove('is-draggable');
2664
+ }
2665
+ };
2666
+
2667
+ // backwards compatibility
2668
+ proto.bindDrag = function() {
2669
+ this.options.draggable = true;
2670
+ this.updateDraggable();
2671
+ };
2672
+
2673
+ proto.unbindDrag = function() {
2674
+ this.options.draggable = false;
2675
+ this.updateDraggable();
2676
+ };
2677
+
2678
+ proto._uiChangeDrag = function() {
2679
+ delete this.isFreeScrolling;
2680
+ };
2681
+
2682
+ // -------------------------- pointer events -------------------------- //
2683
+
2684
+ proto.pointerDown = function( event, pointer ) {
2685
+ if ( !this.isDraggable ) {
2686
+ this._pointerDownDefault( event, pointer );
2687
+ return;
2688
+ }
2689
+ var isOkay = this.okayPointerDown( event );
2690
+ if ( !isOkay ) {
2691
+ return;
2692
+ }
2693
+
2694
+ this._pointerDownPreventDefault( event );
2695
+ this.pointerDownFocus( event );
2696
+ // blur
2697
+ if ( document.activeElement != this.element ) {
2698
+ // do not blur if already focused
2699
+ this.pointerDownBlur();
2700
+ }
2701
+
2702
+ // stop if it was moving
2703
+ this.dragX = this.x;
2704
+ this.viewport.classList.add('is-pointer-down');
2705
+ // track scrolling
2706
+ this.pointerDownScroll = getScrollPosition();
2707
+ window.addEventListener( 'scroll', this );
2708
+
2709
+ this._pointerDownDefault( event, pointer );
2710
+ };
2711
+
2712
+ // default pointerDown logic, used for staticClick
2713
+ proto._pointerDownDefault = function( event, pointer ) {
2714
+ // track start event position
2715
+ // Safari 9 overrides pageX and pageY. These values needs to be copied. #779
2716
+ this.pointerDownPointer = {
2717
+ pageX: pointer.pageX,
2718
+ pageY: pointer.pageY,
2719
+ };
2720
+ // bind move and end events
2721
+ this._bindPostStartEvents( event );
2722
+ this.dispatchEvent( 'pointerDown', event, [ pointer ] );
2723
+ };
2724
+
2725
+ var focusNodes = {
2726
+ INPUT: true,
2727
+ TEXTAREA: true,
2728
+ SELECT: true,
2729
+ };
2730
+
2731
+ proto.pointerDownFocus = function( event ) {
2732
+ var isFocusNode = focusNodes[ event.target.nodeName ];
2733
+ if ( !isFocusNode ) {
2734
+ this.focus();
2735
+ }
2736
+ };
2737
+
2738
+ proto._pointerDownPreventDefault = function( event ) {
2739
+ var isTouchStart = event.type == 'touchstart';
2740
+ var isTouchPointer = event.pointerType == 'touch';
2741
+ var isFocusNode = focusNodes[ event.target.nodeName ];
2742
+ if ( !isTouchStart && !isTouchPointer && !isFocusNode ) {
2743
+ event.preventDefault();
2744
+ }
2745
+ };
2746
+
2747
+ // ----- move ----- //
2748
+
2749
+ proto.hasDragStarted = function( moveVector ) {
2750
+ return Math.abs( moveVector.x ) > this.options.dragThreshold;
2751
+ };
2752
+
2753
+ // ----- up ----- //
2754
+
2755
+ proto.pointerUp = function( event, pointer ) {
2756
+ delete this.isTouchScrolling;
2757
+ this.viewport.classList.remove('is-pointer-down');
2758
+ this.dispatchEvent( 'pointerUp', event, [ pointer ] );
2759
+ this._dragPointerUp( event, pointer );
2760
+ };
2761
+
2762
+ proto.pointerDone = function() {
2763
+ window.removeEventListener( 'scroll', this );
2764
+ delete this.pointerDownScroll;
2765
+ };
2766
+
2767
+ // -------------------------- dragging -------------------------- //
2768
+
2769
+ proto.dragStart = function( event, pointer ) {
2770
+ if ( !this.isDraggable ) {
2771
+ return;
2772
+ }
2773
+ this.dragStartPosition = this.x;
2774
+ this.startAnimation();
2775
+ window.removeEventListener( 'scroll', this );
2776
+ this.dispatchEvent( 'dragStart', event, [ pointer ] );
2777
+ };
2778
+
2779
+ proto.pointerMove = function( event, pointer ) {
2780
+ var moveVector = this._dragPointerMove( event, pointer );
2781
+ this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] );
2782
+ this._dragMove( event, pointer, moveVector );
2783
+ };
2784
+
2785
+ proto.dragMove = function( event, pointer, moveVector ) {
2786
+ if ( !this.isDraggable ) {
2787
+ return;
2788
+ }
2789
+ event.preventDefault();
2790
+
2791
+ this.previousDragX = this.dragX;
2792
+ // reverse if right-to-left
2793
+ var direction = this.options.rightToLeft ? -1 : 1;
2794
+ if ( this.options.wrapAround ) {
2795
+ // wrap around move. #589
2796
+ moveVector.x %= this.slideableWidth;
2797
+ }
2798
+ var dragX = this.dragStartPosition + moveVector.x * direction;
2799
+
2800
+ if ( !this.options.wrapAround && this.slides.length ) {
2801
+ // slow drag
2802
+ var originBound = Math.max( -this.slides[0].target, this.dragStartPosition );
2803
+ dragX = dragX > originBound ? ( dragX + originBound ) * 0.5 : dragX;
2804
+ var endBound = Math.min( -this.getLastSlide().target, this.dragStartPosition );
2805
+ dragX = dragX < endBound ? ( dragX + endBound ) * 0.5 : dragX;
2806
+ }
2807
+
2808
+ this.dragX = dragX;
2809
+
2810
+ this.dragMoveTime = new Date();
2811
+ this.dispatchEvent( 'dragMove', event, [ pointer, moveVector ] );
2812
+ };
2813
+
2814
+ proto.dragEnd = function( event, pointer ) {
2815
+ if ( !this.isDraggable ) {
2816
+ return;
2817
+ }
2818
+ if ( this.options.freeScroll ) {
2819
+ this.isFreeScrolling = true;
2820
+ }
2821
+ // set selectedIndex based on where flick will end up
2822
+ var index = this.dragEndRestingSelect();
2823
+
2824
+ if ( this.options.freeScroll && !this.options.wrapAround ) {
2825
+ // if free-scroll & not wrap around
2826
+ // do not free-scroll if going outside of bounding slides
2827
+ // so bounding slides can attract slider, and keep it in bounds
2828
+ var restingX = this.getRestingPosition();
2829
+ this.isFreeScrolling = -restingX > this.slides[0].target &&
2830
+ -restingX < this.getLastSlide().target;
2831
+ } else if ( !this.options.freeScroll && index == this.selectedIndex ) {
2832
+ // boost selection if selected index has not changed
2833
+ index += this.dragEndBoostSelect();
2834
+ }
2835
+ delete this.previousDragX;
2836
+ // apply selection
2837
+ // TODO refactor this, selecting here feels weird
2838
+ // HACK, set flag so dragging stays in correct direction
2839
+ this.isDragSelect = this.options.wrapAround;
2840
+ this.select( index );
2841
+ delete this.isDragSelect;
2842
+ this.dispatchEvent( 'dragEnd', event, [ pointer ] );
2843
+ };
2844
+
2845
+ proto.dragEndRestingSelect = function() {
2846
+ var restingX = this.getRestingPosition();
2847
+ // how far away from selected slide
2848
+ var distance = Math.abs( this.getSlideDistance( -restingX, this.selectedIndex ) );
2849
+ // get closet resting going up and going down
2850
+ var positiveResting = this._getClosestResting( restingX, distance, 1 );
2851
+ var negativeResting = this._getClosestResting( restingX, distance, -1 );
2852
+ // use closer resting for wrap-around
2853
+ var index = positiveResting.distance < negativeResting.distance ?
2854
+ positiveResting.index : negativeResting.index;
2855
+ return index;
2856
+ };
2857
+
2858
+ /**
2859
+ * given resting X and distance to selected cell
2860
+ * get the distance and index of the closest cell
2861
+ * @param {Number} restingX - estimated post-flick resting position
2862
+ * @param {Number} distance - distance to selected cell
2863
+ * @param {Integer} increment - +1 or -1, going up or down
2864
+ * @returns {Object} - { distance: {Number}, index: {Integer} }
2865
+ */
2866
+ proto._getClosestResting = function( restingX, distance, increment ) {
2867
+ var index = this.selectedIndex;
2868
+ var minDistance = Infinity;
2869
+ var condition = this.options.contain && !this.options.wrapAround ?
2870
+ // if contain, keep going if distance is equal to minDistance
2871
+ function( dist, minDist ) {
2872
+ return dist <= minDist;
2873
+ } : function( dist, minDist ) {
2874
+ return dist < minDist;
2875
+ };
2876
+ while ( condition( distance, minDistance ) ) {
2877
+ // measure distance to next cell
2878
+ index += increment;
2879
+ minDistance = distance;
2880
+ distance = this.getSlideDistance( -restingX, index );
2881
+ if ( distance === null ) {
2882
+ break;
2883
+ }
2884
+ distance = Math.abs( distance );
2885
+ }
2886
+ return {
2887
+ distance: minDistance,
2888
+ // selected was previous index
2889
+ index: index - increment,
2890
+ };
2891
+ };
2892
+
2893
+ /**
2894
+ * measure distance between x and a slide target
2895
+ * @param {Number} x - horizontal position
2896
+ * @param {Integer} index - slide index
2897
+ * @returns {Number} - slide distance
2898
+ */
2899
+ proto.getSlideDistance = function( x, index ) {
2900
+ var len = this.slides.length;
2901
+ // wrap around if at least 2 slides
2902
+ var isWrapAround = this.options.wrapAround && len > 1;
2903
+ var slideIndex = isWrapAround ? utils.modulo( index, len ) : index;
2904
+ var slide = this.slides[ slideIndex ];
2905
+ if ( !slide ) {
2906
+ return null;
2907
+ }
2908
+ // add distance for wrap-around slides
2909
+ var wrap = isWrapAround ? this.slideableWidth * Math.floor( index/len ) : 0;
2910
+ return x - ( slide.target + wrap );
2911
+ };
2912
+
2913
+ proto.dragEndBoostSelect = function() {
2914
+ // do not boost if no previousDragX or dragMoveTime
2915
+ if ( this.previousDragX === undefined || !this.dragMoveTime ||
2916
+ // or if drag was held for 100 ms
2917
+ new Date() - this.dragMoveTime > 100 ) {
2918
+ return 0;
2919
+ }
2920
+
2921
+ var distance = this.getSlideDistance( -this.dragX, this.selectedIndex );
2922
+ var delta = this.previousDragX - this.dragX;
2923
+ if ( distance > 0 && delta > 0 ) {
2924
+ // boost to next if moving towards the right, and positive velocity
2925
+ return 1;
2926
+ } else if ( distance < 0 && delta < 0 ) {
2927
+ // boost to previous if moving towards the left, and negative velocity
2928
+ return -1;
2929
+ }
2930
+ return 0;
2931
+ };
2932
+
2933
+ // ----- staticClick ----- //
2934
+
2935
+ proto.staticClick = function( event, pointer ) {
2936
+ // get clickedCell, if cell was clicked
2937
+ var clickedCell = this.getParentCell( event.target );
2938
+ var cellElem = clickedCell && clickedCell.element;
2939
+ var cellIndex = clickedCell && this.cells.indexOf( clickedCell );
2940
+ this.dispatchEvent( 'staticClick', event, [ pointer, cellElem, cellIndex ] );
2941
+ };
2942
+
2943
+ // ----- scroll ----- //
2944
+
2945
+ proto.onscroll = function() {
2946
+ var scroll = getScrollPosition();
2947
+ var scrollMoveX = this.pointerDownScroll.x - scroll.x;
2948
+ var scrollMoveY = this.pointerDownScroll.y - scroll.y;
2949
+ // cancel click/tap if scroll is too much
2950
+ if ( Math.abs( scrollMoveX ) > 3 || Math.abs( scrollMoveY ) > 3 ) {
2951
+ this._pointerDone();
2952
+ }
2953
+ };
2954
+
2955
+ // ----- utils ----- //
2956
+
2957
+ function getScrollPosition() {
2958
+ return {
2959
+ x: window.pageXOffset,
2960
+ y: window.pageYOffset,
2961
+ };
2962
+ }
2963
+
2964
+ // ----- ----- //
2965
+
2966
+ return Flickity;
2967
+
2968
+ } ) );
2969
+ } (drag));
2970
+ return drag.exports;
2971
+ }
2972
+
2973
+ var prevNextButton = {exports: {}};
2974
+
2975
+ var hasRequiredPrevNextButton;
2976
+
2977
+ function requirePrevNextButton () {
2978
+ if (hasRequiredPrevNextButton) return prevNextButton.exports;
2979
+ hasRequiredPrevNextButton = 1;
2980
+ (function (module) {
2981
+ // prev/next buttons
2982
+ ( function( window, factory ) {
2983
+ // universal module definition
2984
+ if ( module.exports ) {
2985
+ // CommonJS
2986
+ module.exports = factory(
2987
+ window,
2988
+ requireFlickity(),
2989
+ requireUnipointer(),
2990
+ requireUtils()
2991
+ );
2992
+ } else {
2993
+ // browser global
2994
+ factory(
2995
+ window,
2996
+ window.Flickity,
2997
+ window.Unipointer,
2998
+ window.fizzyUIUtils
2999
+ );
3000
+ }
3001
+
3002
+ }( window, function factory( window, Flickity, Unipointer, utils ) {
3003
+
3004
+ var svgURI = 'http://www.w3.org/2000/svg';
3005
+
3006
+ // -------------------------- PrevNextButton -------------------------- //
3007
+
3008
+ function PrevNextButton( direction, parent ) {
3009
+ this.direction = direction;
3010
+ this.parent = parent;
3011
+ this._create();
3012
+ }
3013
+
3014
+ PrevNextButton.prototype = Object.create( Unipointer.prototype );
3015
+
3016
+ PrevNextButton.prototype._create = function() {
3017
+ // properties
3018
+ this.isEnabled = true;
3019
+ this.isPrevious = this.direction == -1;
3020
+ var leftDirection = this.parent.options.rightToLeft ? 1 : -1;
3021
+ this.isLeft = this.direction == leftDirection;
3022
+
3023
+ var element = this.element = document.createElement('button');
3024
+ element.className = 'flickity-button flickity-prev-next-button';
3025
+ element.className += this.isPrevious ? ' previous' : ' next';
3026
+ // prevent button from submitting form http://stackoverflow.com/a/10836076/182183
3027
+ element.setAttribute( 'type', 'button' );
3028
+ // init as disabled
3029
+ this.disable();
3030
+
3031
+ element.setAttribute( 'aria-label', this.isPrevious ? 'Previous' : 'Next' );
3032
+
3033
+ // create arrow
3034
+ var svg = this.createSVG();
3035
+ element.appendChild( svg );
3036
+ // events
3037
+ this.parent.on( 'select', this.update.bind( this ) );
3038
+ this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) );
3039
+ };
3040
+
3041
+ PrevNextButton.prototype.activate = function() {
3042
+ this.bindStartEvent( this.element );
3043
+ this.element.addEventListener( 'click', this );
3044
+ // add to DOM
3045
+ this.parent.element.appendChild( this.element );
3046
+ };
3047
+
3048
+ PrevNextButton.prototype.deactivate = function() {
3049
+ // remove from DOM
3050
+ this.parent.element.removeChild( this.element );
3051
+ // click events
3052
+ this.unbindStartEvent( this.element );
3053
+ this.element.removeEventListener( 'click', this );
3054
+ };
3055
+
3056
+ PrevNextButton.prototype.createSVG = function() {
3057
+ var svg = document.createElementNS( svgURI, 'svg' );
3058
+ svg.setAttribute( 'class', 'flickity-button-icon' );
3059
+ svg.setAttribute( 'viewBox', '0 0 100 100' );
3060
+ var path = document.createElementNS( svgURI, 'path' );
3061
+ var pathMovements = getArrowMovements( this.parent.options.arrowShape );
3062
+ path.setAttribute( 'd', pathMovements );
3063
+ path.setAttribute( 'class', 'arrow' );
3064
+ // rotate arrow
3065
+ if ( !this.isLeft ) {
3066
+ path.setAttribute( 'transform', 'translate(100, 100) rotate(180) ' );
3067
+ }
3068
+ svg.appendChild( path );
3069
+ return svg;
3070
+ };
3071
+
3072
+ // get SVG path movmement
3073
+ function getArrowMovements( shape ) {
3074
+ // use shape as movement if string
3075
+ if ( typeof shape == 'string' ) {
3076
+ return shape;
3077
+ }
3078
+ // create movement string
3079
+ return 'M ' + shape.x0 + ',50' +
3080
+ ' L ' + shape.x1 + ',' + ( shape.y1 + 50 ) +
3081
+ ' L ' + shape.x2 + ',' + ( shape.y2 + 50 ) +
3082
+ ' L ' + shape.x3 + ',50 ' +
3083
+ ' L ' + shape.x2 + ',' + ( 50 - shape.y2 ) +
3084
+ ' L ' + shape.x1 + ',' + ( 50 - shape.y1 ) +
3085
+ ' Z';
3086
+ }
3087
+
3088
+ PrevNextButton.prototype.handleEvent = utils.handleEvent;
3089
+
3090
+ PrevNextButton.prototype.onclick = function() {
3091
+ if ( !this.isEnabled ) {
3092
+ return;
3093
+ }
3094
+ this.parent.uiChange();
3095
+ var method = this.isPrevious ? 'previous' : 'next';
3096
+ this.parent[ method ]();
3097
+ };
3098
+
3099
+ // ----- ----- //
3100
+
3101
+ PrevNextButton.prototype.enable = function() {
3102
+ if ( this.isEnabled ) {
3103
+ return;
3104
+ }
3105
+ this.element.disabled = false;
3106
+ this.isEnabled = true;
3107
+ };
3108
+
3109
+ PrevNextButton.prototype.disable = function() {
3110
+ if ( !this.isEnabled ) {
3111
+ return;
3112
+ }
3113
+ this.element.disabled = true;
3114
+ this.isEnabled = false;
3115
+ };
3116
+
3117
+ PrevNextButton.prototype.update = function() {
3118
+ // index of first or last slide, if previous or next
3119
+ var slides = this.parent.slides;
3120
+ // enable is wrapAround and at least 2 slides
3121
+ if ( this.parent.options.wrapAround && slides.length > 1 ) {
3122
+ this.enable();
3123
+ return;
3124
+ }
3125
+ var lastIndex = slides.length ? slides.length - 1 : 0;
3126
+ var boundIndex = this.isPrevious ? 0 : lastIndex;
3127
+ var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable';
3128
+ this[ method ]();
3129
+ };
3130
+
3131
+ PrevNextButton.prototype.destroy = function() {
3132
+ this.deactivate();
3133
+ this.allOff();
3134
+ };
3135
+
3136
+ // -------------------------- Flickity prototype -------------------------- //
3137
+
3138
+ utils.extend( Flickity.defaults, {
3139
+ prevNextButtons: true,
3140
+ arrowShape: {
3141
+ x0: 10,
3142
+ x1: 60, y1: 50,
3143
+ x2: 70, y2: 40,
3144
+ x3: 30,
3145
+ },
3146
+ } );
3147
+
3148
+ Flickity.createMethods.push('_createPrevNextButtons');
3149
+ var proto = Flickity.prototype;
3150
+
3151
+ proto._createPrevNextButtons = function() {
3152
+ if ( !this.options.prevNextButtons ) {
3153
+ return;
3154
+ }
3155
+
3156
+ this.prevButton = new PrevNextButton( -1, this );
3157
+ this.nextButton = new PrevNextButton( 1, this );
3158
+
3159
+ this.on( 'activate', this.activatePrevNextButtons );
3160
+ };
3161
+
3162
+ proto.activatePrevNextButtons = function() {
3163
+ this.prevButton.activate();
3164
+ this.nextButton.activate();
3165
+ this.on( 'deactivate', this.deactivatePrevNextButtons );
3166
+ };
3167
+
3168
+ proto.deactivatePrevNextButtons = function() {
3169
+ this.prevButton.deactivate();
3170
+ this.nextButton.deactivate();
3171
+ this.off( 'deactivate', this.deactivatePrevNextButtons );
3172
+ };
3173
+
3174
+ // -------------------------- -------------------------- //
3175
+
3176
+ Flickity.PrevNextButton = PrevNextButton;
3177
+
3178
+ return Flickity;
3179
+
3180
+ } ) );
3181
+ } (prevNextButton));
3182
+ return prevNextButton.exports;
3183
+ }
3184
+
3185
+ var pageDots = {exports: {}};
3186
+
3187
+ var hasRequiredPageDots;
3188
+
3189
+ function requirePageDots () {
3190
+ if (hasRequiredPageDots) return pageDots.exports;
3191
+ hasRequiredPageDots = 1;
3192
+ (function (module) {
3193
+ // page dots
3194
+ ( function( window, factory ) {
3195
+ // universal module definition
3196
+ if ( module.exports ) {
3197
+ // CommonJS
3198
+ module.exports = factory(
3199
+ window,
3200
+ requireFlickity(),
3201
+ requireUnipointer(),
3202
+ requireUtils()
3203
+ );
3204
+ } else {
3205
+ // browser global
3206
+ factory(
3207
+ window,
3208
+ window.Flickity,
3209
+ window.Unipointer,
3210
+ window.fizzyUIUtils
3211
+ );
3212
+ }
3213
+
3214
+ }( window, function factory( window, Flickity, Unipointer, utils ) {
3215
+
3216
+ function PageDots( parent ) {
3217
+ this.parent = parent;
3218
+ this._create();
3219
+ }
3220
+
3221
+ PageDots.prototype = Object.create( Unipointer.prototype );
3222
+
3223
+ PageDots.prototype._create = function() {
3224
+ // create holder element
3225
+ this.holder = document.createElement('ol');
3226
+ this.holder.className = 'flickity-page-dots';
3227
+ // create dots, array of elements
3228
+ this.dots = [];
3229
+ // events
3230
+ this.handleClick = this.onClick.bind( this );
3231
+ this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) );
3232
+ };
3233
+
3234
+ PageDots.prototype.activate = function() {
3235
+ this.setDots();
3236
+ this.holder.addEventListener( 'click', this.handleClick );
3237
+ this.bindStartEvent( this.holder );
3238
+ // add to DOM
3239
+ this.parent.element.appendChild( this.holder );
3240
+ };
3241
+
3242
+ PageDots.prototype.deactivate = function() {
3243
+ this.holder.removeEventListener( 'click', this.handleClick );
3244
+ this.unbindStartEvent( this.holder );
3245
+ // remove from DOM
3246
+ this.parent.element.removeChild( this.holder );
3247
+ };
3248
+
3249
+ PageDots.prototype.setDots = function() {
3250
+ // get difference between number of slides and number of dots
3251
+ var delta = this.parent.slides.length - this.dots.length;
3252
+ if ( delta > 0 ) {
3253
+ this.addDots( delta );
3254
+ } else if ( delta < 0 ) {
3255
+ this.removeDots( -delta );
3256
+ }
3257
+ };
3258
+
3259
+ PageDots.prototype.addDots = function( count ) {
3260
+ var fragment = document.createDocumentFragment();
3261
+ var newDots = [];
3262
+ var length = this.dots.length;
3263
+ var max = length + count;
3264
+
3265
+ for ( var i = length; i < max; i++ ) {
3266
+ var dot = document.createElement('li');
3267
+ dot.className = 'dot';
3268
+ dot.setAttribute( 'aria-label', 'Page dot ' + ( i + 1 ) );
3269
+ fragment.appendChild( dot );
3270
+ newDots.push( dot );
3271
+ }
3272
+
3273
+ this.holder.appendChild( fragment );
3274
+ this.dots = this.dots.concat( newDots );
3275
+ };
3276
+
3277
+ PageDots.prototype.removeDots = function( count ) {
3278
+ // remove from this.dots collection
3279
+ var removeDots = this.dots.splice( this.dots.length - count, count );
3280
+ // remove from DOM
3281
+ removeDots.forEach( function( dot ) {
3282
+ this.holder.removeChild( dot );
3283
+ }, this );
3284
+ };
3285
+
3286
+ PageDots.prototype.updateSelected = function() {
3287
+ // remove selected class on previous
3288
+ if ( this.selectedDot ) {
3289
+ this.selectedDot.className = 'dot';
3290
+ this.selectedDot.removeAttribute('aria-current');
3291
+ }
3292
+ // don't proceed if no dots
3293
+ if ( !this.dots.length ) {
3294
+ return;
3295
+ }
3296
+ this.selectedDot = this.dots[ this.parent.selectedIndex ];
3297
+ this.selectedDot.className = 'dot is-selected';
3298
+ this.selectedDot.setAttribute( 'aria-current', 'step' );
3299
+ };
3300
+
3301
+ PageDots.prototype.onTap = // old method name, backwards-compatible
3302
+ PageDots.prototype.onClick = function( event ) {
3303
+ var target = event.target;
3304
+ // only care about dot clicks
3305
+ if ( target.nodeName != 'LI' ) {
3306
+ return;
3307
+ }
3308
+
3309
+ this.parent.uiChange();
3310
+ var index = this.dots.indexOf( target );
3311
+ this.parent.select( index );
3312
+ };
3313
+
3314
+ PageDots.prototype.destroy = function() {
3315
+ this.deactivate();
3316
+ this.allOff();
3317
+ };
3318
+
3319
+ Flickity.PageDots = PageDots;
3320
+
3321
+ // -------------------------- Flickity -------------------------- //
3322
+
3323
+ utils.extend( Flickity.defaults, {
3324
+ pageDots: true,
3325
+ } );
3326
+
3327
+ Flickity.createMethods.push('_createPageDots');
3328
+
3329
+ var proto = Flickity.prototype;
3330
+
3331
+ proto._createPageDots = function() {
3332
+ if ( !this.options.pageDots ) {
3333
+ return;
3334
+ }
3335
+ this.pageDots = new PageDots( this );
3336
+ // events
3337
+ this.on( 'activate', this.activatePageDots );
3338
+ this.on( 'select', this.updateSelectedPageDots );
3339
+ this.on( 'cellChange', this.updatePageDots );
3340
+ this.on( 'resize', this.updatePageDots );
3341
+ this.on( 'deactivate', this.deactivatePageDots );
3342
+ };
3343
+
3344
+ proto.activatePageDots = function() {
3345
+ this.pageDots.activate();
3346
+ };
3347
+
3348
+ proto.updateSelectedPageDots = function() {
3349
+ this.pageDots.updateSelected();
3350
+ };
3351
+
3352
+ proto.updatePageDots = function() {
3353
+ this.pageDots.setDots();
3354
+ };
3355
+
3356
+ proto.deactivatePageDots = function() {
3357
+ this.pageDots.deactivate();
3358
+ };
3359
+
3360
+ // ----- ----- //
3361
+
3362
+ Flickity.PageDots = PageDots;
3363
+
3364
+ return Flickity;
3365
+
3366
+ } ) );
3367
+ } (pageDots));
3368
+ return pageDots.exports;
3369
+ }
3370
+
3371
+ var player = {exports: {}};
3372
+
3373
+ var hasRequiredPlayer;
3374
+
3375
+ function requirePlayer () {
3376
+ if (hasRequiredPlayer) return player.exports;
3377
+ hasRequiredPlayer = 1;
3378
+ (function (module) {
3379
+ // player & autoPlay
3380
+ ( function( window, factory ) {
3381
+ // universal module definition
3382
+ if ( module.exports ) {
3383
+ // CommonJS
3384
+ module.exports = factory(
3385
+ requireEvEmitter(),
3386
+ requireUtils(),
3387
+ requireFlickity()
3388
+ );
3389
+ } else {
3390
+ // browser global
3391
+ factory(
3392
+ window.EvEmitter,
3393
+ window.fizzyUIUtils,
3394
+ window.Flickity
3395
+ );
3396
+ }
3397
+
3398
+ }( window, function factory( EvEmitter, utils, Flickity ) {
3399
+
3400
+ // -------------------------- Player -------------------------- //
3401
+
3402
+ function Player( parent ) {
3403
+ this.parent = parent;
3404
+ this.state = 'stopped';
3405
+ // visibility change event handler
3406
+ this.onVisibilityChange = this.visibilityChange.bind( this );
3407
+ this.onVisibilityPlay = this.visibilityPlay.bind( this );
3408
+ }
3409
+
3410
+ Player.prototype = Object.create( EvEmitter.prototype );
3411
+
3412
+ // start play
3413
+ Player.prototype.play = function() {
3414
+ if ( this.state == 'playing' ) {
3415
+ return;
3416
+ }
3417
+ // do not play if page is hidden, start playing when page is visible
3418
+ var isPageHidden = document.hidden;
3419
+ if ( isPageHidden ) {
3420
+ document.addEventListener( 'visibilitychange', this.onVisibilityPlay );
3421
+ return;
3422
+ }
3423
+
3424
+ this.state = 'playing';
3425
+ // listen to visibility change
3426
+ document.addEventListener( 'visibilitychange', this.onVisibilityChange );
3427
+ // start ticking
3428
+ this.tick();
3429
+ };
3430
+
3431
+ Player.prototype.tick = function() {
3432
+ // do not tick if not playing
3433
+ if ( this.state != 'playing' ) {
3434
+ return;
3435
+ }
3436
+
3437
+ var time = this.parent.options.autoPlay;
3438
+ // default to 3 seconds
3439
+ time = typeof time == 'number' ? time : 3000;
3440
+ var _this = this;
3441
+ // HACK: reset ticks if stopped and started within interval
3442
+ this.clear();
3443
+ this.timeout = setTimeout( function() {
3444
+ _this.parent.next( true );
3445
+ _this.tick();
3446
+ }, time );
3447
+ };
3448
+
3449
+ Player.prototype.stop = function() {
3450
+ this.state = 'stopped';
3451
+ this.clear();
3452
+ // remove visibility change event
3453
+ document.removeEventListener( 'visibilitychange', this.onVisibilityChange );
3454
+ };
3455
+
3456
+ Player.prototype.clear = function() {
3457
+ clearTimeout( this.timeout );
3458
+ };
3459
+
3460
+ Player.prototype.pause = function() {
3461
+ if ( this.state == 'playing' ) {
3462
+ this.state = 'paused';
3463
+ this.clear();
3464
+ }
3465
+ };
3466
+
3467
+ Player.prototype.unpause = function() {
3468
+ // re-start play if paused
3469
+ if ( this.state == 'paused' ) {
3470
+ this.play();
3471
+ }
3472
+ };
3473
+
3474
+ // pause if page visibility is hidden, unpause if visible
3475
+ Player.prototype.visibilityChange = function() {
3476
+ var isPageHidden = document.hidden;
3477
+ this[ isPageHidden ? 'pause' : 'unpause' ]();
3478
+ };
3479
+
3480
+ Player.prototype.visibilityPlay = function() {
3481
+ this.play();
3482
+ document.removeEventListener( 'visibilitychange', this.onVisibilityPlay );
3483
+ };
3484
+
3485
+ // -------------------------- Flickity -------------------------- //
3486
+
3487
+ utils.extend( Flickity.defaults, {
3488
+ pauseAutoPlayOnHover: true,
3489
+ } );
3490
+
3491
+ Flickity.createMethods.push('_createPlayer');
3492
+ var proto = Flickity.prototype;
3493
+
3494
+ proto._createPlayer = function() {
3495
+ this.player = new Player( this );
3496
+
3497
+ this.on( 'activate', this.activatePlayer );
3498
+ this.on( 'uiChange', this.stopPlayer );
3499
+ this.on( 'pointerDown', this.stopPlayer );
3500
+ this.on( 'deactivate', this.deactivatePlayer );
3501
+ };
3502
+
3503
+ proto.activatePlayer = function() {
3504
+ if ( !this.options.autoPlay ) {
3505
+ return;
3506
+ }
3507
+ this.player.play();
3508
+ this.element.addEventListener( 'mouseenter', this );
3509
+ };
3510
+
3511
+ // Player API, don't hate the ... thanks I know where the door is
3512
+
3513
+ proto.playPlayer = function() {
3514
+ this.player.play();
3515
+ };
3516
+
3517
+ proto.stopPlayer = function() {
3518
+ this.player.stop();
3519
+ };
3520
+
3521
+ proto.pausePlayer = function() {
3522
+ this.player.pause();
3523
+ };
3524
+
3525
+ proto.unpausePlayer = function() {
3526
+ this.player.unpause();
3527
+ };
3528
+
3529
+ proto.deactivatePlayer = function() {
3530
+ this.player.stop();
3531
+ this.element.removeEventListener( 'mouseenter', this );
3532
+ };
3533
+
3534
+ // ----- mouseenter/leave ----- //
3535
+
3536
+ // pause auto-play on hover
3537
+ proto.onmouseenter = function() {
3538
+ if ( !this.options.pauseAutoPlayOnHover ) {
3539
+ return;
3540
+ }
3541
+ this.player.pause();
3542
+ this.element.addEventListener( 'mouseleave', this );
3543
+ };
3544
+
3545
+ // resume auto-play on hover off
3546
+ proto.onmouseleave = function() {
3547
+ this.player.unpause();
3548
+ this.element.removeEventListener( 'mouseleave', this );
3549
+ };
3550
+
3551
+ // ----- ----- //
3552
+
3553
+ Flickity.Player = Player;
3554
+
3555
+ return Flickity;
3556
+
3557
+ } ) );
3558
+ } (player));
3559
+ return player.exports;
3560
+ }
3561
+
3562
+ var addRemoveCell = {exports: {}};
3563
+
3564
+ var hasRequiredAddRemoveCell;
3565
+
3566
+ function requireAddRemoveCell () {
3567
+ if (hasRequiredAddRemoveCell) return addRemoveCell.exports;
3568
+ hasRequiredAddRemoveCell = 1;
3569
+ (function (module) {
3570
+ // add, remove cell
3571
+ ( function( window, factory ) {
3572
+ // universal module definition
3573
+ if ( module.exports ) {
3574
+ // CommonJS
3575
+ module.exports = factory(
3576
+ window,
3577
+ requireFlickity(),
3578
+ requireUtils()
3579
+ );
3580
+ } else {
3581
+ // browser global
3582
+ factory(
3583
+ window,
3584
+ window.Flickity,
3585
+ window.fizzyUIUtils
3586
+ );
3587
+ }
3588
+
3589
+ }( window, function factory( window, Flickity, utils ) {
3590
+
3591
+ // append cells to a document fragment
3592
+ function getCellsFragment( cells ) {
3593
+ var fragment = document.createDocumentFragment();
3594
+ cells.forEach( function( cell ) {
3595
+ fragment.appendChild( cell.element );
3596
+ } );
3597
+ return fragment;
3598
+ }
3599
+
3600
+ // -------------------------- add/remove cell prototype -------------------------- //
3601
+
3602
+ var proto = Flickity.prototype;
3603
+
3604
+ /**
3605
+ * Insert, prepend, or append cells
3606
+ * @param {[Element, Array, NodeList]} elems - Elements to insert
3607
+ * @param {Integer} index - Zero-based number to insert
3608
+ */
3609
+ proto.insert = function( elems, index ) {
3610
+ var cells = this._makeCells( elems );
3611
+ if ( !cells || !cells.length ) {
3612
+ return;
3613
+ }
3614
+ var len = this.cells.length;
3615
+ // default to append
3616
+ index = index === undefined ? len : index;
3617
+ // add cells with document fragment
3618
+ var fragment = getCellsFragment( cells );
3619
+ // append to slider
3620
+ var isAppend = index == len;
3621
+ if ( isAppend ) {
3622
+ this.slider.appendChild( fragment );
3623
+ } else {
3624
+ var insertCellElement = this.cells[ index ].element;
3625
+ this.slider.insertBefore( fragment, insertCellElement );
3626
+ }
3627
+ // add to this.cells
3628
+ if ( index === 0 ) {
3629
+ // prepend, add to start
3630
+ this.cells = cells.concat( this.cells );
3631
+ } else if ( isAppend ) {
3632
+ // append, add to end
3633
+ this.cells = this.cells.concat( cells );
3634
+ } else {
3635
+ // insert in this.cells
3636
+ var endCells = this.cells.splice( index, len - index );
3637
+ this.cells = this.cells.concat( cells ).concat( endCells );
3638
+ }
3639
+
3640
+ this._sizeCells( cells );
3641
+ this.cellChange( index, true );
3642
+ };
3643
+
3644
+ proto.append = function( elems ) {
3645
+ this.insert( elems, this.cells.length );
3646
+ };
3647
+
3648
+ proto.prepend = function( elems ) {
3649
+ this.insert( elems, 0 );
3650
+ };
3651
+
3652
+ /**
3653
+ * Remove cells
3654
+ * @param {[Element, Array, NodeList]} elems - ELements to remove
3655
+ */
3656
+ proto.remove = function( elems ) {
3657
+ var cells = this.getCells( elems );
3658
+ if ( !cells || !cells.length ) {
3659
+ return;
3660
+ }
3661
+
3662
+ var minCellIndex = this.cells.length - 1;
3663
+ // remove cells from collection & DOM
3664
+ cells.forEach( function( cell ) {
3665
+ cell.remove();
3666
+ var index = this.cells.indexOf( cell );
3667
+ minCellIndex = Math.min( index, minCellIndex );
3668
+ utils.removeFrom( this.cells, cell );
3669
+ }, this );
3670
+
3671
+ this.cellChange( minCellIndex, true );
3672
+ };
3673
+
3674
+ /**
3675
+ * logic to be run after a cell's size changes
3676
+ * @param {Element} elem - cell's element
3677
+ */
3678
+ proto.cellSizeChange = function( elem ) {
3679
+ var cell = this.getCell( elem );
3680
+ if ( !cell ) {
3681
+ return;
3682
+ }
3683
+ cell.getSize();
3684
+
3685
+ var index = this.cells.indexOf( cell );
3686
+ this.cellChange( index );
3687
+ };
3688
+
3689
+ /**
3690
+ * logic any time a cell is changed: added, removed, or size changed
3691
+ * @param {Integer} changedCellIndex - index of the changed cell, optional
3692
+ * @param {Boolean} isPositioningSlider - Positions slider after selection
3693
+ */
3694
+ proto.cellChange = function( changedCellIndex, isPositioningSlider ) {
3695
+ var prevSelectedElem = this.selectedElement;
3696
+ this._positionCells( changedCellIndex );
3697
+ this._getWrapShiftCells();
3698
+ this.setGallerySize();
3699
+ // update selectedIndex
3700
+ // try to maintain position & select previous selected element
3701
+ var cell = this.getCell( prevSelectedElem );
3702
+ if ( cell ) {
3703
+ this.selectedIndex = this.getCellSlideIndex( cell );
3704
+ }
3705
+ this.selectedIndex = Math.min( this.slides.length - 1, this.selectedIndex );
3706
+
3707
+ this.emitEvent( 'cellChange', [ changedCellIndex ] );
3708
+ // position slider
3709
+ this.select( this.selectedIndex );
3710
+ // do not position slider after lazy load
3711
+ if ( isPositioningSlider ) {
3712
+ this.positionSliderAtSelected();
3713
+ }
3714
+ };
3715
+
3716
+ // ----- ----- //
3717
+
3718
+ return Flickity;
3719
+
3720
+ } ) );
3721
+ } (addRemoveCell));
3722
+ return addRemoveCell.exports;
3723
+ }
3724
+
3725
+ var lazyload = {exports: {}};
3726
+
3727
+ var hasRequiredLazyload;
3728
+
3729
+ function requireLazyload () {
3730
+ if (hasRequiredLazyload) return lazyload.exports;
3731
+ hasRequiredLazyload = 1;
3732
+ (function (module) {
3733
+ // lazyload
3734
+ ( function( window, factory ) {
3735
+ // universal module definition
3736
+ if ( module.exports ) {
3737
+ // CommonJS
3738
+ module.exports = factory(
3739
+ window,
3740
+ requireFlickity(),
3741
+ requireUtils()
3742
+ );
3743
+ } else {
3744
+ // browser global
3745
+ factory(
3746
+ window,
3747
+ window.Flickity,
3748
+ window.fizzyUIUtils
3749
+ );
3750
+ }
3751
+
3752
+ }( window, function factory( window, Flickity, utils ) {
3753
+
3754
+ Flickity.createMethods.push('_createLazyload');
3755
+ var proto = Flickity.prototype;
3756
+
3757
+ proto._createLazyload = function() {
3758
+ this.on( 'select', this.lazyLoad );
3759
+ };
3760
+
3761
+ proto.lazyLoad = function() {
3762
+ var lazyLoad = this.options.lazyLoad;
3763
+ if ( !lazyLoad ) {
3764
+ return;
3765
+ }
3766
+ // get adjacent cells, use lazyLoad option for adjacent count
3767
+ var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0;
3768
+ var cellElems = this.getAdjacentCellElements( adjCount );
3769
+ // get lazy images in those cells
3770
+ var lazyImages = [];
3771
+ cellElems.forEach( function( cellElem ) {
3772
+ var lazyCellImages = getCellLazyImages( cellElem );
3773
+ lazyImages = lazyImages.concat( lazyCellImages );
3774
+ } );
3775
+ // load lazy images
3776
+ lazyImages.forEach( function( img ) {
3777
+ new LazyLoader( img, this );
3778
+ }, this );
3779
+ };
3780
+
3781
+ function getCellLazyImages( cellElem ) {
3782
+ // check if cell element is lazy image
3783
+ if ( cellElem.nodeName == 'IMG' ) {
3784
+ var lazyloadAttr = cellElem.getAttribute('data-flickity-lazyload');
3785
+ var srcAttr = cellElem.getAttribute('data-flickity-lazyload-src');
3786
+ var srcsetAttr = cellElem.getAttribute('data-flickity-lazyload-srcset');
3787
+ if ( lazyloadAttr || srcAttr || srcsetAttr ) {
3788
+ return [ cellElem ];
3789
+ }
3790
+ }
3791
+ // select lazy images in cell
3792
+ var lazySelector = 'img[data-flickity-lazyload], ' +
3793
+ 'img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]';
3794
+ var imgs = cellElem.querySelectorAll( lazySelector );
3795
+ return utils.makeArray( imgs );
3796
+ }
3797
+
3798
+ // -------------------------- LazyLoader -------------------------- //
3799
+
3800
+ /**
3801
+ * class to handle loading images
3802
+ * @param {Image} img - Image element
3803
+ * @param {Flickity} flickity - Flickity instance
3804
+ */
3805
+ function LazyLoader( img, flickity ) {
3806
+ this.img = img;
3807
+ this.flickity = flickity;
3808
+ this.load();
3809
+ }
3810
+
3811
+ LazyLoader.prototype.handleEvent = utils.handleEvent;
3812
+
3813
+ LazyLoader.prototype.load = function() {
3814
+ this.img.addEventListener( 'load', this );
3815
+ this.img.addEventListener( 'error', this );
3816
+ // get src & srcset
3817
+ var src = this.img.getAttribute('data-flickity-lazyload') ||
3818
+ this.img.getAttribute('data-flickity-lazyload-src');
3819
+ var srcset = this.img.getAttribute('data-flickity-lazyload-srcset');
3820
+ // set src & serset
3821
+ this.img.src = src;
3822
+ if ( srcset ) {
3823
+ this.img.setAttribute( 'srcset', srcset );
3824
+ }
3825
+ // remove attr
3826
+ this.img.removeAttribute('data-flickity-lazyload');
3827
+ this.img.removeAttribute('data-flickity-lazyload-src');
3828
+ this.img.removeAttribute('data-flickity-lazyload-srcset');
3829
+ };
3830
+
3831
+ LazyLoader.prototype.onload = function( event ) {
3832
+ this.complete( event, 'flickity-lazyloaded' );
3833
+ };
3834
+
3835
+ LazyLoader.prototype.onerror = function( event ) {
3836
+ this.complete( event, 'flickity-lazyerror' );
3837
+ };
3838
+
3839
+ LazyLoader.prototype.complete = function( event, className ) {
3840
+ // unbind events
3841
+ this.img.removeEventListener( 'load', this );
3842
+ this.img.removeEventListener( 'error', this );
3843
+
3844
+ var cell = this.flickity.getParentCell( this.img );
3845
+ var cellElem = cell && cell.element;
3846
+ this.flickity.cellSizeChange( cellElem );
3847
+
3848
+ this.img.classList.add( className );
3849
+ this.flickity.dispatchEvent( 'lazyLoad', event, cellElem );
3850
+ };
3851
+
3852
+ // ----- ----- //
3853
+
3854
+ Flickity.LazyLoader = LazyLoader;
3855
+
3856
+ return Flickity;
3857
+
3858
+ } ) );
3859
+ } (lazyload));
3860
+ return lazyload.exports;
3861
+ }
3862
+
3863
+ /*!
3864
+ * Flickity v2.3.0
3865
+ * Touch, responsive, flickable carousels
3866
+ *
3867
+ * Licensed GPLv3 for open source use
3868
+ * or Flickity Commercial License for commercial use
3869
+ *
3870
+ * https://flickity.metafizzy.co
3871
+ * Copyright 2015-2021 Metafizzy
3872
+ */
3873
+
3874
+ var hasRequiredJs;
3875
+
3876
+ function requireJs () {
3877
+ if (hasRequiredJs) return js.exports;
3878
+ hasRequiredJs = 1;
3879
+ (function (module) {
3880
+ ( function( window, factory ) {
3881
+ // universal module definition
3882
+ if ( module.exports ) {
3883
+ // CommonJS
3884
+ module.exports = factory(
3885
+ requireFlickity(),
3886
+ requireDrag(),
3887
+ requirePrevNextButton(),
3888
+ requirePageDots(),
3889
+ requirePlayer(),
3890
+ requireAddRemoveCell(),
3891
+ requireLazyload()
3892
+ );
3893
+ }
3894
+
3895
+ } )( window, function factory( Flickity ) {
3896
+ return Flickity;
3897
+ } );
3898
+ } (js));
3899
+ return js.exports;
3900
+ }
3901
+
3902
+ var jsExports = requireJs();
3903
+ const index = /*@__PURE__*/getDefaultExportFromCjs(jsExports);
3904
+
3905
+ const index$1 = /*#__PURE__*/_mergeNamespaces({
3906
+ __proto__: null,
3907
+ default: index
3908
+ }, [jsExports]);
3909
+
3910
+ export { index$1 as i };