Module 104681

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