/**
 * Kendo UI v2023.3.1114 (http://www.telerik.com/kendo-ui)
 * Copyright 2023 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
 *
 * Kendo UI commercial licenses may be obtained at
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
 * If you do not own a commercial license, this file shall be governed by the trial license terms.
 */
import"./kendo.core.js";import"./kendo.userevents.js";var __meta__={id:"touch",name:"Touch",category:"mobile",description:"The kendo Touch widget provides a cross-platform compatible API for handling user-initiated touch events, multi-touch gestures and event sequences (drag, swipe, etc.). ",depends:["core","userevents"]};!function(e,t){var n=window.kendo,i=n.ui.Widget,a=Math.abs,o=i.extend({init:function(e,t){var a=this;function o(e){return function(t){a._triggerTouch(e,t)}}function r(e){return function(t){a.trigger(e,{touches:t.touches,distance:t.distance,center:t.center,event:t.event})}}i.fn.init.call(a,e,t),t=a.options,e=a.element,a.wrapper=e,a.events=new n.UserEvents(e,{filter:t.filter,surface:t.surface,minHold:t.minHold,multiTouch:t.multiTouch,allowSelection:!0,fastTap:t.fastTap,press:o("touchstart"),hold:o("hold"),tap:a._tap.bind(a),gesturestart:r("gesturestart"),gesturechange:r("gesturechange"),gestureend:r("gestureend")}),t.enableSwipe?(a.events.bind("start",a._swipestart.bind(a)),a.events.bind("move",a._swipemove.bind(a))):(a.events.bind("start",a._dragstart.bind(a)),a.events.bind("move",o("drag")),a.events.bind("end",o("dragend"))),n.notify(a)},events:["touchstart","dragstart","drag","dragend","tap","doubletap","hold","swipe","gesturestart","gesturechange","gestureend"],options:{name:"Touch",surface:null,global:!1,fastTap:!1,filter:null,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},destroy:function(){i.fn.destroy.call(this),this.events.destroy()},_triggerTouch:function(e,t){this.trigger(e,{touch:t.touch,event:t.event})&&t.preventDefault()},_tap:function(e){var t=this,i=t.lastTap,a=e.touch;i&&a.endTime-i.endTime<t.options.doubleTapTimeout&&n.touchDelta(a,i).distance<20?(t._triggerTouch("doubletap",e),t.lastTap=null):(t._triggerTouch("tap",e),t.lastTap=a)},_dragstart:function(e){this._triggerTouch("dragstart",e)},_swipestart:function(e){2*a(e.x.velocity)>=a(e.y.velocity)&&e.sender.capture()},_swipemove:function(e){var t=this.options,n=e.touch,i=e.event.timeStamp-n.startTime,o=n.x.initialDelta>0?"right":"left";a(n.x.initialDelta)>=t.minXDelta&&a(n.y.initialDelta)<t.maxYDelta&&i<t.maxDuration&&(this.trigger("swipe",{direction:o,touch:e.touch}),n.cancel())}});n.ui.plugin(o)}(window.kendo.jQuery);var kendo$1=kendo;export{kendo$1 as default};
//# sourceMappingURL=kendo.touch.js.map
