!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define("vLongpress",[],t):"object"===typeof exports?exports.vLongpress=t():e.vLongpress=t()}("undefined"!==typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return r}});const n=/(?:^\[object\s(.*?)\]$)/;var o=e=>Object.prototype.toString.call(e).replace(n,"$1").toLowerCase();function c(e,t){let{callback:n,delay:o}=t,c=null;function r(e){"click"===e.type&&0!==e.button||null===c&&(c=setTimeout((()=>{!function(e){n(e)}(e)}),o||2e3))}function l(e){null!==c&&(clearTimeout(c),c=null)}e.addEventListener("mousedown",r),e.addEventListener("touchstart",r),e.addEventListener("click",l),e.addEventListener("mouseout",l),e.addEventListener("touchend",l),e.addEventListener("touchcancel",l)}var r={name:"longpress",beforeMount(e,t){let{value:n}=t;if("function"===o(n))c(e,{callback:n});else{if("object"!==o(n))throw new Error("[v-longpress]: The 'value' must be an object ({ callback: Function, delay?: number })");"function"!==o(n.callback)&&console.warn("[v-longpress]: The 'callback' must be a function"),c(e,n)}},updated(e,t){let{value:n}=t;e.$value=n},unmounted(e){e.removeEventListener("click",e.handler)}};return t=t.default}()}));