mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-20 11:40:36 +03:00
1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).OverlayScrollbars=t()}(this,(function(){"use strict";var n=function(n,t){var r,e=t||{},i=e.o,o=e.u,u=e.s,a=o;return{v:function(t,e){var o=a,c=n?n(e,a,r):e,f=t||(i?!i(o,c):o!==c);return(f||u)&&(a=c,r=o),{g:a,_:r,p:f}},m:function(n){return{g:a,_:r,p:!!n}}}},t=Node.ELEMENT_NODE,r=Object.prototype,e=r.toString,i=r.hasOwnProperty;function o(n){return void 0===n}function u(n){return null===n}var a=function(n){return o(n)||u(n)?""+n:e.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};function c(n){return"number"==typeof n}function f(n){return"string"==typeof n}function l(n){return"boolean"==typeof n}function s(n){return"function"==typeof n}function v(n){return Array.isArray(n)}function d(n){return"object"==typeof n&&!v(n)&&!u(n)}function g(n){var t=!!n&&n.length,r=c(t)&&t>-1&&t%1==0;return!!(v(n)||!s(n)&&r)&&(!(t>0&&d(n))||t-1 in n)}function _(n){if(!n||!d(n)||"object"!==a(n))return!1;var t,r=n.constructor,e=r&&r.prototype,u=i.call(n,"constructor"),c=e&&i.call(e,"isPrototypeOf");if(r&&!u&&!c)return!1;for(t in n);return o(t)||i.call(n,t)}function h(n){var r=window.Element;return!!n&&(r?n instanceof r:n.nodeType===t)}function p(n,t){if(g(n))for(var r=0;r<n.length&&!1!==t(n[r],r,n);r++);else n&&p(Object.keys(n),(function(r){return t(n[r],r,n)}));return n}var w=function(n,t,r){return n.indexOf(t,r)},b=function(n,t,r){return r||f(t)||!g(t)?n.push(t):Array.prototype.push.apply(n,t),n},m=function(n){if(Array.from)return Array.from(n);var t=[];return p(n,(function(n){b(t,n)})),t},y=function(n){return n&&0===n.length},x=function(n,t){var r=function(n){return n&&n(t)};n instanceof Set?n.forEach(r):p(n,r)},S=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},z=function(n){return n?Object.keys(n):[]};function O(n,t,r,e,i,o,a){var c=[t,r,e,i,o,a];return"object"==typeof n&&!u(n)||s(n)||(n={}),p(c,(function(t){p(z(t),(function(r){var e=t[r];if(n===e)return!0;var i=v(e);if(e&&(_(e)||i)){var o=n[r],u=o;i&&!v(o)?u=[]:i||_(o)||(u={}),n[r]=O(u,e)}else n[r]=e}))})),n}function M(n){for(var t in n)return!1;return!0}function L(n,t,r,e){if(o(e))return r?r[n]:t;r&&(r[n]=e)}function A(n,t,r){if(o(r))return n?n.getAttribute(t):null;n&&n.setAttribute(t,r)}function C(n,t){return L("scrollLeft",0,n,t)}function T(n,t){return L("scrollTop",0,n,t)}var I,R=Element.prototype,j=function(n,t){var r=[],e=t?h(t)?t:null:document;return e?b(r,e.querySelectorAll(n)):r},V=function(n,t){return!!h(n)&&(R.matches||R.msMatchesSelector).call(n,t)},B=function(n){return n?m(n.childNodes):[]},E=function(n){return n?n.parentElement:null},D=function(n,t,r){if(r){var e,i=t;n&&(g(r)?(e=document.createDocumentFragment(),p(r,(function(n){n===i&&(i=n.previousSibling),e.appendChild(n)}))):e=r,t&&(i?i!==t&&(i=i.nextSibling):i=n.firstChild),n.insertBefore(e,i||null))}},P=function(n,t){D(n,null,t)},q=function(n,t){D(n,n&&n.firstChild,t)},F=function(n,t){D(E(n),n&&n.nextSibling,t)},H=function n(t){if(g(t))p(m(t),(function(t){return n(t)}));else if(t){var r=E(t);r&&r.removeChild(t)}},W=function(n){var t=document.createElement("div");return n&&A(t,"class",n),t},Y=function(n){var t=W();return t.innerHTML=n.trim(),p(B(t),(function(n){return H(n)}))},N=["WebKit","Moz","O","MS","webkit","moz","o","ms"],X={},k=function(n){var t=X[n]||window[n];return S(X,n)||(p(N,(function(r){var e;return!(t=t||window[r+(e=n,e.charAt(0).toUpperCase()+e.slice(1))])})),X[n]=t),t},$=k("MutationObserver"),G=k("IntersectionObserver"),J=k("ResizeObserver"),K=k("cancelAnimationFrame"),U=k("requestAnimationFrame"),Q=/[^\x20\t\r\n\f]+/g,Z=function(n,t,r){var e,i=0,o=!1;if(n&&f(t)){var u=t.match(Q)||[];for(o=u.length>0;e=u[i++];)o=!!r(n.classList,e)&&o}return o},nn=function(n,t){Z(n,t,(function(n,t){return n.add(t)}))},tn=function(n,t){Z(n,t,(function(n,t){return n.remove(t)}))},rn={w:0,h:0},en=function(){return{w:window.innerWidth,h:window.innerHeight}},on=function(n){return n?{w:n.offsetWidth,h:n.offsetHeight}:rn},un=function(n){return n?{w:n.clientWidth,h:n.clientHeight}:rn},an=function(n){return n?{w:n.scrollWidth,h:n.scrollHeight}:rn},cn=function(n){return n.getBoundingClientRect()},fn=function(n){return n.split(" ")},ln=function(n,t,r,e){p(fn(t),(function(t){n.removeEventListener(t,r,e)}))},sn=function(n,t,r,e){var i=function(){if(o(I)){I=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){I=!0}}))}catch(n){}}return I}(),u=i&&e&&e.S||!1,a=e&&e.O||!1,c=e&&e.M||!1,f=[],l=i?{passive:u,capture:a}:a;return p(fn(t),(function(t){var e=c?function(i){n.removeEventListener(t,e,a),r&&r(i)}:r;b(f,ln.bind(null,n,t,e,a)),n.addEventListener(t,e,l)})),x.bind(0,f)},vn=function(n){return n.stopPropagation()},dn=function(n){return n.preventDefault()},gn=function(n,t,r,e){if(n&&t){var i=!0;return p(r,(function(r){(e?e(n[r]):n[r])!==(e?e(t[r]):t[r])&&(i=!1)})),i}return!1},_n=function(n,t){return gn(n,t,["w","h"])},hn=function(n,t){return gn(n,t,["x","y"])},pn=function(n,t){return gn(n,t,["t","r","b","l"])},wn=function(n,t,r){return gn(n,t,["width","height"],r&&function(n){return Math.round(n)})},bn=function(){},mn={opacity:1,zindex:1},yn=function(n,t){var r=t?parseFloat(n):parseInt(n,10);return Number.isNaN(r)?0:r},xn=function(n,t,r){return null!=t?t[r]||t.getPropertyValue(r):n.style[r]},Sn=function(n,t,r){try{if(n){var e=n.style;o(e[t])?e.setProperty(t,r):e[t]=function(n,t){return!mn[n.toLowerCase()]&&c(t)?t+"px":t}(t,r)}}catch(i){}};function zn(n,t){var r=f(t);if(v(t)||r){var e=r?"":{};if(n){var i=window.getComputedStyle(n,null);e=r?xn(n,i,t):t.reduce((function(t,r){return t[r]=xn(n,i,r),t}),e)}return e}p(z(t),(function(r){return Sn(n,r,t[r])}))}var On={x:0,y:0},Mn=function(n){var t=n?cn(n):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:On};var Ln,An=function(n){var t={exports:{}};return n(t,t.exports),t.exports}((function(n){function t(){return n.exports=t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},t.apply(this,arguments)}n.exports=t})),Cn=JSON.stringify,Tn=["__TPL_","_TYPE__"],In=["boolean","number","string","array","object","function","null"].reduce((function(n,t){return n[t]=Tn[0]+t+Tn[1],n}),{}),Rn=function(n,t,r,e){return function n(t,r,e,i,u){var c={},l=An({},t);return p(z(r).filter((function(n){return S(t,n)})),(function(s){var d=o(e[s])?{}:e[s],g=t[s],h=r[s],w=_(h),m=u?u+".":"";if(w&&_(g)){var y=n(g,h,d,i,m+s);c[s]=y.L,l[s]=y.A,p([l,c],(function(n){M(n[s])&&delete n[s]}))}else if(!w){var x=!1,S=[],z=[],O=a(g);if(p(v(h)?h:[h],(function(n){var t;p(In,(function(r,e){r===n&&(t=e)}));var r=o(t);if(r&&f(g)){var e=n.split(" ");x=!!e.find((function(n){return n===g})),b(S,e)}else x=In[O]===n;return b(z,r?In.string:t),!x})),x)(v(g)||_(g)?Cn(g)!==Cn(d):g!==d)&&(c[s]=g);else i&&console.warn('The option "'+m+s+"\" wasn't set, because it doesn't accept the type [ "+O.toUpperCase()+' ] with the value of "'+g+'".\r\nAccepted types are: [ '+z.join(", ").toUpperCase()+" ].\r\n"+(S.length>0?"\r\nValid strings are: [ "+S.join(", ")+" ].":""));delete l[s]}})),{A:l,L:c}}(n,t,r||{},e||!1)},jn=In.number,Vn=[In.string,In.array,In.null],Bn=[!0,In.boolean],En=[!1,In.boolean],Dn=function n(t){var r={C:{},T:{}};return p(z(t),(function(e){var i=t[e];if(v(i))r.C[e]=i[1],r.T[e]=i[0];else{var o=n(i);r.C[e]=o.C,r.T[e]=o.T}})),r}({resize:["none","none both horizontal vertical"],paddingAbsolute:En,updating:{elementEvents:[[["img","load"]],[In.array,In.null]],contentMutationDebounce:[80,jn],hostMutationDebounce:[0,jn],resizeDebounce:[0,jn]},overflow:{x:["scroll","visible-hidden visible-scroll scroll hidden"],y:["scroll","visible-hidden visible-scroll scroll hidden"]},scrollbars:{visibility:["auto","visible hidden auto"],autoHide:["never","never scroll leavemove"],autoHideDelay:[800,jn],dragScroll:Bn,clickScroll:En,touch:Bn},textarea:{dynWidth:En,dynHeight:En,inheritedAttrs:[["style","class"],Vn]},nativeScrollbarsOverlaid:{show:En,initialize:En}}),Pn=Dn.C,qn=Dn.T,Fn=Math.abs,Hn=Math.round,Wn=function(n,t){P(n,t);var r=un(t),e=on(t);return{x:e.h-r.h,y:e.w-r.w}},Yn=function(n,t){zn(n,{overflowX:"hidden",overflowY:"hidden",direction:"rtl"}),C(n,0);var r=Mn(n),e=Mn(t);C(n,-999);var i=Mn(t);return{i:r.x===e.x,n:e.x!==i.x}},Nn=function(n,t){nn(n,"os-environment-flexbox-glue");var r=cn(n),e=cn(t),i=wn(e,r,!0);nn(n,"os-environment-flexbox-glue-max");var o=cn(n),u=cn(t),a=wn(u,o,!0);return i&&a},Xn=function(){var n=window.screen.deviceXDPI||0,t=window.screen.logicalXDPI||1;return window.devicePixelRatio||n/t},kn=function(){var n,t,r=document.body,e=Y('<div class="os-environment"><div></div></div>')[0],i=e.firstChild,o=new Set,u=Wn(r,e),a={x:0===u.x,y:0===u.y},c=function(n){return{I:!n,R:!1}}(!1),f=c,l=qn,s={j:u,V:a,B:!1,D:"-1"===zn(e,"zIndex"),P:Yn(e,i),q:Nn(e,i),F:function(n){o.add(n)},H:function(n){o.delete(n)},W:function(){return An({},f)},Y:function(n){f=O({},f,n)},N:function(){return An({},l)},X:function(n){l=O({},l,n)},k:c,$:l};if(t="style",(n=e)&&n.removeAttribute(t),H(e),!a.x||!a.y){var v=en(),d=Xn(),g=u;window.addEventListener("resize",(function(){if(o.size){var n=en(),t={w:n.w-v.w,h:n.h-v.h};if(0===t.w&&0===t.h)return;var i={w:Fn(t.w),h:Fn(t.h)},u={w:Fn(Hn(n.w/(v.w/100))),h:Fn(Hn(n.h/(v.h/100)))},a=Xn(),c=i.w>2&&i.h>2,f=(s=u.h,_=Fn(u.w),h=Fn(s),!(_!==h&&_+1!==h&&_-1!==h));if(c&&f&&(a!==d&&d>0)){var l=Ln.j=Wn(r,e);H(e),g.x===l.x&&g.y===l.y||x(o),g=l}v=n,d=a}var s,_,h}))}return s},$n=function(){return Ln||(Ln=kn()),Ln},Gn=function(n){P(E(n),B(n)),H(n)},Jn=0,Kn=function(n,t){var r=l(n);return r||o(n)?(r?n:t)&&void 0:n},Un=function(n){var r=$n(),e=r.W,i=r.B,u=r.V,a=r.D,c=e(),f=c.I,l=c.R,s=function(n){var r=window.HTMLElement;return!!n&&(r?n instanceof r:n.nodeType===t)}(n),v=s?{}:{G:n.host,J:n.target,K:n.viewport,I:Kn(n.padding,f),R:Kn(n.content,l)};if(s){var d=W("os-viewport"),g=f&&W("os-padding"),_=l&&W("os-content");v.J=n,v.I=g,v.K=d,v.R=_}var h=v.J,p=v.I,w=v.K,m=v.R,y=[],S=V(h,"textarea"),z=!S&&V(h,"body"),O=S?v.G||W():h,M=function(n){return S?h:B(n)};if(S&&O!==v.G&&(F(h,O),b(y,(function(){F(O,h),H(O)}))),s){var L=m||w;P(L,M(h)),P(O,p),P(p||O,w),P(w,m),b(y,(function(){P(O,B(L)),H(p||w),tn(O,"os-host")}))}else{var C=m||w||p||O,T=o(p),I=o(w),R=o(m),j=M(C);p=v.I=T?W():p,w=v.K=I?W():w,m=v.R=R?W():m,P(O,p),P(p||O,w),P(w,m),P(m||w,j),b(y,(function(){R&&Gn(m),I&&Gn(w),T&&Gn(p),tn(O,"os-host"),tn(p,"os-padding"),tn(w,"os-viewport"),tn(m,"os-content")}))}nn(O,"os-host"),nn(p,"os-padding"),nn(w,"os-viewport"),nn(m,"os-content");var q,Y,N,X=h.ownerDocument,k=X.body,$={U:X.defaultView,Z:X,nn:E(k),tn:k,rn:S,en:z},G=An({},v,{G:O});if(i)b(y,tn.bind(0,w,"os-viewport-scrollbar-styled"));else if(!a&&(u.x||u.y)){var J=(A(N=document.createElement("style"),"id","os-viewport-arrange-"+Jn),Jn++,N);Y=J,D(E(q=w),q,Y),b(y,H.bind(0,J)),G.in=J}return{on:G,un:$,an:function(){x(y)}}},Qn=function(t){var r=t.cn,e=t.fn,i=t.ln.on,o=i.G,u=i.I,a=i.K,c=n((function(){return f=zn(o,[i=(r=(n="padding")?n+"-":"")+"top"+(e=t?"-"+t:""),u=r+"right"+e,a=r+"bottom"+e,c=r+"left"+e]),{t:yn(f[i]),r:yn(f[u]),b:yn(f[a]),l:yn(f[c])};var n,t,r,e,i,u,a,c,f}),{o:pn}),f=c.v,l=c.m;return function(n,t,i){var o=l(i),c=(o.g,o.p),s=$n().B,v=n.sn,d=n.vn,g=d.g,_=d.p,h=t("paddingAbsolute"),p=h.g,w=h.p;if(v||c){var b=f(i);b.g,c=b.p}var m=w||_||c;if(m){var y=f(i).g,x=!p||!u&&!s,S=y.r+y.l,z=y.t+y.b,O={marginTop:0,marginRight:0,marginBottom:x?-z:0,marginLeft:0,top:x?-y.t:0,right:0,bottom:0,left:0,maxWidth:x?"calc(100% + "+S+"px)":""},M={paddingTop:x?y.t:0,paddingRight:x?y.r:0,paddingBottom:x?y.b:0,paddingLeft:x?y.l:0};if(x){var L=g?"right":"left",A=g?"marginLeft":"marginRight",C=g?y.r:y.l;O[L]=-C,O[A]=-S}zn(u||a,O),zn(a,M),r({dn:!x,I:y}),e(u?M:An({},O,M))}return{gn:m}}},Zn=function(t){var r=t.ln,e=t._n,i=t.hn,o=t.pn,u=t.wn,a=r.on,c=a.G,f=a.I,l=a.K,s=a.in,v=n((function(n){return b(n.bn,n.mn,n.yn)}),{o:_n}),d=v.v,g=v.m,_=n((function(n){return{x:Math.max(0,n.xn.w-n.Sn.w),y:Math.max(0,n.xn.h-n.Sn.h)}}),{o:hn,u:{x:0,y:0}}),h=_.v,w=_.m,b=function(n,t,r){return{w:n.w-Math.round(Math.max(0,r.width-t.w)),h:n.h-Math.round(Math.max(0,r.height-t.h))}},m=function(n,t){if(zn(l,{height:""}),t){var r=o(),e=r.dn,i=r.I,u=n.zn,a=n.On,f=cn(c),s=on(c),v=un(c),d=e?i.b+i.t:0,g=v.h+(f.height-s.h);zn(l,{height:g+(u.x?a.x:0)-d})}},y=function(n,t){var r=$n(),e=r.j,i=r.V,o=r.B,u=i.x,a=i.y,c=o||n?0:42,f=!t?zn(l,["overflowX","overflowY"]):t,s={x:"scroll"===f.overflowX,y:"scroll"===f.overflowY};return{zn:s,Mn:{x:u&&!!c,y:a&&!!c},On:{x:s.x&&!o?u?c:e.x:0,y:s.y&&!o?a?c:e.y:0}}},x=function(n,t,r){if(e){var o=n.On,u=n.Mn,a=u.x,c=u.y,f=o.x,v=o.y,d=i(),g=d[r?"paddingRight":"paddingLeft"],_=d.paddingTop,h={w:v&&c?v+t.w-g+"px":"",h:f&&a?f+t.h-_+"px":""};if(s){var p=s.sheet;if(p){var w=p.cssRules;if(w){w.length||p.insertRule("#"+A(s,"id")+" + .os-viewport-arrange::before {}",0);var b=w[0].style;b.width=h.w,b.height=h.h}}}else zn(l,{"--viewport-arrange-width":h.w,"--viewport-arrange-height":h.h})}return e};return function(n,t,r){var o,a=n.vn,s=n.Ln,v=n.sn,_=n.An,S=n.Cn,O=n.gn,M=$n(),L=M.q,A=M.B,C=M.V,T=s.g,I=s.p,R=a.g,j=a.p,V=t("nativeScrollbarsOverlaid.show"),B=V.g,E=V.p,D=B&&C.x&&C.y,P=!L&&(v||S||_||E||I),q=w(r),F=g(r);if(E&&A&&(D?tn(l,"os-viewport-scrollbar-styled"):nn(l,"os-viewport-scrollbar-styled")),P&&(o=y(D),m(o,!!T)),v||O||S||E||j){var H=function(n,t){if(e){var r=t||y(n),o=i(),u=$n().q,a=r.Mn,c=a.x,f=a.y,s={},v=function(n){return p(n.split(" "),(function(n){s[n]=o[n]}))};u||(s.height=""),c&&v("marginTop marginBottom paddingTop paddingBottom"),f&&v("marginLeft marginRight paddingLeft paddingRight");var d=zn(l,z(s));return tn(l,"os-viewport-arrange"),zn(l,s),{Tn:function(){zn(l,d),nn(l,"os-viewport-arrange")},In:r}}return{Tn:bn}}(D,o),W=H.Tn,Y=H.In,N=un(l),X=cn(l),k=on(l),$=an(l),G=N,J=F=d(r,{yn:X,mn:k,bn:$}),K=J.g,U=J.p;W(),(U||E)&&Y&&!D&&x(Y,K,R)&&(G=un(l),$=b(an(l),on(l),cn(l))),q=h(r,{xn:{w:Math.max(K.w,$.w),h:Math.max(K.h,$.h)},Sn:{w:G.w+Math.max(0,N.w-K.w),h:G.h+Math.max(0,N.h-K.h)}})}var Q=t("overflow"),Z=Q.g,rn=Q.p,en=F,fn=en.g,ln=en.p,sn=q,vn=sn.g,dn=sn.p;if(O||ln||dn||rn||E||j||P){var gn={marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,maxWidth:"",overflowY:"",overflowX:""},_n=function(n,t,r,e){var i=function(n,t,r,e){var i="visible-scroll"===r,o=t>0&&("scroll"===r||"hidden"===r);return o&&(e[n?"overflowX":"overflowY"]=r),{Rn:!o,jn:i?"scroll":"hidden"}},o=i(!0,t.x,r.x,e),u=o.Rn,a=o.jn,c=i(!1,t.y,r.y,e),f=c.Rn,l=c.jn;return u&&!f&&(e.overflowX=a),f&&!u&&(e.overflowY=l),y(n,e)}(D,vn,Z,gn);!function(n,t,r,e){var o=$n().B,u=n.zn,a=n.On,l=n.Mn,s=l.x,v=l.y,d=a.x,g=a.y,_=u.x,h=u.y,p=i(),w=t?"marginLeft":"marginRight",b=t?"paddingLeft":"paddingRight",m=p[w],y=p.marginBottom,x=p[b],S=p.paddingBottom;e.maxWidth="calc(100% + "+(g+-1*m)+"px)",e[w]=-g+m,e.marginBottom=-d+y,r&&(e[b]=x+(v?g:0),e.paddingBottom=S+(s?d:0)),o||zn(f||c,{overflow:_||h?"hidden":""})}(_n,R,x(_n,fn,R),gn),P&&m(_n,!!T),zn(l,gn),u(_n.zn)}}},nt={direction:["rtl"]},tt=function(n){var t=!1;return p(zn(n,["direction"]),(function(n,r){t=t||w(nt[r],n)>-1})),t},rt=function(n){return n&&(n.height||n.width)},et=function(t,r,e){var i,o=e||{},u=o.Vn,a=void 0!==u&&u,c=o.Bn,f=void 0!==c&&c,s=$n().P,d=Y('<div class="os-size-observer"><div class="os-size-observer-listener"></div></div>')[0],g=d.firstChild,_=n(0,{s:!0,o:function(n,t){return!(!n||!rt(n)&&rt(t))}}).v,h=function(n){var t=n&&l(n.g),e=!1;if(v(n)&&n.length>0){var i=_(0,n.pop().contentRect),o=i._,u=i.g;i.p;e=!o||!rt(u)}else t&&n.p;if(a){var c=t?n.g:tt(d);C(d,c?s.n?-3333333:s.i?0:3333333:3333333),T(d,3333333)}e||r(t?n:void 0)},p=[],w=!!f&&h;if(J){var m=new J(h);m.observe(g),b(p,(function(){return m.disconnect()}))}else{var y=Y('<div class="os-size-observer-listener-item" dir="ltr"><div class="os-size-observer-listener-item"><div class="os-size-observer-listener-item-final"></div></div><div class="os-size-observer-listener-item"><div class="os-size-observer-listener-item-final" style="width: 200%; height: 200%"></div></div></div>');P(g,y),nn(g,"os-size-observer-listener-scroll");var S,z=y[0],O=z.lastChild,M=z.firstChild,L=null==M?void 0:M.firstChild,A=on(g),I=A,R=!1,j=function(){C(M,3333333),T(M,3333333),C(O,3333333),T(O,3333333)},V=function(){S=0,R&&(A=I,h())},B=function(n){return I=on(g),R=!n||!_n(I,A),n&&R&&!S?(K(S),S=U(V)):n||V(),j(),n&&(dn(n),vn(n)),!1};b(p,[sn(M,"scroll",B),sn(O,"scroll",B)]),zn(L,{width:3333333,height:3333333}),j(),w=f?function(){return B()}:j}if(a){var E=(i=n((function(){return tt(d)}))).v;b(p,sn(d,"scroll",(function(n){var t=E(),r=t.g;return t.p&&(zn(g,r?{left:"auto",right:0}:{left:0,right:"auto"}),h(t)),dn(n),vn(n),!1})))}return w&&(nn(d,"os-size-observer-appear"),b(p,sn(d,"animationstart",w,{M:!!J}))),q(t,d),{an:function(){x(p),H(d)},En:function(n){return{vn:i?i.m(n):{g:!1,_:!1,p:!1}}}}},it=function(n,t,r,e){var i,u=function(){r.forEach((function(n,t){ln(t,n,e)})),r.clear()},a=function(t){i&&p(i.reduce((function(r,e){if(e){var i=e[0],o=e[1],u=o&&i&&(t?t(i):j(i,n));u&&b(r,[u,s(o)?o(u):o],!0)}return r}),[]),(function(n){var t=n[0],i=n[1];p(t,(function(n){!function(n,t){var i=r.get(n),u=o(i),a=function(){r.set(n,t),sn(n,t,e)};u||t===i?u&&a():(ln(n,i,e),a())}(n,i)}))}))},c=function(n){i=n,u(),a()};return t&&c(t),{an:u,Dn:a,v:c}},ot=function(n,t,r){var e,i,o,u,a,l,s,v,d,g,_=!1,h=r||{},m=h.Pn,x=h.qn,S=h.Fn,z=h.Hn,O=h.Wn,M=h.Yn,L=h.Nn,C=it(n,m&&z,new Map,(e=function(){_&&t([],!1,!0)},l=c(i=84)&&i>0,s=c(o)&&o>0,v=l?window.clearTimeout:K,d=l?window.setTimeout:U,g=function(n){a=s?performance.now():0,u&&v(u),e.apply(this,n)},function(){var n=g.bind(this,arguments),t=!!s&&performance.now()-a>=o;u&&v(u),u=t?n():d(n,i)})),T=C.Dn,I=C.an,R=C.v,B=S||[],E=(x||[]).concat(B),D=function(e){var i=M||bn,o=L||bn,u=[],a=[],c=!1,l=!1,s=!1;p(e,(function(t){var e=t.attributeName,v=t.target,d=t.type,g=t.oldValue,_=t.addedNodes,h="attributes"===d,p="childList"===d,y=n===v,x=h&&f(e)?A(v,e):0,S=0!==x&&g!==x,z=S&&y&&!m&&!i(v,e,g,x),M=w(B,e)>-1&&S;if(z&&b(u,e),m){var L=!h,C=h&&M&&!y,T=C&&O&&V(v,O),I=(T?!i(v,e,g,x):L||C)&&!o(t,!!T,n,r);b(a,_),l=l||I,s=s||p}c=c||z&&M})),s&&!y(a)&&T((function(n){return a.reduce((function(t,r){return b(t,j(n,r)),V(r,n)?b(t,r):t}),[])})),(!y(u)||c||l)&&t(u,c,l)},P=new $(D);return P.observe(n,{attributes:!0,attributeOldValue:!0,attributeFilter:E,subtree:m,childList:m,characterData:m}),_=!0,{Xn:function(){_&&(I(),P.disconnect(),_=!1)},kn:function(n){R(_&&m&&n)},v:function(){_&&D(P.takeRecords())}}},ut=function(n,t){return n&&t.split(".").reduce((function(n,t){return n&&S(n,t)?n[t]:void 0}),n)},at=["id","class","style","open"],ct={dn:!1,I:{t:0,r:0,b:0,l:0}},ft={marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},lt={x:!1,y:!1},st={g:!1,_:!1,p:!1},vt={g:!1,_:!1,p:!1},dt=function(t,r){var e=ct,i=ft,o=lt,u=r.on,a=u.G,f=u.K,l=u.R,s=$n(),v=s.B,d=s.V,g=s.q,_=s.F,h=s.H,w=!v&&(d.x||d.y),m=[],y={T:t,ln:r,_n:w,pn:function(){return e},cn:function(n){e=n||ct},hn:function(){return i},fn:function(n){var t,r;i=n?(r=ft,z(t=n).reduce((function(n,r){var e=t[r];return n[r]=""===e?0:e,n}),An({},r))):ft},$n:function(){return o},wn:function(n){o=n||lt}};b(m,function(n){var t=n.ln.on.R;return function(n){var r=n.Ln,e=r.g;r.p&&zn(t,{height:e?"auto":"100%"})}}(y)),b(m,Qn(y)),b(m,Zn(y));var S=function(n,r,e){var i=n||{},o=i.vn,u=i.Ln,a=i.sn,l=void 0===a?e||!1:a,s=i.An,v=void 0===s?e||!1:s,d=i.Cn,_=void 0===d?e||!1:d,h=i.gn,b=void 0===h?e||!1:h,y=o||(M?M.En(e).vn:st),x=u||(O?O.En(e).Ln:vt),S=function(n){return{g:ut(t,n),p:e||void 0!==ut(r,n)}},z=w||!g,L=z&&C(f),A=z&&T(f);p(m,(function(n){var t=n({vn:y,Ln:x,sn:l,An:v,Cn:_,gn:b},S,!!e)||{},r=t.sn,i=t.An,o=t.Cn,u=t.gn;l=r||l,v=i||v,_=o||_,b=u||b})),c(L)&&C(f,L),c(A)&&T(f,A)},O=(l||!g)&&function(t,r){var e=Y('<div class="os-trinsic-observer"></div>')[0],i=[],o=n((function(n){return 0===n.h||n.isIntersecting||n.intersectionRatio>0}),{u:!1}),u=o.v,a=o.m;if(G){var c=new G((function(n){if(n&&n.length>0){var t=n.pop();if(t){var e=u(0,t);e.p&&r(e)}}}),{root:t});c.observe(e),b(i,(function(){return c.disconnect()}))}else{var f=function(){var n=on(e),t=u(0,n);t.p&&r(t)};b(i,et(e,f).an),f()}return q(t,e),{an:function(){x(i),H(e)},En:function(n){return{Ln:a(n)}}}}(a,(function(n){S({Ln:n})})),M=et(a,(function(n){S({vn:n,sn:!n})}),{Bn:!0,Vn:!v}),L=(ot(a,(function(){requestAnimationFrame((function(){S({An:!0})}))}),{Fn:at,qn:at}),ot(l||f,(function(){requestAnimationFrame((function(){S({Cn:!0})}))}),{Pn:!0,Fn:at,qn:at,Hn:t.updating.elementEvents}),function(n,t){S(null,n,t)}),A=L.bind(null,null,!0);return _(A),{v:L,an:function(){h(A)}}};return function(n,t,r){var e=O({},(0,$n().N)(),Rn(t||{},Pn,null,!0).L),i=Un(n),o=dt(e,i),u={options:function(n){if(n){var t=Rn(n,Pn,e,!0).L;M(t)||(O(e,t),o.v(t))}return e},update:function(n){o.v(null,n)}};return u.update(!0),u}})); |