Files
OverlayScrollbars/packages/overlayscrollbars/dist/overlayscrollbars.min.js
T

1 line
22 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";function n(n,t){var r,i=n.o,e=n.u,o=n.v,u=i,a=function(n,t){var i=u,a=n,c=t||(e?!e(i,a):i!==a);return(c||o)&&(u=a,r=i),[u,c,r]};return[t?function(n){return a(t(u,r),n)}:a,function(n){return[u,!!n,r]}]}var t=Node.ELEMENT_NODE,r=Object.prototype,i=r.toString,e=r.hasOwnProperty;function o(n){return void 0===n}function u(n){return null===n}function a(n){return"number"==typeof n}function c(n){return"string"==typeof n}function f(n){return"boolean"==typeof n}function l(n){return"function"==typeof n}function v(n){return Array.isArray(n)}function s(n){return"object"==typeof n&&!v(n)&&!u(n)}function d(n){var t=!!n&&n.length,r=a(t)&&t>-1&&t%1==0;return!!(v(n)||!l(n)&&r)&&(!(t>0&&s(n))||t-1 in n)}function _(n){if(!n||!s(n)||"object"!==function(n){return o(n)||u(n)?""+n:i.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}(n))return!1;var t,r="constructor",a=n[r],c=a&&a.prototype,f=e.call(n,r),l=c&&e.call(c,"isPrototypeOf");if(a&&!f&&!l)return!1;for(t in n);return o(t)||e.call(n,t)}function g(n){var r=window.Element;return!!n&&(r?n instanceof r:n.nodeType===t)}function h(n,t){if(d(n))for(var r=0;r<n.length&&!1!==t(n[r],r,n);r++);else n&&h(Object.keys(n),(function(r){return t(n[r],r,n)}));return n}var w=function(n,t,r){return n.indexOf(t,r)},p=function(n,t,r){return r||c(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 h(n,(function(n){p(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):h(n,r)},x=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},O=function(n){return n?Object.keys(n):[]};function S(n,t,r,i,e,o,a){var c=[t,r,i,e,o,a];return"object"==typeof n&&!u(n)||l(n)||(n={}),h(c,(function(t){h(O(t),(function(r){var i=t[r];if(n===i)return!0;var e=v(i);if(i&&(_(i)||e)){var o=n[r],u=o;e&&!v(o)?u=[]:e||_(o)||(u={}),n[r]=S(u,i)}else n[r]=i}))})),n}function z(n,t,r,i){if(o(i))return r?r[n]:t;r&&(r[n]=i)}function C(n,t,r){if(o(r))return n?n.getAttribute(t):null;n&&n.setAttribute(t,r)}var L=function(n,t){n&&n.removeAttribute(t)};function A(n,t){return z("scrollLeft",0,n,t)}function I(n,t){return z("scrollTop",0,n,t)}var M,j=Element.prototype,T=function(n,t){var r=[],i=t?g(t)?t:null:document;return i?p(r,i.querySelectorAll(n)):r},R=function(n,t){return!!g(n)&&(j.matches||j.msMatchesSelector).call(n,t)},E=function(n){return n?b(n.childNodes):[]},V=function(n){return n?n.parentElement:null},B=function(n,t,r){if(r){var i,e=t;n&&(d(r)?(i=document.createDocumentFragment(),h(r,(function(n){n===e&&(e=n.previousSibling),i.appendChild(n)}))):i=r,t&&(e?e!==t&&(e=e.nextSibling):e=n.firstChild),n.insertBefore(i,e||null))}},k=function(n,t){B(n,null,t)},P=function(n,t){B(n,n&&n.firstChild,t)},D=function(n,t){B(V(n),n&&n.nextSibling,t)},H=function n(t){if(d(t))h(b(t),(function(t){return n(t)}));else if(t){var r=V(t);r&&r.removeChild(t)}},Y=function(n){var t=document.createElement("div");return n&&C(t,"class",n),t},q=function(n){var t=Y();return t.innerHTML=n.trim(),h(E(t),(function(n){return H(n)}))},F=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},N=["-webkit-","-moz-","-o-","-ms-"],X=["WebKit","Moz","O","MS","webkit","moz","o","ms"],W={},U={},$=function(n){var t=U[n];if(x(U,n))return t;var r=F(n),i=Y().style;return h(N,(function(e){var o=e.replace(/-/g,""),u=[n,e+n,o+r,F(o)+r];return!(t=u.find((function(n){return void 0!==i[n]})))})),U[n]=t||""},G=function(n){var t=W[n]||window[n];return x(W,n)||(h(X,(function(r){return!(t=t||window[r+F(n)])})),W[n]=t),t},J=G("MutationObserver"),K=G("IntersectionObserver"),Q=G("ResizeObserver"),Z=G("cancelAnimationFrame"),nn=G("requestAnimationFrame"),tn=/[^\x20\t\r\n\f]+/g,rn=function(n,t,r){var i,e=0,o=!1;if(n&&c(t)){var u=t.match(tn)||[];for(o=u.length>0;i=u[e++];)o=!!r(n.classList,i)&&o}return o},en=function(n,t){rn(n,t,(function(n,t){return n.add(t)}))},on=function(n,t){rn(n,t,(function(n,t){return n.remove(t)}))},un={w:0,h:0},an=function(){return{w:window.innerWidth,h:window.innerHeight}},cn=function(n){return n?{w:n.offsetWidth,h:n.offsetHeight}:un},fn=function(n){return n?{w:n.clientWidth,h:n.clientHeight}:un},ln=function(n){return n?{w:n.scrollWidth,h:n.scrollHeight}:un},vn=function(n){return n.getBoundingClientRect()},sn=function(n){return n.split(" ")},dn=function(n,t,r,i){h(sn(t),(function(t){n.removeEventListener(t,r,i)}))},_n=function(n,t,r,i){var e=function(){if(o(M)){M=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){M=!0}}))}catch(n){}}return M}(),u=e&&i&&i.s||!1,a=i&&i._||!1,c=i&&i.g||!1,f=[],l=e?{passive:u,capture:a}:a;return h(sn(t),(function(t){var i=c?function(e){n.removeEventListener(t,i,a),r&&r(e)}:r;p(f,dn.bind(null,n,t,i,a)),n.addEventListener(t,i,l)})),y.bind(0,f)},gn=function(n){return function(n){return n.stopPropagation()}(n)||function(n){return n.preventDefault()}(n)},hn=function(n,t,r,i){if(n&&t){var e=!0;return h(r,(function(r){(i?i(n[r]):n[r])!==(i?i(t[r]):t[r])&&(e=!1)})),e}return!1},wn=function(n,t){return hn(n,t,["w","h"])},pn=function(n,t){return hn(n,t,["t","r","b","l"])},bn=function(n,t,r){return hn(n,t,["width","height"],r&&function(n){return Math.round(n)})},mn=function(n){n&&window.clearTimeout(n),n&&Z(n)},yn=function(){},xn=function(n,t){var r,i,e,o,u=t||{},c=u.p,f=u.m,v=u.O,s=window.setTimeout,d=function(t){mn(r),mn(i),i=r=e=void 0,n.apply(this,t)},_=function(n){return v&&e?v(e,n):n},g=function(){r&&d(_(o)||o)},h=function(){var n=b(arguments),t=l(c)?c():c,u=a(t)&&t>=0;if(u){var v=l(f)?f():f,h=a(v)&&v>=0,w=t>0?s:nn,p=_(n),m=p||n,y=d.bind(0,m);mn(r),r=w(y,t),h&&!i&&(i=s(g,v)),e=o=m}else d(n)};return h.S=g,h},On={opacity:1,zindex:1},Sn=function(n,t){var r=t?parseFloat(n):parseInt(n,10);return Number.isNaN(r)?0:r},zn=function(n,t,r){return null!=t?t[r]||t.getPropertyValue(r):n.style[r]},Cn=function(n,t,r){try{if(n){var i=n.style;o(i[t])?i.setProperty(t,r):i[t]=function(n,t){return!On[n.toLowerCase()]&&a(t)?t+"px":t}(t,r)}}catch(e){}};function Ln(n,t){var r=c(t);if(v(t)||r){var i=r?"":{};if(n){var e=window.getComputedStyle(n,null);i=r?zn(n,e,t):t.reduce((function(t,r){return t[r]=zn(n,e,r),t}),i)}return i}h(O(t),(function(r){return Cn(n,r,t[r])}))}var An=function(n,t,r){var i=t?t+"-":"",e=r?"-"+r:"",o=i+"top"+e,u=i+"right"+e,a=i+"bottom"+e,c=i+"left"+e,f=Ln(n,[o,u,a,c]);return{t:Sn(f[o]),r:Sn(f[u]),b:Sn(f[a]),l:Sn(f[c])}},In={x:0,y:0},Mn=function(n){var t=n?vn(n):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:In},jn="os-environment",Tn=jn+"-flexbox-glue",Rn=Tn+"-max",En="os-host",Vn="os-padding",Bn="os-viewport",kn=Bn+"-arrange",Pn="os-content",Dn=Bn+"-scrollbar-styled",Hn="os-size-observer",Yn=Hn+"-appear",qn=Hn+"-listener",Fn=qn+"-scroll",Nn=qn+"-item",Xn=Nn+"-final",Wn="os-trinsic-observer",Un="os-scrollbar",$n=Un+"-horizontal",Gn=Un+"-vertical",Jn="os-scrollbar-track",Kn="os-scrollbar-handle";var Qn={exports:{}};!function(n){function t(){return n.exports=t=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},n.exports.C=!0,n.exports["default"]=n.exports,t.apply(this,arguments)}n.exports=t,n.exports.C=!0,n.exports["default"]=n.exports}(Qn);var Zn,nt,tt=(Zn=Qn.exports)&&Zn.C&&Object.prototype.hasOwnProperty.call(Zn,"default")?Zn["default"]:Zn,rt=function(n){return JSON.stringify(n,(function(n,t){if(l(t))throw new Error;return t}))},it={resize:"none",paddingAbsolute:!1,updating:{elementEvents:[["img","load"]],attributes:null,debounce:[0,33]},overflow:{x:"scroll",y:"scroll"},scrollbars:{visibility:"auto",autoHide:"never",autoHideDelay:800,dragScroll:!0,clickScroll:!1,touch:!0},textarea:{dynWidth:!1,dynHeight:!1,inheritedAttrs:["style","class"]},nativeScrollbarsOverlaid:{show:!1,initialize:!1},callbacks:{onUpdated:null}},et=Math.abs,ot=Math.round,ut=function(n,t){k(n,t);var r=fn(t),i=cn(t);return{x:i.h-r.h,y:i.w-r.w}},at=function(n,t){var r="hidden";Ln(n,{overflowX:r,overflowY:r,direction:"rtl"}),A(n,0);var i=Mn(n),e=Mn(t);A(n,-999);var o=Mn(t);return{i:i.x===e.x,n:e.x!==o.x}},ct=function(n,t){en(n,Tn);var r=vn(n),i=vn(t),e=bn(i,r,!0);en(n,Rn);var o=vn(n),u=vn(t),a=bn(u,o,!0);return e&&a},ft=function(){var n=window.screen.deviceXDPI||0,t=window.screen.logicalXDPI||1;return window.devicePixelRatio||n/t},lt=function(){var n=document.body,t=q('<div class="'+jn+'"><div></div></div>')[0],r=t.firstChild,i=new Set,e=ut(n,t),o=function(n){var t=!1;en(n,Dn);try{t="none"===Ln(n,$("scrollbar-width"))||"none"===window.getComputedStyle(n,"::-webkit-scrollbar").getPropertyValue("display")}catch(r){}return t}(t),u={x:0===e.x,y:0===e.y},a={L:null,A:null,I:null,M:null,j:null},c=a,f=it,l={T:e,R:u,V:o,B:"-1"===Ln(t,"zIndex"),k:at(t,r),P:ct(t,r),D:function(n){i.add(n)},H:function(n){i.delete(n)},Y:function(){return tt({},c)},q:function(n){c=S({},c,n)},F:function(){return tt({},f)},N:function(n){f=S({},f,n)},X:a,W:f};if(L(t,"style"),H(t),!(o||u.x&&u.y)){var v=an(),s=ft(),d=e;window.addEventListener("resize",(function(){if(i.size){var r=an(),e={w:r.w-v.w,h:r.h-v.h};if(0===e.w&&0===e.h)return;var o={w:et(e.w),h:et(e.h)},u={w:et(ot(r.w/(v.w/100))),h:et(ot(r.h/(v.h/100)))},a=ft(),c=o.w>2&&o.h>2,f=(_=u.h,g=et(u.w),h=et(_),!(g!==h&&g+1!==h&&g-1!==h));if(c&&f&&(a!==s&&s>0)){var l=nt.T=ut(n,t);H(t),d.x===l.x&&d.y===l.y||y(i),d=l}v=r,s=a}var _,g,h}))}return l},vt=function(){return nt||(nt=lt()),nt},st=0,dt=function(n){k(V(n),E(n)),H(n)},_t=function(){var n=vt(),t=n.V,r=n.R,i=!!(!n.B&&!t&&(r.x||r.y))&&document.createElement("style");return i&&(C(i,"id",kn+"-"+st),st++),i},gt=function(n,t,r,i){var e=t||(l(r)?r(n):r);return e||Y(i)},ht=function(n,t,r,i,e){var o=f(t)||t?t:l(r)?r(n):r;return null===o?!!e&&Y(i):!0===o?Y(i):o},wt=function(n){var r,i,e,o,u=vt(),a=u.Y,c=u.V,f=a(),l=f.L,v=f.A,s=f.I,d=f.M,_=(r=n,i=window.HTMLElement,!!r&&(i?r instanceof i:r.nodeType===t)),g=n,h=_?n:g.target,b=R(h,"textarea"),m=!b&&R(h,"body"),x=h.ownerDocument,S=x.body,z=x.defaultView,C={U:h,L:b?gt(h,g.host,l,En):h,A:gt(h,g.viewport,v,Bn),I:ht(h,g.padding,s,Vn,!c),M:ht(h,g.content,d,Pn,!1),$:_t()},L={G:z,J:x,K:V(S),Z:S,nn:b,tn:m,rn:_},A=O(C).reduce((function(n,t){var r=C[t];return p(n,!(!r||V(r))&&r)}),[]),I=function(n){return n?w(A,n)>-1:null},M=C.U,j=C.L,T=C.I,P=C.A,Y=C.M,q=C.$,F=[],N=b&&I(j),X=b?M:E([Y,P,T,j,M].find((function(n){return!1===I(n)}))),W=Y||P;return N&&(D(M,j),p(F,(function(){D(j,M),H(j)}))),k(W,X),k(j,T),k(T||j,P),k(P,Y),en(j,En),en(T,Vn),en(P,Bn),en(Y,Pn),p(F,(function(){_?(k(j,E(W)),H(T||P),on(j,En)):(I(Y)&&dt(Y),I(P)&&dt(P),I(T)&&dt(T),on(j,En),on(T,Vn),on(P,Bn),on(Y,Pn))})),c&&p(F,on.bind(0,P,Dn)),q&&(o=q,B(V(e=P),e,o),p(F,H.bind(0,q))),{in:C,en:L,on:function(){y(F)}}},pt=function(n){var t=Y(Un+" "+n),r=Y(Jn),i=Y(Kn);return k(t,r),k(r,i),{un:t,an:r,cn:i}},bt="animationstart",mt="scroll",yt=3333333,xt=function(n){return"rtl"===Ln(n,"direction")},Ot=function(n){return n&&(n.height||n.width)},St=function(t,r,i){var e,o=i||{},u=o.fn,a=void 0!==u&&u,c=o.ln,l=void 0!==c&&c,d=vt().k,_=q('<div class="'+Hn+'"><div class="'+qn+'"></div></div>')[0],g=_.firstChild,h=xt.bind(0,_),w=n({o:void 0,v:!0,u:function(n,t){return!(!n||!Ot(n)&&Ot(t))}})[0],b=function(n){var t=v(n)&&n.length>0&&s(n[0]),i=!t&&f(n[0]),e=!1,o=!1,u=!0;if(t){var c=w(n.pop().contentRect),l=c[0],g=c[2],h=Ot(l);o=!Ot(g)&&h,u=!(e=!g||!h)}else i?u=n[1]:o=!0===n;if(a&&u){var p=i?n[0]:xt(_);A(_,p?d.n?-yt:d.i?0:yt:yt),I(_,yt)}e||r({vn:!i,sn:i?n:void 0,ln:!!o})},m=[],x=!!l&&b;if(Q){var O=new Q(b);O.observe(g),p(m,(function(){O.disconnect()}))}else{var S=q('<div class="'+Nn+'" dir="ltr"><div class="'+Nn+'"><div class="'+Xn+'"></div></div><div class="'+Nn+'"><div class="'+Xn+'" style="width: 200%; height: 200%"></div></div></div>');k(g,S),en(g,Fn);var z,C=S[0],L=C.lastChild,M=C.firstChild,j=null==M?void 0:M.firstChild,T=cn(C),R=T,E=!1,V=function(){A(M,yt),I(M,yt),A(L,yt),I(L,yt)},B=function(n){z=0,E&&(T=R,b(!0===n))},D=function(n){R=cn(C),E=!n||!wn(R,T),n?(gn(n),E&&!z&&(Z(z),z=nn(B))):B(!1===n),V()};p(m,[_n(M,mt,D),_n(L,mt,D)]),Ln(j,{width:yt,height:yt}),V(),x=l?D.bind(0,!1):V}if(a){var Y=(e=n({o:!h()},h))[0];p(m,_n(_,mt,(function(n){var t=Y(),r=t[0];t[1]&&(on(g,"ltr rtl"),en(g,r?"rtl":"ltr"),b(t)),gn(n)})))}return x&&(en(_,Yn),p(m,_n(_,bt,x,{g:!!Q}))),P(t,_),{on:function(){y(m),H(_)},dn:function(n){return{_n:e?e[1](n):[!1,!1,!1]}}}},zt=function(n,t,r,i){var e=!1,o=i||{},u=o.gn,a=o.hn,f=o.wn,l=o.pn,v=o.bn,s=o.mn,d=o.yn,_=function(n,t,r){var i,e=!1,o=function(o){r&&h(r.reduce((function(t,r){if(r){var i=r[0],e=r[1],u=e&&i&&(o?o(i):T(i,n));u&&u.length&&e&&c(e)&&p(t,[u,e.trim()],!0)}return t}),[]),(function(n){return h(n[0],(function(r){var o=n[1],u=i.get(r);if(u){var a=u[0],c=u[1];a===o&&c()}var f=_n(r,o,(function(n){e?(f(),i.delete(r)):t(n)}));i.set(r,[o,f])}))}))};return r&&(i=new WeakMap,o()),{on:function(){e=!0},xn:o}}(n,xn((function(){e&&r(!0)}),{p:33,m:99}),f),g=_.on,b=_.xn,y=a||[],x=(u||[]).concat(y),O=function(e){var o=(t?s:v)||yn,u=d||yn,a=[],f=[],_=!1,g=!1,x=!1;h(e,(function(r){var e=r.attributeName,v=r.target,s=r.type,d=r.oldValue,h=r.addedNodes,b="attributes"===s,m="childList"===s,O=n===v,S=b&&c(e)?C(v,e):0,z=0!==S&&d!==S,L=w(y,e)>-1&&z;if(t&&!O){var A=!b,I=b&&L,M=I&&l&&R(v,l),j=(M?!o(v,e,d,S):A||I)&&!u(r,!!M,n,i);p(f,h),g=g||j,x=x||m}!t&&O&&z&&!o(v,e,d,S)&&(p(a,e),_=_||L)})),x&&!m(f)&&b((function(n){return f.reduce((function(t,r){return p(t,T(n,r)),R(r,n)?p(t,r):t}),[])})),t?g&&r(!1):m(a)&&!_||r(a,_)},S=new J(O);return S.observe(n,{attributes:!0,attributeOldValue:!0,attributeFilter:x,subtree:t,childList:t,characterData:t}),e=!0,{on:function(){e&&(g(),S.disconnect(),e=!1)},On:function(){e&&O(S.takeRecords())}}},Ct="os-",Lt=["tabindex"],At=["wrap","cols","rows"],It=["id","class","style","open"],Mt=function(n,t,r,i){var e,o,u,a,c;return!("class"!==t||!r||!i)&&!!(o=i,u=(e=r)&&e.split(" "),a=o&&o.split(" "),c={},h(u,(function(n){c[n]=1})),h(a,(function(n){c[n]?delete c[n]:c[n]=1})),O(c)).find((function(n){return 0!==n.indexOf(Ct)}))},jt=function(t,r){var i,e,o,u=t.Sn,f=u.in,l=u.en,s=f.L,d=f.A,_=f.M,g=l.nn,b=vt(),m=b.V,x=b.P,O=g?At:It.concat(At),S=xn(r,{p:function(){return i},m:function(){return e},O:function(n,t){var r=n[0],i=r.vn,e=r.zn,o=r.Cn,u=t[0],a=u.vn,c=u.zn,f=u.Cn;return[{vn:i||a,zn:e||c,Cn:o||f}]}}),z=function(n){h(n||Lt,(function(n){if(w(Lt,n)>-1){var t=C(s,n);c(t)?C(d,n,t):L(d,n)}}))},A=function(n){(n?r:S)({Cn:!0})},I=(_||!x)&&function(t,r){var i=Y(Wn),e=[],o=n({o:!1}),u=o[0],a=o[1],c=function(n){if(n){var t=u(0===(i=n).h||i.isIntersecting||i.intersectionRatio>0);t[1]&&r(t)}var i};if(K){var f=new K((function(n){n&&n.length>0&&c(n.pop())}),{root:t});f.observe(i),p(e,(function(){f.disconnect()}))}else{var l=function(){var n=cn(i);c(n)};p(e,St(i,l).on),l()}return P(t,i),{on:function(){y(e),H(i)},dn:function(n){return{Ln:a(n)}}}}(s,(function(n){r({Ln:n})})),M=St(s,(function(n){var t=n.vn,i=n.sn,e=n.ln;(!t||e?r:S)({vn:t,_n:i})}),{ln:!0,fn:!m}),j=zt(s,!1,(function(n,t){t?S({zn:!0}):z(n)}),{hn:It,gn:It.concat(Lt),bn:Mt});return z(),{An:I,In:M,Mn:function(n){var t=n("updating.elementEvents"),r=t[0],u=t[1],c=n("updating.attributes"),f=c[0],l=c[1],s=n("updating.debounce"),g=s[0],h=s[1];if((u||l)&&(o&&(o.On(),o.on()),o=zt(_||d,!0,A,{hn:O.concat(f||[]),gn:O.concat(f||[]),wn:r,mn:Mt})),h)if(S.S(),v(g)){var w=g[0],p=g[1];i=!!a(w)&&w,e=!!a(p)&&p}else a(g)?(i=g,e=!1):(i=!1,e=!1)},on:function(){o&&o.on(),I&&I.on(),M.on(),j.on()}}},Tt=function(t){var r=t.Sn,i=t.jn,e=r.in,o=e.L,u=e.I,a=e.A,c=n({u:pn,o:An()},An.bind(0,o,"padding","")),f=c[0],l=c[1];return function(n,t,r){var e=l(r),o=e[0],c=e[1],v=vt(),s=v.V,d=v.P,_=n.vn,g=n._n,h=n.Cn,w=g[0],p=g[1],b=t("paddingAbsolute"),m=b[0],y=b[1];if(_||c||!d&&h){var x=f(r);o=x[0],c=x[1]}var O=y||p||c;if(O){var S=!m||!u&&!s,z=o.r+o.l,C=o.t+o.b,L={marginRight:S&&!w?-z:0,marginBottom:S?-C:0,marginLeft:S&&w?-z:0,top:S?-o.t:0,right:S?w?-o.r:"auto":0,left:S?w?"auto":-o.l:0,width:S?"calc(100% + "+z+"px)":""},A={paddingTop:S?o.t:0,paddingRight:S?o.r:0,paddingBottom:S?o.b:0,paddingLeft:S?o.l:0};Ln(u||a,L),Ln(a,A),i({Tn:{Rn:!S,I:o},En:u?A:tt({},L,A)})}return{Vn:O}}},Rt=Math.max,Et=Math.abs,Vt=Math.round,Bt=42,kt={u:wn,o:{w:0,h:0}},Pt=function(n){var t=cn(n),r=vn(n);return{w:r.width-t.w,h:r.height-t.h}},Dt=function(){return window.devicePixelRatio%1==0?0:1},Ht=function(n,t,r,i){var e=n?"overflowX":"overflowY",o=0===r.indexOf("visible"),u="visible-hidden"===r,a="scroll"===r,c=t>0;return o&&(i[e]="visible"),a&&c&&(i[e]=r),{Bn:o,kn:u?"hidden":"scroll"}},Yt=function(t){var r=t.Sn,i=t.Pn,e=t.Dn,o=t.jn,u=r.in,a=u.L,c=u.A,f=u.$,l=n(kt,Pt.bind(0,c)),v=l[0],s=l[1],d=n(kt,ln.bind(0,c)),_=d[0],g=d[1],w=n(kt),p=w[0],b=w[1],m=function(n,t){if(Ln(c,{height:""}),t){var r=vt().R,i=e().Tn,o=i.Rn,u=i.I,f=n.Hn,l=n.Yn,v=Pt(a),s=fn(a),d="content-box"===Ln(c,"boxSizing"),_=o||d?u.b+u.t:0,g=s.h+(Et(v.h)<1?v.h:0),h=!(r.x&&d);Ln(c,{height:g+(f.x&&h?l.x:0)-_})}},y=function(n,t){var r=vt(),i=r.T,e=r.R,o=r.V,u=e.x,a=e.y,f=o||n?0:Bt,l=!t?Ln(c,["overflowX","overflowY"]):t,v={x:"scroll"===l.overflowX,y:"scroll"===l.overflowY},s={x:u?f:i.x,y:a?f:i.y};return{Hn:v,qn:{x:u&&!!f,y:a&&!!f},Yn:{x:v.x&&!o?s.x:0,y:v.y&&!o?s.y:0}}},x=function(n,t,r,o){if(i){var u=n.Yn,a=n.qn,l=a.x,v=a.y,s=u.x,d=u.y,_=e().En,g=_[o?"paddingRight":"paddingLeft"],h=_.paddingTop,w=t.w+(Et(r.w)<1?r.w:0),p=t.h+(Et(r.h)<1?r.h:0),b={w:d&&v?d+w-g+"px":"",h:s&&l?s+p-h+"px":""};if(f){var m=f.sheet;if(m){var y=m.cssRules;if(y){y.length||m.insertRule("#"+C(f,"id")+" + ."+kn+"::before {}",0);var x=y[0].style;x.width=b.w,x.height=b.h}}}else Ln(c,{"--os-vaw":b.w,"--os-vah":b.h})}return i},S=function(n,t,r,i){var o=n.Yn,u=n.qn,a=u.x,c=u.y,f=o.x,l=o.y,v=e().En,s=t?"marginLeft":"marginRight",d=t?"paddingLeft":"paddingRight",_=v[s],g=v.marginBottom,h=v[d],w=v.paddingBottom;i.width="calc(100% + "+(l+-1*_)+"px)",i[s]=-l+_,i.marginBottom=-f+g,r&&(i[d]=h+(c?l:0),i.paddingBottom=w+(a?f:0))};return function(n,t,r){var u,a=n._n,f=n.Ln,l=n.vn,d=n.zn,w=n.Cn,z=n.Vn,C=vt(),L=C.P,A=C.V,I=C.R,M=f[0],j=f[1],T=a[0],R=a[1],E=t("nativeScrollbarsOverlaid.show"),V=E[0],B=E[1],k=V&&I.x&&I.y,P=!L&&(l||w||d||B||j),D=s(r),H=g(r),Y=b(r);if(B&&A&&(k?on(c,Dn):en(c,Dn)),P&&(u=y(k),m(u,!!M)),l||z||w||B||R){var q=function(n,t,r){if(i){var o=r||y(n),u=e().En,a=vt().P,f=o.qn,l=f.x,v=f.y,s={},d=function(n){return h(n.split(" "),(function(n){s[n]=u[n]}))};a||(s.height=""),l&&d("marginBottom paddingTop paddingBottom"),v&&d("marginLeft marginRight paddingLeft paddingRight");var _=Ln(c,O(s));return on(c,kn),Ln(c,s),[function(){S(o,t,i,_),Ln(c,_),en(c,kn)},o]}return[yn]}(k,T,u),F=q[0],N=q[1],X=D=v(r),W=X[0],U=X[1],$=H=_(r),G=$[0],J=$[1],K=fn(c),Q=G,Z=K;F(),(J||U||B)&&N&&!k&&x(N,G,W,T)&&(Z=fn(c),Q=ln(c)),Y=p(function(n,t,r){return{w:Rt(0,Vt(Rt(0,n.w-t.w)-(Dt()||Rt(0,r.w)))),h:Rt(0,Vt(Rt(0,n.h-t.h)-(Dt()||Rt(0,r.h))))}}({w:Rt(G.w,Q.w),h:Rt(G.h,Q.h)},{w:Z.w+Rt(0,K.w-G.w),h:Z.h+Rt(0,K.h-G.h)},W),r)}var nn=D,tn=nn[0],rn=nn[1],un=H,an=un[0],cn=un[1],vn=Y,sn=vn[0],dn=vn[1],_n=t("overflow"),gn=_n[0],hn=_n[1];if(z||rn||cn||dn||hn||B||R||P){var wn={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},pn=function(n,t,r,i){var e=Ht(!0,t.w,r.x,i),o=e.Bn,u=e.kn,a=Ht(!1,t.h,r.y,i),c=a.Bn,f=a.kn;return o&&!c&&(i.overflowX=u),c&&!o&&(i.overflowY=f),y(n,i)}(k,sn,gn,wn),bn=x(pn,an,tn,T);S(pn,T,bn,wn),P&&m(pn,!!M),Ln(c,wn),o({Fn:pn.Hn,Nn:sn})}}},qt=function(n,t){return n?t.split(".").reduce((function(n,t){return n&&x(n,t)?n[t]:void 0}),n):void 0},Ft=[!1,!1,!1],Nt={Tn:{Rn:!1,I:{t:0,r:0,b:0,l:0}},Fn:{x:!1,y:!1},Nn:{w:0,h:0},En:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0}},Xt={},Wt=["__TPL_","_TYPE__"],Ut=["boolean","number","string","array","object","function","null"].reduce((function(n,t){return n[t]=Wt[0]+t+Wt[1],n}),{});Ut.number,Ut.boolean,Ut.array,Ut.null,Ut.string,Ut.array,Ut.null;Ut.number,Ut.array,Ut.null,Ut.function,Ut.null;var $t="__osOptionsValidationPlugin",Gt=function n(t,r){var i=vt().F,e=S({},Xt),o=e[$t],u=o&&o.Xn,c=S({},i(),u?u(r||{},!0):r),f=wt(t),d=function(n,t){var r=(0,vt().Y)().j,i=t.in,e=t.en,o=i.U,u=i.L,a=i.A,c=!e.rn&&n.scrollbarsSlot,f=(l(c)?c(o,u,a):c)||(l(r)?r(o,u,a):r)||u,v=pt($n),s=pt(Gn),d=v.un,_=s.un;return k(f,d),k(f,_),{Wn:v,Un:s,on:function(){H([d,_])}}}(t,f),_=function(n,t,r){var i,e,o=Nt,u=t.in.A,c=vt(),f=c.V,l=c.R,v=c.P,s=c.D,d=c.H,_=!f&&(l.x||l.y),g={$n:n,Sn:t,Pn:_,Dn:function(){return o},jn:function(n){o=S({},o,n)}},w=[(i=g,e=i.Sn.in.M,function(n){var t=n.Ln,r=t[0],i=t[1];return i&&Ln(e,{height:r?"":"100%",display:r?"":"inline"}),{vn:i,Cn:i}}),Tt(g),Yt(g)],p=function(t,r,i){var e=t||{},o=e._n,c=e.Ln,f=e.vn,l=void 0===f?i||!1:f,s=e.zn,d=void 0===s?i||!1:s,g=e.Cn,p=void 0===g?i||!1:g,b=e.Vn,O=void 0===b?i||!1:b,S=o||(m?m.dn(i)._n:Ft),z=c||(y?y.dn(i).Ln:Ft),C=function(t){return[qt(n,t),i||void 0!==qt(r,t)]},L=_||!v,M=L&&A(u),j=L&&I(u);x&&x(C),h(w,(function(n){var t=n({_n:S,Ln:z,vn:l,zn:d,Cn:p,Vn:O},C,!!i)||{},r=t.vn,e=t.zn,o=t.Cn,u=t.Vn;l=r||l,d=e||d,p=o||p,O=u||O})),a(M)&&A(u,M),a(j)&&I(u,j),n.callbacks.onUpdated&&n.callbacks.onUpdated()},b=jt(g,p),m=b.In,y=b.An,x=b.Mn,O=b.on,z=function(n,t){return p({},n,t)},C=z.bind(0,{},!0);return s(C),console.log(vt()),{On:z,Gn:function(){return{Jn:o.Nn}},on:function(){O(),d(C),t.on(),r.on()}}}(c,f,d),g={options:function(n){if(n){var t=function n(t,r){var i={};return h(O(r).concat(O(t)),(function(e){var o=t[e],u=r[e];if(s(o)&&s(u))S(i[e]={},n(o,u));else if(x(r,e)&&u!==o){var a=!0;if(v(o)||v(u))try{rt(o)===rt(u)&&(a=!1)}catch(c){}a&&(i[e]=u)}})),i}(c,u?u(n,!0):n);(function(n){for(var t in n)return!1;return!0})(t)||(S(c,t),_.On(t))}return c},state:function(){return _.Gn()},update:function(n){_.On({},n)},destroy:function(){return _.on()}};return h(O(e),(function(t){var r=e[t];l(r)&&r(n,g)})),g.update(!0),g};return Gt.extend=function(n){return h(v(n)?n:[n],(function(n){Xt[n[0]]=n[1]}))},Gt}));