UNPKG

react-md

Version:

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

7 lines 897 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 a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=a(t),c=a(r),l=a(n),i={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 a=arguments[n];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)){if(a.length){var c=r.apply(null,a);c&&e.push(c)}}else if("object"===o)if(a.toString===Object.prototype.toString)for(var l in a)t.call(a,l)&&a[l]&&e.push(l);else e.push(a.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r}()}(i);var u=i.exports;function f(e){var n=e.into,a=e.intoId,o=e.children,c=t.useState(null),l=c[0],i=c[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,a);l!==e&&i(e)}),[n,a,l]),l?r.createPortal(o,l):null}function s(e){var t=e.portal,r=e.portalInto,n=e.portalIntoId,a=e.children;return t||r||n?o.default.createElement(f,{into:r,intoId:n},a):a}function d(e,t){t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e))}function p(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(n,a){return r.call(t,a)&&t[a]&&(n=n+" "+e+"--"+a),n}),e)}function h(e){return function(t,r){return t?"string"!=typeof t?p(e,t):p(e+"__"+t,r):e}}var v=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,m=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function y(e){var t=(e=e.replace(v,(function(e,t,r,n){return""+t+t+r+r+n+n}))).match(m)||[];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=y(e),r=t[0],n=t[1],a=t[2];return.2126*b(r)+.7152*b(n)+.0722*b(a)}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 E(e,t){return e=w(e),t=w(t),!!(e&&t&&e.contains(t))}var z=function(){return(z=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function j(e,t){return Object.keys(t).reduce((function(e,r){return void 0===e[r]&&(e[r]=t[r]),e}),z({},e))}var V=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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},S=t.createContext({root:!0,dir:"ltr",toggleDir:function(){throw new Error("Tried to toggle the current writing direction without initializing the `Dir` component.")}}),M=S.Provider;function P(){var e=t.useContext(S);return e.root,V(e,["root"])}var H=function(){var e="ltr";"undefined"!=typeof document&&(e="rtl"===document.documentElement.getAttribute("dir")?"rtl":"ltr");return e};function I(e){var r=e.children,n=e.defaultDir,a=void 0===n?H:n,c=t.useContext(S).root,l=t.useState(a),i=l[0],u=l[1];t.useEffect((function(){if(c&&"undefined"!=typeof document)return document.documentElement.setAttribute("dir",i),function(){document.documentElement.removeAttribute("dir")}}),[i,c]);var f=t.useCallback((function(){u((function(e){return"ltr"===e?"rtl":"ltr"}))}),[]),s=t.useMemo((function(){return{root:!1,dir:i,toggleDir:f}}),[i,f]),d=t.Children.only(r);return c||(d=t.cloneElement(d,{dir:i})),o.default.createElement(M,{value:s},d)}var C=function(){},R=!1;function x(){if("undefined"==typeof window)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return window.addEventListener("testSupportsPassive",C,t),window.removeEventListener("testSupportsPassive",C,t),R=e,e}x();var L=Object.freeze({__proto__:null,update:x,get isSupported(){return R}}),N=[];function G(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r=!1);var a=[],o=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,a);return{add:function(r){a.length||t.addEventListener(e,o,n),-1===a.indexOf(r)&&a.push(r)},remove:function(r){var c=a.indexOf(r);c>=0&&(a.splice(c,1),a.length||t.removeEventListener(e,o,n))}}}function T(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r="resize"===e||"scroll"===e);var a=N.findIndex((function(a){return a.type===e&&a.target===t&&a.options===n&&a.throttle===r}));return-1===a&&(N.push({type:e,target:t,options:n,throttle:r,handler:G(e,t,r,n)}),a=N.length-1),N[a].handler}var A=function(){return(A=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function k(e,t,r,n,a,o){void 0===a&&(a=!1),t[(e?"add":"remove")+"EventListener"]("touch"+r,n,R?A({passive:!0,capture:a},o):a)}function D(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e})),r}function F(e){var r=e.enabled,n=void 0===r||r,a=e.onScroll,o=e.element,c=e.options,l=void 0===c?!!R&&{passive:!0}:c,i=D(a);t.useEffect((function(){if(n){var e=T("scroll",o||window,!0,l),t=function(e){return i.current(e)};return e.add(t),function(){e.remove(t)}}}),[n,o,l])}function B(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 _=1e3;function K(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e})),t.useEffect((function(){return function(){return r.current()}}),[])}var W=function(){},U=t.createContext({visibleInTime:_,enableHoverMode:W,disableHoverMode:W,startDisableTimer:W}),q=U.Provider;function X(){return t.useContext(U)}function Y(e){var r=e.children,n=e.disabled,a=void 0!==n&&n,c=e.defaultVisibleInTime,l=void 0===c?_:c,i=e.deactivateTime,u=void 0===i?1e3:i,f=t.useState(l),s=f[0],d=f[1],p=t.useRef(),h=t.useCallback((function(){a||(window.clearTimeout(p.current),d(0))}),[a]),v=t.useCallback((function(){window.clearTimeout(p.current),d(l)}),[l]),m=t.useCallback((function(){window.clearTimeout(p.current),p.current=window.setTimeout((function(){d(l)}),u)}),[l,u]);t.useEffect((function(){a&&(window.clearTimeout(p.current),d(l))}),[a,l]),K((function(){window.clearTimeout(p.current)}));var y=t.useMemo((function(){return{visibleInTime:s,enableHoverMode:h,disableHoverMode:v,startDisableTimer:m}}),[v,h,m,s]);return o.default.createElement(q,{value:y},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],a=t.useRef(0),o=t.useRef(!1);return J((function(){var e=function(){return n("mouse")},t=function(){return n("keyboard")},c=function(){a.current=Date.now(),o.current=!1,n("touch")},l=function(){o.current||Date.now()-a.current<1200?o.current=!1:e()},i=function(){o.current=!0},u="rmd-utils--"+r;return document.body.classList.add(u),window.addEventListener("touchstart",c,!0),"mouse"===r?window.addEventListener("keydown",t,!0):"keyboard"===r?window.addEventListener("mousedown",e,!0):(window.addEventListener("mousemove",l,!0),window.addEventListener("contextmenu",i,!0)),function(){document.body.classList.remove(u),window.removeEventListener("touchstart",c,!0),"mouse"===r?window.removeEventListener("keydown",t,!0):"keyboard"===r?window.removeEventListener("mousedown",e,!0):(window.removeEventListener("mousemove",l,!0),window.removeEventListener("contextmenu",i,!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 ae(e){var r=e.children,n=$();if(t.useContext(Z))throw new Error("Mounted multiple `UserInteractionModeListener` components.");return o.default.createElement(ee,{value:n},o.default.createElement(te,{value:!0},r))}var oe=ae,ce=function(){return(ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function le(e){var r=void 0===e?{}:e,n=r.disabled,a=void 0!==n&&n,o=r.sticky,c=void 0!==o&&o,l=r.onClick,i=r.onMouseEnter,u=r.onMouseLeave,f=r.defaultVisible,s=void 0!==f&&f,d=r.exitVisibilityDelay,p=void 0===d?c?300:0:d,h=re(),v="touch"===h,m=t.useState(s),y=m[0],b=m[1],O=t.useState(!1),g=O[0],w=O[1],E=t.useRef(),z=t.useRef(s),j=X(),V=j.visibleInTime,S=j.enableHoverMode,M=j.disableHoverMode,P=j.startDisableTimer,H=0===V;t.useEffect((function(){c&&!y&&w(!1)}),[y,c]),K((function(){window.clearTimeout(E.current)})),t.useEffect((function(){if(!a){var e=function(){b(!1),M(),window.clearTimeout(E.current)};return z.current||e(),z.current=!1,window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}}),[M,h,a]);var I,C=t.useCallback((function(e){if(null==i||i(e),!(g||a||v||e.isPropagationStopped())){if(window.clearTimeout(E.current),0===V)return S(),void b(!0);E.current=window.setTimeout((function(){S(),b(!0)}),V)}}),[a,S,v,i,g,V]),R=t.useCallback((function(e){null==u||u(e),g||a||v||e.isPropagationStopped()||(P(),window.clearTimeout(E.current),0!==p?E.current=window.setTimeout((function(){b(!1)}),p):b(!1))}),[a,p,v,u,P,g]),x=t.useCallback((function(e){null==l||l(e),e.isPropagationStopped()||a||(P(),window.clearTimeout(E.current))}),[a,l,P]),L=t.useCallback((function(e){null==l||l(e),e.isPropagationStopped()||a||(g?(w(!1),b((function(e){return!e}))):(w(!0),b(!0),M()))}),[M,a,l,g]),N={onClick:x,onMouseEnter:C,onMouseLeave:R};return c&&(I=ce(ce({},N),{onClick:L})),{active:H,stuck:c?g:void 0,visible:y,setVisible:b,handlers:N,stickyHandlers:I,enableHoverMode:S,disableHoverMode:M,startDisableTimer:P}}var ie="64.0625em",ue="48em",fe="64em",se="47.9375em",de="80em",pe=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 he(e){var r=t.useState((function(){return e||("undefined"!=typeof window?pe():"landscape-primary")})),n=r[0],a=r[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=function(){a(pe())};return window.addEventListener("orientationchange",e),function(){return window.removeEventListener("orientationchange",e)}}}),[]),n}function ve(e,r,n,a){void 0===n&&(n=!1),void 0===a&&(a="undefined"!=typeof window);var o=t.useState((function(){return void 0!==r?r:!(n||!a||"undefined"==typeof window)&&window.matchMedia(e).matches})),c=o[0],l=o[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!==c&&l(t.matches),function(){t.removeEventListener("change",r)}}}),[n,c,e]),c}var me=function(e,t){var r=typeof e;return"undefined"===r?"":"("+t+"-width: "+("number"===r?e+"px":e)+")"};function ye(e){var r=e.min,n=e.max;return ve(t.useMemo((function(){return"screen and "+[me(r,"min"),me(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,a=void 0===n?se:n,o=r.tabletMinWidth,c=void 0===o?ue:o,l=r.tabletMaxWidth,i=void 0===l?fe:l,u=r.desktopMinWidth,f=void 0===u?ie:u,s=r.desktopLargeMinWidth,d=void 0===s?de:s,p=r.defaultSize,h=void 0===p?be:p;if("undefined"==typeof window)return h;var v=ye({min:f}),m=ye({min:d}),y=ye({min:c,max:i}),b=ye({max:a}),O=v,g=!v&&y,w=!g&&!O&&b,E=he().includes("landscape"),z=m,j=t.useState(h),V=j[0],S=j[1];return t.useEffect((function(){V.isPhone===w&&V.isTablet===g&&V.isDesktop===O&&V.isLargeDesktop===z&&V.isLandscape===E||(w||g||O||z)&&S({isPhone:w,isTablet:g,isDesktop:O,isLargeDesktop:z,isLandscape:E})}),[w,g,O,z,E,V]),V}var ge=function(){return(ge=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Ee=t.createContext(ge(ge({},be),{__initialized:!1}));function ze(){var e=t.useContext(Ee),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 je,Ve=function(){return(Ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Se=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Me=h("rmd-grid"),Pe=t.forwardRef((function(e,r){var n,a,c,l,i,f,s,d=e.style,p=e.className,h=e.clone,v=e.children,m=e.colSpan,y=e.colStart,b=e.colEnd,O=e.rowSpan,g=e.rowStart,w=e.rowEnd,E=e.phone,z=e.tablet,j=e.desktop,V=e.largeDesktop,S=Se(e,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),M=ze(),P=M.isPhone,H=M.isTablet,I=M.isDesktop,C=M.isLargeDesktop,R=m,x=y,L=b,N=O,G=g,T=w,A=P&&E||H&&z||C&&V||I&&j;A&&(N=void 0===(n=A.rowSpan)?O:n,G=void 0===(a=A.rowStart)?g:a,T=void 0===(c=A.rowEnd)?w:c,R=void 0===(l=A.colSpan)?m:l,x=void 0===(i=A.colStart)?y:i,L=void 0===(f=A.colEnd)?b:f);var k=Ve({gridColumnStart:x,gridColumnEnd:L,gridRowStart:G,gridRowEnd:N?"span "+N:T},d),D=u(Me("cell",((s={})[""+R]=R,s)),p);if(h&&t.isValidElement(v)){var F=t.Children.only(v);return t.cloneElement(F,{style:Ve(Ve({},F.props.style),k),className:u(D,F.props.className)})}return o.default.createElement("div",Ve({},S,{ref:r,style:k,className:D}),v)})),He=function(){return(He=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Ie=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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Ce="--rmd-grid-cols",Re="--rmd-grid-gutter",xe=h("rmd-grid"),Le=t.forwardRef((function(e,r){var n,a=e.style,c=e.className,l=e.children,i=e.clone,f=void 0!==i&&i,s=e.cloneStyles,d=void 0!==s&&s,p=e.wrapOnly,h=void 0!==p&&p,v=e.columns,m=e.phoneColumns,y=e.tabletColumns,b=e.desktopColumns,O=e.largeDesktopColumns,g=e.padding,w=e.gutter,E=e.minCellWidth,z=Ie(e,["style","className","children","clone","cloneStyles","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),j=ze(),V=j.isPhone,S=j.isTablet,M=j.isDesktop,P=j.isLargeDesktop,H=He(He({padding:0!==g&&g||void 0,gridTemplateColumns:E?"repeat(auto-fill, minmax("+E+", 1fr))":void 0},a),((n={})[Ce]=V&&m||S&&y||P&&O||M&&b||v,n[Re]=w,n)),I=u(xe({"no-padding":0===g}),c);if(d&&t.isValidElement(l)){var C=t.Children.only(l);return t.cloneElement(C,{style:He(He({},H),C.props.style),className:u(I,C.props.className)})}var R=l;return(f||h)&&(R=t.Children.map(l,(function(e){return e&&o.default.createElement(Pe,{clone:f},e)}))),o.default.createElement("div",He({},z,{ref:r,style:H,className:I}),R)})),Ne=function(){return(Ne=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Ge=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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Te=h("rmd-grid-list"),Ae=t.forwardRef((function(e,r){var n=e.className,a=e.children,c=e.square,l=void 0!==c&&c,i=e.clone,f=void 0!==i&&i,s=Ge(e,["className","children","square","clone"]),d=u(Te("cell",{square:l}),n);if(f&&t.isValidElement(a)){var p=t.Children.only(a);return t.cloneElement(p,{className:u(d,p.props.className)})}return o.default.createElement("div",Ne({},s,{ref:r,className:d}),a)})),ke=[],De="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"}(je||(je={}));var Fe,Be=function(e){return Object.freeze(e)},_e=function(e,t){this.inlineSize=e,this.blockSize=t,Be(this)},Ke=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,Be(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}(),We=function(e){return e instanceof SVGElement&&"getBBox"in e},Ue=function(e){if(We(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var a=e,o=a.offsetWidth,c=a.offsetHeight;return!(o||c||e.getClientRects().length)},qe=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 _e((r?t:e)||0,(r?e:t)||0)},tt=Be({devicePixelContentBoxSize:et(),borderBoxSize:et(),contentBoxSize:et(),contentRect:new Ke(0,0,0,0)}),rt=function(e,t){if(void 0===t&&(t=!1),Ye.has(e)&&!t)return Ye.get(e);if(Ue(e))return Ye.set(e,tt),tt;var r=getComputedStyle(e),n=We(e)&&e.ownerSVGElement&&e.getBBox(),a=!Qe&&"border-box"===r.boxSizing,o=$e.test(r.writingMode||""),c=!n&&Je.test(r.overflowY||""),l=!n&&Je.test(r.overflowX||""),i=n?0:Ze(r.paddingTop),u=n?0:Ze(r.paddingRight),f=n?0:Ze(r.paddingBottom),s=n?0:Ze(r.paddingLeft),d=n?0:Ze(r.borderTopWidth),p=n?0:Ze(r.borderRightWidth),h=n?0:Ze(r.borderBottomWidth),v=s+u,m=i+f,y=(n?0:Ze(r.borderLeftWidth))+p,b=d+h,O=l?e.offsetHeight-b-e.clientHeight:0,g=c?e.offsetWidth-y-e.clientWidth:0,w=a?v+y:0,E=a?m+b:0,z=n?n.width:Ze(r.width)-w-g,j=n?n.height:Ze(r.height)-E-O,V=z+v+g+y,S=j+m+O+b,M=Be({devicePixelContentBoxSize:et(Math.round(z*devicePixelRatio),Math.round(j*devicePixelRatio),o),borderBoxSize:et(V,S,o),contentBoxSize:et(z,j,o),contentRect:new Ke(s,i,z,j)});return Ye.set(e,M),M},nt=function(e,t,r){var n=rt(e,r),a=n.borderBoxSize,o=n.contentBoxSize,c=n.devicePixelContentBoxSize;switch(t){case je.DEVICE_PIXEL_CONTENT_BOX:return c;case je.BORDER_BOX:return a;default:return o}},at=function(e){var t=rt(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Be([t.borderBoxSize]),this.contentBoxSize=Be([t.contentBoxSize]),this.devicePixelContentBoxSize=Be([t.devicePixelContentBoxSize])},ot=function(e){if(Ue(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},ct=function(){var e=1/0,t=[];ke.forEach((function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach((function(t){var r=new at(t.target),a=ot(t.target);n.push(r),t.lastReportedSize=nt(t.target,t.observedBox),a<e&&(e=a)})),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){ke.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(r){r.isActive()&&(ot(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},it=function(){var e,t=0;for(lt(t);ke.some((function(e){return e.activeTargets.length>0}));)t=ct(),lt(t);return ke.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:De}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=De),window.dispatchEvent(e)),t>0},ut=[],ft=function(e){if(!Fe){var t=0,r=document.createTextNode("");new MutationObserver((function(){return ut.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),Fe=function(){r.textContent=""+(t?t--:t++)}}ut.push(e),Fe()},st=0,dt={attributes:!0,characterData:!0,childList:!0,subtree:!0},pt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ht=function(e){return void 0===e&&(e=0),Date.now()+e},vt=!1,mt=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),!vt){vt=!0;var r,n=ht(e);r=function(){var r=!1;try{r=it()}finally{if(vt=!1,e=n-ht(),!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,dt)};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(),pt.forEach((function(t){return Xe.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),pt.forEach((function(t){return Xe.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),yt=function(e){!st&&e>0&&mt.start(),!(st+=e)&&mt.stop()},bt=function(){function e(e,t){this.target=e,this.observedBox=t||je.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,We(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},Et=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),a=0===n.observationTargets.length;wt(n.observationTargets,t)<0&&(a&&ke.push(n),n.observationTargets.push(new bt(t,r&&r.box)),yt(1),mt.schedule())},e.unobserve=function(e,t){var r=gt.get(e),n=wt(r.observationTargets,t),a=1===r.observationTargets.length;n>=0&&(a&&ke.splice(ke.indexOf(r),1),r.observationTargets.splice(n,1),yt(-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}(),zt=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.");Et.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(!qe(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Et.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(!qe(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Et.unobserve(this,e)},e.prototype.disconnect=function(){Et.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function jt(e){var r=t.useRef(null),n=t.useCallback((function(t){d(t,e),r.current=t}),[e]);return[r,n]}var Vt=function(){return(Vt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function St(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function Mt(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}function Pt(e){var r=e.disableHeight,n=void 0!==r&&r,a=e.disableWidth,o=void 0!==a&&a,c=e.onResize,l=e.target;t.useEffect((function(){if(!n||!o){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 zt((function(e){for(var r=0;r<e.length;r+=1){var a=e[r],l=a.target,i=a.contentRect,u={height:i.height,width:i.width,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},f=St(t,u),s=Mt(t,u);t=u,(f&&!n||s&&!o)&&c(Vt(Vt({},u),{element:l}))}}));return r.observe(e),function(){r.unobserve(e),r.disconnect()}}}}),[l,c,n,o])}var Ht,It=function(){return(It=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function Ct(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function Rt(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}var xt=[];function Lt(e,t){if(void 0===t&&(t={}),"function"==typeof e){var r=e,n=t.ref,a=t.disableHeight,o=void 0!==a&&a,c=t.disableWidth,l=void 0!==c&&c,i=jt(n),u=i[0],f=i[1];return J((function(){var e=u.current;if(!(o&&l||!e))return Ht||"undefined"==typeof document||(Ht=new zt((function(e){for(var t=function(t){var r=e[t],n=xt.filter((function(e){return e.target===r.target}));if(!n.length)return{value:void 0};for(var a=r.contentRect,o=a.height,c=a.width,l=r.target,i={height:o,width:c,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},u=0;u<n.length;u+=1){var f=n[u],s=f.handler,d=f.prevSize,p=f.disableHeight,h=f.disableWidth,v=Ct(d,i),m=Rt(d,i);(v&&!p||m&&!h)&&(f.prevSize=i,s(It(It({},i),{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 a=xt.find((function(t){return t.target===e}));xt.push({target:e,handler:t,disableWidth:n,disableHeight:r,prevSize:void 0}),a||null==Ht||Ht.observe(e)}(e,r,o,l),function(){!function(e,t,r,n){var a=xt.findIndex((function(a){return a.target===e&&a.handler===t&&a.disableWidth===n&&a.disableHeight===r}));-1!==a&&xt.splice(a,1),xt.some((function(t){return t.target===e}))||null==Ht||Ht.unobserve(e)}(e,r,o,l)}}),[o,l,r]),[u,f]}Pt(e)}var Nt={height:void 0,width:void 0};var Gt=function(){return(Gt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Tt="--rmd-cell-size",At="--rmd-cell-margin",kt=t.createContext({columns:-1,cellWidth:-1}),Dt=kt.Provider;function Ft(e){var r,n=void 0===e?{}:e,a=n.ref,o=n.style,c=n.className,l=n.cellMargin,i=n.defaultSize,f=n.maxCellSize,s=void 0===f?150:f,d=n.disableHeight,p=void 0!==d&&d,h=n.disableWidth,v=void 0!==h&&h,m=n.containerPadding,y=void 0===m?16:m,b=jt(a),O=b[0],g=b[1],w=t.useState(i||{columns:-1,cellWidth:s}),E=w[0],z=w[1],j=Lt(t.useCallback((function(){var e=O.current;if(e){var t=e.getBoundingClientRect().width;t-=y,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=Nt[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 a=document.createElement("div");n.appendChild(a);var o="width"===e?"offsetWidth":"offsetHeight";return r=n[o]-a[o],Nt[e]=r,document.body.removeChild(n),r}("width"));var r=Math.ceil(t/s);z({cellWidth:t/r,columns:r})}}),[y,s,O]),{ref:g,disableHeight:p,disableWidth:v})[1],V=Gt(Gt({},o),((r={})[Tt]=E.cellWidth+"px",r));return l&&(V[At]=l),[{ref:j,style:V,className:u("rmd-grid-list",c)},E]}var Bt=function(){return(Bt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},_t=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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Kt=t.forwardRef((function(e,r){var n=e.style,a=e.className,c=e.children,l=e.clone,i=void 0!==l&&l,u=e.wrapOnly,f=void 0!==u&&u,s=e.cellMargin,d=e.defaultSize,p=e.maxCellSize,h=void 0===p?150:p,v=e.containerPadding,m=void 0===v?16:v,y=e.disableHeightObserver,b=void 0!==y&&y,O=e.disableWidthObserver,g=void 0!==O&&O,w=_t(e,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),E=Ft({ref:r,style:n,className:a,cellMargin:s,defaultSize:d,maxCellSize:h,containerPadding:m,disableHeight:b,disableWidth:g}),z=E[0],j=E[1],V=null;return V=function(e){return"function"==typeof e}(c)?c(j):i||f?t.Children.map(c,(function(e){return e&&o.default.createElement(Ae,{clone:i},e)})):c,o.default.createElement(Dt,{value:j},o.default.createElement("div",Bt({},w,z),V))}));function Wt(e){var t=e.value,r=e.min,n=void 0===r?0:r,a=e.max,o=e.increment,c=e.minmax,l=t+(o?1:-1);return void 0!==c&&c?l=Math.min(a,Math.max(n,l)):l>a?l=n:l<n&&(l=a),l}function Ut(e,t,r,n,a){void 0===a&&(a=r-t);var o=Math.round((e-t)*n/a)/n,c=Math.min(Math.max(o,0),1),l=a/n,i=Number.isInteger(l)?a%n:l.toString().split(".")[1].length;return Math.min(r,Math.max(t,parseFloat((c*a+t).toFixed(i))))}function qt(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 a=r.getBoundingClientRect();return n.removeChild(r),a}function Qt(e){var t=e.xMargin,r=e.elWidth,n=e.initialX,a=e.containerRect;return(null!=n?n:a.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,a=e.containerRect;return(null!=n?n:a.left+a.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,a=e.containerRect;return(null!=r?r:a.top)-n-t}function nr(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top)+t}function ar(e){var t=e.yMargin,r=e.initialY,n=e.elHeight,a=e.containerRect;return(null!=r?r:a.top+a.height)-n-t}function or(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top+n.height)+t}function cr(e){var t=e.x,r=e.vw,n=e.vwMargin,a=e.xMargin,o=e.width,c=e.elWidth,l=e.initialX,i=e.containerRect,u=e.disableSwapping;if("min"===o||"equal"===o)return function(e){var t,r,n=e.x,a=e.vw,o=e.elWidth,c=e.xMargin,l=e.vwMargin,i=e.initialX,u=e.containerRect,f=e.isMinWidth,s=null!=i?i:u.left+c,d=u.width-2*c;return f&&(t=d,d=void 0,s+o>a-l&&(r=l)),{left:s,right:r,width:d,minWidth:t,actualX:n}}({x:t,vw:r,vwMargin:n,xMargin:a,elWidth:c,initialX:l,containerRect:i,isMinWidth:"min"===o});if(c>r-2*n)return{left:n,right:n,actualX:t};var f={vwMargin:n,xMargin:a,elWidth:c,initialX:l,screenRight:r-n,containerRect:i,disableSwapping:u};switch(t){case"left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,a=e.disableSwapping,o=Qt(e),c="left";if(o>=t)return{actualX:c,left:o};var l=tr(e);return a||l+n>r?o=t:(o=l,c="right"),{actualX:c,left:o}}(f);case"inner-left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,a=e.disableSwapping,o=Zt(e),c="inner-left";if(o+n<=r)return{actualX:c,left:o};var l=er(e);return a||l<t?o=t:(o=l,c="inner-right"),{actualX:c,left:o}}(f);case"center":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,a=function(e){var t=e.elWidth,r=e.initialX,n=e.containerRect,a=n.width/2,o=t/2;return(null!=r?r:n.left+a)-o}(e);return a<t?a=t:(a+n>r||a<t)&&(a=r-n),{actualX:"center",left:a}}(f);case"inner-right":return function(e){var t=e.screenRight,r=e.vwMargin,n=e.elWidth,a=e.disableSwapping,o=er(e),c="inner-right";if(o>=r)return{actualX:c,left:o};var l=Zt(e);return a||l+n>t?o=t-n:(o=l,c="inner-left"),{actualX:c,left:o}}(f);case"right":return function(e){var t=e.screenRight,r=e.vwMargin,n=e.elWidth,a=e.disableSwapping,o=tr(e),c="right";if(o+n<=t)return{actualX:c,left:o};var l=Qt(e);return a||l<r?o=t-n:(o=l,c="left"),{actualX:c,left:o}}(f);default:throw new Error("This should never happen")}}function lr(e){var t=e.y,r=e.vh,n=e.vhMargin,a=e.yMargin,o=e.elHeight,c=e.initialY,l=e.containerRect,i=e.disableSwapping,u=e.preventOverlap,f=e.disableVHBounds;if(!f&&!u&&o>r-2*n)return{top:n,bottom:n,actualY:"center"};var s={vhMargin:n,yMargin:a,elHeight:o,initialY:c,containerRect:l,screenBottom:r-n,preventOverlap:u,disableSwapping:i,disableVHBounds:f};switch(t){case"above":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.screenBottom,a=e.elHeight,o=e.containerRect,c=e.preventOverlap,l=e.disableSwapping,i=e.disableVHBounds,u=rr(e),f="above";if(i)return{actualY:f,top:Math.max(0,u)};if(u>r)return{actualY:f,top:u};var s,d=or(e);return l||d+a>n?u=r:(f="below",u=d),c&&"above"===f&&u+a>o.top&&(s=window.innerHeight-o.top+t),{actualY:f,top:u,bottom:s}}(s);case"top":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,a=e.disableSwapping,o=e.disableVHBounds,c=nr(e),l="top";if(o||c+n<=r)return{actualY:l,top:c};var i=ar(e);return a||i<t?c=t:(l="bottom",c=i),{actualY:l,top:c}}(s);case"center":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,a=e.disableVHBounds,o=function(e){var t=e.elHeight,r=e.initialY,n=e.containerRect,a=n.height/2,o=t/2;return(null!=r?r:n.top+a)-o}(e),c="center";return a?{actualY:c,top:Math.max(0,o)}:((o=Math.max(t,o))+n>r&&(o=r-n),{actualY:c,top:o})}(s);case"bottom":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,a=e.disableSwapping,o=e.disableVHBounds,c=ar(e),l="bottom";if(o||c>t)return{actualY:l,top:c};var i=nr(e);return a||i+n>r?c=r-n:(l="top",c=i),{actualY:l,top:c}}(s);case"below":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.elHeight,a=e.screenBottom,o=e.containerRect,c=e.preventOverlap,l=e.disableSwapping,i=e.disableVHBounds,u=or(e),f="below";if(i||u+n<=a)return{actualY:f,top:u};if(c){var s=o.top-t;return l||s<a-u?{actualY:f,top:u,bottom:r}:{actualY:"above",top:Math.max(r,s-n),bottom:Yt("height")-s}}var d=rr(e);return l||d<r?u=a-n:(f="above",u=d),{actualY:f,top:u}}(s);default:throw new Error("This should never happen")}}function ir(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,a=void 0===n?{}:n,o=e.initialX,c=e.initialY,l=e.vwMargin,i=void 0===l?16:l,u=e.vhMargin,f=void 0===u?16:u,s=e.xMargin,d=void 0===s?0:s,p=e.yMargin,h=void 0===p?0:p,v=e.width,m=void 0===v?"auto":v,y=e.preventOverlap,b=void 0!==y&&y,O=e.transformOrigin,g=void 0!==O&&O,w=e.disableSwapping,E=void 0!==w&&w,z=e.disableVHBounds,j=void 0!==z&&z;t=Xt(t);var V={x:a.x||"center",y:a.y||"below"};if(!t||!r)return{actualX:V.x,actualY:V.y};var S=t.getBoundingClientRect(),M=Yt("height"),P=Yt("width"),H=$t(r),I=H.height,C=H.width;j&&(r.closest("[role='dialog']")||(c=(null!=c?c:0)+window.scrollY));var R=cr({x:V.x,vw:P,vwMargin:i,xMargin:d,width:m,elWidth:C,initialX:o,containerRect:S,disableSwapping:E}),x=R.left,L=R.right,N=R.width,G=R.minWidth,T=R.actualX,A=lr({y:V.y,vh:M,vhMargin:f,yMargin:h,initialY:c,elHeight:I,containerRect:S,disableSwapping:E,preventOverlap:b,disableVHBounds:j}),k=A.top,D=A.bottom,F=A.actualY;return{actualX:T,actualY:F,style:{left:x,top:k,right:L,bottom:D,width:N,minWidth:G,position:j?"absolute":"fixed",transformOrigin:g?ir({x:T,y:F}):void 0}}}var fr={x:"center",y:"above"},sr={x:"inner-left",y:"top"},dr={x:"inner-right",y:"top"},pr={x:"right",y:"top"},hr={x:"left",y:"center"},vr={x:"center",y:"center"},mr={x:"right",y:"center"},yr={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 a=r;a<n;a+=1){if(0===t[a].toUpperCase().indexOf(e))return a}return-1}function wr(e,t,r,n){void 0===n&&(n=!0);var a=gr(e,t,r+1,t.length);-1===a&&(a=gr(e,t,0,r+(n?1:0)));return a}function Er(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 zr(e,t){switch(void 0===t&&(t="value"),typeof e){case"string":return e;case"number":return Number.isNaN(e)?"":""+e;case"function":return zr(e(),t);case"object":return e?zr(e[t],t):"";default:return""}}var jr=zr,Vr="value",Sr={getItemValue:jr,valueKey:Vr,trim:true,ignoreWhitespace:false};function Mr(e,t,r){void 0===r&&(r={});var n=j(r,Sr),a=n.getItemValue,o=n.valueKey,c=n.trim,l=n.ignoreWhitespace,i=n.startsWith,u=void 0!==i&&i;return(e=Er(e,!0,c,l))&&t.length?t.filter((function(t){var r=Er(a(t,o),!0,c,l);return u?0===r.indexOf(e):-1!==r.indexOf(e)})):t}function Pr(e){return new RegExp((""+e).split("").join("\\w*").replace(/(\(|\||\)|\\(?!w\*)|\[|\|-|\.|\^|\+|\$|\?|^(?!w)\*)/g,"\\$1").replace(/\*\*/g,"*\\*"),"i")}function Hr(e,t,r){void 0===r&&(r={});var n=j(r,Sr),a=n.getItemValue,o=n.valueKey,c=n.trim,l=n.ignoreWhitespace;if(e=Er(e,!1,c,l),!t.length||!e)return t;var i=Pr(e);return t.filter((function(e){var t=Er(a(e,o),!1,c,l);return t.length&&t.match(i)}))}function Ir(e,r){void 0===r&&(r=500);var n=t.useRef(e),a=t.useRef(),o=t.useCallback((function(){window.clearTimeout(a.current),n.current=e}),[e]),c=t.useCallback((function(e){n.current=e,window.clearTimeout(a.current),a.current=window.setTimeout(o,r)}),[r,o]);return[n,c,o]}function Cr(e){var r=e.items,n=e.onChange,a=e.onKeyDown,o=e.resetTime,c=void 0===o?500:o,l=e.searchIndex,i=e.valueKey,u=void 0===i?Vr:i,f=e.getItemValue,s=void 0===f?jr:f,d=e.findMatchIndex,p=void 0===d?wr:d,h=Ir("",c),v=h[0],m=h[1],y=t.useMemo((function(){return r.map((function(e){return s(e,u)}))}),[r,s,u]);return t.useCallback((function(e){a&&a(e);var t=e.key,o=e.altKey,c=e.ctrlKey,i=e.metaKey;if(!(o||c||i||t.length>1||!v.current&&" "===t)){var u=t;v.current!==t&&(u=""+v.current+t),m(u);var f=p(u,y,l,!0);if(f!==l&&-1!==f){var s={index:f,item:r[f],items:r,query:u,target:e.currentTarget};n(s)}}}),[l,p,r,n,a,m,v,y])}var Rr=function(){return(Rr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function xr(e){var r=e.children,n=e.onChange,a=e.phoneMaxWidth,c=void 0===a?se:a,l=e.tabletMinWidth,i=void 0===l?ue:l,u=e.tabletMaxWidth,f=void 0===u?fe:u,s=e.desktopMinWidth,d=void 0===s?ie:s,p=e.desktopLargeMinWidth,h=void 0===p?de:p,v=e.defaultSize,m=void 0===v?be:v,y=Oe({phoneMaxWidth:c,tabletMaxWidth:f,tabletMinWidth:i,desktopMinWidth:d,desktopLargeMinWidth:h,defaultSize:m}),b=t.useRef(y);t.useEffect((function(){!n||m.isPhone===y.isPhone&&m.isTablet===y.isTablet&&m.isDesktop===y.isDesktop&&m.isLargeDesktop===y.isLargeDesktop&&m.isLandscape===y.isLandscape||n(y,m)}),[]),t.useEffect((function(){b.current!==y&&(n&&n(y,b.current),b.current=y)}));var O=t.useMemo((function(){return Rr(Rr({},y),{__initialized:!0})}),[y]);return o.default.createElement(Ee.Provider,{value:O},r)}function Lr(e){var r=e.onResize,n=e.options,a=e.immediate,o=e.enabled,c=void 0===o||o,l=D(r);t.useEffect((function(){if(c){var e=T("resize",window,!0,n),t=function(e){return l.current(e)};return e.add(t),a&&"undefined"!=typeof window&&window.dispatchEvent(new UIEvent("resize")),function(){e.remove(t)}}}),[n,c])}function Nr(e,t){void 0===t&&(t={});var r=t.fontSizeFallback,n=void 0===r?16:r,a=t.element;if("number"==typeof e)return e;var o=parseFloat(e);if(/px$/.test(e))return o;if("undefined"==typeof document)return o*n;var c=/rem$/.test(e),l=document.documentElement;return!c&&a&&(l=a.parentElement||a),o*parseFloat(window.getComputedStyle(l).fontSize||n+"px")}function Gr(e){return e?void 0!==e.current?e.current:e:null}function Tr(e){var r=e.enabled,n=e.element,a=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=Gr(n);E(r,t)||a(r,t,E)}}),[r,n,a])}function Ar(e){var r=t.useState(e),n=r[0],a=r[1],o=D(n);return[n,t.useCallback((function(){o.current||a(!0)}),[]),t.useCallback((function(){o.current&&a(!1)}),[]),t.useCallback((function(){a((function(e){return!e}))}),[]),a]}function kr(e,r,n){void 0===n&&(n=!1);var a=D(e),o=D(r),c=t.useRef(),l=Ar(n),i=l[0],u=l[1],f=l[2],s=t.useCallback((function(){window.clearTimeout(c.current),c.current=void 0}),[]),d=t.useCallback((function(){s(),c.current=window.setTimeout((function(){a.current(),f()}),o.current)}),[]),p=t.useCallback((function(){s(),f()}),[]);return t.useEffect((function(){if(i)return c.current=window.setTimeout((function(){a.current(),f()}),r),function(){s()}}),[i,r,f]),[u,p,d]}var Dr=function(e){return e.replace(/\s/g,"")};function Fr(e,t){if(void 0===t&&(t=".rmd-icon--font"),"string"==typeof e)return Dr(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 Dr(r.textContent||"")}return Dr(e.textContent||"")}var Br=["BUTTON","TEXTAREA","SELECT"].reduce((function(e,t){return e+","+t+":not([disabled])"}),'a[href],area[href],input:not([disabled]):not([type="hidden"])')+",[tabindex]",_r=Br+':not([tabindex="-1"])';function Kr(e,t){return void 0===t&&(t=!1),Array.from(e.querySelectorAll(t?Br:_r))}function Wr(e,t){return void 0===t&&(t="programmatic"),"matches"in e&&e.matches("programmatic"===t?Br:_r)}function Ur(e,t,r,n,a){var o;switch(void 0===r&&(r=!1),void 0===n&&(n=!1),a&&a.length||(a=Kr(e,r)),t){case"first":o=a[0];break;case"last":o=a[a.length-1];break;default:o=e.querySelector(t)}if(!o&&Wr(e,"programmatic")&&(o=e),!o)throw new Error("Unable to find a focusable element");o.focus({preventScroll:n}),n||e===document||Or(e,o)}function qr(e,r,n,a,o){void 0===n&&(n=!1),void 0===a&&(a=!1),void 0===o&&(o=!1),t.useEffect((function(){if(!o){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}),Ur(t,r,a,n))}));return function(){window.cancelAnimationFrame(t)}}}),[r,o,e,a,n])}function Xr(e,r,n){void 0===r&&(r=void 0),void 0===n&&(n=null);var a=t.useRef({disabled:e,fallback:r});t.useEffect((function(){a.current={disabled:e,fallback:r}})),t.useEffect((function(){if(!e){var t=n||document.activeElement,r=t.closest('[role="menu"]'),o=null;if(r&&!(o=document.getElementById(r.id.replace(/-menu$/,"")))){var c=(r.getAttribute("aria-labelledby")||"").split(" ").map((function(e){return"#"+e+"[tabindex]"})).join(",");o=c?document.querySelector(c):null}return function(){var e=a.current,c=e.fallback;if(!e.disabled)if(!r||!o||n||c||document.contains(t)||!document.contains(o)){var l=t;if(document.contains(l)||(l=n&&document.contains(n)?n:null),!l&&c)switch(typeof c){case"string":l=document.querySelector(c);break;case"function":l=c();break;default:l=c}l&&!document.contains(l)&&(l=null),l&&l.focus()}else o.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 a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Zr=t.forwardRef((function(e,r){var n=e.children,a=e.onKeyDown,c=e.component,l=void 0===c?"div":c,i=e.defaultFocus,u=void 0===i?"first":i,f=e.disableFocusCache,s=void 0!==f&&f,d=e.disableFocusOnMount,p=void 0!==d&&d,h=e.disableFocusOnMountScroll,v=void 0!==h&&h,m=e.disableFocusOnUnmount,y=void 0!==m&&m,b=e.disableTabFocusWrap,O=void 0!==b&&b,g=e.unmountFocusFallback,w=void 0===g?"":g,E=Qr(e,["children","onKeyDown","component","defaultFocus","disableFocusCache","disableFocusOnMount","disableFocusOnMountScroll","disableFocusOnUnmount","disableTabFocusWrap","unmountFocusFallback"]),z=jt(r),j=z[0],V=z[1];Xr(y,w),qr(j,u,v,!1,p);var S=function(e){var r=e.disabled,n=void 0!==r&&r,a=e.disableFocusCache,o=void 0!==a&&a,c=e.onKeyDown,l=t.useRef([]),i=t.useCallback((function(e){if(c&&c(e),"Tab"===e.key){!o&&l.current.length||(l.current=Kr(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()))}}),[c,o]);return n?c:i}({disabled:O,disableFocusCache:s,onKeyDown:a});return o.default.createElement(l,$r({},E,{onKeyDown:S,ref:V}),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 a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);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