PageSourceSearch

https://sqirlla.com/cdn/shop/t/14/assets/js-polyfill-smooth-scroll.js?v=148379743528603512151782235822

js sqirlla.com collected 2026-10-04 00:26:06 UTC 8,262 bytes, 2 lines download raw bytes

1/*  https://www.npmjs.com/package/seamless-scroll-polyfill  */
2!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).seamless={})}(this,function(e){"use strict";var Y=function(){return(Y=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function f(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,r,i=o.call(e),l=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)l.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return l}function u(){return(performance||Date).now()}function I(e,t){var o=p.bind(e);if(void 0!==t.left||void 0!==t.top){var n=e.scrollLeft,r=e.scrollTop,i=t.left,l=void 0===i?n:i,i=t.top,i=void 0===i?r:i;if("smooth"!==t.behavior)return p.call(e,l,r);var a=function(){window.removeEventListener("wheel",s),window.removeEventListener("touchmove",s)},c={timeStamp:u(),duration:t.duration,startX:n,startY:r,targetX:l,targetY:i,rafId:0,method:o,timingFunc:t.timingFunc,callback:a},s=function(){cancelAnimationFrame(c.rafId),a()};window.addEventListener("wheel",s,{passive:!0,once:!0}),window.addEventListener("touchmove",s,{passive:!0,once:!0}),w(c)}}function d(e,t){var o=(t.left||0)+e.scrollLeft,n=(t.top||0)+e.scrollTop;return I(e,Y({},t,{left:o,top:n}))}function c(e,t){return(window.scroll||window.scrollTo)(e,t)}function W(e){if(void 0!==e.left||void 0!==e.top){var t=window.scrollX||window.pageXOffset,o=window.scrollY||window.pageYOffset,n=e.left,r=void 0===n?t:n,n=e.top,n=void 0===n?o:n;if("smooth"!==e.behavior)return c(r,n);var i=function(){window.removeEventListener("wheel",a),window.removeEventListener("touchmove",a)},l={timeStamp:u(),duration:e.duration,startX:t,startY:o,targetX:r,targetY:n,rafId:0,method:c,timingFunc:e.timingFunc,callback:i},a=function(){cancelAnimationFrame(l.rafId),i()};window.addEventListener("wheel",a,{passive:!0,once:!0}),window.addEventListener("touchmove",a,{passive:!0,once:!0}),w(l)}}function m(e,t,o,n){return"center"===(e=0===t&&o||1===t&&!o?e.inline:e.block)?1:"nearest"===e?0:"start"===e?0===t?n?5:4:2:"end"===e?0===t?n?4:5:3:o?0===t?0:2:0===t?4:0}var w=function(e){var t=(u()-e.timeStamp)/(e.duration||500);if(1<t)return e.method(e.targetX,e.targetY),void e.callback();var o=(e.timingFunc||function(e){return.5*(1-Math.cos(Math.PI*e))})(t),t=e.startX+(e.targetX-e.startX)*o,o=e.startY+(e.targetY-e.startY)*o;e.method(t,o),e.rafId=requestAnimationFrame(function(){w(e)})},p=Element.prototype.scroll||Element.prototype.scrollTo||function(e,t){this.scrollLeft=e,this.scrollTop=t},h=document.documentElement.scrollIntoView;function L(e,t,o,n,r,i,l,a){return i<e&&t<l||e<i&&l<t?0:i<=e&&a<=o||t<=l&&o<=a?i-e-n:t<l&&a<o||i<e&&o<a?l-t+r:0}function t(e){return"visible"!==e&&"clip"!==e}function M(e){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){e=getComputedStyle(e);return t(e.overflowY)||t(e.overflowX)}}function B(e){return(e=e.parentNode)&&(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e)}function v(e,v){var t,o;if(e.ownerDocument.documentElement.contains(e)){if("smooth"!==v.behavior)return h.call(e,"end"!==v.block);for(var b=document.scrollingElement||document.documentElement,n=[],r=B(e);null!==r;r=B(r)){if(r===b){n.push(r);break}r===document.body&&M(r)&&!M(document.documentElement)||M(r)&&n.push(r)}var i,l,a,y=window.visualViewport?window.visualViewport.width:innerWidth,g=window.visualViewport?window.visualViewport.height:innerHeight,E=window.scrollX||window.pageXOffset,T=window.scrollY||window.pageYOffset,c=e.getBoundingClientRect(),O=c.height,j=c.width,s=c.top,u=c.right,f=c.bottom,d=c.left,c=getComputedStyle(e).writingMode,e="horizontal-tb"===c,c="vertical-rl"===c,k=m(v,0,e,c),x=m(v,1,e,c),S=function(){switch(x){case 2:case 0:return s;case 3:return f;default:return s+O/2}}(),F=function(){switch(k){case 1:return d+j/2;case 5:return u;default:return d}}(),X=[];try{for(var w=(i=n,l="function"==typeof Symbol&&i[Symbol.iterator],a=0,l?l.call(i):{next:function(){return i&&a>=i.length&&(i=void 0),{value:i&&i[a++],done:!i}}}),p=w.next();!p.done;p=w.next())!function(e){var t=e.getBoundingClientRect(),o=t.height,n=t.width,r=t.top,i=t.right,l=t.bottom,a=t.left,c=getComputedStyle(e),s=parseInt(c.borderLeftWidth,10),u=parseInt(c.borderTopWidth,10),f=parseInt(c.borderRightWidth,10),d=parseInt(c.borderBottomWidth,10),w=0,p=0,m="offsetWidth"in e?e.offsetWidth-e.clientWidth-s-f:0,h="offsetHeight"in e?e.offsetHeight-e.clientHeight-u-d:0;if(b===e){switch(x){case 2:w=S;break;case 3:w=S-g;break;case 1:w=S-g/2;break;case 0:w=L(T,T+g,g,u,d,T+S,T+S+O,O)}switch(k){case 4:p=F;break;case 5:p=F-y;break;case 1:p=F-y/2;break;case 0:p=L(E,E+y,y,s,f,E+F,E+F+j,j)}w=Math.max(0,w+T),p=Math.max(0,p+E),X.push(function(){return W(Y({},v,{top:w,left:p}))})}else{switch(x){case 2:w=S-r-u;break;case 3:w=S-l+d+h;break;case 1:w=S-(r+o/2)+h/2;break;case 0:w=L(r,l,o,u,d+h,S,S+O,O)}switch(k){case 4:p=F-a-s;break;case 5:p=F-i+f+m;break;case 1:p=F-(a+n/2)+m/2;break;case 0:p=L(a,i,n,s,f+m,F,F+j,j)}t=e.scrollLeft,c=e.scrollTop,w=Math.max(0,Math.min(c+w,e.scrollHeight-o+h)),p=Math.max(0,Math.min(t+p,e.scrollWidth-n+m));S+=c-w,F+=t-p,X.push(function(){return I(e,Y({},v,{top:w,left:p}))})}}(p.value)}catch(e){t={error:e}}
2finally{try{p&&!p.done&&(o=w.return)&&o.call(w)}finally{if(t)throw t.error}}X.forEach(function(e){return e()})}}function b(e){var t=(e.left||0)+(window.scrollX||window.pageXOffset),o=(e.top||0)+(window.scrollY||window.pageYOffset);return"smooth"!==e.behavior?c(t,o):W(Y({},e,{left:t,top:o}))}function o(e){var o,n,r,i,l,a,c,s,u,t;"scrollBehavior"in document.documentElement.style||(o=e,n=window.scroll||window.scrollTo,window.scroll=function(){var e=f(arguments,2),t=e[0],t=void 0===t?0:t,e=e[1],e=void 0===e?0:e;if("number"==typeof t&&"number"==typeof e)return n.call(this,t,e);if(Object(t)!==t)throw new TypeError("Failed to execute 'scroll' on 'Window': parameter 1 ('options') is not an object.");return W(Y({},t,o))},r=e,i=window.scrollTo||window.scroll,window.scrollTo=function(){var e=f(arguments,2),t=e[0],t=void 0===t?0:t,e=e[1],e=void 0===e?0:e;if("number"==typeof t&&"number"==typeof e)return i.call(this,t,e);if(Object(t)!==t)throw new TypeError("Failed to execute 'scrollTo' on 'Window': parameter 1 ('options') is not an object.");return W(Y({},t,r))},l=e,a=window.scrollBy,window.scrollBy=function(){var e=f(arguments,2),t=e[0],t=void 0===t?0:t,e=e[1],e=void 0===e?0:e;if("number"==typeof t&&"number"==typeof e)return a(t,e);if(Object(t)!==t)throw new TypeError("Failed to execute 'scrollBy' on 'Window': parameter 1 ('options') is not an object.");return b(Y({},t,l))},c=e,Element.prototype.scroll=function(){var e=f(arguments,2),t=e[0],t=void 0===t?0:t,e=e[1],e=void 0===e?0:e;if("number"==typeof t&&"number"==typeof e)return p.call(this,t,e);if(Object(t)!==t)throw new TypeError("Failed to execute 'scroll' on 'Element': parameter 1 ('options') is not an object.");return I(this,Y({},t,c))},s=e,Element.prototype.scrollTo=function(){var e=f(arguments,2),t=e[0],t=void 0===t?0:t,e=e[1],e=void 0===e?0:e;if("number"==typeof t&&"number"==typeof e)return p.call(this,t,e);if(Object(t)!==t)throw new TypeError("Failed to execute 'scrollTo' on 'Element': parameter 1 ('options') is not an object.");return I(this,Y({},t,s))},u=e,Element.prototype.scrollBy=function(){var e=f(arguments,2),t=e[0],t=void 0===t?0:t,e=e[1],e=void 0===e?0:e;if("number"==typeof t&&"number"==typeof e)return d(this,{left:t,top:e});if(Object(t)!==t)throw new TypeError("Failed to execute 'scrollBy' on 'Element': parameter 1 ('options') is not an object.");return d(this,Y({},t,u))},t=e,Element.prototype.scrollIntoView=function(e){if("boolean"==typeof e)return h.call(this,e);if(Object(e)!==e)throw new TypeError("Failed to execute 'scrollIntoView' on 'Element': parameter 1 ('options') is not an object.");return v(this,Y({},e,t))})}e.elementScroll=I,e.elementScrollBy=d,e.elementScrollIntoView=v,e.elementScrollTo=I,e.polyfill=o,e.seamless=o,e.windowScroll=W,e.windowScrollBy=b,e.windowScrollTo=W,Object.defineProperty(e,"__esModule",{value:!0})});

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.