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