Build 545032stable
Module 518665
1,756 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{R:()=>s,o:()=>o});var i=n(435987),r=n(408713);function s(e,t){let n=a(e,t,"left"),i=a(e,t,"top"),r=t.offsetWidth,s=t.offsetHeight,o=e.scrollLeft,l=e.scrollTop,{borderTopWidth:u,borderLeftWidth:c,scrollPaddingTop:d,scrollPaddingRight:_,scrollPaddingBottom:f,scrollPaddingLeft:h}=getComputedStyle(e),{scrollMarginTop:p,scrollMarginRight:E,scrollMarginBottom:m,scrollMarginLeft:g}=getComputedStyle(t),A=o+parseInt(c,10),I=l+parseInt(u,10),T=A+e.clientWidth,S=I+e.clientHeight,N=parseInt(d,10)||0,y=parseInt(f,10)||0,C=parseInt(_,10)||0,v=parseInt(h,10)||0,O=parseInt(p,10)||0,R=parseInt(m,10)||0,b=parseInt(E,10)||0,D=n-(parseInt(g,10)||0),L=n+r+b,w=i-O,M=i+s+R,P=o+parseInt(c,10)+v,x=l+parseInt(u,10)+N;(D>P||L<T-C)&&(D<=o+v?o=D-parseInt(c,10)-v:L>T-C&&(o+=L-T+C)),(w>x||M<S-y)&&(w<=I+N?l=w-parseInt(u,10)-N:M>S-y&&(l+=M-S+y)),e.scrollTo({left:o,top:l})}function a(e,t,n){let i="left"===n?"offsetLeft":"offsetTop",r=0;for(;t.offsetParent&&(r+=t[i],t.offsetParent!==e);){if(t.offsetParent.contains(e)){r-=e[i];break}t=t.offsetParent}return r}function o(e,t){if(e&&document.contains(e)){let u=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(u).overflow||(0,r.H8)())for(let t of function(e){let t=[];for(;e&&e!==document.documentElement;)(0,i.o)(e,void 0)&&t.push(e),e=e.parentElement;return t}(e))s(t,e);else{var n,a,o,l;let{left:i,top:r}=e.getBoundingClientRect();null==e||null==(n=e.scrollIntoView)||n.call(e,{block:"nearest"});let{left:s,top:u}=e.getBoundingClientRect();(Math.abs(i-s)>1||Math.abs(r-u)>1)&&(null==t||null==(o=t.containingElement)||null==(a=o.scrollIntoView)||a.call(o,{block:"center",inline:"center"}),null==(l=e.scrollIntoView)||l.call(e,{block:"nearest"}))}}}}