/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/dom-locky@1.0.1/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lockyOn=exports.lockyGroup=void 0;var _utils=require("./utils"),_handleScroll=require("./handleScroll"),_defaultEvents=require("./defaultEvents"),_isInside=require("./isInside");function _toConsumableArray(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}var lockyGroup=exports.lockyGroup=function(e,r){[].concat(_toConsumableArray(document.querySelectorAll(e))).forEach((function(e){return e.setAttribute(_isInside.LOCKY_GROUP,r)}))},lockyOn=exports.lockyOn=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error("locky: selector",e,"is not matching any element.");var n,o,l=0,u=function(e,n){var o=(0,_utils.getHandler)(e,n,r.onEscape);return o?function(e){(function(e){return t&&(0,_isInside.isInside)(t,e.target)})(e)||(0,_isInside.shouldIgnoreEvent)(e.target)||o(e)}:null},c=(n=r.noDefault,o=r.events,Object.assign({},n?{}:_defaultEvents.EVENTS,o||{})),i=Object.keys(c).map((function(e){return(0,_utils.addEvent)(document,e,u(e,c[e]),!0)})).filter(Boolean),s=[];return c.scroll&&s.push.apply(s,[(0,_utils.addEvent)(t,"wheel",(function(e){return(0,_handleScroll.handleScroll)(t,e,e.deltaY,r.preventOnly)}),!0),(0,_utils.addEvent)(t,"touchstart",(function(e){l=(0,_handleScroll.getTouchY)(e)}),!0),(0,_utils.addEvent)(t,"touchmove",(function(e){return(0,_handleScroll.handleScroll)(t,e,l-(0,_handleScroll.getTouchY)(e),r.preventOnly)}),!0)]),r.group&&lockyGroup(e,r.group),function(){i.forEach(_utils.removeEvent),s.forEach(_utils.removeEvent)}};
//# sourceMappingURL=/sm/c487aaf93171f3c69e16903c0edf8ac440b3f81c522295aa1a2035fd0794a20b.map