@kenyaemr/esm-dispensing-app
Version:
Medication dispensing application
2 lines • 548 kB
JavaScript
/*! For license information please see main.js.LICENSE.txt */
(()=>{var e,n,t={9625:(e,n,t)=>{"use strict";t.d(n,{zxk:()=>be,CtY:()=>Tt,wQF:()=>dr,gqd:()=>fl,Ltx:()=>fr,lXp:()=>hr,h4i:()=>ql,lSo:()=>_r,K0D:()=>Il,Y2U:()=>Bl,PQB:()=>or,laM:()=>ia,tlE:()=>qr,olm:()=>$a,OK9:()=>so,tdY:()=>no,x45:()=>ao,nPR:()=>ro,iA_:()=>ei,RMI:()=>fi,pj1:()=>gi,xJi:()=>bi,MOD:()=>xi,RcE:()=>ki,WdL:()=>Ti,ssF:()=>zi,xDH:()=>Bi,SCH:()=>ji,mQc:()=>vo,Vp9:()=>Co,Kx8:()=>Eo,n9L:()=>ol});var i={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?i.enableCssCustomProperties=!0:i.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?i.enableUseControlledStateWithValue=!0:i.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?i.enableCssGrid=!0:i.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE&&"true"===process.env.CARBON_ENABLE_V11_RELEASE?i.enableV11Release=!0:i.enableV11Release=!1}catch(e){i.enableCssCustomProperties=!1,i.enableUseControlledStateWithValue=!1,i.enableCssGrid=!1,i.enableV11Release=!1}var a=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:i.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:i.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:i.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:i.enableV11Release}];function r(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var i,a,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(i=t.next()).done)&&(r.push(i.value),!n||r.length!==n);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw a}}return r}}(e,n)||l(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,n){if(e){if("string"==typeof e)return s(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,n):void 0}}function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}for(var c=function(){function e(n){var t=this;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.flags=new Map,n&&Object.keys(n).forEach((function(e){t.flags.set(e,n[e])}))}var n,t;return n=e,t=[{key:"checkForFlag",value:function(e){if(!this.flags.has(e))throw new Error("Unable to find a feature flag with the name: `".concat(e,"`"))}},{key:"add",value:function(e,n){if(this.flags.has(e))throw new Error("The feature flag: ".concat(e," already exists"));this.flags.set(e,n)}},{key:"enable",value:function(e){this.checkForFlag(e),this.flags.set(e,!0)}},{key:"disable",value:function(e){this.checkForFlag(e),this.flags.set(e,!1)}},{key:"merge",value:function(e){var n=this;Object.keys(e).forEach((function(t){n.flags.set(t,e[t])}))}},{key:"mergeWithScope",value:function(e){var n,t=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=l(e))){t&&(e=t);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==t.return||t.return()}finally{if(s)throw r}}}}(e.flags);try{for(t.s();!(n=t.n()).done;){var i=o(n.value,2),a=i[0],r=i[1];this.flags.has(a)||this.flags.set(a,r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"enabled",value:function(e){return this.checkForFlag(e),this.flags.get(e)}}],t&&r(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),e}(),d=new c(void 0),p=0;p<a.length;p++){var u=a[p];d.add(u.name,u.enabled)}function f(){return d.enabled.apply(d,arguments)}function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g(Object(t),!0).forEach((function(n){_(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function y(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e,n,t){return n&&y(e.prototype,n),t&&y(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},A.apply(this,arguments)}function w(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&C(e,n)}function x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}function C(e,n){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},C(e,n)}function $(e,n){if(null==e)return{};var t,i,a=function(e,n){if(null==e)return{};var t,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)t=r[i],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)t=r[i],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,i=x(e);if(n){var a=x(this).constructor;t=Reflect.construct(i,arguments,a)}else t=i.apply(this,arguments);return function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}(this,t)}}function I(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var i,a,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(i=t.next()).done)&&(r.push(i.value),!n||r.length!==n);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw a}}return r}}(e,n)||S(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,n){if(e){if("string"==typeof e)return T(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?T(e,n):void 0}}function T(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}!function(){d.merge.apply(d,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0});var z=t(5697),M=t.n(z),O=t(1672),N=t.n(O),D=t(3119),B=t.n(D),R="undefined"!=typeof window?O.useLayoutEffect:O.useEffect;function P(e){return(0,O.useCallback)((function(n){e.forEach((function(e){"function"==typeof e?e(n):null!=e&&(e.current=n)}))}),e)}var L=N().createContext("cds");function j(){return N().useContext(L)}var F=["align","as","autoAlign","caret","className","children","dropShadow","highContrast","open"],q=["className","children"],H=N().createContext({floating:{current:null}}),U=N().forwardRef((function(e,n){var t,i=e.align,a=void 0===i?"bottom":i,r=e.as,o=void 0===r?"span":r,l=e.autoAlign,s=void 0!==l&&l,c=e.caret,d=void 0===c||c,p=e.className,u=e.children,f=e.dropShadow,g=void 0===f||f,h=e.highContrast,m=void 0!==h&&h,b=e.open,y=$(e,F),v=j(),w=(0,O.useRef)(),x=(0,O.useRef)(),C=(0,O.useMemo)((function(){return{floating:w}}),[]),k=P([n,x]),E=I((0,O.useState)(!1),2),S=E[0],T=E[1],z=I((0,O.useState)(a),2),M=z[0],D=z[1],L=B()((_(t={},"".concat(v,"--popover-container"),!0),_(t,"".concat(v,"--popover--caret"),d),_(t,"".concat(v,"--popover--drop-shadow"),g),_(t,"".concat(v,"--popover--high-contrast"),m),_(t,"".concat(v,"--popover--open"),b),_(t,"".concat(v,"--popover--").concat(M),S),_(t,"".concat(v,"--popover--").concat(a),!S),_(t,p,!!p),t));return R((function(){if(s){if(w.current&&!0!==S){var e=w.current.getBoundingClientRect(),n=e.x<-16,t=e.y<-16,i=e.x+(e.width-16)>document.documentElement.clientWidth,r=e.y+(e.height-16)>document.documentElement.clientHeight;if(n||t||i||r){for(var o=["top","top-left","right-bottom","right","right-top","bottom-left","bottom","bottom-right","left-top","left","left-bottom","top-right"],l=[a],c=o[(o.indexOf(a)+1)%o.length];c&&!l.includes(c);)l.push(c),c=o[(o.indexOf(c)+1)%o.length];for(var d=null,p=0;p<l.length;p++){var u=l[p];if(f(u)){d=u;break}}d&&(T(!0),D(d))}else T(!1)}}else T(!1);function f(e){x.current.classList.add("".concat(v,"--popover--").concat(e));var n=w.current.getBoundingClientRect();return n.x<-16||n.y<-16||n.x+(n.width-16)>document.documentElement.clientWidth||n.y+(n.height-16)>document.documentElement.clientHeight?(x.current.classList.remove("".concat(v,"--popover--").concat(e)),!1):(x.current.classList.remove("".concat(v,"--popover--").concat(e)),!0)}}),[S,a,s,v]),N().createElement(H.Provider,{value:C},N().createElement(o,A({},y,{className:L,ref:k}),u))}));U.propTypes={align:M().oneOf(["top","top-left","top-right","bottom","bottom-left","bottom-right","left","left-bottom","left-top","right","right-bottom","right-top"]),as:M().oneOfType([M().string,M().elementType]),autoAlign:M().bool,caret:M().bool,children:M().node,className:M().string,dropShadow:M().bool,highContrast:M().bool,open:M().bool.isRequired};var W=N().forwardRef((function(e,n){var t=e.className,i=e.children,a=$(e,q),r=j(),o=P([N().useContext(H).floating,n]);return N().createElement("span",A({},a,{className:"".concat(r,"--popover")}),N().createElement("span",{className:B()("".concat(r,"--popover-content"),t),ref:o},i),N().createElement("span",{className:"".concat(r,"--popover-caret")}))}));function V(){var e=0;return function(){return++e}}W.propTypes={children:M().node,className:M().string};var K=!("undefined"==typeof window||!window.document||!window.document.createElement),G=V(),Z=K?O.useLayoutEffect:O.useEffect,Y=!1;function Q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",n=I((0,O.useState)((function(){return Y?"".concat(e,"-").concat(G()):null})),2),t=n[0],i=n[1];return Z((function(){null===t&&i("".concat(e,"-").concat(G()))}),[G]),(0,O.useEffect)((function(){!1===Y&&(Y=!0)}),[]),t}function J(e){if(function(e){if(e.tabIndex<0)return!1;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}(e))return e;var n,t=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=S(e))){t&&(e=t);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){l=!0,r=e},f:function(){try{o||null==t.return||t.return()}finally{if(l)throw r}}}}(e.childNodes);try{for(t.s();!(n=t.n()).done;){var i=J(n.value);if(i)return i}}catch(e){t.e(e)}finally{t.f()}return null}function X(e,n){for(var t=0;t<n.length;t++)if(ee(e,n[t]))return!0;return!1}function ee(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.key,i=n.which,a=n.keyCode,r=n.code;return"string"==typeof e?e===t:"number"==typeof e?e===i||e===a:e.key&&Array.isArray(t)?-1!==t.indexOf(e.key):e.key===t||e.which===i||e.keyCode===a||e.code===r}var ne={key:"Enter",which:13,keyCode:13,code:"Enter"},te={key:["Escape","Esc"],which:27,keyCode:27,code:"Esc"},ie={key:" ",which:32,keyCode:32,code:"Space"},ae={key:"End",which:35,keyCode:35,code:"Numpad1"},re={key:"Home",which:36,keyCode:36,code:"Numpad7"},oe={key:"ArrowLeft",which:37,keyCode:37,code:"ArrowLeft"},le={key:"ArrowUp",which:38,keyCode:38,code:"ArrowUp"},se={key:"ArrowRight",which:39,keyCode:39,code:"ArrowRight"},ce={key:"ArrowDown",which:40,keyCode:40,code:"ArrowDown"},de=["align","className","children","label","description","enterDelayMs","leaveDelayMs","defaultOpen"];function pe(e){var n,t,i,a,r,o,l=e.align,s=void 0===l?"top":l,c=e.className,d=e.children,p=e.label,u=e.description,f=e.enterDelayMs,g=void 0===f?100:f,h=e.leaveDelayMs,m=void 0===h?300:h,b=e.defaultOpen,y=void 0!==b&&b,v=$(e,de),_=(0,O.useRef)(null),w=(0,O.useRef)(null),x=(n=y,i=(t=I((0,O.useState)(n),2))[0],a=t[1],r=(0,O.useRef)(null),o=(0,O.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;clearTimeout(r.current),r.current=null,0!==n?r.current=setTimeout((function(){a(e),r.current=null}),n):a(e)}),[]),(0,O.useEffect)((function(){return function(){clearTimeout(r.current)}}),[]),[i,o]),C=I(x,2),k=C[0],E=C[1],S=Q("tooltip"),T=j(),z=N().Children.only(d),M={onFocus:function(){return E(!0)},onBlur:function(){return E(!1)},onMouseEnter:function(){E(!0,g)}};return p?M["aria-labelledby"]=S:M["aria-describedby"]=S,(0,O.useEffect)((function(){J(_.current)||E(!1)})),N().createElement(U,A({},v,{align:s,className:B()("".concat(T,"--tooltip"),c),dropShadow:!1,highContrast:!0,onKeyDown:function(e){k&&ee(e,te)&&(e.stopPropagation(),E(!1))},onMouseLeave:function(){E(!1,m)},open:k,ref:_}),N().cloneElement(z,M),N().createElement(W,{"aria-hidden":"true",className:"".concat(T,"--tooltip-content"),id:S,ref:w,role:"tooltip"},p||u))}pe.propTypes={align:M().oneOf(["top","top-left","top-right","bottom","bottom-left","bottom-right","left","left-bottom","left-top","right","right-bottom","right-top"]),children:M().node,className:M().string,defaultOpen:M().bool,description:M().node,enterDelayMs:M().number,label:M().node,leaveDelayMs:M().number};var ue=["align","children","className","defaultOpen","enterDelayMs","kind","label","leaveDelayMs","size"],fe=N().forwardRef((function(e,n){var t=e.align,i=e.children,a=e.className,r=e.defaultOpen,o=void 0!==r&&r,l=e.enterDelayMs,s=e.kind,c=e.label,d=e.leaveDelayMs,p=e.size,u=void 0===p?"md":p,f=$(e,ue),g=j();return N().createElement(pe,{align:t,className:"".concat(g,"--icon-tooltip"),defaultOpen:o,enterDelayMs:l,label:c,leaveDelayMs:d},N().createElement(be,A({},f,{kind:s,ref:n,size:u,className:B()("".concat(g,"--btn--icon-only"),a)}),i))}));fe.propTypes={align:M().oneOf(["top","top-left","top-right","bottom","bottom-left","bottom-right","left","right"]),children:M().node,className:M().string,defaultOpen:M().bool,enterDelayMs:M().number,kind:M().oneOf(["primary","secondary","ghost","tertiary"]),label:M().node.isRequired,leaveDelayMs:M().number,size:M().oneOf(["sm","md","lg"])};var ge=function(e){return function(n){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];for(var r=0;r<e.length&&!n.defaultPrevented;r++)"function"==typeof e[r]&&e[r].apply(e,[n].concat(i))}},he=["as","children","className","dangerDescription","disabled","hasIconOnly","href","iconDescription","isExpressive","isSelected","kind","onBlur","onClick","onFocus","onMouseEnter","onMouseLeave","renderIcon","size","tabIndex","tooltipAlignment","tooltipPosition","type"],me=N().forwardRef((function(e,n){var t,i,a=e.as,r=e.children,o=e.className,l=e.dangerDescription,s=void 0===l?"danger":l,c=e.disabled,d=void 0!==c&&c,p=e.hasIconOnly,u=void 0!==p&&p,f=e.href,g=e.iconDescription,m=e.isExpressive,b=void 0!==m&&m,y=e.isSelected,v=e.kind,w=void 0===v?"primary":v,x=e.onBlur,C=e.onClick,k=e.onFocus,E=e.onMouseEnter,I=e.onMouseLeave,S=e.renderIcon,T=e.size,z=void 0===T?"lg":T,M=e.tabIndex,D=void 0===M?0:M,R=e.tooltipAlignment,P=void 0===R?"center":R,L=e.tooltipPosition,F=void 0===L?"top":L,q=e.type,H=void 0===q?"button":q,U=$(e,he),W=(0,O.useRef)(null),V=j(),K={tabIndex:D,className:B()(o,(_(t={},"".concat(V,"--btn"),!0),_(t,"".concat(V,"--btn--sm"),"sm"===z&&!b),_(t,"".concat(V,"--btn--md"),"md"===z&&!b),_(t,"".concat(V,"--btn--xl"),"xl"===z),_(t,"".concat(V,"--btn--2xl"),"2xl"===z),_(t,"".concat(V,"--btn--").concat(w),w),_(t,"".concat(V,"--btn--disabled"),d),_(t,"".concat(V,"--btn--expressive"),b),_(t,"".concat(V,"--btn--icon-only"),u),_(t,"".concat(V,"--btn--selected"),u&&y&&"ghost"===w),t)),ref:n},G=S?N().createElement(S,{"aria-label":g,className:"".concat(V,"--btn__icon"),"aria-hidden":"true"}):null,Z=S?N().createElement(S,null):null,Y=["danger","danger--tertiary","danger--ghost"],J="button",X=Q("danger-description"),ee={disabled:d,type:H,"aria-describedby":Y.includes(w)?X:null,"aria-pressed":u&&"ghost"===w?y:null},ne={href:f};i=Y.includes(w)?N().createElement("span",{id:X,className:"".concat(V,"--visually-hidden")},s):null,a?(J=a,ee=h(h({},ee),ne)):f&&!d&&(J="a",ee=ne);var te,ie=N().createElement(J,h(h(h({onMouseEnter:E,onMouseLeave:I,onFocus:k,onBlur:x,onClick:C},U),K),ee),i,r,G);return u?("top"!==F&&"bottom"!==F||("center"===P&&(te=F),"end"===P&&(te="".concat(F,"-right")),"start"===P&&(te="".concat(F,"-left"))),"right"!==F&&"left"!==F||(te=F),N().createElement(fe,A({align:te,label:g,kind:w,size:z,onMouseEnter:E,onMouseLeave:I,onFocus:k,onBlur:x,onClick:ge([C,function(e){e.target!==W.current||e.preventDefault()}])},U,K,ee),Z||r)):ie}));me.displayName="Button",me.propTypes={as:M().oneOfType([M().func,M().string,M().elementType]),children:M().node,className:M().string,dangerDescription:M().string,disabled:M().bool,hasIconOnly:M().bool,href:M().string,iconDescription:function(e){if(e.renderIcon&&!e.children&&!e.iconDescription)return new Error("renderIcon property specified without also providing an iconDescription property.")},isExpressive:M().bool,isSelected:M().bool,kind:M().oneOf(["primary","secondary","danger","ghost","danger--primary","danger--ghost","danger--tertiary","tertiary"]),onBlur:M().func,onClick:M().func,onFocus:M().func,onMouseEnter:M().func,onMouseLeave:M().func,renderIcon:M().oneOfType([M().func,M().object]),role:M().string,size:M().oneOf(["sm","md","lg","xl","2xl"]),tabIndex:M().number,tooltipAlignment:M().oneOf(["start","center","end"]),tooltipPosition:M().oneOf(["top","right","bottom","left"]),type:M().oneOf(["button","reset","submit"])};var be=me,ye=t(3366),ve=t(7462);function _e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ae(e,n){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},Ae(e,n)}function we(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function xe(e,n){return(!n||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function Ce(e,n){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var t=getComputedStyle(e,null);return xe(t.overflowY,n)||xe(t.overflowX,n)||function(e){var n=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!n&&(n.clientHeight<e.scrollHeight||n.clientWidth<e.scrollWidth)}(e)}return!1}function $e(e,n,t,i,a,r,o,l){return r<e&&o>n||r>e&&o<n?0:r<=e&&l<=t||o>=n&&l>=t?r-e-i:o>n&&l<t||r<e&&l>t?o-n+a:0}t(8783);var ke=0;function Ee(e){return"function"==typeof e?e:Ie}function Ie(){}function Se(e,n){if(null!==e){var t=function(e,n){var t=window,i=n.scrollMode,a=n.block,r=n.inline,o=n.boundary,l=n.skipOverflowHiddenElements,s="function"==typeof o?o:function(e){return e!==o};if(!we(e))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,d=[],p=e;we(p)&&s(p);){if((p=p.parentElement)===c){d.push(p);break}null!=p&&p===document.body&&Ce(p)&&!Ce(document.documentElement)||null!=p&&Ce(p,l)&&d.push(p)}for(var u=t.visualViewport?t.visualViewport.width:innerWidth,f=t.visualViewport?t.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),b=m.height,y=m.width,v=m.top,_=m.right,A=m.bottom,w=m.left,x="start"===a||"nearest"===a?v:"end"===a?A:v+b/2,C="center"===r?w+y/2:"end"===r?_:w,$=[],k=0;k<d.length;k++){var E=d[k],I=E.getBoundingClientRect(),S=I.height,T=I.width,z=I.top,M=I.right,O=I.bottom,N=I.left;if("if-needed"===i&&v>=0&&w>=0&&A<=f&&_<=u&&v>=z&&A<=O&&w>=N&&_<=M)return $;var D=getComputedStyle(E),B=parseInt(D.borderLeftWidth,10),R=parseInt(D.borderTopWidth,10),P=parseInt(D.borderRightWidth,10),L=parseInt(D.borderBottomWidth,10),j=0,F=0,q="offsetWidth"in E?E.offsetWidth-E.clientWidth-B-P:0,H="offsetHeight"in E?E.offsetHeight-E.clientHeight-R-L:0;if(c===E)j="start"===a?x:"end"===a?x-f:"nearest"===a?$e(h,h+f,f,R,L,h+x,h+x+b,b):x-f/2,F="start"===r?C:"center"===r?C-u/2:"end"===r?C-u:$e(g,g+u,u,B,P,g+C,g+C+y,y),j=Math.max(0,j+h),F=Math.max(0,F+g);else{j="start"===a?x-z-R:"end"===a?x-O+L+H:"nearest"===a?$e(z,O,S,R,L+H,x,x+b,b):x-(z+S/2)+H/2,F="start"===r?C-N-B:"center"===r?C-(N+T/2)+q/2:"end"===r?C-M+P+q:$e(N,M,T,B,P+q,C,C+y,y);var U=E.scrollLeft,W=E.scrollTop;x+=W-(j=Math.max(0,Math.min(W+j,E.scrollHeight-S+H))),C+=U-(F=Math.max(0,Math.min(U+F,E.scrollWidth-T+q)))}$.push({el:E,top:j,left:F})}return $}(e,{boundary:n,block:"nearest",scrollMode:"if-needed"});t.forEach((function(e){var n=e.el,t=e.top,i=e.left;n.scrollTop=t,n.scrollLeft=i}))}}function Te(e,n){return e===n||e.contains&&e.contains(n)}function ze(e,n){var t;function i(){t&&clearTimeout(t)}function a(){for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];i(),t=setTimeout((function(){t=null,e.apply(void 0,r)}),n)}return a.cancel=i,a}function Me(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return n.some((function(n){return n&&n.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function Oe(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e){n.forEach((function(n){"function"==typeof n?n(e):n&&(n.current=e)}))}}function Ne(){return String(ke++)}function De(e){var n=e.isOpen,t=e.resultCount,i=e.previousResultCount;return n?t?t!==i?t+" result"+(1===t?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Be(e,n){return!(e=Array.isArray(e)?e[0]:e)&&n?n:e}var Re=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Pe(e){void 0===e&&(e={});var n={};return Re.forEach((function(t){e.hasOwnProperty(t)&&(n[t]=e[t])})),n}function Le(e,n){return Object.keys(e).reduce((function(t,i){return t[i]=je(n,i)?n[i]:e[i],t}),{})}function je(e,n){return void 0!==e[n]}function Fe(e){var n=e.key,t=e.keyCode;return t>=37&&t<=40&&0!==n.indexOf("Arrow")?"Arrow"+n:n}function qe(e,n,t,i,a){void 0===a&&(a=!0);var r=t-1;("number"!=typeof n||n<0||n>=t)&&(n=e>0?-1:r+1);var o=n+e;o<0?o=a?r:0:o>r&&(o=a?0:r);var l=He(e,o,t,i,a);return-1===l?n:l}function He(e,n,t,i,a){var r=i(n);if(!r||!r.hasAttribute("disabled"))return n;if(e>0){for(var o=n+1;o<t;o++)if(!i(o).hasAttribute("disabled"))return o}else for(var l=n-1;l>=0;l--)if(!i(l).hasAttribute("disabled"))return l;return a?e>0?He(1,0,t,i,!1):He(-1,t-1,t,i,!1):-1}function Ue(e,n,t,i){return void 0===i&&(i=!0),n.some((function(n){return n&&(Te(n,e)||i&&Te(n,t.activeElement))}))}var We=ze((function(){Ke().textContent=""}),500);function Ve(e,n){var t=Ke(n);e&&(t.textContent=e,We())}function Ke(e){void 0===e&&(e=document);var n=e.getElementById("a11y-status-message");return n||((n=e.createElement("div")).setAttribute("id","a11y-status-message"),n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-relevant","additions text"),Object.assign(n.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(n),n)}var Ge=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Ze=function(){var e=function(e){var n,t;function i(n){var t=e.call(this,n)||this;t.id=t.props.id||"downshift-"+Ne(),t.menuId=t.props.menuId||t.id+"-menu",t.labelId=t.props.labelId||t.id+"-label",t.inputId=t.props.inputId||t.id+"-input",t.getItemId=t.props.getItemId||function(e){return t.id+"-item-"+e},t.input=null,t.items=[],t.itemCount=null,t.previousResultCount=0,t.timeoutIds=[],t.internalSetTimeout=function(e,n){var i=setTimeout((function(){t.timeoutIds=t.timeoutIds.filter((function(e){return e!==i})),e()}),n);t.timeoutIds.push(i)},t.setItemCount=function(e){t.itemCount=e},t.unsetItemCount=function(){t.itemCount=null},t.setHighlightedIndex=function(e,n){void 0===e&&(e=t.props.defaultHighlightedIndex),void 0===n&&(n={}),n=Pe(n),t.internalSetState((0,ve.Z)({highlightedIndex:e},n))},t.clearSelection=function(e){t.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:t.props.defaultHighlightedIndex,isOpen:t.props.defaultIsOpen},e)},t.selectItem=function(e,n,i){n=Pe(n),t.internalSetState((0,ve.Z)({isOpen:t.props.defaultIsOpen,highlightedIndex:t.props.defaultHighlightedIndex,selectedItem:e,inputValue:t.props.itemToString(e)},n),i)},t.selectItemAtIndex=function(e,n,i){var a=t.items[e];null!=a&&t.selectItem(a,n,i)},t.selectHighlightedItem=function(e,n){return t.selectItemAtIndex(t.getState().highlightedIndex,e,n)},t.internalSetState=function(e,n){var i,a,r={},o="function"==typeof e;return!o&&e.hasOwnProperty("inputValue")&&t.props.onInputValueChange(e.inputValue,(0,ve.Z)({},t.getStateAndHelpers(),{},e)),t.setState((function(n){n=t.getState(n);var l=o?e(n):e;l=t.props.stateReducer(n,l),i=l.hasOwnProperty("selectedItem");var s={},c={};return i&&l.selectedItem!==n.selectedItem&&(a=l.selectedItem),l.type=l.type||0,Object.keys(l).forEach((function(e){n[e]!==l[e]&&(r[e]=l[e]),"type"!==e&&(c[e]=l[e],je(t.props,e)||(s[e]=l[e]))})),o&&l.hasOwnProperty("inputValue")&&t.props.onInputValueChange(l.inputValue,(0,ve.Z)({},t.getStateAndHelpers(),{},l)),s}),(function(){Ee(n)(),Object.keys(r).length>1&&t.props.onStateChange(r,t.getStateAndHelpers()),i&&t.props.onSelect(e.selectedItem,t.getStateAndHelpers()),void 0!==a&&t.props.onChange(a,t.getStateAndHelpers()),t.props.onUserAction(r,t.getStateAndHelpers())}))},t.rootRef=function(e){return t._rootNode=e},t.getRootProps=function(e,n){var i,a=void 0===e?{}:e,r=a.refKey,o=void 0===r?"ref":r,l=a.ref,s=(0,ye.Z)(a,["refKey","ref"]),c=(void 0===n?{}:n).suppressRefError,d=void 0!==c&&c;t.getRootProps.called=!0,t.getRootProps.refKey=o,t.getRootProps.suppressRefError=d;var p=t.getState().isOpen;return(0,ve.Z)(((i={})[o]=Oe(l,t.rootRef),i.role="combobox",i["aria-expanded"]=p,i["aria-haspopup"]="listbox",i["aria-owns"]=p?t.menuId:null,i["aria-labelledby"]=t.labelId,i),s)},t.keyDownHandlers={ArrowDown:function(e){var n=this;if(e.preventDefault(),this.getState().isOpen){var t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=n.getItemCount();if(e>0){var t=qe(1,n.getState().highlightedIndex,e,(function(e){return n.getItemNodeFromIndex(e)}));n.setHighlightedIndex(t,{type:4})}}))},ArrowUp:function(e){var n=this;if(e.preventDefault(),this.getState().isOpen){var t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=n.getItemCount();if(e>0){var t=qe(-1,n.getState().highlightedIndex,e,(function(e){return n.getItemNodeFromIndex(e)}));n.setHighlightedIndex(t,{type:3})}}))},Enter:function(e){if(229!==e.which){var n=this.getState(),t=n.isOpen,i=n.highlightedIndex;if(t&&null!=i){e.preventDefault();var a=this.items[i],r=this.getItemNodeFromIndex(i);if(null==a||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},t.buttonKeyDownHandlers=(0,ve.Z)({},t.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),t.inputKeyDownHandlers=(0,ve.Z)({},t.keyDownHandlers,{Home:function(e){var n=this;e.preventDefault();var t=this.getItemCount(),i=this.getState().isOpen;if(!(t<=0)&&i){var a=He(1,0,t,(function(e){return n.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(a,{type:7})}},End:function(e){var n=this;e.preventDefault();var t=this.getItemCount(),i=this.getState().isOpen;if(!(t<=0)&&i){var a=He(-1,t-1,t,(function(e){return n.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(a,{type:8})}}}),t.getToggleButtonProps=function(e){var n=void 0===e?{}:e,i=n.onClick,a=(n.onPress,n.onKeyDown),r=n.onKeyUp,o=n.onBlur,l=(0,ye.Z)(n,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),s=t.getState().isOpen,c={onClick:Me(i,t.buttonHandleClick),onKeyDown:Me(a,t.buttonHandleKeyDown),onKeyUp:Me(r,t.buttonHandleKeyUp),onBlur:Me(o,t.buttonHandleBlur)},d=l.disabled?{}:c;return(0,ve.Z)({type:"button",role:"button","aria-label":s?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},d,{},l)},t.buttonHandleKeyUp=function(e){e.preventDefault()},t.buttonHandleKeyDown=function(e){var n=Fe(e);t.buttonKeyDownHandlers[n]&&t.buttonKeyDownHandlers[n].call(_e(t),e)},t.buttonHandleClick=function(e){e.preventDefault(),t.props.environment.document.activeElement===t.props.environment.document.body&&e.target.focus(),t.internalSetTimeout((function(){return t.toggleMenu({type:13})}))},t.buttonHandleBlur=function(e){var n=e.target;t.internalSetTimeout((function(){t.isMouseDown||null!=t.props.environment.document.activeElement&&t.props.environment.document.activeElement.id===t.inputId||t.props.environment.document.activeElement===n||t.reset({type:14})}))},t.getLabelProps=function(e){return(0,ve.Z)({htmlFor:t.inputId,id:t.labelId},e)},t.getInputProps=function(e){var n,i=void 0===e?{}:e,a=i.onKeyDown,r=i.onBlur,o=i.onChange,l=i.onInput,s=(i.onChangeText,(0,ye.Z)(i,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),c={},d=t.getState(),p=d.inputValue,u=d.isOpen,f=d.highlightedIndex;return s.disabled||((n={}).onChange=Me(o,l,t.inputHandleChange),n.onKeyDown=Me(a,t.inputHandleKeyDown),n.onBlur=Me(r,t.inputHandleBlur),c=n),(0,ve.Z)({"aria-autocomplete":"list","aria-activedescendant":u&&"number"==typeof f&&f>=0?t.getItemId(f):null,"aria-controls":u?t.menuId:null,"aria-labelledby":t.labelId,autoComplete:"off",value:p,id:t.inputId},c,{},s)},t.inputHandleKeyDown=function(e){var n=Fe(e);n&&t.inputKeyDownHandlers[n]&&t.inputKeyDownHandlers[n].call(_e(t),e)},t.inputHandleChange=function(e){t.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:t.props.defaultHighlightedIndex})},t.inputHandleBlur=function(){t.internalSetTimeout((function(){var e=t.props.environment.document&&!!t.props.environment.document.activeElement&&!!t.props.environment.document.activeElement.dataset&&t.props.environment.document.activeElement.dataset.toggle&&t._rootNode&&t._rootNode.contains(t.props.environment.document.activeElement);t.isMouseDown||e||t.reset({type:10})}))},t.menuRef=function(e){t._menuNode=e},t.getMenuProps=function(e,n){var i,a=void 0===e?{}:e,r=a.refKey,o=void 0===r?"ref":r,l=a.ref,s=(0,ye.Z)(a,["refKey","ref"]),c=(void 0===n?{}:n).suppressRefError,d=void 0!==c&&c;return t.getMenuProps.called=!0,t.getMenuProps.refKey=o,t.getMenuProps.suppressRefError=d,(0,ve.Z)(((i={})[o]=Oe(l,t.menuRef),i.role="listbox",i["aria-labelledby"]=s&&s["aria-label"]?null:t.labelId,i.id=t.menuId,i),s)},t.getItemProps=function(e){var n,i=void 0===e?{}:e,a=i.onMouseMove,r=i.onMouseDown,o=i.onClick,l=(i.onPress,i.index),s=i.item,c=void 0===s?void 0:s,d=(0,ye.Z)(i,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===l?(t.items.push(c),l=t.items.indexOf(c)):t.items[l]=c;var p=o,u=((n={onMouseMove:Me(a,(function(){l!==t.getState().highlightedIndex&&(t.setHighlightedIndex(l,{type:2}),t.avoidScrolling=!0,t.internalSetTimeout((function(){return t.avoidScrolling=!1}),250))})),onMouseDown:Me(r,(function(e){e.preventDefault()}))}).onClick=Me(p,(function(){t.selectItemAtIndex(l,{type:9})})),n),f=d.disabled?{onMouseDown:u.onMouseDown}:u;return(0,ve.Z)({id:t.getItemId(l),role:"option","aria-selected":t.getState().highlightedIndex===l},f,{},d)},t.clearItems=function(){t.items=[]},t.reset=function(e,n){void 0===e&&(e={}),e=Pe(e),t.internalSetState((function(n){var i=n.selectedItem;return(0,ve.Z)({isOpen:t.props.defaultIsOpen,highlightedIndex:t.props.defaultHighlightedIndex,inputValue:t.props.itemToString(i)},e)}),n)},t.toggleMenu=function(e,n){void 0===e&&(e={}),e=Pe(e),t.internalSetState((function(n){var i=n.isOpen;return(0,ve.Z)({isOpen:!i},i&&{highlightedIndex:t.props.defaultHighlightedIndex},{},e)}),(function(){var i=t.getState(),a=i.isOpen,r=i.highlightedIndex;a&&t.getItemCount()>0&&"number"==typeof r&&t.setHighlightedIndex(r,e),Ee(n)()}))},t.openMenu=function(e){t.internalSetState({isOpen:!0},e)},t.closeMenu=function(e){t.internalSetState({isOpen:!1},e)},t.updateStatus=ze((function(){var e=t.getState(),n=t.items[e.highlightedIndex],i=t.getItemCount(),a=t.props.getA11yStatusMessage((0,ve.Z)({itemToString:t.props.itemToString,previousResultCount:t.previousResultCount,resultCount:i,highlightedItem:n},e));t.previousResultCount=i,Ve(a,t.props.environment.document)}),200);var i=t.props,a=i.defaultHighlightedIndex,r=i.initialHighlightedIndex,o=void 0===r?a:r,l=i.defaultIsOpen,s=i.initialIsOpen,c=void 0===s?l:s,d=i.initialInputValue,p=void 0===d?"":d,u=i.initialSelectedItem,f=void 0===u?null:u,g=t.getState({highlightedIndex:o,isOpen:c,inputValue:p,selectedItem:f});return null!=g.selectedItem&&void 0===t.props.initialInputValue&&(g.inputValue=t.props.itemToString(g.selectedItem)),t.state=g,t}t=e,(n=i).prototype=Object.create(t.prototype),n.prototype.constructor=n,Ae(n,t);var a=i.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),Le(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,n){var t=this,i=this.getItemCount(),a=this.getState().highlightedIndex;if(i>0){var r=qe(e,a,i,(function(e){return t.getItemNodeFromIndex(e)}));this.setHighlightedIndex(r,n)}},a.getStateAndHelpers=function(){var e=this.getState(),n=e.highlightedIndex,t=e.inputValue,i=e.selectedItem,a=e.isOpen,r=this.props.itemToString,o=this.id,l=this.getRootProps,s=this.getToggleButtonProps,c=this.getLabelProps,d=this.getMenuProps,p=this.getInputProps,u=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,b=this.selectItemAtIndex,y=this.selectHighlightedItem,v=this.setHighlightedIndex,_=this.clearSelection,A=this.clearItems;return{getRootProps:l,getToggleButtonProps:s,getLabelProps:c,getMenuProps:d,getInputProps:p,getItemProps:u,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:b,selectHighlightedItem:y,setHighlightedIndex:v,clearSelection:_,clearItems:A,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:o,highlightedIndex:n,inputValue:t,isOpen:a,selectedItem:i}},a.componentDidMount=function(){var e=this,n=function(){e.isMouseDown=!0},t=function(n){e.isMouseDown=!1,!Ue(n.target,[e._rootNode,e._menuNode],e.props.environment.document)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},a=function(){e.isTouchMove=!0},r=function(n){var t=Ue(n.target,[e._rootNode,e._menuNode],e.props.environment.document,!1);e.isTouchMove||t||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=this.props.environment;o.addEventListener("mousedown",n),o.addEventListener("mouseup",t),o.addEventListener("touchstart",i),o.addEventListener("touchmove",a),o.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),o.removeEventListener("mousedown",n),o.removeEventListener("mouseup",t),o.removeEventListener("touchstart",i),o.removeEventListener("touchmove",a),o.removeEventListener("touchend",r)}},a.shouldScroll=function(e,n){var t=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===n.highlightedIndex?e:n).highlightedIndex;return t&&this.getState().isOpen&&!e.isOpen||t!==i},a.componentDidUpdate=function(e,n){je(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(n,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=Be(this.props.children,Ie);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=Be(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?(0,O.cloneElement)(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},i}(O.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:De,itemToString:function(e){return null==e?"":String(e)},onStateChange:Ie,onInputValueChange:Ie,onUserAction:Ie,onChange:Ie,onSelect:Ie,onOuterClick:Ie,selectedItemChanged:function(e,n){return e!==n},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,n){return n},suppressRefError:!1,scrollIntoView:Se},e.stateChangeTypes=Ge,e}(),Ye={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};var Qe=ze((function(e,n){Ve(e(),n)}),200);function Je(e){return/^\S{1}$/.test(e)}function Xe(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function en(e,n,t){var i=(0,O.useState)(n),a=i[0],r=i[1],o=Le(a,t);return[Le(o,t),function(n){return function(n){var t=n.props.stateReducer,i=e(o,n),a=t(o,(0,ve.Z)({},n,{changes:i}));(function(e,n,t){var i=e.props,a=e.type,r={};Object.keys(n).forEach((function(e){!function(e,n,t,i){var a="on"+Xe(e)+"Change";n[a]&&void 0!==i[e]&&i[e]!==t[e]&&n[a](i)}(e,i,n,t),t[e]!==n[e]&&(r[e]=t[e])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange((0,ve.Z)({type:a},r))})(n,o,a),r(a)}((0,ve.Z)({props:t},n))}]}var nn={itemToString:function(e){return e?String(e):""},stateReducer:function(e,n){return n.changes},getA11ySelectionMessage:function(e){var n=e.selectedItem,t=e.itemToString;return n?t(n)+" has been selected.":""},scrollIntoView:Se,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function tn(e,n,t){void 0===t&&(t=Ye);var i="default"+Xe(n);return i in e?e[i]:t[n]}function an(e,n,t){if(void 0===t&&(t=Ye),n in e)return e[n];var i="initial"+Xe(n);return i in e?e[i]:tn(e,n,t)}function rn(e,n,t,i){var a=e.items,r=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,l=n.selectedItem,s=n.highlightedIndex;return void 0!==r&&s===r?r:void 0!==o?o:l?0===t?a.indexOf(l):qe(t,a.indexOf(l),a.length,i,!1):0===t?-1:t<0?a.length-1:0}function on(e,n,t,i,a){for(var r=t.map((function(e){return i(e).toLowerCase()})),o=e.toLowerCase(),l=function(e,n){var t=a(n);return e.startsWith(o)&&!(t&&t.hasAttribute("disabled"))},s=n+1;s<r.length;s++)if(l(r[s],s))return s;for(var c=0;c<n;c++)if(l(r[c],c))return c;return n}M().array.isRequired,M().func,M().func,M().func,M().bool,M().number,M().number,M().number,M().bool,M().bool,M().bool,M().any,M().any,M().any,M().string,M().string,M().string,M().func,M().string,M().func,M().func,M().func,M().func,M().func,M().shape({addEventListener:M().func,removeEventListener:M().func,document:M().shape({getElementById:M().func,activeElement:M().any,body:M().any})});var ln=(0,ve.Z)({},nn,{getA11yStatusMessage:function(e){var n=e.isOpen,t=e.resultCount,i=e.previousResultCount;return n?t?t!==i?t+" result"+(1===t?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}}),sn=0,cn=1,dn=2,pn=3,un=4,fn=5,gn=6,hn=7,mn=8,bn=9,yn=10,vn=11,_n=12,An=13,wn=14,xn=15,Cn=16,$n=17,kn=18,En=19,In=20,Sn=21,Tn=22,zn=Object.freeze({__proto__:null,MenuKeyDownArrowDown:sn,MenuKeyDownArrowUp:cn,MenuKeyDownEscape:dn,MenuKeyDownHome:pn,MenuKeyDownEnd:un,MenuKeyDownEnter:fn,MenuKeyDownSpaceButton:gn,MenuKeyDownCharacter:hn,MenuBlur:mn,MenuMouseLeave:bn,ItemMouseMove:yn,ItemClick:vn,ToggleButtonClick:_n,ToggleButtonKeyDownArrowDown:An,ToggleButtonKeyDownArrowUp:wn,ToggleButtonKeyDownCharacter:xn,FunctionToggleMenu:Cn,FunctionOpenMenu:$n,FunctionCloseMenu:kn,FunctionSetHighlightedIndex:En,FunctionSelectItem:In,FunctionSetInputValue:Sn,FunctionReset:Tn});function Mn(e,n){var t,i=n.type,a=n.props,r=n.shiftKey;switch(i){case yn:t={highlightedIndex:n.index};break;case vn:t={isOpen:tn(a,"isOpen"),highlightedIndex:tn(a,"highlightedIndex"),selectedItem:a.items[n.index]};break;case xn:var o=n.key,l=""+e.inputValue+o,s=on(l,e.selectedItem?a.items.indexOf(e.selectedItem):-1,a.items,a.itemToString,n.getItemNodeFromIndex);t=(0,ve.Z)({inputValue:l},s>=0&&{selectedItem:a.items[s]});break;case An:t={highlightedIndex:rn(a,e,1,n.getItemNodeFromIndex),isOpen:!0};break;case wn:t={highlightedIndex:rn(a,e,-1,n.getItemNodeFromIndex),isOpen:!0};break;case fn:case gn:t=(0,ve.Z)({isOpen:tn(a,"isOpen"),highlightedIndex:tn(a,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:a.items[e.highlightedIndex]});break;case pn:t={highlightedIndex:He(1,0,a.items.length,n.getItemNodeFromIndex,!1)};break;case un:t={highlightedIndex:He(-1,a.items.length-1,a.items.length,n.getItemNodeFromIndex,!1)};break;case dn:case mn:t={isOpen:!1,highlightedIndex:-1};break;case hn:var c=n.key,d=""+e.inputValue+c,p=on(d,e.highlightedIndex,a.items,a.itemToString,n.getItemNodeFromIndex);t=(0,ve.Z)({inputValue:d},p>=0&&{highlightedIndex:p});break;case sn:t={highlightedIndex:qe(r?5:1,e.highlightedIndex,a.items.length,n.getItemNodeFromIndex,a.circularNavigation)};break;case cn:t={highlightedIndex:qe(r?-5:-1,e.highlightedIndex,a.items.length,n.getItemNodeFromIndex,a.circularNavigation)};break;case bn:t={highlightedIndex:-1};break;case _n:case Cn:t={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:rn(a,e,0)};break;case $n:t={isOpen:!0,highlightedIndex:rn(a,e,0)};break;case kn:t={isOpen:!1};break;case En:t={highlightedIndex:n.highlightedIndex};break;case In:t={selectedItem:n.selectedItem};break;case Sn:t={inputValue:n.inputValue};break;case Tn:t={highlightedIndex:tn(a,"highlightedIndex"),isOpen:tn(a,"isOpen"),selectedItem:tn(a,"selectedItem"),inputValue:tn(a,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return(0,ve.Z)({},e,{},t)}function On(e){void 0===e&&(e={});var n,t,i,a,r,o,l,s=(0,ve.Z)({},ln,{},e),c=s.items,d=s.scrollIntoView,p=s.environment,u=s.initialIsOpen,f=s.defaultIsOpen,g=s.itemToString,h=s.getA11ySelectionMessage,m=s.getA11yStatusMessage,b=en(Mn,function(e){var n=an(e,"selectedItem"),t=an(e,"isOpen"),i=an(e,"highlightedIndex"),a=an(e,"inputValue");return{highlightedIndex:i<0&&n?e.items.indexOf(n):i,isOpen:t,selectedItem:n,inputValue:a}}(s),s),y=b[0],v=y.isOpen,_=y.highlightedIndex,A=y.selectedItem,w=y.inputValue,x=b[1],C=(0,O.useRef)(null),$=(0,O.useRef)(null),k=(0,O.useRef)(!0),E=(0,O.useRef)(!0),I=(0,O.useRef)(null),S=(0,O.useRef)({isMouseDown:!1,isTouchMove:!1}),T=(0,O.useRef)((t=(n=s).id,i=n.labelId,a=n.menuId,r=n.getItemId,o=n.toggleButtonId,l=void 0===t?"downshift-"+Ne():t,{labelId:i||l+"-label",menuId:a||l+"-menu",getItemId:r||function(e){return l+"-item-"+e},toggleButtonId:o||l+"-toggle-button"})),z=(0,O.useRef)(),M=function(e){return p.document.getElementById(T.current.getItemId(e))};(0,O.useEffect)((function(){if(!k.current){var e=z.current;Qe((function(){return m({isOpen:v,highlightedIndex:_,selectedItem:A,inputValue:w,highlightedItem:c[_],resultCount:c.length,itemToString:g,previousResultCount:e})}),p.document)}}),[v,_,A,w]),(0,O.useEffect)((function(){if(!k.current){var e=z.current;Qe((function(){return h({isOpen:v,highlightedIndex:_,selectedItem:A,inputValue:w,highlightedItem:c[_],resultCount:c.length,itemToString:g,previousResultCount:e})}),p.document)}}),[A]),(0,O.useEffect)((function(){k.current&&(I.current=ze((function(e){e({type:Sn,inputValue:""})}),500)),w&&I.current(x)}),[w]),(0,O.useEffect)((function(){k.current?(u||f||v)&&$.current&&$.current.focus():v&&$.current?$.current.focus():p.document.activeElement===$.current&&C.current&&C.current.focus()}),[v]),(0,O.useEffect)((function(){_<0||!v||!c.length||(!1===E.current?E.current=!0:d(M(_),$.current))}),[_]),(0,O.useEffect)((function(){k.current||(z.current=c.length)})),(0,O.useEffect)((function(){k.current=!1}),[]),(0,O.useEffect)((function(){var e=function(){S.current.isMouseDown=!0},n=function(e){S.current.isMouseDown=!1,v&&!Ue(e.target,[C.current,$.current],p.document)&&x({type:mn})},t=function(){S.current.isTouchMove=!1},i=function(){S.current.isTouchMove=!0},a=function(e){!v||S.current.isTouchMove||Ue(e.target,[C.current,$.current],p.document,!1)||x({type:mn})};return p.addEventListener("mousedown",e),p.addEventListener("mouseup",n),p.addEventListener("touchstart",t),p.addEventListener("touchmove",i),p.addEventListener("touchend",a),function(){p.removeEventListener("mousedown",e),p.removeEventListener("mouseup",n),p.removeEventListener("touchstart",t),p.removeEventListener("touchmove",i),p.removeEventListener("touchend",a)}}));var N={ArrowDown:function(e){e.preventDefault(),x({type:An,getItemNodeFromIndex:M,shiftKey:e.shiftKey})},ArrowUp:function(e){e.preventDefault(),x({type:wn,getItemNodeFromIndex:M,shiftKey:e.shiftKey})}},D={ArrowDown:function(e){e.preventDefault(),x({type:sn,getItemNodeFromIndex:M,shiftKey:e.shiftKey})},ArrowUp:function(e){e.preventDefault(),x({type:cn,getItemNodeFromIndex:M,shiftKey:e.shiftKey})},Home:function(e){e.preventDefault(),x({type:pn,getItemNodeFromIndex:M})},End:function(e){e.preventDefault(),x({type:un,getItemNodeFromIndex:M})},Escape:function(){x({type:dn})},Enter:function(e){e.preventDefault(),x({type:fn})}," ":function(e){e.preventDefault(),x({type:gn})}},B=function(e){var n=Fe(e);n&&D[n]?D[n](e):Je(n)&&x({type:hn,key:n,getItemNodeFromIndex:M})},R=function(){!S.current.isMouseDown&&x({type:mn})},P=function(){x({type:bn})},L=function(){x({type:_n})},j=function(e){var n=Fe(e);n&&N[n]?N[n](e):Je(n)&&x({type:xn,key:n,getItemNodeFromIndex:M})};return{getToggleButtonProps:function(e){var n,t=void 0===e?{}:e,i=t.onClick,a=t.onKeyDown,r=t.refKey,o=void 0===r?"ref":r,l=t.ref,s=(0,ye.Z)(t,["onClick","onKeyDown","refKey","ref"]),c=(0,ve.Z)(((n={})[o]=Oe(l,(function(e){C.current=e})),n.id=T.current.toggleButtonId,n["aria-haspopup"]="listbox",n["aria-expanded"]=v,n["aria-labelledby"]=T.current.labelId+" "+T.current.toggleButtonId,n),s);return s.disabled||(c.onClick=Me(i,L),c.onKeyDown=Me(a,j)),c},getLabelProps:function(e){return(0,ve.Z)({id:T.current.labelId,htmlFor:T.current.toggleButtonId},e)},getMenuProps:function(e){var n,t=void 0===e?{}:e,i=t.onMouseLeave,a=t.refKey,r=void 0===a?"ref":a,o=t.on