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