Socket
Socket
Sign inDemoInstall

react-laag

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-laag - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

50

dist/react-laag.cjs.production.min.js

@@ -1,50 +0,2 @@

'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var p=require("react"),aa=require("react-dom");require("tiny-warning");function w(a,d){if(d){a=a.prototype;for(var b=0;b<d.length;b++){var c=d[b];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}}
function y(){y=Object.assign||function(a){for(var d=1;d<arguments.length;d++){var b=arguments[d],c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}return a};return y.apply(this,arguments)}function ba(a,d){a.prototype=Object.create(d.prototype);a.prototype.constructor=a;a.__proto__=d}
function ca(a){if(a){if("string"===typeof a)return da(a);var d=Object.prototype.toString.call(a).slice(8,-1);"Object"===d&&a.constructor&&(d=a.constructor.name);if("Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return da(a)}}function da(a){var d=void 0;if(null==d||d>a.length)d=a.length;for(var b=0,c=Array(d);b<d;b++)c[b]=a[b];return c}
function A(a){var d;if("undefined"===typeof Symbol||null==a[Symbol.iterator]){if(Array.isArray(a)||(d=ca(a))){d&&(a=d);var b=0;return function(){return b>=a.length?{done:!0}:{done:!1,value:a[b++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}d=a[Symbol.iterator]();return d.next.bind(d)}function ea(a){var d=p.h(null);return function(b){b&&b!==d.current&&(d.current=b,a(b))}}
function fa(){var a=p.h({v:[],c:null,b:null});return p.$a(function(){return[function(){return a.current},function(d){a.current="function"===typeof d?d(a.current):d}]},[])}function ia(){var a=p.h([]);return p.$a(function(){return{Ma:function(){return 0<a.current.length},Ta:function(){for(var d=A(a.current),b;!(b=d()).done;)b=b.value,b();a.current=[]},ya:function(d){a.current.push(d)}}},[])}var ja="undefined"!==typeof window?p.Ob:p.B;
function ka(a,d){var b=p.h(a);if(!d)return b.current=null,b;b.current=a;return b}var la={top:0,left:0,right:1,bottom:1,width:1,height:1};function G(a){return parseFloat(a.replace("px",""))}function ma(){for(var a=arguments.length,d=Array(a),b=0;b<a;b++)d[b]=arguments[b];return function(c){for(var f=A(d),g;!(g=f()).done;)if(g=g.value)"function"===typeof g?g(c):g.current=c}}
function na(a,d){var b=[];if(!a||!d||a===document.body)return b;var c=d.getComputedStyle(a);[c.overflow,c.overflowX,c.overflowY].some(function(f){return["auto","scroll"].includes(f)})&&b.push(a);return[].concat(b,na(a.parentElement,d))}
function I(a){return"react-laag: Could not find a valid reference for the "+a+" element. There might be 2 causes:\n - Make sure that the 'ref' is set correctly on the "+a+' element when isOpen: true. Also make sure your component forwards the ref with "forwardRef()".\n - Make sure that you are actually rendering the '+a+" when the isOpen prop is set to true"}
function oa(a){var d=a.enabled,b=a.Ra,c=a.S,f=a.o,g=a.Ya;var e="undefined"!==typeof c?a.xa||c.ResizeObserver:void 0;p.B(function(){},[e]);var h=p.h(null),l=!!g;a=fa();var k=a[0],n=a[1];a=ia();var m=a.Ma,t=a.ya,q=a.Ta,u=p.A(function(){var r=k(),v=r.b,C=r.c;r=r.v;var x=r[0];if(!v)throw Error(I("layer"));if(!C&&!l)throw Error(I("trigger"));var E=x?{top:x.scrollTop,left:x.scrollLeft}:{top:c.scrollY,left:c.scrollX};var F={left:0,top:0};x&&(x=c.getComputedStyle(x),F=x.borderTopWidth,F={left:G(x.borderLeftWidth)||
0,top:G(F)||0});b({b:v,c:C,v:r,j:h.current},E,F)},[k,b,c,h,l]),z=p.A(function(){function r(){var B=W.value;B.addEventListener("scroll",u);t(function(){return B.removeEventListener("scroll",u)})}var v=k(),C=v.c,x=v.b;v=v.v;if(!x)throw Error(I("layer"));if(!C&&!l)throw Error(I("trigger"));if(e){for(var E=!1,F=new e(function(){E?u():E=!0}),M=0,X=[C,x,document.body];M<X.length;M++){var T=X[M];T&&F.observe(T)}t(function(){for(var B=0,N=[C,x,document.body];B<N.length;B++){var O=N[B];O&&F.unobserve(O)}F.disconnect()})}v=
A([c].concat(v));for(var W;!(W=v()).done;)r()},[k,t,u,c,e,l]),L=p.A(function(r,v){d&&r&&r!==v&&(q(),z(),u())},[q,z,u,d]);a=ea(p.A(function(r){var v=k().b;n(function(C){return y({},C,{b:r})});L(v,r)},[k,n,L]));var K=p.A(function(r){r=na(r,c);var v=r[0];if(v){var C=c.getComputedStyle(v).position;["relative","absolute","fixed"].includes(C)||f||(v.style.position="relative")}return r},[c,f]),H=ea(p.A(function(r){var v=K(r),C=k().c;n(function(x){return y({},x,{c:r,v})});L(C,r)},[k,n,L,K])),D=null==g?void 0:
null==g.getParent?void 0:g.getParent();ja(function(){D&&n(function(r){return y({},r,{v:K(D)})})},[D,n,K]);ja(function(){d&&(m()||z());return function(){m()&&q()}},[d,m,z,q]);ja(function(){d&&u()});return{Za:H,Oa:a,Aa:h,Ca:k().v[0]||null}}var pa=p.jb({});function qa(a){var d=a.children,b=a.fa;a=p.A(function(c){b.current.add(c);return function(){return b.current["delete"](c)}},[b]);return p.createElement(pa.gb,{value:a},d)}
function ra(a,d){a=A(a);for(var b;!(b=a()).done;)if(b=b.value.Va,!b(d))return!1;return!0}
function ta(a){var d=a.aa,b=a.qa,c=a.ra,f=p.h(null),g=p.h(null),e=p.h(new Set),h=p.Lb(pa),l=p.A(function(k){var n=k.target,m=f.current&&f.current.contains(n);n=g.current&&g.current.contains(n);k=ra(e.current,k);n&&k&&e.current.forEach(function(t){t=t.ja;return t()});return!m&&!n&&k},[f,g,e]);p.B(function(){if("function"===typeof h)return h({Va:l,ja:function(){c&&c()}})},[h,l,c,e]);p.B(function(){function k(m){l(m)&&b()}var n="function"===typeof h;if(d&&b&&!n)return document.addEventListener("click",
k,!0),function(){return document.removeEventListener("click",k,!0)}},[d,b,l,h]);p.B(function(){d||e.current.forEach(function(k){k=k.ja;return k()})},[d]);return{Ba:{c:f,b:g},fa:e}}
var ua="bottom-start bottom-end bottom-center top-start top-center top-end left-end left-center left-start right-end right-center right-start center".split(" "),va={top:"bottom",left:"right",bottom:"top",right:"left",s:"center"},wa=function(){function a(b,c,f,g,e,h,l,k,n){this.a=b;this.f=c;this.g=f;this.ta=g;this.da=e;this.sa=l;this.C=k;this.D=n}var d=a.prototype;d.I=function(b){return b*(this.D?1:-1)};d.Na=function(b){return this.g!==b.g};return a}();
function J(a,d){void 0===d&&(d=!0);var b=["left","right"].includes(a);return new wa(a,d?J(va[a],!1):null,b,b?"width":"height",b?"height":"width",b?"left":"top",b?"top":"left","center"===a,!["right","bottom"].includes(a))}
var P={top:J("top"),bottom:J("bottom"),left:J("left"),right:J("right")},Q=y({},P,{s:J("center")}),R=["top","left","bottom","right"],xa=function(){function a(d){return Object.assign(this,d)}a.na=function(d){var b=d[0],c=d.slice(1);if(!b)throw Error("Please provide at least 1 bounds objects in order to merge");d=Object.fromEntries(R.map(function(h){return[h,b[h]]}));c=A(c);for(var f;!(f=c()).done;){f=f.value;for(var g=A(R),e;!(e=g()).done;)e=e.value,d[e]=Math.min(d[e],f[e])}return new a(d)};w(a,[{key:"allSidesArePositive",
get:function(){var d=this;return R.every(function(b){return 0<=d[b]})}},{key:"negativeSides",get:function(){var d=this;return Object.fromEntries(R.filter(function(b){return 0>d[b]}).map(function(b){return[b,d[b]]}))}}]);return a}();function ya(){for(var a=arguments.length,d=Array(a),b=0;b<a;b++)d[b]=arguments[b];return d.reduce(function(c,f){return c+(f?G(f):0)},0)}function za(a){return{top:a.top,left:a.left,right:a.right,bottom:a.bottom,width:a.width,height:a.height}}
var Aa={top:0,left:0,right:0,bottom:0,width:0,height:0},S=function(){function a(b){void 0===b&&(b={});return Object.assign(this,Aa,b)}a.create=function(b){return new a(b)};a.fromElement=function(b,c){void 0===c&&(c={});var f=c.bb,g=void 0===f?!0:f;f=c.S;var e=void 0===f?window:f;c=c.ab;c=void 0===c?!0:c;f=za(b.getBoundingClientRect());f=new a(f);if(!g){var h=e.getComputedStyle(b),l=h.width;g=h.height;e=h.boxSizing;var k=h.borderLeft,n=h.borderRight,m=h.borderTop,t=h.borderBottom,q=h.paddingLeft,u=
h.paddingRight,z=h.paddingTop;h=h.paddingBottom;l="border-box"===e?G(l):ya(l,k,n,q,u);g="border-box"===e?G(g):ya(g,m,t,z,h);f=new a(y({},f,{width:l,height:g}))}return c?f:f.ua({right:f.width-b.clientWidth,bottom:f.height-b.clientHeight})};a.empty=function(){return new a};a.Ga=function(b){var c=b||{};b=c.innerWidth;b=void 0===b?0:b;c=c.innerHeight;c=void 0===c?0:c;return new a({width:b,height:c,right:b,bottom:c})};var d=a.prototype;d.ha=function(){return za(this)};d.L=function(b){var c=this.ha();return new a(y({},
c,"function"===typeof b?b(c):b))};d.ua=function(b){var c=this.ha(),f=0;for(b=Object.entries(b);f<b.length;f++){var g=b[f],e=g[0];g=g[1];if(e in P){var h=P[e];c[e]+=h.I(g);c[h.g?"width":"height"]-=g}else c[e]-=g||0}return new a(c)};d.Qa=function(b){return new xa({top:b.top-this.top,bottom:this.bottom-b.bottom,left:b.left-this.left,right:this.right-b.right})};d.Pa=function(b){for(var c=this.ha(),f=0,g=Object.values(P);f<g.length;f++){var e=g[f];c[e.a]=b(e,c[e.a])}return new a(c)};w(a,[{key:"surface",
get:function(){return this.width*this.height}}]);return a}(),Ba=function(){function a(b,c,f,g,e){this.i=b;this.O=c;this.ca=e;this.Z=this.$=null;this.Ua(f,g)}var d=a.prototype;d.Ua=function(b,c){c?(c="function"===typeof c?c(this.i.a):c,this.l=b.L({b:y({},b.b,c)})):this.l=b};d.U=function(b){void 0===b&&(b=0);if(this.$&&0===b)return this.$;var c=this.i,f=this.O,g=this.l,e=g.c,h=g.b,l=g.j,k=c.g,n=c.sa;g=c.da;var m=c.a,t=c.f,q=S.empty();q[t.a]=e[m]-c.I(this.ca.c);q[m]=q[t.a]-c.I(h[c.ta]);m=2*this.ca.j;
c=e[n]-(h[g]-l[g])+m;l=e[n]+(e[g]-l[g])-m;f.D||(c+=h[g],l+=h[g]);f.C?(f=(k?P.top:P.left).a,k=(k?P.bottom:P.right).a,e=e[f]+e[g]/2-h[g]/2+b,q[f]=e<c?c:e>l?l:e,q[k]=q[f]+h[g]):(e=e[f.a],e=e+b+(e<c?c-e:e>l?l-e:0),q[f.a]=e<c?c:e>l?l:e,q[f.f.a]=q[f.a]+f.I(h[g]));q.width=q.right-q.left;q.height=q.bottom-q.top;h=S.create(q);0===b&&(this.$=h);return h};d.Ia=function(){var b=this.ca.P;return this.U().Pa(function(c,f){return f-c.I(b)}).L(function(c){return{width:c.width+2*b,height:c.height+2*b}})};d.T=function(b){if(this.Z&&
!b)return this.Z;var c=this.l.L({b:b||this.Ia()});c=xa.na(c.sb);b||(this.Z=c);return c};w(a,[{key:"type",get:function(){return this.i.a+"-"+("center"===this.O.a?"center":["bottom","right"].includes(this.O.a)?"end":"start")}},{key:"triggerIsBigger",get:function(){var b=this.O.g,c=this.l,f=c.Xa;c=c.Wa;return b&&f||!b&&c}},{key:"fitsContainer",get:function(){return this.T().za}},{key:"visibleSurface",get:function(){var b=this.U(),c=this.T(b).oa,f;for(f in c)c[f]=-c[f];return b.ua(c).ga}},{key:"secondaryOffsetSide",
get:function(){var b,c,f=this,g=this.T();return(null!=(b=null==(c=Object.entries(g.oa).map(function(e){return[P[e[0]],e[1]]}).filter(function(e){return f.i.Na(e[0])}).sort(function(e,h){return h[1]-e[1]}))?void 0:c[0])?b:[])[0]||null}}]);return a}(),Ca=function(a){function d(){return a.apply(this,arguments)||this}ba(d,a);d.prototype.U=function(){var b=this.l,c=b.c;b=b.b;var f=S.empty();f.top=c.top+c.height/2-b.height/2;f.bottom=f.top+b.height;f.left=c.left+c.width/2-b.width/2;f.right=f.left+b.width;
f.width=f.right-f.left;f.height=f.bottom-f.top;return f};return d}(Ba),Da={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null},Ea=function(){function a(b,c,f){this.V=b;this.H=c;this.l=f}a.ma=function(b){var c=b.split("-");b=c[1];c=P[c[0]];return[c,"center"===b?Q.s:c.g?"start"===b?Q.top:Q.bottom:"start"===b?Q.left:Q.right]};a.create=function(b,c){function f(e){function h(t,q){return new Ba(t,q,b,c.ba,g)}void 0===e&&(e=c.u);var l=a.ma(e);e=l[0];l=l[1];var k=P[e.g?c.N:
c.M],n=!e.g&&b.Xa||e.g&&b.Wa,m=[];m[0]=h(e,l);m[1]=h(e,l.C?k:Q.s);m[2]=h(e,Q[(l.f.C?k.f:l.f).a]);m[3]=h(k,n?e:Q[e.f.a]);m[4]=h(k,Q.s);m[5]=h(k,n?Q[e.f.a]:e);m[6]=h(P[k.f.a],n?e:Q[e.f.a]);m[7]=h(P[k.f.a],Q.s);m[8]=h(P[k.f.a],n?Q[e.f.a]:e);m[9]=h(P[e.f.a],l);m[10]=h(P[e.f.a],l.C?k:Q.s);m[11]=h(P[e.f.a],Q[(l.f.C?k.f:l.f).a]);return m=m.filter(function(t){return t.type===c.u||c.W.includes(t.type)})}var g={j:c.F,P:c.R,c:c.Y};return"center"===c.u?new a([new Ca(Q.s,Q.s,b,c.ba,g)].concat(f(c.N+"-"+c.M)),
c,b):new a(f(),c,b)};var d=a.prototype;d.Da=function(b){return this.V.filter(function(c){return c.i===b})};d.Ea=function(){return this.V.find(function(b){return b.ka})};d.Sa=function(){return this.V.map(function(b){return{u:b,ga:b.Rb}}).sort(function(b,c){return c.ga-b.ga})[0].u};d.Fa=function(){return this.H.G?this.Ea()||this.Sa():this.V[0]};d.Ja=function(b){var c=this.H,f=c.X;if(!c.G||f||b instanceof Ca)return 0;c=this.Da(b.i);if(0===c.indexOf(b)&&b.ka)return 0;var g=c.find(function(h){return!h.ka});
if(!g)return 0;c=g.Gb;if(!c)return 0;f=b.T();var e=b.O;b=b.Jb||g===b?c.D?-1:1:e===Q.left||[Q.top,Q.s].includes(e)&&c.D?-1:1;return f[c.a]*b};d.Ka=function(b,c,f,g){var e={willChange:"top, left, width, height"};var h=this.l.L({b}),l=this.H.F,k;if(c.i.C)var n=Da;else{var m=h.b,t=h.c,q=h.j,u=c.i.da;n=l+q[u]/2;q=m[u]-q[u]/2-l;var z=h.b,L=h.c,K=h.j,H=c.i.da,D=c.i.g?["top","bottom"]:["left","right"];h=D[0];D=D[1];h=z[h]+z[H]/2-L[h]-K[H]/2-l;z=z[D]-z[H]/2-L[D]+K[H]/2+l;l=c.i.a;c=c.i.sa;m=t[u]>m[u]?m[u]/
2+((0>h?-h:0)+(0<z?-z:0)):t[c]+t[u]/2-m[c];n=y({},Da,(k={},k[l]="100%",k[c]=m<n?n:m>q?q:m,k))}b=this.H.o?y({},e,{position:"fixed",top:b.top,left:b.left}):y({},e,{position:"absolute",top:b.top-this.l.parent.top+f.top-g.top,left:b.left-this.l.parent.left+f.left-g.left});return{j:n,b}};d.Ha=function(b){var c=this.H.o?this.l.c:b;b=xa.na(this.l.pa(c,!0));return Object.entries(b.oa).some(function(f){return f[1]<=-c[P[f[0]].ta]})?"full":b.za?null:"partial"};d.result=function(b,c){var f=this.Fa(),g=this.Ja(f);
g=f.U(g);return{w:this.Ka(g,f,b,c),m:f.i.a,u:f,rb:g,La:this.Ha(g)}};return a}(),Fa=function(){function a(b,c){this.o=c;Object.assign(this,b)}a.create=function(b,c,f,g,e,h,l,k){var n=S.Ga(b);return new a({b:S.fromElement(c,{S:b,bb:!1}),c:k?S.create(za(k())):S.fromElement(f),j:e?S.fromElement(e):S.empty(),parent:g?S.fromElement(g):n,window:n,v:[n].concat(h.map(function(m){return S.fromElement(m,{ab:!1})}))},l)};var d=a.prototype;d.L=function(b){return new a(y({},this,b),this.o)};d.pa=function(b,c){void 0===
c&&(c=!1);return(this.o&&!c?[this.window]:this.v).map(function(f){return f.Qa(b)})};w(a,[{key:"layerOffsetsToScrollContainers",get:function(){return this.pa(this.b)}},{key:"triggerHasBiggerWidth",get:function(){return this.c.width>this.b.width}},{key:"triggerHasBiggerHeight",get:function(){return this.c.height>this.b.height}}]);return a}(),Ga=null,U={G:!1,F:0,R:10,Y:0,o:!0,u:"top-center",W:ua,M:"right",N:"bottom",X:!1,P:void 0,c:void 0};
function Ha(a,d){if(a.m!==d.m)return!0;for(var b=0,c=["position","top","left","right","bottom"];b<c.length;b++){var f=c[b];if(a.w.b[f]!==d.w.b[f]||a.w.j[f]!==d.w.j[f])return!0}return!1}
function Ia(a){if("function"===typeof a){var d=a();if(!(d&&d instanceof HTMLElement))throw Error("react-laag: You've passed a function to the 'container' prop, but it returned no valid HTMLElement");}else if(a instanceof HTMLElement)d=a;else if("string"===typeof a){if(d=document.getElementById(a),!d)throw Error("react-laag: You've passed element with id '"+a+"' to the 'container' prop, but it returned no valid HTMLElement");}else{if(Ga instanceof HTMLElement)return Ga;d=document.getElementById("layers");
d||(d=document.createElement("div"),d.id="layers",d.style.cssText="\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n ",document.body.appendChild(d))}return d}function V(a,d){return Math.tan(Math.PI/180*a)*d}function Ja(a,d,b,c){var f;return(f={},f.bottom="0 "+-c+" "+d+" "+a,f.top="0 0 "+d+" "+(a+c),f.right=-c+" 0 "+a+" "+d,f.left="0 0 "+(a+c)+" "+d,f)[b.a]}
function Ka(a,d,b,c,f){var g,e,h,l=c/10*a*2;c=(g={},g.bottom=[0,a],g.top=[0,0],g.right=[a,d],g.left=[0,d],g)[b.a].join(" ");g=b.g?"V 0":"H "+d;var k=d/2,n=d/2+V(f,a/8),m=a/8;n=(e={},e.bottom=["C",n,m,k+l,0,k,0],e.top=["C",n,a-m,k+l,a,k,a],e.right=["C",m,d-n,0,k-l,0,k],e.left=["C",a-m,d-n,a,k-l,a,k],e)[b.a].join(" ");f=d/2-V(f,a/8);e=a/8;a=(h={},h.bottom=["C",k-l,0,f,e,c],h.top=["C",k-l,a,f,a-e,c],h.right=["C",0,k+l,e,d-f,c],h.left=["C",a,k+l,a-e,d-f,c],h)[b.a].join(" ");return["M",c,g,n,a].join(" ")}
function La(a,d,b,c,f){f=V(f,b);var g=c.D?[0,b]:[a,a-b];a=g[0];g=g[1];return c.g?["M",a,b,"V",d-b,"L",g,d-b-f,"V",f+b,"Z"].join(" "):["M",b,a,"H",d-b,"L",d-b-f,g,"H",f+b,"Z"].join(" ")}
var Ma=p.nb(function(a,d){var b=a.size;b=void 0===b?8:b;var c=a.angle;c=void 0===c?45:c;var f=a.borderWidth;f=void 0===f?0:f;var g=a.borderColor;g=void 0===g?"black":g;var e=a.Fb;e=void 0===e?0:e;var h=a.backgroundColor;h=void 0===h?"white":h;var l=a.m,k=void 0===l?"top":l;l=a.style;l=void 0===l?{}:l;var n="size angle borderWidth borderColor roundness backgroundColor layerSide style".split(" ");if(null==a)a={};else{var m={},t=Object.keys(a),q;for(q=0;q<t.length;q++){var u=t[q];0<=n.indexOf(u)||(m[u]=
a[u])}a=m}if("center"===k)return null;k=P[k];n=2*V(c,b);m=Math.max(b,n);return p.createElement("svg",y({ea:d},a,{style:y({},l,{transform:"translate"+(k.g?"Y":"X")+"(-50%)"}),width:m,height:m,Cb:k.D?"xMinYMin":"xMaxYMax",Qb:Ja(b,n,k,f)}),p.createElement("path",{fill:h,strokeWidth:f,stroke:g,d:Ka(b,n,k,e,c)}),p.createElement("path",{fill:h,d:La(b,n,f,k,c)}))}),Y,Z=Y||(Y={});Z[Z.ENTERING=0]="ENTERING";Z[Z.LEAVING=1]="LEAVING";Z[Z.IDLE=2]="IDLE";exports.cb=Ma;exports.eb=U;exports.fb=ua;
exports.hb=function(a){var d=a.aa;a=a.children;var b=p.ia({K:d,J:!1}),c=b[0],f=b[1],g=p.h(!1);p.B(function(){d?f({K:!0,J:!1}):g.current&&f({K:!1,J:!0})},[d,f]);p.B(function(){g.current=!0},[]);return d||c.K||c.J?a(c.K,function(){c.K||f(function(e){return y({},e,{J:!1})})},c.J):null};exports.ub=ma;exports.Hb=function(a){Ga="function"===typeof a?a():"string"===typeof a?document.getElementById(a):a};
exports.Mb=function(a){function d(t,q){k.current===Y.va&&l.current&&m();e&&(q?(h(!1),l.current=null,k.current=Y.IDLE):(k.current=Y.wa,l.current=setTimeout(function(){h(!1);l.current=null;k.current=Y.IDLE},f)))}a=void 0===a?{}:a;var b=a.lb,c=void 0===b?0:b;b=a.mb;var f=void 0===b?0:b;a=a.qb;var g=void 0===a?!0:a;a=p.ia(!1);var e=a[0],h=a[1],l=p.h(null),k=p.h(Y.IDLE),n=p.h(!1),m=p.A(function(){clearTimeout(l.current);l.current=null;k.current=Y.IDLE},[]);p.B(function(){function t(){e&&g&&(m(),h(!1))}
function q(){e&&(m(),h(!1))}var u=l.current;window.addEventListener("scroll",t,!0);window.addEventListener("touchend",q,!0);return function(){window.removeEventListener("scroll",t,!0);window.removeEventListener("touchend",q,!0);u&&clearTimeout(u)}},[e,g,m]);return[e,{wb:function(){k.current===Y.wa&&l.current&&m();e||(k.current=Y.va,l.current=setTimeout(function(){h(!0);l.current=null;k.current=Y.IDLE},c))},xb:d,Ab:function(){n.current=!1},zb:function(){n.current=!0},yb:function(){n.current||e||h(!0);
n.current=!1}},function(){return d(null,!0)}]};
exports.Nb=function(a){var d,b=a.aa;b=void 0===b?!1:b;var c=a.o,f=void 0===c?U.o:c;c=a.S;var g=void 0===c?"undefined"!==typeof window?window:void 0:c;c=a.ResizeObserver;var e=a.u,h=void 0===e?U.u:e;e=a.W;var l=void 0===e?U.W:e;e=a.M;var k=void 0===e?U.M:e;e=a.N;var n=void 0===e?U.N:e;e=a.G;var m=void 0===e?U.G:e;e=a.X;var t=void 0===e?U.X:e;e=a.Y;var q=void 0===e?U.Y:e;e=a.R;var u=void 0===e?U.R:e;e=a.F;var z=void 0===e?U.F:e;e=a.P;var L=void 0===e?U.P:e;e=a.ba;var K=void 0===e?null:e,H=a.vb;e=a.qa;
var D=a.ra,r=a.c,v=p.ia(function(){return{m:"center"===h?"center":Ea.ma(h)[0].a,w:{b:{position:f?"fixed":"absolute",top:0,left:0},j:{position:"absolute",top:0,left:0}}}});a=v[0];var C=v[1];v=p.h(null);var x=ka(a,b),E=p.h(null);p.B(function(){return function(){E.current&&(cancelAnimationFrame(E.current),E.current=null)}},[]);var F=p.A(function(B,N,O){var sa=B.v;B=Fa.create(g,B.b,B.c,sa[0],B.j,sa,f,null==r?void 0:r.la);N=Ea.create(B,{u:h,W:l,G:m,ba:K,F:z,R:u,Y:q,M:k,N:n,X:t,o:f}).result(N,O);O=N.La;
var ha={m:N.m,w:N.w};if(!x.current||Ha(x.current,ha))x.current=ha,E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(function(){C(ha);E.current=null});null!==O&&void 0!==O&&null!==H&&void 0!==H&&H(O)},[z,m,u,g,K,H,f,h,l,k,n,t,q,x,r]),M=oa({xa:c,S:g,enabled:b,o:f,Ra:F,Ya:r});c=M.Za;F=M.Oa;var X=M.Aa,T=M.Ca;e=ta({aa:b,qa:e,ra:D});D=e.Ba;var W=e.fa;return{Kb:r?{}:{ea:ma(c,D.c,v)},tb:{ea:ma(F,D.b),style:a.w.b},ib:{ea:X,style:a.w.j,m:a.m},m:a.m,Ib:b?r?r.la():null==(d=v.current)?
void 0:d.getBoundingClientRect():null,Db:function(B){return"undefined"!==typeof document?aa.kb(p.createElement(qa,{fa:W,children:B}),f||!T?Ia(L):T):null}}};
exports.Pb=function(a){a=void 0===a?{}:a;var d=a.enabled,b=void 0===d?!0:d;a=a.preventDefault;var c=void 0===a?!0:a,f=p.h(null);a=p.ia(la);var g=a[0],e=a[1];return{pb:g!==la,Eb:function(){e(la)},ob:function(h){if(b){c&&h.preventDefault();var l=h.clientX;h=h.clientY;e({top:h,left:l,width:1,height:1,right:l+1,bottom:h+1})}},c:{la:function(){return g},getParent:f.current?function(){return f.current}:void 0},Bb:f}}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom");function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function u(t){var r=e.useRef(null);return function(e){e&&e!==r.current&&(r.current=e,t(e))}}require("tiny-warning");var a="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,c={top:0,left:0,right:1,bottom:1,width:1,height:1};function l(e){return parseFloat(e.replace("px",""))}function f(e,t,r){return e<t?t:e>r?r:e}function p(e){return null!=e}function d(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r,n=s(t);!(r=n()).done;){var o=r.value;o&&("function"==typeof o?o(e):o.current=e)}}}function h(e){return"react-laag: Could not find a valid reference for the "+e+" element. There might be 2 causes:\n - Make sure that the 'ref' is set correctly on the "+e+' element when isOpen: true. Also make sure your component forwards the ref with "forwardRef()".\n - Make sure that you are actually rendering the '+e+" when the isOpen prop is set to true"}var g=e.createContext({});function v(t){var r=t.children,n=t.registrations,o=e.useCallback((function(e){return n.current.add(e),function(){return n.current.delete(e)}}),[n]);return e.createElement(g.Provider,{value:o},r)}var m=["bottom-start","bottom-end","bottom-center","top-start","top-center","top-end","left-end","left-center","left-start","right-end","right-center","right-start","center"],y={top:"bottom",left:"right",bottom:"top",right:"left",center:"center"},b=function(){function e(e,t,r,n,o,i,s,u,a){this.prop=e,this.opposite=t,this.isHorizontal=r,this.sizeProp=n,this.oppositeSizeProp=o,this.cssProp=i,this.oppositeCssProp=s,this.isCenter=u,this.isPush=a}var t=e.prototype;return t.factor=function(e){return e*(this.isPush?1:-1)},t.isOppositeDirection=function(e){return this.isHorizontal!==e.isHorizontal},e}();function w(e,t){void 0===t&&(t=!0);var r=["left","right"].includes(e);return new b(e,t?w(y[e],!1):null,r,r?"width":"height",r?"height":"width",r?"left":"top",r?"top":"left","center"===e,!["right","bottom"].includes(e))}var C={top:w("top"),bottom:w("bottom"),left:w("left"),right:w("right")},O=o({},C,{center:w("center")}),S=["top","left","bottom","right"],E=function(){function e(e){return Object.assign(this,e)}return e.mergeSmallestSides=function(t){var r=t[0],n=t.slice(1);if(!r)throw new Error("Please provide at least 1 bounds objects in order to merge");for(var o,i=Object.fromEntries(S.map((function(e){return[e,r[e]]}))),u=s(n);!(o=u()).done;)for(var a,c=o.value,l=s(S);!(a=l()).done;){var f=a.value;i[f]=Math.min(i[f],c[f])}return new e(i)},n(e,[{key:"allSidesArePositive",get:function(){var e=this;return S.every((function(t){return e[t]>=0}))}},{key:"negativeSides",get:function(){var e=this;return Object.fromEntries(S.filter((function(t){return e[t]<0})).map((function(t){return[t,e[t]]})))}}]),e}();function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce((function(e,t){return e+(t?l(t):0)}),0)}function L(e){return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}var B={top:0,left:0,right:0,bottom:0,width:0,height:0},j=function(){function e(e){return void 0===e&&(e={}),Object.assign(this,B,e)}e.create=function(t){return new e(t)},e.fromElement=function(t,r){void 0===r&&(r={});var n=r.withTransform,i=void 0===n||n,s=r.environment,u=void 0===s?window:s,a=r.withScrollbars,c=void 0===a||a,f=new e(L(t.getBoundingClientRect()));if(!i){var p=u.getComputedStyle(t),d=p.width,h=p.height,g=p.boxSizing,v=p.borderLeft,m=p.borderRight,y=p.borderTop,b=p.borderBottom,w=p.paddingLeft,C=p.paddingRight,O=p.paddingTop,S=p.paddingBottom;f=new e(o({},f,{width:"border-box"===g?l(d):P(d,v,m,w,C),height:"border-box"===g?l(h):P(h,y,b,O,S)}))}return c?f:f.substract({right:f.width-t.clientWidth,bottom:f.height-t.clientHeight})},e.empty=function(){return new e},e.fromWindow=function(t){var r=t||{},n=r.innerWidth,o=void 0===n?0:n,i=r.innerHeight,s=void 0===i?0:i;return new e({width:o,height:s,right:o,bottom:s})};var t=e.prototype;return t.toObject=function(){return L(this)},t.merge=function(t){var r=this.toObject();return new e(o({},r,"function"==typeof t?t(r):t))},t.substract=function(t){for(var r=this.toObject(),n=0,o=Object.entries(t);n<o.length;n++){var i=o[n],s=i[0],u=i[1];if(s in C){var a=C[s];r[s]+=a.factor(u),r[a.isHorizontal?"width":"height"]-=u}else r[s]-=u||0}return new e(r)},t.offsetsTo=function(e){return new E({top:e.top-this.top,bottom:this.bottom-e.bottom,left:e.left-this.left,right:this.right-e.right})},t.mapSides=function(t){for(var r=this.toObject(),n=0,o=Object.values(C);n<o.length;n++){var i=o[n];r[i.prop]=t(i,r[i.prop])}return new e(r)},n(e,[{key:"surface",get:function(){return this.width*this.height}}]),e}(),T=function(){function e(e,t,r,n,o){this.primary=e,this.secondary=t,this.offsets=o,this._cachedLayerBounds=null,this._cachedContainerOffsets=null,this.setSubjectsBounds(r,n)}var t=e.prototype;return t.setSubjectsBounds=function(e,t){if(t){var r="function"==typeof t?t(this.primary.prop):t;this.subjectsBounds=e.merge({layer:o({},e.layer,r)})}else this.subjectsBounds=e},t.getLayerBounds=function(e){if(void 0===e&&(e=0),this._cachedLayerBounds&&0===e)return this._cachedLayerBounds;var t=this.primary,r=this.secondary,n=this.subjectsBounds,o=n.trigger,i=n.layer,s=n.arrow,u=t.isHorizontal,a=t.oppositeCssProp,c=t.oppositeSizeProp,l=t.prop,p=t.opposite,d=j.empty();d[p.prop]=o[l]-t.factor(this.offsets.trigger),d[l]=d[p.prop]-t.factor(i[t.sizeProp]);var h=2*this.offsets.arrow,g=o[a]-(i[c]-s[c])+h,v=o[a]+(o[c]-s[c])-h;if(r.isPush||(g+=i[c],v+=i[c]),r.isCenter){var m=(u?C.top:C.left).prop,y=(u?C.bottom:C.right).prop;d[m]=f(o[m]+o[c]/2-i[c]/2+e,g,v),d[y]=d[m]+i[c]}else{var b=r,w=o[b.prop];d[b.prop]=f(w+e+(w<g?g-w:w>v?v-w:0),g,v),d[b.opposite.prop]=d[b.prop]+r.factor(i[c])}d.width=d.right-d.left,d.height=d.bottom-d.top;var O=j.create(d);return 0===e&&(this._cachedLayerBounds=O),O},t.getLayerCollisionBounds=function(){var e=this.offsets.container;return this.getLayerBounds().mapSides((function(t,r){return r-t.factor(e)})).merge((function(t){return{width:t.width+2*e,height:t.height+2*e}}))},t.getContainerOffsets=function(e){if(this._cachedContainerOffsets&&!e)return this._cachedContainerOffsets;var t=this.subjectsBounds.merge({layer:e||this.getLayerCollisionBounds()}),r=E.mergeSmallestSides(t.layerOffsetsToScrollContainers);return e||(this._cachedContainerOffsets=r),r},n(e,[{key:"type",get:function(){return this.primary.prop+"-"+("center"===this.secondary.prop?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var e=this.secondary.isHorizontal,t=this.subjectsBounds;return e&&t.triggerHasBiggerWidth||!e&&t.triggerHasBiggerHeight}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var e=this.getLayerBounds(),t=this.getContainerOffsets(e).negativeSides;for(var r in t)t[r]=-t[r];return e.substract(t).surface}},{key:"secondaryOffsetSide",get:function(){var e,t,r=this,n=this.getContainerOffsets();return(null!=(e=null==(t=Object.entries(n.negativeSides).map((function(e){return[C[e[0]],e[1]]})).filter((function(e){return r.primary.isOppositeDirection(e[0])})).sort((function(e,t){return t[1]-e[1]})))?void 0:t[0])?e:[])[0]||null}}]),e}(),k=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype.getLayerBounds=function(){var e=this.subjectsBounds,t=e.trigger,r=e.layer,n=j.empty();return n.top=t.top+t.height/2-r.height/2,n.bottom=n.top+r.height,n.left=t.left+t.width/2-r.width/2,n.right=n.left+r.width,n.width=n.right-n.left,n.height=n.bottom-n.top,n},n}(T),R={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null},H=function(){function e(e,t,r){this.placements=e,this.config=t,this.subjectsBounds=r}e.getSidesFromPlacementType=function(e){var t=e.split("-"),r=t[1],n=C[t[0]];return[n,"center"===r?O.center:n.isHorizontal?"start"===r?O.top:O.bottom:"start"===r?O.left:O.right]},e.create=function(t,r){var n={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function o(o){void 0===o&&(o=r.placement);var i=e.getSidesFromPlacementType(o),s=i[0],u=i[1],a=C[s.isHorizontal?r.preferY:r.preferX],c=!s.isHorizontal&&t.triggerHasBiggerWidth||s.isHorizontal&&t.triggerHasBiggerHeight;function l(e,o){return new T(e,o,t,r.layerDimensions,n)}var f=[];return f[0]=l(s,u),f[1]=l(s,u.isCenter?a:O.center),f[2]=l(s,O[(u.opposite.isCenter?a.opposite:u.opposite).prop]),f[3]=l(a,c?s:O[s.opposite.prop]),f[4]=l(a,O.center),f[5]=l(a,c?O[s.opposite.prop]:s),f[6]=l(C[a.opposite.prop],c?s:O[s.opposite.prop]),f[7]=l(C[a.opposite.prop],O.center),f[8]=l(C[a.opposite.prop],c?O[s.opposite.prop]:s),f[9]=l(C[s.opposite.prop],u),f[10]=l(C[s.opposite.prop],u.isCenter?a:O.center),f[11]=l(C[s.opposite.prop],O[(u.opposite.isCenter?a.opposite:u.opposite).prop]),f.filter((function(e){return e.type===r.placement||r.possiblePlacements.includes(e.type)}))}return new e("center"===r.placement?[new k(O.center,O.center,t,r.layerDimensions,n)].concat(o(r.preferY+"-"+r.preferX)):o(),r,t)};var t=e.prototype;return t.filterPlacementsBySide=function(e){return this.placements.filter((function(t){return t.primary===e}))},t.findFirstPlacementThatFits=function(){return this.placements.find((function(e){return e.fitsContainer}))},t.placementWithBiggestVisibleSurface=function(){return this.placements.map((function(e){return{placement:e,surface:e.visibleSurface}})).sort((function(e,t){return t.surface-e.surface}))[0].placement},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(e){var t=this.config;if(!t.auto||t.snap||e instanceof k)return 0;var r=this.filterPlacementsBySide(e.primary);if(0===r.indexOf(e)&&e.fitsContainer)return 0;var n=r.find((function(e){return!e.fitsContainer}));if(!n)return 0;var o=n.secondaryOffsetSide;if(!o)return 0;var i,s=e.getContainerOffsets(),u=e.secondary;return i=e.triggerIsBigger||n===e?o.isPush?-1:1:u===O.left||[O.top,O.center].includes(u)&&o.isPush?-1:1,s[o.prop]*i},t.getStyles=function(e,t,r,n){return{arrow:function(e,t,r){var n;if(t.primary.isCenter)return R;var i=e.layer,s=e.trigger,u=e.arrow,a=t.primary.oppositeSizeProp,c=s[a]>i[a],l=r+u[a]/2,p=i[a]-u[a]/2-r,d=function(e,t,r){var n=e.layer,o=e.trigger,i=e.arrow,s=t.primary.oppositeSizeProp,u=t.primary.isHorizontal?["top","bottom"]:["left","right"],a=u[0],c=u[1],l=n[a]+n[s]/2-o[a]-i[s]/2-r,f=n[c]-n[s]/2-o[c]+i[s]/2+r;return(l<0?-l:0)+(f>0?-f:0)}(e,t,r),h=t.primary.oppositeCssProp,g=c?i[a]/2+d:s[h]+s[a]/2-i[h];return o({},R,((n={})[t.primary.prop]="100%",n[h]=f(g,l,p),n))}(this.subjectsBounds.merge({layer:e}),t,this.config.arrowOffset),layer:o({},{willChange:"top, left, width, height"},this.config.overflowContainer?{position:"fixed",top:e.top,left:e.left}:{position:"absolute",top:e.top-this.subjectsBounds.parent.top+r.top-n.top,left:e.left-this.subjectsBounds.parent.left+r.left-n.left})}},t.getHasDisappeared=function(e){var t=this.config.overflowContainer?this.subjectsBounds.trigger:e,r=E.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(t,!0));return Object.entries(r.negativeSides).some((function(e){return e[1]<=-t[C[e[0]].sizeProp]}))?"full":r.allSidesArePositive?null:"partial"},t.result=function(e,t){var r=this.findSuitablePlacement(),n=this.getSecondaryOffset(r),o=r.getLayerBounds(n);return{styles:this.getStyles(o,r,e,t),layerSide:r.primary.prop,placement:r,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),x=function(){function e(e,t){this.overflowContainer=t,Object.assign(this,e)}e.create=function(t,r,n,o,i,s,u,a){var c=j.fromWindow(t);return new e({layer:j.fromElement(r,{environment:t,withTransform:!1}),trigger:a?j.create(L(a())):j.fromElement(n),arrow:i?j.fromElement(i):j.empty(),parent:o?j.fromElement(o):c,window:c,scrollContainers:[c].concat(s.map((function(e){return j.fromElement(e,{withScrollbars:!1})})))},u)};var t=e.prototype;return t.merge=function(t){return new e(o({},this,t),this.overflowContainer)},t.offsetsToScrollContainers=function(e,t){return void 0===t&&(t=!1),(this.overflowContainer&&!t?[this.window]:this.scrollContainers).map((function(t){return t.offsetsTo(e)}))},n(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),I=null,M={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:m,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function z(e,t){return Math.tan(e*(Math.PI/180))*t}function A(e,t,r,n){var o;return((o={}).bottom="0 "+-n+" "+t+" "+e,o.top="0 0 "+t+" "+(e+n),o.right=-n+" 0 "+e+" "+t,o.left="0 0 "+(e+n)+" "+t,o)[r.prop]}function D(e,t,r,n,o){var i,s,u,a=n/10*e*2,c=(i={},i.bottom=[0,e],i.top=[0,0],i.right=[e,t],i.left=[0,t],i)[r.prop].join(" "),l=r.isHorizontal?"V 0":"H "+t,f=t/2,p=t/2+z(o,e/8),d=e/8,h=(s={},s.bottom=["C",p,d,f+a,0,f,0],s.top=["C",p,e-d,f+a,e,f,e],s.right=["C",d,t-p,0,f-a,0,f],s.left=["C",e-d,t-p,e,f-a,e,f],s)[r.prop].join(" "),g=t/2-z(o,e/8),v=e/8;return["M",c,l,h,(u={},u.bottom=["C",f-a,0,g,v,c],u.top=["C",f-a,e,g,e-v,c],u.right=["C",0,f+a,v,t-g,c],u.left=["C",e,f+a,e-v,t-g,c],u)[r.prop].join(" ")].join(" ")}function W(e,t,r,n,o){var i=z(o,r),s=n.isPush?[0,r]:[e,e-r],u=s[0],a=s[1];return n.isHorizontal?["M",u,r,"V",t-r,"L",a,t-r-i,"V",i+r,"Z"].join(" "):["M",r,u,"H",t-r,"L",t-r-i,a,"H",i+r,"Z"].join(" ")}var _,Y=e.forwardRef((function(t,r){var n=t.size,i=void 0===n?8:n,s=t.angle,u=void 0===s?45:s,a=t.borderWidth,c=void 0===a?0:a,l=t.borderColor,f=void 0===l?"black":l,p=t.roundness,d=void 0===p?0:p,h=t.backgroundColor,g=void 0===h?"white":h,v=t.layerSide,m=void 0===v?"top":v,y=t.style,b=void 0===y?{}:y,w=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(o[r]=e[r]);return o}(t,["size","angle","borderWidth","borderColor","roundness","backgroundColor","layerSide","style"]);if("center"===m)return null;var O=C[m],S=i,E=2*z(u,i),P=Math.max(S,E);return e.createElement("svg",o({ref:r},w,{style:o({},b,{transform:"translate"+(O.isHorizontal?"Y":"X")+"(-50%)"}),width:P,height:P,preserveAspectRatio:O.isPush?"xMinYMin":"xMaxYMax",viewBox:A(S,E,O,c)}),e.createElement("path",{fill:g,strokeWidth:c,stroke:f,d:D(S,E,O,d,u)}),e.createElement("path",{fill:g,d:W(S,E,c,O,u)}))}));!function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"}(_||(_={})),exports.Arrow=Y,exports.DEFAULT_OPTIONS=M,exports.PLACEMENT_TYPES=m,exports.Transition=function(t){var r=t.isOpen,n=t.children,i=e.useState({isOpenInternal:r,isLeaving:!1}),s=i[0],u=i[1],a=e.useRef(!1);return e.useEffect((function(){r?u({isOpenInternal:!0,isLeaving:!1}):a.current&&u({isOpenInternal:!1,isLeaving:!0})}),[r,u]),e.useEffect((function(){a.current=!0}),[]),r||s.isOpenInternal||s.isLeaving?n(s.isOpenInternal,(function(){s.isOpenInternal||u((function(e){return o({},e,{isLeaving:!1})}))}),s.isLeaving):null},exports.mergeRefs=d,exports.setGlobalContainer=function(e){"undefined"!=typeof document&&(I="function"==typeof e?e():"string"==typeof e?document.getElementById(e):e)},exports.useHover=function(t){var r=void 0===t?{}:t,n=r.delayEnter,o=void 0===n?0:n,i=r.delayLeave,s=void 0===i?0:i,u=r.hideOnScroll,a=void 0===u||u,c=e.useState(!1),l=c[0],f=c[1],p=e.useRef(null),d=e.useRef(_.IDLE),h=e.useRef(!1),g=e.useCallback((function(){clearTimeout(p.current),p.current=null,d.current=_.IDLE}),[]);function v(e,t){if(d.current===_.ENTERING&&p.current&&g(),l){if(t)return f(!1),p.current=null,void(d.current=_.IDLE);d.current=_.LEAVING,p.current=setTimeout((function(){f(!1),p.current=null,d.current=_.IDLE}),s)}}return e.useEffect((function(){var e=p.current;function t(){l&&a&&(g(),f(!1))}function r(){l&&(g(),f(!1))}return window.addEventListener("scroll",t,!0),window.addEventListener("touchend",r,!0),function(){window.removeEventListener("scroll",t,!0),window.removeEventListener("touchend",r,!0),e&&clearTimeout(e)}}),[l,a,g]),[l,{onMouseEnter:function(){d.current===_.LEAVING&&p.current&&g(),l||(d.current=_.ENTERING,p.current=setTimeout((function(){f(!0),p.current=null,d.current=_.IDLE}),o))},onMouseLeave:v,onTouchStart:function(){h.current=!1},onTouchMove:function(){h.current=!0},onTouchEnd:function(){h.current||l||f(!0),h.current=!1}},function(){return v(0,!0)}]},exports.useLayer=function(r){var n,i=r.isOpen,c=void 0!==i&&i,f=r.overflowContainer,m=void 0===f?M.overflowContainer:f,y=r.environment,b=void 0===y?"undefined"!=typeof window?window:void 0:y,w=r.ResizeObserver,C=r.placement,O=void 0===C?M.placement:C,S=r.possiblePlacements,E=void 0===S?M.possiblePlacements:S,P=r.preferX,L=void 0===P?M.preferX:P,B=r.preferY,j=void 0===B?M.preferY:B,T=r.auto,k=void 0===T?M.auto:T,R=r.snap,z=void 0===R?M.snap:R,A=r.triggerOffset,D=void 0===A?M.triggerOffset:A,W=r.containerOffset,_=void 0===W?M.containerOffset:W,Y=r.arrowOffset,N=void 0===Y?M.arrowOffset:Y,F=r.container,X=void 0===F?M.container:F,G=r.layerDimensions,V=void 0===G?null:G,q=r.onDisappear,U=r.onOutsideClick,Z=r.onParentClose,$=r.trigger,J=e.useState((function(){return{layerSide:"center"===O?"center":H.getSidesFromPlacementType(O)[0].prop,styles:{layer:{position:m?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}})),K=J[0],Q=J[1],ee=e.useRef(null),te=function(t,r){var n=e.useRef(t);return r?(n.current=t,n):(n.current=null,n)}(K,c),re=e.useRef(null);e.useEffect((function(){return function(){re.current&&(cancelAnimationFrame(re.current),re.current=null)}}),[]);var ne=e.useCallback((function(e,t,r){var n=e.scrollContainers,o=x.create(b,e.layer,e.trigger,n[0],e.arrow,n,m,null==$?void 0:$.getBounds),i=H.create(o,{placement:O,possiblePlacements:E,auto:k,layerDimensions:V,arrowOffset:N,containerOffset:_,triggerOffset:D,preferX:L,preferY:j,snap:z,overflowContainer:m}).result(t,r),s=i.hasDisappeared,u={layerSide:i.layerSide,styles:i.styles};te.current&&!function(e,t){if(e.layerSide!==t.layerSide)return!0;for(var r=0,n=["position","top","left","right","bottom"];r<n.length;r++){var o=n[r];if(e.styles.layer[o]!==t.styles.layer[o]||e.styles.arrow[o]!==t.styles.arrow[o])return!0}return!1}(te.current,u)||(te.current=u,re.current&&cancelAnimationFrame(re.current),re.current=requestAnimationFrame((function(){Q(u),re.current=null}))),p(s)&&p(q)&&q(s)}),[N,k,_,b,V,q,m,O,E,L,j,z,D,te,$]),oe=function(t){var r=t.enabled,n=t.onChange,i=t.environment,c=t.overflowContainer,f=t.triggerOption,p=function(e,t){if(void 0!==e)return t||e.ResizeObserver}(i,t.ResizeObserverPolyfill);e.useEffect((function(){}),[p]);var d,g,v=e.useRef(null),m=Boolean(f),y=(d=e.useRef({scrollContainers:[],trigger:null,layer:null}),e.useMemo((function(){return[function(){return d.current},function(e){d.current="function"==typeof e?e(d.current):e}]}),[])),b=y[0],w=y[1],C=(g=e.useRef([]),e.useMemo((function(){return{hasEventSubscriptions:function(){return g.current.length>0},removeAllEventSubscriptions:function(){for(var e,t=s(g.current);!(e=t()).done;)(0,e.value)();g.current=[]},addEventSubscription:function(e){g.current.push(e)}}}),[])),O=C.hasEventSubscriptions,S=C.addEventSubscription,E=C.removeAllEventSubscriptions,P=e.useCallback((function(){var e,t=b(),r=t.layer,o=t.trigger,s=t.scrollContainers,u=s[0];if(!r)throw new Error(h("layer"));if(!o&&!m)throw new Error(h("trigger"));e=u?{top:u.scrollTop,left:u.scrollLeft}:{top:i.scrollY,left:i.scrollX};var a={left:0,top:0};if(u){var c=i.getComputedStyle(u),f=c.borderTopWidth;a={left:l(c.borderLeftWidth)||0,top:l(f)||0}}n({layer:r,trigger:o,scrollContainers:s,arrow:v.current},e,a)}),[b,n,i,v,m]),L=e.useCallback((function(){var e=b(),t=e.trigger,r=e.layer,n=e.scrollContainers;if(!r)throw new Error(h("layer"));if(!t&&!m)throw new Error(h("trigger"));if(p){for(var o=!1,u=new p((function(){o?P():o=!0})),a=0,c=[t,r,document.body];a<c.length;a++){var l=c[a];l&&u.observe(l)}S((function(){for(var e=0,n=[t,r,document.body];e<n.length;e++){var o=n[e];o&&u.unobserve(o)}u.disconnect()}))}for(var f,d=function(){var e=f.value;e.addEventListener("scroll",P),S((function(){return e.removeEventListener("scroll",P)}))},g=s([i].concat(n));!(f=g()).done;)d()}),[b,S,P,i,p,m]),B=e.useCallback((function(e,t){r&&e&&e!==t&&(E(),L(),P())}),[E,L,P,r]),j=u(e.useCallback((function(e){var t=b().layer;w((function(t){return o({},t,{layer:e})})),B(t,e)}),[b,w,B])),T=e.useCallback((function(e){var t=function e(t,r){var n=[];if(!t||!r||t===document.body)return n;var o=r.getComputedStyle(t);return[o.overflow,o.overflowX,o.overflowY].some((function(e){return["auto","scroll"].includes(e)}))&&n.push(t),[].concat(n,e(t.parentElement,r))}(e,i),r=t[0];if(r){var n=i.getComputedStyle(r).position;["relative","absolute","fixed"].includes(n)||c||(r.style.position="relative")}return t}),[i,c]),k=u(e.useCallback((function(e){var t=T(e),r=b().trigger;w((function(r){return o({},r,{trigger:e,scrollContainers:t})})),B(r,e)}),[b,w,B,T])),R=null==f||null==f.getParent?void 0:f.getParent();return a((function(){R&&w((function(e){return o({},e,{scrollContainers:T(R)})}))}),[R,w,T]),a((function(){return r&&(O()||L()),function(){O()&&E()}}),[r,O,L,E]),a((function(){r&&P()})),{triggerRef:k,layerRef:j,arrowRef:v,closestScrollContainer:b().scrollContainers[0]||null}}({ResizeObserverPolyfill:w,environment:b,enabled:c,overflowContainer:m,onChange:ne,triggerOption:$}),ie=oe.triggerRef,se=oe.layerRef,ue=oe.arrowRef,ae=oe.closestScrollContainer,ce=function(t){var r=t.isOpen,n=t.onOutsideClick,o=t.onParentClose,i=e.useRef(null),u=e.useRef(null),a=e.useRef(new Set),c=e.useContext(g),l=e.useCallback((function(e){var t=e.target,r=i.current&&i.current.contains(t),n=u.current&&u.current.contains(t),o=function(e,t){for(var r,n=s(e);!(r=n()).done;)if(!(0,r.value.shouldCloseWhenClickedOutside)(t))return!1;return!0}(a.current,e);return n&&o&&a.current.forEach((function(e){return(0,e.closeChild)()})),!r&&!n&&o}),[i,u,a]);return e.useEffect((function(){if("function"==typeof c)return c({shouldCloseWhenClickedOutside:l,closeChild:function(){o&&o()}})}),[c,l,o,a]),e.useEffect((function(){if(r&&n&&"function"!=typeof c)return document.addEventListener("click",e,!0),function(){return document.removeEventListener("click",e,!0)};function e(e){l(e)&&n()}}),[r,n,l,c]),e.useEffect((function(){r||a.current.forEach((function(e){return(0,e.closeChild)()}))}),[r]),{closeOnOutsideClickRefs:{trigger:i,layer:u},registrations:a}}({isOpen:c,onOutsideClick:U,onParentClose:Z}),le=ce.closeOnOutsideClickRefs,fe=ce.registrations;return{triggerProps:Boolean($)?{}:{ref:d(ie,le.trigger,ee)},layerProps:{ref:d(se,le.layer),style:K.styles.layer},arrowProps:{ref:ue,style:K.styles.arrow,layerSide:K.layerSide},layerSide:K.layerSide,triggerBounds:c?$?$.getBounds():null==(n=ee.current)?void 0:n.getBoundingClientRect():null,renderLayer:function(r){return"undefined"!=typeof document?t.createPortal(e.createElement(v,{registrations:fe,children:r}),m||!ae?function(e){var t;if("function"==typeof e){if(!((t=e())&&t instanceof HTMLElement))throw new Error("react-laag: You've passed a function to the 'container' prop, but it returned no valid HTMLElement")}else if(e instanceof HTMLElement)t=e;else if("string"==typeof e){if(!(t=document.getElementById(e)))throw new Error("react-laag: You've passed element with id '"+e+"' to the 'container' prop, but it returned no valid HTMLElement")}else{if(I instanceof HTMLElement)return I;(t=document.getElementById("layers"))||((t=document.createElement("div")).id="layers",t.style.cssText="\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n ",document.body.appendChild(t))}return t}(X):ae):null}}},exports.useMousePositionAsTrigger=function(t){var r=void 0===t?{}:t,n=r.enabled,o=void 0===n||n,i=r.preventDefault,s=void 0===i||i,u=e.useRef(null),a=e.useState(c),l=a[0],f=a[1];return{hasMousePosition:l!==c,resetMousePosition:function(){f(c)},handleMouseEvent:function(e){if(o){s&&e.preventDefault();var t=e.clientX,r=e.clientY;f({top:r,left:t,width:1,height:1,right:t+1,bottom:r+1})}},trigger:{getBounds:function(){return l},getParent:u.current?function(){return u.current}:void 0},parentRef:u}};
//# sourceMappingURL=react-laag.cjs.production.min.js.map

3

package.json
{
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",

@@ -33,3 +33,2 @@ "name": "react-laag",

"devDependencies": {
"@ampproject/rollup-plugin-closure-compiler": "^0.26.0",
"@size-limit/preset-small-lib": "^4.9.0",

@@ -36,0 +35,0 @@ "@snowpack/web-test-runner-plugin": "^0.1.5",

@@ -36,3 +36,3 @@ <p align="center">

- 📦 Only 7kb minified & gzipped / tree-shakable / no dependencies
- 📦 Only 8kb minified & gzipped / tree-shakable / no dependencies
- 🛠 We do the positioning, you do the rest. You maintain full control over the look and feel.

@@ -39,0 +39,0 @@ - 🚀 Optimized for performance / no scroll lag whatsoever

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc