react-md
Version:
This is the full react-md library bundled together for convenience.
7 lines • 668 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self).ReactMD={},e.React,e.ReactDOM)}(this,(function(e,t,r){"use strict";var n="default"in t?t.default:t,o="default"in r?r.default:r;function a(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var i=a((function(e){
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){var t={}.hasOwnProperty;function r(){for(var e=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)&&o.length){var i=r.apply(null,o);i&&e.push(i)}else if("object"===a)for(var c in o)t.call(o,c)&&o[c]&&e.push(c)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r}()}));function c(e){var n=e.into,o=e.intoId,a=e.children,i=t.useState(null),c=i[0],l=i[1];return t.useEffect((function(){var e=function(e,t){if("undefined"==typeof document)return null;var r=null;return void 0===e&&void 0===t?r=document.body:"string"==typeof t?r=document.getElementById(t):"string"==typeof e?r=document.querySelector(e):"function"==typeof e?r=e():e&&(r=e),r}(n,o);c!==e&&l(e)}),[n,o,c]),c?r.createPortal(a,c):null}try{var l=require("prop-types");c.propTypes={into:l.oneOfType([l.string,l.func,l.object]),intoId:l.string,children:l.node}}catch(e){}function s(e){var t=e.portal,r=e.portalInto,o=e.portalIntoId,a=e.children;return t||r||o?n.createElement(c,{into:r,intoId:o},a):a}try{var f=require("prop-types");s.propTypes={portal:f.bool,portalInto:f.oneOfType([f.string,f.func,f.object]),portalIntoId:f.string,children:f.node}}catch(e){}var u=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function d(e){if(!u.test(e)&&!p.test(e))throw new TypeError("Invalid color string.");var t=(e=e.replace(u,(function(e,t,r,n){return""+t+t+r+r+n+n}))).match(p)||[];return[parseInt(t[1]||"",16)||0,parseInt(t[2]||"",16)||0,parseInt(t[3]||"",16)||0]}function y(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function h(e){var t=d(e),r=t[0],n=t[1],o=t[2];return.2126*y(r)+.7152*y(n)+.0722*y(o)}function b(e,t){var r=h(e)+.05,n=h(t)+.05;return Math.max(r,n)/Math.min(r,n)}var v=function(){},m=!1;function g(){if("undefined"==typeof window)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return window.addEventListener("testSupportsPassive",v,t),window.removeEventListener("testSupportsPassive",v,t),m=e,e}g();var O=Object.freeze({__proto__:null,update:g,get isSupported(){return m}}),w=[];function j(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r=!1);var o=[],a=function(e,t){var r=!1,n=function(e){return function(){for(var n=0;n<t.length;n+=1)t[n](e);r=!1}};return function(t){e?r||(r=!0,window.requestAnimationFrame(n(t))):n(t)()}}(r,o);return{add:function(r){o.length||t.addEventListener(e,a,n),-1===o.indexOf(r)&&o.push(r)},remove:function(r){var i=o.indexOf(r);i>=0&&(o.splice(i,1),o.length||t.removeEventListener(e,a,n))}}}function E(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r="resize"===e||"scroll"===e);var o=w.findIndex((function(o){return o.type===e&&o.target===t&&o.options===n&&o.throttle===r}));return-1===o&&(w.push({type:e,target:t,options:n,throttle:r,handler:j(e,t,r,n)}),o=w.length-1),w[o].handler}var P=function(){return(P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function I(e,t,r,n,o,a){void 0===o&&(o=!1),t[(e?"add":"remove")+"EventListener"]("touch"+r,n,m?P({passive:!0,capture:o},a):o)}function R(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e})),r}function x(e){var r=e.enabled,n=void 0===r||r,o=e.onScroll,a=e.element,i=e.options,c=void 0===i?!!m&&{passive:!0}:i,l=R(o);t.useEffect((function(){if(n){var e=E("scroll",a||window,!0,c),t=function(e){return l.current(e)};return e.add(t),function(){e.remove(t)}}}),[n,a,c])}function F(e){var r=t.useState(e),n=r[0],o=r[1],a=R(n);return[n,t.useCallback((function(){a.current||o(!0)}),[]),t.useCallback((function(){a.current&&o(!1)}),[]),t.useCallback((function(){o((function(e){return!e}))}),[]),o]}function C(){var e=function(e){void 0===e&&(e=1200);var r=t.useState(0),n=r[0],o=r[1],a=R(n),i=t.useRef(!1),c=t.useCallback((function(){o(Date.now()),i.current=!1}),[]),l=t.useCallback((function(){var t=a.current;i.current||Date.now()-t<e?i.current=!1:o(0)}),[e]);return t.useEffect((function(){return window.addEventListener("touchstart",c,!0),function(){window.removeEventListener("touchstart",c,!0)}}),[c]),t.useEffect((function(){if(0!==n){var e=function(){i.current=!0};return window.addEventListener("mousemove",l,!0),window.addEventListener("contextmenu",e,!0),function(){window.removeEventListener("mousemove",l,!0),window.removeEventListener("contextmenu",e,!0)}}i.current=!1}),[n,l]),0!==n}(),r=function(){var e=F(!1),r=e[0],n=e[1],o=e[2];return t.useEffect((function(){if(!r)return window.addEventListener("keydown",n,!0),function(){window.removeEventListener("keydown",n,!0)}}),[r,n]),t.useEffect((function(){if(r)return window.addEventListener("mousedown",o,!0),window.addEventListener("touchstart",o,!0),function(){window.removeEventListener("mousedown",o,!0),window.removeEventListener("touchstart",o,!0)}}),[r,o]),r}();return e?"touch":r?"keyboard":"mouse"}var _=t.createContext("mouse"),T=t.createContext(!1);function N(){return t.useContext(_)}function S(e){return N()===e}function A(e){var r=e.children;if(t.useContext(T))throw new Error("Nested `InteractionModeListener` components");var o=C();return function(e){t.useEffect((function(){var t="rmd-utils--"+e;return document.body.classList.add(t),function(){document.body.classList.remove(t)}}),[e])}(o),n.createElement(_.Provider,{value:o},n.createElement(T.Provider,{value:!0},r))}try{var k=require("prop-types");A.propTypes={children:k.node.isRequired}}catch(e){}function M(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(n,o){return r.call(t,o)&&t[o]&&(n=n+" "+e+"--"+o),n}),e)}function L(e){if(!e)throw new Error("bem requires a base block class but none were provided.");return function(t,r){if("string"!=typeof t&&r)throw new TypeError("bem does not support having two modifier arguments.");return t?"string"!=typeof t?M(e,t):M(e+"__"+t,r):e}}function D(e,r,n,o){void 0===n&&(n=!1),void 0===o&&(o="undefined"!=typeof window);var a=t.useState((function(){return void 0!==r?r:!(n||!o||"undefined"==typeof window)&&window.matchMedia(e).matches})),i=a[0],c=a[1];return t.useEffect((function(){if("undefined"!=typeof window&&!n){var t=window.matchMedia(e),r=function(e){var t=e.matches;return c(t)};return t.addListener(r),t.matches!==i&&c(t.matches),function(){return t.removeListener(r)}}}),[n,i,e]),i}var q=function(e,t){var r=typeof e;return"undefined"===r?"":"("+t+"-width: "+("number"===r?e+"px":e)+")"};function B(e){var r=e.min,n=e.max;return D(t.useMemo((function(){return"screen and "+[q(r,"min"),q(n,"max")].filter(Boolean).join(" and ")}),[r,n]))}var K=function(){var e,t=null===(e=window.screen.orientation)||void 0===e?void 0:e.type;if("string"==typeof t)return t;var r=window.screen;return r.availHeight>r.availWidth?"portrait-primary":"landscape-primary"};function H(e){var r=t.useState((function(){return e||("undefined"!=typeof window?K():"landscape-primary")})),n=r[0],o=r[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=function(){o(K())};return window.addEventListener("orientationchange",e),function(){return window.removeEventListener("orientationchange",e)}}}),[]),n}var W={isPhone:!1,isTablet:!1,isDesktop:!0,isLargeDesktop:!1,isLandscape:!0};var V=function(){return(V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},z=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},U=t.createContext(V(V({},W),{__initialized:!1}));function G(){var e=t.useContext(U),r=e.__initialized,n=z(e,["__initialized"]);if(!r)throw new Error("Attempted to use the current `AppSizeContext` without mounting the `AppSizeListener` component beforehand.");return n}var Y=function(){return(Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},X=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Q=L("rmd-grid"),$=t.forwardRef((function(e,r){var o,a,c,l,s,f,u,p=e.style,d=e.className,y=e.clone,h=e.children,b=e.colSpan,v=e.colStart,m=e.colEnd,g=e.rowSpan,O=e.rowStart,w=e.rowEnd,j=e.phone,E=e.tablet,P=e.desktop,I=e.largeDesktop,R=X(e,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),x=G(),F=x.isPhone,C=x.isTablet,_=x.isDesktop,T=x.isLargeDesktop,N=b,S=v,A=m,k=g,M=O,L=w,D=F&&j||C&&E||_&&P||T&&I;D&&(k=void 0===(o=D.rowSpan)?g:o,M=void 0===(a=D.rowStart)?O:a,L=void 0===(c=D.rowEnd)?w:c,N=void 0===(l=D.colSpan)?b:l,S=void 0===(s=D.colStart)?v:s,A=void 0===(f=D.colEnd)?m:f);var q=Y({gridColumnStart:S,gridColumnEnd:A,gridRowStart:M,gridRowEnd:k?"span "+k:L},p),B=i(Q("cell",((u={})[""+N]=N,u)),d);if(y&&t.isValidElement(h)){var K=t.Children.only(h);return t.cloneElement(K,{style:Y(Y({},K.props.style),q),className:i(B,K.props.className)})}return n.createElement("div",Y({},R,{ref:r,style:q,className:B}),h)}));try{var J=require("prop-types"),Z=J.shape({rowSpan:J.number,rowStart:J.oneOfType([J.number,J.string]),rowEnd:J.oneOfType([J.number,J.string]),colSpan:J.number,colStart:J.oneOfType([J.number,J.string]),colEnd:J.oneOfType([J.number,J.string])});$.propTypes={style:J.object,className:J.string,clone:J.bool,rowSpan:J.number,rowStart:J.oneOfType([J.number,J.string]),rowEnd:J.oneOfType([J.number,J.string]),colSpan:J.number,colStart:J.oneOfType([J.number,J.string]),colEnd:J.oneOfType([J.number,J.string]),phone:Z,tablet:Z,desktop:Z,largeDesktop:Z,children:J.node}}catch(e){}var ee=function(){return(ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},te=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},re=L("rmd-grid"),ne=t.forwardRef((function(e,r){var o,a=e.style,c=e.className,l=e.children,s=e.clone,f=void 0!==s&&s,u=e.wrapOnly,p=void 0!==u&&u,d=e.columns,y=e.phoneColumns,h=e.tabletColumns,b=e.desktopColumns,v=e.largeDesktopColumns,m=e.padding,g=e.gutter,O=e.minCellWidth,w=te(e,["style","className","children","clone","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),j=G(),E=j.isPhone,P=j.isTablet,I=j.isDesktop,R=j.isLargeDesktop,x=ee(ee({padding:0!==m&&m||void 0,gridTemplateColumns:O?"repeat(auto-fill, minmax("+O+", 1fr))":void 0},a),((o={})["--rmd-grid-cols"]=E&&y||P&&h||R&&v||I&&b||d,o["--rmd-grid-gutter"]=g,o)),F=l;return(f||p)&&(F=t.Children.map(l,(function(e){return e&&n.createElement($,{clone:f},e)}))),n.createElement("div",ee({},w,{ref:r,style:x,className:i(re({"no-padding":0===m}),c)}),F)}));try{var oe=require("prop-types");ne.propTypes={style:oe.object,className:oe.string,clone:oe.bool,wrapOnly:oe.bool,columns:oe.number,phoneColumns:oe.number,tabletColumns:oe.number,desktopColumns:oe.number,largeDesktopColumns:oe.number,padding:oe.oneOfType([oe.number,oe.string]),gutter:oe.string,children:oe.node,minCellWidth:oe.string}}catch(e){}function ae(e,t){t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e))}var ie=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var o=n[r];e.call(t,o[1],o[0])}},t}()}(),ce="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,le="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),se="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(le):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var fe=["top","right","bottom","left","width","height","size","weight"],ue="undefined"!=typeof MutationObserver,pe=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,n=!1,o=0;function a(){r&&(r=!1,e()),n&&c()}function i(){se(a)}function c(){var e=Date.now();if(r){if(e-o<2)return;n=!0}else r=!0,n=!1,setTimeout(i,t);o=e}return c}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){ce&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ue?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){ce&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;fe.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),de=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},ye=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||le},he=we(0,0,0,0);function be(e){return parseFloat(e)||0}function ve(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+be(e["border-"+r+"-width"])}),0)}function me(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return he;var n=ye(e).getComputedStyle(e),o=function(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var o=n[r],a=e["padding-"+o];t[o]=be(a)}return t}(n),a=o.left+o.right,i=o.top+o.bottom,c=be(n.width),l=be(n.height);if("border-box"===n.boxSizing&&(Math.round(c+a)!==t&&(c-=ve(n,"left","right")+a),Math.round(l+i)!==r&&(l-=ve(n,"top","bottom")+i)),!function(e){return e===ye(e).document.documentElement}(e)){var s=Math.round(c+a)-t,f=Math.round(l+i)-r;1!==Math.abs(s)&&(c-=s),1!==Math.abs(f)&&(l-=f)}return we(o.left,o.top,c,l)}var ge="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof ye(e).SVGGraphicsElement}:function(e){return e instanceof ye(e).SVGElement&&"function"==typeof e.getBBox};function Oe(e){return ce?ge(e)?function(e){var t=e.getBBox();return we(0,0,t.width,t.height)}(e):me(e):he}function we(e,t,r,n){return{x:e,y:t,width:r,height:n}}var je=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=we(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Oe(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),Ee=function(e,t){var r,n,o,a,i,c,l,s=(n=(r=t).x,o=r.y,a=r.width,i=r.height,c="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(c.prototype),de(l,{x:n,y:o,width:a,height:i,top:o,right:n+a,bottom:i+o,left:n}),l);de(this,{target:e,contentRect:s})},Pe=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new ie,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ye(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new je(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ye(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new Ee(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Ie="undefined"!=typeof WeakMap?new WeakMap:new ie,Re=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=pe.getInstance(),n=new Pe(t,r,this);Ie.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){Re.prototype[e]=function(){var t;return(t=Ie.get(this))[e].apply(t,arguments)}}));var xe=void 0!==le.ResizeObserver?le.ResizeObserver:Re,Fe=function(){return(Fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ce(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function _e(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}function Te(e){var r=e.disableHeight,n=void 0!==r&&r,o=e.disableWidth,a=void 0!==o&&o,i=e.onResize,c=e.target;t.useEffect((function(){if(!n||!a){var e=function(e){return function(e){return!!e&&void 0!==e.current}(e)?e.current:function(e){return"function"==typeof e}(e)?e():"string"==typeof e?document.querySelector(e):e}(c);if(e){var t,r=new xe((function(e){for(var r=0;r<e.length;r+=1){var o=e[r],c=o.target,l=o.contentRect,s={height:l.height,width:l.width,scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth},f=Ce(t,s),u=_e(t,s);t=s,(f&&!n||u&&!a)&&i(Fe(Fe({},s),{element:c}))}}));return r.observe(e),function(){r.disconnect()}}}}),[c,i,n,a])}var Ne=function(){return(Ne=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Se=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Ae=L("rmd-grid-list"),ke=t.forwardRef((function(e,r){var o=e.className,a=e.children,c=e.square,l=void 0!==c&&c,s=e.clone,f=void 0!==s&&s,u=Se(e,["className","children","square","clone"]),p=i(Ae("cell",{square:l}),o);if(f&&t.isValidElement(a)){var d=t.Children.only(a);return t.cloneElement(d,{className:i(p,d.props.className)})}return n.createElement("div",Ne({},u,{ref:r,className:p}),a)}));try{var Me=require("prop-types");ke.propTypes={clone:Me.bool,square:Me.bool,className:Me.string,children:Me.node}}catch(e){}var Le={height:void 0,width:void 0};function De(e,t){if(void 0===e&&(e="width"),void 0===t&&(t=!1),"undefined"==typeof window)return-1;var r=Le[e];if(!t&&"number"==typeof r)return r;var n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",document.body.appendChild(n);var o=document.createElement("div");n.appendChild(o);var a="width"===e?"offsetWidth":"offsetHeight";return r=n[a]-o[a],Le[e]=r,document.body.removeChild(n),r}var qe=function(){return(qe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Be=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Ke=L("rmd-grid-list"),He=t.forwardRef((function(e,r){var o,a=e.style,c=e.className,l=e.children,s=e.clone,f=void 0!==s&&s,u=e.wrapOnly,p=void 0!==u&&u,d=e.cellMargin,y=e.defaultSize,h=e.maxCellSize,b=void 0===h?150:h,v=e.containerPadding,m=void 0===v?16:v,g=e.disableHeightObserver,O=void 0!==g&&g,w=e.disableWidthObserver,j=void 0!==w&&w,E=Be(e,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),P=t.useState(y||{columns:-1,cellWidth:b}),I=P[0],R=P[1],x=t.useRef(null),F=t.useCallback((function(){if(x.current){var e=x.current.getBoundingClientRect().width;e-=m,x.current.offsetHeight<x.current.scrollHeight&&(e-=De("width"));var t=Math.ceil(e/b);R({cellWidth:e/t,columns:t})}}),[b,m]),C=t.useCallback((function(e){ae(e,r),x.current=e,e&&F()}),[r,F]);Te({disableHeight:O,disableWidth:j,onResize:F,target:x});var _=qe(qe({},a),((o={})["--rmd-cell-size"]=I.cellWidth+"px",o["--rmd-cell-margin"]=d||void 0,o)),T=null;return T=function(e){return"function"==typeof e}(l)?l(I):f||p?t.Children.map(l,(function(e){return e&&n.createElement(ke,{clone:f},e)})):l,n.createElement("div",qe({},E,{ref:C,style:_,className:i(Ke(),c)}),T)}));try{var We=require("prop-types");He.propTypes={style:We.object,clone:We.bool,wrapOnly:We.bool,className:We.string,children:We.oneOfType([We.func,We.node]),cellMargin:We.string,maxCellSize:We.number,defaultSize:We.oneOfType([We.shape({columns:We.number.isRequired,cellWidth:We.number.isRequired}),We.func]),containerPadding:We.number,disableHeightObserver:We.bool,disableWidthObserver:We.bool}}catch(e){}function Ve(e,t,r,n){e=e.toUpperCase();for(var o=r;o<n;o+=1){if(0===t[o].toUpperCase().indexOf(e))return o}return-1}function ze(e,t,r,n){void 0===n&&(n=!0);var o=Ve(e,t,r+1,t.length);-1===o&&(o=Ve(e,t,0,r+(n?1:0)));return o}var Ue=function(){return(Ue=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ge(e,t){return Object.keys(t).reduce((function(e,r){return void 0===e[r]&&(e[r]=t[r]),e}),Ue({},e))}function Ye(e,t,r,n){return void 0===t&&(t=!1),void 0===r&&(r=!1),void 0===n&&(n=!1),t&&(e=e.toLowerCase()),n?e=e.replace(/\s/g,""):r&&(e=e.trim()),e}function Xe(e,t){switch(void 0===t&&(t="value"),typeof e){case"string":return e;case"number":return Number.isNaN(e)?"":""+e;case"function":return Xe(e(),t);case"object":return e?Xe(e[t],t):"";default:return""}}var Qe=Xe,$e={getItemValue:Qe,valueKey:"value",trim:!0,ignoreWhitespace:!1};function Je(e,t,r){void 0===r&&(r={});var n=Ge(r,$e),o=n.getItemValue,a=n.valueKey,i=n.trim,c=n.ignoreWhitespace,l=n.startsWith,s=void 0!==l&&l;return(e=Ye(e,!0,i,c))&&t.length?t.filter((function(t){var r=Ye(o(t,a),!0,i,c);return s?0===r.indexOf(e):-1!==r.indexOf(e)})):t}function Ze(e){return new RegExp((""+e).split("").join("\\w*").replace(/(\(|\||\)|\\(?!w\*)|\[|\|-|\.|\^|\+|\$|\?|^(?!w)\*)/g,"\\$1").replace(/\*\*/g,"*\\*"),"i")}function et(e,t,r){void 0===r&&(r={});var n=Ge(r,$e),o=n.getItemValue,a=n.valueKey,i=n.trim,c=n.ignoreWhitespace;if(e=Ye(e,!1,i,c),!t.length||!e)return t;var l=Ze(e);return t.filter((function(e){var t=Ye(o(e,a),!1,i,c);return t.length&&t.match(l)}))}function tt(e,r){void 0===r&&(r=500);var n=t.useRef(e),o=t.useRef(),a=t.useCallback((function(){window.clearTimeout(o.current),n.current=e}),[e]),i=t.useCallback((function(e){n.current=e,window.clearTimeout(o.current),o.current=window.setTimeout(a,r)}),[r,a]);return[n,i,a]}function rt(e){var r=e.items,n=e.onChange,o=e.onKeyDown,a=e.resetTime,i=void 0===a?500:a,c=e.searchIndex,l=e.valueKey,s=void 0===l?"value":l,f=e.getItemValue,u=void 0===f?Qe:f,p=e.findMatchIndex,d=void 0===p?ze:p,y=tt("",i),h=y[0],b=y[1],v=t.useMemo((function(){return r.map((function(e){return u(e,s)}))}),[r,u,s]);return t.useCallback((function(e){o&&o(e);var t=e.key,a=e.altKey,i=e.ctrlKey,l=e.metaKey;if(!(a||i||l||t.length>1||!h.current&&" "===t)){var s=t;h.current!==t&&(s=""+h.current+t),b(s);var f=d(s,v,c,!0);if(f!==c&&-1!==f){var u={index:f,item:r[f],items:r,query:s,target:e.currentTarget};n(u)}}}),[c,d,r,n,o,b,h,v])}var nt=function(){return(nt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ot(e){var r=e.children,o=e.onChange,a=e.phoneMaxWidth,i=void 0===a?"47.9375em":a,c=e.tabletMinWidth,l=void 0===c?"48em":c,s=e.tabletMaxWidth,f=void 0===s?"64em":s,u=e.desktopMinWidth,p=void 0===u?"64.0625em":u,d=e.desktopLargeMinWidth,y=void 0===d?"80em":d,h=e.defaultSize,b=void 0===h?W:h,v=function(e){var r=void 0===e?{}:e,n=r.phoneMaxWidth,o=void 0===n?"47.9375em":n,a=r.tabletMinWidth,i=void 0===a?"48em":a,c=r.tabletMaxWidth,l=void 0===c?"64em":c,s=r.desktopMinWidth,f=void 0===s?"64.0625em":s,u=r.desktopLargeMinWidth,p=void 0===u?"80em":u,d=r.defaultSize,y=void 0===d?W:d;if("undefined"==typeof window)return y;var h=B({min:f}),b=B({min:p}),v=B({min:i,max:l}),m=B({max:o}),g=h,O=!h&&v,w=!O&&!g&&m,j=H().includes("landscape"),E=b,P=t.useState(y),I=P[0],R=P[1];return t.useEffect((function(){I.isPhone===w&&I.isTablet===O&&I.isDesktop===g&&I.isLargeDesktop===E&&I.isLandscape===j||(w||O||g||E)&&R({isPhone:w,isTablet:O,isDesktop:g,isLargeDesktop:E,isLandscape:j})}),[w,O,g,E,j,I]),I}({phoneMaxWidth:i,tabletMaxWidth:f,tabletMinWidth:l,desktopMinWidth:p,desktopLargeMinWidth:y,defaultSize:b}),m=t.useRef(v);t.useEffect((function(){!o||b.isPhone===v.isPhone&&b.isTablet===v.isTablet&&b.isDesktop===v.isDesktop&&b.isLargeDesktop===v.isLargeDesktop&&b.isLandscape===v.isLandscape||o(v,b)}),[]),t.useEffect((function(){m.current!==v&&(o&&o(v,m.current),m.current=v)}));var g=t.useMemo((function(){return nt(nt({},v),{__initialized:!0})}),[v]);return n.createElement(U.Provider,{value:g},r)}try{var at=require("prop-types"),it=at.oneOfType([at.string,at.number]);ot.propTypes={children:at.node.isRequired,onChange:at.func,phoneMaxWidth:it,tabletMinWidth:it,tabletMaxWidth:it,desktopMinWidth:it,desktopLargeMinWidth:it,defaultSize:at.shape({isPhone:at.bool.isRequired,isTablet:at.bool.isRequired,isDesktop:at.bool.isRequired,isLargeDesktop:at.bool.isRequired,isLandscape:at.bool.isRequired})}}catch(e){}function ct(e){var r=e.disableHeight,o=void 0!==r&&r,a=e.disableWidth,i=void 0!==a&&a,c=e.className,l=e.component,s=void 0===l?"span":l,f=e.target,u=e.onResize,p=t.useState(null),d=p[0],y=p[1];Te({disableHeight:o,disableWidth:i,target:f||d,onResize:u});var h=t.useCallback((function(e){y(e?e.parentElement:null)}),[]);return null===f||f?null:n.createElement(s,{className:c,"aria-hidden":"true",ref:h})}try{var lt=require("prop-types");ct.propTypes={disableHeight:lt.bool,disableWidth:lt.bool,className:lt.string,component:lt.oneOfType([lt.string]),target:lt.oneOfType([lt.string,lt.func,lt.object])}}catch(e){}function st(e){var r=e.onResize,n=e.options,o=e.immediate,a=e.enabled,i=void 0===a||a,c=R(r);t.useEffect((function(){if(i){var e=E("resize",window,!0,n),t=function(e){return c.current(e)};return e.add(t),o&&"undefined"!=typeof window&&window.dispatchEvent(new UIEvent("resize")),function(){e.remove(t)}}}),[n,i])}function ft(e){var t=e.onResize,r=e.options,n=e.immediate;return st({onResize:t,options:r,immediate:void 0===n?"undefined"!=typeof window:n,enabled:!0}),null}try{var ut=require("prop-types");ft.propTypes={onResize:ut.func.isRequired,options:ut.object,immediate:ut.bool}}catch(e){}var pt=function(e){var t=e,r=t.children,n=t.fallback,o=G(),a=o.isPhone,i=o.isTablet;return a||i?r:n},dt=function(e){var t=e,r=t.children,n=t.fallback;return G().isPhone?r:n},yt=function(e){var t=e,r=t.children,n=t.fallback;return G().isTablet?r:n},ht=function(e){var t=e,r=t.children,n=t.fallback;return G().isDesktop?r:n},bt={fallback:null};function vt(e){if(!e)return null;if(/(tree|list)item/.test(e.getAttribute("role")||"")){if(n=e.querySelector(".rmd-tree-item__content, .rmd-item-text"))return n}else if("file"===e.getAttribute("type")){var t=document.querySelector('[for="'+e.id+'"]');if(t)return t}var r=e.getAttribute("data-sizing-selector");if(r){var n;if(n=e.querySelector(r))return n;throw new Error("Unable to find a child element using the `data-sizing-selector`")}return e}function mt(e){var t=document.documentElement||{clientHeight:0,clientWidth:0};return"width"===e?window.innerWidth||t.clientWidth:window.innerHeight||t.clientHeight}function gt(e){return"number"==typeof e?e+"px":""}function Ot(e,t){void 0===t&&(t={});var r=e.cloneNode(!0);r.removeAttribute("id"),r.removeAttribute("role"),r.style.position="fixed",r.style.visibility="hidden",r.style.left=gt(t.left),r.style.top=gt(t.top),r.style.right=gt(t.right),r.style.bottom=gt(t.bottom),r.style.webkitTransform="none",r.style.transform="none";var n=e.parentElement||document.body;n.appendChild(r);var o=r.getBoundingClientRect();return n.removeChild(r),o}function wt(e){var t=e.xMargin,r=e.elWidth,n=e.initialX,o=e.containerRect;return(null!=n?n:o.left)-r-t}function jt(e){var t=e.xMargin,r=e.initialX,n=e.containerRect;return(null!=r?r:n.left)+t}function Et(e){var t=e.xMargin,r=e.elWidth,n=e.initialX,o=e.containerRect;return(null!=n?n:o.left+o.width)-r-t}function Pt(e){var t=e.xMargin,r=e.initialX,n=e.containerRect;return(null!=r?r:n.left+n.width)+t}function It(e){var t=e.yMargin,r=e.initialY,n=e.elHeight,o=e.containerRect;return(null!=r?r:o.top)-n-t}function Rt(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top)+t}function xt(e){var t=e.yMargin,r=e.initialY,n=e.elHeight,o=e.containerRect;return(null!=r?r:o.top+o.height)-n-t}function Ft(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top+n.height)+t}function Ct(e){var t=e.x,r=e.vw,n=e.vwMargin,o=e.xMargin,a=e.width,i=e.elWidth,c=e.initialX,l=e.containerRect,s=e.disableSwapping;if("min"===a||"equal"===a)return function(e){var t,r,n=e.x,o=e.vw,a=e.elWidth,i=e.xMargin,c=e.vwMargin,l=e.initialX,s=e.containerRect,f=e.isMinWidth,u=null!=l?l:s.left+i,p=s.width-2*i;return f&&(t=p,p=void 0,u+a>o-c&&(r=c)),{left:u,right:r,width:p,minWidth:t,actualX:n}}({x:t,vw:r,vwMargin:n,xMargin:o,elWidth:i,initialX:c,containerRect:l,isMinWidth:"min"===a});if(i>r-2*n)return{left:n,right:n,actualX:t};var f={vwMargin:n,xMargin:o,elWidth:i,initialX:c,screenRight:r-n,containerRect:l,disableSwapping:s};switch(t){case"left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=e.disableSwapping,a=wt(e),i="left";if(a>=t)return{actualX:i,left:a};var c=Pt(e);return o||c+n>r?a=t:(a=c,i="right"),{actualX:i,left:a}}(f);case"inner-left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=e.disableSwapping,a=jt(e),i="inner-left";if(a+n<=r)return{actualX:i,left:a};var c=Et(e);return o||c<t?a=t:(a=c,i="inner-right"),{actualX:i,left:a}}(f);case"center":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=function(e){var t=e.elWidth,r=e.initialX,n=e.containerRect,o=n.width/2,a=t/2;return(null!=r?r:n.left+o)-a}(e);return o<t?o=t:(o+n>r||o<t)&&(o=r-n),{actualX:"center",left:o}}(f);case"inner-right":return function(e){var t=e.screenRight,r=e.vwMargin,n=e.elWidth,o=e.disableSwapping,a=Et(e),i="inner-right";if(a>=r)return{actualX:i,left:a};var c=jt(e);return o||c+n>t?a=t-n:(a=c,i="inner-left"),{actualX:i,left:a}}(f);case"right":return function(e){var t=e.screenRight,r=e.vwMargin,n=e.elWidth,o=e.disableSwapping,a=Pt(e),i="right";if(a+n<=t)return{actualX:i,left:a};var c=wt(e);return o||c<r?a=t-n:(a=c,i="left"),{actualX:i,left:a}}(f);default:throw new Error("This should never happen")}}function _t(e){var t=e.y,r=e.vh,n=e.vhMargin,o=e.yMargin,a=e.elHeight,i=e.initialY,c=e.containerRect,l=e.disableSwapping,s=e.preventOverlap,f=e.disableVHBounds;if(!f&&!s&&a>r-2*n)return{top:n,bottom:n,actualY:"center"};var u={vhMargin:n,yMargin:o,elHeight:a,initialY:i,containerRect:c,screenBottom:r-n,preventOverlap:s,disableSwapping:l,disableVHBounds:f};switch(t){case"above":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.screenBottom,o=e.elHeight,a=e.containerRect,i=e.preventOverlap,c=e.disableSwapping,l=e.disableVHBounds,s=It(e),f="above";if(l)return{actualY:f,top:Math.max(0,s)};if(s>r)return{actualY:f,top:s};var u,p=Ft(e);return c||p+o>n?s=r:(f="below",s=p),i&&"above"===f&&s+o>a.top&&(u=window.innerHeight-a.top+t),{actualY:f,top:s,bottom:u}}(u);case"top":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,i=Rt(e),c="top";if(a||i+n<=r)return{actualY:c,top:i};var l=xt(e);return o||l<t?i=t:(c="bottom",i=l),{actualY:c,top:i}}(u);case"center":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableVHBounds,a=function(e){var t=e.elHeight,r=e.initialY,n=e.containerRect,o=n.height/2,a=t/2;return(null!=r?r:n.top+o)-a}(e);return o?{actualY:"center",top:Math.max(0,a)}:((a=Math.max(t,a))+n>r&&(a=r-n),{actualY:"center",top:a})}(u);case"bottom":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,i=xt(e),c="bottom";if(a||i>t)return{actualY:c,top:i};var l=Rt(e);return o||l+n>r?i=r-n:(c="top",i=l),{actualY:c,top:i}}(u);case"below":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.elHeight,o=e.screenBottom,a=e.containerRect,i=e.preventOverlap,c=e.disableSwapping,l=e.disableVHBounds,s=Ft(e),f="below";if(l||s+n<=o)return{actualY:f,top:s};if(i){var u=a.top-t;return c||u<o-s?{actualY:f,top:s,bottom:r}:{actualY:"above",top:Math.max(r,u-n),bottom:mt("height")-u}}var p=It(e);return c||p<r?s=o-n:(f="above",s=p),{actualY:f,top:s}}(u);default:throw new Error("This should never happen")}}function Tt(e){var t="0";switch(e.x){case"right":case"inner-left":t="0";break;case"center":t="50%";break;case"left":case"inner-right":t="100%";break;default:t="0"}var r="0";switch(e.y){case"above":case"bottom":r="100%";break;case"center":r="50%";break;case"below":case"top":r="0";break;default:r="0"}return t+" "+r}function Nt(e){var t=e.container,r=e.element,n=e.anchor,o=void 0===n?{}:n,a=e.initialX,i=e.initialY,c=e.vwMargin,l=void 0===c?16:c,s=e.vhMargin,f=void 0===s?16:s,u=e.xMargin,p=void 0===u?0:u,d=e.yMargin,y=void 0===d?0:d,h=e.width,b=void 0===h?"auto":h,v=e.preventOverlap,m=void 0!==v&&v,g=e.transformOrigin,O=void 0!==g&&g,w=e.disableSwapping,j=void 0!==w&&w,E=e.disableVHBounds,P=void 0!==E&&E;t=vt(t);var I={x:o.x||"center",y:o.y||"below"};if("auto"!==b&&"center"!==I.x)throw new Error('Unable to use a calculated width when the horizontal anchor is not `"center"`.');if(m&&"above"!==I.y&&"below"!==I.y)throw new Error('Unable to prevent overlap when the vertical anchor is not `"above"` or `"below"`');if(!t||!r)return{actualX:I.x,actualY:I.y};var R=t.getBoundingClientRect(),x=mt("height"),F=mt("width"),C=Ot(r),_=C.height,T=C.width;P&&(r.closest("[role='dialog']")||(i=(null!=i?i:0)+window.scrollY));var N=Ct({x:I.x,vw:F,vwMargin:l,xMargin:p,width:b,elWidth:T,initialX:a,containerRect:R,disableSwapping:j}),S=N.left,A=N.right,k=N.width,M=N.minWidth,L=N.actualX,D=_t({y:I.y,vh:x,vhMargin:f,yMargin:y,initialY:i,elHeight:_,containerRect:R,disableSwapping:j,preventOverlap:m,disableVHBounds:P}),q=D.top,B=D.bottom,K=D.actualY;return{actualX:L,actualY:K,style:{left:S,top:q,right:A,bottom:B,width:k,minWidth:M,position:P?"absolute":"fixed",transformOrigin:O?Tt({x:L,y:K}):void 0}}}pt.defaultProps=bt,dt.defaultProps=bt,yt.defaultProps=bt,ht.defaultProps=bt;var St={x:"inner-left",y:"top"},At={x:"inner-right",y:"top"},kt={x:"right",y:"top"},Mt={x:"center",y:"center"},Lt={x:"center",y:"below"},Dt={x:"inner-right",y:"below"},qt=["BUTTON","TEXTAREA","SELECT"].reduce((function(e,t){return e+","+t+":not([disabled])"}),'a[href],area[href],input:not([disabled]):not([type="hidden"])')+",[tabindex]",Bt=qt+':not([tabindex="-1"])';function Kt(e,t){return void 0===t&&(t=!1),Array.from(e.querySelectorAll(t?qt:Bt))}function Ht(e,t){if(t=vt(t),e&&t){var r=t.offsetTop;t.offsetParent!==e&&(r-=e.offsetTop);var n=r+t.offsetHeight;n>e.offsetHeight+e.scrollTop?e.scrollTop=n-e.offsetHeight:r<e.scrollTop&&(e.scrollTop=r)}}function Wt(e,t,r,n,o){var a;switch(void 0===r&&(r=!1),void 0===n&&(n=!1),o&&o.length||(o=Kt(e,r)),t){case"first":a=o[0];break;case"last":a=o[o.length-1];break;default:a=e.querySelector(t)}if(!a)throw new Error("Unable to find a focusable element");a.focus({preventScroll:n}),n||e===document||Ht(e,a)}function Vt(e,r,n,o,a){void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===a&&(a=!1),t.useEffect((function(){if(!a){var t=window.requestAnimationFrame((function(){var t=function(e){var t=null;return e&&(t=e instanceof HTMLElement?e:e.current),t}(e);t&&(t.focus({preventScroll:n}),Wt(t,r,o,n))}));return function(){window.cancelAnimationFrame(t)}}}),[r,a,e,o,n])}function zt(e,r,n){void 0===r&&(r=void 0),void 0===n&&(n=null);var o=t.useRef({disabled:e,fallback:r});t.useEffect((function(){o.current={disabled:e,fallback:r}})),t.useEffect((function(){if(!e){var t=n||document.activeElement,r=t.closest('[role="menu"]'),a=null;if(r&&!(a=document.getElementById(r.id.replace(/-menu$/,"")))){var i=(r.getAttribute("aria-labelledby")||"").split(" ").map((function(e){return"#"+e+"[tabindex]"})).join(",");a=i?document.querySelector(i):null}return function(){var e=o.current,i=e.fallback;if(!e.disabled)if(!r||!a||n||i||document.contains(t)||!document.contains(a)){var c=t;if(document.contains(c)||(c=n&&document.contains(n)?n:null),!c&&i)switch(typeof i){case"string":c=document.querySelector(i);break;case"function":c=i();break;default:c=i}c&&!document.contains(c)&&(c=null),c&&c.focus()}else a.focus()}}}),[])}var Ut,Gt,Yt=function(){return(Yt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xt=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Qt=t.forwardRef((function(e,r){var o=e.children,a=e.onKeyDown,i=e.component,c=void 0===i?"div":i,l=e.defaultFocus,s=void 0===l?"first":l,f=e.disableFocusCache,u=void 0!==f&&f,p=e.disableFocusOnMount,d=void 0!==p&&p,y=e.disableFocusOnMountScroll,h=void 0!==y&&y,b=e.disableFocusOnUnmount,v=void 0!==b&&b,m=e.disableTabFocusWrap,g=void 0!==m&&m,O=e.unmountFocusFallback,w=void 0===O?"":O,j=Xt(e,["children","onKeyDown","component","defaultFocus","disableFocusCache","disableFocusOnMount","disableFocusOnMountScroll","disableFocusOnUnmount","disableTabFocusWrap","unmountFocusFallback"]),E=t.useRef(null),P=t.useCallback((function(e){ae(e,r),E.current=e}),[r]);zt(v,w),Vt(E,s,h,!1,d);var I=function(e){var r=e.disabled,n=void 0!==r&&r,o=e.disableFocusCache,a=void 0!==o&&o,i=e.onKeyDown,c=t.useRef([]),l=t.useCallback((function(e){if(i&&i(e),"Tab"===e.key){!a&&c.current.length||(c.current=Kt(e.currentTarget));var t=c.current,r=t.length;0!==r&&(1===r?e.preventDefault():t[0]===e.target&&e.shiftKey?(e.preventDefault(),t[r-1].focus()):t[r-1]!==e.target||e.shiftKey||(e.preventDefault(),t[0].focus()))}}),[i,a]);return n?i:l}({disabled:g,disableFocusCache:u,onKeyDown:a});return n.createElement(c,Yt({},j,{onKeyDown:I,ref:P}),o)}));try{var $t=require("prop-types");Qt.propTypes={disableFocusCache:$t.bool,disableFocusOnMount:$t.bool,disableFocusOnUnmount:$t.bool,disableTabFocusWrap:$t.bool,defaultFocus:$t.oneOfType([$t.oneOf(["first","last"]),$t.string]),component:$t.oneOfType([$t.string,$t.func,$t.object]),unmountFocusFallback:$t.oneOfType([$t.string,$t.func,$t.object]),children:$t.node,onKeyDown:$t.func,disableFocusOnMountScroll:$t.bool}}catch(e){}(Ut=e.IncrementMovementKey||(e.IncrementMovementKey={})).ArrowUp="ArrowUp",Ut.ArrowDown="ArrowDown",Ut.ArrowLeft="ArrowLeft",Ut.ArrowRight="ArrowRight",Ut.PageDown="PageDown",Ut.PageUp="PageUp",Ut.ShiftArrowUp="Shift+ArrowUp",Ut.ShiftArrowDown="Shift+ArrowDown",Ut.ShiftArrowLeft="Shift+ArrowLeft",Ut.ShiftArrowRight="Shift+ArrowRight",Ut.AltArrowDown="Alt+ArrowDown",Ut.AltArrowUp="Alt+ArrowUp",Ut.AltArrowLeft="Alt+ArrowLeft",Ut.AltArrowRight="Alt+ArrowRight",Ut.AltPageDown="Alt+PageDown",Ut.AltPageUp="Alt+PageUp",Ut.ControlArrowDown="Control+ArrowDown",Ut.ControlArrowUp="Control+ArrowUp",(Gt=e.JumpMovementKey||(e.JumpMovementKey={})).Home="Home",Gt.End="End",Gt.AltHome="Alt+Home",Gt.AltEnd="Alt+End",Gt.ControlHome="Control+Home",Gt.ControlEnd="Control+End",Gt.ControlShiftHome="Control+Shift+Home",Gt.ControlShiftEnd="Control+Shift+End";var Jt=function(){return(Jt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zt={loopable:!0,searchable:!0,incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End]},er=Jt(Jt({},Zt),{incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft]}),tr=Jt(Jt({},Zt),{loopable:!1}),rr=Jt(Jt({},er),{loopable:!1}),nr={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[],jumpToLastKeys:[],searchable:!1},or={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[],jumpToLastKeys:[],searchable:!1},ar={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home,e.JumpMovementKey.ControlShiftHome],jumpToLastKeys:[e.JumpMovementKey.End,e.JumpMovementKey.ControlShiftEnd],loopable:!0,searchable:!0},ir={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[e.JumpMovementKey.Home,e.JumpMovementKey.ControlShiftHome],jumpToLastKeys:[e.JumpMovementKey.End,e.JumpMovementKey.ControlShiftEnd],loopable:!0,searchable:!0},cr={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End],loopable:!0,searchable:!1},lr={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End],loopable:!0,searchable:!1},sr=Object.freeze({__proto__:null,VERTICAL_MENU:Zt,HORIZONTAL_MENU:er,VERTICAL_LISTBOX:tr,HORIZONTAL_LISTBOX:rr,VERTICAL_COMBOBOX:nr,HORIZONTAL_COMBOBOX:or,VERTICAL_TREE:ar,HORIZONTAL_TREE:ir,HORIZONTAL_TABS:cr,VERTICAL_TABS:lr});function fr(e,t,r,n){void 0===n&&(n=!1);var o=e+(r?1:-1);return n?o=Math.min(t,Math.max(0,o)):o>t?o=0:o<0&&(o=t),o}function ur(e,t){if(!e)throw new Error("The id must be a string with a length greater than 0");if(t<0)throw new RangeError("The provided index must be greater than 0");return e+"-item-"+(t+1)}function pr(e,t){return e.map((function(e){return{shiftKey:e.includes("Shift+"),metaKey:e.includes("Meta+"),ctrlKey:e.includes("Control+"),altKey:e.includes("Alt+"),key:e.replace(/(Shift|Meta|Alt|Control)\+/g,""),type:t}}))}function dr(e){var t=e.key,r=e.altKey,n=e.ctrlKey,o=e.metaKey,a=e.shiftKey;return e.type+"-"+[o&&"Meta",n&&"Control",a&&"Shift",r&&"Alt",t].filter(Boolean).join("+")}var yr=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,c=a.length;i<c;i++,o++)n[o]=a[i];return n};function hr(e){var r=e.onKeyDown,n=e.incrementKeys,o=e.decrementKeys,a=e.jumpToFirstKeys,i=e.jumpToLastKeys,c=e.stopPropagation,l=void 0===c||c,s=e.onChange,f=e.items,u=e.resetTime,p=e.findMatchIndex,d=e.focusedIndex,y=e.loopable,h=void 0===y||y,b=e.searchable,v=void 0===b||b,m=e.valueKey,g=void 0===m?"value":m,O=e.getItemValue,w=void 0===O?Qe:O,j=t.useMemo((function(){return yr(pr(n,"increment"),pr(o,"decrement"),pr(a,"first"),pr(i,"last"))}),[n,o,a,i]),E=t.useMemo((function(){return Array.from(f,(function(){return{current:null}}))}),[f]),P=rt({items:f,valueKey:g,getItemValue:w,onChange:function(e){s(e,E)},searchIndex:d,resetTime:u,findMatchIndex:p}),I=t.useCallback((function(e){v&&P(e),r&&r(e);var t=e.target,n=function(e,t){var r=e.key,n=e.altKey,o=e.ctrlKey,a=e.metaKey,i=e.shiftKey;return t.find((function(e){return e.key===r&&e.altKey===n&&e.ctrlKey===o&&e.metaKey===a&&e.shiftKey===i}))||null}(e,j);if(n&&t){e.preventDefault(),l&&e.stopPropagation();var o,a=n.type,i=f.length-1;switch(a){case"first":o=0;break;case"last":o=i;break;default:o=fr(d,i,"increment"===a,!h)}if(o!==d){var c={index:o,item:f[o],items:f,query:dr(n),target:e.currentTarget};s(c,E)}}}),[r,l,d,j,f,P,h,v,s,E]);return[E,I]}var br=function(){return(br=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},vr=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};function mr(e){var r=e.baseId,n=e.getId,o=void 0===n?ur:n,a=e.defaultFocusedIndex,i=void 0===a?-1:a,c=e.items,l=e.onChange,s=e.getItemValue,f=void 0===s?Qe:s,u=e.valueKey,p=void 0===u?"value":u,d=e.onKeyDown,y=e.onEnter,h=e.onSpace,b=vr(e,["baseId","getId","defaultFocusedIndex","items","onChange","getItemValue","valueKey","onKeyDown","onEnter","onSpace"]),v=t.useState(i),m=v[0],g=v[1],O=-1!==m?o(r,m):"",w=hr(br(br({},b),{valueKey:p,getItemValue:f,focusedIndex:m,items:c,onChange:function(e,t){l&&l(e,t);var r=e.index,n=e.target,o=t[r]&&t[r].current;o&&n&&n.scrollHeight>n.offsetHeight&&Ht(n,o),g(r)},onKeyDown:function(e){d&&d(e);var t=j[m]&&j[m].current||null;y&&"Enter"===e.key?y(m,t):h&&" "===e.key&&(e.preventDefault(),h(m,t))}})),j=w[0],E=w[1];return{activeId:O,itemRefs:j,onKeyDown:E,focusedIndex:m,setFocusedIndex:g}}var gr=function(){return(gr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},O