UNPKG

react-md

Version:

This is the full react-md library bundled together for convenience.

7 lines 676 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("crypto")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","crypto"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactMD={},e.React,e.ReactDOM,e.crypto)}(this,(function(e,t,r,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),i=o(r),l=o(n),c={exports:{}}; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(e){!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)){if(o.length){var i=r.apply(null,o);i&&e.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var l in o)t.call(o,l)&&o[l]&&e.push(l);else e.push(o.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r}()}(c);var u=c.exports;function f(e){var n=e.into,o=e.intoId,a=e.children,i=t.useState(null),l=i[0],c=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);l!==e&&c(e)}),[n,o,l]),l?r.createPortal(a,l):null}function s(e){var t=e.portal,r=e.portalInto,n=e.portalIntoId,o=e.children;return t||r||n?a.default.createElement(f,{into:r,intoId:n},o):o}function p(e,t){t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e))}function d(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 y(e){return function(t,r){return t?"string"!=typeof t?d(e,t):d(e+"__"+t,r):e}}var h=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,v=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function m(e){var t=(e=e.replace(h,(function(e,t,r,n){return""+t+t+r+r+n+n}))).match(v)||[];return[parseInt(t[1]||"",16)||0,parseInt(t[2]||"",16)||0,parseInt(t[3]||"",16)||0]}function b(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function O(e){var t=m(e),r=t[0],n=t[1],o=t[2];return.2126*b(r)+.7152*b(n)+.0722*b(o)}function g(e,t){var r=O(e)+.05,n=O(t)+.05;return Math.max(r,n)/Math.min(r,n)}var w=function(e){return function(e){return!!e&&void 0!==e.current}(e)?e.current:e};function j(e,t){return e=w(e),t=w(t),!!(e&&t&&e.contains(t))}var E=function(){return(E=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 P(e,t){return Object.keys(t).reduce((function(e,r){return void 0===e[r]&&(e[r]=t[r]),e}),E({},e))}var I=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},R=t.createContext({root:!0,dir:"ltr",toggleDir:function(){throw new Error("Tried to toggle the current writing direction without initializing the `Dir` component.")}}),x=R.Provider;function F(){var e=t.useContext(R);return e.root,I(e,["root"])}var C=function(){var e="ltr";"undefined"!=typeof document&&(e="rtl"===document.documentElement.getAttribute("dir")?"rtl":"ltr");return e};function _(e){var r=e.children,n=e.defaultDir,o=void 0===n?C:n,i=t.useContext(R).root,l=t.useState(o),c=l[0],u=l[1];t.useEffect((function(){if(i&&"undefined"!=typeof document)return document.documentElement.setAttribute("dir",c),function(){document.documentElement.removeAttribute("dir")}}),[c,i]);var f=t.useCallback((function(){u((function(e){return"ltr"===e?"rtl":"ltr"}))}),[]),s=t.useMemo((function(){return{root:!1,dir:c,toggleDir:f}}),[c,f]),p=t.Children.only(r);return i||(p=t.cloneElement(p,{dir:c})),a.default.createElement(x,{value:s},p)}var S=function(){},N=!1;function k(){if("undefined"==typeof window)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return window.addEventListener("testSupportsPassive",S,t),window.removeEventListener("testSupportsPassive",S,t),N=e,e}k();var T=Object.freeze({__proto__:null,update:k,get isSupported(){return N}}),A=[];function M(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 L(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r="resize"===e||"scroll"===e);var o=A.findIndex((function(o){return o.type===e&&o.target===t&&o.options===n&&o.throttle===r}));return-1===o&&(A.push({type:e,target:t,options:n,throttle:r,handler:M(e,t,r,n)}),o=A.length-1),A[o].handler}var D=function(){return(D=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 B(e,t,r,n,o,a){void 0===o&&(o=!1),t[(e?"add":"remove")+"EventListener"]("touch"+r,n,N?D({passive:!0,capture:o},a):o)}function K(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e})),r}function H(e){var r=e.enabled,n=void 0===r||r,o=e.onScroll,a=e.element,i=e.options,l=void 0===i?!!N&&{passive:!0}:i,c=K(o);t.useEffect((function(){if(n){var e=L("scroll",a||window,!0,l),t=function(e){return c.current(e)};return e.add(t),function(){e.remove(t)}}}),[n,a,l])}function V(e,t,r){if(e>=t)throw new RangeError("A range must have the min value less than the max value");if(r>t||r<e)throw new RangeError("A value must be between the min and max values");var n=(r-e)/(t-e);return Math.max(0,Math.min(Math.abs(n),1))}var W=1e3;function z(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e})),t.useEffect((function(){return function(){return r.current()}}),[])}var U=function(){},q=t.createContext({visibleInTime:W,enableHoverMode:U,disableHoverMode:U,startDisableTimer:U}),G=q.Provider;function X(){return t.useContext(q)}function Y(e){var r=e.children,n=e.disabled,o=void 0!==n&&n,i=e.defaultVisibleInTime,l=void 0===i?W:i,c=e.deactivateTime,u=void 0===c?1e3:c,f=t.useState(l),s=f[0],p=f[1],d=t.useRef(),y=t.useCallback((function(){o||(window.clearTimeout(d.current),p(0))}),[o]),h=t.useCallback((function(){window.clearTimeout(d.current),p(l)}),[l]),v=t.useCallback((function(){window.clearTimeout(d.current),d.current=window.setTimeout((function(){p(l)}),u)}),[l,u]);t.useEffect((function(){o&&(window.clearTimeout(d.current),p(l))}),[o,l]),z((function(){window.clearTimeout(d.current)}));var m=t.useMemo((function(){return{visibleInTime:s,enableHoverMode:y,disableHoverMode:h,startDisableTimer:v}}),[h,y,v,s]);return a.default.createElement(G,{value:m},r)}var J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function $(){var e=t.useState("mouse"),r=e[0],n=e[1],o=t.useRef(0),a=t.useRef(!1);return J((function(){var e=function(){return n("mouse")},t=function(){return n("keyboard")},i=function(){o.current=Date.now(),a.current=!1,n("touch")},l=function(){a.current||Date.now()-o.current<1200?a.current=!1:e()},c=function(){a.current=!0},u="rmd-utils--"+r;return document.body.classList.add(u),window.addEventListener("touchstart",i,!0),"mouse"===r?window.addEventListener("keydown",t,!0):"keyboard"===r?window.addEventListener("mousedown",e,!0):(window.addEventListener("mousemove",l,!0),window.addEventListener("contextmenu",c,!0)),function(){document.body.classList.remove(u),window.removeEventListener("touchstart",i,!0),"mouse"===r?window.removeEventListener("keydown",t,!0):"keyboard"===r?window.removeEventListener("mousedown",e,!0):(window.removeEventListener("mousemove",l,!0),window.removeEventListener("contextmenu",c,!0))}}),[r]),r}var Q=t.createContext("mouse"),Z=t.createContext(!1),ee=Q.Provider,te=Z.Provider;function re(){return t.useContext(Q)}function ne(e){return $()===e}function oe(e){var r=e.children,n=$();if(t.useContext(Z))throw new Error("Mounted multiple `UserInteractionModeListener` components.");return a.default.createElement(ee,{value:n},a.default.createElement(te,{value:!0},r))}var ae=oe,ie=function(){return(ie=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 le(e){var r=void 0===e?{}:e,n=r.disabled,o=void 0!==n&&n,a=r.sticky,i=void 0!==a&&a,l=r.onClick,c=r.onMouseEnter,u=r.onMouseLeave,f=r.defaultVisible,s=void 0!==f&&f,p=r.exitVisibilityDelay,d=void 0===p?i?300:0:p,y=re(),h="touch"===y,v=t.useState(s),m=v[0],b=v[1],O=t.useState(!1),g=O[0],w=O[1],j=t.useRef(),E=t.useRef(s),P=X(),I=P.visibleInTime,R=P.enableHoverMode,x=P.disableHoverMode,F=P.startDisableTimer,C=0===I;t.useEffect((function(){i&&!m&&w(!1)}),[m,i]),z((function(){window.clearTimeout(j.current)})),t.useEffect((function(){if(!o){var e=function(){b(!1),x(),window.clearTimeout(j.current)};return E.current||e(),E.current=!1,window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}}),[x,y,o]);var _,S=t.useCallback((function(e){if(null==c||c(e),!(g||o||h||e.isPropagationStopped())){if(window.clearTimeout(j.current),0===I)return R(),void b(!0);j.current=window.setTimeout((function(){R(),b(!0)}),I)}}),[o,R,h,c,g,I]),N=t.useCallback((function(e){null==u||u(e),g||o||h||e.isPropagationStopped()||(F(),window.clearTimeout(j.current),0!==d?j.current=window.setTimeout((function(){b(!1)}),d):b(!1))}),[o,d,h,u,F,g]),k=t.useCallback((function(e){null==l||l(e),e.isPropagationStopped()||o||(F(),window.clearTimeout(j.current))}),[o,l,F]),T=t.useCallback((function(e){null==l||l(e),e.isPropagationStopped()||o||(g?(w(!1),b((function(e){return!e}))):(w(!0),b(!0),x()))}),[x,o,l,g]),A={onClick:k,onMouseEnter:S,onMouseLeave:N};return i&&(_=ie(ie({},A),{onClick:T})),{active:C,stuck:i?g:void 0,visible:m,setVisible:b,handlers:A,stickyHandlers:_,enableHoverMode:R,disableHoverMode:x,startDisableTimer:F}}var ce="64.0625em",ue="48em",fe="64em",se="47.9375em",pe="80em",de=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 ye(e){var r=t.useState((function(){return e||("undefined"!=typeof window?de():"landscape-primary")})),n=r[0],o=r[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=function(){o(de())};return window.addEventListener("orientationchange",e),function(){return window.removeEventListener("orientationchange",e)}}}),[]),n}function he(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],l=a[1];return t.useEffect((function(){if("undefined"!=typeof window&&!n){var t=window.matchMedia(e),r=function(e){var t=e.matches;return l(t)};return t.addEventListener("change",r),t.matches!==i&&l(t.matches),function(){t.removeEventListener("change",r)}}}),[n,i,e]),i}var ve=function(e,t){var r=typeof e;return"undefined"===r?"":"("+t+"-width: "+("number"===r?e+"px":e)+")"};function me(e){var r=e.min,n=e.max;return he(t.useMemo((function(){return"screen and "+[ve(r,"min"),ve(n,"max")].filter(Boolean).join(" and ")}),[r,n]))}var be={isPhone:!1,isTablet:!1,isDesktop:!0,isLargeDesktop:!1,isLandscape:!0};function Oe(e){var r=void 0===e?{}:e,n=r.phoneMaxWidth,o=void 0===n?se:n,a=r.tabletMinWidth,i=void 0===a?ue:a,l=r.tabletMaxWidth,c=void 0===l?fe:l,u=r.desktopMinWidth,f=void 0===u?ce:u,s=r.desktopLargeMinWidth,p=void 0===s?pe:s,d=r.defaultSize,y=void 0===d?be:d;if("undefined"==typeof window)return y;var h=me({min:f}),v=me({min:p}),m=me({min:i,max:c}),b=me({max:o}),O=h,g=!h&&m,w=!g&&!O&&b,j=ye().includes("landscape"),E=v,P=t.useState(y),I=P[0],R=P[1];return t.useEffect((function(){I.isPhone===w&&I.isTablet===g&&I.isDesktop===O&&I.isLargeDesktop===E&&I.isLandscape===j||(w||g||O||E)&&R({isPhone:w,isTablet:g,isDesktop:O,isLargeDesktop:E,isLandscape:j})}),[w,g,O,E,j,I]),I}var ge=function(){return(ge=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)},we=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},je=t.createContext(ge(ge({},be),{__initialized:!1}));function Ee(){var e=t.useContext(je),r=e.__initialized,n=we(e,["__initialized"]);if(!r)throw new Error("Unable to get the current `AppSize` from `react-md` because the `AppSizeListener` could not be found when using the `useAppSize` hook. To fix this error, either initialize the `AppSizeListener` component from `@react-md/utils` or the `Configuration` component from `@react-md/layout` near the root of your app.");return n}var Pe,Ie=function(){return(Ie=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)},Re=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},xe=y("rmd-grid"),Fe=t.forwardRef((function(e,r){var n,o,i,l,c,f,s,p=e.style,d=e.className,y=e.clone,h=e.children,v=e.colSpan,m=e.colStart,b=e.colEnd,O=e.rowSpan,g=e.rowStart,w=e.rowEnd,j=e.phone,E=e.tablet,P=e.desktop,I=e.largeDesktop,R=Re(e,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),x=Ee(),F=x.isPhone,C=x.isTablet,_=x.isDesktop,S=x.isLargeDesktop,N=v,k=m,T=b,A=O,M=g,L=w,D=F&&j||C&&E||S&&I||_&&P;D&&(A=void 0===(n=D.rowSpan)?O:n,M=void 0===(o=D.rowStart)?g:o,L=void 0===(i=D.rowEnd)?w:i,N=void 0===(l=D.colSpan)?v:l,k=void 0===(c=D.colStart)?m:c,T=void 0===(f=D.colEnd)?b:f);var B=Ie({gridColumnStart:k,gridColumnEnd:T,gridRowStart:M,gridRowEnd:A?"span "+A:L},p),K=u(xe("cell",((s={})[""+N]=N,s)),d);if(y&&t.isValidElement(h)){var H=t.Children.only(h);return t.cloneElement(H,{style:Ie(Ie({},H.props.style),B),className:u(K,H.props.className)})}return a.default.createElement("div",Ie({},R,{ref:r,style:B,className:K}),h)})),Ce=function(){return(Ce=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)},_e=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},Se="--rmd-grid-cols",Ne="--rmd-grid-gutter",ke=y("rmd-grid"),Te=t.forwardRef((function(e,r){var n,o=e.style,i=e.className,l=e.children,c=e.clone,f=void 0!==c&&c,s=e.cloneStyles,p=void 0!==s&&s,d=e.wrapOnly,y=void 0!==d&&d,h=e.columns,v=e.phoneColumns,m=e.tabletColumns,b=e.desktopColumns,O=e.largeDesktopColumns,g=e.padding,w=e.gutter,j=e.minCellWidth,E=_e(e,["style","className","children","clone","cloneStyles","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),P=Ee(),I=P.isPhone,R=P.isTablet,x=P.isDesktop,F=P.isLargeDesktop,C=Ce(Ce({padding:0!==g&&g||void 0,gridTemplateColumns:j?"repeat(auto-fill, minmax("+j+", 1fr))":void 0},o),((n={})[Se]=I&&v||R&&m||F&&O||x&&b||h,n[Ne]=w,n)),_=u(ke({"no-padding":0===g}),i);if(p&&t.isValidElement(l)){var S=t.Children.only(l);return t.cloneElement(S,{style:Ce(Ce({},C),S.props.style),className:u(_,S.props.className)})}var N=l;return(f||y)&&(N=t.Children.map(l,(function(e){return e&&a.default.createElement(Fe,{clone:f},e)}))),a.default.createElement("div",Ce({},E,{ref:r,style:C,className:_}),N)})),Ae=function(){return(Ae=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)},Me=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},Le=y("rmd-grid-list"),De=t.forwardRef((function(e,r){var n=e.className,o=e.children,i=e.square,l=void 0!==i&&i,c=e.clone,f=void 0!==c&&c,s=Me(e,["className","children","square","clone"]),p=u(Le("cell",{square:l}),n);if(f&&t.isValidElement(o)){var d=t.Children.only(o);return t.cloneElement(d,{className:u(p,d.props.className)})}return a.default.createElement("div",Ae({},s,{ref:r,className:p}),o)})),Be=[],Ke="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Pe||(Pe={}));var He,Ve=function(e){return Object.freeze(e)},We=function(e,t){this.inlineSize=e,this.blockSize=t,Ve(this)},ze=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ve(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ue=function(e){return e instanceof SVGElement&&"getBBox"in e},qe=function(e){if(Ue(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var o=e,a=o.offsetWidth,i=o.offsetHeight;return!(a||i||e.getClientRects().length)},Ge=function(e){var t,r;if(e instanceof Element)return!0;var n=null===(r=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===r?void 0:r.defaultView;return!!(n&&e instanceof n.Element)},Xe="undefined"!=typeof window?window:{},Ye=new WeakMap,Je=/auto|scroll/,$e=/^tb|vertical/,Qe=/msie|trident/i.test(Xe.navigator&&Xe.navigator.userAgent),Ze=function(e){return parseFloat(e||"0")},et=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new We((r?t:e)||0,(r?e:t)||0)},tt=Ve({devicePixelContentBoxSize:et(),borderBoxSize:et(),contentBoxSize:et(),contentRect:new ze(0,0,0,0)}),rt=function(e,t){if(void 0===t&&(t=!1),Ye.has(e)&&!t)return Ye.get(e);if(qe(e))return Ye.set(e,tt),tt;var r=getComputedStyle(e),n=Ue(e)&&e.ownerSVGElement&&e.getBBox(),o=!Qe&&"border-box"===r.boxSizing,a=$e.test(r.writingMode||""),i=!n&&Je.test(r.overflowY||""),l=!n&&Je.test(r.overflowX||""),c=n?0:Ze(r.paddingTop),u=n?0:Ze(r.paddingRight),f=n?0:Ze(r.paddingBottom),s=n?0:Ze(r.paddingLeft),p=n?0:Ze(r.borderTopWidth),d=n?0:Ze(r.borderRightWidth),y=n?0:Ze(r.borderBottomWidth),h=s+u,v=c+f,m=(n?0:Ze(r.borderLeftWidth))+d,b=p+y,O=l?e.offsetHeight-b-e.clientHeight:0,g=i?e.offsetWidth-m-e.clientWidth:0,w=o?h+m:0,j=o?v+b:0,E=n?n.width:Ze(r.width)-w-g,P=n?n.height:Ze(r.height)-j-O,I=E+h+g+m,R=P+v+O+b,x=Ve({devicePixelContentBoxSize:et(Math.round(E*devicePixelRatio),Math.round(P*devicePixelRatio),a),borderBoxSize:et(I,R,a),contentBoxSize:et(E,P,a),contentRect:new ze(s,c,E,P)});return Ye.set(e,x),x},nt=function(e,t,r){var n=rt(e,r),o=n.borderBoxSize,a=n.contentBoxSize,i=n.devicePixelContentBoxSize;switch(t){case Pe.DEVICE_PIXEL_CONTENT_BOX:return i;case Pe.BORDER_BOX:return o;default:return a}},ot=function(e){var t=rt(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Ve([t.borderBoxSize]),this.contentBoxSize=Ve([t.contentBoxSize]),this.devicePixelContentBoxSize=Ve([t.devicePixelContentBoxSize])},at=function(e){if(qe(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},it=function(){var e=1/0,t=[];Be.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new ot(t.target),o=at(t.target);n.push(r),t.lastReportedSize=nt(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){r.callback.call(r.observer,n,r.observer)})),r.activeTargets.splice(0,r.activeTargets.length)}}));for(var r=0,n=t;r<n.length;r++){(0,n[r])()}return e},lt=function(e){Be.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(r){r.isActive()&&(at(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},ct=function(){var e,t=0;for(lt(t);Be.some((function(e){return e.activeTargets.length>0}));)t=it(),lt(t);return Be.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Ke}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Ke),window.dispatchEvent(e)),t>0},ut=[],ft=function(e){if(!He){var t=0,r=document.createTextNode("");new MutationObserver((function(){return ut.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),He=function(){r.textContent=""+(t?t--:t++)}}ut.push(e),He()},st=0,pt={attributes:!0,characterData:!0,childList:!0,subtree:!0},dt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],yt=function(e){return void 0===e&&(e=0),Date.now()+e},ht=!1,vt=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!ht){ht=!0;var r,n=yt(e);r=function(){var r=!1;try{r=ct()}finally{if(ht=!1,e=n-yt(),!st)return;r?t.run(1e3):e>0?t.run(e):t.start()}},ft((function(){requestAnimationFrame(r)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,pt)};document.body?t():Xe.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),dt.forEach((function(t){return Xe.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),dt.forEach((function(t){return Xe.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),mt=function(e){!st&&e>0&&vt.start(),!(st+=e)&&vt.stop()},bt=function(){function e(e,t){this.target=e,this.observedBox=t||Pe.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=nt(this.target,this.observedBox,!0);return e=this.target,Ue(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Ot=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},gt=new WeakMap,wt=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},jt=function(){function e(){}return e.connect=function(e,t){var r=new Ot(e,t);gt.set(e,r)},e.observe=function(e,t,r){var n=gt.get(e),o=0===n.observationTargets.length;wt(n.observationTargets,t)<0&&(o&&Be.push(n),n.observationTargets.push(new bt(t,r&&r.box)),mt(1),vt.schedule())},e.unobserve=function(e,t){var r=gt.get(e),n=wt(r.observationTargets,t),o=1===r.observationTargets.length;n>=0&&(o&&Be.splice(Be.indexOf(r),1),r.observationTargets.splice(n,1),mt(-1))},e.disconnect=function(e){var t=this,r=gt.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Et=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");jt.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ge(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");jt.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ge(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");jt.unobserve(this,e)},e.prototype.disconnect=function(){jt.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function Pt(e){var r=t.useRef(null),n=t.useCallback((function(t){p(t,e),r.current=t}),[e]);return[r,n]}var It=function(){return(It=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 Rt(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function xt(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}function Ft(e){var r=e.disableHeight,n=void 0!==r&&r,o=e.disableWidth,a=void 0!==o&&o,i=e.onResize,l=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}(l);if(e){var t,r=new Et((function(e){for(var r=0;r<e.length;r+=1){var o=e[r],l=o.target,c=o.contentRect,u={height:c.height,width:c.width,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},f=Rt(t,u),s=xt(t,u);t=u,(f&&!n||s&&!a)&&i(It(It({},u),{element:l}))}}));return r.observe(e),function(){r.unobserve(e),r.disconnect()}}}}),[l,i,n,a])}var Ct,_t=function(){return(_t=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 St(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function Nt(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}var kt=[];function Tt(e,t){if(void 0===t&&(t={}),"function"==typeof e){var r=e,n=t.ref,o=t.disableHeight,a=void 0!==o&&o,i=t.disableWidth,l=void 0!==i&&i,c=Pt(n),u=c[0],f=c[1];return J((function(){var e=u.current;if(!(a&&l||!e))return Ct||"undefined"==typeof document||(Ct=new Et((function(e){for(var t=function(t){var r=e[t],n=kt.filter((function(e){return e.target===r.target}));if(!n.length)return{value:void 0};for(var o=r.contentRect,a=o.height,i=o.width,l=r.target,c={height:a,width:i,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},u=0;u<n.length;u+=1){var f=n[u],s=f.handler,p=f.prevSize,d=f.disableHeight,y=f.disableWidth,h=St(p,c),v=Nt(p,c);(h&&!d||v&&!y)&&(f.prevSize=c,s(_t(_t({},c),{element:r.target})))}},r=0;r<e.length;r+=1){var n=t(r);if("object"==typeof n)return n.value}}))),function(e,t,r,n){var o=kt.find((function(t){return t.target===e}));kt.push({target:e,handler:t,disableWidth:n,disableHeight:r,prevSize:void 0}),o||null==Ct||Ct.observe(e)}(e,r,a,l),function(){!function(e,t,r,n){var o=kt.findIndex((function(o){return o.target===e&&o.handler===t&&o.disableWidth===n&&o.disableHeight===r}));-1!==o&&kt.splice(o,1),kt.some((function(t){return t.target===e}))||null==Ct||Ct.unobserve(e)}(e,r,a,l)}}),[a,l,r]),[u,f]}Ft(e)}var At={height:void 0,width:void 0};var Mt=function(){return(Mt=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)},Lt="--rmd-cell-size",Dt="--rmd-cell-margin",Bt=t.createContext({columns:-1,cellWidth:-1}),Kt=Bt.Provider;function Ht(e){var r,n=void 0===e?{}:e,o=n.ref,a=n.style,i=n.className,l=n.cellMargin,c=n.defaultSize,f=n.maxCellSize,s=void 0===f?150:f,p=n.disableHeight,d=void 0!==p&&p,y=n.disableWidth,h=void 0!==y&&y,v=n.containerPadding,m=void 0===v?16:v,b=Pt(o),O=b[0],g=b[1],w=t.useState(c||{columns:-1,cellWidth:s}),j=w[0],E=w[1],P=Tt(t.useCallback((function(){var e=O.current;if(e){var t=e.getBoundingClientRect().width;t-=m,e.offsetHeight<e.scrollHeight&&(t-=function(e,t){if(void 0===e&&(e="width"),void 0===t&&(t=!1),"undefined"==typeof window)return-1;var r=At[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],At[e]=r,document.body.removeChild(n),r}("width"));var r=Math.ceil(t/s);E({cellWidth:t/r,columns:r})}}),[m,s,O]),{ref:g,disableHeight:d,disableWidth:h})[1],I=Mt(Mt({},a),((r={})[Lt]=j.cellWidth+"px",r));return l&&(I[Dt]=l),[{ref:P,style:I,className:u("rmd-grid-list",i)},j]}var Vt=function(){return(Vt=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)},Wt=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},zt=t.forwardRef((function(e,r){var n=e.style,o=e.className,i=e.children,l=e.clone,c=void 0!==l&&l,u=e.wrapOnly,f=void 0!==u&&u,s=e.cellMargin,p=e.defaultSize,d=e.maxCellSize,y=void 0===d?150:d,h=e.containerPadding,v=void 0===h?16:h,m=e.disableHeightObserver,b=void 0!==m&&m,O=e.disableWidthObserver,g=void 0!==O&&O,w=Wt(e,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),j=Ht({ref:r,style:n,className:o,cellMargin:s,defaultSize:p,maxCellSize:y,containerPadding:v,disableHeight:b,disableWidth:g}),E=j[0],P=j[1],I=null;return I=function(e){return"function"==typeof e}(i)?i(P):c||f?t.Children.map(i,(function(e){return e&&a.default.createElement(De,{clone:c},e)})):i,a.default.createElement(Kt,{value:P},a.default.createElement("div",Vt({},w,E),I))}));function Ut(e){var t=e.value,r=e.min,n=void 0===r?0:r,o=e.max,a=e.increment,i=e.minmax,l=t+(a?1:-1);return void 0!==i&&i?l=Math.min(o,Math.max(n,l)):l>o?l=n:l<n&&(l=o),l}function qt(e,t,r,n,o){void 0===o&&(o=r-t);var a=Math.round((e-t)*n/o)/n,i=Math.min(Math.max(a,0),1),l=o/n,c=Number.isInteger(l)?o%n:l.toString().split(".")[1].length;return Math.min(r,Math.max(t,parseFloat((i*o+t).toFixed(c))))}function Gt(e,t){if(!t.length)return e;var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function Xt(e){if(!e)return null;if(/(tree|list)item/.test(e.getAttribute("role")||"")){if(r=e.querySelector(".rmd-tree-item__content, .rmd-item-text"))return r}else if("file"===e.getAttribute("type")){var t=document.querySelector('[for="'+e.id+'"]');if(t)return t}var r,n=e.getAttribute("data-sizing-selector");if(n&&(r=e.querySelector(n)))return r;return e}function Yt(e){var t=document.documentElement||{clientHeight:0,clientWidth:0};return"width"===e?window.innerWidth||t.clientWidth:window.innerHeight||t.clientHeight}function Jt(e){return"number"==typeof e?e+"px":""}function $t(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=Jt(t.left),r.style.top=Jt(t.top),r.style.right=Jt(t.right),r.style.bottom=Jt(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 Qt(e){var t=e.xMargin,r=e.elWidth,n=e.initialX,o=e.containerRect;return(null!=n?n:o.left)-r-t}function Zt(e){var t=e.xMargin,r=e.initialX,n=e.containerRect;return(null!=r?r:n.left)+t}function er(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 tr(e){var t=e.xMargin,r=e.initialX,n=e.containerRect;return(null!=r?r:n.left+n.width)+t}function rr(e){var t=e.yMargin,r=e.initialY,n=e.elHeight,o=e.containerRect;return(null!=r?r:o.top)-n-t}function nr(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top)+t}function or(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 ar(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top+n.height)+t}function ir(e){var t=e.x,r=e.vw,n=e.vwMargin,o=e.xMargin,a=e.width,i=e.elWidth,l=e.initialX,c=e.containerRect,u=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,l=e.vwMargin,c=e.initialX,u=e.containerRect,f=e.isMinWidth,s=null!=c?c:u.left+i,p=u.width-2*i;return f&&(t=p,p=void 0,s+a>o-l&&(r=l)),{left:s,right:r,width:p,minWidth:t,actualX:n}}({x:t,vw:r,vwMargin:n,xMargin:o,elWidth:i,initialX:l,containerRect:c,isMinWidth:"min"===a});if(i>r-2*n)return{left:n,right:n,actualX:t};var f={vwMargin:n,xMargin:o,elWidth:i,initialX:l,screenRight:r-n,containerRect:c,disableSwapping:u};switch(t){case"left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=e.disableSwapping,a=Qt(e),i="left";if(a>=t)return{actualX:i,left:a};var l=tr(e);return o||l+n>r?a=t:(a=l,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=Zt(e),i="inner-left";if(a+n<=r)return{actualX:i,left:a};var l=er(e);return o||l<t?a=t:(a=l,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=er(e),i="inner-right";if(a>=r)return{actualX:i,left:a};var l=Zt(e);return o||l+n>t?a=t-n:(a=l,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=tr(e),i="right";if(a+n<=t)return{actualX:i,left:a};var l=Qt(e);return o||l<r?a=t-n:(a=l,i="left"),{actualX:i,left:a}}(f);default:throw new Error("This should never happen")}}function lr(e){var t=e.y,r=e.vh,n=e.vhMargin,o=e.yMargin,a=e.elHeight,i=e.initialY,l=e.containerRect,c=e.disableSwapping,u=e.preventOverlap,f=e.disableVHBounds;if(!f&&!u&&a>r-2*n)return{top:n,bottom:n,actualY:"center"};var s={vhMargin:n,yMargin:o,elHeight:a,initialY:i,containerRect:l,screenBottom:r-n,preventOverlap:u,disableSwapping:c,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,l=e.disableSwapping,c=e.disableVHBounds,u=rr(e),f="above";if(c)return{actualY:f,top:Math.max(0,u)};if(u>r)return{actualY:f,top:u};var s,p=ar(e);return l||p+o>n?u=r:(f="below",u=p),i&&"above"===f&&u+o>a.top&&(s=window.innerHeight-a.top+t),{actualY:f,top:u,bottom:s}}(s);case"top":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,i=nr(e),l="top";if(a||i+n<=r)return{actualY:l,top:i};var c=or(e);return o||c<t?i=t:(l="bottom",i=c),{actualY:l,top:i}}(s);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),i="center";return o?{actualY:i,top:Math.max(0,a)}:((a=Math.max(t,a))+n>r&&(a=r-n),{actualY:i,top:a})}(s);case"bottom":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,i=or(e),l="bottom";if(a||i>t)return{actualY:l,top:i};var c=nr(e);return o||c+n>r?i=r-n:(l="top",i=c),{actualY:l,top:i}}(s);case"below":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.elHeight,o=e.screenBottom,a=e.containerRect,i=e.preventOverlap,l=e.disableSwapping,c=e.disableVHBounds,u=ar(e),f="below";if(c||u+n<=o)return{actualY:f,top:u};if(i){var s=a.top-t;return l||s<o-u?{actualY:f,top:u,bottom:r}:{actualY:"above",top:Math.max(r,s-n),bottom:Yt("height")-s}}var p=rr(e);return l||p<r?u=o-n:(f="above",u=p),{actualY:f,top:u}}(s);default:throw new Error("This should never happen")}}function cr(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 ur(e){var t=e.container,r=e.element,n=e.anchor,o=void 0===n?{}:n,a=e.initialX,i=e.initialY,l=e.vwMargin,c=void 0===l?16:l,u=e.vhMargin,f=void 0===u?16:u,s=e.xMargin,p=void 0===s?0:s,d=e.yMargin,y=void 0===d?0:d,h=e.width,v=void 0===h?"auto":h,m=e.preventOverlap,b=void 0!==m&&m,O=e.transformOrigin,g=void 0!==O&&O,w=e.disableSwapping,j=void 0!==w&&w,E=e.disableVHBounds,P=void 0!==E&&E;t=Xt(t);var I={x:o.x||"center",y:o.y||"below"};if(!t||!r)return{actualX:I.x,actualY:I.y};var R=t.getBoundingClientRect(),x=Yt("height"),F=Yt("width"),C=$t(r),_=C.height,S=C.width;P&&(r.closest("[role='dialog']")||(i=(null!=i?i:0)+window.scrollY));var N=ir({x:I.x,vw:F,vwMargin:c,xMargin:p,width:v,elWidth:S,initialX:a,containerRect:R,disableSwapping:j}),k=N.left,T=N.right,A=N.width,M=N.minWidth,L=N.actualX,D=lr({y:I.y,vh:x,vhMargin:f,yMargin:y,initialY:i,elHeight:_,containerRect:R,disableSwapping:j,preventOverlap:b,disableVHBounds:P}),B=D.top,K=D.bottom,H=D.actualY;return{actualX:L,actualY:H,style:{left:k,top:B,right:T,bottom:K,width:A,minWidth:M,position:P?"absolute":"fixed",transformOrigin:g?cr({x:L,y:H}):void 0}}}var fr={x:"center",y:"above"},sr={x:"inner-left",y:"top"},pr={x:"inner-right",y:"top"},dr={x:"right",y:"top"},yr={x:"left",y:"center"},hr={x:"center",y:"center"},vr={x:"right",y:"center"},mr={x:"center",y:"below"},br={x:"inner-right",y:"below"};function Or(e,t){if(t=Xt(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 gr(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 wr(e,t,r,n){void 0===n&&(n=!0);var o=gr(e,t,r+1,t.length);-1===o&&(o=gr(e,t,0,r+(n?1:0)));return o}function jr(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 Er(e,t){switch(void 0===t&&(t="value"),typeof e){case"string":return e;case"number":return Number.isNaN(e)?"":""+e;case"function":return Er(e(),t);case"object":return e?Er(e[t],t):"";default:return""}}var Pr=Er,Ir="value",Rr={getItemValue:Pr,valueKey:Ir,trim:true,ignoreWhitespace:false};function xr(e,t,r){void 0===r&&(r={});var n=P(r,Rr),o=n.getItemValue,a=n.valueKey,i=n.trim,l=n.ignoreWhitespace,c=n.startsWith,u=void 0!==c&&c;return(e=jr(e,!0,i,l))&&t.length?t.filter((function(t){var r=jr(o(t,a),!0,i,l);return u?0===r.indexOf(e):-1!==r.indexOf(e)})):t}function Fr(e){return new RegExp((""+e).split("").join("\\w*").replace(/(\(|\||\)|\\(?!w\*)|\[|\|-|\.|\^|\+|\$|\?|^(?!w)\*)/g,"\\$1").replace(/\*\*/g,"*\\*"),"i")}function Cr(e,t,r){void 0===r&&(r={});var n=P(r,Rr),o=n.getItemValue,a=n.valueKey,i=n.trim,l=n.ignoreWhitespace;if(e=jr(e,!1,i,l),!t.length||!e)return t;var c=Fr(e);return t.filter((function(e){var t=jr(o(e,a),!1,i,l);return t.length&&t.match(c)}))}function _r(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 Sr(e){var r=e.items,n=e.onChange,o=e.onKeyDown,a=e.resetTime,i=void 0===a?500:a,l=e.searchIndex,c=e.valueKey,u=void 0===c?Ir:c,f=e.getItemValue,s=void 0===f?Pr:f,p=e.findMatchIndex,d=void 0===p?wr:p,y=_r("",i),h=y[0],v=y[1],m=t.useMemo((function(){return r.map((function(e){return s(e,u)}))}),[r,s,u]);return t.useCallback((function(e){o&&o(e);var t=e.key,a=e.altKey,i=e.ctrlKey,c=e.metaKey;if(!(a||i||c||t.length>1||!h.current&&" "===t)){var u=t;h.current!==t&&(u=""+h.current+t),v(u);var f=d(u,m,l,!0);if(f!==l&&-1!==f){var s={index:f,item:r[f],items:r,query:u,target:e.currentTarget};n(s)}}}),[l,d,r,n,o,v,h,m])}var Nr=function(){return(Nr=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 kr(e){var r=e.children,n=e.onChange,o=e.phoneMaxWidth,i=void 0===o?se:o,l=e.tabletMinWidth,c=void 0===l?ue:l,u=e.tabletMaxWidth,f=void 0===u?fe:u,s=e.desktopMinWidth,p=void 0===s?ce:s,d=e.desktopLargeMinWidth,y=void 0===d?pe:d,h=e.defaultSize,v=void 0===h?be:h,m=Oe({phoneMaxWidth:i,tabletMaxWidth:f,tabletMinWidth:c,desktopMinWidth:p,desktopLargeMinWidth:y,defaultSize:v}),b=t.useRef(m);t.useEffect((function(){!n||v.isPhone===m.isPhone&&v.isTablet===m.isTablet&&v.isDesktop===m.isDesktop&&v.isLargeDesktop===m.isLargeDesktop&&v.isLandscape===m.isLandscape||n(m,v)}),[]),t.useEffect((function(){b.current!==m&&(n&&n(m,b.current),b.current=m)}));var O=t.useMemo((function(){return Nr(Nr({},m),{__initialized:!0})}),[m]);return a.default.createElement(je.Provider,{value:O},r)}function Tr(e){var r=e.onResize,n=e.options,o=e.immediate,a=e.enabled,i=void 0===a||a,l=K(r);t.useEffect((function(){if(i){var e=L("resize",window,!0,n),t=function(e){return l.current(e)};return e.add(t),o&&"undefined"!=typeof window&&window.dispatchEvent(new UIEvent("resize")),function(){e.remove(t)}}}),[n,i])}function Ar(e,t){void 0===t&&(t={});var r=t.fontSizeFallback,n=void 0===r?16:r,o=t.element;if("number"==typeof e)return e;var a=parseFloat(e);if(/px$/.test(e))return a;if("undefined"==typeof document)return a*n;var i=/rem$/.test(e),l=document.documentElement;return!i&&o&&(l=o.parentElement||o),a*parseFloat(window.getComputedStyle(l).fontSize||n+"px")}function Mr(e){return e?void 0!==e.current?e.current:e:null}function Lr(e){var r=e.enabled,n=e.element,o=e.onOutsideClick;t.useEffect((function(){if(r)return window.addEventListener("click",e),function(){window.removeEventListener("click",e)};function e(e){var t=e.target,r=Mr(n);j(r,t)||o(r,t,j)}}),[r,n,o])}function Dr(e){var r=t.useState(e),n=r[0],o=r[1],a=K(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 Br(e,r,n){void 0===n&&(n=!1);var o=K(e),a=K(r),i=t.useRef(),l=Dr(n),c=l[0],u=l[1],f=l[2],s=t.useCallback((function(){window.clearTimeout(i.current),i.current=void 0}),[]),p=t.useCallback((function(){s(),i.current=window.setTimeout((function(){o.current(),f()}),a.current)}),[]),d=t.useCallback((function(){s(),f()}),[]);return t.useEffect((function(){if(c)return i.current=window.setTimeout((function(){o.current(),f()}),r),function(){s()}}),[c,r,f]),[u,d,p]}var Kr=function(e){return e.replace(/\s/g,"")};function Hr(e,t){if(void 0===t&&(t=".rmd-icon--font"),"string"==typeof e)return Kr(e);if(t&&Array.from(e.querySelectorAll(t)).some((function(e){return!!e.textContent}))){var r=e.cloneNode(!0),n=void 0;do{(n=r.querySelector(t))&&n.parentNode&&n.parentNode.removeChild(n)}while(n);return Kr(r.textContent||"")}return Kr(e.textContent||"")}var Vr=["BUTTON","TEXTAREA","SELECT"].reduce((function(e,t){return e+","+t+":not([disabled])"}),'a[href],area[href],input:not([disabled]):not([type="hidden"])')+",[tabindex]",Wr=Vr+':not([tabindex="-1"])';function zr(e,t){return void 0===t&&(t=!1),Array.from(e.querySelectorAll(t?Vr:Wr))}function Ur(e,t){return void 0===t&&(t="programmatic"),"matches"in e&&e.matches("programmatic"===t?Vr:Wr)}function qr(e,t,r,n,o){var a;switch(void 0===r&&(r=!1),void 0===n&&(n=!1),o&&o.length||(o=zr(e,r)),t){case"first":a=o[0];break;case"last":a=o[o.length-1];break;default:a=e.querySelector(t)}if(!a&&Ur(e,"programmatic")&&(a=e),!a)throw new Error("Unable to find a focusable element");a.focus({preventScroll:n}),n||e===document||Or(e,a)}function Gr(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}),qr(t,r,o,n))}));return function(){window.cancelAnimationFrame(t)}}}),[r,a,e,o,n])}function Xr(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 l=t;if(document.contains(l)||(l=n&&document.contains(n)?n:null),!l&&i)switch(typeof i){case"string":l=document.querySelector(i);break;case"function":l=i();break;default:l=i}l&&!document.contains(l)&&(l=null),l&&l.focus()}else a.focus()}}}),[])}var Yr,Jr,$r=function(){return($r=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)},Qr=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},Zr=t.forwardRef((function(e,r){var n=e.children,o=e.onKeyDown,i=e.component,l=void 0===i?"div":i,c=e.defaultFocus,u=void 0===c?"first":c,f=e.disableFocusCache,s=void 0!==f&&f,p=e.disableFocusOnMount,d=void 0!==p&&p,y=e.disableFocusOnMountScroll,h=void 0!==y&&y,v=e.disableFocusOnUnmount,m=void 0!==v&&v,b=e.disableTabFocusWrap,O=void 0!==b&&b,g=e.unmountFocusFallback,w=void 0===g?"":g,j=Qr(e,["children","onKeyDown","component","defaultFocus","disableFocusCache","disableFocusOnMount","disableFocusOnMountScroll","disableFocusOnUnmount","disableTabFocusWrap","unmountFocusFallback"]),E=Pt(r),P=E[0],I=E[1];Xr(m,w),Gr(P,u,h,!1,d);var R=function(e){var r=e.disabled,n=void 0!==r&&r,o=e.disableFocusCache,a=void 0!==o&&o,i=e.onKeyDown,l=t.useRef([]),c=t.useCallback((function(e){if(i&&i(e),"Tab"===e.key){!a&&l.current.length||(l.current=zr(e.currentTarget));var t=l.current,r=t.length;0!==r&&(1===r?(e.preventDefault(),t[0].focus()):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:c}({disabled:O,disableFocusCache:s,onKeyDown:o});return a.default.createElement(l,$r({},j,{onKeyDown:R,ref:I}),n)}));e.IncrementMovementKey=void 0,(Yr=e.IncrementMovementKey||(e.IncrementMovementKey={})).ArrowUp="ArrowUp",Yr.ArrowDown="ArrowDown",Yr.ArrowLeft="ArrowLeft",Yr.ArrowRight="ArrowRight",Yr.PageDown="PageDown",Yr.PageUp="PageUp",Yr.ShiftArrowUp="Shift+ArrowUp",Yr.ShiftArrowDown="Shift+ArrowDown",Yr.ShiftArrowLeft="Shift+ArrowLeft",Yr.ShiftArrowRight="Shift+ArrowRight",Yr.AltArrowDown="Alt+ArrowDown",Yr.AltArrowUp="Alt+ArrowUp",Yr.AltArrowLeft="Alt+ArrowLeft",Yr.AltArrowRight="Alt+ArrowRight",Yr.AltPageDown="Alt+PageDown",Yr.AltPageUp="Alt+PageUp",Yr.ControlArrowDown="Control+ArrowDown",Yr.ControlArrowUp="Control+ArrowUp",e.JumpMovementKey=void 0,(Jr=e.JumpMovementKey||(e.JumpMovementKey={})).Home="Home",Jr.End="End",Jr.AltHome="Alt+Home",Jr.AltEnd="Alt+End",Jr.ControlHome="Control+Home",Jr.ControlEnd="Control+End",Jr.ControlShiftHome="Control+Shift+Home",Jr.ControlShiftEnd="Control+Shift+End";var en=function(){return(en=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)},tn={loopable:!0,searchable:!0,incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovem