react-md
Version:
This is the full react-md library bundled together for convenience.
14 lines • 1.22 MB
JavaScript
!function(r,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((r="undefined"!=typeof globalThis?globalThis:r||self).ReactMD={},r.React,r.ReactDOM,r.crypto)}(this,(function(r,t,e,n){"use strict";function o(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var a,i,c,s=o(t),l=o(n),f={exports:{}},p={};function u(){if(c)return p;c=1,function(){if(i)return a;i=1;var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function n(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}a=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(r){return t[r]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(r){n[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}()?Object.assign:function(o,a){for(var i,c,s=n(o),l=1;l<arguments.length;l++){for(var f in i=Object(arguments[l]))t.call(i,f)&&(s[f]=i[f]);if(r){c=r(i);for(var p=0;p<c.length;p++)e.call(i,c[p])&&(s[c[p]]=i[c[p]])}}return s}}
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/();var r=s.default,t=60103;if(p.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var e=Symbol.for;t=e("react.element"),p.Fragment=e("react.fragment")}var n=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function f(r,e,a){var i,c={},s=null,f=null;for(i in void 0!==a&&(s=""+a),void 0!==e.key&&(s=""+e.key),void 0!==e.ref&&(f=e.ref),e)o.call(e,i)&&!l.hasOwnProperty(i)&&(c[i]=e[i]);if(r&&r.defaultProps)for(i in e=r.defaultProps)void 0===c[i]&&(c[i]=e[i]);return{$$typeof:t,type:r,key:s,ref:f,props:c,_owner:n.current}}return p.jsx=f,p.jsxs=f,p}!function(r){r.exports=u()}(f);var h={exports:{}};
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(r){!function(){var t={}.hasOwnProperty;function e(){for(var r=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var a=typeof o;if("string"===a||"number"===a)r.push(o);else if(Array.isArray(o)){if(o.length){var i=e.apply(null,o);i&&r.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var c in o)t.call(o,c)&&o[c]&&r.push(c);else r.push(o.toString())}}return r.join(" ")}r.exports?(e.default=e,r.exports=e):window.classNames=e}()}(h);var v=h.exports;var d=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};function y(r){var n=r.into,o=r.intoId,a=r.children,i=d(t.useState(null),2),c=i[0],s=i[1];return t.useEffect((function(){var r=function(r,t){if("undefined"==typeof document)return null;var e=null;return void 0===r&&void 0===t?e=document.body:"string"==typeof t?e=document.getElementById(t):"string"==typeof r?e=document.querySelector(r):"function"==typeof r?e=r():r&&(e=r),e}(n,o);c!==r&&s(r)}),[n,o,c]),c?e.createPortal(a,c):null}var O=function(){return O=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},O.apply(this,arguments)};function x(r){var t=r.portal,e=r.portalInto,n=r.portalIntoId,o=r.children;return t||e||n?f.exports.jsx(y,O({into:e,intoId:n},{children:o})):f.exports.jsx(f.exports.Fragment,{children:o})}function j(r,t){t&&("function"==typeof t?t(r):"object"==typeof t&&(t.current=r))}function b(r,t){if(!t)return r;var e=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(n,o){return e.call(t,o)&&t[o]&&(n="".concat(n," ").concat(r,"--").concat(o)),n}),r)}function g(r){return function(t,e){return t?"string"!=typeof t?b(r,t):b("".concat(r,"__").concat(t),e):r}}var m=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,w=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function z(r){r=r.replace(m,(function(r,t,e,n){return"".concat(t).concat(t).concat(e).concat(e).concat(n).concat(n)}));var t=r.match(w)||[];return[parseInt(t[1]||"",16)||0,parseInt(t[2]||"",16)||0,parseInt(t[3]||"",16)||0]}var P=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};function R(r){return(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}function M(r){var t=P(z(r),3),e=t[0],n=t[1],o=t[2];return.2126*R(e)+.7152*R(n)+.0722*R(o)}function H(r,t){var e=M(r)+.05,n=M(t)+.05;return Math.max(e,n)/Math.min(e,n)}var I=function(r){return function(r){return!!r&&void 0!==r.current}(r)?r.current:r};function V(r,t){return r=I(r),t=I(t),!!(r&&t&&r.contains(t))}var C=function(){return C=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},C.apply(this,arguments)};function S(r,t){return Object.keys(t).reduce((function(r,e){return void 0===r[e]&&(r[e]=t[e]),r}),C({},r))}var L=function(){return L=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},L.apply(this,arguments)},F=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},_=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i},E=t.createContext({root:!0,dir:"ltr",toggleDir:function(){throw new Error("Tried to toggle the current writing direction without initializing the `Dir` component.")}}),N=E.Provider;function T(){var r=t.useContext(E);return r.root,F(r,["root"])}var A=function(){var r="ltr";"undefined"!=typeof document&&(r="rtl"===document.documentElement.getAttribute("dir")?"rtl":"ltr");return r};function k(r){var e=r.children,n=r.defaultDir,o=void 0===n?A:n,a=t.useContext(E).root,i=_(t.useState(o),2),c=i[0],s=i[1];t.useEffect((function(){if(a&&"undefined"!=typeof document)return document.documentElement.setAttribute("dir",c),function(){document.documentElement.removeAttribute("dir")}}),[c,a]);var l=t.useCallback((function(){s((function(r){return"ltr"===r?"rtl":"ltr"}))}),[]),p=t.useMemo((function(){return{root:!1,dir:c,toggleDir:l}}),[c,l]),u=t.Children.only(e);return a||(u=t.cloneElement(u,{dir:c})),f.exports.jsx(N,L({value:p},{children:u}))}function D(r){var e=t.useRef(r);return t.useEffect((function(){e.current=r})),e}var B=[];function K(r,t,e,n){void 0===t&&(t=window),void 0===e&&(e=!1);var o=[],a=function(r,t){var e=!1,n=function(r){return function(){for(var n=0;n<t.length;n+=1)t[n](r);e=!1}};return function(t){r?e||(e=!0,window.requestAnimationFrame(n(t))):n(t)()}}(e,o);return{add:function(e){o.length||t.addEventListener(r,a,n),-1===o.indexOf(e)&&o.push(e)},remove:function(e){var i=o.indexOf(e);i>=0&&(o.splice(i,1),o.length||t.removeEventListener(r,a,n))}}}function W(r,t,e,n){void 0===t&&(t=window),void 0===e&&(e="resize"===r||"scroll"===r);var o=B.findIndex((function(o){return o.type===r&&o.target===t&&o.options===n&&o.throttle===e}));return-1===o&&(B.push({type:r,target:t,options:n,throttle:e,handler:K(r,t,e,n)}),o=B.length-1),B[o].handler}function U(r){var e=r.once,n=r.passive,o=void 0===n||n,a=r.signal,i=r.capture,c=r.enabled,s=void 0===c||c,l=D(r.onScroll);t.useEffect((function(){if(s){var r=W("scroll",window,!0,{once:e,passive:o,signal:a,capture:i}),t=l.current;return r.add(t),function(){r.remove(t)}}}),[i,s,e,o,l,a])}function G(r){var t=r.min,e=r.max,n=r.value,o=r.validate;if(void 0===o||o){if(t>=e)throw new RangeError("A range must have the min value less than the max value");if(n>e||n<t)throw new RangeError("A value must be between the min and max values")}var a=(n-t)/(e-t);return Math.max(0,Math.min(Math.abs(a),1))}var q=1e3;function Y(r){var e=t.useRef(r);return t.useEffect((function(){e.current=r})),t.useEffect((function(){return function(){return e.current()}}),[])}var X=function(){},J=t.createContext({visibleInTime:q,enableHoverMode:X,disableHoverMode:X,startDisableTimer:X}),Q=J.Provider;function Z(){return t.useContext(J)}var $=function(){return $=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},$.apply(this,arguments)},rr=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};function tr(r){var e=r.children,n=r.disabled,o=void 0!==n&&n,a=r.defaultVisibleInTime,i=void 0===a?q:a,c=r.deactivateTime,s=void 0===c?1e3:c,l=rr(t.useState(i),2),p=l[0],u=l[1],h=t.useRef(),v=t.useCallback((function(){o||(window.clearTimeout(h.current),u(0))}),[o]),d=t.useCallback((function(){window.clearTimeout(h.current),u(i)}),[i]),y=t.useCallback((function(){window.clearTimeout(h.current),h.current=window.setTimeout((function(){u(i)}),s)}),[i,s]);t.useEffect((function(){o&&(window.clearTimeout(h.current),u(i))}),[o,i]),Y((function(){window.clearTimeout(h.current)}));var O=t.useMemo((function(){return{visibleInTime:p,enableHoverMode:v,disableHoverMode:d,startDisableTimer:y}}),[d,v,y,p]);return f.exports.jsx(Q,$({value:O},{children:e}))}var er="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,nr=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};var or=function(){return or=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},or.apply(this,arguments)},ar=t.createContext("mouse"),ir=t.createContext(!1),cr=ar.Provider,sr=ir.Provider;function lr(){return t.useContext(ar)}function fr(r){return lr()===r}function pr(r){var e=r.children,n=function(){var r=nr(t.useState("mouse"),2),e=r[0],n=r[1],o=t.useRef(0),a=t.useRef(!1);return er((function(){var r=function(){return n("mouse")},t=function(){return n("keyboard")},i=function(){o.current=Date.now(),a.current=!1,n("touch")},c=function(){a.current||Date.now()-o.current<1200?a.current=!1:r()},s=function(){a.current=!0},l="rmd-utils--".concat(e);return document.body.classList.add(l),window.addEventListener("touchstart",i,!0),"mouse"===e?window.addEventListener("keydown",t,!0):"keyboard"===e?window.addEventListener("mousedown",r,!0):(window.addEventListener("mousemove",c,!0),window.addEventListener("contextmenu",s,!0)),function(){document.body.classList.remove(l),window.removeEventListener("touchstart",i,!0),"mouse"===e?window.removeEventListener("keydown",t,!0):"keyboard"===e?window.removeEventListener("mousedown",r,!0):(window.removeEventListener("mousemove",c,!0),window.removeEventListener("contextmenu",s,!0))}}),[e]),e}();if(t.useContext(ir))throw new Error("Mounted multiple `UserInteractionModeListener` components.");return f.exports.jsx(cr,or({value:n},{children:f.exports.jsx(sr,or({value:!0},{children:e}))}))}var ur=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};function hr(r){var e=void 0===r?{}:r,n=e.disabled,o=void 0!==n&&n,a=e.defaultVisible,i=void 0!==a&&a,c=e.exitVisibilityDelay,s=void 0===c?300:c,l="touch"===lr(),f=ur(t.useState(i),2),p=f[0],u=f[1],h=ur(t.useState(!1),2),v=h[0],d=h[1],y=t.useRef(),O=Z(),x=O.visibleInTime,j=O.enableHoverMode,b=O.disableHoverMode,g=O.startDisableTimer,m=0===x;t.useEffect((function(){p||d(!1)}),[p]),Y((function(){window.clearTimeout(y.current)}));var w=t.useCallback((function(){window.clearTimeout(y.current)}),[]),z=t.useCallback((function(r){if(!(v||o||l||r.isPropagationStopped())){if(w(),0===x)return j(),void u(!0);y.current=window.setTimeout((function(){j(),u(!0)}),x)}}),[w,o,j,l,v,x]),P=t.useCallback((function(r){v||o||l||r.isPropagationStopped()||(g(),w(),0!==s?y.current=window.setTimeout((function(){u(!1)}),s):u(!1))}),[w,o,s,l,g,v]),R=t.useCallback((function(r){r.isPropagationStopped()||(v||o?(d(!1),u((function(r){return!r}))):(d(!0),u(!0)))}),[o,v]);return{active:m,stuck:v,visible:p,setVisible:u,onClick:R,onMouseEnter:z,onMouseLeave:P,enableHoverMode:j,disableHoverMode:b,startDisableTimer:g,clearHoverTimeout:w,handlers:{onClick:R,onMouseEnter:z,onMouseLeave:P},hoverHandlers:{onMouseEnter:z,onMouseLeave:P}}}var vr=t.createContext({activeId:"",setActiveId:function(){throw new Error("ActiveDescendantMovementProvider must be a parent component.")}});vr.displayName="ActiveDescendant";var dr=vr.Provider;function yr(){return t.useContext(vr)}var Or=function(){return Or=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},Or.apply(this,arguments)};var xr=function(){},jr={incrementKeys:["ArrowDown"],decrementKeys:["ArrowUp"],jumpToFirstKeys:["Home"],jumpToLastKeys:["End"]},br={incrementKeys:["ArrowRight"],decrementKeys:["ArrowLeft"],jumpToFirstKeys:["Home"],jumpToLastKeys:["End"]},gr={incrementKeys:["ArrowLeft"],decrementKeys:["ArrowRight"],jumpToFirstKeys:["Home"],jumpToLastKeys:["End"]},mr=t.createContext({attach:xr,detach:xr,watching:{current:[]},loopable:!1,searchable:!1,horizontal:!1,includeDisabled:!1,config:{current:jr}});mr.displayName="KeyboardMovement";var wr=mr.Provider;function zr(){return t.useContext(mr)}function Pr(r){var t=r.value,e=r.min,n=void 0===e?0:e,o=r.max,a=r.increment,i=r.minmax,c=t+(a?1:-1);return void 0!==i&&i?c=Math.min(o,Math.max(n,c)):c>o?c=n:c<n&&(c=o),c}var Rr=function(r){r.focus()},Mr=function(r,t){return!r||!t&&(null!==r.getAttribute("disabled")||"true"===r.getAttribute("aria-disabled"))},Hr=function(r,t){if(!r.length)return-1;for(var e=0;e<r.length-1&&Mr(r[e].element,t);)e+=1;return Mr(r[e].element,t)?-1:e},Ir=function(r,t){if(!r.length)return-1;for(var e=r.length-1;e>0&&Mr(r[e].element,t);)e-=1;return Mr(r[e].element,t)?-1:e},Vr=function(r){for(var t=r.loopable,e=r.watching,n=r.increment,o=r.includeDisabled,a=r.currentFocusIndex,i=Hr(e,o),c=Ir(e,o),s=Pr({min:i,max:c,value:a,minmax:!t,increment:n});Mr(e[s].element,o)&&(t||s!==(n?c:i));)s=Pr({min:i,max:c,value:s,minmax:!t,increment:n});return s};function Cr(r,t){if(!t)return"";var e=r.cloneNode(!0);return e.querySelectorAll(".rmd-icon--font,[aria-hidden=true],[hidden]").forEach((function(r){var t;null===(t=r.parentNode)||void 0===t||t.removeChild(r)})),(e.textContent||"").substring(0,1).toUpperCase()}var Sr=function(){return Sr=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},Sr.apply(this,arguments)};function Lr(r){var e,n=r.children,o=r.loopable,a=void 0!==o&&o,i=r.searchable,c=void 0!==i&&i,s=r.horizontal,l=void 0!==s&&s,p=r.includeDisabled,u=void 0!==p&&p,h=r.incrementKeys,v=r.decrementKeys,d=r.jumpToFirstKeys,y=r.jumpToLastKeys,O="rtl"===T().dir;e=l?O?gr:br:jr;var x=h||e.incrementKeys,j=v||e.decrementKeys,b=d||e.jumpToFirstKeys,g=y||e.jumpToLastKeys,m=t.useRef([]),w={incrementKeys:x,decrementKeys:j,jumpToFirstKeys:b,jumpToLastKeys:g},z=t.useRef(w);z.current=w;var P=t.useMemo((function(){return{attach:function(r){m.current.push({element:r,content:Cr(r,c)})},detach:function(r){m.current=m.current.filter((function(t){return t.element!==r}))},watching:m,config:z,loopable:a,searchable:c,horizontal:l,includeDisabled:u}}),[l,u,a,c]);return f.exports.jsx(wr,Sr({value:P},{children:n}))}function Fr(r){var e=zr(),n=e.attach,o=e.detach,a=t.useRef(null);return t.useCallback((function(t){j(t,r),t?n(t):a.current&&o(a.current),a.current=t}),[n,o,r])}function _r(r,t,e,n){r=r.toUpperCase();for(var o=e;o<n;o+=1){if(0===t[o].toUpperCase().indexOf(r))return o}return-1}function Er(r,t,e,n){void 0===n&&(n=!0);var o=_r(r,t,e+1,t.length);-1===o&&(o=_r(r,t,0,e+(n?1:0)));return o}var Nr=function(){};function Tr(r){void 0===r&&(r={});var e=r.onFocus,n=void 0===e?Nr:e,o=r.onKeyDown,a=void 0===o?Nr:o,i=r.onSearch,c=void 0===i?Nr:i,s=r.onIncrement,l=void 0===s?Nr:s,f=r.onDecrement,p=void 0===f?Nr:f,u=r.onJumpToFirst,h=void 0===u?Nr:u,v=r.onJumpToLast,d=void 0===v?Nr:v,y=r.onFocusChange,O=void 0===y?Rr:y,x=r.getDefaultFocusIndex,j=lr(),b=t.useRef(-1),g=zr(),m=g.config,w=g.loopable,z=g.searchable,P=g.watching,R=g.includeDisabled;return{focusIndex:b,onFocus:function(r){var t;if(n(r),!r.isPropagationStopped())if(r.target===r.currentTarget){var e;if(e=x?x(P.current.map((function(r){return r.element})),r.currentTarget):Hr(P.current,R),-1!==e&&"keyboard"===j){b.current=e;var o=null===(t=P.current[b.current])||void 0===t?void 0:t.element;o&&O(o,b.current)}}else{var a=P.current.findIndex((function(t){return t.element===r.target}));-1!==a&&(b.current=a)}},onKeyDown:function(r){if(a(r),!r.isPropagationStopped()){var t=r.key,e=r.altKey,n=r.ctrlKey,o=r.metaKey,i=r.shiftKey,s=m.current,f=s.incrementKeys,u=s.decrementKeys,v=s.jumpToFirstKeys,y=s.jumpToLastKeys,x=function(t){var e;if(r.preventDefault(),r.stopPropagation(),b.current!==t){b.current=t;var n=null===(e=P.current[t])||void 0===e?void 0:e.element;n&&O(n,b.current)}};if(!z||1!==t.length||" "===t||e||n||o||i){if(v.includes(t)){if(h({key:t,event:r}),r.isPropagationStopped())return;x(Hr(P.current,R))}else if(y.includes(t)){if(d({key:t,event:r}),r.isPropagationStopped())return;x(Ir(P.current,R))}else if(f.includes(t)){if(l({key:t,event:r}),r.isPropagationStopped())return;x(Vr({loopable:w,watching:P.current,increment:!0,includeDisabled:R,currentFocusIndex:b.current}))}else if(u.includes(t)){if(p({key:t,event:r}),r.isPropagationStopped())return;x(Vr({loopable:w,watching:P.current,increment:!1,includeDisabled:R,currentFocusIndex:b.current}))}}else{if(c({key:t,event:r}),r.isPropagationStopped())return;var j=P.current.map((function(r){var t=r.content,e=r.element;return Mr(e,R)?"":t}));x(Er(t,j,b.current))}}}}}var Ar=function(){return Ar=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},Ar.apply(this,arguments)},kr=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},Dr=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};var Br="".concat(64.0625,"em"),Kr="".concat(48,"em"),Wr="".concat(64,"em"),Ur="".concat(767/16,"em"),Gr="".concat(80,"em"),qr=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i},Yr=function(){var r,t=null===(r=window.screen.orientation)||void 0===r?void 0:r.type;if("string"==typeof t)return t;var e=window.screen;return e.availHeight>e.availWidth?"portrait-primary":"landscape-primary"};function Xr(r){var e=qr(t.useState((function(){return r||("undefined"!=typeof window?Yr():"landscape-primary")})),2),n=e[0],o=e[1];return t.useEffect((function(){if("undefined"!=typeof window){var r=function(){o(Yr())};return window.addEventListener("orientationchange",r),function(){return window.removeEventListener("orientationchange",r)}}}),[]),n}var Jr=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};function Qr(r,e,n,o){void 0===n&&(n=!1),void 0===o&&(o="undefined"!=typeof window);var a=Jr(t.useState((function(){return void 0!==e?e:!(n||!o||"undefined"==typeof window)&&window.matchMedia(r).matches})),2),i=a[0],c=a[1];return t.useEffect((function(){if("undefined"!=typeof window&&!n){var t=window.matchMedia(r),e=function(r){var t=r.matches;return c(t)};return t.addEventListener("change",e),t.matches!==i&&c(t.matches),function(){t.removeEventListener("change",e)}}}),[n,i,r]),i}var Zr=function(r,t){var e=typeof r;if("undefined"===e)return"";var n="number"===e?"".concat(r,"px"):r;return"(".concat(t,"-width: ").concat(n,")")};function $r(r){var e=r.min,n=r.max;return Qr(t.useMemo((function(){var r=[Zr(e,"min"),Zr(n,"max")].filter(Boolean).join(" and ");return"screen and ".concat(r)}),[e,n]))}var rt=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i},tt={isPhone:!1,isTablet:!1,isDesktop:!0,isLargeDesktop:!1,isLandscape:!0};function et(r){var e=void 0===r?{}:r,n=e.phoneMaxWidth,o=void 0===n?Ur:n,a=e.tabletMinWidth,i=void 0===a?Kr:a,c=e.tabletMaxWidth,s=void 0===c?Wr:c,l=e.desktopMinWidth,f=void 0===l?Br:l,p=e.desktopLargeMinWidth,u=void 0===p?Gr:p,h=e.defaultSize,v=void 0===h?tt:h;if("undefined"==typeof window)return v;var d=$r({min:f}),y=$r({min:u}),O=$r({min:i,max:s}),x=$r({max:o}),j=d,b=!d&&O,g=!b&&!j&&x,m=Xr().includes("landscape"),w=y,z=rt(t.useState(v),2),P=z[0],R=z[1];return t.useEffect((function(){P.isPhone===g&&P.isTablet===b&&P.isDesktop===j&&P.isLargeDesktop===w&&P.isLandscape===m||(g||b||j||w)&&R({isPhone:g,isTablet:b,isDesktop:j,isLargeDesktop:w,isLandscape:m})}),[g,b,j,w,m,P]),P}var nt=function(){return nt=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},nt.apply(this,arguments)},ot=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},at=t.createContext(nt(nt({},tt),{__initialized:!1}));function it(){var r=t.useContext(at),e=r.__initialized,n=ot(r,["__initialized"]);if(!e)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 ct,st=function(){return st=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},st.apply(this,arguments)},lt=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},ft=g("rmd-grid"),pt=t.forwardRef((function(r,e){var n,o,a,i,c,s,l,p=r.style,u=r.className,h=r.clone,d=r.children,y=r.colSpan,O=r.colStart,x=r.colEnd,j=r.rowSpan,b=r.rowStart,g=r.rowEnd,m=r.phone,w=r.tablet,z=r.desktop,P=r.largeDesktop,R=lt(r,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),M=it(),H=M.isPhone,I=M.isTablet,V=M.isDesktop,C=M.isLargeDesktop,S=y,L=O,F=x,_=j,E=b,N=g,T=H&&m||I&&w||C&&P||V&&z;T&&(_=void 0===(n=T.rowSpan)?j:n,E=void 0===(o=T.rowStart)?b:o,N=void 0===(a=T.rowEnd)?g:a,S=void 0===(i=T.colSpan)?y:i,L=void 0===(c=T.colStart)?O:c,F=void 0===(s=T.colEnd)?x:s);var A=st({gridColumnStart:L,gridColumnEnd:F,gridRowStart:E,gridRowEnd:_?"span ".concat(_):N},p),k=v(ft("cell",((l={})["".concat(S)]=S,l)),u);if(h&&t.isValidElement(d)){var D=t.Children.only(d);return t.cloneElement(D,{style:st(st({},D.props.style),A),className:v(k,D.props.className)})}return f.exports.jsx("div",st({},R,{ref:e,style:A,className:k},{children:d}))})),ut=function(){return ut=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},ut.apply(this,arguments)},ht=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},vt="--rmd-grid-cols",dt="--rmd-grid-gutter",yt=g("rmd-grid"),Ot=t.forwardRef((function(r,e){var n,o=r.style,a=r.className,i=r.children,c=r.clone,s=void 0!==c&&c,l=r.cloneStyles,p=void 0!==l&&l,u=r.wrapOnly,h=void 0!==u&&u,d=r.columns,y=r.phoneColumns,O=r.tabletColumns,x=r.desktopColumns,j=r.largeDesktopColumns,b=r.padding,g=r.gutter,m=r.minCellWidth,w=ht(r,["style","className","children","clone","cloneStyles","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),z=it(),P=z.isPhone,R=z.isTablet,M=z.isDesktop,H=z.isLargeDesktop,I=ut(ut({padding:0!==b&&b||void 0,gridTemplateColumns:m?"repeat(auto-fill, minmax(".concat(m,", 1fr))"):void 0},o),((n={})[vt]=P&&y||R&&O||H&&j||M&&x||d,n[dt]=g,n)),V=v(yt({"no-padding":0===b}),a);if(p&&t.isValidElement(i)){var C=t.Children.only(i);return t.cloneElement(C,{style:ut(ut({},I),C.props.style),className:v(V,C.props.className)})}var S=i;return(s||h)&&(S=t.Children.map(i,(function(r){return r&&f.exports.jsx(pt,ut({clone:s},{children:r}))}))),f.exports.jsx("div",ut({},w,{ref:e,style:I,className:V},{children:S}))})),xt=function(){return xt=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},xt.apply(this,arguments)},jt=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},bt=g("rmd-grid-list"),gt=t.forwardRef((function(r,e){var n=r.className,o=r.children,a=r.square,i=void 0!==a&&a,c=r.clone,s=void 0!==c&&c,l=jt(r,["className","children","square","clone"]),p=v(bt("cell",{square:i}),n);if(s&&t.isValidElement(o)){var u=t.Children.only(o);return t.cloneElement(u,{className:v(p,u.props.className)})}return f.exports.jsx("div",xt({},l,{ref:e,className:p},{children:o}))})),mt=[],wt="ResizeObserver loop completed with undelivered notifications.";!function(r){r.BORDER_BOX="border-box",r.CONTENT_BOX="content-box",r.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(ct||(ct={}));var zt,Pt=function(r){return Object.freeze(r)},Rt=function(r,t){this.inlineSize=r,this.blockSize=t,Pt(this)},Mt=function(){function r(r,t,e,n){return this.x=r,this.y=t,this.width=e,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Pt(this)}return r.prototype.toJSON=function(){var r=this;return{x:r.x,y:r.y,top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}},r.fromRect=function(t){return new r(t.x,t.y,t.width,t.height)},r}(),Ht=function(r){return r instanceof SVGElement&&"getBBox"in r},It=function(r){if(Ht(r)){var t=r.getBBox(),e=t.width,n=t.height;return!e&&!n}var o=r,a=o.offsetWidth,i=o.offsetHeight;return!(a||i||r.getClientRects().length)},Vt=function(r){var t,e;if(r instanceof Element)return!0;var n=null===(e=null===(t=r)||void 0===t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(n&&r instanceof n.Element)},Ct="undefined"!=typeof window?window:{},St=new WeakMap,Lt=/auto|scroll/,Ft=/^tb|vertical/,_t=/msie|trident/i.test(Ct.navigator&&Ct.navigator.userAgent),Et=function(r){return parseFloat(r||"0")},Nt=function(r,t,e){return void 0===r&&(r=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Rt((e?t:r)||0,(e?r:t)||0)},Tt=Pt({devicePixelContentBoxSize:Nt(),borderBoxSize:Nt(),contentBoxSize:Nt(),contentRect:new Mt(0,0,0,0)}),At=function(r,t){if(void 0===t&&(t=!1),St.has(r)&&!t)return St.get(r);if(It(r))return St.set(r,Tt),Tt;var e=getComputedStyle(r),n=Ht(r)&&r.ownerSVGElement&&r.getBBox(),o=!_t&&"border-box"===e.boxSizing,a=Ft.test(e.writingMode||""),i=!n&&Lt.test(e.overflowY||""),c=!n&&Lt.test(e.overflowX||""),s=n?0:Et(e.paddingTop),l=n?0:Et(e.paddingRight),f=n?0:Et(e.paddingBottom),p=n?0:Et(e.paddingLeft),u=n?0:Et(e.borderTopWidth),h=n?0:Et(e.borderRightWidth),v=n?0:Et(e.borderBottomWidth),d=p+l,y=s+f,O=(n?0:Et(e.borderLeftWidth))+h,x=u+v,j=c?r.offsetHeight-x-r.clientHeight:0,b=i?r.offsetWidth-O-r.clientWidth:0,g=o?d+O:0,m=o?y+x:0,w=n?n.width:Et(e.width)-g-b,z=n?n.height:Et(e.height)-m-j,P=w+d+b+O,R=z+y+j+x,M=Pt({devicePixelContentBoxSize:Nt(Math.round(w*devicePixelRatio),Math.round(z*devicePixelRatio),a),borderBoxSize:Nt(P,R,a),contentBoxSize:Nt(w,z,a),contentRect:new Mt(p,s,w,z)});return St.set(r,M),M},kt=function(r,t,e){var n=At(r,e),o=n.borderBoxSize,a=n.contentBoxSize,i=n.devicePixelContentBoxSize;switch(t){case ct.DEVICE_PIXEL_CONTENT_BOX:return i;case ct.BORDER_BOX:return o;default:return a}},Dt=function(r){var t=At(r);this.target=r,this.contentRect=t.contentRect,this.borderBoxSize=Pt([t.borderBoxSize]),this.contentBoxSize=Pt([t.contentBoxSize]),this.devicePixelContentBoxSize=Pt([t.devicePixelContentBoxSize])},Bt=function(r){if(It(r))return 1/0;for(var t=0,e=r.parentNode;e;)t+=1,e=e.parentNode;return t},Kt=function(){var r=1/0,t=[];mt.forEach((function(e){if(0!==e.activeTargets.length){var n=[];e.activeTargets.forEach((function(t){var e=new Dt(t.target),o=Bt(t.target);n.push(e),t.lastReportedSize=kt(t.target,t.observedBox),o<r&&(r=o)})),t.push((function(){e.callback.call(e.observer,n,e.observer)})),e.activeTargets.splice(0,e.activeTargets.length)}}));for(var e=0,n=t;e<n.length;e++){(0,n[e])()}return r},Wt=function(r){mt.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(e){e.isActive()&&(Bt(e.target)>r?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},Ut=function(){var r,t=0;for(Wt(t);mt.some((function(r){return r.activeTargets.length>0}));)t=Kt(),Wt(t);return mt.some((function(r){return r.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?r=new ErrorEvent("error",{message:wt}):((r=document.createEvent("Event")).initEvent("error",!1,!1),r.message=wt),window.dispatchEvent(r)),t>0},Gt=[],qt=function(r){if(!zt){var t=0,e=document.createTextNode("");new MutationObserver((function(){return Gt.splice(0).forEach((function(r){return r()}))})).observe(e,{characterData:!0}),zt=function(){e.textContent=""+(t?t--:t++)}}Gt.push(r),zt()},Yt=0,Xt={attributes:!0,characterData:!0,childList:!0,subtree:!0},Jt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Qt=function(r){return void 0===r&&(r=0),Date.now()+r},Zt=!1,$t=new(function(){function r(){var r=this;this.stopped=!0,this.listener=function(){return r.schedule()}}return r.prototype.run=function(r){var t=this;if(void 0===r&&(r=250),!Zt){Zt=!0;var e,n=Qt(r);e=function(){var e=!1;try{e=Ut()}finally{if(Zt=!1,r=n-Qt(),!Yt)return;e?t.run(1e3):r>0?t.run(r):t.start()}},qt((function(){requestAnimationFrame(e)}))}},r.prototype.schedule=function(){this.stop(),this.run()},r.prototype.observe=function(){var r=this,t=function(){return r.observer&&r.observer.observe(document.body,Xt)};document.body?t():Ct.addEventListener("DOMContentLoaded",t)},r.prototype.start=function(){var r=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Jt.forEach((function(t){return Ct.addEventListener(t,r.listener,!0)})))},r.prototype.stop=function(){var r=this;this.stopped||(this.observer&&this.observer.disconnect(),Jt.forEach((function(t){return Ct.removeEventListener(t,r.listener,!0)})),this.stopped=!0)},r}()),re=function(r){!Yt&&r>0&&$t.start(),!(Yt+=r)&&$t.stop()},te=function(){function r(r,t){this.target=r,this.observedBox=t||ct.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return r.prototype.isActive=function(){var r,t=kt(this.target,this.observedBox,!0);return r=this.target,Ht(r)||function(r){switch(r.tagName){case"INPUT":if("image"!==r.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(r)||"inline"!==getComputedStyle(r).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},r}(),ee=function(r,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=r,this.callback=t},ne=new WeakMap,oe=function(r,t){for(var e=0;e<r.length;e+=1)if(r[e].target===t)return e;return-1},ae=function(){function r(){}return r.connect=function(r,t){var e=new ee(r,t);ne.set(r,e)},r.observe=function(r,t,e){var n=ne.get(r),o=0===n.observationTargets.length;oe(n.observationTargets,t)<0&&(o&&mt.push(n),n.observationTargets.push(new te(t,e&&e.box)),re(1),$t.schedule())},r.unobserve=function(r,t){var e=ne.get(r),n=oe(e.observationTargets,t),o=1===e.observationTargets.length;n>=0&&(o&&mt.splice(mt.indexOf(e),1),e.observationTargets.splice(n,1),re(-1))},r.disconnect=function(r){var t=this,e=ne.get(r);e.observationTargets.slice().forEach((function(e){return t.unobserve(r,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},r}(),ie=function(){function r(r){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof r)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ae.connect(this,r)}return r.prototype.observe=function(r,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Vt(r))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ae.observe(this,r,t)},r.prototype.unobserve=function(r){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Vt(r))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ae.unobserve(this,r)},r.prototype.disconnect=function(){ae.disconnect(this)},r.toString=function(){return"function ResizeObserver () { [polyfill code] }"},r}();function ce(r){var e=t.useRef(null),n=t.useCallback((function(t){j(t,r),e.current=t}),[r]);return[e,n]}var se,le=function(){return le=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},le.apply(this,arguments)},fe=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i};function pe(r,t){return!r||r.height!==t.height||r.scrollHeight!==t.scrollHeight}function ue(r,t){return!r||r.width!==t.width||r.scrollWidth!==t.scrollWidth}var he=[];function ve(r,t){void 0===t&&(t={});var e=t.ref,n=t.disableWidth,o=void 0!==n&&n,a=t.disableHeight,i=void 0!==a&&a,c=fe(ce(e),2),s=c[0],l=c[1];return er((function(){var t=s.current;if(!(i&&o||!t))return se||"undefined"==typeof document||(se=new ie((function(r){for(var t=function(t){var e=r[t],n=he.filter((function(r){return r.target===e.target}));if(!n.length)return{value:void 0};for(var o=e.contentRect,a=o.height,i=o.width,c=e.target,s={height:a,width:i,scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth},l=0;l<n.length;l+=1){var f=n[l],p=f.handler,u=f.prevSize,h=f.disableHeight,v=f.disableWidth,d=pe(u,s),y=ue(u,s);(d&&!h||y&&!v)&&(f.prevSize=s,p(le(le({},s),{element:e.target})))}},e=0;e<r.length;e+=1){var n=t(e);if("object"==typeof n)return n.value}}))),function(r,t,e,n){var o=he.find((function(t){return t.target===r}));he.push({target:r,handler:t,disableWidth:n,disableHeight:e,prevSize:void 0}),o||null==se||se.observe(r)}(t,r,i,o),function(){!function(r,t,e,n){var o=he.findIndex((function(o){return o.target===r&&o.handler===t&&o.disableWidth===n&&o.disableHeight===e}));-1!==o&&he.splice(o,1),he.some((function(t){return t.target===r}))||null==se||se.unobserve(r)}(t,r,i,o)}}),[i,o,r]),[s,l]}var de={height:void 0,width:void 0};function ye(r,t){if(void 0===r&&(r="width"),void 0===t&&(t=!1),"undefined"==typeof window)return-1;var e=de[r];if(!t&&"number"==typeof e)return e;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"===r?"offsetWidth":"offsetHeight";return e=n[a]-o[a],de[r]=e,document.body.removeChild(n),e}var Oe=function(){return Oe=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},Oe.apply(this,arguments)},xe=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i},je="--rmd-cell-size",be="--rmd-cell-margin",ge=t.createContext({columns:-1,cellWidth:-1}),me=ge.Provider;function we(r){var e,n=void 0===r?{}:r,o=n.ref,a=n.style,i=n.className,c=n.cellMargin,s=n.defaultSize,l=n.maxCellSize,f=void 0===l?150:l,p=n.disableHeight,u=void 0!==p&&p,h=n.disableWidth,d=void 0!==h&&h,y=n.containerPadding,O=void 0===y?16:y,x=xe(ce(o),2),j=x[0],b=x[1],g=xe(t.useState(s||{columns:-1,cellWidth:f}),2),m=g[0],w=g[1],z=t.useCallback((function(){var r=j.current;if(r){var t=r.getBoundingClientRect().width;t-=O,r.offsetHeight<r.scrollHeight&&(t-=ye("width"));var e=Math.ceil(t/f);w({cellWidth:t/e,columns:e})}}),[O,f,j]),P=xe(ve(z,{ref:b,disableHeight:u,disableWidth:d}),2)[1],R=Oe(Oe({},a),((e={})[je]="".concat(m.cellWidth,"px"),e));return c&&(R[be]=c),[{ref:P,style:R,className:v("rmd-grid-list",i)},m]}var ze=function(){return ze=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},ze.apply(this,arguments)},Pe=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},Re=function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,a=e.call(r),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=a.return)&&e.call(a)}finally{if(o)throw o.error}}return i},Me=t.forwardRef((function(r,e){var n=r.style,o=r.className,a=r.children,i=r.clone,c=void 0!==i&&i,s=r.wrapOnly,l=void 0!==s&&s,p=r.cellMargin,u=r.defaultSize,h=r.maxCellSize,v=void 0===h?150:h,d=r.containerPadding,y=void 0===d?16:d,O=r.disableHeightObserver,x=void 0!==O&&O,j=r.disableWidthObserver,b=void 0!==j&&j,g=Pe(r,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),m=Re(we({ref:e,style:n,className:o,cellMargin:p,defaultSize:u,maxCellSize:v,containerPadding:y,disableHeight:x,disableWidth:b}),2),w=m[0],z=m[1],P=null;return P=function(r){return"function"==typeof r}(a)?a(z):c||l?t.Children.map(a,(function(r){return r&&f.exports.jsx(gt,ze({clone:c},{children:r}))})):a,f.exports.jsx(me,ze({value:z},{children:f.exports.jsx("div",ze({},g,w,{children:P}))}))}));function He(r,t,e,n,o){void 0===o&&(o=e-t);var a=Math.round((r-t)*n/o)/n,i=Math.min(Math.max(a,0),1),c=o/n,s=Number.isInteger(c)?o%n:c.toString().split(".")[1].length;return Math.min(e,Math.max(t,parseFloat((i*o+t).toFixed(s))))}function Ie(r,t){if(!t.length)return r;var e={};for(var n in r)t.includes(n)||(e[n]=r[n]);return e}function Ve(r){if(!r)return null;if(/(tree|list)item/.test(r.getAttribute("role")||"")){if(e=r.querySelector(".rmd-tree-item__content, .rmd-item-text"))return e}else if("file"===r.getAttribute("type")){var t=document.querySelector('[for="'.concat(r.id,'"]'));if(t)return t}var e,n=r.getAttribute("data-sizing-selector");if(n&&(e=r.querySelector(n)))return e;return r}function Ce(r){var t=document.documentElement||{clientHeight:0,clientWidth:0};return"width"===r?window.innerWidth||t.clientWidth:window.innerHeight||t.clientHeight}function Se(r){return"number"==typeof r?"".concat(r,"px"):""}function Le(r,t){void 0===t&&(t={});var e=r.cloneNode(!0);e.removeAttribute("id"),e.removeAttribute("role"),e.style.position="fixed",e.style.visibility="hidden",e.style.left=Se(t.left),e.style.top=Se(t.top),e.style.right=Se(t.right),e.style.bottom=Se(t.bottom),e.style.webkitTransform="none",e.style.transform="none";var n=r.parentElement||document.body;n.appendChild(e);var o=e.getBoundingClientRect();return n.removeChild(e),o}var Fe={x:"center",y:"above"},_e={x:"inner-left",y:"top"},Ee={x:"inner-right",y:"top"},Ne={x:"right",y:"top"},Te={x:"left",y:"center"},Ae={x:"right",y:"center"},ke={x:"inner-left",y:"bottom"},De={x:"inner-right",y:"bottom"},Be={x:"inner-left",y:"below"},Ke={x:"center",y:"below"};function We(r){var t=r.xMargin,e=r.elWidth,n=r.initialX,o=r.containerRect;return(null!=n?n:o.left)-e-t}function Ue(r){var t=r.xMargin,e=r.initialX,n=r.containerRect;return(null!=e?e:n.left)+t}function Ge(r){var t=r.xMargin,e=r.elWidth,n=r.initialX,o=r.containerRect;return(null!=n?n:o.left+o.width)-e-t}function qe(r){var t=r.xMargin,e=r.initialX,n=r.containerRect;return(null!=e?e:n.left+n.width)+t}function Ye(r){var t=r.yMargin,e=r.initialY,n=r.elHeight,o=r.containerRect;return(null!=e?e:o.top)-n-t}function Xe(r){var t=r.yMargin,e=r.initialY,n=r.containerRect;return(null!=e?e:n.top)+t}function Je(r){var t=r.yMargin,e=r.initialY,n=r.elHeight,o=r.containerRect;return(null!=e?e:o.top+o.height)-n-t}function Qe(r){var t=r.yMargin,e=r.initialY,n=r.containerRect;return(null!=e?e:n.top+n.height)+t}function Ze(r){var t=r.x,e=r.vw,n=r.vwMargin,o=r.xMargin,a=r.width,i=r.elWidth,c=r.initialX,s=r.containerRect,l=r.disableSwapping,f=e-n;if("min"===a||"equal"===a)return function(r){var t,e,n=r.x,o=r.elWidth,a=r.xMargin,i=r.vwMargin,c=r.initialX,s=r.containerRect,l=r.screenRight,f=r.isMinWidth,p=null!=c?c:s.left+a,u=s.width-2*a;if(f){t=u,o>u&&(p-=(o-u)/2,t=o),u=void 0;var h=p+o;h>l&&(p-=h-l,e=i),p=Math.max(i,p)}return{left:p,right:e,width:u,minWidth:t,actualX:n}}({x:t,vwMargin:n,xMargin:o,elWidth:i,initialX:c,containerRect:s,screenRight:f,isMinWidth:"min"===a});if(i>e-2*n)return{left:n,right:n,actualX:t};var p={vwMargin:n,xMargin:o,elWidth:i,initialX:c,screenRight:f,containerRect:s,disableSwapping:l};switch(t){case"left":return function(r){var t=r.vwMargin,e=r.screenRight,n=r.elWidth,o=r.disableSwapping,a=We(r),i="left";if(a>=t)return{actualX:i,left:a};var c=qe(r);return o||c+n>e?a=t:(a=c,i="right"),{actualX:i,left:a}}(p);case"inner-left":return function(r){var t=r.vwMargin,e=r.screenRight,n=r.elWidth,o=r.disableSwapping,a=Ue(r),i="inner-left";if(a+n<=e&&a>=t)return{actualX:i,left:a};if(o)return{actualX:i,left:a=a+n>e?e-n:t};var c=Ge(r);return c<t?a=t:c+n>e?(a=e-n,i="inner-right"):(a=c,i="inner-right"),{actualX:i,left:a}}(p);case"center":return function(r){var t=r.vwMargin,e=r.screenRight,n=r.elWidth,o=function(r){var t=r.elWidth,e=r.initialX,n=r.containerRect,o=n.width/2,a=t/2;return(null!=e?e:n.left+o)-a}(r);return o<t?o=t:(o+n>e||o<t)&&(o=e-n),{actualX:"center",left:o}}(p);case"inner-right":return function(r){var t=r.screenRight,e=r.vwMargin,n=r.elWidth,o=r.disableSwapping,a=Ge(r),i="inner-right";if(a>=e)return{actualX:i,left:Math.min(a,t-n)};var c=Ue(r);return o||c+n>t?a=e:(a=Math.max(c,e),i="inner-left"),{actualX:i,left:a}}(p);case"right":return function(r){var t=r.screenRight,e=r.vwMargin,n=r.elWidth,o=r.disableSwapping,a=qe(r),i="right";if(a+n<=t)return{actualX:i,left:a};var c=We(r);return o||c<e?a=t-n:(a=c,i="left"),{actualX:i,left:a}}(p)}}function $e(r){var t=r.y,e=r.vh,n=r.vhMargin,o=r.yMargin,a=r.elHeight,i=r.initialY,c=r.containerRect,s=r.disableSwapping,l=r.preventOverlap,f=r.disableVHBounds;if(!f&&!l&&a>e-2*n)return{top:n,bottom:n,actualY:"center",transformOriginY:c.top};var p={vhMargin:n,yMargin:o,elHeight:a,initialY:i,containerRect:c,screenBottom:e-n,preventOverlap:l,disableSwapping:s,disableVHBounds:f};switch(t){case"above":return function(r){var t=r.yMargin,e=r.vhMargin,n=r.screenBottom,o=r.elHeight,a=r.containerRect,i=r.preventOverlap,c=r.disableSwapping,s=r.disableVHBounds,l=Ye(r),f="above";if(s)return{actualY:f,top:Math.max(0,l)};if(l>e)return{actualY:f,top:l};var p,u=Qe(r);return c||u+o>n?l=Math.min(l,e):(f="below",l=u),i&&"above"===f&&l+o>a.top&&(p=n-a.top+t),{actualY:f,top:l,bottom:p}}(p);case"top":return function(r){var t=r.vhMargin,e=r.screenBottom,n=r.elHeight,o=r.disableSwapping,a=r.disableVHBounds,i=Xe(r),c="top";if(a||i+n<=e)return{actualY:c,top:i};var s=Je(r);return o||s<t?i=Math.max(i,t):(c="bottom",i=s),{actualY:c,top:i}}(p);case"center":return function(r){var t=r.vhMargin,e=r.screenBottom,n=r.elHeight,o=r.disableVHBounds,a=function(r){var t=r.yMargin,e=r.elHeight,n=r.initialY,o=r.containerRect,a=o.height/2,i=e/2;return(null!=n?n:o.top+a+t)-i}(r),i="center";return o?{actualY:i,top:Math.max(0,a)}:((a=Math.max(t,a))+n>e&&(a=e-n),{actualY:i,top:a})}(p);case"bottom":return function(r){var t=r.vhMargin,e=r.screenBottom,n=r.elHeight,o=r.disableSwapping,a=r.disableVHBounds,i=Je(r),c="bottom";if(a||i>t)return{actualY:c,top:i};var s=Xe(r);return o||s+n>e?i=Math.min(i,e-n):(c="top",i=s),{actualY:c,top:i}}(p);case"below":return function(r){var t=r.yMargin,e=r.vhMargin,n=r.elHeight,o=r.screenBottom,a=r.containerRect,i=r.preventOverlap,c=r.disableSwapping,s=r.disableVHBounds,l=Qe(r),f="below";if(s||l+n<=o)return{actualY:f,top:l};if(i){var p=a.top-t;return c||p<o-l?{actualY:f,top:l,bottom:e}:{actualY:"above",top:Math.max(e,p-n),bottom:window.innerHeight-p}}var u=Ye(r);return c||u<e?l=Math.min(l,o-n):(f="above",l=u),{actualY:f,top:l}}(p)}}function rn(r){var t=r.transformOriginY,e="0";switch(r.x){case"right":case"inner-left":default:e="0";break;case"center":e="50%";break;case"left":case"inner-right":e="100%"}var n="0";if("number"==typeof t)n="".concat(t,"px");else switch(r.y){case"above":case"bottom":n="100%";break;case"center":n="50%";break;default:n="0"}return"".concat(e," ").concat(n)}var tn={x:0,y:0,height:0,width:0,left:0,right:0,top:0,bottom:0,toJSON:function(){}};function en(r){var t,e=r.element,n=r.anchor,o=void 0===n?Ke:n,a=r.initialX,i=r.vwMargin,c=void 0===i?16:i,s=r.vhMargin,l=void 0===s?16:s,f=r.xMargin,p=void 0===f?0:f,u=r.yMargin,h=void 0===u?0:u,v=r.width,d=void 0===v?"auto":v,y=r.preventOverlap,O=void 0!==y&&y,x=r.transformOrigin,j=void 0!==x&&x,b=r.disableSwapping,g=void 0!==b&&b,m=r.disableVHBounds,w=void 0!==m&&m,z=r.initialY,P=Ve(r.container);if(!e)return{actualX:o.x,actualY:o.y,style:{left:a,top:z,position:w?"absolute":"fixed",transformOrigin:j?rn({x:o.x,y:o.y}):void 0}};var R=null!==(t=null==P?void 0:P.getBoundingClientRect())&&void 0!==t?t:tn,M=window.innerHeight,H=window.innerWidth,I=e.style.minWidth;"min"===d&&(e.style.overflow="visible",e.style.minWidth="");var V=Le(e),C=V.height,S=V.width;("min"===d&&(S+=ye(),e.style.overflow="",e.style.minWidth=I),w)&&