"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("scroll-into-view-if-needed"));let o;const l=()=>(o||(o="performance"in window?performance.now.bind(performance):Date.now),o());function n(e){const t=l(),o=Math.min((t-e.startTime)/e.duration,1),r=e.ease(o),s=e.startX+(e.x-e.startX)*r,i=e.startY+(e.y-e.startY)*r;e.method(s,i,o,r),s!==e.x||i!==e.y?requestAnimationFrame((()=>n(e))):e.cb()}function r(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e=>1+--e*e*e*e*e,i=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const c=e,d=e.scrollLeft,u=e.scrollTop;n({scrollable:c,method:(t,o,l,n)=>{const r=Math.ceil(t),s=Math.ceil(o);e.scrollLeft=r,e.scrollTop=s,null==a||a({target:e,elapsed:l,value:n,left:r,top:s})},startTime:l(),startX:d,startY:u,x:t,y:o,duration:r,ease:s,cb:i})}const s=e=>e&&!e.behavior||"smooth"===e.behavior;const i=function(e,o){const l=o||{};return s(l)?t.default(e,{block:l.block,inline:l.inline,scrollMode:l.scrollMode,boundary:l.boundary,skipOverflowHiddenElements:l.skipOverflowHiddenElements,behavior:e=>Promise.all(e.reduce(((e,t)=>{let{el:o,left:n,top:s}=t;const i=o.scrollLeft,a=o.scrollTop;return i===n&&a===s?e:[...e,new Promise((e=>r(o,n,s,l.duration,l.ease,(()=>e({el:o,left:[i,n],top:[a,s]})),l.onScrollChange)))]}),[]))}):Promise.resolve(t.default(e,o))};module.exports=i;//# sourceMappingURL=index.cjs.map