Module 104681

3,198 characters · in 68925.4de164704c201108.js
Dependencies
Required by (1)
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e,t,r){"use strict";function n(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function i(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r,n=getComputedStyle(e,null);return i(n.overflowY,t)||i(n.overflowX,t)||!!(r=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e))&&(r.clientHeight<e.scrollHeight||r.clientWidth<e.scrollWidth)}return!1}function a(e,t,r,n,i,o,a,s){return o<e&&a>t||o>e&&a<t?0:o<=e&&s<=r||a>=t&&s>=r?o-e-n:a>t&&s<r||o<e&&s>r?a-t+i:0}r.d(t,{A:()=>u});var s=function(e,t){var r=window,i=t.scrollMode,s=t.block,l=t.inline,u=t.boundary,c=t.skipOverflowHiddenElements,f="function"==typeof u?u:function(e){return e!==u};if(!n(e))throw TypeError("Invalid target");for(var d,p,h=document.scrollingElement||document.documentElement,m=[],g=e;n(g)&&f(g);){if((g=null==(p=(d=g).parentElement)?d.getRootNode().host||null:p)===h){m.push(g);break}null!=g&&g===document.body&&o(g)&&!o(document.documentElement)||null!=g&&o(g,c)&&m.push(g)}for(var v=r.visualViewport?r.visualViewport.width:innerWidth,y=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,_=e.getBoundingClientRect(),x=_.height,E=_.width,S=_.top,k=_.right,T=_.bottom,C=_.left,P="start"===s||"nearest"===s?S:"end"===s?T:S+x/2,A="center"===l?C+E/2:"end"===l?k:C,O=[],M=0;M<m.length;M++){var I=m[M],R=I.getBoundingClientRect(),D=R.height,L=R.width,F=R.top,N=R.right,j=R.bottom,V=R.left;if("if-needed"===i&&S>=0&&C>=0&&T<=y&&k<=v&&S>=F&&T<=j&&C>=V&&k<=N)break;var B=getComputedStyle(I),U=parseInt(B.borderLeftWidth,10),K=parseInt(B.borderTopWidth,10),$=parseInt(B.borderRightWidth,10),z=parseInt(B.borderBottomWidth,10),W=0,H=0,G="offsetWidth"in I?I.offsetWidth-I.clientWidth-U-$:0,q="offsetHeight"in I?I.offsetHeight-I.clientHeight-K-z:0,Y="offsetWidth"in I?0===I.offsetWidth?0:L/I.offsetWidth:0,X="offsetHeight"in I?0===I.offsetHeight?0:D/I.offsetHeight:0;if(h===I)W="start"===s?P:"end"===s?P-y:"nearest"===s?a(w,w+y,y,K,z,w+P,w+P+x,x):P-y/2,H="start"===l?A:"center"===l?A-v/2:"end"===l?A-v:a(b,b+v,v,U,$,b+A,b+A+E,E),W=Math.max(0,W+w),H=Math.max(0,H+b);else{W="start"===s?P-F-K:"end"===s?P-j+z+q:"nearest"===s?a(F,j,D,K,z+q,P,P+x,x):P-(F+D/2)+q/2,H="start"===l?A-V-U:"center"===l?A-(V+L/2)+G/2:"end"===l?A-N+$+G:a(V,N,L,U,$+G,A,A+E,E);var J=I.scrollLeft,Q=I.scrollTop;P+=Q-(W=Math.max(0,Math.min(Q+W/X,I.scrollHeight-D/X+q))),A+=J-(H=Math.max(0,Math.min(J+H/Y,I.scrollWidth-L/Y+G)))}O.push({el:I,top:W,left:H})}return O};function l(e){return e===Object(e)&&0!==Object.keys(e).length}let u=function(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(r?s(e,t):[]);if(r){var n,i,o,a=!1===t?{block:"end",inline:"nearest"}:l(t)?t:{block:"start",inline:"nearest"};return n=s(e,a),void 0===(i=a.behavior)&&(i="auto"),o="scrollBehavior"in document.body.style,void n.forEach(function(e){var t=e.el,r=e.top,n=e.left;t.scroll&&o?t.scroll({top:r,left:n,behavior:i}):(t.scrollTop=r,t.scrollLeft=n)})}}}