diff --git a/index.html b/index.html
index 42fb5ba..5c79795 100644
--- a/index.html
+++ b/index.html
@@ -357,7 +357,7 @@
-
People share content that makes them feel inspired. WebSlides is a very effective way to engage young audiences, customers, and teams.
+ People share content that makes them feel inspired. WebSlides is a very effective way to engage young audiences, customers, and teams.
Best,
@jlantunez, @belelros, and @luissacristan.
diff --git a/src/js/modules/slide.js b/src/js/modules/slide.js
index 134ad38..d73038e 100644
--- a/src/js/modules/slide.js
+++ b/src/js/modules/slide.js
@@ -37,7 +37,7 @@ class Slide {
*/
this.i = i;
- this.el.id = `section-${(i + 1)}`;
+ this.el.id = this.el.id ? this.el.id : `section-${(i + 1)}`;
this.el.classList.add(CLASSES.SLIDE);
// Hide slides by default
diff --git a/src/js/plugins/navigation.js b/src/js/plugins/navigation.js
index 2ecd852..44648f2 100644
--- a/src/js/plugins/navigation.js
+++ b/src/js/plugins/navigation.js
@@ -60,6 +60,9 @@ export default class Navigation {
this.el.appendChild(this.counter);
this.ws_.el.appendChild(this.el);
+ this.slides = Array.prototype.slice.call(
+ document.querySelectorAll('#webslides section')).map(s => s.id);
+
this.bindEvents_();
}
@@ -73,6 +76,29 @@ export default class Navigation {
this.next.addEventListener('click', this.onButtonClicked_.bind(this));
this.prev.addEventListener('click', this.onButtonClicked_.bind(this));
this.counter.addEventListener('click', this.onButtonClicked_.bind(this));
+ document.body.addEventListener('click', this.onBodyClicked_.bind(this));
+ }
+
+ /**
+ * Whenever the body is clicked, check if the element has [data-slide] attr
+ * and if so, navigate to it.
+ * @param {MouseEvent} event Click event
+ */
+ onBodyClicked_(event) {
+ const matches = document.body.matches || document.body.msMatchesSelector;
+ let el;
+
+ if (matches.call(event.target, '[data-slide]')) {
+ el = event.target;
+ } else if (matches.call(event.target, '[data-slide] *')) {
+ el = event.target.querySelector('[data-slide]');
+ }
+
+ if (el) {
+ event.preventDefault();
+ const i = this.slides.indexOf(el.dataset.slide);
+ this.ws_.goToSlide(i);
+ }
}
/**
diff --git a/static/css/webslides.css b/static/css/webslides.css
index bb87416..dafc49a 100644
--- a/static/css/webslides.css
+++ b/static/css/webslides.css
@@ -1,7 +1,7 @@
/*!
* Name: WebSlides
* Version: 1.5.0
- * Date: 2017-09-16
+ * Date: 2018-01-01
* Description: Making HTML presentations easy
* URL: https://github.com/webslides/webslides#readme
* Credits: @jlantunez, @LuisSacristan, @Belelros
diff --git a/static/js/webslides.js b/static/js/webslides.js
index 540d033..c0be8ba 100644
--- a/static/js/webslides.js
+++ b/static/js/webslides.js
@@ -1,7 +1,7 @@
/*!
* Name: WebSlides
* Version: 1.5.0
- * Date: 2017-09-16
+ * Date: 2018-01-01
* Description: Making HTML presentations easy
* URL: https://github.com/webslides/webslides#readme
* Credits: @jlantunez, @LuisSacristan, @Belelros
@@ -263,7 +263,8 @@ var DOM = function () {
var eventInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var event = new __WEBPACK_IMPORTED_MODULE_0__custom_event__["a" /* default */](eventType, {
- detail: eventInfo
+ detail: eventInfo,
+ bubbles: true
});
target.dispatchEvent(event);
@@ -377,8 +378,9 @@ var CLASSES = {
var Events = {
ENTER: 'dom:enter',
LEAVE: 'dom:leave',
+ DISABLE: 'slide:disable',
ENABLE: 'slide:enable',
- DISABLE: 'slide:disable'
+ SHOW: 'slide:show'
};
/**
@@ -408,7 +410,7 @@ var Slide = function () {
*/
this.i = i;
- this.el.id = 'section-' + (i + 1);
+ this.el.id = this.el.id ? this.el.id : 'section-' + (i + 1);
this.el.classList.add(CLASSES.SLIDE);
// Hide slides by default
@@ -436,6 +438,7 @@ var Slide = function () {
value: function show() {
__WEBPACK_IMPORTED_MODULE_0__utils_dom__["a" /* default */].show(this.el);
this.el.classList.add(CLASSES.CURRENT);
+ this.fire_(Events.SHOW);
}
/**
@@ -1906,6 +1909,10 @@ var Navigation = function () {
this.el.appendChild(this.counter);
this.ws_.el.appendChild(this.el);
+ this.slides = Array.prototype.slice.call(document.querySelectorAll('#webslides section')).map(function (s) {
+ return s.id;
+ });
+
this.bindEvents_();
}
@@ -1922,6 +1929,32 @@ var Navigation = function () {
this.next.addEventListener('click', this.onButtonClicked_.bind(this));
this.prev.addEventListener('click', this.onButtonClicked_.bind(this));
this.counter.addEventListener('click', this.onButtonClicked_.bind(this));
+ document.body.addEventListener('click', this.onBodyClicked_.bind(this));
+ }
+
+ /**
+ * Whenever the body is clicked, check if the element has [data-slide] attr
+ * and if so, navigate to it.
+ * @param {MouseEvent} event Click event
+ */
+
+ }, {
+ key: 'onBodyClicked_',
+ value: function onBodyClicked_(event) {
+ var matches = document.body.matches || document.body.msMatchesSelector;
+ var el = void 0;
+
+ if (matches.call(event.target, '[data-slide]')) {
+ el = event.target;
+ } else if (matches.call(event.target, '[data-slide] *')) {
+ el = event.target.querySelector('[data-slide]');
+ }
+
+ if (el) {
+ event.preventDefault();
+ var i = this.slides.indexOf(el.dataset.slide);
+ this.ws_.goToSlide(i);
+ }
}
/**
diff --git a/static/js/webslides.min.js b/static/js/webslides.min.js
index ddf3790..8b396ed 100644
--- a/static/js/webslides.min.js
+++ b/static/js/webslides.min.js
@@ -1,9 +1,9 @@
/*!
* Name: WebSlides
* Version: 1.5.0
- * Date: 2017-09-16
+ * Date: 2018-01-01
* Description: Making HTML presentations easy
* URL: https://github.com/webslides/webslides#readme
* Credits: @jlantunez, @LuisSacristan, @Belelros
*/
-!function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var i={};t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/static/js/",t(t.s=5)}([function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i(9),o=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=document.createElement(e);return t&&(n.id=t),i&&(n.textContent=i),n}},{key:"once",value:function(e,t,i){var n=function n(s){s.target===e&&(e.removeEventListener(t,n),i(s))};e.addEventListener(t,n,!1)}},{key:"getTransitionEvent",value:function(e){if(a&&!e)return a;a="";for(var t=e||document.createElement("ws"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},n=Object.keys(i),s=0,o=n.length;s2&&void 0!==arguments[2]?arguments[2]:{},n=new s.a(t,{detail:i});e.dispatchEvent(n)}},{key:"toArray",value:function(e){return[].slice.call(e)}},{key:"isFocusableElement",value:function(){var e=!1;if(document.activeElement){var t="inherit"!==document.activeElement.contentEditable&&void 0!==document.activeElement.contentEditable;e=["INPUT","SELECT","OPTION","TEXTAREA"].indexOf(document.activeElement.tagName)>-1||t}return e}},{key:"parseSize",value:function(e){return Number(e.replace(/[^\d\.]/g,""))}},{key:"wrap",value:function(e,t){var i=document.createElement(t);return e.parentElement.insertBefore(i,e),i.appendChild(e),i}},{key:"after",value:function(e,t){var i=t.parentNode;i.lastChild===t?i.appendChild(e):i.insertBefore(e,t.nextSibling)}}]),e}();t.a=l},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,"b",function(){return l}),i.d(t,"a",function(){return r});var s=i(0),o=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:500,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;o=n||document.getElementById("webslides");var a=e-o.scrollTop,r=o.scrollTop;if(!t)return o.scrollTop=e,void i();!function n(l){l+=16;var u=Math.min(1,l/t),c=s.a.swing(u,l*u,e,a,t);o.scrollTop=Math.floor(r+c*a),l0&&void 0!==arguments[0]?arguments[0]:{},i=t.autoslide,s=void 0!==i&&i,o=t.changeOnClick,a=void 0!==o&&o,r=t.loop,l=void 0===r||r,c=t.minWheelDelta,d=void 0===c?40:c,h=t.navigateOnScroll,f=void 0===h||h,v=t.scrollWait,y=void 0===v?450:v,p=t.slideOffset,m=void 0===p?50:p,w=t.showIndex,b=void 0===w||w;if(n(this,e),this.el=document.getElementById("webslides"),!this.el)throw new Error("Couldn't find the webslides container!");this.isMoving=!1,this.slides=null,this.currentSlideI_=-1,this.currentSlide_=null,this.maxSlide_=0,this.isVertical=this.el.classList.contains(u.VERTICAL),this.plugins={},this.options={autoslide:s,changeOnClick:a,loop:l,minWheelDelta:d,navigateOnScroll:f,scrollWait:y,slideOffset:m,showIndex:b},this.initialised=!1,this.removeChildren_(),this.grabSlides_(),this.createPlugins_(),this.initSlides_(),this.onInit_()}return l(e,[{key:"removeChildren_",value:function(){for(var e=this.el.childNodes,t=e.length;t--;){var i=e[t];o.b.isCandidate(i)||this.el.removeChild(i)}}},{key:"createPlugins_",value:function(){var e=this;Object.keys(c).forEach(function(t){var i=c[t];e.plugins[t]=new i(e)})}},{key:"onInit_",value:function(){this.initialised=!0,a.a.fireEvent(this.el,"ws:init"),document.documentElement.classList.add(u.READY)}},{key:"grabSlides_",value:function(){this.slides=a.a.toArray(this.el.childNodes).map(function(e,t){return new o.b(e,t)}),this.maxSlide_=this.slides.length}},{key:"goToSlide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isValidIndexSlide_(e)&&!this.isMoving&&this.currentSlideI_!==e){this.isMoving=!0;var i=!1;null!==t?i=t:this.currentSlideI_>=0&&(i=e>this.currentSlideI_);var n=this.slides[e];null===this.currentSlide_||!this.isVertical||this.plugins.touch&&this.plugins.touch.isEnabled?this.transitionToSlide_(i,n,this.onSlideChange_):this.scrollTransitionToSlide_(i,n,this.onSlideChange_)}}},{key:"scrollTransitionToSlide_",value:function(e,t,i){var n=this;this.el.style.overflow="hidden",e?t.show():(t.moveBeforeFirst(),t.show(),Object(r.a)(this.currentSlide_.el.offsetTop,0)),Object(r.a)(t.el.offsetTop,500,function(){n.currentSlide_.hide(),e&&n.currentSlide_.moveAfterLast(),n.el.style.overflow="auto",setTimeout(function(){i.call(n,t)},150)})}},{key:"transitionToSlide_",value:function(e,t,i){var n=this;Object(r.a)(0,0);var s="slideInRight";e||(t.moveBeforeFirst(),s="slideInLeft"),this.currentSlide_&&(e&&this.currentSlide_.moveAfterLast(),this.currentSlide_.hide()),t.show(),this.initialised&&this.plugins.touch&&this.plugins.touch.isEnabled?(a.a.once(t.el,a.a.getAnimationEvent(),function(){t.el.classList.remove(s),i.call(n,t)}),t.el.classList.add(s)):i.call(this,t)}},{key:"onSlideChange_",value:function(e){this.currentSlide_&&this.currentSlide_.disable(),this.currentSlide_=e,this.currentSlideI_=e.i,this.currentSlide_.enable(),this.isMoving=!1,a.a.fireEvent(this.el,"ws:slide-change",{slides:this.maxSlide_,currentSlide0:this.currentSlideI_,currentSlide:this.currentSlideI_+1})}},{key:"goNext",value:function(){var e=this.currentSlideI_+1;if(e>=this.maxSlide_){if(!this.options.loop)return;e=0}this.goToSlide(e,!0)}},{key:"goPrev",value:function(){var e=this.currentSlideI_-1;if(e<0){if(!this.options.loop)return;e=this.maxSlide_-1}this.goToSlide(e,!1)}},{key:"isValidIndexSlide_",value:function(e){return"number"==typeof e&&e>=0&&e=this.maxSlide_)&&(e=0),0!==e)for(var t=0;t0&&(this.interval_=setInterval(this.ws_.goNext.bind(this.ws_),e))}},{key:"stop",value:function(){this.interval_&&(clearInterval(this.interval_),this.interval_=null)}}]),e}();t.a=a},function(e,t,i){"use strict";var n=window.CustomEvent,s=function(e,t){var i=document.createEvent("CustomEvent");return t?i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):i.initCustomEvent(e,!1,!1,void 0),i},o=function(){try{var e=new n("t",{detail:{a:"b"}});return"t"===e.type&&"b"===e.detail.a}catch(e){}return!1}()?n:s;t.a=o},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;iMath.abs(i);if(this.isGoingUp_=i<0,this.isGoingLeft_=n<0,o){if(s)return;e.preventDefault()}(Math.abs(i+t)>=this.ws_.options.minWheelDelta||Math.abs(n+t)>=this.ws_.options.minWheelDelta)&&(o&&this.isGoingLeft_||!o&&this.isGoingUp_?this.ws_.goPrev():this.ws_.goNext(),e.preventDefault())}}}]),e}();t.a=a},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i(3),o=function(){function e(e,t){for(var i=0;i1&&(this.startTouches=e.getTouchCoordinates(t),this.endTouches=this.startTouches,this.isGesture=!0)}}},{key:"onMove_",value:function(t){if(!this.ws_.isDisabled()){var i=e.normalizeEventInfo(t);this.isGesture?this.endTouches=e.getTouchCoordinates(t):(this.endX_=i.x,this.endY_=i.y)}}},{key:"onStop_",value:function(){if(!this.ws_.isDisabled())if(this.isGesture){var e=Math.sqrt(Math.pow(this.startTouches[0].x-this.startTouches[1].x,2)+Math.pow(this.startTouches[0].y-this.startTouches[1].y,2)),t=Math.sqrt(Math.pow(this.endTouches[0].x-this.endTouches[1].x,2)+Math.pow(this.endTouches[0].y-this.endTouches[1].y,2));e>t&&this.ws_.toggleZoom(),this.isGesture=!1}else{var i=this.startX_-this.endX_,n=this.startY_-this.endY_;Math.abs(i)>Math.abs(n)&&(i<-this.ws_.options.slideOffset?this.ws_.goPrev():i>this.ws_.options.slideOffset&&this.ws_.goNext())}}}],[{key:"getTouchCoordinates",value:function(e){return[{x:e.touches[0].clientX,y:e.touches[0].clientY},{x:e.touches[1].clientX,y:e.touches[1].clientY}]}},{key:"normalizeEventInfo",value:function(e){var t={pageX:0,pageY:0};return void 0!==e.changedTouches?t=e.changedTouches[0]:void 0!==e.originalEvent&&void 0!==e.originalEvent.changedTouches&&(t=e.originalEvent.changedTouches[0]),{x:e.offsetX||e.layerX||t.pageX,y:e.offsetY||e.layerY||t.pageY}}}]),e}();t.a=r},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i(0),o=i(1),a=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=document.createElement(e);return t&&(n.id=t),i&&(n.textContent=i),n}},{key:"once",value:function(e,t,i){var n=function n(s){s.target===e&&(e.removeEventListener(t,n),i(s))};e.addEventListener(t,n,!1)}},{key:"getTransitionEvent",value:function(e){if(a&&!e)return a;a="";for(var t=e||document.createElement("ws"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},n=Object.keys(i),s=0,o=n.length;s2&&void 0!==arguments[2]?arguments[2]:{},n=new s.a(t,{detail:i,bubbles:!0});e.dispatchEvent(n)}},{key:"toArray",value:function(e){return[].slice.call(e)}},{key:"isFocusableElement",value:function(){var e=!1;if(document.activeElement){var t="inherit"!==document.activeElement.contentEditable&&void 0!==document.activeElement.contentEditable;e=["INPUT","SELECT","OPTION","TEXTAREA"].indexOf(document.activeElement.tagName)>-1||t}return e}},{key:"parseSize",value:function(e){return Number(e.replace(/[^\d\.]/g,""))}},{key:"wrap",value:function(e,t){var i=document.createElement(t);return e.parentElement.insertBefore(i,e),i.appendChild(e),i}},{key:"after",value:function(e,t){var i=t.parentNode;i.lastChild===t?i.appendChild(e):i.insertBefore(e,t.nextSibling)}}]),e}();t.a=l},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,"b",function(){return l}),i.d(t,"a",function(){return r});var s=i(0),o=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:500,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;o=n||document.getElementById("webslides");var a=e-o.scrollTop,r=o.scrollTop;if(!t)return o.scrollTop=e,void i();!function n(l){l+=16;var u=Math.min(1,l/t),c=s.a.swing(u,l*u,e,a,t);o.scrollTop=Math.floor(r+c*a),l0&&void 0!==arguments[0]?arguments[0]:{},i=t.autoslide,s=void 0!==i&&i,o=t.changeOnClick,a=void 0!==o&&o,r=t.loop,l=void 0===r||r,c=t.minWheelDelta,d=void 0===c?40:c,h=t.navigateOnScroll,f=void 0===h||h,v=t.scrollWait,y=void 0===v?450:v,p=t.slideOffset,m=void 0===p?50:p,b=t.showIndex,w=void 0===b||b;if(n(this,e),this.el=document.getElementById("webslides"),!this.el)throw new Error("Couldn't find the webslides container!");this.isMoving=!1,this.slides=null,this.currentSlideI_=-1,this.currentSlide_=null,this.maxSlide_=0,this.isVertical=this.el.classList.contains(u.VERTICAL),this.plugins={},this.options={autoslide:s,changeOnClick:a,loop:l,minWheelDelta:d,navigateOnScroll:f,scrollWait:y,slideOffset:m,showIndex:w},this.initialised=!1,this.removeChildren_(),this.grabSlides_(),this.createPlugins_(),this.initSlides_(),this.onInit_()}return l(e,[{key:"removeChildren_",value:function(){for(var e=this.el.childNodes,t=e.length;t--;){var i=e[t];o.b.isCandidate(i)||this.el.removeChild(i)}}},{key:"createPlugins_",value:function(){var e=this;Object.keys(c).forEach(function(t){var i=c[t];e.plugins[t]=new i(e)})}},{key:"onInit_",value:function(){this.initialised=!0,a.a.fireEvent(this.el,"ws:init"),document.documentElement.classList.add(u.READY)}},{key:"grabSlides_",value:function(){this.slides=a.a.toArray(this.el.childNodes).map(function(e,t){return new o.b(e,t)}),this.maxSlide_=this.slides.length}},{key:"goToSlide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isValidIndexSlide_(e)&&!this.isMoving&&this.currentSlideI_!==e){this.isMoving=!0;var i=!1;null!==t?i=t:this.currentSlideI_>=0&&(i=e>this.currentSlideI_);var n=this.slides[e];null===this.currentSlide_||!this.isVertical||this.plugins.touch&&this.plugins.touch.isEnabled?this.transitionToSlide_(i,n,this.onSlideChange_):this.scrollTransitionToSlide_(i,n,this.onSlideChange_)}}},{key:"scrollTransitionToSlide_",value:function(e,t,i){var n=this;this.el.style.overflow="hidden",e?t.show():(t.moveBeforeFirst(),t.show(),Object(r.a)(this.currentSlide_.el.offsetTop,0)),Object(r.a)(t.el.offsetTop,500,function(){n.currentSlide_.hide(),e&&n.currentSlide_.moveAfterLast(),n.el.style.overflow="auto",setTimeout(function(){i.call(n,t)},150)})}},{key:"transitionToSlide_",value:function(e,t,i){var n=this;Object(r.a)(0,0);var s="slideInRight";e||(t.moveBeforeFirst(),s="slideInLeft"),this.currentSlide_&&(e&&this.currentSlide_.moveAfterLast(),this.currentSlide_.hide()),t.show(),this.initialised&&this.plugins.touch&&this.plugins.touch.isEnabled?(a.a.once(t.el,a.a.getAnimationEvent(),function(){t.el.classList.remove(s),i.call(n,t)}),t.el.classList.add(s)):i.call(this,t)}},{key:"onSlideChange_",value:function(e){this.currentSlide_&&this.currentSlide_.disable(),this.currentSlide_=e,this.currentSlideI_=e.i,this.currentSlide_.enable(),this.isMoving=!1,a.a.fireEvent(this.el,"ws:slide-change",{slides:this.maxSlide_,currentSlide0:this.currentSlideI_,currentSlide:this.currentSlideI_+1})}},{key:"goNext",value:function(){var e=this.currentSlideI_+1;if(e>=this.maxSlide_){if(!this.options.loop)return;e=0}this.goToSlide(e,!0)}},{key:"goPrev",value:function(){var e=this.currentSlideI_-1;if(e<0){if(!this.options.loop)return;e=this.maxSlide_-1}this.goToSlide(e,!1)}},{key:"isValidIndexSlide_",value:function(e){return"number"==typeof e&&e>=0&&e=this.maxSlide_)&&(e=0),0!==e)for(var t=0;t0&&(this.interval_=setInterval(this.ws_.goNext.bind(this.ws_),e))}},{key:"stop",value:function(){this.interval_&&(clearInterval(this.interval_),this.interval_=null)}}]),e}();t.a=a},function(e,t,i){"use strict";var n=window.CustomEvent,s=function(e,t){var i=document.createEvent("CustomEvent");return t?i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):i.initCustomEvent(e,!1,!1,void 0),i},o=function(){try{var e=new n("t",{detail:{a:"b"}});return"t"===e.type&&"b"===e.detail.a}catch(e){}return!1}()?n:s;t.a=o},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;iMath.abs(i);if(this.isGoingUp_=i<0,this.isGoingLeft_=n<0,o){if(s)return;e.preventDefault()}(Math.abs(i+t)>=this.ws_.options.minWheelDelta||Math.abs(n+t)>=this.ws_.options.minWheelDelta)&&(o&&this.isGoingLeft_||!o&&this.isGoingUp_?this.ws_.goPrev():this.ws_.goNext(),e.preventDefault())}}}]),e}();t.a=a},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i(3),o=function(){function e(e,t){for(var i=0;i1&&(this.startTouches=e.getTouchCoordinates(t),this.endTouches=this.startTouches,this.isGesture=!0)}}},{key:"onMove_",value:function(t){if(!this.ws_.isDisabled()){var i=e.normalizeEventInfo(t);this.isGesture?this.endTouches=e.getTouchCoordinates(t):(this.endX_=i.x,this.endY_=i.y)}}},{key:"onStop_",value:function(){if(!this.ws_.isDisabled())if(this.isGesture){var e=Math.sqrt(Math.pow(this.startTouches[0].x-this.startTouches[1].x,2)+Math.pow(this.startTouches[0].y-this.startTouches[1].y,2)),t=Math.sqrt(Math.pow(this.endTouches[0].x-this.endTouches[1].x,2)+Math.pow(this.endTouches[0].y-this.endTouches[1].y,2));e>t&&this.ws_.toggleZoom(),this.isGesture=!1}else{var i=this.startX_-this.endX_,n=this.startY_-this.endY_;Math.abs(i)>Math.abs(n)&&(i<-this.ws_.options.slideOffset?this.ws_.goPrev():i>this.ws_.options.slideOffset&&this.ws_.goNext())}}}],[{key:"getTouchCoordinates",value:function(e){return[{x:e.touches[0].clientX,y:e.touches[0].clientY},{x:e.touches[1].clientX,y:e.touches[1].clientY}]}},{key:"normalizeEventInfo",value:function(e){var t={pageX:0,pageY:0};return void 0!==e.changedTouches?t=e.changedTouches[0]:void 0!==e.originalEvent&&void 0!==e.originalEvent.changedTouches&&(t=e.originalEvent.changedTouches[0]),{x:e.offsetX||e.layerX||t.pageX,y:e.offsetY||e.layerY||t.pageY}}}]),e}();t.a=r},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i(0),o=i(1),a=function(){function e(e,t){for(var i=0;i