@dolthub/react-contexts
Version:
A collection of React contexts for common tasks
15 lines • 2.62 MB
JavaScript
"use strict";var t=require("react");function r(t,r,e,n){return new(e||(e=Promise))((function(o,s){function u(t){try{i(n.next(t))}catch(t){s(t)}}function a(t){try{i(n.throw(t))}catch(t){s(t)}}function i(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}i((n=n.apply(t,r||[])).next())}))}function e(r){const e=t.useContext(r);return void 0===e&&console.error(`useContext must be used within a child of ContextProvider for context: ${r.displayName}`),e}function n(t){if(t.__esModule)return t;var r=t.default;if("function"==typeof r){var e=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}"function"==typeof SuppressedError&&SuppressedError;var o,s,u,a,i,l,f,b,v,p,d,C,L,y,h,w,E={exports:{}},m={exports:{}},A={exports:{}},g={},T={};
/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function _(){return u||(u=1,"production"===process.env.NODE_ENV?A.exports=function(){if(o)return g;o=1;var t="function"==typeof Symbol&&Symbol.for,r=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,s=t?Symbol.for("react.strict_mode"):60108,u=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,i=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,b=t?Symbol.for("react.suspense"):60113,v=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,d=t?Symbol.for("react.lazy"):60116,C=t?Symbol.for("react.block"):60121,L=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,h=t?Symbol.for("react.scope"):60119;function w(t){if("object"==typeof t&&null!==t){var o=t.$$typeof;switch(o){case r:switch(t=t.type){case l:case c:case n:case u:case s:case b:return t;default:switch(t=t&&t.$$typeof){case i:case f:case d:case p:case a:return t;default:return o}}case e:return o}}}function E(t){return w(t)===c}return g.AsyncMode=l,g.ConcurrentMode=c,g.ContextConsumer=i,g.ContextProvider=a,g.Element=r,g.ForwardRef=f,g.Fragment=n,g.Lazy=d,g.Memo=p,g.Portal=e,g.Profiler=u,g.StrictMode=s,g.Suspense=b,g.isAsyncMode=function(t){return E(t)||w(t)===l},g.isConcurrentMode=E,g.isContextConsumer=function(t){return w(t)===i},g.isContextProvider=function(t){return w(t)===a},g.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},g.isForwardRef=function(t){return w(t)===f},g.isFragment=function(t){return w(t)===n},g.isLazy=function(t){return w(t)===d},g.isMemo=function(t){return w(t)===p},g.isPortal=function(t){return w(t)===e},g.isProfiler=function(t){return w(t)===u},g.isStrictMode=function(t){return w(t)===s},g.isSuspense=function(t){return w(t)===b},g.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===c||t===u||t===s||t===b||t===v||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===a||t.$$typeof===i||t.$$typeof===f||t.$$typeof===L||t.$$typeof===y||t.$$typeof===h||t.$$typeof===C)},g.typeOf=w,g}():A.exports=(s||(s=1,"production"!==process.env.NODE_ENV&&function(){var t="function"==typeof Symbol&&Symbol.for,r=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,u=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,i=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,b=t?Symbol.for("react.suspense_list"):60120,v=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,d=t?Symbol.for("react.block"):60121,C=t?Symbol.for("react.fundamental"):60117,L=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function h(t){if("object"==typeof t&&null!==t){var b=t.$$typeof;switch(b){case r:var d=t.type;switch(d){case i:case l:case n:case s:case o:case f:return d;default:var C=d&&d.$$typeof;switch(C){case a:case c:case p:case v:case u:return C;default:return b}}case e:return b}}}var w=i,E=l,m=a,A=u,g=r,_=c,I=n,S=p,R=v,N=e,O=s,x=o,k=f,U=!1;function M(t){return h(t)===l}T.AsyncMode=w,T.ConcurrentMode=E,T.ContextConsumer=m,T.ContextProvider=A,T.Element=g,T.ForwardRef=_,T.Fragment=I,T.Lazy=S,T.Memo=R,T.Portal=N,T.Profiler=O,T.StrictMode=x,T.Suspense=k,T.isAsyncMode=function(t){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(t)||h(t)===i},T.isConcurrentMode=M,T.isContextConsumer=function(t){return h(t)===a},T.isContextProvider=function(t){return h(t)===u},T.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},T.isForwardRef=function(t){return h(t)===c},T.isFragment=function(t){return h(t)===n},T.isLazy=function(t){return h(t)===p},T.isMemo=function(t){return h(t)===v},T.isPortal=function(t){return h(t)===e},T.isProfiler=function(t){return h(t)===s},T.isStrictMode=function(t){return h(t)===o},T.isSuspense=function(t){return h(t)===f},T.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===l||t===s||t===o||t===f||t===b||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===v||t.$$typeof===u||t.$$typeof===a||t.$$typeof===c||t.$$typeof===C||t.$$typeof===L||t.$$typeof===y||t.$$typeof===d)},T.typeOf=h}()),T)),A.exports}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/function I(){return f?l:(f=1,l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function S(){return v?b:(v=1,b=Function.call.bind(Object.prototype.hasOwnProperty))}function R(){if(L)return C;L=1;var t=_(),r=function(){if(i)return a;i=1;var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;return a=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var r={},e=0;e<10;e++)r["_"+String.fromCharCode(e)]=e;var n=Object.getOwnPropertyNames(r).map((function(t){return r[t]}));if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(t){o[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}()?Object.assign:function(n,o){for(var s,u,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(n),i=1;i<arguments.length;i++){for(var l in s=Object(arguments[i]))r.call(s,l)&&(a[l]=s[l]);if(t){u=t(s);for(var c=0;c<u.length;c++)e.call(s,u[c])&&(a[u[c]]=s[u[c]])}}return a},a}(),e=I(),n=S(),o=function(){if(d)return p;d=1;var t=function(){};if("production"!==process.env.NODE_ENV){var r=I(),e={},n=S();t=function(t){var r="Warning: "+t;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(t){}}}function o(o,s,u,a,i){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var c;try{if("function"!=typeof o[l]){var f=Error((a||"React class")+": "+u+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}c=o[l](s,l,a,u,null,r)}catch(t){c=t}if(!c||c instanceof Error||t((a||"React class")+": type specification of "+u+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in e)){e[c.message]=!0;var b=i?i():"";t("Failed "+u+" type: "+c.message+(null!=b?b:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(e={})},p=o}(),s=function(){};function u(){return null}return"production"!==process.env.NODE_ENV&&(s=function(t){var r="Warning: "+t;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(t){}}),C=function(a,i){var l="function"==typeof Symbol&&Symbol.iterator,c="<<anonymous>>",f={array:d("array"),bigint:d("bigint"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:p(u),arrayOf:function(t){return p((function(r,n,o,s,u){if("function"!=typeof t)return new v("Property `"+u+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=r[n];if(!Array.isArray(a))return new v("Invalid "+s+" `"+u+"` of type `"+y(a)+"` supplied to `"+o+"`, expected an array.");for(var i=0;i<a.length;i++){var l=t(a,i,o,s,u+"["+i+"]",e);if(l instanceof Error)return l}return null}))},element:p((function(t,r,e,n,o){var s=t[r];return a(s)?null:new v("Invalid "+n+" `"+o+"` of type `"+y(s)+"` supplied to `"+e+"`, expected a single ReactElement.")})),elementType:p((function(r,e,n,o,s){var u=r[e];return t.isValidElementType(u)?null:new v("Invalid "+o+" `"+s+"` of type `"+y(u)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(t){return p((function(r,e,n,o,s){if(!(r[e]instanceof t)){var u=t.name||c;return new v("Invalid "+o+" `"+s+"` of type `"+((a=r[e]).constructor&&a.constructor.name?a.constructor.name:c)+"` supplied to `"+n+"`, expected instance of `"+u+"`.")}var a;return null}))},node:p((function(t,r,e,n,o){return L(t[r])?null:new v("Invalid "+n+" `"+o+"` supplied to `"+e+"`, expected a ReactNode.")})),objectOf:function(t){return p((function(r,o,s,u,a){if("function"!=typeof t)return new v("Property `"+a+"` of component `"+s+"` has invalid PropType notation inside objectOf.");var i=r[o],l=y(i);if("object"!==l)return new v("Invalid "+u+" `"+a+"` of type `"+l+"` supplied to `"+s+"`, expected an object.");for(var c in i)if(n(i,c)){var f=t(i,c,s,u,a+"."+c,e);if(f instanceof Error)return f}return null}))},oneOf:function(t){return Array.isArray(t)?p((function(r,e,n,o,s){for(var u=r[e],a=0;a<t.length;a++)if(b(u,t[a]))return null;var i=JSON.stringify(t,(function(t,r){return"symbol"===h(r)?String(r):r}));return new v("Invalid "+o+" `"+s+"` of value `"+String(u)+"` supplied to `"+n+"`, expected one of "+i+".")})):("production"!==process.env.NODE_ENV&&s(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),u)},oneOfType:function(t){if(!Array.isArray(t))return"production"!==process.env.NODE_ENV&&s("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var r=0;r<t.length;r++){var o=t[r];if("function"!=typeof o)return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+r+"."),u}return p((function(r,o,s,u,a){for(var i=[],l=0;l<t.length;l++){var c=(0,t[l])(r,o,s,u,a,e);if(null==c)return null;c.data&&n(c.data,"expectedType")&&i.push(c.data.expectedType)}return new v("Invalid "+u+" `"+a+"` supplied to `"+s+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")}))},shape:function(t){return p((function(r,n,o,s,u){var a=r[n],i=y(a);if("object"!==i)return new v("Invalid "+s+" `"+u+"` of type `"+i+"` supplied to `"+o+"`, expected `object`.");for(var l in t){var c=t[l];if("function"!=typeof c)return C(o,s,u,l,h(c));var f=c(a,l,o,s,u+"."+l,e);if(f)return f}return null}))},exact:function(t){return p((function(o,s,u,a,i){var l=o[s],c=y(l);if("object"!==c)return new v("Invalid "+a+" `"+i+"` of type `"+c+"` supplied to `"+u+"`, expected `object`.");var f=r({},o[s],t);for(var b in f){var p=t[b];if(n(t,b)&&"function"!=typeof p)return C(u,a,i,b,h(p));if(!p)return new v("Invalid "+a+" `"+i+"` key `"+b+"` supplied to `"+u+"`.\nBad object: "+JSON.stringify(o[s],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var d=p(l,b,u,a,i+"."+b,e);if(d)return d}return null}))}};function b(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}function v(t,r){this.message=t,this.data=r&&"object"==typeof r?r:{},this.stack=""}function p(t){if("production"!==process.env.NODE_ENV)var r={},n=0;function o(o,u,a,l,f,b,p){if(l=l||c,b=b||a,p!==e){if(i){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var C=l+":"+a;!r[C]&&n<3&&(s("You are manually calling a React.PropTypes validation function for the `"+b+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[C]=!0,n++)}}return null==u[a]?o?null===u[a]?new v("The "+f+" `"+b+"` is marked as required in `"+l+"`, but its value is `null`."):new v("The "+f+" `"+b+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(u,a,l,f,b)}var u=o.bind(null,!1);return u.isRequired=o.bind(null,!0),u}function d(t){return p((function(r,e,n,o,s,u){var a=r[e];return y(a)!==t?new v("Invalid "+o+" `"+s+"` of type `"+h(a)+"` supplied to `"+n+"`, expected `"+t+"`.",{expectedType:t}):null}))}function C(t,r,e,n,o){return new v((t||"React class")+": "+r+" type `"+e+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function L(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(L);if(null===t||a(t))return!0;var r=function(t){var r=t&&(l&&t[l]||t["@@iterator"]);if("function"==typeof r)return r}(t);if(!r)return!1;var e,n=r.call(t);if(r!==t.entries){for(;!(e=n.next()).done;)if(!L(e.value))return!1}else for(;!(e=n.next()).done;){var o=e.value;if(o&&!L(o[1]))return!1}return!0;default:return!1}}function y(t){var r=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,r){return"symbol"===t||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,t)?"symbol":r}function h(t){if(null==t)return""+t;var r=y(t);if("object"===r){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return r}function w(t){var r=h(t);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return v.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},C}var N=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(function(){if(w)return m.exports;if(w=1,"production"!==process.env.NODE_ENV){var t=_();m.exports=R()(t.isElement,!0)}else m.exports=function(){if(h)return y;h=1;var t=I();function r(){}function e(){}return e.resetWarningCache=r,y=function(){function n(r,e,n,o,s,u){if(u!==t){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function o(){return n}n.isRequired=n;var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:e,resetWarningCache:r};return s.PropTypes=s,s}}()();return m.exports}());function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function x(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function k(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function U(t,r,e){return r&&k(t.prototype,r),e&&k(t,e),t}function M(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function D(){return D=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},D.apply(this,arguments)}function P(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){M(t,r,e[r])}))}return t}function j(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&$(t,r)}function F(t){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},F(t)}function $(t,r){return $=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},$(t,r)}function G(t,r,e){return G=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,r,e){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(t,n));return e&&$(o,e.prototype),o},G.apply(null,arguments)}function H(t){var r="function"==typeof Map?new Map:void 0;return H=function(t){if(null===t||(e=t,-1===Function.toString.call(e).indexOf("[native code]")))return t;var e;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,n)}function n(){return G(t,arguments,F(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$(n,t)},H(t)}function K(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)e=s[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)e=s[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function B(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Y(t,r){return!r||"object"!=typeof r&&"function"!=typeof r?B(t):r}function q(t,r,e){return q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,r,e){var n=function(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=F(t)););return t}(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(e):o.value}},q(t,r,e||t)}function W(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function X(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return t.reduce((function(t,e){return t[e]=r||{value:e},t}),{})}var V={logLevel:"warn",defaultKeyEvent:"keydown",defaultComponent:"div",defaultTabIndex:"-1",ignoreTags:["input","select","textarea"],enableHardSequences:!1,ignoreKeymapAndHandlerChangesByDefault:!0,ignoreEventsCondition:function(t){var r=t.target;if(r&&r.tagName){var e=r.tagName.toLowerCase();return Z.option("_ignoreTagsDict")[e]||r.isContentEditable}return!1},ignoreRepeatedEventsWhenKeyHeldDown:!0,simulateMissingKeyPressEvents:!0,stopEventPropagationAfterHandling:!0,stopEventPropagationAfterIgnoring:!0,allowCombinationSubmatches:!1,customKeyCodes:{}},z=P({},V);z._ignoreTagsDict=X(z.ignoreTags,!0);var Z=function(){function t(){x(this,t)}return U(t,null,[{key:"init",value:function(t){var r=this,e=t.ignoreTags,n=t.customKeyCodes;e&&(t._ignoreTagsDict=X(t.ignoreTags)),n&&(t._customKeyNamesDict=X(Object.values(t.customKeyCodes))),-1!==["verbose","debug","info"].indexOf(t.logLevel)&&console.warn("React HotKeys: You have requested log level '".concat(t.logLevel,"' but for performance reasons, logging below severity level 'warning' is disabled in production. Please use the development build for complete logs.")),Object.keys(t).forEach((function(e){r.set(e,t[e])}))}},{key:"set",value:function(t,r){z[t]=r}},{key:"reset",value:function(t){z[t]=V[t]}},{key:"option",value:function(t){return z[t]}}]),t}(),J=function(){function t(){var r=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"warn";x(this,t),M(this,"verbose",this.noop),M(this,"debug",this.noop),M(this,"info",this.noop),M(this,"warn",this.noop),M(this,"error",this.noop),this.logLevel=this.constructor.levels[e],this.logLevel>=this.constructor.levels.error&&(this.error=console.error,this.logLevel>=this.constructor.levels.warn&&(this.warn=console.warn,["info","debug","verbose"].some((function(t){return!(r.logLevel>=r.constructor.levels[t]&&(r[t]=console.log,1))}))))}return U(t,[{key:"noop",value:function(){}}]),t}();M(J,"logIcons",["📕","📗","📘","📙"]),M(J,"componentIcons",["🔺","⭐️","🔷","🔶","⬛️"]),M(J,"eventIcons",["❤️","💚","💙","💛","💜","🧡"]),M(J,"levels",{none:0,error:1,warn:2,info:3,debug:4,verbose:5});var Q={keydown:0,keypress:1,keyup:2},tt={Shift:["shiftKey"],Meta:["metaKey"],Control:["ctrlKey"],Alt:["altKey"]},rt={"`":["~"],1:["!"],2:["@",'"'],3:["#","£"],4:["$"],5:["%"],6:["^"],7:["&"],8:["*"],9:["("],0:[")"],"-":["_"],"=":["plus"],";":[":"],"'":['"',"@"],",":["<"],".":[">"],"/":["?"],"\\":["|"],"[":["{"],"]":["}"],"#":["~"]};function et(t){return rt[t]||[1===t.length?t.toUpperCase():t]}function nt(t,r){return t.hasOwnProperty(r)}function ot(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(e,n){var o=t[n];return o.forEach((function(t){nt(e,t)||(e[t]=[]),e[t].push(n)})),r.includeOriginal&&(!nt(e,n)&&(e[n]=[]),e[n]=[].concat(W(e[n]),W(o))),e}),{})}var st=ot(rt);function ut(t){return st[t]||[1===t.length?t.toLowerCase():t]}var at=ot({},{includeOriginal:!0});function it(t){return"string"==typeof t}var lt={tab:"Tab",capslock:"CapsLock",shift:"Shift",meta:"Meta",alt:"Alt",ctrl:"Control",space:" ",spacebar:" ",escape:"Escape",esc:"Escape",left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown",return:"Enter",del:"Delete",command:"Meta",option:"Alt",enter:"Enter",backspace:"Backspace",ins:"Insert",pageup:"PageUp",pagedown:"PageDown",end:"End",home:"Home",contextmenu:"ContextMenu",numlock:"Clear"},ct={cmd:"Meta"};function ft(t){var r=t.toLowerCase();return lt[r]||ct[r]||(t.match(/^f\d+$/)?t.toUpperCase():t)}var bt={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vt=X(Object.values(bt),!0);function pt(t){return!!vt[t]}function dt(t){return pt(t)||String.fromCharCode(t.charCodeAt(0))===t||function(t){return Z.option("_customKeyNamesDict")[t]}(t)}var Ct=function(t){function r(){var t,e;x(this,r);for(var n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];return M(B(B(e=Y(this,(t=F(r)).call.apply(t,[this].concat(o))))),"name","InvalidKeyNameError"),e}return j(r,H(Error)),r}();function Lt(t){return t.sort().join("+")}var yt=function(){function t(){x(this,t)}return U(t,null,[{key:"parse",value:function(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=function(t){return it(t)?t.trim().replace(/\s+/g," "):t}(t),n=e.split(" ");try{var o=n.slice(0,n.length-1),s=n[n.length-1],u=o.map((function(t){var e=ht(t,r);return Lt(Object.keys(e))})).join(" "),a=ht(s,r),i={id:Lt(Object.keys(a)),keyDictionary:a,keyEventType:r.keyEventType,size:Object.keys(a).length};return{sequence:{prefix:u,size:o.length+1},combination:i}}catch(t){return{sequence:null,combination:null}}}}]),t}();function ht(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return t.replace(/^\+|(\s|[^+]\+)\+/,"$1plus").split("+").reduce((function(t,e){var n=ft(e);if(r.ensureValidKeys&&!dt(n))throw new Ct;return t[n]=!0,t}),{})}var wt={"`":["`"],1:["¡"],2:["™"],3:["£"],4:["¢"],5:["∞"],6:["§"],7:["¶"],8:["•"],9:["ª"],0:["º"],"-":["–"],"=":["≠"],a:["å"],b:["∫"],c:["ç"],d:["∂"],e:["´"],f:["ƒ"],g:["©"],h:["˙"],i:["ˆ"],j:["∆"],k:["˚"],l:["¬"],m:["µ"],n:["˜"],o:["ø"],p:["π"],q:["œ"],r:["®"],s:["ß"],t:["†"],u:["¨"],v:["√"],w:["∑"],x:["≈"],y:["¥"],z:["Ω"],"[":["“"],"]":["‘"],"\\":["«"],"'":["æ"],";":["…"],",":["≤"],".":["≥"],"/":["÷"]},Et=ot(wt);function mt(t){return Et[t]||[t]}function At(t){return wt[t]||[t]}var gt={"`":["`"],1:["⁄"],2:["€"],3:["‹"],4:["›"],5:["fi"],6:["fl"],7:["‡"],8:["°"],9:["·"],0:["‚"],"-":["—"],"=":["±"],a:["Å"],b:["ı"],c:["Ç"],d:["Î"],e:["´"],f:["Ï"],g:["˝"],h:["Ó"],i:["ˆ"],j:["Ô"],k:[""],l:["Ò"],m:["Â"],n:["˜"],o:["Ø"],p:["π"],q:["Œ"],r:["‰"],s:["Í"],t:["Î"],u:["¨"],v:["◊"],w:["„"],x:["˛"],y:["Á"],z:["¸"],"[":["”"],"]":["’"],"\\":["»"],"'":["Æ"],";":["Ú"],",":["¯"],".":["˘"]},Tt=ot(gt);function _t(t){return Tt[t]||ut(t)}function It(t){return gt[t]||[t]}var St=function(){function t(){x(this,t)}return U(t,null,[{key:"serialize",value:function(t){var r=t.Shift,e=t.Alt,n={};return Object.keys(t).sort().forEach((function(t){var o=[];if(r)if(e){var s=_t(t),u=It(t);o=[].concat(W(o),[t],W(s),W(u))}else{var a=ut(t),i=et(t);o=[].concat(W(o),[t],W(a),W(i))}else if(e){var l=mt(t),c=At(t);o=[].concat(W(o),[t],W(l),W(c))}else{o.push(t);var f=at[t];f&&(o=[].concat(W(o),W(f)))}var b=Object.keys(n);0<b.length?b.forEach((function(t){o.forEach((function(r){n[t+"+".concat(r)]=P({},n[t],M({},r,!0))})),delete n[t]})):o.forEach((function(t){n[t]=M({},t,!0)}))})),Object.values(n).map((function(t){return Object.keys(t).sort().join("+")}))}},{key:"isValidKeySerialization",value:function(t){return!!(0<t.length)&&!!yt.parse(t,{ensureValidKeys:!0}).combination}}]),t}();function Rt(t){return void 0===t}var Nt=function(){function t(){x(this,t)}return U(t,null,[{key:"newRecord",value:function(t,r){var e=[0,0,0];if(!Rt(t))for(var n=0;n<=t;n++)e[n]=r;return e}},{key:"setBit",value:function(t,r,e){return t[r]=e,t}},{key:"clone",value:function(t){for(var r=this.newRecord(),e=0;e<t.length;e++)r[e]=t[e];return r}}]),t}();function Ot(t){return!Array.isArray(t)&&"object"===O(t)&&null!==t}function xt(t){return Ot(t)?0===Object.keys(t).length:!t||0===t.length}function kt(t){return Ot(t)?Object.keys(t).length:t.length}var Ut=function(){function t(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};x(this,t),this._keys=r,this._includesKeyUp=!1,this._update()}return U(t,[{key:"getIds",value:function(){return this._ids}},{key:"getKeyAliases",value:function(){return this._keyAliases}},{key:"getNormalizedKeyName",value:function(t){return this._keys[t]?t:this._keyAliases[t]||t}},{key:"getNumberOfKeys",value:function(){return kt(this._keys)}},{key:"any",value:function(){return 0<Object.keys(this._getKeyStates()).length}},{key:"isEnding",value:function(){return this._includesKeyUp}},{key:"hasEnded",value:function(){return xt(this.keysStillPressedDict())}},{key:"addKey",value:function(t,r){this._setKeyState(t,[Nt.newRecord(),Nt.newRecord(Q.keydown,r)])}},{key:"setKeyState",value:function(t,r,e){var n=this._getKeyState(t);if(this.isKeyIncluded(t)){var o=Nt.clone(n[1]),s=Nt.clone(o);Nt.setBit(s,r,e),this._setKeyState(t,[o,s])}else this.addKey(t,e);r===Q.keyup&&(this._includesKeyUp=!0)}},{key:"forEachKey",value:function(t){return Object.keys(this._keys).forEach(t)}},{key:"some",value:function(t){return Object.keys(this._keys).some(t)}},{key:"getKeyDictionary",value:function(){return X(Object.keys(this._getKeyStates()),!0)}},{key:"keysStillPressedDict",value:function(){var t=this;return Object.keys(this._keys).reduce((function(r,e){return t.isKeyStillPressed(e)&&(r[e]=t._getKeyState(e)),r}),{})}},{key:"isKeyIncluded",value:function(t){return!!this._getKeyState(t)}},{key:"isKeyStillPressed",value:function(t){return this.isEventTriggered(t,Q.keypress)&&!this.isKeyReleased(t)}},{key:"isKeyReleased",value:function(t){return this.isEventTriggered(t,Q.keyup)}},{key:"isEventTriggered",value:function(t,r){return this._getKeyStateType(t,1,r)}},{key:"wasEventPreviouslyTriggered",value:function(t,r){return this._getKeyStateType(t,0,r)}},{key:"isKeyPressSimulated",value:function(t){return this._isKeyEventSimulated(t,Q.keypress)}},{key:"isKeyUpSimulated",value:function(t){return this._isKeyEventSimulated(t,Q.keyup)}},{key:"describe",value:function(){return this.getIds()[0]}},{key:"toJSON",value:function(){return{keys:this._getKeyStates(),ids:this.getIds(),keyAliases:this.getKeyAliases()}}},{key:"_getKeyStateType",value:function(t,r,e){var n=this._getKeyState(t);return n&&n[r][e]}},{key:"_update",value:function(){this._ids=St.serialize(this._keys),this._keyAliases=function(t){return Object.keys(t).reduce((function(r,e){return function(t){return at[t]||[t]}(e).forEach((function(n){(function(t){if(t.Shift)return t.Alt?[It,_t]:[et,ut];if(t.Alt)return[At,mt];var r=function(t){return[t]};return[r,r]})(t).forEach((function(t){t(n).forEach((function(t){(t!==e||e!==n)&&(r[t]=e)}))}))})),r}),{})}(this._keys)}},{key:"_isKeyEventSimulated",value:function(t,r){return 2===this.isEventTriggered(t,r)}},{key:"_getKeyStates",value:function(){return this._keys}},{key:"_getKeyState",value:function(t){var r=this._keys[t];if(r)return r;var e=this._keyAliases[t];return e?this._keys[e]:void 0}},{key:"_setKeyState",value:function(t,r){var e=this.getNormalizedKeyName(t);this._keys[e]=r,this._update()}}]),t}(),Mt=function(){function t(r){var e=r.maxLength,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;x(this,t),this._records=[],this._maxLength=e,n?this._push(n):this._push(new Ut)}return U(t,[{key:"getMostRecentCombinations",value:function(t){return this._records.slice(-t,-1)}},{key:"any",value:function(){return this._records.some((function(t){return t.any()}))}},{key:"getLength",value:function(){return this._records.length}},{key:"getCurrentCombination",value:function(){return this._records[this.getLength()-1]}},{key:"addKeyToCurrentCombination",value:function(t,r,e){this._ensureInitialKeyCombination(),this.getCurrentCombination().setKeyState(t,r,e)}},{key:"setMaxLength",value:function(t){this._maxLength=t,this._trimHistory()}},{key:"startNewKeyCombination",value:function(t,r){this._ensureInitialKeyCombination();var e=new Ut(this.getCurrentCombination().keysStillPressedDict());e.addKey(t,r),this._push(e)}},{key:"toJSON",value:function(){return this._records.map((function(t){return t.toJSON()}))}},{key:"_ensureInitialKeyCombination",value:function(){0===this.getLength()&&this._push(new Ut)}},{key:"_push",value:function(t){this._trimHistory(),this._records.push(t)}},{key:"_trimHistory",value:function(){for(;this.getLength()>this._maxLength;)this._shift()}},{key:"_shift",value:function(){this._records.shift()}}]),t}(),Dt=function(){function t(){x(this,t),this._registry={}}return U(t,[{key:"get",value:function(t){return this._registry[t]}},{key:"set",value:function(t,r){this._registry[t]=r}},{key:"remove",value:function(t){delete this._registry[t]}},{key:"toJSON",value:function(){return this._registry}}]),t}();function Pt(t){return Array.isArray(t)?t:t?[t]:[]}var jt=function(t){function r(){return x(this,r),Y(this,F(r).apply(this,arguments))}return j(r,Dt),U(r,[{key:"add",value:function(t,e){q(F(r.prototype),"set",this).call(this,t,{childIds:[],parentId:null,keyMap:e})}},{key:"update",value:function(t,e){var n=q(F(r.prototype),"get",this).call(this,t);q(F(r.prototype),"set",this).call(this,t,P({},n,{keyMap:e}))}},{key:"setParent",value:function(t,r){this.get(t).parentId=r,this._addChildId(r,t)}},{key:"remove",value:function(t){var e=this._getParentId(t);this._removeChildId(e,t),q(F(r.prototype),"remove",this).call(this,t)}},{key:"_getParentId",value:function(t){var r=this.get(t);return r&&r.parentId}},{key:"_addChildId",value:function(t,r){this.get(t).childIds.push(r)}},{key:"_removeChildId",value:function(t,r){var e=this.get(t);e&&(e.childIds=function(t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},e=X(Pt(1<arguments.length&&void 0!==arguments[1]?arguments[1]:[]));return Array.isArray(t)?t.reduce((function(t,n){return e[n]&&(r.stringifyFirst||e[n].value===n)||t.push(n),t}),[]):Ot(t)?Object.keys(t).reduce((function(r,n){return e[n]||(r[n]=t[n]),r}),{}):t}(e.childIds,r))}}]),r}(),Ft=function(){function t(r){x(this,t),this._list=r,this._position=-1}return U(t,[{key:"getPosition",value:function(){return this._position}},{key:"getComponent",value:function(){return this._list.getAtPosition(this.getPosition())}},{key:"next",value:function(){return this.getPosition()+1<this._list.getLength()?(this._position++,this.getComponent()):null}}]),t}(),$t=function(){function t(){x(this,t),this._list=[],this._idToIndex={},this._longestSequence=1,this._longestSequenceComponentId=null,this._keyMapEventRecord=Nt.newRecord()}return U(t,[{key:"getNewIterator",value:function(){return new Ft(this)}},{key:"add",value:function(t,r,e,n){if(this.containsId(t))return this.update(t,r,e,n);var o=this._build(t,r,e,n);this._list.push(o);var s=this._getLastIndex();return this._idToIndex[t]=s}},{key:"containsId",value:function(t){return!!this.get(t)}},{key:"get",value:function(t){return this.getAtPosition(this.getIndexById(t))}},{key:"getIndexById",value:function(t){return this._idToIndex[t]}},{key:"update",value:function(t,r,e,n){var o=this._isUpdatingComponentWithLongestSequence(t),s=this.getLongestSequence(),u=this._build(t,r,e,n);o&&u.sequenceLength!==s&&(u.sequenceLength>s?this._longestSequence=u.sequenceLength:this._recalculateLongestSequence()),this._list[this.getIndexById(t)]=u}},{key:"remove",value:function(t){var r=this._isUpdatingComponentWithLongestSequence(t);this.removeAtPosition(this.getIndexById(t)),r&&this._recalculateLongestSequence()}},{key:"any",value:function(){return 0!==this.getLength()}},{key:"isRoot",value:function(t){return this.getIndexById(t)>=this.getLength()-1}},{key:"getLongestSequence",value:function(){return this._longestSequence}},{key:"anyActionsForEventType",value:function(t){return!!this._keyMapEventRecord[t]}},{key:"getLength",value:function(){return this._list.length}},{key:"getAtPosition",value:function(t){return this._list[t]}},{key:"removeAtPosition",value:function(t){this._list=function(t,r){return[].concat(W(t.slice(0,r)),W(t.slice(r+1)))}(this._list,t);for(var r=t;r<this.getLength();)this._idToIndex[this.getAtPosition(r).componentId]=r,r++}},{key:"toJSON",value:function(){return this._list}},{key:"_getLastIndex",value:function(){return this.getLength()-1}},{key:"_build",value:function(t,r,e,n){var o=this._applyHardSequences(r,e),s=o.keyMap,u=o.handlers;return{actions:this._buildActionDictionary(P({},r,s),n,t),handlers:u,componentId:t,options:n}}},{key:"_isUpdatingComponentWithLongestSequence",value:function(t){return t===this._getLongestSequenceComponentId()}},{key:"_getLongestSequenceComponentId",value:function(){return this._longestSequenceComponentId}},{key:"_recalculateLongestSequence",value:function(){for(var t=this.getNewIterator();t.next();){var r=t.getComponent(),e=r.longestSequence,n=r.componentId;e>this.getLongestSequence()&&(this._longestSequenceComponentId=n,this._longestSequence=e)}}},{key:"_applyHardSequences",value:function(t,r){return Z.option("enableHardSequences")?Object.keys(r).reduce((function(e,n){return!t[n]&&St.isValidKeySerialization(n)&&(e.keyMap[n]=n),e.handlers[n]=r[n],e}),{keyMap:{},handlers:{}}):{keyMap:t,handlers:r}}},{key:"_buildActionDictionary",value:function(t,r,e){var n=this;return Object.keys(t).reduce((function(o,s){var u=t[s];return(Ot(u)&&nt(u,"sequences")?Pt(u.sequences):Pt(u)).forEach((function(t){var u=function(t,r){if(Ot(t)){var e=t.sequence,n=t.action;return{keySequence:e,keyEventType:Rt(n)?Q[r.defaultKeyEvent]:Q[n]}}return{keySequence:t,keyEventType:Q[r.defaultKeyEvent]}}(t,r),a=u.keySequence,i=u.keyEventType;n._addActionOptions(o,e,s,a,i)})),o}),{})}},{key:"_addActionOptions",value:function(t,r,e,n,o){var s=yt.parse(n,{keyEventType:o}),u=s.sequence,a=s.combination;u.size>this.getLongestSequence()&&(this._longestSequence=u.size,this._longestSequenceComponentId=r),this._keyMapEventRecord[o]=1,t[e]||(t[e]=[]),t[e].push(P({prefix:u.prefix,actionName:e,sequenceLength:u.size},a))}}]),t}();function Gt(t,r){return t[t.length-(r+1)]}for(var Ht={Enter:!0,Backspace:!0,ArrowRight:!0,ArrowLeft:!0,ArrowUp:!0,ArrowDown:!0,CapsLock:!0},Kt=1;13>Kt;Kt++)Ht["F".concat(Kt)]=!0;function Bt(t){return 1===t.length||nt(Ht,t)}var Yt=function(){function t(){x(this,t),this._actionConfigs={},this._order=null}return U(t,[{key:"addMatch",value:function(t,r){if(this._includesMatcherForCombination(t.id)){var e=t.keyEventType,n=t.actionName,o=t.id;this._addHandlerToActionConfig(o,{keyEventType:e,actionName:n,handler:r})}else this._addNewActionConfig(t,r)}},{key:"findMatch",value:function(t,r,e){this._order||this._setOrder();var n=!0,o=!1,s=void 0;try{for(var u,a=this._order[Symbol.iterator]();!(n=(u=a.next()).done);n=!0){var i=u.value,l=this._actionConfigs[i];if(this._matchesActionConfig(t,r,e,l))return l}}catch(t){o=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw s}}return null}},{key:"toJSON",value:function(){return{actionConfigs:this._actionConfigs,order:this._order}}},{key:"_matchesActionConfig",value:function(t,r,e,n){if(!function(t,r){var e=kt(r.keyDictionary);return Z.option("allowCombinationSubmatches")||function(t){return!!t.isKeyStillPressed("Meta")&&t.some((function(t){return Bt(t)}))}(t)?t.getNumberOfKeys()>=e:t.getNumberOfKeys()===e}(t,n))return!1;if(!n.events[e])return!1;var o=!1;return Object.keys(n.keyDictionary).every((function(n){return!!t.isEventTriggered(n,e)&&(r&&r===t.getNormalizedKeyName(n)&&(o=!t.wasEventPreviouslyTriggered(n,e)),!0)}))&&o}},{key:"_setOrder",value:function(){var t=Object.values(this._actionConfigs).reduce((function(t,r){var e=r.id,n=r.size;return t[n]||(t[n]=[]),t[n].push(e),t}),{});this._order=Object.keys(t).sort((function(t,r){return r-t})).reduce((function(r,e){return r.concat(t[e])}),[])}},{key:"_addNewActionConfig",value:function(t,r){var e=t.prefix,n=t.sequenceLength,o=t.id,s=t.keyDictionary,u=t.size,a=t.keyEventType,i=t.actionName;this._setCombinationMatcher(o,{prefix:e,sequenceLength:n,id:o,keyDictionary:s,size:u,events:{}}),this._addHandlerToActionConfig(o,{keyEventType:a,actionName:i,handler:r})}},{key:"_addHandlerToActionConfig",value:function(t,r){var e=r.keyEventType,n=r.actionName,o=r.handler,s=this._getCombinationMatcher(t);this._setCombinationMatcher(t,P({},s,{events:P({},s.events,M({},e,{actionName:n,handler:o}))}))}},{key:"_setCombinationMatcher",value:function(t,r){this._actionConfigs[t]=r}},{key:"_getCombinationMatcher",value:function(t){return this._actionConfigs[t]}},{key:"_includesMatcherForCombination",value:function(t){return!!this._getCombinationMatcher(t)}}]),t}(),qt=function(){function t(){x(this,t),this._combinationMatchers={},this._eventRecord=Nt.newRecord()}return U(t,[{key:"addMatch",value:function(t,r){this._getOrCreateCombinationMatcher(t.prefix).addMatch(t,r),Nt.setBit(this._eventRecord,t.keyEventType,1),(!this._longestSequence||this._longestSequence<t.sequenceLength)&&(this._longestSequence=t.sequenceLength)}},{key:"findMatch",value:function(t,r,e){var n=this._findCombinationMatcher(t);return n?n.findMatch(t.getCurrentCombination(),t.getCurrentCombination().getNormalizedKeyName(r),e):null}},{key:"hasMatchesForEventType",value:function(t){return!!this._eventRecord[t]}},{key:"getLongestSequence",value:function(){return this._longestSequence}},{key:"toJSON",value:function(){var t=this;return Object.keys(this._combinationMatchers).reduce((function(r,e){var n=t._combinationMatchers[e];return r[e]=n.toJSON(),r}),{})}},{key:"_getOrCreateCombinationMatcher",value:function(t){return this._combinationMatchers[t]||(this._combinationMatchers[t]=new Yt),this._combinationMatchers[t]}},{key:"_findCombinationMatcher",value:function(t){var r=t.getMostRecentCombinations(this.getLongestSequence());if(0===r.length)return this._combinationMatchers[""];for(var e=r.map((function(t){return t.getIds()})),n=e.map((function(t){return t.length})),o=Array(e.length).fill(0),s=!1;!s;){var u=o.map((function(t,r){return e[r][t]})),a=u.join(" ");if(this._combinationMatchers[a])return this._combinationMatchers[a];for(var i=0,l=!0;l&&i<o.length;){var c=(Gt(o,i)+1)%(Gt(n,i)||1);o[o.length-(i+1)]=c,(l=0==c)&&i++}s=i===o.length}}}]),t}(),Wt=function(){function t(r){x(this,t),this._keyMapMatchers=[],this._unmatchedHandlerStatus=[],this._handlersDictionary={},this._keySequencesDictionary={};for(var e=r.getNewIterator();e.next();){var n=e.getComponent().handlers;this._unmatchedHandlerStatus.push([Object.keys(n).length,{}]),this._keyMapMatchers.push(new qt)}this._componentList=r,this._componentListIterator=r.getNewIterator()}return U(t,[{key:"getKeyHistoryMatcher",value:function(t){if(this._componentHasUnmatchedHandlers(t))for(;this._componentListIterator.next();)this._addHandlersFromComponent(),this._addActionsFromComponent();return this._getKeyHistoryMatcher(t)}},{key:"componentHasActionsBoundToEventType",value:function(t,r){return this.getKeyHistoryMatcher(t).hasMatchesForEventType(r)}},{key:"findMatchingKeySequenceInComponent",value:function(t,r,e,n){return this.componentHasActionsBoundToEventType(t,n)?this.getKeyHistoryMatcher(t).findMatch(r,e,n):null}},{key:"_getKeyHistoryMatcher",value:function(t){return this._keyMapMatchers[t]}},{key:"_addActionsFromComponent",value:function(){var t=this,r=this._componentListIterator.getComponent().actions;Object.keys(r).forEach((function(e){var n=t._getHandlers(e);if(n){var o=n[0],s=t._componentList.getAtPosition(o).handlers[e],u=t._getKeyHistoryMatcher(o);r[e].forEach((function(r){var e=[r.prefix,r.id].join(" ");t._isClosestHandlerFound(e,r)||(u.addMatch(r,s),t._addKeySequence(e,[o,r.keyEventType]))})),n.forEach((function(r){var n=t._getUnmatchedHandlerStatus(r);n[1][e]||(n[1][e]=!0,n[0]--)}))}}))}},{key:"_getHandlers",value:function(t){return this._handlersDictionary[t]}},{key:"_addHandlersFromComponent",value:function(){var t=this,r=this._componentListIterator.getComponent().handlers;Object.keys(r).forEach((function(r){t._addHandler(r)}))}},{key:"_addHandler",value:function(t){this._handlersDictionary[t]||(this._handlersDictionary[t]=[]),this._handlersDictionary[t].push(this._componentListIterator.getPosition())}},{key:"_addKeySequence",value:function(t,r){this._keySequencesDictionary[t]||(this._keySequencesDictionary[t]=[]),this._keySequencesDictionary[t].push(r)}},{key:"_componentHasUnmatchedHandlers",value:function(t){return 0<this._getUnmatchedHandlerStatus(t)[0]}},{key:"_getUnmatchedHandlerStatus",value:function(t){return this._unmatchedHandlerStatus[t]}},{key:"_isClosestHandlerFound",value:function(t,r){return this._keySequencesDictionary[t]&&this._keySequencesDictionary[t].some((function(t){return t[1]===r.keyEventType}))}}]),t}();function Xt(t,r,e){return e.forEach((function(e){nt(t,e)&&(r[e]=t[e])})),r}function Vt(t){switch(parseInt(t,10)){case 0:return"keydown";case 1:return"keypress";default:return"keyup"}}function zt(t){return t.simulated?2:1}var Zt=["sequence","action"],Jt=["name","description","group"],Qt=function(){function t(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0;x(this,t),this.logger=r.logger||new J("warn"),this.componentId=-1,this.keyEventManager=e,this._componentTree=new jt,this.rootComponentId=null,this._reset(),this.resetKeyHistory()}return U(t,[{key:"_reset",value:function(){this.componentList=new $t,this._initHandlerResolutionState()}},{key:"_newKeyHistory",value:function(){return new Mt({maxLength:this.componentList.getLongestSequence()})}},{key:"getKeyHistory",value:function(){return this._keyHistory||(this._keyHistory=this._newKeyHistory()),this._keyHistory}},{key:"_initHandlerResolutionState",value:function(){this._actionResolver=null}},{key:"resetKeyHistory",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.keypressEventsToSimulate=[],this.keyupEventsToSimulate=[],this._keyHistory=this.getKeyHistory().any()&&!t.force?new Mt({maxLength:this.componentList.getLongestSequence()},new Ut(this.getCurrentCombination().keysStillPressedDict())):this._newKeyHistory()}},{key:"getApplicationKeyMap",value:function(){return null===this.rootComponentId?{}:this._buildApplicationKeyMap([this.rootComponentId],{})}},{key:"_buildApplicationKeyMap",value:function(t,r){var e=this;return t.forEach((function(t){var n=e._componentTree.get(t),o=n.childIds,s=n.keyMap;s&&Object.keys(s).forEach((function(t){var n=s[t];r[t]={},Ot(n)?nt(n,"sequences")?(Xt(n,r[t],Jt),r[t].sequences=e._createSequenceFromConfig(n.sequences)):(Xt(n,r[t],Jt),r[t].sequences=[Xt(n,{},Zt)]):r[t].sequences=e._createSequenceFromConfig(n)})),e._buildApplicationKeyMap(o,r)})),r}},{key:"_createSequenceFromConfig",value:function(t){return Pt(t).map((function(t){return Ot(t)?Xt(t,{},Zt):{sequence:t}}))}},{key:"registerKeyMap",value:function(t){return this.componentId+=1,this._componentTree.add(this.componentId,t),this.componentId}},{key:"reregisterKeyMap",value:function(t,r){this._componentTree.update(t,r)}},{key:"registerComponentMount",value:function(t,r){Rt(r)?this.rootComponentId=t:this._componentTree.setParent(t,r)}},{key:"deregisterKeyMap",value:function(t){this._componentTree.remove(t),t===this.rootComponentId&&(this.rootComponentId=null)}},{key:"_addComponent",value:function(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=3<arguments.length?arguments[3]:void 0;this.componentList.add(t,r,e,n),this.getKeyHistory().setMaxLength(this.componentList.getLongestSequence())}},{key:"_allKeysAreReleased",value:function(){return this.getCurrentCombination().hasEnded()}},{key:"getCurrentCombination",value:function(){return this.getKeyHistory().getCurrentCombination()}},{key:"_shouldSimulate",value:function(t,r){var e=function(t){return!pt(t)}(r),n=this.getCurrentCombination();return t===Q.keypress?!e||e&&n.isKeyStillPressed("Meta"):t===Q.keyup&&Bt(r)&&n.isKeyReleased("Meta")}},{key:"_cloneAndMergeEvent",value:function(t,r){var e=Object.keys(tt).reduce((function(r,e){return r[e]=t[e],r}),{});return P({},e,r)}},{key:"_callClosestMatchingHandler",value:function(t,r,e,n,o){for(this._actionResolver||(this._actionResolver=new Wt(this.componentList));o<=n;){this._actionResolver.getKeyHistoryMatcher(o);var s=this._actionResolver.findMatchingKeySequenceInComponent(o,this.getKeyHistory(),r,e);if(this.getCurrentCombination(),s){var u=s.events[e];return Z.option("allowCombinationSubmatches")&&St.serialize(s.keyDictionary),u.handler(t),this._stopEventPropagationAfterHandlingIfEnabled(t,o),!0}this._actionResolver.componentHasActionsBoundToEventType(o,e),o++}}},{key:"_stopEventPropagationAfterHandlingIfEnabled",value:function(t,r){return!!Z.option("stopEventPropagationAfterHandling")&&(this._stopEventPropagation(t,r),!0)}},{key:"_stopEventPropagation",value:function(){throw new Error("_stopEventPropagation must be overridden by a subclass")}},{key:"_checkForModifierFlagDiscrepancies",value:function(t,r,e){var n=this;Object.keys(tt).forEach((function(o){if(r!==o||e!==Q.keyup){var s=n.getCurrentCombination(),u=s.isKeyStillPressed(o);tt[o].forEach((function(r){!1===t[r]&&u&&s.setKeyState(o,Q.keyup,zt(t))}))}}))}},{key:"_logPrefix",value:function(){}}]),t}(),tr=function(){function t(){x(this,t)}return U(t,null,[{key:"getId",value:function(){return Rt(this._id)&&(this._id=0),this._id}},{key:"incrementId",value:function(){this._id=this.getId()+1}}]),t}(),rr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"};function er(t){var r=function(){var r=Z.option("customKeyCodes"),e=t.keyCode||t.charCode;return nt(r,e)?r[e]:t.nativeEvent?t.key:function(t){if(t.key){var r=rr[t.key]||t.key;if("Unidentified"!==r)return r}if("keypress"===t.type){var e=function(t){var r,e=t.keyCode;return"charCode"in t?0===(r=t.charCode)&&13===e&&(r=13):r=e,10===r&&(r=13),32<=r||13===r?r:0}(t);return 13===e?"Enter":String.fromCharCode(e)}return"keydown"===t.type||"keyup"===t.type?bt[t.keyCode]||"Unidentified":""}(t)}();return"+"===r?"plus":r}function nr(t){return"Meta"===t}var or=function(){function t(r,e){var n=e.logger,o=e.logPrefix;x(this,t),this._componentList=r,this._previousPropagation=null,this.logger=n,this._logPrefix=o,this._reset()}return U(t,[{key:"_reset",value:function(){this._previousPosition=-1,this._position=-1,this._actionHandled=!1,this._ignoreEvent=!1,this._observeIgnoredEvents=!1,this._stopping=!1,this._compon