{"version":3,"file":"16.polyfills/smoothScroll.26848d3d6b5b4d65d85b.js","mappings":";;;;;;;;;;;AAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oEAAO;AACtD;AACA;AACA;AACA;AACA;AACA,yBAAyB,oEAAO;AAChC;AACA,+DAAe,cAAc;;;;;;;;;;;;ACnD2B;AACxD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,sEAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA,KAAK;AACL;;AAEA,yBAAyB,sEAAc;AACvC;;AAEA;AACA,+DAAe,oBAAoB;;;;;;;;;;;;;;AC7GnC,cAAc,kDAAkD,gBAAgB,oDAAoD,gBAAgB,+DAA+D,+BAA+B,uDAAuD,kBAAkB,8DAA8D,IAAI,gDAAgD,SAAS,aAAa,IAAI,wEAAwE,IAAI,SAAS,4BAA4B,oFAAoF,oBAAoB,kIAAkI,cAAc,+CAA+C,2EAA2E,WAAW,EAAE,uEAAuE,UAAU,MAAM,2FAA2F,oWAAoW,WAAW,KAAK,kGAAkG,4EAA4E,8YAA8Y,sMAAsM,KAAK,iLAAiL,iCAAiC,mHAAmH,QAAQ,kBAAkB,EAAE,UAA+B;AACpmF","sources":["webpack://@humandigital-agency/jointhestribe-frontend/./node_modules/scroll-into-view-if-needed/es/index.js","webpack://@humandigital-agency/jointhestribe-frontend/./node_modules/smooth-scroll-into-view-if-needed/es/index.js","webpack://@humandigital-agency/jointhestribe-frontend/./node_modules/compute-scroll-into-view/dist/index.mjs"],"sourcesContent":["import compute from 'compute-scroll-into-view';\nfunction isOptionsObject(options) {\n return options === Object(options) && Object.keys(options).length !== 0;\n}\nfunction defaultBehavior(actions, behavior) {\n if (behavior === void 0) {\n behavior = 'auto';\n }\n var canSmoothScroll = ('scrollBehavior' in document.body.style);\n actions.forEach(function (_ref) {\n var el = _ref.el,\n top = _ref.top,\n left = _ref.left;\n if (el.scroll && canSmoothScroll) {\n el.scroll({\n top: top,\n left: left,\n behavior: behavior\n });\n } else {\n el.scrollTop = top;\n el.scrollLeft = left;\n }\n });\n}\nfunction getOptions(options) {\n if (options === false) {\n return {\n block: 'end',\n inline: 'nearest'\n };\n }\n if (isOptionsObject(options)) {\n return options;\n }\n return {\n block: 'start',\n inline: 'nearest'\n };\n}\nfunction scrollIntoView(target, options) {\n var isTargetAttached = target.isConnected || target.ownerDocument.documentElement.contains(target);\n if (isOptionsObject(options) && typeof options.behavior === 'function') {\n return options.behavior(isTargetAttached ? compute(target, options) : []);\n }\n if (!isTargetAttached) {\n return;\n }\n var computeOptions = getOptions(options);\n return defaultBehavior(compute(target, computeOptions), computeOptions.behavior);\n}\nexport default scrollIntoView;","import scrollIntoView from 'scroll-into-view-if-needed';\nvar memoizedNow;\n\nvar now = function now() {\n if (!memoizedNow) {\n memoizedNow = 'performance' in window ? performance.now.bind(performance) : Date.now;\n }\n\n return memoizedNow();\n};\n\nfunction step(context) {\n var time = now();\n var elapsed = Math.min((time - context.startTime) / context.duration, 1);\n var value = context.ease(elapsed);\n var currentX = context.startX + (context.x - context.startX) * value;\n var currentY = context.startY + (context.y - context.startY) * value;\n context.method(currentX, currentY);\n\n if (currentX !== context.x || currentY !== context.y) {\n requestAnimationFrame(function () {\n return step(context);\n });\n } else {\n context.cb();\n }\n}\n\nfunction smoothScroll(el, x, y, duration, ease, cb) {\n if (duration === void 0) {\n duration = 600;\n }\n\n if (ease === void 0) {\n ease = function ease(t) {\n return 1 + --t * t * t * t * t;\n };\n }\n\n var scrollable;\n var startX;\n var startY;\n var method;\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n\n method = function method(x, y) {\n el.scrollLeft = Math.ceil(x);\n el.scrollTop = Math.ceil(y);\n };\n\n step({\n scrollable: scrollable,\n method: method,\n startTime: now(),\n startX: startX,\n startY: startY,\n x: x,\n y: y,\n duration: duration,\n ease: ease,\n cb: cb\n });\n}\n\nvar shouldSmoothScroll = function shouldSmoothScroll(options) {\n return options && !options.behavior || options.behavior === 'smooth';\n};\n\nfunction scroll(target, options) {\n var overrides = options || {};\n\n if (shouldSmoothScroll(overrides)) {\n return scrollIntoView(target, {\n block: overrides.block,\n inline: overrides.inline,\n scrollMode: overrides.scrollMode,\n boundary: overrides.boundary,\n behavior: function behavior(actions) {\n return Promise.all(actions.reduce(function (results, _ref) {\n var el = _ref.el,\n left = _ref.left,\n top = _ref.top;\n var startLeft = el.scrollLeft;\n var startTop = el.scrollTop;\n\n if (startLeft === left && startTop === top) {\n return results;\n }\n\n return [].concat(results, [new Promise(function (resolve) {\n return smoothScroll(el, left, top, overrides.duration, overrides.ease, function () {\n return resolve({\n el: el,\n left: [startLeft, left],\n top: [startTop, top]\n });\n });\n })]);\n }, []));\n }\n });\n }\n\n return Promise.resolve(scrollIntoView(target, options));\n}\n\nvar smoothScrollIntoView = scroll;\nexport default smoothScrollIntoView;","function t(t){return\"object\"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||\"hidden\"!==t)&&\"visible\"!==t&&\"clip\"!==t}function n(t,n){if(t.clientHeighte||o>t&&l=e&&d>=n?o-t-r:l>e&&dn?l-e+i:0}var i=function(e,i){var o=window,l=i.scrollMode,d=i.block,f=i.inline,h=i.boundary,u=i.skipOverflowHiddenElements,s=\"function\"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError(\"Invalid target\");for(var a,c,g=document.scrollingElement||document.documentElement,p=[],m=e;t(m)&&s(m);){if((m=null==(c=(a=m).parentElement)?a.getRootNode().host||null:c)===g){p.push(m);break}null!=m&&m===document.body&&n(m)&&!n(document.documentElement)||null!=m&&n(m,u)&&p.push(m)}for(var w=o.visualViewport?o.visualViewport.width:innerWidth,v=o.visualViewport?o.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,H=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),y=b.height,E=b.width,M=b.top,V=b.right,x=b.bottom,I=b.left,C=\"start\"===d||\"nearest\"===d?M:\"end\"===d?x:M+y/2,R=\"center\"===f?I+E/2:\"end\"===f?V:I,T=[],k=0;k=0&&I>=0&&x<=v&&V<=w&&M>=Y&&x<=S&&I>=j&&V<=L)return T;var N=getComputedStyle(B),q=parseInt(N.borderLeftWidth,10),z=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),F=parseInt(N.borderBottomWidth,10),G=0,J=0,K=\"offsetWidth\"in B?B.offsetWidth-B.clientWidth-q-A:0,P=\"offsetHeight\"in B?B.offsetHeight-B.clientHeight-z-F:0,Q=\"offsetWidth\"in B?0===B.offsetWidth?0:X/B.offsetWidth:0,U=\"offsetHeight\"in B?0===B.offsetHeight?0:O/B.offsetHeight:0;if(g===B)G=\"start\"===d?C:\"end\"===d?C-v:\"nearest\"===d?r(H,H+v,v,z,F,H+C,H+C+y,y):C-v/2,J=\"start\"===f?R:\"center\"===f?R-w/2:\"end\"===f?R-w:r(W,W+w,w,q,A,W+R,W+R+E,E),G=Math.max(0,G+H),J=Math.max(0,J+W);else{G=\"start\"===d?C-Y-z:\"end\"===d?C-S+F+P:\"nearest\"===d?r(Y,S,O,z,F+P,C,C+y,y):C-(Y+O/2)+P/2,J=\"start\"===f?R-j-q:\"center\"===f?R-(j+X/2)+K/2:\"end\"===f?R-L+A+K:r(j,L,X,q,A+K,R,R+E,E);var Z=B.scrollLeft,$=B.scrollTop;C+=$-(G=Math.max(0,Math.min($+G/U,B.scrollHeight-O/U+P))),R+=Z-(J=Math.max(0,Math.min(Z+J/Q,B.scrollWidth-X/Q+K)))}T.push({el:B,top:G,left:J})}return T};export{i as default};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"sourceRoot":""}