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