1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.scrollLock=t():e.scrollLock=t()}(this,function(){return function(e){var t={};function l(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,l),o.l=!0,o.exports}return l.m=e,l.c=t,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)l.d(r,o,function(t){return e[t]}.bind(null,o));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="",l(l.s=0)}([function(e,t,l){"use strict";l.r(t);var r=function(e){return Array.isArray(e)?e:[e]},o=function(e){return e instanceof Node},n=function(e,t){if(e&&t){e=function(e){return e instanceof NodeList}(e)?e:[e];for(var l=0;l<e.length&&!0!==t(e[l],l,e.length);l++);}},c=function(e){return console.error("[scroll-lock] ".concat(e))},a=function(e){if(Array.isArray(e))return e.join(", ")},i=function(e){var t=[];return n(e,function(e){return t.push(e)}),t},u=function(e,t){var l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document;if(l&&-1!==i(r.querySelectorAll(t)).indexOf(e))return e;for(;(e=e.parentElement)&&-1===i(r.querySelectorAll(t)).indexOf(e););return e},d=function(e,t){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;return-1!==i(l.querySelectorAll(t)).indexOf(e)},s=function(e){if(e)return"hidden"===getComputedStyle(e).overflow},f=function(e){if(e)return!!s(e)||e.scrollTop<=0},p=function(e){if(e){if(s(e))return!0;var t=e.scrollTop,l=e.scrollHeight;return t+e.offsetHeight>=l}},g=function(e){if(e)return!!s(e)||e.scrollLeft<=0},h=function(e){if(e){if(s(e))return!0;var t=e.scrollLeft,l=e.scrollWidth;return t+e.offsetWidth>=l}};function v(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}l.d(t,"disablePageScroll",function(){return m}),l.d(t,"enablePageScroll",function(){return y}),l.d(t,"getScrollState",function(){return k}),l.d(t,"clearQueueScrollLocks",function(){return L}),l.d(t,"getTargetScrollBarWidth",function(){return w}),l.d(t,"getCurrentTargetScrollBarWidth",function(){return G}),l.d(t,"getPageScrollBarWidth",function(){return F}),l.d(t,"getCurrentPageScrollBarWidth",function(){return T}),l.d(t,"addScrollableTarget",function(){return P}),l.d(t,"removeScrollableTarget",function(){return O}),l.d(t,"addScrollableSelector",function(){return W}),l.d(t,"removeScrollableSelector",function(){return Y}),l.d(t,"addLockableTarget",function(){return x}),l.d(t,"addLockableSelector",function(){return E}),l.d(t,"setFillGapMethod",function(){return j}),l.d(t,"addFillGapTarget",function(){return M}),l.d(t,"removeFillGapTarget",function(){return q}),l.d(t,"addFillGapSelector",function(){return C}),l.d(t,"removeFillGapSelector",function(){return A}),l.d(t,"refillGaps",function(){return N});var b=["padding","margin","width","max-width","none"],S={scroll:!0,queue:0,scrollableSelectors:["[data-scroll-lock-scrollable]"],lockableSelectors:["body","[data-scroll-lock-lockable]"],fillGapSelectors:["body","[data-scroll-lock-fill-gap]","[data-scroll-lock-lockable]"],fillGapMethod:b[0],startTouchY:0,startTouchX:0},m=function(e){S.queue<=0&&(S.scroll=!1,B(),X()),P(e),S.queue++},y=function(e){S.queue>0&&S.queue--,S.queue<=0&&(S.scroll=!0,K(),Q()),O(e)},k=function(){return S.scroll},L=function(){S.queue=0},w=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(e)){var l=e.style.overflowY;t?k()||(e.style.overflowY=e.dataset.scrollLockSavedOverflowYProperty):e.style.overflowY="scroll";var r=G(e);return e.style.overflowY=l,r}return 0},G=function(e){if(o(e)){if(e===document.body||e===document.documentElement){var t=document.documentElement.clientWidth;return window.innerWidth-t}var l=e.style.borderLeftWidth,r=e.style.borderRightWidth;e.style.borderLeftWidth="0px",e.style.borderRightWidth="0px";var n=e.offsetWidth-e.clientWidth;return e.style.borderLeftWidth=l,e.style.borderRightWidth=r,n}return 0},F=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return w(document.body,e)},T=function(){return G(document.body)},P=function(e){e&&r(e).map(function(e){n(e,function(e){o(e)?e.dataset.scrollLockScrollable="":c('"'.concat(e,'" is not a Element.'))})})},O=function(e){e&&r(e).map(function(e){n(e,function(e){o(e)?delete e.dataset.scrollLockScrollable:c('"'.concat(e,'" is not a Element.'))})})}
1,W=function(e){e&&r(e).map(function(e){S.scrollableSelectors.push(e)})},Y=function(e){e&&r(e).map(function(e){S.scrollableSelectors=S.scrollableSelectors.filter(function(t){return t!==e})})},x=function(e){e&&(r(e).map(function(e){n(e,function(e){o(e)?e.dataset.scrollLockLockable="":c('"'.concat(e,'" is not a Element.'))})}),k()||B())},E=function(e){e&&(r(e).map(function(e){S.lockableSelectors.push(e)}),k()||B(),C(e))},j=function(e){if(e)if(-1!==b.indexOf(e))S.fillGapMethod=e,N();else{var t=b.join(", ");c('"'.concat(e,'" method is not available!\nAvailable fill gap methods: ').concat(t,"."))}},M=function(e){e&&r(e).map(function(e){n(e,function(e){o(e)?(e.dataset.scrollLockFillGap="",S.scroll||H(e)):c('"'.concat(e,'" is not a Element.'))})})},q=function(e){e&&r(e).map(function(e){n(e,function(e){o(e)?(delete e.dataset.scrollLockFillGap,S.scroll||J(e)):c('"'.concat(e,'" is not a Element.'))})})},C=function(e){e&&r(e).map(function(e){S.fillGapSelectors.push(e),S.scroll||D(e)})},A=function(e){e&&r(e).map(function(e){S.fillGapSelectors=S.fillGapSelectors.filter(function(t){return t!==e}),S.scroll||z(e)})},N=function(){S.scroll||X()},B=function(){var e=a(S.lockableSelectors);R(e)},K=function(){var e=a(S.lockableSelectors);U(e)},R=function(e){var t=document.querySelectorAll(e);n(t,function(e){_(e)})},U=function(e){var t=document.querySelectorAll(e);n(t,function(e){I(e)})},_=function(e){if(o(e)&&"true"!==e.dataset.scrollLockLocked){var t=window.getComputedStyle(e);e.dataset.scrollLockSavedOverflowYProperty=t.overflowY,e.dataset.scrollLockSavedInlineOverflowProperty=e.style.overflow,e.dataset.scrollLockSavedInlineOverflowYProperty=e.style.overflowY,e.style.overflow="hidden",e.dataset.scrollLockLocked="true"}},I=function(e){o(e)&&"true"===e.dataset.scrollLockLocked&&(e.style.overflow=e.dataset.scrollLockSavedInlineOverflowProperty,e.style.overflowY=e.dataset.scrollLockSavedInlineOverflowYProperty,delete e.dataset.scrollLockSavedOverflowYProperty,delete e.dataset.scrollLockSavedInlineOverflowProperty,delete e.dataset.scrollLockSavedInlineOverflowYProperty,delete e.dataset.scrollLockLocked)},X=function(){S.fillGapSelectors.map(function(e){D(e)})},Q=function(){S.fillGapSelectors.map(function(e){z(e)})},D=function(e){var t=document.querySelectorAll(e),l=-1!==S.lockableSelectors.indexOf(e);n(t,function(e){H(e,l)})},H=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(e)){var l;if(""===e.dataset.scrollLockLockable||t)l=w(e,!0);else{var r=u(e,a(S.lockableSelectors));l=w(r,!0)}"true"===e.dataset.scrollLockFilledGap&&J(e);var n=window.getComputedStyle(e);if(e.dataset.scrollLockFilledGap="true",e.dataset.scrollLockCurrentFillGapMethod=S.fillGapMethod,"margin"===S.fillGapMethod){var c=parseFloat(n.marginRight);e.style.marginRight="".concat(c+l,"px")}else if("width"===S.fillGapMethod)e.style.width="calc(100% - ".concat(l,"px)");else if("max-width"===S.fillGapMethod)e.style.maxWidth="calc(100% - ".concat(l,"px)");else if("padding"===S.fillGapMethod){var i=parseFloat(n.paddingRight);e.style.paddingRight="".concat(i+l,"px")}}},z=function(e){var t=document.querySelectorAll(e);n(t,function(e){J(e)})},J=function(e){if(o(e)&&"true"===e.dataset.scrollLockFilledGap){var t=e.dataset.scrollLockCurrentFillGapMethod;delete e.dataset.scrollLockFilledGap,delete e.dataset.scrollLockCurrentFillGapMethod,"margin"===t?e.style.marginRight="":"width"===t?e.style.width="":"max-width"===t?e.style.maxWidth="":"padding"===t&&(e.style.paddingRight="")}};"undefined"!=typeof window&&window.addEventListener("resize",function(e){N()}),"undefined"!=typeof document&&(document.addEventListener("touchstart",function(e){S.scroll||(S.startTouchY=e.touches[0].clientY,S.startTouchX=e.touches[0].clientX)}),document.addEventListener("touchmove",function(e){if(!S.scroll){var t=S.startTouchY,l=S.startTouchX,r=e.touches[0].clientY,o=e.touches[0].clientX;if(e.touches.length<2){var n=a(S.scrollableSelectors),c={up:t<r,down:t>r,left:l<o,right:l>o},i={up:t+3<r,down:t-3>r,left:l+3<o,right:l-3>o};!function t(l){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l){var o=u(l,n,!1);if(function(e){return d(e,'input[type="range"]')}(l))return!1;if(r||function(e){return d(e,'textarea, [contenteditable="true"]')}(l)&&u(l,n)||d(l,n)){var a=!1;g(l)&&h(l)?(c.up&&f(l)||c.down&&p(l))&&(a=!0):f(l)&&p(l)?(c.left&&g(l)||c.right&&h(l))&&(a=!0):(i.up&&f(l)||i.down&&p(l)||i.left&&g(l)||i.right&&h(l))&&(a=!0),a&&(o?t(o,!0):e.preventDefault())}else t(o)}else e.preventDefault()}(e.target)}}},{passive:!1}
vendor: 2,548 bytes, line 1
1),document.addEventListener("touchend",function(e){S.scroll||(S.startTouchY=0,S.startTouchX=0)}));var V={hide:function(e){c('"hide" is deprecated! Use "disablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#disablepagescrollscrollabletarget'),m(e)},show:function(e){c('"show" is deprecated! Use "enablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#enablepagescrollscrollabletarget'),y(e)},toggle:function(e){c('"toggle" is deprecated! Do not use it.'),k()?m():y(e)},getState:function(){return c('"getState" is deprecated! Use "getScrollState" instead. \n https://github.com/FL3NKEY/scroll-lock#getscrollstate'),k()},getWidth:function(){return c('"getWidth" is deprecated! Use "getPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getpagescrollbarwidth'),F()},getCurrentWidth:function(){return c('"getCurrentWidth" is deprecated! Use "getCurrentPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getcurrentpagescrollbarwidth'),T()},setScrollableTargets:function(e){c('"setScrollableTargets" is deprecated! Use "addScrollableTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addscrollabletargetscrollabletarget'),P(e)},setFillGapSelectors:function(e){c('"setFillGapSelectors" is deprecated! Use "addFillGapSelector" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgapselectorfillgapselector'),C(e)},setFillGapTargets:function(e){c('"setFillGapTargets" is deprecated! Use "addFillGapTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgaptargetfillgaptarget'),M(e)},clearQueue:function(){c('"clearQueue" is deprecated! Use "clearQueueScrollLocks" instead. \n https://github.com/FL3NKEY/scroll-lock#clearqueuescrolllocks'),L()}},Z=function(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))),r.forEach(function(t){v(e,t,l[t])})}return e}({disablePageScroll:m,enablePageScroll:y,getScrollState:k,clearQueueScrollLocks:L,getTargetScrollBarWidth:w,getCurrentTargetScrollBarWidth:G,getPageScrollBarWidth:F,getCurrentPageScrollBarWidth:T,addScrollableSelector:W,removeScrollableSelector:Y,addScrollableTarget:P,removeScrollableTarget:O,addLockableSelector:E,addLockableTarget:x,addFillGapSelector:C,removeFillGapSelector:A,addFillGapTarget:M,removeFillGapTarget:q,setFillGapMethod:j,refillGaps:N,_state:S},V);t.default=Z}]).default});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.