/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@storybook/ui@6.5.16/dist/cjs/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
'use strict';require("core-js/modules/esnext.string.replace-all.js");Object.defineProperty(exports,'__esModule',{value:true});var React$2=require('react');var require$$2=require('react-dom');var router=require('@storybook/router');var api=require('@storybook/api');var theming=require('@storybook/theming');var components=require('@storybook/components');var memoize=require('memoizerific');var clientLogger=require('@storybook/client-logger');var coreEvents=require('@storybook/core-events');var shortcut=require('@storybook/api/shortcut');var addons=require('@storybook/addons');var qs=require('qs');var semver=require('@storybook/semver');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e};}var React__default$1=/*#__PURE__*/_interopDefaultLegacy(React$2);var require$$2__default=/*#__PURE__*/_interopDefaultLegacy(require$$2);var memoize__default=/*#__PURE__*/_interopDefaultLegacy(memoize);var qs__default=/*#__PURE__*/_interopDefaultLegacy(qs);var semver__default=/*#__PURE__*/_interopDefaultLegacy(semver);var commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var a=Object.defineProperty({},'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var win;if(typeof window!=="undefined"){win=window;}else if(typeof commonjsGlobal!=="undefined"){win=commonjsGlobal;}else if(typeof self!=="undefined"){win=self;}else{win={};}var window_1=win;var propTypes={exports:{}};var reactIs$1={exports:{}};var reactIs_production_min$1={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var b$3="function"===typeof Symbol&&Symbol.for,c$3=b$3?Symbol.for("react.element"):60103,d$3=b$3?Symbol.for("react.portal"):60106,e$3=b$3?Symbol.for("react.fragment"):60107,f$3=b$3?Symbol.for("react.strict_mode"):60108,g$3=b$3?Symbol.for("react.profiler"):60114,h$3=b$3?Symbol.for("react.provider"):60109,k$3=b$3?Symbol.for("react.context"):60110,l$3=b$3?Symbol.for("react.async_mode"):60111,m$3=b$3?Symbol.for("react.concurrent_mode"):60111,n$3=b$3?Symbol.for("react.forward_ref"):60112,p$3=b$3?Symbol.for("react.suspense"):60113,q$3=b$3?Symbol.for("react.suspense_list"):60120,r$3=b$3?Symbol.for("react.memo"):60115,t$1=b$3?Symbol.for("react.lazy"):60116,v$3=b$3?Symbol.for("react.block"):60121,w$3=b$3?Symbol.for("react.fundamental"):60117,x$3=b$3?Symbol.for("react.responder"):60118,y$3=b$3?Symbol.for("react.scope"):60119;function z$3(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$3:switch(a=a.type,a){case l$3:case m$3:case e$3:case g$3:case f$3:case p$3:return a;default:switch(a=a&&a.$$typeof,a){case k$3:case n$3:case t$1:case r$3:case h$3:return a;default:return u;}}case d$3:return u;}}}function A$3(a){return z$3(a)===m$3;}reactIs_production_min$1.AsyncMode=l$3;reactIs_production_min$1.ConcurrentMode=m$3;reactIs_production_min$1.ContextConsumer=k$3;reactIs_production_min$1.ContextProvider=h$3;reactIs_production_min$1.Element=c$3;reactIs_production_min$1.ForwardRef=n$3;reactIs_production_min$1.Fragment=e$3;reactIs_production_min$1.Lazy=t$1;reactIs_production_min$1.Memo=r$3;reactIs_production_min$1.Portal=d$3;reactIs_production_min$1.Profiler=g$3;reactIs_production_min$1.StrictMode=f$3;reactIs_production_min$1.Suspense=p$3;reactIs_production_min$1.isAsyncMode=function(a){return A$3(a)||z$3(a)===l$3;};reactIs_production_min$1.isConcurrentMode=A$3;reactIs_production_min$1.isContextConsumer=function(a){return z$3(a)===k$3;};reactIs_production_min$1.isContextProvider=function(a){return z$3(a)===h$3;};reactIs_production_min$1.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c$3;};reactIs_production_min$1.isForwardRef=function(a){return z$3(a)===n$3;};reactIs_production_min$1.isFragment=function(a){return z$3(a)===e$3;};reactIs_production_min$1.isLazy=function(a){return z$3(a)===t$1;};reactIs_production_min$1.isMemo=function(a){return z$3(a)===r$3;};reactIs_production_min$1.isPortal=function(a){return z$3(a)===d$3;};reactIs_production_min$1.isProfiler=function(a){return z$3(a)===g$3;};reactIs_production_min$1.isStrictMode=function(a){return z$3(a)===f$3;};reactIs_production_min$1.isSuspense=function(a){return z$3(a)===p$3;};reactIs_production_min$1.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e$3||a===m$3||a===g$3||a===f$3||a===p$3||a===q$3||"object"===typeof a&&null!==a&&(a.$$typeof===t$1||a.$$typeof===r$3||a.$$typeof===h$3||a.$$typeof===k$3||a.$$typeof===n$3||a.$$typeof===w$3||a.$$typeof===x$3||a.$$typeof===y$3||a.$$typeof===v$3);};reactIs_production_min$1.typeOf=z$3;var reactIs_development$1={};/** @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.
 */if(process.env.NODE_ENV!=="production"){(function(){// nor polyfill, then a plain number is used for performance.
var hasSymbol=typeof Symbol==='function'&&Symbol.for;var REACT_ELEMENT_TYPE=hasSymbol?Symbol.for('react.element'):0xeac7;var REACT_PORTAL_TYPE=hasSymbol?Symbol.for('react.portal'):0xeaca;var REACT_FRAGMENT_TYPE=hasSymbol?Symbol.for('react.fragment'):0xeacb;var REACT_STRICT_MODE_TYPE=hasSymbol?Symbol.for('react.strict_mode'):0xeacc;var REACT_PROFILER_TYPE=hasSymbol?Symbol.for('react.profiler'):0xead2;var REACT_PROVIDER_TYPE=hasSymbol?Symbol.for('react.provider'):0xeacd;var REACT_CONTEXT_TYPE=hasSymbol?Symbol.for('react.context'):0xeace;// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?
var REACT_ASYNC_MODE_TYPE=hasSymbol?Symbol.for('react.async_mode'):0xeacf;var REACT_CONCURRENT_MODE_TYPE=hasSymbol?Symbol.for('react.concurrent_mode'):0xeacf;var REACT_FORWARD_REF_TYPE=hasSymbol?Symbol.for('react.forward_ref'):0xead0;var REACT_SUSPENSE_TYPE=hasSymbol?Symbol.for('react.suspense'):0xead1;var REACT_SUSPENSE_LIST_TYPE=hasSymbol?Symbol.for('react.suspense_list'):0xead8;var REACT_MEMO_TYPE=hasSymbol?Symbol.for('react.memo'):0xead3;var REACT_LAZY_TYPE=hasSymbol?Symbol.for('react.lazy'):0xead4;var REACT_BLOCK_TYPE=hasSymbol?Symbol.for('react.block'):0xead9;var REACT_FUNDAMENTAL_TYPE=hasSymbol?Symbol.for('react.fundamental'):0xead5;var REACT_RESPONDER_TYPE=hasSymbol?Symbol.for('react.responder'):0xead6;var REACT_SCOPE_TYPE=hasSymbol?Symbol.for('react.scope'):0xead7;function isValidElementType(type){return typeof type==='string'||typeof type==='function'||// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
type===REACT_FRAGMENT_TYPE||type===REACT_CONCURRENT_MODE_TYPE||type===REACT_PROFILER_TYPE||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||typeof type==='object'&&type!==null&&(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_FUNDAMENTAL_TYPE||type.$$typeof===REACT_RESPONDER_TYPE||type.$$typeof===REACT_SCOPE_TYPE||type.$$typeof===REACT_BLOCK_TYPE);}function typeOf(object){if(typeof object==='object'&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_ASYNC_MODE_TYPE:case REACT_CONCURRENT_MODE_TYPE:case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof;}}case REACT_PORTAL_TYPE:return $$typeof;}}return undefined;}// AsyncMode is deprecated along with isAsyncMode
var AsyncMode=REACT_ASYNC_MODE_TYPE;var ConcurrentMode=REACT_CONCURRENT_MODE_TYPE;var ContextConsumer=REACT_CONTEXT_TYPE;var ContextProvider=REACT_PROVIDER_TYPE;var Element=REACT_ELEMENT_TYPE;var ForwardRef=REACT_FORWARD_REF_TYPE;var Fragment=REACT_FRAGMENT_TYPE;var Lazy=REACT_LAZY_TYPE;var Memo=REACT_MEMO_TYPE;var Portal=REACT_PORTAL_TYPE;var Profiler=REACT_PROFILER_TYPE;var StrictMode=REACT_STRICT_MODE_TYPE;var Suspense=REACT_SUSPENSE_TYPE;var hasWarnedAboutDeprecatedIsAsyncMode=false;// AsyncMode should be deprecated
function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint
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.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}function isConcurrentMode(object){return typeOf(object)===REACT_CONCURRENT_MODE_TYPE;}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE;}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE;}function isElement(object){return typeof object==='object'&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE;}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE;}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE;}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE;}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE;}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE;}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE;}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE;}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE;}reactIs_development$1.AsyncMode=AsyncMode;reactIs_development$1.ConcurrentMode=ConcurrentMode;reactIs_development$1.ContextConsumer=ContextConsumer;reactIs_development$1.ContextProvider=ContextProvider;reactIs_development$1.Element=Element;reactIs_development$1.ForwardRef=ForwardRef;reactIs_development$1.Fragment=Fragment;reactIs_development$1.Lazy=Lazy;reactIs_development$1.Memo=Memo;reactIs_development$1.Portal=Portal;reactIs_development$1.Profiler=Profiler;reactIs_development$1.StrictMode=StrictMode;reactIs_development$1.Suspense=Suspense;reactIs_development$1.isAsyncMode=isAsyncMode;reactIs_development$1.isConcurrentMode=isConcurrentMode;reactIs_development$1.isContextConsumer=isContextConsumer;reactIs_development$1.isContextProvider=isContextProvider;reactIs_development$1.isElement=isElement;reactIs_development$1.isForwardRef=isForwardRef;reactIs_development$1.isFragment=isFragment;reactIs_development$1.isLazy=isLazy;reactIs_development$1.isMemo=isMemo;reactIs_development$1.isPortal=isPortal;reactIs_development$1.isProfiler=isProfiler;reactIs_development$1.isStrictMode=isStrictMode;reactIs_development$1.isSuspense=isSuspense;reactIs_development$1.isValidElementType=isValidElementType;reactIs_development$1.typeOf=typeOf;})();}if(process.env.NODE_ENV==='production'){reactIs$1.exports=reactIs_production_min$1;}else{reactIs$1.exports=reactIs_development$1;}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/ /* eslint-disable no-unused-vars */var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty$1=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===undefined){throw new TypeError('Object.assign cannot be called with null or undefined');}return Object(val);}function shouldUseNative(){try{if(!Object.assign){return false;}// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1=new String('abc');// eslint-disable-line no-new-wrappers
test1[5]='de';if(Object.getOwnPropertyNames(test1)[0]==='5'){return false;}// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2={};for(var i=0;i<10;i++){test2['_'+String.fromCharCode(i)]=i;}var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n];});if(order2.join('')!=='0123456789'){return false;}// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3={};'abcdefghijklmnopqrst'.split('').forEach(function(letter){test3[letter]=letter;});if(Object.keys(Object.assign({},test3)).join('')!=='abcdefghijklmnopqrst'){return false;}return true;}catch(err){// We don't expect any of the above to throw, but better to be safe.
return false;}}var objectAssign=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s<arguments.length;s++){from=Object(arguments[s]);for(var key in from){if(hasOwnProperty$1.call(from,key)){to[key]=from[key];}}if(getOwnPropertySymbols){symbols=getOwnPropertySymbols(from);for(var i=0;i<symbols.length;i++){if(propIsEnumerable.call(from,symbols[i])){to[symbols[i]]=from[symbols[i]];}}}}return to;};/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ReactPropTypesSecret$3='SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';var ReactPropTypesSecret_1=ReactPropTypesSecret$3;var has$2=Function.call.bind(Object.prototype.hasOwnProperty);/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var printWarning$1=function(){};if(process.env.NODE_ENV!=='production'){var ReactPropTypesSecret$2=ReactPropTypesSecret_1;var loggedTypeFailures={};var has$1=has$2;printWarning$1=function(text){var message='Warning: '+text;if(typeof console!=='undefined'){console.error(message);}try{// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);}catch(x){/**/}};}/**
 * Assert that the values match with the type specs.
 * Error messages are memorized and will only be shown once.
 *
 * @param {object} typeSpecs Map of name to a ReactPropType
 * @param {object} values Runtime values that need to be type-checked
 * @param {string} location e.g. "prop", "context", "child context"
 * @param {string} componentName Name of the component for error messages.
 * @param {?Function} getStack Returns the component stack.
 * @private
 */function checkPropTypes$1(typeSpecs,values,location,componentName,getStack){if(process.env.NODE_ENV!=='production'){for(var typeSpecName in typeSpecs){if(has$1(typeSpecs,typeSpecName)){var error;// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try{// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if(typeof typeSpecs[typeSpecName]!=='function'){var err=Error((componentName||'React class')+': '+location+' type `'+typeSpecName+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+typeof typeSpecs[typeSpecName]+'`.'+'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');err.name='Invariant Violation';throw err;}error=typeSpecs[typeSpecName](values,typeSpecName,componentName,location,null,ReactPropTypesSecret$2);}catch(ex){error=ex;}if(error&&!(error instanceof Error)){printWarning$1((componentName||'React class')+': type specification of '+location+' `'+typeSpecName+'` is invalid; the type checker '+'function must return `null` or an `Error` but returned a '+typeof error+'. '+'You may have forgotten to pass an argument to the type checker '+'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+'shape all require an argument).');}if(error instanceof Error&&!(error.message in loggedTypeFailures)){// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message]=true;var stack=getStack?getStack():'';printWarning$1('Failed '+location+' type: '+error.message+(stack!=null?stack:''));}}}}}/**
 * Resets warning cache when testing.
 *
 * @private
 */checkPropTypes$1.resetWarningCache=function(){if(process.env.NODE_ENV!=='production'){loggedTypeFailures={};}};var checkPropTypes_1=checkPropTypes$1;/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ReactIs$1=reactIs$1.exports;var assign=objectAssign;var ReactPropTypesSecret$1=ReactPropTypesSecret_1;var has=has$2;var checkPropTypes=checkPropTypes_1;var printWarning=function(){};if(process.env.NODE_ENV!=='production'){printWarning=function(text){var message='Warning: '+text;if(typeof console!=='undefined'){console.error(message);}try{// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);}catch(x){}};}function emptyFunctionThatReturnsNull(){return null;}var factoryWithTypeCheckers=function(isValidElement,throwOnDirectAccess){/* global Symbol */var ITERATOR_SYMBOL=typeof Symbol==='function'&&Symbol.iterator;var FAUX_ITERATOR_SYMBOL='@@iterator';// Before Symbol spec.
/**
   * Returns the iterator method function contained on the iterable object.
   *
   * Be sure to invoke the function with the iterable as context:
   *
   *     var iteratorFn = getIteratorFn(myIterable);
   *     if (iteratorFn) {
   *       var iterator = iteratorFn.call(myIterable);
   *       ...
   *     }
   *
   * @param {?object} maybeIterable
   * @return {?function}
   */function getIteratorFn(maybeIterable){var iteratorFn=maybeIterable&&(ITERATOR_SYMBOL&&maybeIterable[ITERATOR_SYMBOL]||maybeIterable[FAUX_ITERATOR_SYMBOL]);if(typeof iteratorFn==='function'){return iteratorFn;}}/**
   * Collection of methods that allow declaration and validation of props that are
   * supplied to React components. Example usage:
   *
   *   var Props = require('ReactPropTypes');
   *   var MyArticle = React.createClass({
   *     propTypes: {
   *       // An optional string prop named "description".
   *       description: Props.string,
   *
   *       // A required enum prop named "category".
   *       category: Props.oneOf(['News','Photos']).isRequired,
   *
   *       // A prop named "dialog" that requires an instance of Dialog.
   *       dialog: Props.instanceOf(Dialog).isRequired
   *     },
   *     render: function() { ... }
   *   });
   *
   * A more formal specification of how these methods are used:
   *
   *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
   *   decl := ReactPropTypes.{type}(.isRequired)?
   *
   * Each and every declaration produces a function with the same signature. This
   * allows the creation of custom validation functions. For example:
   *
   *  var MyLink = React.createClass({
   *    propTypes: {
   *      // An optional string or URI prop named "href".
   *      href: function(props, propName, componentName) {
   *        var propValue = props[propName];
   *        if (propValue != null && typeof propValue !== 'string' &&
   *            !(propValue instanceof URI)) {
   *          return new Error(
   *            'Expected a string or an URI for ' + propName + ' in ' +
   *            componentName
   *          );
   *        }
   *      }
   *    },
   *    render: function() {...}
   *  });
   *
   * @internal
   */var ANONYMOUS='<<anonymous>>';// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes={array:createPrimitiveTypeChecker('array'),bigint:createPrimitiveTypeChecker('bigint'),bool:createPrimitiveTypeChecker('boolean'),func:createPrimitiveTypeChecker('function'),number:createPrimitiveTypeChecker('number'),object:createPrimitiveTypeChecker('object'),string:createPrimitiveTypeChecker('string'),symbol:createPrimitiveTypeChecker('symbol'),any:createAnyTypeChecker(),arrayOf:createArrayOfTypeChecker,element:createElementTypeChecker(),elementType:createElementTypeTypeChecker(),instanceOf:createInstanceTypeChecker,node:createNodeChecker(),objectOf:createObjectOfTypeChecker,oneOf:createEnumTypeChecker,oneOfType:createUnionTypeChecker,shape:createShapeTypeChecker,exact:createStrictShapeTypeChecker};/**
   * inlined Object.is polyfill to avoid requiring consumers ship their own
   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
   */ /*eslint-disable no-self-compare*/function is(x,y){// SameValue algorithm
if(x===y){// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x!==0||1/x===1/y;}else{// Step 6.a: NaN == NaN
return x!==x&&y!==y;}}/*eslint-enable no-self-compare*/ /**
   * We use an Error-like object for backward compatibility as people may call
   * PropTypes directly and inspect their output. However, we don't use real
   * Errors anymore. We don't inspect their stack anyway, and creating them
   * is prohibitively expensive if they are created too often, such as what
   * happens in oneOfType() for any type before the one that matched.
   */function PropTypeError(message,data){this.message=message;this.data=data&&typeof data==='object'?data:{};this.stack='';}// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype=Error.prototype;function createChainableTypeChecker(validate){if(process.env.NODE_ENV!=='production'){var manualPropTypeCallCache={};var manualPropTypeWarningCount=0;}function checkType(isRequired,props,propName,componentName,location,propFullName,secret){componentName=componentName||ANONYMOUS;propFullName=propFullName||propName;if(secret!==ReactPropTypesSecret$1){if(throwOnDirectAccess){// New behavior only for users of `prop-types` package
var err=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');err.name='Invariant Violation';throw err;}else if(process.env.NODE_ENV!=='production'&&typeof console!=='undefined'){// Old behavior for people using React.PropTypes
var cacheKey=componentName+':'+propName;if(!manualPropTypeCallCache[cacheKey]&&// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount<3){printWarning('You are manually calling a React.PropTypes validation '+'function for the `'+propFullName+'` prop on `'+componentName+'`. 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.');manualPropTypeCallCache[cacheKey]=true;manualPropTypeWarningCount++;}}}if(props[propName]==null){if(isRequired){if(props[propName]===null){return new PropTypeError('The '+location+' `'+propFullName+'` is marked as required '+('in `'+componentName+'`, but its value is `null`.'));}return new PropTypeError('The '+location+' `'+propFullName+'` is marked as required in '+('`'+componentName+'`, but its value is `undefined`.'));}return null;}else{return validate(props,propName,componentName,location,propFullName);}}var chainedCheckType=checkType.bind(null,false);chainedCheckType.isRequired=checkType.bind(null,true);return chainedCheckType;}function createPrimitiveTypeChecker(expectedType){function validate(props,propName,componentName,location,propFullName,secret){var propValue=props[propName];var propType=getPropType(propValue);if(propType!==expectedType){// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType=getPreciseType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+preciseType+'` supplied to `'+componentName+'`, expected ')+('`'+expectedType+'`.'),{expectedType:expectedType});}return null;}return createChainableTypeChecker(validate);}function createAnyTypeChecker(){return createChainableTypeChecker(emptyFunctionThatReturnsNull);}function createArrayOfTypeChecker(typeChecker){function validate(props,propName,componentName,location,propFullName){if(typeof typeChecker!=='function'){return new PropTypeError('Property `'+propFullName+'` of component `'+componentName+'` has invalid PropType notation inside arrayOf.');}var propValue=props[propName];if(!Array.isArray(propValue)){var propType=getPropType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected an array.'));}for(var i=0;i<propValue.length;i++){var error=typeChecker(propValue,i,componentName,location,propFullName+'['+i+']',ReactPropTypesSecret$1);if(error instanceof Error){return error;}}return null;}return createChainableTypeChecker(validate);}function createElementTypeChecker(){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];if(!isValidElement(propValue)){var propType=getPropType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected a single ReactElement.'));}return null;}return createChainableTypeChecker(validate);}function createElementTypeTypeChecker(){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];if(!ReactIs$1.isValidElementType(propValue)){var propType=getPropType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected a single ReactElement type.'));}return null;}return createChainableTypeChecker(validate);}function createInstanceTypeChecker(expectedClass){function validate(props,propName,componentName,location,propFullName){if(!(props[propName]instanceof expectedClass)){var expectedClassName=expectedClass.name||ANONYMOUS;var actualClassName=getClassName(props[propName]);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+actualClassName+'` supplied to `'+componentName+'`, expected ')+('instance of `'+expectedClassName+'`.'));}return null;}return createChainableTypeChecker(validate);}function createEnumTypeChecker(expectedValues){if(!Array.isArray(expectedValues)){if(process.env.NODE_ENV!=='production'){if(arguments.length>1){printWarning('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]).');}else{printWarning('Invalid argument supplied to oneOf, expected an array.');}}return emptyFunctionThatReturnsNull;}function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];for(var i=0;i<expectedValues.length;i++){if(is(propValue,expectedValues[i])){return null;}}var valuesString=JSON.stringify(expectedValues,function replacer(key,value){var type=getPreciseType(value);if(type==='symbol'){return String(value);}return value;});return new PropTypeError('Invalid '+location+' `'+propFullName+'` of value `'+String(propValue)+'` '+('supplied to `'+componentName+'`, expected one of '+valuesString+'.'));}return createChainableTypeChecker(validate);}function createObjectOfTypeChecker(typeChecker){function validate(props,propName,componentName,location,propFullName){if(typeof typeChecker!=='function'){return new PropTypeError('Property `'+propFullName+'` of component `'+componentName+'` has invalid PropType notation inside objectOf.');}var propValue=props[propName];var propType=getPropType(propValue);if(propType!=='object'){return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected an object.'));}for(var key in propValue){if(has(propValue,key)){var error=typeChecker(propValue,key,componentName,location,propFullName+'.'+key,ReactPropTypesSecret$1);if(error instanceof Error){return error;}}}return null;}return createChainableTypeChecker(validate);}function createUnionTypeChecker(arrayOfTypeCheckers){if(!Array.isArray(arrayOfTypeCheckers)){process.env.NODE_ENV!=='production'?printWarning('Invalid argument supplied to oneOfType, expected an instance of array.'):void 0;return emptyFunctionThatReturnsNull;}for(var i=0;i<arrayOfTypeCheckers.length;i++){var checker=arrayOfTypeCheckers[i];if(typeof checker!=='function'){printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but '+'received '+getPostfixForTypeWarning(checker)+' at index '+i+'.');return emptyFunctionThatReturnsNull;}}function validate(props,propName,componentName,location,propFullName){var expectedTypes=[];for(var i=0;i<arrayOfTypeCheckers.length;i++){var checker=arrayOfTypeCheckers[i];var checkerResult=checker(props,propName,componentName,location,propFullName,ReactPropTypesSecret$1);if(checkerResult==null){return null;}if(checkerResult.data&&has(checkerResult.data,'expectedType')){expectedTypes.push(checkerResult.data.expectedType);}}var expectedTypesMessage=expectedTypes.length>0?', expected one of type ['+expectedTypes.join(', ')+']':'';return new PropTypeError('Invalid '+location+' `'+propFullName+'` supplied to '+('`'+componentName+'`'+expectedTypesMessage+'.'));}return createChainableTypeChecker(validate);}function createNodeChecker(){function validate(props,propName,componentName,location,propFullName){if(!isNode(props[propName])){return new PropTypeError('Invalid '+location+' `'+propFullName+'` supplied to '+('`'+componentName+'`, expected a ReactNode.'));}return null;}return createChainableTypeChecker(validate);}function invalidValidatorError(componentName,location,propFullName,key,type){return new PropTypeError((componentName||'React class')+': '+location+' type `'+propFullName+'.'+key+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+type+'`.');}function createShapeTypeChecker(shapeTypes){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];var propType=getPropType(propValue);if(propType!=='object'){return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type `'+propType+'` '+('supplied to `'+componentName+'`, expected `object`.'));}for(var key in shapeTypes){var checker=shapeTypes[key];if(typeof checker!=='function'){return invalidValidatorError(componentName,location,propFullName,key,getPreciseType(checker));}var error=checker(propValue,key,componentName,location,propFullName+'.'+key,ReactPropTypesSecret$1);if(error){return error;}}return null;}return createChainableTypeChecker(validate);}function createStrictShapeTypeChecker(shapeTypes){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];var propType=getPropType(propValue);if(propType!=='object'){return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type `'+propType+'` '+('supplied to `'+componentName+'`, expected `object`.'));}// We need to check all keys in case some are required but missing from props.
var allKeys=assign({},props[propName],shapeTypes);for(var key in allKeys){var checker=shapeTypes[key];if(has(shapeTypes,key)&&typeof checker!=='function'){return invalidValidatorError(componentName,location,propFullName,key,getPreciseType(checker));}if(!checker){return new PropTypeError('Invalid '+location+' `'+propFullName+'` key `'+key+'` supplied to `'+componentName+'`.'+'\nBad object: '+JSON.stringify(props[propName],null,'  ')+'\nValid keys: '+JSON.stringify(Object.keys(shapeTypes),null,'  '));}var error=checker(propValue,key,componentName,location,propFullName+'.'+key,ReactPropTypesSecret$1);if(error){return error;}}return null;}return createChainableTypeChecker(validate);}function isNode(propValue){switch(typeof propValue){case'number':case'string':case'undefined':return true;case'boolean':return!propValue;case'object':if(Array.isArray(propValue)){return propValue.every(isNode);}if(propValue===null||isValidElement(propValue)){return true;}var iteratorFn=getIteratorFn(propValue);if(iteratorFn){var iterator=iteratorFn.call(propValue);var step;if(iteratorFn!==propValue.entries){while(!(step=iterator.next()).done){if(!isNode(step.value)){return false;}}}else{// Iterator will provide entry [k,v] tuples rather than values.
while(!(step=iterator.next()).done){var entry=step.value;if(entry){if(!isNode(entry[1])){return false;}}}}}else{return false;}return true;default:return false;}}function isSymbol(propType,propValue){// Native Symbol.
if(propType==='symbol'){return true;}// falsy value can't be a Symbol
if(!propValue){return false;}// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if(propValue['@@toStringTag']==='Symbol'){return true;}// Fallback for non-spec compliant Symbols which are polyfilled.
if(typeof Symbol==='function'&&propValue instanceof Symbol){return true;}return false;}// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue){var propType=typeof propValue;if(Array.isArray(propValue)){return'array';}if(propValue instanceof RegExp){// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return'object';}if(isSymbol(propType,propValue)){return'symbol';}return propType;}// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue){if(typeof propValue==='undefined'||propValue===null){return''+propValue;}var propType=getPropType(propValue);if(propType==='object'){if(propValue instanceof Date){return'date';}else if(propValue instanceof RegExp){return'regexp';}}return propType;}// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value){var type=getPreciseType(value);switch(type){case'array':case'object':return'an '+type;case'boolean':case'date':case'regexp':return'a '+type;default:return type;}}// Returns class name of the object, if any.
function getClassName(propValue){if(!propValue.constructor||!propValue.constructor.name){return ANONYMOUS;}return propValue.constructor.name;}ReactPropTypes.checkPropTypes=checkPropTypes;ReactPropTypes.resetWarningCache=checkPropTypes.resetWarningCache;ReactPropTypes.PropTypes=ReactPropTypes;return ReactPropTypes;};/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret===ReactPropTypesSecret){// It is still safe when called from React.
return;}var err=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');err.name='Invariant Violation';throw err;}shim.isRequired=shim;function getShim(){return shim;}// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};ReactPropTypes.PropTypes=ReactPropTypes;return ReactPropTypes;};/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */if(process.env.NODE_ENV!=='production'){var ReactIs=reactIs$1.exports;// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess=true;propTypes.exports=factoryWithTypeCheckers(ReactIs.isElement,throwOnDirectAccess);}else{// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
propTypes.exports=factoryWithThrowingShims();}var PropTypes=propTypes.exports;/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */var hasElementType=typeof Element!=='undefined';var hasMap=typeof Map==='function';var hasSet=typeof Set==='function';var hasArrayBuffer=typeof ArrayBuffer==='function'&&!!ArrayBuffer.isView;// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
function equal(a,b){// START: fast-deep-equal es6/index.js 3.1.1
if(a===b)return true;if(a&&b&&typeof a=='object'&&typeof b=='object'){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return false;return true;}// START: Modifications:
// 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
//    to co-exist with es5.
// 2. Replace `for of` with es5 compliant iteration using `for`.
//    Basically, take:
//
//    ```js
//    for (i of a.entries())
//      if (!b.has(i[0])) return false;
//    ```
//
//    ... and convert to:
//
//    ```js
//    it = a.entries();
//    while (!(i = it.next()).done)
//      if (!b.has(i.value[0])) return false;
//    ```
//
//    **Note**: `i` access switches to `i.value`.
var it;if(hasMap&&a instanceof Map&&b instanceof Map){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;it=a.entries();while(!(i=it.next()).done)if(!equal(i.value[1],b.get(i.value[0])))return false;return true;}if(hasSet&&a instanceof Set&&b instanceof Set){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;return true;}// END: Modifications
if(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(b)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(a[i]!==b[i])return false;return true;}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;// END: fast-deep-equal
// START: react-fast-compare
// custom handling for DOM elements
if(hasElementType&&a instanceof Element)return false;// custom handling for React/Preact
for(i=length;i--!==0;){if((keys[i]==='_owner'||keys[i]==='__v'||keys[i]==='__o')&&a.$$typeof){// React-specific: avoid traversing React elements' _owner
// Preact-specific: avoid traversing Preact elements' __v and __o
//    __v = $_original / $_vnode
//    __o = $_owner
// These properties contain circular references and are not needed when
// comparing the actual elements (and not their owners)
// .$$typeof and ._store on just reasonable markers of elements
continue;}// all other properties should be traversed as usual
if(!equal(a[keys[i]],b[keys[i]]))return false;}// END: react-fast-compare
// START: fast-deep-equal
return true;}return a!==a&&b!==b;}// end fast-deep-equal
var reactFastCompare=function isEqual(a,b){try{return equal(a,b);}catch(error){if((error.message||'').match(/stack|recursion/i)){// warn on circular references, don't crash
// browsers give this different errors name and messages:
// chrome/safari: "RangeError", "Maximum call stack size exceeded"
// firefox: "InternalError", too much recursion"
// edge: "Error", "Out of stack space"
console.warn('react-fast-compare cannot handle circular refs');return false;}// some other error. we should definitely know about these
throw error;}};/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ /**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */var NODE_ENV=process.env.NODE_ENV;var invariant$1=function(condition,format,a,b,c,d,e,f){if(NODE_ENV!=='production'){if(format===undefined){throw new Error('invariant requires an error message argument');}}if(!condition){var error;if(format===undefined){error=new Error('Minified exception occurred; use the non-minified dev environment '+'for the full error message and additional helpful warnings.');}else{var args=[a,b,c,d,e,f];var argIndex=0;error=new Error(format.replace(/%s/g,function(){return args[argIndex++];}));error.name='Invariant Violation';}error.framesToPop=1;// we don't care about invariant's own frame
throw error;}};var invariant_1=invariant$1;var shallowequal=function shallowEqual(objA,objB,compare,compareContext){var ret=compare?compare.call(compareContext,objA,objB):void 0;if(ret!==void 0){return!!ret;}if(objA===objB){return true;}if(typeof objA!=="object"||!objA||typeof objB!=="object"||!objB){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}var bHasOwnProperty=Object.prototype.hasOwnProperty.bind(objB);// Test for A's keys different from B.
for(var idx=0;idx<keysA.length;idx++){var key=keysA[idx];if(!bHasOwnProperty(key)){return false;}var valueA=objA[key];var valueB=objB[key];ret=compare?compare.call(compareContext,valueA,valueB,key):void 0;if(ret===false||ret===void 0&&valueA!==valueB){return false;}}return true;};function a$1(){return(a$1=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);}return t;}).apply(this,arguments);}function s$1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,c$2(t,e);}function c$2(t,e){return(c$2=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t;})(t,e);}function u$2(t,e){if(null==t)return{};var r,n,i={},o=Object.keys(t);for(n=0;n<o.length;n++)e.indexOf(r=o[n])>=0||(i[r]=t[r]);return i;}var l$2={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},p$2={rel:["amphtml","canonical","alternate"]},f$2={type:["application/ld+json"]},d$2={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},h$2=Object.keys(l$2).map(function(t){return l$2[t];}),m$2={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},y$2=Object.keys(m$2).reduce(function(t,e){return t[m$2[e]]=e,t;},{}),T$1=function(t,e){for(var r=t.length-1;r>=0;r-=1){var n=t[r];if(Object.prototype.hasOwnProperty.call(n,e))return n[e];}return null;},g$2=function(t){var e=T$1(t,l$2.TITLE),r=T$1(t,"titleTemplate");if(Array.isArray(e)&&(e=e.join("")),r&&e)return r.replace(/%s/g,function(){return e;});var n=T$1(t,"defaultTitle");return e||n||void 0;},b$2=function(t){return T$1(t,"onChangeClientState")||function(){};},v$2=function(t,e){return e.filter(function(e){return void 0!==e[t];}).map(function(e){return e[t];}).reduce(function(t,e){return a$1({},t,e);},{});},A$2=function(t,e){return e.filter(function(t){return void 0!==t[l$2.BASE];}).map(function(t){return t[l$2.BASE];}).reverse().reduce(function(e,r){if(!e.length)for(var n=Object.keys(r),i=0;i<n.length;i+=1){var o=n[i].toLowerCase();if(-1!==t.indexOf(o)&&r[o])return e.concat(r);}return e;},[]);},C$2=function(t,e,r){var n={};return r.filter(function(e){return!!Array.isArray(e[t])||(void 0!==e[t]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+t+' should be of type "Array". Instead found type "'+typeof e[t]+'"'),!1);}).map(function(e){return e[t];}).reverse().reduce(function(t,r){var i={};r.filter(function(t){for(var r,o=Object.keys(t),a=0;a<o.length;a+=1){var s=o[a],c=s.toLowerCase();-1===e.indexOf(c)||"rel"===r&&"canonical"===t[r].toLowerCase()||"rel"===c&&"stylesheet"===t[c].toLowerCase()||(r=c),-1===e.indexOf(s)||"innerHTML"!==s&&"cssText"!==s&&"itemprop"!==s||(r=s);}if(!r||!t[r])return!1;var u=t[r].toLowerCase();return n[r]||(n[r]={}),i[r]||(i[r]={}),!n[r][u]&&(i[r][u]=!0,!0);}).reverse().forEach(function(e){return t.push(e);});for(var o=Object.keys(i),s=0;s<o.length;s+=1){var c=o[s],u=a$1({},n[c],i[c]);n[c]=u;}return t;},[]).reverse();},O$1=function(t,e){if(Array.isArray(t)&&t.length)for(var r=0;r<t.length;r+=1)if(t[r][e])return!0;return!1;},S$1=function(t){return Array.isArray(t)?t.join(""):t;},E$2=function(t,e){return Array.isArray(t)?t.reduce(function(t,r){return function(t,e){for(var r=Object.keys(t),n=0;n<r.length;n+=1)if(e[r[n]]&&e[r[n]].includes(t[r[n]]))return!0;return!1;}(r,e)?t.priority.push(r):t.default.push(r),t;},{priority:[],default:[]}):{default:t};},I$2=function(t,e){var r;return a$1({},t,((r={})[e]=void 0,r));},P$1=[l$2.NOSCRIPT,l$2.SCRIPT,l$2.STYLE],w$2=function(t,e){return void 0===e&&(e=!0),!1===e?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;");},x$2=function(t){return Object.keys(t).reduce(function(e,r){var n=void 0!==t[r]?r+'="'+t[r]+'"':""+r;return e?e+" "+n:n;},"");},L$1=function(t,e){return void 0===e&&(e={}),Object.keys(t).reduce(function(e,r){return e[m$2[r]||r]=t[r],e;},e);},j$1=function(e,r){return r.map(function(r,n){var i,o=((i={key:n})["data-rh"]=!0,i);return Object.keys(r).forEach(function(t){var e=m$2[t]||t;"innerHTML"===e||"cssText"===e?o.dangerouslySetInnerHTML={__html:r.innerHTML||r.cssText}:o[e]=r[t];}),React__default$1["default"].createElement(e,o);});},M$1=function(e,r,n){switch(e){case l$2.TITLE:return{toComponent:function(){return n=r.titleAttributes,(i={key:e=r.title})["data-rh"]=!0,o=L$1(n,i),[React__default$1["default"].createElement(l$2.TITLE,o,e)];var e,n,i,o;},toString:function(){return function(t,e,r,n){var i=x$2(r),o=S$1(e);return i?"<"+t+' data-rh="true" '+i+">"+w$2(o,n)+"</"+t+">":"<"+t+' data-rh="true">'+w$2(o,n)+"</"+t+">";}(e,r.title,r.titleAttributes,n);}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return L$1(r);},toString:function(){return x$2(r);}};default:return{toComponent:function(){return j$1(e,r);},toString:function(){return function(t,e,r){return e.reduce(function(e,n){var i=Object.keys(n).filter(function(t){return!("innerHTML"===t||"cssText"===t);}).reduce(function(t,e){var i=void 0===n[e]?e:e+'="'+w$2(n[e],r)+'"';return t?t+" "+i:i;},""),o=n.innerHTML||n.cssText||"",a=-1===P$1.indexOf(t);return e+"<"+t+' data-rh="true" '+i+(a?"/>":">"+o+"</"+t+">");},"");}(e,r,n);}};}},k$2=function(t){var e=t.baseTag,r=t.bodyAttributes,n=t.encode,i=t.htmlAttributes,o=t.noscriptTags,a=t.styleTags,s=t.title,c=void 0===s?"":s,u=t.titleAttributes,h=t.linkTags,m=t.metaTags,y=t.scriptTags,T={toComponent:function(){},toString:function(){return"";}};if(t.prioritizeSeoTags){var g=function(t){var e=t.linkTags,r=t.scriptTags,n=t.encode,i=E$2(t.metaTags,d$2),o=E$2(e,p$2),a=E$2(r,f$2);return{priorityMethods:{toComponent:function(){return[].concat(j$1(l$2.META,i.priority),j$1(l$2.LINK,o.priority),j$1(l$2.SCRIPT,a.priority));},toString:function(){return M$1(l$2.META,i.priority,n)+" "+M$1(l$2.LINK,o.priority,n)+" "+M$1(l$2.SCRIPT,a.priority,n);}},metaTags:i.default,linkTags:o.default,scriptTags:a.default};}(t);T=g.priorityMethods,h=g.linkTags,m=g.metaTags,y=g.scriptTags;}return{priority:T,base:M$1(l$2.BASE,e,n),bodyAttributes:M$1("bodyAttributes",r,n),htmlAttributes:M$1("htmlAttributes",i,n),link:M$1(l$2.LINK,h,n),meta:M$1(l$2.META,m,n),noscript:M$1(l$2.NOSCRIPT,o,n),script:M$1(l$2.SCRIPT,y,n),style:M$1(l$2.STYLE,a,n),title:M$1(l$2.TITLE,{title:c,titleAttributes:u},n)};},H$2=[],N$1=function(t,e){var r=this;void 0===e&&(e="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(t){r.context.helmet=t;},helmetInstances:{get:function(){return r.canUseDOM?H$2:r.instances;},add:function(t){(r.canUseDOM?H$2:r.instances).push(t);},remove:function(t){var e=(r.canUseDOM?H$2:r.instances).indexOf(t);(r.canUseDOM?H$2:r.instances).splice(e,1);}}},this.context=t,this.canUseDOM=e,e||(t.helmet=k$2({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}));},R$1=React__default$1["default"].createContext({}),D$2=PropTypes.shape({setHelmet:PropTypes.func,helmetInstances:PropTypes.shape({get:PropTypes.func,add:PropTypes.func,remove:PropTypes.func})}),U$1="undefined"!=typeof document,q$2=function(e){function r(t){var n;return(n=e.call(this,t)||this).helmetData=new N$1(n.props.context,r.canUseDOM),n;}return s$1(r,e),r.prototype.render=function(){return React__default$1["default"].createElement(R$1.Provider,{value:this.helmetData.value},this.props.children);},r;}(React$2.Component);q$2.canUseDOM=U$1,q$2.propTypes={context:PropTypes.shape({helmet:PropTypes.shape()}),children:PropTypes.node.isRequired},q$2.defaultProps={context:{}},q$2.displayName="HelmetProvider";var Y$1=function(t,e){var r,n=document.head||document.querySelector(l$2.HEAD),i=n.querySelectorAll(t+"[data-rh]"),o=[].slice.call(i),a=[];return e&&e.length&&e.forEach(function(e){var n=document.createElement(t);for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&("innerHTML"===i?n.innerHTML=e.innerHTML:"cssText"===i?n.styleSheet?n.styleSheet.cssText=e.cssText:n.appendChild(document.createTextNode(e.cssText)):n.setAttribute(i,void 0===e[i]?"":e[i]));n.setAttribute("data-rh","true"),o.some(function(t,e){return r=e,n.isEqualNode(t);})?o.splice(r,1):a.push(n);}),o.forEach(function(t){return t.parentNode.removeChild(t);}),a.forEach(function(t){return n.appendChild(t);}),{oldTags:o,newTags:a};},B$2=function(t,e){var r=document.getElementsByTagName(t)[0];if(r){for(var n=r.getAttribute("data-rh"),i=n?n.split(","):[],o=[].concat(i),a=Object.keys(e),s=0;s<a.length;s+=1){var c=a[s],u=e[c]||"";r.getAttribute(c)!==u&&r.setAttribute(c,u),-1===i.indexOf(c)&&i.push(c);var l=o.indexOf(c);-1!==l&&o.splice(l,1);}for(var p=o.length-1;p>=0;p-=1)r.removeAttribute(o[p]);i.length===o.length?r.removeAttribute("data-rh"):r.getAttribute("data-rh")!==a.join(",")&&r.setAttribute("data-rh",a.join(","));}},K$1=function(t,e){var r=t.baseTag,n=t.htmlAttributes,i=t.linkTags,o=t.metaTags,a=t.noscriptTags,s=t.onChangeClientState,c=t.scriptTags,u=t.styleTags,p=t.title,f=t.titleAttributes;B$2(l$2.BODY,t.bodyAttributes),B$2(l$2.HTML,n),function(t,e){void 0!==t&&document.title!==t&&(document.title=S$1(t)),B$2(l$2.TITLE,e);}(p,f);var d={baseTag:Y$1(l$2.BASE,r),linkTags:Y$1(l$2.LINK,i),metaTags:Y$1(l$2.META,o),noscriptTags:Y$1(l$2.NOSCRIPT,a),scriptTags:Y$1(l$2.SCRIPT,c),styleTags:Y$1(l$2.STYLE,u)},h={},m={};Object.keys(d).forEach(function(t){var e=d[t],r=e.newTags,n=e.oldTags;r.length&&(h[t]=r),n.length&&(m[t]=d[t].oldTags);}),e&&e(),s(t,h,m);},_$1=null,z$2=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).rendered=!1,e;}s$1(e,t);var r=e.prototype;return r.shouldComponentUpdate=function(t){return!shallowequal(t,this.props);},r.componentDidUpdate=function(){this.emitChange();},r.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange();},r.emitChange=function(){var t,e,r=this.props.context,n=r.setHelmet,i=null,o=(t=r.helmetInstances.get().map(function(t){var e=a$1({},t.props);return delete e.context,e;}),{baseTag:A$2(["href"],t),bodyAttributes:v$2("bodyAttributes",t),defer:T$1(t,"defer"),encode:T$1(t,"encodeSpecialCharacters"),htmlAttributes:v$2("htmlAttributes",t),linkTags:C$2(l$2.LINK,["rel","href"],t),metaTags:C$2(l$2.META,["name","charset","http-equiv","property","itemprop"],t),noscriptTags:C$2(l$2.NOSCRIPT,["innerHTML"],t),onChangeClientState:b$2(t),scriptTags:C$2(l$2.SCRIPT,["src","innerHTML"],t),styleTags:C$2(l$2.STYLE,["cssText"],t),title:g$2(t),titleAttributes:v$2("titleAttributes",t),prioritizeSeoTags:O$1(t,"prioritizeSeoTags")});q$2.canUseDOM?(e=o,_$1&&cancelAnimationFrame(_$1),e.defer?_$1=requestAnimationFrame(function(){K$1(e,function(){_$1=null;});}):(K$1(e),_$1=null)):k$2&&(i=k$2(o)),n(i);},r.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange());},r.render=function(){return this.init(),null;},e;}(React$2.Component);z$2.propTypes={context:D$2.isRequired},z$2.displayName="HelmetDispatcher";var F$2=["children"],G$2=["children"],W$1=function(e){function r(){return e.apply(this,arguments)||this;}s$1(r,e);var o=r.prototype;return o.shouldComponentUpdate=function(t){return!reactFastCompare(I$2(this.props,"helmetData"),I$2(t,"helmetData"));},o.mapNestedChildrenToProps=function(t,e){if(!e)return null;switch(t.type){case l$2.SCRIPT:case l$2.NOSCRIPT:return{innerHTML:e};case l$2.STYLE:return{cssText:e};default:throw new Error("<"+t.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.");}},o.flattenArrayTypeChildren=function(t){var e,r=t.child,n=t.arrayTypeChildren;return a$1({},n,((e={})[r.type]=[].concat(n[r.type]||[],[a$1({},t.newChildProps,this.mapNestedChildrenToProps(r,t.nestedChildren))]),e));},o.mapObjectTypeChildren=function(t){var e,r,n=t.child,i=t.newProps,o=t.newChildProps,s=t.nestedChildren;switch(n.type){case l$2.TITLE:return a$1({},i,((e={})[n.type]=s,e.titleAttributes=a$1({},o),e));case l$2.BODY:return a$1({},i,{bodyAttributes:a$1({},o)});case l$2.HTML:return a$1({},i,{htmlAttributes:a$1({},o)});default:return a$1({},i,((r={})[n.type]=a$1({},o),r));}},o.mapArrayTypeChildrenToProps=function(t,e){var r=a$1({},e);return Object.keys(t).forEach(function(e){var n;r=a$1({},r,((n={})[e]=t[e],n));}),r;},o.warnOnInvalidChildren=function(t,e){return invariant_1(h$2.some(function(e){return t.type===e;}),"function"==typeof t.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+h$2.join(", ")+" are allowed. Helmet does not support rendering <"+t.type+"> elements. Refer to our API for more information."),invariant_1(!e||"string"==typeof e||Array.isArray(e)&&!e.some(function(t){return"string"!=typeof t;}),"Helmet expects a string as a child of <"+t.type+">. Did you forget to wrap your children in braces? ( <"+t.type+">{``}</"+t.type+"> ) Refer to our API for more information."),!0;},o.mapChildrenToProps=function(e,r){var n=this,i={};return React__default$1["default"].Children.forEach(e,function(t){if(t&&t.props){var e=t.props,o=e.children,a=u$2(e,F$2),s=Object.keys(a).reduce(function(t,e){return t[y$2[e]||e]=a[e],t;},{}),c=t.type;switch("symbol"==typeof c?c=c.toString():n.warnOnInvalidChildren(t,o),c){case l$2.FRAGMENT:r=n.mapChildrenToProps(o,r);break;case l$2.LINK:case l$2.META:case l$2.NOSCRIPT:case l$2.SCRIPT:case l$2.STYLE:i=n.flattenArrayTypeChildren({child:t,arrayTypeChildren:i,newChildProps:s,nestedChildren:o});break;default:r=n.mapObjectTypeChildren({child:t,newProps:r,newChildProps:s,nestedChildren:o});}}}),this.mapArrayTypeChildrenToProps(i,r);},o.render=function(){var e=this.props,r=e.children,n=u$2(e,G$2),i=a$1({},n),o=n.helmetData;return r&&(i=this.mapChildrenToProps(r,i)),!o||o instanceof N$1||(o=new N$1(o.context,o.instances)),o?React__default$1["default"].createElement(z$2,a$1({},i,{context:o.value,helmetData:void 0})):React__default$1["default"].createElement(R$1.Consumer,null,function(e){return React__default$1["default"].createElement(z$2,a$1({},i,{context:e}));});},r;}(React$2.Component);W$1.propTypes={base:PropTypes.object,bodyAttributes:PropTypes.object,children:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node]),defaultTitle:PropTypes.string,defer:PropTypes.bool,encodeSpecialCharacters:PropTypes.bool,htmlAttributes:PropTypes.object,link:PropTypes.arrayOf(PropTypes.object),meta:PropTypes.arrayOf(PropTypes.object),noscript:PropTypes.arrayOf(PropTypes.object),onChangeClientState:PropTypes.func,script:PropTypes.arrayOf(PropTypes.object),style:PropTypes.arrayOf(PropTypes.object),title:PropTypes.string,titleAttributes:PropTypes.object,titleTemplate:PropTypes.string,prioritizeSeoTags:PropTypes.bool,helmetData:PropTypes.object},W$1.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},W$1.displayName="Helmet";var cjs$1={};Object.defineProperty(cjs$1,'__esModule',{value:true});/* eslint-disable no-undefined,no-param-reassign,no-shadow */ /**
 * Throttle execution of a function. Especially useful for rate limiting
 * execution of handlers on events like resize and scroll.
 *
 * @param  {number}    delay -          A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
 * @param  {boolean}   [noTrailing] -   Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
 *                                    throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
 *                                    after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
 *                                    the internal counter is reset).
 * @param  {Function}  callback -       A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
 *                                    to `callback` when the throttled-function is executed.
 * @param  {boolean}   [debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
 *                                    schedule `callback` to execute after `delay` ms.
 *
 * @returns {Function}  A new, throttled, function.
 */function throttle$1(delay,noTrailing,callback,debounceMode){/*
   * After wrapper has stopped being called, this timeout ensures that
   * `callback` is executed at the proper times in `throttle` and `end`
   * debounce modes.
   */var timeoutID;var cancelled=false;// Keep track of the last time `callback` was executed.
var lastExec=0;// Function to clear existing timeout
function clearExistingTimeout(){if(timeoutID){clearTimeout(timeoutID);}}// Function to cancel next exec
function cancel(){clearExistingTimeout();cancelled=true;}// `noTrailing` defaults to falsy.
if(typeof noTrailing!=='boolean'){debounceMode=callback;callback=noTrailing;noTrailing=undefined;}/*
   * The `wrapper` function encapsulates all of the throttling / debouncing
   * functionality and when executed will limit the rate at which `callback`
   * is executed.
   */function wrapper(){for(var _len=arguments.length,arguments_=new Array(_len),_key=0;_key<_len;_key++){arguments_[_key]=arguments[_key];}var self=this;var elapsed=Date.now()-lastExec;if(cancelled){return;}// Execute `callback` and update the `lastExec` timestamp.
function exec(){lastExec=Date.now();callback.apply(self,arguments_);}/*
     * If `debounceMode` is true (at begin) this is used to clear the flag
     * to allow future `callback` executions.
     */function clear(){timeoutID=undefined;}if(debounceMode&&!timeoutID){/*
       * Since `wrapper` is being called for the first time and
       * `debounceMode` is true (at begin), execute `callback`.
       */exec();}clearExistingTimeout();if(debounceMode===undefined&&elapsed>delay){/*
       * In throttle mode, if `delay` time has been exceeded, execute
       * `callback`.
       */exec();}else if(noTrailing!==true){/*
       * In trailing throttle mode, since `delay` time has not been
       * exceeded, schedule `callback` to execute `delay` ms after most
       * recent execution.
       *
       * If `debounceMode` is true (at begin), schedule `clear` to execute
       * after `delay` ms.
       *
       * If `debounceMode` is false (at end), schedule `callback` to
       * execute after `delay` ms.
       */timeoutID=setTimeout(debounceMode?clear:exec,debounceMode===undefined?delay-elapsed:delay);}}wrapper.cancel=cancel;// Return the wrapper function.
return wrapper;}/* eslint-disable no-undefined */ /**
 * Debounce execution of a function. Debouncing, unlike throttling,
 * guarantees that a function is only executed a single time, either at the
 * very beginning of a series of calls, or at the very end.
 *
 * @param  {number}   delay -         A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
 * @param  {boolean}  [atBegin] -     Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
 *                                  after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
 *                                  (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
 * @param  {Function} callback -      A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
 *                                  to `callback` when the debounced-function is executed.
 *
 * @returns {Function} A new, debounced function.
 */function debounce$3(delay,atBegin,callback){return callback===undefined?throttle$1(delay,atBegin,false):throttle$1(delay,callback,atBegin!==false);}cjs$1.debounce=debounce$3;cjs$1.throttle=throttle$1;var collectionUtils={exports:{}};var utils$3=collectionUtils.exports={};/**
 * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.
 * @public
 * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.
 * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.
 * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.
 */utils$3.forEach=function(collection,callback){for(var i=0;i<collection.length;i++){var result=callback(collection[i]);if(result){return result;}}};var elementUtils=function(options){var getState=options.stateHandler.getState;/**
   * Tells if the element has been made detectable and ready to be listened for resize events.
   * @public
   * @param {element} The element to check.
   * @returns {boolean} True or false depending on if the element is detectable or not.
   */function isDetectable(element){var state=getState(element);return state&&!!state.isDetectable;}/**
   * Marks the element that it has been made detectable and ready to be listened for resize events.
   * @public
   * @param {element} The element to mark.
   */function markAsDetectable(element){getState(element).isDetectable=true;}/**
   * Tells if the element is busy or not.
   * @public
   * @param {element} The element to check.
   * @returns {boolean} True or false depending on if the element is busy or not.
   */function isBusy(element){return!!getState(element).busy;}/**
   * Marks the object is busy and should not be made detectable.
   * @public
   * @param {element} element The element to mark.
   * @param {boolean} busy If the element is busy or not.
   */function markBusy(element,busy){getState(element).busy=!!busy;}return{isDetectable:isDetectable,markAsDetectable:markAsDetectable,isBusy:isBusy,markBusy:markBusy};};var listenerHandler=function(idHandler){var eventListeners={};/**
   * Gets all listeners for the given element.
   * @public
   * @param {element} element The element to get all listeners for.
   * @returns All listeners for the given element.
   */function getListeners(element){var id=idHandler.get(element);if(id===undefined){return[];}return eventListeners[id]||[];}/**
   * Stores the given listener for the given element. Will not actually add the listener to the element.
   * @public
   * @param {element} element The element that should have the listener added.
   * @param {function} listener The callback that the element has added.
   */function addListener(element,listener){var id=idHandler.get(element);if(!eventListeners[id]){eventListeners[id]=[];}eventListeners[id].push(listener);}function removeListener(element,listener){var listeners=getListeners(element);for(var i=0,len=listeners.length;i<len;++i){if(listeners[i]===listener){listeners.splice(i,1);break;}}}function removeAllListeners(element){var listeners=getListeners(element);if(!listeners){return;}listeners.length=0;}return{get:getListeners,add:addListener,removeListener:removeListener,removeAllListeners:removeAllListeners};};var idGenerator=function(){var idCount=1;/**
   * Generates a new unique id in the context.
   * @public
   * @returns {number} A unique id in the context.
   */function generate(){return idCount++;}return{generate:generate};};var idHandler=function(options){var idGenerator=options.idGenerator;var getState=options.stateHandler.getState;/**
   * Gets the resize detector id of the element.
   * @public
   * @param {element} element The target element to get the id of.
   * @returns {string|number|null} The id of the element. Null if it has no id.
   */function getId(element){var state=getState(element);if(state&&state.id!==undefined){return state.id;}return null;}/**
   * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.
   * @public
   * @param {element} element The target element to set the id of.
   * @returns {string|number|null} The id of the element.
   */function setId(element){var state=getState(element);if(!state){throw new Error("setId required the element to have a resize detection state.");}var id=idGenerator.generate();state.id=id;return id;}return{get:getId,set:setId};};/* global console: false */ /**
 * Reporter that handles the reporting of logs, warnings and errors.
 * @public
 * @param {boolean} quiet Tells if the reporter should be quiet or not.
 */var reporter=function(quiet){function noop(){//Does nothing.
}var reporter={log:noop,warn:noop,error:noop};if(!quiet&&window.console){var attachFunction=function(reporter,name){//The proxy is needed to be able to call the method with the console context,
//since we cannot use bind.
reporter[name]=function reporterProxy(){var f=console[name];if(f.apply){//IE9 does not support console.log.apply :)
f.apply(console,arguments);}else{for(var i=0;i<arguments.length;i++){f(arguments[i]);}}};};attachFunction(reporter,"log");attachFunction(reporter,"warn");attachFunction(reporter,"error");}return reporter;};var browserDetector$2={exports:{}};var detector=browserDetector$2.exports={};detector.isIE=function(version){function isAnyIeVersion(){var agent=navigator.userAgent.toLowerCase();return agent.indexOf("msie")!==-1||agent.indexOf("trident")!==-1||agent.indexOf(" edge/")!==-1;}if(!isAnyIeVersion()){return false;}if(!version){return true;}//Shamelessly stolen from https://gist.github.com/padolsey/527683
var ieVersion=function(){var undef,v=3,div=document.createElement("div"),all=div.getElementsByTagName("i");do{div.innerHTML="<!--[if gt IE "+ ++v+"]><i></i><![endif]-->";}while(all[0]);return v>4?v:undef;}();return version===ieVersion;};detector.isLegacyOpera=function(){return!!window.opera;};var utils$2={exports:{}};var utils$1=utils$2.exports={};utils$1.getOption=getOption$1;function getOption$1(options,name,defaultValue){var value=options[name];if((value===undefined||value===null)&&defaultValue!==undefined){return defaultValue;}return value;}var utils=utils$2.exports;var batchProcessor=function batchProcessorMaker(options){options=options||{};var reporter=options.reporter;var asyncProcess=utils.getOption(options,"async",true);var autoProcess=utils.getOption(options,"auto",true);if(autoProcess&&!asyncProcess){reporter&&reporter.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true.");asyncProcess=true;}var batch=Batch();var asyncFrameHandler;var isProcessing=false;function addFunction(level,fn){if(!isProcessing&&autoProcess&&asyncProcess&&batch.size()===0){// Since this is async, it is guaranteed to be executed after that the fn is added to the batch.
// This needs to be done before, since we're checking the size of the batch to be 0.
processBatchAsync();}batch.add(level,fn);}function processBatch(){// Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.
// Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).
isProcessing=true;while(batch.size()){var processingBatch=batch;batch=Batch();processingBatch.process();}isProcessing=false;}function forceProcessBatch(localAsyncProcess){if(isProcessing){return;}if(localAsyncProcess===undefined){localAsyncProcess=asyncProcess;}if(asyncFrameHandler){cancelFrame(asyncFrameHandler);asyncFrameHandler=null;}if(localAsyncProcess){processBatchAsync();}else{processBatch();}}function processBatchAsync(){asyncFrameHandler=requestFrame(processBatch);}function cancelFrame(listener){// var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
var cancel=clearTimeout;return cancel(listener);}function requestFrame(callback){// var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };
var raf=function(fn){return setTimeout(fn,0);};return raf(callback);}return{add:addFunction,force:forceProcessBatch};};function Batch(){var batch={};var size=0;var topLevel=0;var bottomLevel=0;function add(level,fn){if(!fn){fn=level;level=0;}if(level>topLevel){topLevel=level;}else if(level<bottomLevel){bottomLevel=level;}if(!batch[level]){batch[level]=[];}batch[level].push(fn);size++;}function process(){for(var level=bottomLevel;level<=topLevel;level++){var fns=batch[level];for(var i=0;i<fns.length;i++){var fn=fns[i];fn();}}}function getSize(){return size;}return{add:add,process:process,size:getSize};}var prop="_erd";function initState(element){element[prop]={};return getState$1(element);}function getState$1(element){return element[prop];}function cleanState(element){delete element[prop];}var stateHandler$1={initState:initState,getState:getState$1,cleanState:cleanState};/**
 * Resize detection strategy that injects objects to elements in order to detect resize events.
 * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/
 */var browserDetector$1=browserDetector$2.exports;var object=function(options){options=options||{};var reporter=options.reporter;var batchProcessor=options.batchProcessor;var getState=options.stateHandler.getState;if(!reporter){throw new Error("Missing required dependency: reporter.");}/**
   * Adds a resize event listener to the element.
   * @public
   * @param {element} element The element that should have the listener added.
   * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
   */function addListener(element,listener){function listenerProxy(){listener(element);}if(browserDetector$1.isIE(8)){//IE 8 does not support object, but supports the resize event directly on elements.
getState(element).object={proxy:listenerProxy};element.attachEvent("onresize",listenerProxy);}else{var object=getObject(element);if(!object){throw new Error("Element is not detectable by this strategy.");}object.contentDocument.defaultView.addEventListener("resize",listenerProxy);}}function buildCssTextString(rules){var seperator=options.important?" !important; ":"; ";return(rules.join(seperator)+seperator).trim();}/**
   * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
   * @private
   * @param {object} options Optional options object.
   * @param {element} element The element to make detectable
   * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
   */function makeDetectable(options,element,callback){if(!callback){callback=element;element=options;options=null;}options=options||{};options.debug;function injectObject(element,callback){var OBJECT_STYLE=buildCssTextString(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]);//The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.
// Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.
var positionCheckPerformed=false;// The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.
// Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.
var style=window.getComputedStyle(element);var width=element.offsetWidth;var height=element.offsetHeight;getState(element).startSize={width:width,height:height};function mutateDom(){function alterPositionStyles(){if(style.position==="static"){element.style.setProperty("position","relative",options.important?"important":"");var removeRelativeStyles=function(reporter,element,style,property){function getNumericalValue(value){return value.replace(/[^-\d\.]/g,"");}var value=style[property];if(value!=="auto"&&getNumericalValue(value)!=="0"){reporter.warn("An element that is positioned static has style."+property+"="+value+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+property+" will be set to 0. Element: ",element);element.style.setProperty(property,"0",options.important?"important":"");}};//Check so that there are no accidental styles that will make the element styled differently now that is is relative.
//If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
removeRelativeStyles(reporter,element,style,"top");removeRelativeStyles(reporter,element,style,"right");removeRelativeStyles(reporter,element,style,"bottom");removeRelativeStyles(reporter,element,style,"left");}}function onObjectLoad(){// The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.
if(!positionCheckPerformed){alterPositionStyles();}/*jshint validthis: true */function getDocument(element,callback){//Opera 12 seem to call the object.onload before the actual document has been created.
//So if it is not present, poll it with an timeout until it is present.
//TODO: Could maybe be handled better with object.onreadystatechange or similar.
if(!element.contentDocument){var state=getState(element);if(state.checkForObjectDocumentTimeoutId){window.clearTimeout(state.checkForObjectDocumentTimeoutId);}state.checkForObjectDocumentTimeoutId=setTimeout(function checkForObjectDocument(){state.checkForObjectDocumentTimeoutId=0;getDocument(element,callback);},100);return;}callback(element.contentDocument);}//Mutating the object element here seems to fire another load event.
//Mutating the inner document of the object element is fine though.
var objectElement=this;//Create the style element to be added to the object.
getDocument(objectElement,function onObjectDocumentReady(objectDocument){//Notify that the element is ready to be listened to.
callback(element);});}// The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.
// The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.
if(style.position!==""){alterPositionStyles();positionCheckPerformed=true;}//Add an object element as a child to the target element that will be listened to for resize events.
var object=document.createElement("object");object.style.cssText=OBJECT_STYLE;object.tabIndex=-1;object.type="text/html";object.setAttribute("aria-hidden","true");object.onload=onObjectLoad;//Safari: This must occur before adding the object to the DOM.
//IE: Does not like that this happens before, even if it is also added after.
if(!browserDetector$1.isIE()){object.data="about:blank";}if(!getState(element)){// The element has been uninstalled before the actual loading happened.
return;}element.appendChild(object);getState(element).object=object;//IE: This must occur after adding the object to the DOM.
if(browserDetector$1.isIE()){object.data="about:blank";}}if(batchProcessor){batchProcessor.add(mutateDom);}else{mutateDom();}}if(browserDetector$1.isIE(8)){//IE 8 does not support objects properly. Luckily they do support the resize event.
//So do not inject the object and notify that the element is already ready to be listened to.
//The event handler for the resize event is attached in the utils.addListener instead.
callback(element);}else{injectObject(element,callback);}}/**
   * Returns the child object of the target element.
   * @private
   * @param {element} element The target element.
   * @returns The object element of the target.
   */function getObject(element){return getState(element).object;}function uninstall(element){if(!getState(element)){return;}var object=getObject(element);if(!object){return;}if(browserDetector$1.isIE(8)){element.detachEvent("onresize",object.proxy);}else{element.removeChild(object);}if(getState(element).checkForObjectDocumentTimeoutId){window.clearTimeout(getState(element).checkForObjectDocumentTimeoutId);}delete getState(element).object;}return{makeDetectable:makeDetectable,addListener:addListener,uninstall:uninstall};};/**
 * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.
 * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js
 */var forEach$1=collectionUtils.exports.forEach;var scroll=function(options){options=options||{};var reporter=options.reporter;var batchProcessor=options.batchProcessor;var getState=options.stateHandler.getState;options.stateHandler.hasState;var idHandler=options.idHandler;if(!batchProcessor){throw new Error("Missing required dependency: batchProcessor");}if(!reporter){throw new Error("Missing required dependency: reporter.");}//TODO: Could this perhaps be done at installation time?
var scrollbarSizes=getScrollbarSizes();var styleId="erd_scroll_detection_scrollbar_style";var detectionContainerClass="erd_scroll_detection_container";function initDocument(targetDocument){// Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.
// The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).
injectScrollStyle(targetDocument,styleId,detectionContainerClass);}initDocument(window.document);function buildCssTextString(rules){var seperator=options.important?" !important; ":"; ";return(rules.join(seperator)+seperator).trim();}function getScrollbarSizes(){var width=500;var height=500;var child=document.createElement("div");child.style.cssText=buildCssTextString(["position: absolute","width: "+width*2+"px","height: "+height*2+"px","visibility: hidden","margin: 0","padding: 0"]);var container=document.createElement("div");container.style.cssText=buildCssTextString(["position: absolute","width: "+width+"px","height: "+height+"px","overflow: scroll","visibility: none","top: "+-width*3+"px","left: "+-height*3+"px","visibility: hidden","margin: 0","padding: 0"]);container.appendChild(child);document.body.insertBefore(container,document.body.firstChild);var widthSize=width-container.clientWidth;var heightSize=height-container.clientHeight;document.body.removeChild(container);return{width:widthSize,height:heightSize};}function injectScrollStyle(targetDocument,styleId,containerClass){function injectStyle(style,method){method=method||function(element){targetDocument.head.appendChild(element);};var styleElement=targetDocument.createElement("style");styleElement.innerHTML=style;styleElement.id=styleId;method(styleElement);return styleElement;}if(!targetDocument.getElementById(styleId)){var containerAnimationClass=containerClass+"_animation";var containerAnimationActiveClass=containerClass+"_animation_active";var style="/* Created by the element-resize-detector library. */\n";style+="."+containerClass+" > div::-webkit-scrollbar { "+buildCssTextString(["display: none"])+" }\n\n";style+="."+containerAnimationActiveClass+" { "+buildCssTextString(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+containerAnimationClass,"animation-name: "+containerAnimationClass])+" }\n";style+="@-webkit-keyframes "+containerAnimationClass+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n";style+="@keyframes "+containerAnimationClass+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }";injectStyle(style);}}function addAnimationClass(element){element.className+=" "+detectionContainerClass+"_animation_active";}function addEvent(el,name,cb){if(el.addEventListener){el.addEventListener(name,cb);}else if(el.attachEvent){el.attachEvent("on"+name,cb);}else{return reporter.error("[scroll] Don't know how to add event listeners.");}}function removeEvent(el,name,cb){if(el.removeEventListener){el.removeEventListener(name,cb);}else if(el.detachEvent){el.detachEvent("on"+name,cb);}else{return reporter.error("[scroll] Don't know how to remove event listeners.");}}function getExpandElement(element){return getState(element).container.childNodes[0].childNodes[0].childNodes[0];}function getShrinkElement(element){return getState(element).container.childNodes[0].childNodes[0].childNodes[1];}/**
   * Adds a resize event listener to the element.
   * @public
   * @param {element} element The element that should have the listener added.
   * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
   */function addListener(element,listener){var listeners=getState(element).listeners;if(!listeners.push){throw new Error("Cannot add listener to an element that is not detectable.");}getState(element).listeners.push(listener);}/**
   * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
   * @private
   * @param {object} options Optional options object.
   * @param {element} element The element to make detectable
   * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
   */function makeDetectable(options,element,callback){if(!callback){callback=element;element=options;options=null;}options=options||{};function debug(){if(options.debug){var args=Array.prototype.slice.call(arguments);args.unshift(idHandler.get(element),"Scroll: ");if(reporter.log.apply){reporter.log.apply(null,args);}else{for(var i=0;i<args.length;i++){reporter.log(args[i]);}}}}function isDetached(element){function isInDocument(element){var isInShadowRoot=element.getRootNode&&element.getRootNode().contains(element);return element===element.ownerDocument.body||element.ownerDocument.body.contains(element)||isInShadowRoot;}if(!isInDocument(element)){return true;}// FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520
if(window.getComputedStyle(element)===null){return true;}return false;}function isUnrendered(element){// Check the absolute positioned container since the top level container is display: inline.
var container=getState(element).container.childNodes[0];var style=window.getComputedStyle(container);return!style.width||style.width.indexOf("px")===-1;//Can only compute pixel value when rendered.
}function getStyle(){// Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,
// so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).
var elementStyle=window.getComputedStyle(element);var style={};style.position=elementStyle.position;style.width=element.offsetWidth;style.height=element.offsetHeight;style.top=elementStyle.top;style.right=elementStyle.right;style.bottom=elementStyle.bottom;style.left=elementStyle.left;style.widthCSS=elementStyle.width;style.heightCSS=elementStyle.height;return style;}function storeStartSize(){var style=getStyle();getState(element).startSize={width:style.width,height:style.height};debug("Element start size",getState(element).startSize);}function initListeners(){getState(element).listeners=[];}function storeStyle(){debug("storeStyle invoked.");if(!getState(element)){debug("Aborting because element has been uninstalled");return;}var style=getStyle();getState(element).style=style;}function storeCurrentSize(element,width,height){getState(element).lastWidth=width;getState(element).lastHeight=height;}function getExpandChildElement(element){return getExpandElement(element).childNodes[0];}function getWidthOffset(){return 2*scrollbarSizes.width+1;}function getHeightOffset(){return 2*scrollbarSizes.height+1;}function getExpandWidth(width){return width+10+getWidthOffset();}function getExpandHeight(height){return height+10+getHeightOffset();}function getShrinkWidth(width){return width*2+getWidthOffset();}function getShrinkHeight(height){return height*2+getHeightOffset();}function positionScrollbars(element,width,height){var expand=getExpandElement(element);var shrink=getShrinkElement(element);var expandWidth=getExpandWidth(width);var expandHeight=getExpandHeight(height);var shrinkWidth=getShrinkWidth(width);var shrinkHeight=getShrinkHeight(height);expand.scrollLeft=expandWidth;expand.scrollTop=expandHeight;shrink.scrollLeft=shrinkWidth;shrink.scrollTop=shrinkHeight;}function injectContainerElement(){var container=getState(element).container;if(!container){container=document.createElement("div");container.className=detectionContainerClass;container.style.cssText=buildCssTextString(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]);getState(element).container=container;addAnimationClass(container);element.appendChild(container);var onAnimationStart=function(){getState(element).onRendered&&getState(element).onRendered();};addEvent(container,"animationstart",onAnimationStart);// Store the event handler here so that they may be removed when uninstall is called.
// See uninstall function for an explanation why it is needed.
getState(element).onAnimationStart=onAnimationStart;}return container;}function injectScrollElements(){function alterPositionStyles(){var style=getState(element).style;if(style.position==="static"){element.style.setProperty("position","relative",options.important?"important":"");var removeRelativeStyles=function(reporter,element,style,property){function getNumericalValue(value){return value.replace(/[^-\d\.]/g,"");}var value=style[property];if(value!=="auto"&&getNumericalValue(value)!=="0"){reporter.warn("An element that is positioned static has style."+property+"="+value+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+property+" will be set to 0. Element: ",element);element.style[property]=0;}};//Check so that there are no accidental styles that will make the element styled differently now that is is relative.
//If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
removeRelativeStyles(reporter,element,style,"top");removeRelativeStyles(reporter,element,style,"right");removeRelativeStyles(reporter,element,style,"bottom");removeRelativeStyles(reporter,element,style,"left");}}function getLeftTopBottomRightCssText(left,top,bottom,right){left=!left?"0":left+"px";top=!top?"0":top+"px";bottom=!bottom?"0":bottom+"px";right=!right?"0":right+"px";return["left: "+left,"top: "+top,"right: "+right,"bottom: "+bottom];}debug("Injecting elements");if(!getState(element)){debug("Aborting because element has been uninstalled");return;}alterPositionStyles();var rootContainer=getState(element).container;if(!rootContainer){rootContainer=injectContainerElement();}// Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),
// we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than
// the targeted element.
// When the bug is resolved, "containerContainer" may be removed.
// The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).
// This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.
var scrollbarWidth=scrollbarSizes.width;var scrollbarHeight=scrollbarSizes.height;var containerContainerStyle=buildCssTextString(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]);var containerStyle=buildCssTextString(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(getLeftTopBottomRightCssText(-(1+scrollbarWidth),-(1+scrollbarHeight),-scrollbarHeight,-scrollbarWidth)));var expandStyle=buildCssTextString(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]);var shrinkStyle=buildCssTextString(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]);var expandChildStyle=buildCssTextString(["position: absolute","left: 0","top: 0"]);var shrinkChildStyle=buildCssTextString(["position: absolute","width: 200%","height: 200%"]);var containerContainer=document.createElement("div");var container=document.createElement("div");var expand=document.createElement("div");var expandChild=document.createElement("div");var shrink=document.createElement("div");var shrinkChild=document.createElement("div");// Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56
// However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.
containerContainer.dir="ltr";containerContainer.style.cssText=containerContainerStyle;containerContainer.className=detectionContainerClass;container.className=detectionContainerClass;container.style.cssText=containerStyle;expand.style.cssText=expandStyle;expandChild.style.cssText=expandChildStyle;shrink.style.cssText=shrinkStyle;shrinkChild.style.cssText=shrinkChildStyle;expand.appendChild(expandChild);shrink.appendChild(shrinkChild);container.appendChild(expand);container.appendChild(shrink);containerContainer.appendChild(container);rootContainer.appendChild(containerContainer);function onExpandScroll(){var state=getState(element);if(state&&state.onExpand){state.onExpand();}else{debug("Aborting expand scroll handler: element has been uninstalled");}}function onShrinkScroll(){var state=getState(element);if(state&&state.onShrink){state.onShrink();}else{debug("Aborting shrink scroll handler: element has been uninstalled");}}addEvent(expand,"scroll",onExpandScroll);addEvent(shrink,"scroll",onShrinkScroll);// Store the event handlers here so that they may be removed when uninstall is called.
// See uninstall function for an explanation why it is needed.
getState(element).onExpandScroll=onExpandScroll;getState(element).onShrinkScroll=onShrinkScroll;}function registerListenersAndPositionElements(){function updateChildSizes(element,width,height){var expandChild=getExpandChildElement(element);var expandWidth=getExpandWidth(width);var expandHeight=getExpandHeight(height);expandChild.style.setProperty("width",expandWidth+"px",options.important?"important":"");expandChild.style.setProperty("height",expandHeight+"px",options.important?"important":"");}function updateDetectorElements(done){var width=element.offsetWidth;var height=element.offsetHeight;// Check whether the size has actually changed since last time the algorithm ran. If not, some steps may be skipped.
var sizeChanged=width!==getState(element).lastWidth||height!==getState(element).lastHeight;debug("Storing current size",width,height);// Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.
// Otherwise the if-check in handleScroll is useless.
storeCurrentSize(element,width,height);// Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.
// Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.
batchProcessor.add(0,function performUpdateChildSizes(){if(!sizeChanged){return;}if(!getState(element)){debug("Aborting because element has been uninstalled");return;}if(!areElementsInjected()){debug("Aborting because element container has not been initialized");return;}if(options.debug){var w=element.offsetWidth;var h=element.offsetHeight;if(w!==width||h!==height){reporter.warn(idHandler.get(element),"Scroll: Size changed before updating detector elements.");}}updateChildSizes(element,width,height);});batchProcessor.add(1,function updateScrollbars(){// This function needs to be invoked event though the size is unchanged. The element could have been resized very quickly and then
// been restored to the original size, which will have changed the scrollbar positions.
if(!getState(element)){debug("Aborting because element has been uninstalled");return;}if(!areElementsInjected()){debug("Aborting because element container has not been initialized");return;}positionScrollbars(element,width,height);});if(sizeChanged&&done){batchProcessor.add(2,function(){if(!getState(element)){debug("Aborting because element has been uninstalled");return;}if(!areElementsInjected()){debug("Aborting because element container has not been initialized");return;}done();});}}function areElementsInjected(){return!!getState(element).container;}function notifyListenersIfNeeded(){function isFirstNotify(){return getState(element).lastNotifiedWidth===undefined;}debug("notifyListenersIfNeeded invoked");var state=getState(element);// Don't notify if the current size is the start size, and this is the first notification.
if(isFirstNotify()&&state.lastWidth===state.startSize.width&&state.lastHeight===state.startSize.height){return debug("Not notifying: Size is the same as the start size, and there has been no notification yet.");}// Don't notify if the size already has been notified.
if(state.lastWidth===state.lastNotifiedWidth&&state.lastHeight===state.lastNotifiedHeight){return debug("Not notifying: Size already notified");}debug("Current size not notified, notifying...");state.lastNotifiedWidth=state.lastWidth;state.lastNotifiedHeight=state.lastHeight;forEach$1(getState(element).listeners,function(listener){listener(element);});}function handleRender(){debug("startanimation triggered.");if(isUnrendered(element)){debug("Ignoring since element is still unrendered...");return;}debug("Element rendered.");var expand=getExpandElement(element);var shrink=getShrinkElement(element);if(expand.scrollLeft===0||expand.scrollTop===0||shrink.scrollLeft===0||shrink.scrollTop===0){debug("Scrollbars out of sync. Updating detector elements...");updateDetectorElements(notifyListenersIfNeeded);}}function handleScroll(){debug("Scroll detected.");if(isUnrendered(element)){// Element is still unrendered. Skip this scroll event.
debug("Scroll event fired while unrendered. Ignoring...");return;}updateDetectorElements(notifyListenersIfNeeded);}debug("registerListenersAndPositionElements invoked.");if(!getState(element)){debug("Aborting because element has been uninstalled");return;}getState(element).onRendered=handleRender;getState(element).onExpand=handleScroll;getState(element).onShrink=handleScroll;var style=getState(element).style;updateChildSizes(element,style.width,style.height);}function finalizeDomMutation(){debug("finalizeDomMutation invoked.");if(!getState(element)){debug("Aborting because element has been uninstalled");return;}var style=getState(element).style;storeCurrentSize(element,style.width,style.height);positionScrollbars(element,style.width,style.height);}function ready(){callback(element);}function install(){debug("Installing...");initListeners();storeStartSize();batchProcessor.add(0,storeStyle);batchProcessor.add(1,injectScrollElements);batchProcessor.add(2,registerListenersAndPositionElements);batchProcessor.add(3,finalizeDomMutation);batchProcessor.add(4,ready);}debug("Making detectable...");if(isDetached(element)){debug("Element is detached");injectContainerElement();debug("Waiting until element is attached...");getState(element).onRendered=function(){debug("Element is now attached");install();};}else{install();}}function uninstall(element){var state=getState(element);if(!state){// Uninstall has been called on a non-erd element.
return;}// Uninstall may have been called in the following scenarios:
// (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).
// (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).
// (3) After the installation process (here, state.busy = false and all the stuff has been injected).
// So to be on the safe side, let's check for each thing before removing.
// We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.
state.onExpandScroll&&removeEvent(getExpandElement(element),"scroll",state.onExpandScroll);state.onShrinkScroll&&removeEvent(getShrinkElement(element),"scroll",state.onShrinkScroll);state.onAnimationStart&&removeEvent(state.container,"animationstart",state.onAnimationStart);state.container&&element.removeChild(state.container);}return{makeDetectable:makeDetectable,addListener:addListener,uninstall:uninstall,initDocument:initDocument};};var forEach=collectionUtils.exports.forEach;var elementUtilsMaker=elementUtils;var listenerHandlerMaker=listenerHandler;var idGeneratorMaker=idGenerator;var idHandlerMaker=idHandler;var reporterMaker=reporter;var browserDetector=browserDetector$2.exports;var batchProcessorMaker=batchProcessor;var stateHandler=stateHandler$1;//Detection strategies.
var objectStrategyMaker=object;var scrollStrategyMaker=scroll;function isCollection(obj){return Array.isArray(obj)||obj.length!==undefined;}function toArray(collection){if(!Array.isArray(collection)){var array=[];forEach(collection,function(obj){array.push(obj);});return array;}else{return collection;}}function isElement(obj){return obj&&obj.nodeType===1;}/**
 * @typedef idHandler
 * @type {object}
 * @property {function} get Gets the resize detector id of the element.
 * @property {function} set Generate and sets the resize detector id of the element.
 */ /**
 * @typedef Options
 * @type {object}
 * @property {boolean} callOnAdd    Determines if listeners should be called when they are getting added.
                                    Default is true. If true, the listener is guaranteed to be called when it has been added.
                                    If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).
 * @property {idHandler} idHandler  A custom id handler that is responsible for generating, setting and retrieving id's for elements.
                                    If not provided, a default id handler will be used.
 * @property {reporter} reporter    A custom reporter that handles reporting logs, warnings and errors.
                                    If not provided, a default id handler will be used.
                                    If set to false, then nothing will be reported.
 * @property {boolean} debug        If set to true, the the system will report debug messages as default for the listenTo method.
 */ /**
 * Creates an element resize detector instance.
 * @public
 * @param {Options?} options Optional global options object that will decide how this instance will work.
 */var elementResizeDetector=function(options){options=options||{};//idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.
var idHandler;if(options.idHandler){// To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler
// so that readonly flag always is true when it's used here. This may be removed next major version bump.
idHandler={get:function(element){return options.idHandler.get(element,true);},set:options.idHandler.set};}else{var idGenerator=idGeneratorMaker();var defaultIdHandler=idHandlerMaker({idGenerator:idGenerator,stateHandler:stateHandler});idHandler=defaultIdHandler;}//reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.
var reporter=options.reporter;if(!reporter){//If options.reporter is false, then the reporter should be quiet.
var quiet=reporter===false;reporter=reporterMaker(quiet);}//batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.
var batchProcessor=getOption(options,"batchProcessor",batchProcessorMaker({reporter:reporter}));//Options to be used as default for the listenTo function.
var globalOptions={};globalOptions.callOnAdd=!!getOption(options,"callOnAdd",true);globalOptions.debug=!!getOption(options,"debug",false);var eventListenerHandler=listenerHandlerMaker(idHandler);var elementUtils=elementUtilsMaker({stateHandler:stateHandler});//The detection strategy to be used.
var detectionStrategy;var desiredStrategy=getOption(options,"strategy","object");var importantCssRules=getOption(options,"important",false);var strategyOptions={reporter:reporter,batchProcessor:batchProcessor,stateHandler:stateHandler,idHandler:idHandler,important:importantCssRules};if(desiredStrategy==="scroll"){if(browserDetector.isLegacyOpera()){reporter.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy.");desiredStrategy="object";}else if(browserDetector.isIE(9)){reporter.warn("Scroll strategy is not supported on IE9. Changing to object strategy.");desiredStrategy="object";}}if(desiredStrategy==="scroll"){detectionStrategy=scrollStrategyMaker(strategyOptions);}else if(desiredStrategy==="object"){detectionStrategy=objectStrategyMaker(strategyOptions);}else{throw new Error("Invalid strategy name: "+desiredStrategy);}//Calls can be made to listenTo with elements that are still being installed.
//Also, same elements can occur in the elements list in the listenTo function.
//With this map, the ready callbacks can be synchronized between the calls
//so that the ready callback can always be called when an element is ready - even if
//it wasn't installed from the function itself.
var onReadyCallbacks={};/**
   * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.
   * @public
   * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.
   * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.
   * @param {function} listener The callback to be executed for each resize event for each element.
   */function listenTo(options,elements,listener){function onResizeCallback(element){var listeners=eventListenerHandler.get(element);forEach(listeners,function callListenerProxy(listener){listener(element);});}function addListener(callOnAdd,element,listener){eventListenerHandler.add(element,listener);if(callOnAdd){listener(element);}}//Options object may be omitted.
if(!listener){listener=elements;elements=options;options={};}if(!elements){throw new Error("At least one element required.");}if(!listener){throw new Error("Listener required.");}if(isElement(elements)){// A single element has been passed in.
elements=[elements];}else if(isCollection(elements)){// Convert collection to array for plugins.
// TODO: May want to check so that all the elements in the collection are valid elements.
elements=toArray(elements);}else{return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");}var elementsReady=0;var callOnAdd=getOption(options,"callOnAdd",globalOptions.callOnAdd);var onReadyCallback=getOption(options,"onReady",function noop(){});var debug=getOption(options,"debug",globalOptions.debug);forEach(elements,function attachListenerToElement(element){if(!stateHandler.getState(element)){stateHandler.initState(element);idHandler.set(element);}var id=idHandler.get(element);debug&&reporter.log("Attaching listener to element",id,element);if(!elementUtils.isDetectable(element)){debug&&reporter.log(id,"Not detectable.");if(elementUtils.isBusy(element)){debug&&reporter.log(id,"System busy making it detectable");//The element is being prepared to be detectable. Do not make it detectable.
//Just add the listener, because the element will soon be detectable.
addListener(callOnAdd,element,listener);onReadyCallbacks[id]=onReadyCallbacks[id]||[];onReadyCallbacks[id].push(function onReady(){elementsReady++;if(elementsReady===elements.length){onReadyCallback();}});return;}debug&&reporter.log(id,"Making detectable...");//The element is not prepared to be detectable, so do prepare it and add a listener to it.
elementUtils.markBusy(element,true);return detectionStrategy.makeDetectable({debug:debug,important:importantCssRules},element,function onElementDetectable(element){debug&&reporter.log(id,"onElementDetectable");if(stateHandler.getState(element)){elementUtils.markAsDetectable(element);elementUtils.markBusy(element,false);detectionStrategy.addListener(element,onResizeCallback);addListener(callOnAdd,element,listener);// Since the element size might have changed since the call to "listenTo", we need to check for this change,
// so that a resize event may be emitted.
// Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.
// Also, check the state existance before since the element may have been uninstalled in the installation process.
var state=stateHandler.getState(element);if(state&&state.startSize){var width=element.offsetWidth;var height=element.offsetHeight;if(state.startSize.width!==width||state.startSize.height!==height){onResizeCallback(element);}}if(onReadyCallbacks[id]){forEach(onReadyCallbacks[id],function(callback){callback();});}}else{// The element has been unisntalled before being detectable.
debug&&reporter.log(id,"Element uninstalled before being detectable.");}delete onReadyCallbacks[id];elementsReady++;if(elementsReady===elements.length){onReadyCallback();}});}debug&&reporter.log(id,"Already detecable, adding listener.");//The element has been prepared to be detectable and is ready to be listened to.
addListener(callOnAdd,element,listener);elementsReady++;});if(elementsReady===elements.length){onReadyCallback();}}function uninstall(elements){if(!elements){return reporter.error("At least one element is required.");}if(isElement(elements)){// A single element has been passed in.
elements=[elements];}else if(isCollection(elements)){// Convert collection to array for plugins.
// TODO: May want to check so that all the elements in the collection are valid elements.
elements=toArray(elements);}else{return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");}forEach(elements,function(element){eventListenerHandler.removeAllListeners(element);detectionStrategy.uninstall(element);stateHandler.cleanState(element);});}function initDocument(targetDocument){detectionStrategy.initDocument&&detectionStrategy.initDocument(targetDocument);}return{listenTo:listenTo,removeListener:eventListenerHandler.removeListener,removeAllListeners:eventListenerHandler.removeAllListeners,uninstall:uninstall,initDocument:initDocument};};function getOption(options,name,defaultValue){var value=options[name];if((value===undefined||value===null)&&defaultValue!==undefined){return defaultValue;}return value;}var React$1=React__default$1["default"];var ReactDOM=require$$2__default["default"];var invariant=invariant_1;var throttleDebounce=cjs$1;var createResizeDetector=elementResizeDetector;var isShallowEqual=shallowequal;function _interopDefaultLegacy$1(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e};}var React__default=/*#__PURE__*/_interopDefaultLegacy$1(React$1);var ReactDOM__default=/*#__PURE__*/_interopDefaultLegacy$1(ReactDOM);var invariant__default=/*#__PURE__*/_interopDefaultLegacy$1(invariant);var createResizeDetector__default=/*#__PURE__*/_interopDefaultLegacy$1(createResizeDetector);var isShallowEqual__default=/*#__PURE__*/_interopDefaultLegacy$1(isShallowEqual);function ownKeys$1(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});}keys.push.apply(keys,symbols);}return keys;}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys$1(Object(source),true).forEach(function(key){_defineProperty$2(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys$1(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}function _classCallCheck$1(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties$1(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass$1(Constructor,protoProps,staticProps){if(protoProps)_defineProperties$1(Constructor.prototype,protoProps);if(staticProps)_defineProperties$1(Constructor,staticProps);return Constructor;}function _defineProperty$2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends$2(){_extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends$2.apply(this,arguments);}function _inherits$1(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf$3(subClass,superClass);}function _getPrototypeOf$2(o){_getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf$2(o);}function _setPrototypeOf$3(o,p){_setPrototypeOf$3=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf$3(o,p);}function _isNativeReflectConstruct$2(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _objectWithoutPropertiesLoose$1(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose$1(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _assertThisInitialized$3(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _possibleConstructorReturn$1(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized$3(self);}function _createSuper$1(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct$2();return function _createSuperInternal(){var Super=_getPrototypeOf$2(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf$2(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn$1(this,result);};}var instances={};// Lazily require to not cause bug
// https://github.com/ctrlplusb/react-sizeme/issues/6
function resizeDetector(){var strategy=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'scroll';if(!instances[strategy]){instances[strategy]=createResizeDetector__default['default']({strategy:strategy});}return instances[strategy];}var _excluded$1=["explicitRef","className","style","size","disablePlaceholder","onSize"];var errMsg='react-sizeme: an error occurred whilst stopping to listen to node size changes';var defaultConfig={monitorWidth:true,monitorHeight:false,refreshRate:16,refreshMode:'throttle',noPlaceholder:false,resizeDetectorStrategy:'scroll'};function getDisplayName(WrappedComponent){return WrappedComponent.displayName||WrappedComponent.name||'Component';}/**
 * This is a utility wrapper component that will allow our higher order
 * component to get a ref handle on our wrapped components html.
 * @see https://gist.github.com/jimfb/32b587ee6177665fb4cf
 */var ReferenceWrapper=/*#__PURE__*/function(_Component){_inherits$1(ReferenceWrapper,_Component);var _super=_createSuper$1(ReferenceWrapper);function ReferenceWrapper(){_classCallCheck$1(this,ReferenceWrapper);return _super.apply(this,arguments);}_createClass$1(ReferenceWrapper,[{key:"render",value:function render(){return React$1.Children.only(this.props.children);}}]);return ReferenceWrapper;}(React$1.Component);_defineProperty$2(ReferenceWrapper,"displayName",'SizeMeReferenceWrapper');function Placeholder$1(_ref){var className=_ref.className,style=_ref.style;// Lets create the props for the temp element.
var phProps={};// We will use any provided className/style or else make the temp
// container take the full available space.
if(!className&&!style){phProps.style={width:'100%',height:'100%'};}else{if(className){phProps.className=className;}if(style){phProps.style=style;}}return/*#__PURE__*/React__default['default'].createElement("div",phProps);}Placeholder$1.displayName='SizeMePlaceholder';/**
 * As we need to maintain a ref on the root node that is rendered within our
 * SizeMe component we need to wrap our entire render in a sub component.
 * Without this, we lose the DOM ref after the placeholder is removed from
 * the render and the actual component is rendered.
 * It took me forever to figure this out, so tread extra careful on this one!
 */var renderWrapper=function renderWrapper(WrappedComponent){function SizeMeRenderer(props){var explicitRef=props.explicitRef,className=props.className,style=props.style,size=props.size,disablePlaceholder=props.disablePlaceholder;props.onSize;var restProps=_objectWithoutProperties(props,_excluded$1);var noSizeData=size==null||size.width==null&&size.height==null;var renderPlaceholder=noSizeData&&!disablePlaceholder;var renderProps={className:className,style:style};if(size!=null){renderProps.size=size;}var toRender=renderPlaceholder?/*#__PURE__*/React__default['default'].createElement(Placeholder$1,{className:className,style:style}):/*#__PURE__*/React__default['default'].createElement(WrappedComponent,_extends$2({},renderProps,restProps));return/*#__PURE__*/React__default['default'].createElement(ReferenceWrapper,{ref:explicitRef},toRender);}SizeMeRenderer.displayName="SizeMeRenderer(".concat(getDisplayName(WrappedComponent),")");return SizeMeRenderer;};/**
 * :: config -> Component -> WrappedComponent
 *
 * Higher order component that allows the wrapped component to become aware
 * of it's size, by receiving it as an object within it's props.
 *
 * @param  monitorWidth
 *   Default true, whether changes in the element's width should be monitored,
 *   causing a size property to be broadcast.
 * @param  monitorHeight
 *   Default false, whether changes in the element's height should be monitored,
 *   causing a size property to be broadcast.
 *
 * @return The wrapped component.
 */function withSize(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultConfig;var _config$monitorWidth=config.monitorWidth,monitorWidth=_config$monitorWidth===void 0?defaultConfig.monitorWidth:_config$monitorWidth,_config$monitorHeight=config.monitorHeight,monitorHeight=_config$monitorHeight===void 0?defaultConfig.monitorHeight:_config$monitorHeight,_config$refreshRate=config.refreshRate,refreshRate=_config$refreshRate===void 0?defaultConfig.refreshRate:_config$refreshRate,_config$refreshMode=config.refreshMode,refreshMode=_config$refreshMode===void 0?defaultConfig.refreshMode:_config$refreshMode,_config$noPlaceholder=config.noPlaceholder,noPlaceholder=_config$noPlaceholder===void 0?defaultConfig.noPlaceholder:_config$noPlaceholder,_config$resizeDetecto=config.resizeDetectorStrategy,resizeDetectorStrategy=_config$resizeDetecto===void 0?defaultConfig.resizeDetectorStrategy:_config$resizeDetecto;invariant__default['default'](monitorWidth||monitorHeight,'You have to monitor at least one of the width or height when using "sizeMe"');invariant__default['default'](refreshRate>=16,"It is highly recommended that you don't put your refreshRate lower than "+'16 as this may cause layout thrashing.');invariant__default['default'](refreshMode==='throttle'||refreshMode==='debounce','The refreshMode should have a value of "throttle" or "debounce"');var refreshDelayStrategy=refreshMode==='throttle'?throttleDebounce.throttle:throttleDebounce.debounce;return function WrapComponent(WrappedComponent){var SizeMeRenderWrapper=renderWrapper(WrappedComponent);var SizeAwareComponent=/*#__PURE__*/function(_React$Component){_inherits$1(SizeAwareComponent,_React$Component);var _super2=_createSuper$1(SizeAwareComponent);function SizeAwareComponent(){var _this;_classCallCheck$1(this,SizeAwareComponent);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super2.call.apply(_super2,[this].concat(args));_defineProperty$2(_assertThisInitialized$3(_this),"domEl",null);_defineProperty$2(_assertThisInitialized$3(_this),"state",{width:undefined,height:undefined});_defineProperty$2(_assertThisInitialized$3(_this),"uninstall",function(){if(_this.domEl){try{_this.detector.uninstall(_this.domEl);}catch(err){// eslint-disable-next-line no-console
console.warn(errMsg);}_this.domEl=null;}});_defineProperty$2(_assertThisInitialized$3(_this),"determineStrategy",function(props){if(props.onSize){if(!_this.callbackState){_this.callbackState=_objectSpread2({},_this.state);}_this.strategy='callback';}else{_this.strategy='render';}});_defineProperty$2(_assertThisInitialized$3(_this),"strategisedSetState",function(state){if(_this.strategy==='callback'){_this.callbackState=state;_this.props.onSize(state);}_this.setState(state);});_defineProperty$2(_assertThisInitialized$3(_this),"strategisedGetState",function(){return _this.strategy==='callback'?_this.callbackState:_this.state;});_defineProperty$2(_assertThisInitialized$3(_this),"refCallback",function(element){_this.element=element;});_defineProperty$2(_assertThisInitialized$3(_this),"hasSizeChanged",function(current,next){var c=current;var n=next;return monitorWidth&&c.width!==n.width||monitorHeight&&c.height!==n.height;});_defineProperty$2(_assertThisInitialized$3(_this),"checkIfSizeChanged",refreshDelayStrategy(refreshRate,function(el){var _el$getBoundingClient=el.getBoundingClientRect(),width=_el$getBoundingClient.width,height=_el$getBoundingClient.height;var next={width:monitorWidth?width:null,height:monitorHeight?height:null};if(_this.hasSizeChanged(_this.strategisedGetState(),next)){_this.strategisedSetState(next);}}));return _this;}_createClass$1(SizeAwareComponent,[{key:"componentDidMount",value:function componentDidMount(){this.detector=resizeDetector(resizeDetectorStrategy);this.determineStrategy(this.props);this.handleDOMNode();}},{key:"componentDidUpdate",value:function componentDidUpdate(){this.determineStrategy(this.props);this.handleDOMNode();}},{key:"componentWillUnmount",value:function componentWillUnmount(){// Change our size checker to a noop just in case we have some
// late running events.
this.hasSizeChanged=function(){return undefined;};this.checkIfSizeChanged=function(){return undefined;};this.uninstall();}},{key:"handleDOMNode",value:function handleDOMNode(){var found=this.element&&ReactDOM__default['default'].findDOMNode(this.element);if(!found){// If we previously had a dom node then we need to ensure that
// we remove any existing listeners to avoid memory leaks.
this.uninstall();return;}if(!this.domEl){this.domEl=found;this.detector.listenTo(this.domEl,this.checkIfSizeChanged);}else if(this.domEl.isSameNode&&!this.domEl.isSameNode(found)||this.domEl!==found){this.uninstall();this.domEl=found;this.detector.listenTo(this.domEl,this.checkIfSizeChanged);}else;}},{key:"render",value:function render(){var disablePlaceholder=withSize.enableSSRBehaviour||withSize.noPlaceholders||noPlaceholder||this.strategy==='callback';var size=_objectSpread2({},this.state);return/*#__PURE__*/React__default['default'].createElement(SizeMeRenderWrapper,_extends$2({explicitRef:this.refCallback,size:this.strategy==='callback'?null:size,disablePlaceholder:disablePlaceholder},this.props));}}]);return SizeAwareComponent;}(React__default['default'].Component);_defineProperty$2(SizeAwareComponent,"displayName","SizeMe(".concat(getDisplayName(WrappedComponent),")"));SizeAwareComponent.WrappedComponent=WrappedComponent;return SizeAwareComponent;};}/**
 * Allow SizeMe to run within SSR environments.  This is a "global" behaviour
 * flag that should be set within the initialisation phase of your application.
 *
 * Warning: don't set this flag unless you need to as using it may cause
 * extra render cycles to happen within your components depending on the logic
 * contained within them around the usage of the `size` data.
 *
 * DEPRECATED: Please use the global noPlaceholders
 */withSize.enableSSRBehaviour=false;/**
 * Global configuration allowing to disable placeholder rendering for all
 * sizeMe components.
 */withSize.noPlaceholders=false;var _excluded=["children","render"],_excluded2=["children","render"],_excluded3=["children","render"];var SizeMe=/*#__PURE__*/function(_Component){_inherits$1(SizeMe,_Component);var _super=_createSuper$1(SizeMe);function SizeMe(props){var _this;_classCallCheck$1(this,SizeMe);_this=_super.call(this,props);_defineProperty$2(_assertThisInitialized$3(_this),"createComponent",function(config){_this.SizeAware=withSize(config)(function(_ref){var children=_ref.children;return children;});});_defineProperty$2(_assertThisInitialized$3(_this),"onSize",function(size){return _this.setState({size:size});});props.children;props.render;var sizeMeConfig=_objectWithoutProperties(props,_excluded);_this.createComponent(sizeMeConfig);_this.state={size:{width:undefined,height:undefined}};return _this;}_createClass$1(SizeMe,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this$props=this.props;_this$props.children;_this$props.render;var currentSizeMeConfig=_objectWithoutProperties(_this$props,_excluded2);prevProps.children;prevProps.render;var prevSizeMeConfig=_objectWithoutProperties(prevProps,_excluded3);if(!isShallowEqual__default['default'](currentSizeMeConfig,prevSizeMeConfig)){this.createComponent(currentSizeMeConfig);}}},{key:"render",value:function render(){var SizeAware=this.SizeAware;var render=this.props.children||this.props.render;return/*#__PURE__*/React__default['default'].createElement(SizeAware,{onSize:this.onSize},render({size:this.state.size}));}}]);return SizeMe;}(React$1.Component);_defineProperty$2(SizeMe,"defaultProps",{children:undefined,render:undefined});withSize.SizeMe=SizeMe;withSize.withSize=withSize;var reactSizeme=withSize;const Root$2=theming.styled.div({position:'fixed',left:0,top:0,width:'100vw',height:'100vh',overflow:'hidden'});const{SIDEBAR,CANVAS,ADDONS}=api.ActiveTabs;const Pane$1=theming.styled.div({transition:'transform .2s ease',position:'absolute',top:0,height:'100%',overflow:'auto'},({theme})=>({background:theme.background.content,'&:nth-of-type(1)':{borderRight:`1px solid ${theme.appBorderColor}`},'&:nth-of-type(3)':{borderLeft:`1px solid ${theme.appBorderColor}`}}),({index})=>{switch(index){case 0:{return{width:'80vw',transform:'translateX(-80vw)',left:0};}case 1:{return{width:'100%',transform:'translateX(0) scale(1)',left:0};}case 2:{return{width:'80vw',transform:'translateX(80vw)',right:0};}default:{return{};}}},({active,index})=>{switch(true){case index===0&&active===SIDEBAR:{return{transform:'translateX(-0px)'};}case index===1&&active===SIDEBAR:{return{transform:'translateX(40vw) translateY(-42.5vh) translateY(40px) scale(0.2)'};}case index===1&&active===ADDONS:{return{transform:'translateX(-40vw) translateY(-42.5vh) translateY(40px) scale(0.2)'};}case index===2&&active===ADDONS:{return{transform:'translateX(0px)'};}default:{return{};}}});const Panels=React__default$1["default"].memo(({children,active,isFullscreen})=>React__default$1["default"].createElement(PanelsContainer,{isFullscreen:isFullscreen},React$2.Children.toArray(children).map((item,index)=>// eslint-disable-next-line react/no-array-index-key
React__default$1["default"].createElement(Pane$1,{key:index,index:index,active:active},item))));Panels.displayName='Panels';const PanelsContainer=theming.styled.div({position:'fixed',top:0,left:0,width:'100vw'},({isFullscreen})=>({height:isFullscreen?'100vh':'calc(100% - 40px)'}));const Bar$1=theming.styled.nav({position:'fixed',bottom:0,left:0,width:'100vw',height:40,display:'flex',boxShadow:'0 1px 5px 0 rgba(0, 0, 0, 0.1)','& > *':{flex:1}},({theme})=>({background:theme.barBg}));class Mobile extends React$2.Component{constructor(props){super(props);const{options}=props;this.state={active:options.isFullscreen?CANVAS:options.initialActive||SIDEBAR};}render(){const{Sidebar,Preview,Panel,Notifications,pages,viewMode,options,docsOnly}=this.props;const{active}=this.state;return React__default$1["default"].createElement(Root$2,null,React__default$1["default"].createElement(Notifications,{placement:{position:'fixed',bottom:60,left:20,right:20}}),React__default$1["default"].createElement(Panels,{active:active,isFullscreen:options.isFullscreen},React__default$1["default"].createElement(Sidebar,null),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement("div",{hidden:!viewMode},React__default$1["default"].createElement(Preview,{showToolbar:options.showToolbar,id:"main",viewMode:viewMode})),pages.map(({key,route:Route,render:Content})=>React__default$1["default"].createElement(Route,{key:key},React__default$1["default"].createElement(Content,null)))),React__default$1["default"].createElement(Panel,{hidden:!viewMode})),!options.isFullscreen&&React__default$1["default"].createElement(Bar$1,null,React__default$1["default"].createElement(components.TabButton,{onClick:()=>this.setState({active:SIDEBAR}),active:active===SIDEBAR},"Sidebar"),React__default$1["default"].createElement(components.TabButton,{onClick:()=>this.setState({active:CANVAS}),active:active===CANVAS},viewMode?'Canvas':null,pages.map(({key,route:Route})=>React__default$1["default"].createElement(Route,{key:key},key))),viewMode&&!docsOnly?React__default$1["default"].createElement(components.TabButton,{onClick:()=>this.setState({active:ADDONS}),active:active===ADDONS},"Addons"):null));}}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var __assign=function(){__assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p];}return t;};return __assign.apply(this,arguments);};function __rest(s,e){var t={};for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0)t[p]=s[p];if(s!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i]))t[p[i]]=s[p[i]];}return t;}function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}step((generator=generator.apply(thisArg,_arguments||[])).next());});}var store2={exports:{}};/*! store2 - v2.13.1 - 2021-12-20
* Copyright (c) 2021 Nathan Bubna; Licensed (MIT OR GPL-3.0) */(function(module){(function(window,define){var _={version:"2.13.1",areas:{},apis:{},// utilities
inherit:function(api,o){for(var p in api){if(!o.hasOwnProperty(p)){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(api,p));}}return o;},stringify:function(d,fn){return d===undefined||typeof d==="function"?d+'':JSON.stringify(d,fn||_.replace);},parse:function(s,fn){// if it doesn't parse, return as is
try{return JSON.parse(s,fn||_.revive);}catch(e){return s;}},// extension hooks
fn:function(name,fn){_.storeAPI[name]=fn;for(var api in _.apis){_.apis[api][name]=fn;}},get:function(area,key){return area.getItem(key);},set:function(area,key,string){area.setItem(key,string);},remove:function(area,key){area.removeItem(key);},key:function(area,i){return area.key(i);},length:function(area){return area.length;},clear:function(area){area.clear();},// core functions
Store:function(id,area,namespace){var store=_.inherit(_.storeAPI,function(key,data,overwrite){if(arguments.length===0){return store.getAll();}if(typeof data==="function"){return store.transact(key,data,overwrite);}// fn=data, alt=overwrite
if(data!==undefined){return store.set(key,data,overwrite);}if(typeof key==="string"||typeof key==="number"){return store.get(key);}if(typeof key==="function"){return store.each(key);}if(!key){return store.clear();}return store.setAll(key,data);// overwrite=data, data=key
});store._id=id;try{var testKey='__store2_test';area.setItem(testKey,'ok');store._area=area;area.removeItem(testKey);}catch(e){store._area=_.storage('fake');}store._ns=namespace||'';if(!_.areas[id]){_.areas[id]=store._area;}if(!_.apis[store._ns+store._id]){_.apis[store._ns+store._id]=store;}return store;},storeAPI:{// admin functions
area:function(id,area){var store=this[id];if(!store||!store.area){store=_.Store(id,area,this._ns);//new area-specific api in this namespace
if(!this[id]){this[id]=store;}}return store;},namespace:function(namespace,singleArea){if(!namespace){return this._ns?this._ns.substring(0,this._ns.length-1):'';}var ns=namespace,store=this[ns];if(!store||!store.namespace){store=_.Store(this._id,this._area,this._ns+ns+'.');//new namespaced api
if(!this[ns]){this[ns]=store;}if(!singleArea){for(var name in _.areas){store.area(name,_.areas[name]);}}}return store;},isFake:function(force){if(force){this._real=this._area;this._area=_.storage('fake');}else if(force===false){this._area=this._real||this._area;}return this._area.name==='fake';},toString:function(){return'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';},// storage functions
has:function(key){if(this._area.has){return this._area.has(this._in(key));//extension hook
}return!!(this._in(key)in this._area);},size:function(){return this.keys().length;},each:function(fn,fill){// fill is used by keys(fillList) and getAll(fillList))
for(var i=0,m=_.length(this._area);i<m;i++){var key=this._out(_.key(this._area,i));if(key!==undefined){if(fn.call(this,key,this.get(key),fill)===false){break;}}if(m>_.length(this._area)){m--;i--;}// in case of removeItem
}return fill||this;},keys:function(fillList){return this.each(function(k,v,list){list.push(k);},fillList||[]);},get:function(key,alt){var s=_.get(this._area,this._in(key)),fn;if(typeof alt==="function"){fn=alt;alt=null;}return s!==null?_.parse(s,fn):alt!=null?alt:s;},getAll:function(fillObj){return this.each(function(k,v,all){all[k]=v;},fillObj||{});},transact:function(key,fn,alt){var val=this.get(key,alt),ret=fn(val);this.set(key,ret===undefined?val:ret);return this;},set:function(key,data,overwrite){var d=this.get(key),replacer;if(d!=null&&overwrite===false){return data;}if(typeof overwrite!=="boolean"){replacer=overwrite;}return _.set(this._area,this._in(key),_.stringify(data,replacer))||d;},setAll:function(data,overwrite){var changed,val;for(var key in data){val=data[key];if(this.set(key,val,overwrite)!==val){changed=true;}}return changed;},add:function(key,data,replacer){var d=this.get(key);if(d instanceof Array){data=d.concat(data);}else if(d!==null){var type=typeof d;if(type===typeof data&&type==='object'){for(var k in data){d[k]=data[k];}data=d;}else{data=d+data;}}_.set(this._area,this._in(key),_.stringify(data,replacer));return data;},remove:function(key,alt){var d=this.get(key,alt);_.remove(this._area,this._in(key));return d;},clear:function(){if(!this._ns){_.clear(this._area);}else{this.each(function(k){_.remove(this._area,this._in(k));},1);}return this;},clearAll:function(){var area=this._area;for(var id in _.areas){if(_.areas.hasOwnProperty(id)){this._area=_.areas[id];this.clear();}}this._area=area;return this;},// internal use functions
_in:function(k){if(typeof k!=="string"){k=_.stringify(k);}return this._ns?this._ns+k:k;},_out:function(k){return this._ns?k&&k.indexOf(this._ns)===0?k.substring(this._ns.length):undefined:// so each() knows to skip it
k;}},// end _.storeAPI
storage:function(name){return _.inherit(_.storageAPI,{items:{},name:name});},storageAPI:{length:0,has:function(k){return this.items.hasOwnProperty(k);},key:function(i){var c=0;for(var k in this.items){if(this.has(k)&&i===c++){return k;}}},setItem:function(k,v){if(!this.has(k)){this.length++;}this.items[k]=v;},removeItem:function(k){if(this.has(k)){delete this.items[k];this.length--;}},getItem:function(k){return this.has(k)?this.items[k]:null;},clear:function(){for(var k in this.items){this.removeItem(k);}}}// end _.storageAPI
};var store=// safely set this up (throws error in IE10/32bit mode for local files)
_.Store("local",function(){try{return localStorage;}catch(e){}}());store.local=store;// for completeness
store._=_;// for extenders and debuggers...
// safely setup store.session (throws exception in FF for file:/// urls)
store.area("session",function(){try{return sessionStorage;}catch(e){}}());store.area("page",_.storage("page"));if(typeof define==='function'&&define.amd!==undefined){define('store2',[],function(){return store;});}else if(module.exports){module.exports=store;}else{// expose the primary store fn to the global object and save conflicts
if(window.store){_.conflict=window.store;}window.store=store;}})(commonjsGlobal,commonjsGlobal&&commonjsGlobal.define);})(store2);var store=store2.exports;/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */function isObject$3(value){var type=typeof value;return value!=null&&(type=='object'||type=='function');}var isObject_1=isObject$3;/** Detect free variable `global` from Node.js. */var freeGlobal$1=typeof commonjsGlobal=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var _freeGlobal=freeGlobal$1;var freeGlobal=_freeGlobal;/** Detect free variable `self`. */var freeSelf=typeof self=='object'&&self&&self.Object===Object&&self;/** Used as a reference to the global object. */var root$2=freeGlobal||freeSelf||Function('return this')();var _root=root$2;var root$1=_root;/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */var now$1=function(){return root$1.Date.now();};var now_1=now$1;/** Used to match a single whitespace character. */var reWhitespace=/\s/;/**
 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
 * character of `string`.
 *
 * @private
 * @param {string} string The string to inspect.
 * @returns {number} Returns the index of the last non-whitespace character.
 */function trimmedEndIndex$1(string){var index=string.length;while(index--&&reWhitespace.test(string.charAt(index))){}return index;}var _trimmedEndIndex=trimmedEndIndex$1;var trimmedEndIndex=_trimmedEndIndex;/** Used to match leading whitespace. */var reTrimStart=/^\s+/;/**
 * The base implementation of `_.trim`.
 *
 * @private
 * @param {string} string The string to trim.
 * @returns {string} Returns the trimmed string.
 */function baseTrim$1(string){return string?string.slice(0,trimmedEndIndex(string)+1).replace(reTrimStart,''):string;}var _baseTrim=baseTrim$1;var root=_root;/** Built-in value references. */var Symbol$3=root.Symbol;var _Symbol=Symbol$3;var Symbol$2=_Symbol;/** Used for built-in method references. */var objectProto$1=Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty=objectProto$1.hasOwnProperty;/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */var nativeObjectToString$1=objectProto$1.toString;/** Built-in value references. */var symToStringTag$1=Symbol$2?Symbol$2.toStringTag:undefined;/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */function getRawTag$1(value){var isOwn=hasOwnProperty.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=undefined;var unmasked=true;}catch(e){}var result=nativeObjectToString$1.call(value);if(unmasked){if(isOwn){value[symToStringTag$1]=tag;}else{delete value[symToStringTag$1];}}return result;}var _getRawTag=getRawTag$1;/** Used for built-in method references. */var objectProto=Object.prototype;/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */var nativeObjectToString=objectProto.toString;/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */function objectToString$1(value){return nativeObjectToString.call(value);}var _objectToString=objectToString$1;var Symbol$1=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString;/** `Object#toString` result references. */var nullTag='[object Null]',undefinedTag='[object Undefined]';/** Built-in value references. */var symToStringTag=Symbol$1?Symbol$1.toStringTag:undefined;/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */function baseGetTag$1(value){if(value==null){return value===undefined?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}var _baseGetTag=baseGetTag$1;/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */function isObjectLike$1(value){return value!=null&&typeof value=='object';}var isObjectLike_1=isObjectLike$1;var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1;/** `Object#toString` result references. */var symbolTag='[object Symbol]';/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */function isSymbol$1(value){return typeof value=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}var isSymbol_1=isSymbol$1;var baseTrim=_baseTrim,isObject$2=isObject_1,isSymbol=isSymbol_1;/** Used as references for various `Number` constants. */var NAN=0/0;/** Used to detect bad signed hexadecimal string values. */var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;/** Used to detect binary string values. */var reIsBinary=/^0b[01]+$/i;/** Used to detect octal string values. */var reIsOctal=/^0o[0-7]+$/i;/** Built-in method references without a dependency on `root`. */var freeParseInt=parseInt;/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */function toNumber$1(value){if(typeof value=='number'){return value;}if(isSymbol(value)){return NAN;}if(isObject$2(value)){var other=typeof value.valueOf=='function'?value.valueOf():value;value=isObject$2(other)?other+'':other;}if(typeof value!='string'){return value===0?value:+value;}value=baseTrim(value);var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value;}var toNumber_1=toNumber$1;var isObject$1=isObject_1,now=now_1,toNumber=toNumber_1;/** Error message constants. */var FUNC_ERROR_TEXT$1='Expected a function';/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax=Math.max,nativeMin=Math.min;/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */function debounce$2(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=false,maxing=false,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT$1);}wait=toNumber(wait)||0;if(isObject$1(options)){leading=!!options.leading;maxing='maxWait'in options;maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait;trailing='trailing'in options?!!options.trailing:trailing;}function invokeFunc(time){var args=lastArgs,thisArg=lastThis;lastArgs=lastThis=undefined;lastInvokeTime=time;result=func.apply(thisArg,args);return result;}function leadingEdge(time){// Reset any `maxWait` timer.
lastInvokeTime=time;// Start the timer for the trailing edge.
timerId=setTimeout(timerExpired,wait);// Invoke the leading edge.
return leading?invokeFunc(time):result;}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting;}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait;}function timerExpired(){var time=now();if(shouldInvoke(time)){return trailingEdge(time);}// Restart the timer.
timerId=setTimeout(timerExpired,remainingWait(time));}function trailingEdge(time){timerId=undefined;// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if(trailing&&lastArgs){return invokeFunc(time);}lastArgs=lastThis=undefined;return result;}function cancel(){if(timerId!==undefined){clearTimeout(timerId);}lastInvokeTime=0;lastArgs=lastCallTime=lastThis=timerId=undefined;}function flush(){return timerId===undefined?result:trailingEdge(now());}function debounced(){var time=now(),isInvoking=shouldInvoke(time);lastArgs=arguments;lastThis=this;lastCallTime=time;if(isInvoking){if(timerId===undefined){return leadingEdge(lastCallTime);}if(maxing){// Handle invocations in a tight loop.
clearTimeout(timerId);timerId=setTimeout(timerExpired,wait);return invokeFunc(lastCallTime);}}if(timerId===undefined){timerId=setTimeout(timerExpired,wait);}return result;}debounced.cancel=cancel;debounced.flush=flush;return debounced;}var debounce_1=debounce$2;const get$1=()=>{try{const data=store.local.get(`storybook-layout`);return data||false;}catch(e){// eslint-disable-next-line no-console
console.error(e);return false;}};const write=memoize__default["default"](1)(changes=>{try{store.local.set(`storybook-layout`,changes);}catch(e){// eslint-disable-next-line no-console
console.error(e);}});const set=debounce_1(write,500);var cjs={exports:{}};var Draggable$2={};function toVal(mix){var k,y,str='';if(typeof mix==='string'||typeof mix==='number'){str+=mix;}else if(typeof mix==='object'){if(Array.isArray(mix)){for(k=0;k<mix.length;k++){if(mix[k]){if(y=toVal(mix[k])){str&&(str+=' ');str+=y;}}}}else{for(k in mix){if(mix[k]){str&&(str+=' ');str+=k;}}}}return str;}function clsx_m(){var i=0,tmp,x,str='';while(i<arguments.length){if(tmp=arguments[i++]){if(x=toVal(tmp)){str&&(str+=' ');str+=x;}}}return str;}var clsx_m$1=/*#__PURE__*/Object.freeze({__proto__:null,'default':clsx_m});var require$$3=/*@__PURE__*/getAugmentedNamespace(clsx_m$1);var domFns={};var shims={};Object.defineProperty(shims,"__esModule",{value:true});shims.findInArray=findInArray;shims.isFunction=isFunction;shims.isNum=isNum;shims.int=int;shims.dontSetMe=dontSetMe;// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
function findInArray(array/*: Array<any> | TouchList*/,callback/*: Function*/)/*: any*/{for(var i=0,length=array.length;i<length;i++){if(callback.apply(callback,[array[i],i,array]))return array[i];}}function isFunction(func/*: any*/)/*: boolean %checks*/{// $FlowIgnore[method-unbinding]
return typeof func==='function'||Object.prototype.toString.call(func)==='[object Function]';}function isNum(num/*: any*/)/*: boolean %checks*/{return typeof num==='number'&&!isNaN(num);}function int(a/*: string*/)/*: number*/{return parseInt(a,10);}function dontSetMe(props/*: Object*/,propName/*: string*/,componentName/*: string*/)/*: ?Error*/{if(props[propName]){return new Error("Invalid prop ".concat(propName," passed to ").concat(componentName," - do not set this, set it on the child."));}}var getPrefix$1={};Object.defineProperty(getPrefix$1,"__esModule",{value:true});getPrefix$1.getPrefix=getPrefix;getPrefix$1.browserPrefixToKey=browserPrefixToKey;getPrefix$1.browserPrefixToStyle=browserPrefixToStyle;getPrefix$1.default=void 0;var prefixes=['Moz','Webkit','O','ms'];function getPrefix()/*: string*/{var _window$document,_window$document$docu;var prop/*: string*/=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'transform';// Ensure we're running in an environment where there is actually a global
// `window` obj
if(typeof window==='undefined')return'';// If we're in a pseudo-browser server-side environment, this access
// path may not exist, so bail out if it doesn't.
var style=(_window$document=window.document)===null||_window$document===void 0?void 0:(_window$document$docu=_window$document.documentElement)===null||_window$document$docu===void 0?void 0:_window$document$docu.style;if(!style)return'';if(prop in style)return'';for(var i=0;i<prefixes.length;i++){if(browserPrefixToKey(prop,prefixes[i])in style)return prefixes[i];}return'';}function browserPrefixToKey(prop/*: string*/,prefix/*: string*/)/*: string*/{return prefix?"".concat(prefix).concat(kebabToTitleCase(prop)):prop;}function browserPrefixToStyle(prop/*: string*/,prefix/*: string*/)/*: string*/{return prefix?"-".concat(prefix.toLowerCase(),"-").concat(prop):prop;}function kebabToTitleCase(str/*: string*/)/*: string*/{var out='';var shouldCapitalize=true;for(var i=0;i<str.length;i++){if(shouldCapitalize){out+=str[i].toUpperCase();shouldCapitalize=false;}else if(str[i]==='-'){shouldCapitalize=true;}else{out+=str[i];}}return out;}// Default export is the prefix itself, like 'Moz', 'Webkit', etc
// Note that you may have to re-test for certain things; for instance, Chrome 50
// can handle unprefixed `transform`, but not unprefixed `user-select`
var _default=getPrefix()/*: string*/;getPrefix$1.default=_default;function _typeof$1(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof$1=function _typeof(obj){return typeof obj;};}else{_typeof$1=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof$1(obj);}Object.defineProperty(domFns,"__esModule",{value:true});domFns.matchesSelector=matchesSelector;domFns.matchesSelectorAndParentsTo=matchesSelectorAndParentsTo;domFns.addEvent=addEvent;domFns.removeEvent=removeEvent;domFns.outerHeight=outerHeight;domFns.outerWidth=outerWidth;domFns.innerHeight=innerHeight$1;domFns.innerWidth=innerWidth$1;domFns.offsetXYFromParent=offsetXYFromParent;domFns.createCSSTransform=createCSSTransform;domFns.createSVGTransform=createSVGTransform;domFns.getTranslation=getTranslation;domFns.getTouch=getTouch;domFns.getTouchIdentifier=getTouchIdentifier;domFns.addUserSelectStyles=addUserSelectStyles;domFns.removeUserSelectStyles=removeUserSelectStyles;domFns.addClassName=addClassName;domFns.removeClassName=removeClassName;var _shims$2=shims;var _getPrefix=_interopRequireWildcard$1(getPrefix$1);function _getRequireWildcardCache$1(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache$1=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard$1(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof$1(obj)!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache$1(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});}keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty$1(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}function _defineProperty$1(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var matchesSelectorFunc='';function matchesSelector(el/*: Node*/,selector/*: string*/)/*: boolean*/{if(!matchesSelectorFunc){matchesSelectorFunc=(0,_shims$2.findInArray)(['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'],function(method){// $FlowIgnore: Doesn't think elements are indexable
return(0,_shims$2.isFunction)(el[method]);});}// Might not be found entirely (not an Element?) - in that case, bail
// $FlowIgnore: Doesn't think elements are indexable
if(!(0,_shims$2.isFunction)(el[matchesSelectorFunc]))return false;// $FlowIgnore: Doesn't think elements are indexable
return el[matchesSelectorFunc](selector);}// Works up the tree to the draggable itself attempting to match selector.
function matchesSelectorAndParentsTo(el/*: Node*/,selector/*: string*/,baseNode/*: Node*/)/*: boolean*/{var node=el;do{if(matchesSelector(node,selector))return true;if(node===baseNode)return false;node=node.parentNode;}while(node);return false;}function addEvent(el/*: ?Node*/,event/*: string*/,handler/*: Function*/,inputOptions/*: Object*/)/*: void*/{if(!el)return;var options=_objectSpread({capture:true},inputOptions);// $FlowIgnore[method-unbinding]
if(el.addEventListener){el.addEventListener(event,handler,options);}else if(el.attachEvent){el.attachEvent('on'+event,handler);}else{// $FlowIgnore: Doesn't think elements are indexable
el['on'+event]=handler;}}function removeEvent(el/*: ?Node*/,event/*: string*/,handler/*: Function*/,inputOptions/*: Object*/)/*: void*/{if(!el)return;var options=_objectSpread({capture:true},inputOptions);// $FlowIgnore[method-unbinding]
if(el.removeEventListener){el.removeEventListener(event,handler,options);}else if(el.detachEvent){el.detachEvent('on'+event,handler);}else{// $FlowIgnore: Doesn't think elements are indexable
el['on'+event]=null;}}function outerHeight(node/*: HTMLElement*/)/*: number*/{// This is deliberately excluding margin for our calculations, since we are using
// offsetTop which is including margin. See getBoundPosition
var height=node.clientHeight;var computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);height+=(0,_shims$2.int)(computedStyle.borderTopWidth);height+=(0,_shims$2.int)(computedStyle.borderBottomWidth);return height;}function outerWidth(node/*: HTMLElement*/)/*: number*/{// This is deliberately excluding margin for our calculations, since we are using
// offsetLeft which is including margin. See getBoundPosition
var width=node.clientWidth;var computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);width+=(0,_shims$2.int)(computedStyle.borderLeftWidth);width+=(0,_shims$2.int)(computedStyle.borderRightWidth);return width;}function innerHeight$1(node/*: HTMLElement*/)/*: number*/{var height=node.clientHeight;var computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);height-=(0,_shims$2.int)(computedStyle.paddingTop);height-=(0,_shims$2.int)(computedStyle.paddingBottom);return height;}function innerWidth$1(node/*: HTMLElement*/)/*: number*/{var width=node.clientWidth;var computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);width-=(0,_shims$2.int)(computedStyle.paddingLeft);width-=(0,_shims$2.int)(computedStyle.paddingRight);return width;}/*:: interface EventWithOffset {
  clientX: number, clientY: number
}*/ // Get from offsetParent
function offsetXYFromParent(evt/*: EventWithOffset*/,offsetParent/*: HTMLElement*/,scale/*: number*/)/*: ControlPosition*/{var isBody=offsetParent===offsetParent.ownerDocument.body;var offsetParentRect=isBody?{left:0,top:0}:offsetParent.getBoundingClientRect();var x=(evt.clientX+offsetParent.scrollLeft-offsetParentRect.left)/scale;var y=(evt.clientY+offsetParent.scrollTop-offsetParentRect.top)/scale;return{x:x,y:y};}function createCSSTransform(controlPos/*: ControlPosition*/,positionOffset/*: PositionOffsetControlPosition*/)/*: Object*/{var translation=getTranslation(controlPos,positionOffset,'px');return _defineProperty$1({},(0,_getPrefix.browserPrefixToKey)('transform',_getPrefix.default),translation);}function createSVGTransform(controlPos/*: ControlPosition*/,positionOffset/*: PositionOffsetControlPosition*/)/*: string*/{var translation=getTranslation(controlPos,positionOffset,'');return translation;}function getTranslation(_ref2,positionOffset/*: PositionOffsetControlPosition*/,unitSuffix/*: string*/)/*: string*/{var x=_ref2.x,y=_ref2.y;var translation="translate(".concat(x).concat(unitSuffix,",").concat(y).concat(unitSuffix,")");if(positionOffset){var defaultX="".concat(typeof positionOffset.x==='string'?positionOffset.x:positionOffset.x+unitSuffix);var defaultY="".concat(typeof positionOffset.y==='string'?positionOffset.y:positionOffset.y+unitSuffix);translation="translate(".concat(defaultX,", ").concat(defaultY,")")+translation;}return translation;}function getTouch(e/*: MouseTouchEvent*/,identifier/*: number*/)/*: ?{clientX: number, clientY: number}*/{return e.targetTouches&&(0,_shims$2.findInArray)(e.targetTouches,function(t){return identifier===t.identifier;})||e.changedTouches&&(0,_shims$2.findInArray)(e.changedTouches,function(t){return identifier===t.identifier;});}function getTouchIdentifier(e/*: MouseTouchEvent*/)/*: ?number*/{if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier;}// User-select Hacks:
//
// Useful for preventing blue highlights all over everything when dragging.
// Note we're passing `document` b/c we could be iframed
function addUserSelectStyles(doc/*: ?Document*/){if(!doc)return;var styleEl=doc.getElementById('react-draggable-style-el');if(!styleEl){styleEl=doc.createElement('style');styleEl.type='text/css';styleEl.id='react-draggable-style-el';styleEl.innerHTML='.react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n';styleEl.innerHTML+='.react-draggable-transparent-selection *::selection {all: inherit;}\n';doc.getElementsByTagName('head')[0].appendChild(styleEl);}if(doc.body)addClassName(doc.body,'react-draggable-transparent-selection');}function removeUserSelectStyles(doc/*: ?Document*/){if(!doc)return;try{if(doc.body)removeClassName(doc.body,'react-draggable-transparent-selection');// $FlowIgnore: IE
if(doc.selection){// $FlowIgnore: IE
doc.selection.empty();}else{// Remove selection caused by scroll, unless it's a focused input
// (we use doc.defaultView in case we're in an iframe)
var selection=(doc.defaultView||window).getSelection();if(selection&&selection.type!=='Caret'){selection.removeAllRanges();}}}catch(e){// probably IE
}}function addClassName(el/*: HTMLElement*/,className/*: string*/){if(el.classList){el.classList.add(className);}else{if(!el.className.match(new RegExp("(?:^|\\s)".concat(className,"(?!\\S)")))){el.className+=" ".concat(className);}}}function removeClassName(el/*: HTMLElement*/,className/*: string*/){if(el.classList){el.classList.remove(className);}else{el.className=el.className.replace(new RegExp("(?:^|\\s)".concat(className,"(?!\\S)"),'g'),'');}}var positionFns={};Object.defineProperty(positionFns,"__esModule",{value:true});positionFns.getBoundPosition=getBoundPosition;positionFns.snapToGrid=snapToGrid;positionFns.canDragX=canDragX;positionFns.canDragY=canDragY;positionFns.getControlPosition=getControlPosition;positionFns.createCoreData=createCoreData;positionFns.createDraggableData=createDraggableData;var _shims$1=shims;var _domFns$1=domFns;function getBoundPosition(draggable/*: Draggable*/,x/*: number*/,y/*: number*/)/*: [number, number]*/{// If no bounds, short-circuit and move on
if(!draggable.props.bounds)return[x,y];// Clone new bounds
var bounds=draggable.props.bounds;bounds=typeof bounds==='string'?bounds:cloneBounds(bounds);var node=findDOMNode(draggable);if(typeof bounds==='string'){var ownerDocument=node.ownerDocument;var ownerWindow=ownerDocument.defaultView;var boundNode;if(bounds==='parent'){boundNode=node.parentNode;}else{boundNode=ownerDocument.querySelector(bounds);}if(!(boundNode instanceof ownerWindow.HTMLElement)){throw new Error('Bounds selector "'+bounds+'" could not find an element.');}var boundNodeEl/*: HTMLElement*/=boundNode;// for Flow, can't seem to refine correctly
var nodeStyle=ownerWindow.getComputedStyle(node);var boundNodeStyle=ownerWindow.getComputedStyle(boundNodeEl);// Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
bounds={left:-node.offsetLeft+(0,_shims$1.int)(boundNodeStyle.paddingLeft)+(0,_shims$1.int)(nodeStyle.marginLeft),top:-node.offsetTop+(0,_shims$1.int)(boundNodeStyle.paddingTop)+(0,_shims$1.int)(nodeStyle.marginTop),right:(0,_domFns$1.innerWidth)(boundNodeEl)-(0,_domFns$1.outerWidth)(node)-node.offsetLeft+(0,_shims$1.int)(boundNodeStyle.paddingRight)-(0,_shims$1.int)(nodeStyle.marginRight),bottom:(0,_domFns$1.innerHeight)(boundNodeEl)-(0,_domFns$1.outerHeight)(node)-node.offsetTop+(0,_shims$1.int)(boundNodeStyle.paddingBottom)-(0,_shims$1.int)(nodeStyle.marginBottom)};}// Keep x and y below right and bottom limits...
if((0,_shims$1.isNum)(bounds.right))x=Math.min(x,bounds.right);if((0,_shims$1.isNum)(bounds.bottom))y=Math.min(y,bounds.bottom);// But above left and top limits.
if((0,_shims$1.isNum)(bounds.left))x=Math.max(x,bounds.left);if((0,_shims$1.isNum)(bounds.top))y=Math.max(y,bounds.top);return[x,y];}function snapToGrid(grid/*: [number, number]*/,pendingX/*: number*/,pendingY/*: number*/)/*: [number, number]*/{var x=Math.round(pendingX/grid[0])*grid[0];var y=Math.round(pendingY/grid[1])*grid[1];return[x,y];}function canDragX(draggable/*: Draggable*/)/*: boolean*/{return draggable.props.axis==='both'||draggable.props.axis==='x';}function canDragY(draggable/*: Draggable*/)/*: boolean*/{return draggable.props.axis==='both'||draggable.props.axis==='y';}// Get {x, y} positions from event.
function getControlPosition(e/*: MouseTouchEvent*/,touchIdentifier/*: ?number*/,draggableCore/*: DraggableCore*/)/*: ?ControlPosition*/{var touchObj=typeof touchIdentifier==='number'?(0,_domFns$1.getTouch)(e,touchIdentifier):null;if(typeof touchIdentifier==='number'&&!touchObj)return null;// not the right touch
var node=findDOMNode(draggableCore);// User can provide an offsetParent if desired.
var offsetParent=draggableCore.props.offsetParent||node.offsetParent||node.ownerDocument.body;return(0,_domFns$1.offsetXYFromParent)(touchObj||e,offsetParent,draggableCore.props.scale);}// Create an data object exposed by <DraggableCore>'s events
function createCoreData(draggable/*: DraggableCore*/,x/*: number*/,y/*: number*/)/*: DraggableData*/{var state=draggable.state;var isStart=!(0,_shims$1.isNum)(state.lastX);var node=findDOMNode(draggable);if(isStart){// If this is our first move, use the x and y as last coords.
return{node:node,deltaX:0,deltaY:0,lastX:x,lastY:y,x:x,y:y};}else{// Otherwise calculate proper values.
return{node:node,deltaX:x-state.lastX,deltaY:y-state.lastY,lastX:state.lastX,lastY:state.lastY,x:x,y:y};}}// Create an data exposed by <Draggable>'s events
function createDraggableData(draggable/*: Draggable*/,coreData/*: DraggableData*/)/*: DraggableData*/{var scale=draggable.props.scale;return{node:coreData.node,x:draggable.state.x+coreData.deltaX/scale,y:draggable.state.y+coreData.deltaY/scale,deltaX:coreData.deltaX/scale,deltaY:coreData.deltaY/scale,lastX:draggable.state.x,lastY:draggable.state.y};}// A lot faster than stringify/parse
function cloneBounds(bounds/*: Bounds*/)/*: Bounds*/{return{left:bounds.left,top:bounds.top,right:bounds.right,bottom:bounds.bottom};}function findDOMNode(draggable/*: Draggable | DraggableCore*/)/*: HTMLElement*/{var node=draggable.findDOMNode();if(!node){throw new Error('<DraggableCore>: Unmounted during event!');}// $FlowIgnore we can't assert on HTMLElement due to tests... FIXME
return node;}var DraggableCore$2={};var log$1={};Object.defineProperty(log$1,"__esModule",{value:true});log$1.default=log;/*eslint no-console:0*/function log(){}function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}Object.defineProperty(DraggableCore$2,"__esModule",{value:true});DraggableCore$2.default=void 0;var React=_interopRequireWildcard(React__default$1["default"]);var _propTypes=_interopRequireDefault(propTypes.exports);var _reactDom=_interopRequireDefault(require$$2__default["default"]);var _domFns=domFns;var _positionFns=positionFns;var _shims=shims;var _log=_interopRequireDefault(log$1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){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 _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf$2(subClass,superClass);}function _setPrototypeOf$2(o,p){_setPrototypeOf$2=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf$2(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct$1();return function _createSuperInternal(){var Super=_getPrototypeOf$1(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf$1(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized$2(self);}function _assertThisInitialized$2(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct$1(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf$1(o){_getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf$1(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}// Simple abstraction for dragging events names.
var eventsFor={touch:{start:'touchstart',move:'touchmove',stop:'touchend'},mouse:{start:'mousedown',move:'mousemove',stop:'mouseup'}};// Default to mouse events.
var dragEventFor=eventsFor.mouse;/*:: type DraggableCoreState = {
  dragging: boolean,
  lastX: number,
  lastY: number,
  touchIdentifier: ?number
};*/ /*:: export type DraggableData = {
  node: HTMLElement,
  x: number, y: number,
  deltaX: number, deltaY: number,
  lastX: number, lastY: number,
};*/ /*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/ /*:: export type ControlPosition = {x: number, y: number};*/ /*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/ /*:: export type DraggableCoreDefaultProps = {
  allowAnyClick: boolean,
  disabled: boolean,
  enableUserSelectHack: boolean,
  onStart: DraggableEventHandler,
  onDrag: DraggableEventHandler,
  onStop: DraggableEventHandler,
  onMouseDown: (e: MouseEvent) => void,
  scale: number,
};*/ /*:: export type DraggableCoreProps = {
  ...DraggableCoreDefaultProps,
  cancel: string,
  children: ReactElement<any>,
  offsetParent: HTMLElement,
  grid: [number, number],
  handle: string,
  nodeRef?: ?React.ElementRef<any>,
};*/ //
// Define <DraggableCore>.
//
// <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can
// work well with libraries that require more control over the element.
//
var DraggableCore$1=/*#__PURE__*/function(_React$Component){_inherits(DraggableCore,_React$Component);var _super=_createSuper(DraggableCore);function DraggableCore(){var _this;_classCallCheck(this,DraggableCore);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_defineProperty(_assertThisInitialized$2(_this),"state",{dragging:false,// Used while dragging to determine deltas.
lastX:NaN,lastY:NaN,touchIdentifier:null});_defineProperty(_assertThisInitialized$2(_this),"mounted",false);_defineProperty(_assertThisInitialized$2(_this),"handleDragStart",function(e){// Make it possible to attach event handlers on top of this one.
_this.props.onMouseDown(e);// Only accept left-clicks.
if(!_this.props.allowAnyClick&&typeof e.button==='number'&&e.button!==0)return false;// Get nodes. Be sure to grab relative document (could be iframed)
var thisNode=_this.findDOMNode();if(!thisNode||!thisNode.ownerDocument||!thisNode.ownerDocument.body){throw new Error('<DraggableCore> not mounted on DragStart!');}var ownerDocument=thisNode.ownerDocument;// Short circuit if handle or cancel prop was provided and selector doesn't match.
if(_this.props.disabled||!(e.target instanceof ownerDocument.defaultView.Node)||_this.props.handle&&!(0,_domFns.matchesSelectorAndParentsTo)(e.target,_this.props.handle,thisNode)||_this.props.cancel&&(0,_domFns.matchesSelectorAndParentsTo)(e.target,_this.props.cancel,thisNode)){return;}// Prevent scrolling on mobile devices, like ipad/iphone.
// Important that this is after handle/cancel.
if(e.type==='touchstart')e.preventDefault();// Set touch identifier in component state if this is a touch event. This allows us to
// distinguish between individual touches on multitouch screens by identifying which
// touchpoint was set to this element.
var touchIdentifier=(0,_domFns.getTouchIdentifier)(e);_this.setState({touchIdentifier:touchIdentifier});// Get the current drag point from the event. This is used as the offset.
var position=(0,_positionFns.getControlPosition)(e,touchIdentifier,_assertThisInitialized$2(_this));if(position==null)return;// not possible but satisfies flow
var x=position.x,y=position.y;// Create an event object with all the data parents need to make a decision here.
var coreEvent=(0,_positionFns.createCoreData)(_assertThisInitialized$2(_this),x,y);(0,_log.default)('DraggableCore: handleDragStart: %j',coreEvent);// Call event handler. If it returns explicit false, cancel.
(0,_log.default)('calling',_this.props.onStart);var shouldUpdate=_this.props.onStart(e,coreEvent);if(shouldUpdate===false||_this.mounted===false)return;// Add a style to the body to disable user-select. This prevents text from
// being selected all over the page.
if(_this.props.enableUserSelectHack)(0,_domFns.addUserSelectStyles)(ownerDocument);// Initiate dragging. Set the current x and y as offsets
// so we know how much we've moved during the drag. This allows us
// to drag elements around even if they have been moved, without issue.
_this.setState({dragging:true,lastX:x,lastY:y});// Add events to the document directly so we catch when the user's mouse/touch moves outside of
// this element. We use different events depending on whether or not we have detected that this
// is a touch-capable device.
(0,_domFns.addEvent)(ownerDocument,dragEventFor.move,_this.handleDrag);(0,_domFns.addEvent)(ownerDocument,dragEventFor.stop,_this.handleDragStop);});_defineProperty(_assertThisInitialized$2(_this),"handleDrag",function(e){// Get the current drag point from the event. This is used as the offset.
var position=(0,_positionFns.getControlPosition)(e,_this.state.touchIdentifier,_assertThisInitialized$2(_this));if(position==null)return;var x=position.x,y=position.y;// Snap to grid if prop has been provided
if(Array.isArray(_this.props.grid)){var deltaX=x-_this.state.lastX,deltaY=y-_this.state.lastY;var _snapToGrid=(0,_positionFns.snapToGrid)(_this.props.grid,deltaX,deltaY);var _snapToGrid2=_slicedToArray(_snapToGrid,2);deltaX=_snapToGrid2[0];deltaY=_snapToGrid2[1];if(!deltaX&&!deltaY)return;// skip useless drag
x=_this.state.lastX+deltaX,y=_this.state.lastY+deltaY;}var coreEvent=(0,_positionFns.createCoreData)(_assertThisInitialized$2(_this),x,y);(0,_log.default)('DraggableCore: handleDrag: %j',coreEvent);// Call event handler. If it returns explicit false, trigger end.
var shouldUpdate=_this.props.onDrag(e,coreEvent);if(shouldUpdate===false||_this.mounted===false){try{// $FlowIgnore
_this.handleDragStop(new MouseEvent('mouseup'));}catch(err){// Old browsers
var event=document.createEvent('MouseEvents')/*: any*/ /*: MouseTouchEvent*/;// I see why this insanity was deprecated
// $FlowIgnore
event.initMouseEvent('mouseup',true,true,window,0,0,0,0,0,false,false,false,false,0,null);_this.handleDragStop(event);}return;}_this.setState({lastX:x,lastY:y});});_defineProperty(_assertThisInitialized$2(_this),"handleDragStop",function(e){if(!_this.state.dragging)return;var position=(0,_positionFns.getControlPosition)(e,_this.state.touchIdentifier,_assertThisInitialized$2(_this));if(position==null)return;var x=position.x,y=position.y;var coreEvent=(0,_positionFns.createCoreData)(_assertThisInitialized$2(_this),x,y);// Call event handler
var shouldContinue=_this.props.onStop(e,coreEvent);if(shouldContinue===false||_this.mounted===false)return false;var thisNode=_this.findDOMNode();if(thisNode){// Remove user-select hack
if(_this.props.enableUserSelectHack)(0,_domFns.removeUserSelectStyles)(thisNode.ownerDocument);}(0,_log.default)('DraggableCore: handleDragStop: %j',coreEvent);// Reset the el.
_this.setState({dragging:false,lastX:NaN,lastY:NaN});if(thisNode){// Remove event handlers
(0,_log.default)('DraggableCore: Removing handlers');(0,_domFns.removeEvent)(thisNode.ownerDocument,dragEventFor.move,_this.handleDrag);(0,_domFns.removeEvent)(thisNode.ownerDocument,dragEventFor.stop,_this.handleDragStop);}});_defineProperty(_assertThisInitialized$2(_this),"onMouseDown",function(e){dragEventFor=eventsFor.mouse;// on touchscreen laptops we could switch back to mouse
return _this.handleDragStart(e);});_defineProperty(_assertThisInitialized$2(_this),"onMouseUp",function(e){dragEventFor=eventsFor.mouse;return _this.handleDragStop(e);});_defineProperty(_assertThisInitialized$2(_this),"onTouchStart",function(e){// We're on a touch device now, so change the event handlers
dragEventFor=eventsFor.touch;return _this.handleDragStart(e);});_defineProperty(_assertThisInitialized$2(_this),"onTouchEnd",function(e){// We're on a touch device now, so change the event handlers
dragEventFor=eventsFor.touch;return _this.handleDragStop(e);});return _this;}_createClass(DraggableCore,[{key:"componentDidMount",value:function componentDidMount(){this.mounted=true;// Touch handlers must be added with {passive: false} to be cancelable.
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
var thisNode=this.findDOMNode();if(thisNode){(0,_domFns.addEvent)(thisNode,eventsFor.touch.start,this.onTouchStart,{passive:false});}}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.mounted=false;// Remove any leftover event handlers. Remove both touch and mouse handlers in case
// some browser quirk caused a touch event to fire during a mouse move, or vice versa.
var thisNode=this.findDOMNode();if(thisNode){var ownerDocument=thisNode.ownerDocument;(0,_domFns.removeEvent)(ownerDocument,eventsFor.mouse.move,this.handleDrag);(0,_domFns.removeEvent)(ownerDocument,eventsFor.touch.move,this.handleDrag);(0,_domFns.removeEvent)(ownerDocument,eventsFor.mouse.stop,this.handleDragStop);(0,_domFns.removeEvent)(ownerDocument,eventsFor.touch.stop,this.handleDragStop);(0,_domFns.removeEvent)(thisNode,eventsFor.touch.start,this.onTouchStart,{passive:false});if(this.props.enableUserSelectHack)(0,_domFns.removeUserSelectStyles)(ownerDocument);}}// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
// the underlying DOM node ourselves. See the README for more information.
},{key:"findDOMNode",value:function findDOMNode()/*: ?HTMLElement*/{var _this$props$nodeRef$c,_this$props,_this$props$nodeRef;return(_this$props$nodeRef$c=(_this$props=this.props)===null||_this$props===void 0?void 0:(_this$props$nodeRef=_this$props.nodeRef)===null||_this$props$nodeRef===void 0?void 0:_this$props$nodeRef.current)!==null&&_this$props$nodeRef$c!==void 0?_this$props$nodeRef$c:_reactDom.default.findDOMNode(this);}},{key:"render",value:function render()/*: React.Element<any>*/{// Reuse the child provided
// This makes it flexible to use whatever element is wanted (div, ul, etc)
return/*#__PURE__*/React.cloneElement(React.Children.only(this.props.children),{// Note: mouseMove handler is attached to document so it will still function
// when the user drags quickly and leaves the bounds of the element.
onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,// onTouchStart is added on `componentDidMount` so they can be added with
// {passive: false}, which allows it to cancel. See
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
onTouchEnd:this.onTouchEnd});}}]);return DraggableCore;}(React.Component);DraggableCore$2.default=DraggableCore$1;_defineProperty(DraggableCore$1,"displayName",'DraggableCore');_defineProperty(DraggableCore$1,"propTypes",{/**
   * `allowAnyClick` allows dragging using any mouse button.
   * By default, we only accept the left button.
   *
   * Defaults to `false`.
   */allowAnyClick:_propTypes.default.bool,/**
   * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
   * with the exception of `onMouseDown`, will not fire.
   */disabled:_propTypes.default.bool,/**
   * By default, we add 'user-select:none' attributes to the document body
   * to prevent ugly text selection during drag. If this is causing problems
   * for your app, set this to `false`.
   */enableUserSelectHack:_propTypes.default.bool,/**
   * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
   * instead of using the parent node.
   */offsetParent:function offsetParent(props/*: DraggableCoreProps*/,propName/*: $Keys<DraggableCoreProps>*/){if(props[propName]&&props[propName].nodeType!==1){throw new Error('Draggable\'s offsetParent must be a DOM Node.');}},/**
   * `grid` specifies the x and y that dragging should snap to.
   */grid:_propTypes.default.arrayOf(_propTypes.default.number),/**
   * `handle` specifies a selector to be used as the handle that initiates drag.
   *
   * Example:
   *
   * ```jsx
   *   let App = React.createClass({
   *       render: function () {
   *         return (
   *            <Draggable handle=".handle">
   *              <div>
   *                  <div className="handle">Click me to drag</div>
   *                  <div>This is some other content</div>
   *              </div>
   *           </Draggable>
   *         );
   *       }
   *   });
   * ```
   */handle:_propTypes.default.string,/**
   * `cancel` specifies a selector to be used to prevent drag initialization.
   *
   * Example:
   *
   * ```jsx
   *   let App = React.createClass({
   *       render: function () {
   *           return(
   *               <Draggable cancel=".cancel">
   *                   <div>
   *                     <div className="cancel">You can't drag from here</div>
   *                     <div>Dragging here works fine</div>
   *                   </div>
   *               </Draggable>
   *           );
   *       }
   *   });
   * ```
   */cancel:_propTypes.default.string,/* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
   * Unfortunately, in order for <Draggable> to work properly, we need raw access
   * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
   * as in this example:
   *
   * function MyComponent() {
   *   const nodeRef = React.useRef(null);
   *   return (
   *     <Draggable nodeRef={nodeRef}>
   *       <div ref={nodeRef}>Example Target</div>
   *     </Draggable>
   *   );
   * }
   *
   * This can be used for arbitrarily nested components, so long as the ref ends up
   * pointing to the actual child DOM node and not a custom component.
   */nodeRef:_propTypes.default.object,/**
   * Called when dragging starts.
   * If this function returns the boolean false, dragging will be canceled.
   */onStart:_propTypes.default.func,/**
   * Called while dragging.
   * If this function returns the boolean false, dragging will be canceled.
   */onDrag:_propTypes.default.func,/**
   * Called when dragging stops.
   * If this function returns the boolean false, the drag will remain active.
   */onStop:_propTypes.default.func,/**
   * A workaround option which can be passed if onMouseDown needs to be accessed,
   * since it'll always be blocked (as there is internal use of onMouseDown)
   */onMouseDown:_propTypes.default.func,/**
   * `scale`, if set, applies scaling while dragging an element
   */scale:_propTypes.default.number,/**
   * These properties should be defined on the child, not here.
   */className:_shims.dontSetMe,style:_shims.dontSetMe,transform:_shims.dontSetMe});_defineProperty(DraggableCore$1,"defaultProps",{allowAnyClick:false,// by default only accept left click
disabled:false,enableUserSelectHack:true,onStart:function onStart(){},onDrag:function onDrag(){},onStop:function onStop(){},onMouseDown:function onMouseDown(){},scale:1});(function(exports){function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DraggableCore",{enumerable:true,get:function get(){return _DraggableCore.default;}});exports.default=void 0;var React=_interopRequireWildcard(React__default$1["default"]);var _propTypes=_interopRequireDefault(propTypes.exports);var _reactDom=_interopRequireDefault(require$$2__default["default"]);var _clsx2=_interopRequireDefault(require$$3);var _domFns=domFns;var _positionFns=positionFns;var _shims=shims;var _DraggableCore=_interopRequireDefault(DraggableCore$2);var _log=_interopRequireDefault(log$1);var _excluded=["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});}keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){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 _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}//
// Define <Draggable>
//
var Draggable=/*#__PURE__*/function(_React$Component){_inherits(Draggable,_React$Component);var _super=_createSuper(Draggable);function Draggable(props/*: DraggableProps*/){var _this;_classCallCheck(this,Draggable);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"onDragStart",function(e,coreData){(0,_log.default)('Draggable: onDragStart: %j',coreData);// Short-circuit if user's callback killed it.
var shouldStart=_this.props.onStart(e,(0,_positionFns.createDraggableData)(_assertThisInitialized(_this),coreData));// Kills start event on core as well, so move handlers are never bound.
if(shouldStart===false)return false;_this.setState({dragging:true,dragged:true});});_defineProperty(_assertThisInitialized(_this),"onDrag",function(e,coreData){if(!_this.state.dragging)return false;(0,_log.default)('Draggable: onDrag: %j',coreData);var uiData=(0,_positionFns.createDraggableData)(_assertThisInitialized(_this),coreData);var newState/*: $Shape<DraggableState>*/={x:uiData.x,y:uiData.y};// Keep within bounds.
if(_this.props.bounds){// Save original x and y.
var x=newState.x,y=newState.y;// Add slack to the values used to calculate bound position. This will ensure that if
// we start removing slack, the element won't react to it right away until it's been
// completely removed.
newState.x+=_this.state.slackX;newState.y+=_this.state.slackY;// Get bound position. This will ceil/floor the x and y within the boundaries.
var _getBoundPosition=(0,_positionFns.getBoundPosition)(_assertThisInitialized(_this),newState.x,newState.y),_getBoundPosition2=_slicedToArray(_getBoundPosition,2),newStateX=_getBoundPosition2[0],newStateY=_getBoundPosition2[1];newState.x=newStateX;newState.y=newStateY;// Recalculate slack by noting how much was shaved by the boundPosition handler.
newState.slackX=_this.state.slackX+(x-newState.x);newState.slackY=_this.state.slackY+(y-newState.y);// Update the event we fire to reflect what really happened after bounds took effect.
uiData.x=newState.x;uiData.y=newState.y;uiData.deltaX=newState.x-_this.state.x;uiData.deltaY=newState.y-_this.state.y;}// Short-circuit if user's callback killed it.
var shouldUpdate=_this.props.onDrag(e,uiData);if(shouldUpdate===false)return false;_this.setState(newState);});_defineProperty(_assertThisInitialized(_this),"onDragStop",function(e,coreData){if(!_this.state.dragging)return false;// Short-circuit if user's callback killed it.
var shouldContinue=_this.props.onStop(e,(0,_positionFns.createDraggableData)(_assertThisInitialized(_this),coreData));if(shouldContinue===false)return false;(0,_log.default)('Draggable: onDragStop: %j',coreData);var newState/*: $Shape<DraggableState>*/={dragging:false,slackX:0,slackY:0};// If this is a controlled component, the result of this operation will be to
// revert back to the old position. We expect a handler on `onDragStop`, at the least.
var controlled=Boolean(_this.props.position);if(controlled){var _this$props$position=_this.props.position,x=_this$props$position.x,y=_this$props$position.y;newState.x=x;newState.y=y;}_this.setState(newState);});_this.state={// Whether or not we are currently dragging.
dragging:false,// Whether or not we have been dragged before.
dragged:false,// Current transform x and y.
x:props.position?props.position.x:props.defaultPosition.x,y:props.position?props.position.y:props.defaultPosition.y,prevPropsPosition:_objectSpread({},props.position),// Used for compensating for out-of-bounds drags
slackX:0,slackY:0,// Can only determine if SVG after mounting
isElementSVG:false};if(props.position&&!(props.onDrag||props.onStop)){// eslint-disable-next-line no-console
console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this '+'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the '+'`position` of this element.');}return _this;}_createClass(Draggable,[{key:"componentDidMount",value:function componentDidMount(){// Check to see if the element passed is an instanceof SVGElement
if(typeof window.SVGElement!=='undefined'&&this.findDOMNode()instanceof window.SVGElement){this.setState({isElementSVG:true});}}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.setState({dragging:false});// prevents invariant if unmounted while dragging
}// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
// the underlying DOM node ourselves. See the README for more information.
},{key:"findDOMNode",value:function findDOMNode()/*: ?HTMLElement*/{var _this$props$nodeRef$c,_this$props,_this$props$nodeRef;return(_this$props$nodeRef$c=(_this$props=this.props)===null||_this$props===void 0?void 0:(_this$props$nodeRef=_this$props.nodeRef)===null||_this$props$nodeRef===void 0?void 0:_this$props$nodeRef.current)!==null&&_this$props$nodeRef$c!==void 0?_this$props$nodeRef$c:_reactDom.default.findDOMNode(this);}},{key:"render",value:function render()/*: ReactElement<any>*/{var _clsx;var _this$props2=this.props;_this$props2.axis;_this$props2.bounds;var children=_this$props2.children,defaultPosition=_this$props2.defaultPosition,defaultClassName=_this$props2.defaultClassName,defaultClassNameDragging=_this$props2.defaultClassNameDragging,defaultClassNameDragged=_this$props2.defaultClassNameDragged,position=_this$props2.position,positionOffset=_this$props2.positionOffset;_this$props2.scale;var draggableCoreProps=_objectWithoutProperties(_this$props2,_excluded);var style={};var svgTransform=null;// If this is controlled, we don't want to move it - unless it's dragging.
var controlled=Boolean(position);var draggable=!controlled||this.state.dragging;var validPosition=position||defaultPosition;var transformOpts={// Set left if horizontal drag is enabled
x:(0,_positionFns.canDragX)(this)&&draggable?this.state.x:validPosition.x,// Set top if vertical drag is enabled
y:(0,_positionFns.canDragY)(this)&&draggable?this.state.y:validPosition.y};// If this element was SVG, we use the `transform` attribute.
if(this.state.isElementSVG){svgTransform=(0,_domFns.createSVGTransform)(transformOpts,positionOffset);}else{// Add a CSS transform to move the element around. This allows us to move the element around
// without worrying about whether or not it is relatively or absolutely positioned.
// If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
// has a clean slate.
style=(0,_domFns.createCSSTransform)(transformOpts,positionOffset);}// Mark with class while dragging
var className=(0,_clsx2.default)(children.props.className||'',defaultClassName,(_clsx={},_defineProperty(_clsx,defaultClassNameDragging,this.state.dragging),_defineProperty(_clsx,defaultClassNameDragged,this.state.dragged),_clsx));// Reuse the child provided
// This makes it flexible to use whatever element is wanted (div, ul, etc)
return/*#__PURE__*/React.createElement(_DraggableCore.default,_extends({},draggableCoreProps,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),/*#__PURE__*/React.cloneElement(React.Children.only(children),{className:className,style:_objectSpread(_objectSpread({},children.props.style),style),transform:svgTransform}));}}],[{key:"getDerivedStateFromProps",value:// React 16.3+
// Arity (props, state)
function getDerivedStateFromProps(_ref,_ref2)/*: ?$Shape<DraggableState>*/{var position=_ref.position;var prevPropsPosition=_ref2.prevPropsPosition;// Set x/y if a new position is provided in props that is different than the previous.
if(position&&(!prevPropsPosition||position.x!==prevPropsPosition.x||position.y!==prevPropsPosition.y)){(0,_log.default)('Draggable: getDerivedStateFromProps %j',{position:position,prevPropsPosition:prevPropsPosition});return{x:position.x,y:position.y,prevPropsPosition:_objectSpread({},position)};}return null;}}]);return Draggable;}(React.Component);exports.default=Draggable;_defineProperty(Draggable,"displayName",'Draggable');_defineProperty(Draggable,"propTypes",_objectSpread(_objectSpread({},_DraggableCore.default.propTypes),{},{/**
     * `axis` determines which axis the draggable can move.
     *
     *  Note that all callbacks will still return data as normal. This only
     *  controls flushing to the DOM.
     *
     * 'both' allows movement horizontally and vertically.
     * 'x' limits movement to horizontal axis.
     * 'y' limits movement to vertical axis.
     * 'none' limits all movement.
     *
     * Defaults to 'both'.
     */axis:_propTypes.default.oneOf(['both','x','y','none']),/**
     * `bounds` determines the range of movement available to the element.
     * Available values are:
     *
     * 'parent' restricts movement within the Draggable's parent node.
     *
     * Alternatively, pass an object with the following properties, all of which are optional:
     *
     * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
     *
     * All values are in px.
     *
     * Example:
     *
     * ```jsx
     *   let App = React.createClass({
     *       render: function () {
     *         return (
     *            <Draggable bounds={{right: 300, bottom: 300}}>
     *              <div>Content</div>
     *           </Draggable>
     *         );
     *       }
     *   });
     * ```
     */bounds:_propTypes.default.oneOfType([_propTypes.default.shape({left:_propTypes.default.number,right:_propTypes.default.number,top:_propTypes.default.number,bottom:_propTypes.default.number}),_propTypes.default.string,_propTypes.default.oneOf([false])]),defaultClassName:_propTypes.default.string,defaultClassNameDragging:_propTypes.default.string,defaultClassNameDragged:_propTypes.default.string,/**
     * `defaultPosition` specifies the x and y that the dragged item should start at
     *
     * Example:
     *
     * ```jsx
     *      let App = React.createClass({
     *          render: function () {
     *              return (
     *                  <Draggable defaultPosition={{x: 25, y: 25}}>
     *                      <div>I start with transformX: 25px and transformY: 25px;</div>
     *                  </Draggable>
     *              );
     *          }
     *      });
     * ```
     */defaultPosition:_propTypes.default.shape({x:_propTypes.default.number,y:_propTypes.default.number}),positionOffset:_propTypes.default.shape({x:_propTypes.default.oneOfType([_propTypes.default.number,_propTypes.default.string]),y:_propTypes.default.oneOfType([_propTypes.default.number,_propTypes.default.string])}),/**
     * `position`, if present, defines the current position of the element.
     *
     *  This is similar to how form elements in React work - if no `position` is supplied, the component
     *  is uncontrolled.
     *
     * Example:
     *
     * ```jsx
     *      let App = React.createClass({
     *          render: function () {
     *              return (
     *                  <Draggable position={{x: 25, y: 25}}>
     *                      <div>I start with transformX: 25px and transformY: 25px;</div>
     *                  </Draggable>
     *              );
     *          }
     *      });
     * ```
     */position:_propTypes.default.shape({x:_propTypes.default.number,y:_propTypes.default.number}),/**
     * These properties should be defined on the child, not here.
     */className:_shims.dontSetMe,style:_shims.dontSetMe,transform:_shims.dontSetMe}));_defineProperty(Draggable,"defaultProps",_objectSpread(_objectSpread({},_DraggableCore.default.defaultProps),{},{axis:'both',bounds:false,defaultClassName:'react-draggable',defaultClassNameDragging:'react-draggable-dragging',defaultClassNameDragged:'react-draggable-dragged',defaultPosition:{x:0,y:0},scale:1}));})(Draggable$2);var _require=Draggable$2,Draggable=_require.default,DraggableCore=_require.DraggableCore;// Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
// See https://github.com/mzabriskie/react-draggable/pull/254
// and https://github.com/mzabriskie/react-draggable/issues/266
cjs.exports=Draggable;cjs.exports.default=Draggable;cjs.exports.DraggableCore=DraggableCore;var Draggable$1=cjs.exports;const Handle=theming.styled.div(({theme,isDragging})=>({zIndex:10,position:'absolute',top:0,left:0,display:'flex',justifyContent:'center',alignItems:'center',color:isDragging?theme.color.secondary:theme.appBorderColor,overflow:'hidden',transition:'color 0.2s linear, background-position 0.2s linear, background-size 0.2s linear, background 0.2s linear','&:hover':{color:theme.color.secondary}}),({axis})=>({cursor:axis==='x'?'col-resize':'row-resize'}),({theme,axis})=>axis==='x'?{height:'100%',width:theme.layoutMargin,marginLeft:0}:{height:theme.layoutMargin,width:'100%',marginTop:0},({axis,isDragging})=>{if(axis==='y'){const style={backgroundImage:`radial-gradient(at center center,rgba(0,0,0,0.2) 0%,transparent 70%,transparent 100%)`,backgroundSize:'100% 50px',backgroundPosition:'50% 0',backgroundRepeat:'no-repeat'};return isDragging?style:Object.assign(Object.assign({},style),{backgroundPosition:'50% 10px','&:hover':style});}if(axis==='x'){const style={backgroundImage:`radial-gradient(at center center,rgba(0,0,0,0.2) 0%,transparent 70%,transparent 100%)`,backgroundSize:'50px 100%',backgroundPosition:'0 50%',backgroundRepeat:'no-repeat'};return isDragging?style:Object.assign(Object.assign({},style),{backgroundPosition:'10px 50%','&:hover':style});}return{};});const MIN_NAV_WIDTH=200;// visually there's an additional 10px due to the canvas' left margin
const MIN_CANVAS_WIDTH=200;// visually it's 10px less due to the canvas' left margin
const MIN_CANVAS_HEIGHT=200;// visually it's 50px less due to the canvas toolbar and top margin
const MIN_PANEL_WIDTH=200;// visually it's 10px less due to the canvas' right margin
const MIN_PANEL_HEIGHT=200;// visually it's 50px less due to the panel toolbar and bottom margin
const DEFAULT_NAV_WIDTH=220;const DEFAULT_PANEL_WIDTH=400;const Pane=theming.styled.div({position:'absolute',boxSizing:'border-box',top:0,left:0,width:'100%',height:'100%'},({hidden})=>hidden?{opacity:0}:{opacity:1},({top})=>top?{zIndex:9}:{},({border,theme})=>{switch(border){case'left':{return{borderLeft:`1px solid ${theme.appBorderColor}`};}case'right':{return{borderRight:`1px solid ${theme.appBorderColor}`};}case'top':{return{borderTop:`1px solid ${theme.appBorderColor}`};}case'bottom':{return{borderBottom:`1px solid ${theme.appBorderColor}`};}default:{return{};}}},({animate})=>animate?{transition:['width','height','top','left','background','opacity','transform'].map(p=>`${p} 0.1s ease-out`).join(',')}:{});const Paper=theming.styled.div({position:'absolute',top:0,left:0,width:'100%',height:'100%'},({isFullscreen,theme})=>isFullscreen?{boxShadow:'none',borderRadius:0}:{borderRadius:theme.appBorderRadius,overflow:'hidden',boxShadow:'0 1px 5px 0 rgba(0, 0, 0, 0.1)'});const Sidebar$2=_a=>{var{hidden=false,children,position=undefined}=_a,props=__rest(_a,["hidden","children","position"]);return hidden?null:React__default$1["default"].createElement(Pane,Object.assign({style:position},props),children);};const Main$1=_a=>{var{isFullscreen=false,children,position=undefined}=_a,props=__rest(_a,["isFullscreen","children","position"]);return React__default$1["default"].createElement(Pane,Object.assign({style:position,top:true},props,{role:"main"}),React__default$1["default"].createElement(Paper,{isFullscreen:isFullscreen},children));};const Preview$1=_a=>{var{hidden=false,children,position=undefined}=_a,props=__rest(_a,["hidden","children","position"]);return React__default$1["default"].createElement(Pane,Object.assign({style:position,top:true,hidden:hidden},props),children);};const Panel$1=_a=>{var{hidden=false,children,position=undefined,align='right'}=_a,props=__rest(_a,["hidden","children","position","align"]);return React__default$1["default"].createElement(Pane,Object.assign({style:position,hidden:hidden},props,{border:align==='bottom'?'top':'left'}),children);};const HoverBlocker=theming.styled.div({position:'absolute',left:0,top:0,zIndex:15,height:'100vh',width:'100vw'});const getPreviewPosition=({panelPosition,isPanelHidden,isNavHidden,isFullscreen,bounds,resizerPanel,resizerNav,margin})=>{if(isFullscreen||isPanelHidden){return{};}const navX=isNavHidden?0:resizerNav.x;const panelX=resizerPanel.x;const panelY=resizerPanel.y;return panelPosition==='bottom'?{height:panelY-margin,left:0,top:0,width:bounds.width-navX-2*margin}:{height:bounds.height-2*margin,left:0,top:0,width:panelX-navX-margin};};const getMainPosition=({bounds,resizerNav,isNavHidden,isFullscreen,margin})=>{if(isFullscreen){return{};}const navX=isNavHidden?0:resizerNav.x;return{height:bounds.height-margin*2,left:navX+margin,top:margin,width:bounds.width-navX-margin*2};};const getPanelPosition=({isPanelBottom,isPanelHidden,isNavHidden,bounds,resizerPanel,resizerNav,margin})=>{const navX=isNavHidden?0:resizerNav.x;const panelX=resizerPanel.x;const panelY=resizerPanel.y;if(isPanelBottom&&isPanelHidden){return{height:bounds.height-panelY-margin,left:0,top:panelY-margin,width:bounds.width-navX-2*margin};}if(!isPanelBottom&&isPanelHidden){return{height:bounds.height-2*margin,left:panelX-navX-margin,top:0,width:bounds.width-panelX-margin};}return isPanelBottom?{height:bounds.height-panelY-margin,left:0,top:panelY-margin,width:bounds.width-navX-2*margin}:{height:bounds.height-2*margin,left:panelX-navX-margin,top:0,width:bounds.width-panelX-margin};};class Layout extends React$2.Component{constructor(props){super(props);this.resizeNav=(e,data)=>{if(data.deltaX){this.setState({resizerNav:{x:data.x,y:data.y}});}};this.resizePanel=(e,data)=>{const{options}=this.props;if(data.deltaY&&options.panelPosition==='bottom'||data.deltaX&&options.panelPosition==='right'){this.setState({resizerPanel:{x:data.x,y:data.y}});}};this.setDragNav=()=>{this.setState({isDragging:'nav'});};this.setDragPanel=()=>{this.setState({isDragging:'panel'});};this.unsetDrag=()=>{this.setState({isDragging:false});};const{bounds,options}=props;const{resizerNav,resizerPanel}=get$1();this.state={isDragging:false,resizerNav:resizerNav||{x:DEFAULT_NAV_WIDTH,y:0},resizerPanel:resizerPanel||(options.panelPosition==='bottom'?{x:0,y:Math.round(bounds.height*0.6)}:{x:bounds.width-DEFAULT_PANEL_WIDTH,y:0})};}static getDerivedStateFromProps(props,state){const{bounds,options}=props;const{resizerPanel,resizerNav}=state;const isNavHidden=options.isFullscreen||!options.showNav;const isPanelHidden=options.isFullscreen||!options.showPanel;const{panelPosition}=options;const isPanelRight=panelPosition==='right';const isPanelBottom=panelPosition==='bottom';const navX=resizerNav.x;const panelX=resizerPanel.x;const panelY=resizerPanel.y;const mutation={};if(!isNavHidden){const minPanelWidth=!isPanelHidden&&isPanelRight?MIN_PANEL_WIDTH:0;const minMainWidth=MIN_CANVAS_WIDTH+minPanelWidth;const maxNavX=bounds.width-minMainWidth;const minNavX=MIN_NAV_WIDTH;// coordinate translates directly to width here
if(navX>maxNavX){// upper bound
mutation.resizerNav={x:maxNavX,y:0};}else if(navX<minNavX||maxNavX<minNavX){// lower bound, supercedes upper bound if needed
mutation.resizerNav={x:minNavX,y:0};}}if(isPanelRight&&!isPanelHidden){const maxPanelX=bounds.width-MIN_PANEL_WIDTH;const minPanelX=navX+MIN_CANVAS_WIDTH;if(panelX>maxPanelX||panelX===0){// upper bound or when switching orientation
mutation.resizerPanel={x:maxPanelX,y:0};}else if(panelX<minPanelX){// lower bound
mutation.resizerPanel={x:minPanelX,y:0};}}if(isPanelBottom&&!isPanelHidden){const maxPanelY=bounds.height-MIN_PANEL_HEIGHT;if(panelY>maxPanelY||panelY===0){// lower bound or when switching orientation
mutation.resizerPanel={x:0,y:bounds.height-200};}// upper bound is enforced by the Draggable's bounds
}return mutation.resizerPanel||mutation.resizerNav?Object.assign(Object.assign({},state),mutation):state;}componentDidUpdate(prevProps,prevState){const{resizerPanel,resizerNav}=this.state;set({resizerPanel,resizerNav});const{width:prevWidth,height:prevHeight}=prevProps.bounds;const{bounds,options}=this.props;const{width,height}=bounds;if(width!==prevWidth||height!==prevHeight){const{panelPosition}=options;const isPanelBottom=panelPosition==='bottom';if(isPanelBottom){this.setState({resizerPanel:{x:prevState.resizerPanel.x,y:prevState.resizerPanel.y-(prevHeight-height)}});}else{this.setState({resizerPanel:{x:prevState.resizerPanel.x-(prevWidth-width),y:prevState.resizerPanel.y}});}}}render(){const{children,bounds,options,theme,viewMode,docsOnly,panelCount}=this.props;const{isDragging,resizerNav,resizerPanel}=this.state;const margin=theme.layoutMargin;const isNavHidden=options.isFullscreen||!options.showNav;const isPanelHidden=options.isFullscreen||!options.showPanel||docsOnly||viewMode!=='story'||panelCount===0;const isFullscreen=options.isFullscreen||isNavHidden&&isPanelHidden;const{showToolbar}=options;const{panelPosition}=options;const isPanelBottom=panelPosition==='bottom';const isPanelRight=panelPosition==='right';const panelX=resizerPanel.x;const navX=resizerNav.x;return bounds?React__default$1["default"].createElement(React$2.Fragment,null,isNavHidden?null:React__default$1["default"].createElement(Draggable$1,{axis:"x",position:resizerNav,bounds:{left:MIN_NAV_WIDTH,top:0,right:isPanelRight&&!isPanelHidden?panelX-MIN_CANVAS_WIDTH:bounds.width-MIN_CANVAS_WIDTH,bottom:0},onStart:this.setDragNav,onDrag:this.resizeNav,onStop:this.unsetDrag},React__default$1["default"].createElement(Handle,{axis:"x",isDragging:isDragging==='nav'})),isPanelHidden?null:React__default$1["default"].createElement(Draggable$1,{axis:isPanelBottom?'y':'x',position:resizerPanel,bounds:isPanelBottom?{left:0,top:MIN_CANVAS_HEIGHT,right:0,bottom:bounds.height-MIN_PANEL_HEIGHT}:{left:isNavHidden?MIN_CANVAS_WIDTH:navX+MIN_CANVAS_WIDTH,top:0,right:bounds.width-MIN_PANEL_WIDTH,bottom:0},onStart:this.setDragPanel,onDrag:this.resizePanel,onStop:this.unsetDrag},React__default$1["default"].createElement(Handle,{isDragging:isDragging==='panel',style:isPanelBottom?{left:navX+margin,width:bounds.width-navX-2*margin,marginTop:-margin}:{marginLeft:-margin},axis:isPanelBottom?'y':'x'})),isDragging?React__default$1["default"].createElement(HoverBlocker,null):null,children({mainProps:{viewMode,animate:!isDragging,isFullscreen,position:getMainPosition({bounds,resizerNav,isNavHidden,isFullscreen,margin})},previewProps:{viewMode,docsOnly,animate:!isDragging,isFullscreen,showToolbar,position:getPreviewPosition({isFullscreen,isNavHidden,isPanelHidden,resizerNav,resizerPanel,bounds,panelPosition,margin})},navProps:{viewMode,animate:!isDragging,hidden:isNavHidden,position:{height:bounds.height,left:0,top:0,width:navX+margin}},panelProps:{viewMode,animate:!isDragging,align:options.panelPosition,hidden:isPanelHidden,position:getPanelPosition({isPanelBottom,isPanelHidden,isNavHidden,bounds,resizerPanel,resizerNav,margin})}})):null;}}Layout.defaultProps={viewMode:undefined,docsOnly:false};const ThemedLayout=theming.withTheme(Layout);const Desktop=Object.assign(React__default$1["default"].memo(({Panel,Sidebar,Preview,Notifications,pages,options,viewMode=undefined,width=0,height=0,panelCount,docsOnly=false})=>React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(Notifications,{placement:{position:'fixed',bottom:20,left:20}}),width&&height?React__default$1["default"].createElement(ThemedLayout,{options:options,bounds:{width,height,top:0,left:0},viewMode:viewMode,docsOnly:!!docsOnly,panelCount:panelCount},({navProps,mainProps,panelProps,previewProps})=>React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(Sidebar$2,Object.assign({},navProps),React__default$1["default"].createElement(Sidebar,null)),React__default$1["default"].createElement(Main$1,Object.assign({},mainProps,{isFullscreen:!!mainProps.isFullscreen}),React__default$1["default"].createElement(Preview$1,Object.assign({},previewProps,{hidden:viewMode==='settings'}),React__default$1["default"].createElement(Preview,{id:"main"})),React__default$1["default"].createElement(Panel$1,Object.assign({},panelProps,{hidden:viewMode!=='story'||docsOnly}),React__default$1["default"].createElement(Panel,null)),pages.map(({key,route:Route,render:Content})=>React__default$1["default"].createElement(Route,{key:key},React__default$1["default"].createElement(Content,null)))))):React__default$1["default"].createElement("div",{title:JSON.stringify({width,height})}))),{displayName:'DesktopLayout'});const StorybookLogoStyled=theming.styled(components.StorybookLogo)({width:'auto',height:'22px !important',display:'block'});const Img$1=theming.styled.img({width:'auto',height:'auto',display:'block',maxWidth:'100%'});const LogoLink=theming.styled.a(({theme})=>({display:'inline-block',height:'100%',margin:'-3px -4px',padding:'2px 3px',border:'1px solid transparent',borderRadius:3,color:'inherit',textDecoration:'none','&:focus':{outline:0,borderColor:theme.color.secondary}}));const Brand=theming.withTheme(({theme})=>{const{title='Storybook',url='./',image,target}=theme.brand;const targetValue=target||(url==='./'?'':'_blank');// When image is explicitly set to null, enable custom HTML support
if(image===null){if(title===null)return null;// eslint-disable-next-line react/no-danger
if(!url)return React__default$1["default"].createElement("div",{dangerouslySetInnerHTML:{__html:title}});return React__default$1["default"].createElement(LogoLink,{href:url,target:targetValue,dangerouslySetInnerHTML:{__html:title}});}const logo=image?React__default$1["default"].createElement(Img$1,{src:image,alt:title}):React__default$1["default"].createElement(StorybookLogoStyled,{alt:title});if(url){return React__default$1["default"].createElement(LogoLink,{title:title,href:url,target:targetValue},logo);}// The wrapper div serves to prevent image misalignment
return React__default$1["default"].createElement("div",null,logo);});const sharedStyles={height:10,width:10,marginLeft:-5,marginRight:-5,display:'block'};const Icon=theming.styled(components.Icons)(sharedStyles,({theme})=>({color:theme.color.secondary}));const Img=theming.styled.img(sharedStyles);const Placeholder=theming.styled.div(sharedStyles);const MenuItemIcon=({icon,imgSrc})=>{if(icon){return React__default$1["default"].createElement(Icon,{icon:icon});}if(imgSrc){return React__default$1["default"].createElement(Img,{src:imgSrc,alt:"image"});}return React__default$1["default"].createElement(Placeholder,null);};const MenuButton=theming.styled(components.Button)(({highlighted,theme})=>Object.assign({position:'relative',overflow:'visible',padding:7,transition:'none','&:focus':{background:theme.barBg,boxShadow:'none'},// creates a pseudo border that does not affect the box model, but is accessible in high contrast mode
'&:focus:before':{content:'""',position:'absolute',top:0,bottom:0,left:0,right:0,borderRadius:'100%',border:`1px solid ${theme.color.secondary}`}},highlighted&&{'&:after':{content:'""',position:'absolute',top:0,right:0,width:8,height:8,borderRadius:8,background:theme.color.positive}}));const SidebarMenuList=({menu,onHide})=>{const links=React$2.useMemo(()=>{return menu.map(_a=>{var{onClick}=_a,rest=__rest(_a,["onClick"]);return Object.assign(Object.assign({},rest),{onClick:(event,item)=>{if(onClick){onClick(event,item);}onHide();}});});},[menu]);return React__default$1["default"].createElement(components.TooltipLinkList,{links:links});};const SidebarMenu=({isHighlighted,menu})=>{return React__default$1["default"].createElement(components.WithTooltip,{placement:"top",trigger:"click",closeOnClick:true,tooltip:({onHide})=>React__default$1["default"].createElement(SidebarMenuList,{onHide:onHide,menu:menu})},React__default$1["default"].createElement(MenuButton,{outline:true,small:true,containsIcon:true,highlighted:isHighlighted,title:"Shortcuts"},React__default$1["default"].createElement(components.Icons,{icon:"ellipsis"})));};const BrandArea=theming.styled.div(({theme})=>({fontSize:theme.typography.size.s2,fontWeight:theme.typography.weight.bold,color:theme.color.defaultText,marginRight:20,display:'flex',width:'100%',alignItems:'center',minHeight:22,'& > *':{maxWidth:'100%',height:'auto',display:'block',flex:'1 1 auto'}}));const HeadingWrapper=theming.styled.div({display:'flex',alignItems:'center',justifyContent:'space-between',position:'relative',minHeight:28});const SkipToCanvasLink=theming.styled(components.Button)(({theme})=>({display:'none','@media (min-width: 600px)':{display:'block',position:'absolute',width:'100%',padding:'10px 15px',fontSize:theme.typography.size.s1,zIndex:1,transform:'translate(0,-100px)','&:focus':{transform:'translate(0)'}}}));const Heading=_a=>{var{menuHighlighted=false,menu,skipLinkHref}=_a,props=__rest(_a,["menuHighlighted","menu","skipLinkHref"]);return React__default$1["default"].createElement(HeadingWrapper,Object.assign({},props),skipLinkHref&&React__default$1["default"].createElement(SkipToCanvasLink,{secondary:true,isLink:true,tabIndex:0,href:skipLinkHref},"Skip to canvas"),React__default$1["default"].createElement(BrandArea,null,React__default$1["default"].createElement(Brand,null)),React__default$1["default"].createElement(SidebarMenu,{menu:menu,isHighlighted:menuHighlighted}));};const DEFAULT_REF_ID='storybook_internal';const collapseAllStories=stories=>{// keep track of component IDs that have been rewritten to the ID of their first leaf child
const componentIdToLeafId={};// 1) remove all leaves
const leavesRemoved=Object.values(stories).filter(item=>!(item.isLeaf&&stories[item.parent].isComponent));// 2) make all components leaves and rewrite their ID's to the first leaf child
const componentsFlattened=leavesRemoved.map(item=>{const{id,isComponent,children}=item,rest=__rest(item,["id","isComponent","children"]);// this is a folder, so just leave it alone
if(!isComponent){return item;}const nonLeafChildren=[];const leafChildren=[];children.forEach(child=>(stories[child].isLeaf?leafChildren:nonLeafChildren).push(child));if(leafChildren.length===0){return item;// pass through, we'll handle you later
}const leafId=leafChildren[0];const component=Object.assign(Object.assign({args:{}},rest),{id:leafId,kind:stories[leafId].kind,isRoot:false,isLeaf:true,isComponent:true,children:[]});componentIdToLeafId[id]=leafId;// this is a component, so it should not have any non-leaf children
if(nonLeafChildren.length!==0){throw new Error(`Unexpected '${item.id}': ${JSON.stringify({isComponent,nonLeafChildren})}`);}return component;});// 3) rewrite all the children as needed
const childrenRewritten=componentsFlattened.map(item=>{if(item.isLeaf){return item;}const{children}=item,rest=__rest(item,["children"]);const rewritten=children.map(child=>componentIdToLeafId[child]||child);return Object.assign({children:rewritten},rest);});const result={};childrenRewritten.forEach(item=>{result[item.id]=item;});return result;};const collapseDocsOnlyStories=storiesHash=>{// keep track of component IDs that have been rewritten to the ID of their first leaf child
const componentIdToLeafId={};const docsOnlyStoriesRemoved=Object.values(storiesHash).filter(item=>{if(item.isLeaf&&item.parameters&&item.parameters.docsOnly){componentIdToLeafId[item.parent]=item.id;return false;// filter it out
}return true;});const docsOnlyComponentsCollapsed=docsOnlyStoriesRemoved.map(item=>{// collapse docs-only components
const{isComponent,children,id}=item;if(isComponent&&children.length===1){const leafId=componentIdToLeafId[id];if(leafId){const collapsed=Object.assign(Object.assign({args:{}},item),{id:leafId,isLeaf:true,children:[]});return collapsed;}}// update groups
if(children){const rewritten=children.map(child=>componentIdToLeafId[child]||child);return Object.assign(Object.assign({},item),{children:rewritten});}// pass through stories unmodified
return item;});const result={};docsOnlyComponentsCollapsed.forEach(item=>{result[item.id]=item;});return result;};function _extends$1(){_extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends$1.apply(this,arguments);}function _assertThisInitialized$1(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _setPrototypeOf$1(o,p){_setPrototypeOf$1=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf$1(o,p);}function _inheritsLoose$1(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;_setPrototypeOf$1(subClass,superClass);}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _construct(Parent,args,Class){if(_isNativeReflectConstruct()){_construct=Reflect.construct;}else{_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)_setPrototypeOf$1(instance,Class.prototype);return instance;};}return _construct.apply(null,arguments);}function _wrapNativeSuper(Class){var _cache=typeof Map==="function"?new Map():undefined;_wrapNativeSuper=function _wrapNativeSuper(Class){if(Class===null||!_isNativeFunction(Class))return Class;if(typeof Class!=="function"){throw new TypeError("Super expression must either be null or a function");}if(typeof _cache!=="undefined"){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper);}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor);}Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf$1(Wrapper,Class);};return _wrapNativeSuper(Class);}/**
 * Parse errors.md and turn it into a simple hash of code: message
 * @private
 */var ERRORS={"1":"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n","2":"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n","3":"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n","4":"Couldn't generate valid rgb string from %s, it returned %s.\n\n","5":"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n","6":"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n","7":"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n","8":"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n","9":"Please provide a number of steps to the modularScale helper.\n\n","10":"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n","11":"Invalid value passed as base to modularScale, expected number or em string but got \"%s\"\n\n","12":"Expected a string ending in \"px\" or a number passed as the first argument to %s(), got \"%s\" instead.\n\n","13":"Expected a string ending in \"px\" or a number passed as the second argument to %s(), got \"%s\" instead.\n\n","14":"Passed invalid pixel value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n","15":"Passed invalid base value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n","16":"You must provide a template to this method.\n\n","17":"You passed an unsupported selector state to this method.\n\n","18":"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n","19":"fromSize and toSize must be provided as stringified numbers with the same units.\n\n","20":"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n","21":"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n","22":"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n","23":"fontFace expects a name of a font-family.\n\n","24":"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n","25":"fontFace expects localFonts to be an array.\n\n","26":"fontFace expects fileFormats to be an array.\n\n","27":"radialGradient requries at least 2 color-stops to properly render.\n\n","28":"Please supply a filename to retinaImage() as the first argument.\n\n","29":"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n","30":"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n","31":"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n","32":"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n","33":"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n","34":"borderRadius expects a radius value as a string or number as the second argument.\n\n","35":"borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n","36":"Property must be a string value.\n\n","37":"Syntax Error at %s.\n\n","38":"Formula contains a function that needs parentheses at %s.\n\n","39":"Formula is missing closing parenthesis at %s.\n\n","40":"Formula has too many closing parentheses at %s.\n\n","41":"All values in a formula must have the same unit or be unitless.\n\n","42":"Please provide a number of steps to the modularScale helper.\n\n","43":"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n","44":"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n","45":"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n","46":"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n","47":"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n","48":"fromSize and toSize must be provided as stringified numbers with the same units.\n\n","49":"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n","50":"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n","51":"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n","52":"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n","53":"fontFace expects localFonts to be an array.\n\n","54":"fontFace expects fileFormats to be an array.\n\n","55":"fontFace expects a name of a font-family.\n\n","56":"linearGradient requries at least 2 color-stops to properly render.\n\n","57":"radialGradient requries at least 2 color-stops to properly render.\n\n","58":"Please supply a filename to retinaImage() as the first argument.\n\n","59":"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n","60":"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n","61":"Property must be a string value.\n\n","62":"borderRadius expects a radius value as a string or number as the second argument.\n\n","63":"borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n","64":"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n","65":"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n","66":"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n","67":"You must provide a template to this method.\n\n","68":"You passed an unsupported selector state to this method.\n\n","69":"Expected a string ending in \"px\" or a number passed as the first argument to %s(), got %s instead.\n\n","70":"Expected a string ending in \"px\" or a number passed as the second argument to %s(), got %s instead.\n\n","71":"Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n","72":"Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n","73":"Please provide a valid CSS variable.\n\n","74":"CSS variable not found and no default was provided.\n\n","75":"important requires a valid style object, got a %s instead.\n\n","76":"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n","77":"remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n","78":"base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"};/**
 * super basic version of sprintf
 * @private
 */function format$1(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}var a=args[0];var b=[];var c;for(c=1;c<args.length;c+=1){b.push(args[c]);}b.forEach(function(d){a=a.replace(/%[a-z]/,d);});return a;}/**
 * Create an error file out of errors.md for development and a simple web link to the full errors
 * in production mode.
 * @private
 */var PolishedError=/*#__PURE__*/function(_Error){_inheritsLoose$1(PolishedError,_Error);function PolishedError(code){var _this;if(process.env.NODE_ENV==='production'){_this=_Error.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+code+" for more information.")||this;}else{for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}_this=_Error.call(this,format$1.apply(void 0,[ERRORS[code]].concat(args)))||this;}return _assertThisInitialized$1(_this);}return PolishedError;}(/*#__PURE__*/_wrapNativeSuper(Error));function colorToInt(color){return Math.round(color*255);}function convertToInt(red,green,blue){return colorToInt(red)+","+colorToInt(green)+","+colorToInt(blue);}function hslToRgb(hue,saturation,lightness,convert){if(convert===void 0){convert=convertToInt;}if(saturation===0){// achromatic
return convert(lightness,lightness,lightness);}// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
var huePrime=(hue%360+360)%360/60;var chroma=(1-Math.abs(2*lightness-1))*saturation;var secondComponent=chroma*(1-Math.abs(huePrime%2-1));var red=0;var green=0;var blue=0;if(huePrime>=0&&huePrime<1){red=chroma;green=secondComponent;}else if(huePrime>=1&&huePrime<2){red=secondComponent;green=chroma;}else if(huePrime>=2&&huePrime<3){green=chroma;blue=secondComponent;}else if(huePrime>=3&&huePrime<4){green=secondComponent;blue=chroma;}else if(huePrime>=4&&huePrime<5){red=secondComponent;blue=chroma;}else if(huePrime>=5&&huePrime<6){red=chroma;blue=secondComponent;}var lightnessModification=lightness-chroma/2;var finalRed=red+lightnessModification;var finalGreen=green+lightnessModification;var finalBlue=blue+lightnessModification;return convert(finalRed,finalGreen,finalBlue);}var namedColorMap={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'00ffff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000',blanchedalmond:'ffebcd',blue:'0000ff',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'00ffff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkgrey:'a9a9a9',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkslategrey:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dimgrey:'696969',dodgerblue:'1e90ff',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'ff00ff',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',grey:'808080',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgray:'d3d3d3',lightgreen:'90ee90',lightgrey:'d3d3d3',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslategray:'789',lightslategrey:'789',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'0f0',limegreen:'32cd32',linen:'faf0e6',magenta:'f0f',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370db',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'db7093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',rebeccapurple:'639',red:'f00',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',slategrey:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',wheat:'f5deb3',white:'fff',whitesmoke:'f5f5f5',yellow:'ff0',yellowgreen:'9acd32'};/**
 * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
 * @private
 */function nameToHex(color){if(typeof color!=='string')return color;var normalizedColorName=color.toLowerCase();return namedColorMap[normalizedColorName]?"#"+namedColorMap[normalizedColorName]:color;}var hexRegex=/^#[a-fA-F0-9]{6}$/;var hexRgbaRegex=/^#[a-fA-F0-9]{8}$/;var reducedHexRegex=/^#[a-fA-F0-9]{3}$/;var reducedRgbaHexRegex=/^#[a-fA-F0-9]{4}$/;var rgbRegex=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;var rgbaRegex=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;var hslRegex=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;var hslaRegex=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;/**
 * Returns an RgbColor or RgbaColor object. This utility function is only useful
 * if want to extract a color component. With the color util `toColorString` you
 * can convert a RgbColor or RgbaColor object back to a string.
 *
 * @example
 * // Assigns `{ red: 255, green: 0, blue: 0 }` to color1
 * const color1 = parseToRgb('rgb(255, 0, 0)');
 * // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
 * const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
 */function parseToRgb(color){if(typeof color!=='string'){throw new PolishedError(3);}var normalizedColor=nameToHex(color);if(normalizedColor.match(hexRegex)){return{red:parseInt(""+normalizedColor[1]+normalizedColor[2],16),green:parseInt(""+normalizedColor[3]+normalizedColor[4],16),blue:parseInt(""+normalizedColor[5]+normalizedColor[6],16)};}if(normalizedColor.match(hexRgbaRegex)){var alpha=parseFloat((parseInt(""+normalizedColor[7]+normalizedColor[8],16)/255).toFixed(2));return{red:parseInt(""+normalizedColor[1]+normalizedColor[2],16),green:parseInt(""+normalizedColor[3]+normalizedColor[4],16),blue:parseInt(""+normalizedColor[5]+normalizedColor[6],16),alpha:alpha};}if(normalizedColor.match(reducedHexRegex)){return{red:parseInt(""+normalizedColor[1]+normalizedColor[1],16),green:parseInt(""+normalizedColor[2]+normalizedColor[2],16),blue:parseInt(""+normalizedColor[3]+normalizedColor[3],16)};}if(normalizedColor.match(reducedRgbaHexRegex)){var _alpha=parseFloat((parseInt(""+normalizedColor[4]+normalizedColor[4],16)/255).toFixed(2));return{red:parseInt(""+normalizedColor[1]+normalizedColor[1],16),green:parseInt(""+normalizedColor[2]+normalizedColor[2],16),blue:parseInt(""+normalizedColor[3]+normalizedColor[3],16),alpha:_alpha};}var rgbMatched=rgbRegex.exec(normalizedColor);if(rgbMatched){return{red:parseInt(""+rgbMatched[1],10),green:parseInt(""+rgbMatched[2],10),blue:parseInt(""+rgbMatched[3],10)};}var rgbaMatched=rgbaRegex.exec(normalizedColor.substring(0,50));if(rgbaMatched){return{red:parseInt(""+rgbaMatched[1],10),green:parseInt(""+rgbaMatched[2],10),blue:parseInt(""+rgbaMatched[3],10),alpha:parseFloat(""+rgbaMatched[4])>1?parseFloat(""+rgbaMatched[4])/100:parseFloat(""+rgbaMatched[4])};}var hslMatched=hslRegex.exec(normalizedColor);if(hslMatched){var hue=parseInt(""+hslMatched[1],10);var saturation=parseInt(""+hslMatched[2],10)/100;var lightness=parseInt(""+hslMatched[3],10)/100;var rgbColorString="rgb("+hslToRgb(hue,saturation,lightness)+")";var hslRgbMatched=rgbRegex.exec(rgbColorString);if(!hslRgbMatched){throw new PolishedError(4,normalizedColor,rgbColorString);}return{red:parseInt(""+hslRgbMatched[1],10),green:parseInt(""+hslRgbMatched[2],10),blue:parseInt(""+hslRgbMatched[3],10)};}var hslaMatched=hslaRegex.exec(normalizedColor.substring(0,50));if(hslaMatched){var _hue=parseInt(""+hslaMatched[1],10);var _saturation=parseInt(""+hslaMatched[2],10)/100;var _lightness=parseInt(""+hslaMatched[3],10)/100;var _rgbColorString="rgb("+hslToRgb(_hue,_saturation,_lightness)+")";var _hslRgbMatched=rgbRegex.exec(_rgbColorString);if(!_hslRgbMatched){throw new PolishedError(4,normalizedColor,_rgbColorString);}return{red:parseInt(""+_hslRgbMatched[1],10),green:parseInt(""+_hslRgbMatched[2],10),blue:parseInt(""+_hslRgbMatched[3],10),alpha:parseFloat(""+hslaMatched[4])>1?parseFloat(""+hslaMatched[4])/100:parseFloat(""+hslaMatched[4])};}throw new PolishedError(5);}/**
 * Reduces hex values if possible e.g. #ff8866 to #f86
 * @private
 */var reduceHexValue=function reduceHexValue(value){if(value.length===7&&value[1]===value[2]&&value[3]===value[4]&&value[5]===value[6]){return"#"+value[1]+value[3]+value[5];}return value;};var reduceHexValue$1=reduceHexValue;function numberToHex(value){var hex=value.toString(16);return hex.length===1?"0"+hex:hex;}/**
 * Returns a string value for the color. The returned result is the smallest possible hex notation.
 *
 * @example
 * // Styles as object usage
 * const styles = {
 *   background: rgb(255, 205, 100),
 *   background: rgb({ red: 255, green: 205, blue: 100 }),
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   background: ${rgb(255, 205, 100)};
 *   background: ${rgb({ red: 255, green: 205, blue: 100 })};
 * `
 *
 * // CSS in JS Output
 *
 * element {
 *   background: "#ffcd64";
 *   background: "#ffcd64";
 * }
 */function rgb(value,green,blue){if(typeof value==='number'&&typeof green==='number'&&typeof blue==='number'){return reduceHexValue$1("#"+numberToHex(value)+numberToHex(green)+numberToHex(blue));}else if(typeof value==='object'&&green===undefined&&blue===undefined){return reduceHexValue$1("#"+numberToHex(value.red)+numberToHex(value.green)+numberToHex(value.blue));}throw new PolishedError(6);}/**
 * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
 *
 * Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value.
 *
 * @example
 * // Styles as object usage
 * const styles = {
 *   background: rgba(255, 205, 100, 0.7),
 *   background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }),
 *   background: rgba(255, 205, 100, 1),
 *   background: rgba('#ffffff', 0.4),
 *   background: rgba('black', 0.7),
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   background: ${rgba(255, 205, 100, 0.7)};
 *   background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })};
 *   background: ${rgba(255, 205, 100, 1)};
 *   background: ${rgba('#ffffff', 0.4)};
 *   background: ${rgba('black', 0.7)};
 * `
 *
 * // CSS in JS Output
 *
 * element {
 *   background: "rgba(255,205,100,0.7)";
 *   background: "rgba(255,205,100,0.7)";
 *   background: "#ffcd64";
 *   background: "rgba(255,255,255,0.4)";
 *   background: "rgba(0,0,0,0.7)";
 * }
 */function rgba(firstValue,secondValue,thirdValue,fourthValue){if(typeof firstValue==='string'&&typeof secondValue==='number'){var rgbValue=parseToRgb(firstValue);return"rgba("+rgbValue.red+","+rgbValue.green+","+rgbValue.blue+","+secondValue+")";}else if(typeof firstValue==='number'&&typeof secondValue==='number'&&typeof thirdValue==='number'&&typeof fourthValue==='number'){return fourthValue>=1?rgb(firstValue,secondValue,thirdValue):"rgba("+firstValue+","+secondValue+","+thirdValue+","+fourthValue+")";}else if(typeof firstValue==='object'&&secondValue===undefined&&thirdValue===undefined&&fourthValue===undefined){return firstValue.alpha>=1?rgb(firstValue.red,firstValue.green,firstValue.blue):"rgba("+firstValue.red+","+firstValue.green+","+firstValue.blue+","+firstValue.alpha+")";}throw new PolishedError(7);}// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-redeclare
function curried(f,length,acc){return function fn(){// eslint-disable-next-line prefer-rest-params
var combined=acc.concat(Array.prototype.slice.call(arguments));return combined.length>=length?f.apply(this,combined):curried(f,length,combined);};}// eslint-disable-next-line no-redeclare
function curry(f){// eslint-disable-line no-redeclare
return curried(f,f.length,[]);}function guard(lowerBoundary,upperBoundary,value){return Math.max(lowerBoundary,Math.min(upperBoundary,value));}/**
 * Decreases the opacity of a color. Its range for the amount is between 0 to 1.
 *
 *
 * @example
 * // Styles as object usage
 * const styles = {
 *   background: transparentize(0.1, '#fff'),
 *   background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
 *   background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   background: ${transparentize(0.1, '#fff')};
 *   background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')};
 *   background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')};
 * `
 *
 * // CSS in JS Output
 *
 * element {
 *   background: "rgba(255,255,255,0.9)";
 *   background: "rgba(255,255,255,0.8)";
 *   background: "rgba(255,0,0,0.3)";
 * }
 */function transparentize(amount,color){if(color==='transparent')return color;var parsedColor=parseToRgb(color);var alpha=typeof parsedColor.alpha==='number'?parsedColor.alpha:1;var colorWithAlpha=_extends$1({},parsedColor,{alpha:guard(0,1,+(alpha*100-parseFloat(amount)*100).toFixed(2)/100)});return rgba(colorWithAlpha);}// prettier-ignore
var curriedTransparentize=/*#__PURE__*/curry/* ::<number | string, string, string> */(transparentize);var curriedTransparentize$1=curriedTransparentize;const LOADER_SEQUENCE=[0,0,1,1,2,3,3,3,1,1,1,2,2,2,3];const Loadingitem=theming.styled.div({cursor:'progress',fontSize:13,height:'16px',marginTop:4,marginBottom:4,alignItems:'center',overflow:'hidden'},({depth=0})=>({marginLeft:depth*15,maxWidth:85-depth*5}),({theme})=>theme.animation.inlineGlow,({theme})=>({background:theme.appBorderColor}));const Contained=theming.styled.div({display:'flex',flexDirection:'column',paddingLeft:20,paddingRight:20});const Loader=({size})=>{const repeats=Math.ceil(size/LOADER_SEQUENCE.length);// Creates an array that repeats LOADER_SEQUENCE depths in order, until the size is reached.
const sequence=Array.from(Array(repeats)).fill(LOADER_SEQUENCE).flat().slice(0,size);return React__default$1["default"].createElement(React$2.Fragment,null,sequence.map((depth,index)=>// eslint-disable-next-line react/no-array-index-key
React__default$1["default"].createElement(Loadingitem,{depth:depth,key:index})));};const{window:globalWindow$3,document:document$8}=window_1;const TextStyle=theming.styled.div(({theme})=>({fontSize:theme.typography.size.s2-1,lineHeight:'20px',margin:0}));const Text=theming.styled.div(({theme})=>({fontSize:theme.typography.size.s2-1,lineHeight:'20px',margin:0,code:{fontSize:theme.typography.size.s1},ul:{paddingLeft:20,marginTop:8,marginBottom:8}}));const ErrorDisplay=theming.styled.pre({width:420,boxSizing:'border-box',borderRadius:8,overflow:'auto',whiteSpace:'pre'},({theme})=>({color:theme.color.dark}));const ErrorName=theming.styled.strong(({theme})=>({color:theme.color.orange}));const ErrorImportant=theming.styled.strong(({theme})=>({color:theme.color.ancillary,textDecoration:'underline'}));const ErrorDetail=theming.styled.em(({theme})=>({color:theme.color.mediumdark}));const firstLineRegex=/(Error): (.*)\n/;const linesRegex=/at (?:(.*) )?\(?(.+)\)?/;const ErrorFormatter=({error})=>{if(!error){return React__default$1["default"].createElement(React$2.Fragment,null,"This error has no stack or message");}if(!error.stack){return React__default$1["default"].createElement(React$2.Fragment,null,error.message||'This error has no stack or message');}const input=error.stack.toString();const match=input.match(firstLineRegex);if(!match){return React__default$1["default"].createElement(React$2.Fragment,null,input);}const[,type,name]=match;const rawLines=input.split(/\n/).slice(1);const[,...lines]=rawLines.map(line=>{const r=line.match(linesRegex);return r?{name:r[1],location:r[2].replace(document$8.location.origin,'')}:null;}).filter(Boolean);return React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement("span",null,type),": ",React__default$1["default"].createElement(ErrorName,null,name),React__default$1["default"].createElement("br",null),lines.map((l,i)=>l.name?// eslint-disable-next-line react/no-array-index-key
React__default$1["default"].createElement(React$2.Fragment,{key:i},'  ',"at ",React__default$1["default"].createElement(ErrorImportant,null,l.name)," (",React__default$1["default"].createElement(ErrorDetail,null,l.location),")",React__default$1["default"].createElement("br",null)):// eslint-disable-next-line react/no-array-index-key
React__default$1["default"].createElement(React$2.Fragment,{key:i},'  ',"at ",React__default$1["default"].createElement(ErrorDetail,null,l.location),React__default$1["default"].createElement("br",null))));};const AuthBlock=({loginUrl,id})=>{const[isAuthAttempted,setAuthAttempted]=React$2.useState(false);const refresh=React$2.useCallback(()=>{globalWindow$3.document.location.reload();},[]);const open=React$2.useCallback(e=>{e.preventDefault();const childWindow=globalWindow$3.open(loginUrl,`storybook_auth_${id}`,'resizable,scrollbars');// poll for window to close
const timer=setInterval(()=>{if(!childWindow){clientLogger.logger.error('unable to access loginUrl window');clearInterval(timer);}else if(childWindow.closed){clearInterval(timer);setAuthAttempted(true);}},1000);},[]);return React__default$1["default"].createElement(Contained,null,React__default$1["default"].createElement(components.Spaced,null,isAuthAttempted?React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(Text,null,"Authentication on ",React__default$1["default"].createElement("strong",null,loginUrl)," concluded. Refresh the page to fetch this Storybook."),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(components.Button,{small:true,gray:true,onClick:refresh},React__default$1["default"].createElement(components.Icons,{icon:"sync"}),"Refresh now"))):React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(Text,null,"Sign in to browse this Storybook."),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(components.Button,{small:true,gray:true,onClick:open},React__default$1["default"].createElement(components.Icons,{icon:"lock"}),"Sign in")))));};const ErrorBlock=({error})=>React__default$1["default"].createElement(Contained,null,React__default$1["default"].createElement(components.Spaced,null,React__default$1["default"].createElement(TextStyle,null,"Oh no! Something went wrong loading this Storybook.",React__default$1["default"].createElement("br",null),React__default$1["default"].createElement(components.WithTooltip,{trigger:"click",closeOnClick:false,tooltip:React__default$1["default"].createElement(ErrorDisplay,null,React__default$1["default"].createElement(ErrorFormatter,{error:error}))},React__default$1["default"].createElement(components.Link,{isButton:true},"View error ",React__default$1["default"].createElement(components.Icons,{icon:"arrowdown"}))),' ',React__default$1["default"].createElement(components.Link,{withArrow:true,href:"https://storybook.js.org/docs",cancel:false,target:"_blank"},"View docs"))));const FlexSpaced=theming.styled(components.Spaced)({display:'flex'});const WideSpaced=theming.styled(components.Spaced)({flex:1});const EmptyBlock=({isMain})=>React__default$1["default"].createElement(Contained,null,React__default$1["default"].createElement(FlexSpaced,{col:1},React__default$1["default"].createElement(WideSpaced,null,React__default$1["default"].createElement(Text,null,isMain?React__default$1["default"].createElement(React__default$1["default"].Fragment,null,"Oh no! Your Storybook is empty. Possible reasons why:",React__default$1["default"].createElement("ul",null,React__default$1["default"].createElement("li",null,"The glob specified in ",React__default$1["default"].createElement("code",null,"main.js")," isn't correct."),React__default$1["default"].createElement("li",null,"No stories are defined in your story files.")),' '):React__default$1["default"].createElement(React__default$1["default"].Fragment,null,"Yikes! Something went wrong loading these stories.")))));const LoaderBlock=({isMain})=>React__default$1["default"].createElement(Contained,null,React__default$1["default"].createElement(Loader,{size:isMain?17:5}));const{document:document$7,window:globalWindow$2}=window_1;const IndicatorPlacement=theming.styled.aside(({theme})=>({height:16,display:'flex',alignItems:'center','& > * + *':{marginLeft:theme.layoutMargin}}));const IndicatorClickTarget=theming.styled.button(({theme})=>({height:20,width:20,padding:0,margin:0,display:'flex',alignItems:'center',justifyContent:'center',background:'transparent',outline:'none',border:'1px solid transparent',borderRadius:'100%',cursor:'pointer',color:theme.base==='light'?curriedTransparentize$1(0.3,theme.color.defaultText):curriedTransparentize$1(0.6,theme.color.defaultText),'&:hover':{color:theme.barSelectedColor},'&:focus':{color:theme.barSelectedColor,borderColor:theme.color.secondary},svg:{height:10,width:10,transition:'all 150ms ease-out',color:'inherit'}}));const MessageTitle=theming.styled.span(({theme})=>({fontWeight:theme.typography.weight.bold}));const Message$1=theming.styled.a(({theme})=>({textDecoration:'none',lineHeight:'16px',padding:15,display:'flex',flexDirection:'row',alignItems:'flex-start',color:theme.color.defaultText,'&:not(:last-child)':{borderBottom:`1px solid ${theme.appBorderColor}`},'&:hover':{background:theme.background.hoverable,color:theme.color.darker},'&:link':{color:theme.color.darker},'&:active':{color:theme.color.darker},'&:focus':{color:theme.color.darker},'& > *':{flex:1},'& > svg':{marginTop:3,width:16,height:16,marginRight:10,flex:'unset'}}));const MessageWrapper=theming.styled.div({width:280,boxSizing:'border-box',borderRadius:8,overflow:'hidden'});const BlueIcon=theming.styled(components.Icons)(({theme})=>({color:theme.color.secondary}));const YellowIcon=theming.styled(components.Icons)(({theme})=>({color:theme.color.gold}));const RedIcon=theming.styled(components.Icons)(({theme})=>({color:theme.color.negative}));const GreenIcon=theming.styled(components.Icons)(({theme})=>({color:theme.color.green}));const Version=theming.styled.div(({theme})=>({display:'flex',alignItems:'center',fontSize:theme.typography.size.s1,fontWeight:theme.typography.weight.regular,color:theme.base==='light'?curriedTransparentize$1(0.3,theme.color.defaultText):curriedTransparentize$1(0.6,theme.color.defaultText),'& > * + *':{marginLeft:4},svg:{height:10,width:10}}));const CurrentVersion=({url,versions})=>{const currentVersionId=React$2.useMemo(()=>{const c=Object.entries(versions).find(([k,v])=>v===url);return c&&c[0]?c[0]:'current';},[url,versions]);return React__default$1["default"].createElement(Version,null,React__default$1["default"].createElement("span",null,currentVersionId),React__default$1["default"].createElement(components.Icons,{icon:"chevrondown"}));};const RefIndicator=React__default$1["default"].memo(React$2.forwardRef((_a,forwardedRef)=>{var{state}=_a,ref=__rest(_a,["state"]);const api$1=api.useStorybookApi();const list=React$2.useMemo(()=>Object.values(ref.stories||{}),[ref.stories]);const componentCount=React$2.useMemo(()=>list.filter(v=>v.isComponent).length,[list]);const leafCount=React$2.useMemo(()=>list.filter(v=>v.isLeaf).length,[list]);const changeVersion=React$2.useCallback((event,item)=>{event.preventDefault();api$1.changeRefVersion(ref.id,item.href);},[]);return React__default$1["default"].createElement(IndicatorPlacement,{ref:forwardedRef},React__default$1["default"].createElement(components.WithTooltip,{placement:"bottom-start",trigger:"click",tooltip:React__default$1["default"].createElement(MessageWrapper,null,React__default$1["default"].createElement(components.Spaced,{row:0},state==='loading'&&React__default$1["default"].createElement(LoadingMessage,{url:ref.url}),(state==='error'||state==='empty')&&React__default$1["default"].createElement(ErrorOccurredMessage,{url:ref.url}),state==='ready'&&React__default$1["default"].createElement(ReadyMessage,Object.assign({},{url:ref.url,componentCount,leafCount})),state==='auth'&&React__default$1["default"].createElement(LoginRequiredMessage,Object.assign({},ref)),ref.type==='auto-inject'&&state!=='error'&&React__default$1["default"].createElement(PerformanceDegradedMessage,null),state!=='loading'&&React__default$1["default"].createElement(ReadDocsMessage,null)))},React__default$1["default"].createElement(IndicatorClickTarget,{"data-action":"toggle-indicator","aria-label":"toggle indicator"},React__default$1["default"].createElement(components.Icons,{icon:"globe"}))),ref.versions&&Object.keys(ref.versions).length?React__default$1["default"].createElement(components.WithTooltip,{placement:"bottom-start",trigger:"click",tooltip:React__default$1["default"].createElement(components.TooltipLinkList,{links:Object.entries(ref.versions).map(([id,href])=>({left:href===ref.url?React__default$1["default"].createElement(MenuItemIcon,{icon:"check"}):React__default$1["default"].createElement("span",null),id,title:id,href,onClick:changeVersion}))})},React__default$1["default"].createElement(CurrentVersion,{url:ref.url,versions:ref.versions})):null);}));const ReadyMessage=({url,componentCount,leafCount})=>React__default$1["default"].createElement(Message$1,{href:url.replace(/\/?$/,'/index.html'),target:"_blank"},React__default$1["default"].createElement(BlueIcon,{icon:"globe"}),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(MessageTitle,null,"View external Storybook"),React__default$1["default"].createElement("div",null,"Explore ",componentCount," components and ",leafCount," stories in a new browser tab.")));const LoginRequiredMessage=({loginUrl,id})=>{const open=React$2.useCallback(e=>{e.preventDefault();const childWindow=globalWindow$2.open(loginUrl,`storybook_auth_${id}`,'resizable,scrollbars');// poll for window to close
const timer=setInterval(()=>{if(!childWindow){clearInterval(timer);}else if(childWindow.closed){clearInterval(timer);document$7.location.reload();}},1000);},[]);return React__default$1["default"].createElement(Message$1,{onClick:open},React__default$1["default"].createElement(YellowIcon,{icon:"lock"}),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(MessageTitle,null,"Log in required"),React__default$1["default"].createElement("div",null,"You need to authenticate to view this Storybook's components.")));};const ReadDocsMessage=()=>React__default$1["default"].createElement(Message$1,{href:"https://storybook.js.org",target:"_blank"},React__default$1["default"].createElement(GreenIcon,{icon:"document"}),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(MessageTitle,null,"Read Composition docs"),React__default$1["default"].createElement("div",null,"Learn how to combine multiple Storybooks into one.")));const ErrorOccurredMessage=({url})=>React__default$1["default"].createElement(Message$1,{href:url.replace(/\/?$/,'/index.html'),target:"_blank"},React__default$1["default"].createElement(RedIcon,{icon:"alert"}),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(MessageTitle,null,"Something went wrong"),React__default$1["default"].createElement("div",null,"This external Storybook didn't load. Debug it in a new tab now.")));const LoadingMessage=({url})=>React__default$1["default"].createElement(Message$1,{href:url.replace(/\/?$/,'/index.html'),target:"_blank"},React__default$1["default"].createElement(BlueIcon,{icon:"time"}),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(MessageTitle,null,"Please wait"),React__default$1["default"].createElement("div",null,"This Storybook is loading.")));const PerformanceDegradedMessage=()=>React__default$1["default"].createElement(Message$1,{href:"https://storybook.js.org/docs",target:"_blank"},React__default$1["default"].createElement(YellowIcon,{icon:"lightning"}),React__default$1["default"].createElement("div",null,React__default$1["default"].createElement(MessageTitle,null,"Reduce lag"),React__default$1["default"].createElement("div",null,"Learn how to speed up Composition performance.")));const{DOCS_MODE:DOCS_MODE$4}=window_1;const CollapseIcon=theming.styled.span(({theme,isExpanded})=>({display:'inline-block',width:0,height:0,marginTop:6,marginLeft:8,marginRight:5,color:curriedTransparentize$1(0.4,theme.color.mediumdark),borderTop:'3px solid transparent',borderBottom:'3px solid transparent',borderLeft:`3px solid`,transform:isExpanded?'rotateZ(90deg)':'none',transition:'transform .1s ease-out'}));const iconColors={light:{document:DOCS_MODE$4?'secondary':'#ff8300',bookmarkhollow:'seafoam',component:'secondary',folder:'ultraviolet'},dark:{document:DOCS_MODE$4?'secondary':'gold',bookmarkhollow:'seafoam',component:'secondary',folder:'primary'}};const isColor=(theme,color)=>color in theme.color;const TypeIcon=theming.styled(components.Icons)({width:12,height:12,padding:1,marginTop:3,marginRight:5,flex:'0 0 auto'},({theme,icon,symbol=icon})=>{const colors=theme.base==='dark'?iconColors.dark:iconColors.light;const color=colors[symbol];return{color:isColor(theme,color)?theme.color[color]:color};});const BranchNode=theming.styled.button(({theme,depth=0,isExpandable=false})=>({width:'100%',border:'none',cursor:'pointer',display:'flex',alignItems:'start',textAlign:'left',padding:3,paddingLeft:`${(isExpandable?2:18)+depth*16}px`,color:'inherit',fontSize:`${theme.typography.size.s2-1}px`,background:'transparent','&:hover, &:focus':{background:theme.background.hoverable,outline:'none'}}));const LeafNode=theming.styled.a(({theme,depth=0})=>({cursor:'pointer',display:'flex',alignItems:'start',padding:3,paddingLeft:`${18+depth*16}px`,fontSize:`${theme.typography.size.s2-1}px`,textDecoration:'none',color:theme.color.defaultText,background:'transparent','&:hover, &:focus':{outline:'none',background:theme.background.hoverable},'&[data-selected="true"]':{color:theme.color.lightest,background:theme.color.secondary,fontWeight:theme.typography.weight.bold,'&:hover, &:focus':{background:theme.color.secondary},svg:{color:theme.color.lightest}}}));const Path=theming.styled.span(({theme})=>({display:'grid',justifyContent:'start',gridAutoColumns:'auto',gridAutoFlow:'column',color:theme.textMutedColor,fontSize:`${theme.typography.size.s1-1}px`,'& > span':{whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis'},'& > span + span':{position:'relative',marginLeft:4,paddingLeft:7,'&:before':{content:"'/'",position:'absolute',left:0}}}));const RootNode=theming.styled.div(({theme})=>({display:'flex',alignItems:'center',justifyContent:'space-between',padding:'0 20px',marginTop:16,marginBottom:4,fontSize:`${theme.typography.size.s1-1}px`,fontWeight:theme.typography.weight.black,lineHeight:'16px',minHeight:20,letterSpacing:'0.35em',textTransform:'uppercase',color:theme.color.mediumdark}));const GroupNode=React__default$1["default"].memo(_a=>{var{children,isExpanded=false,isExpandable=false}=_a,props=__rest(_a,["children","isExpanded","isExpandable"]);return React__default$1["default"].createElement(BranchNode,Object.assign({isExpandable:isExpandable,tabIndex:-1},props),isExpandable?React__default$1["default"].createElement(CollapseIcon,{isExpanded:isExpanded}):null,React__default$1["default"].createElement(TypeIcon,{symbol:"folder",color:"primary"}),children);});const ComponentNode=React__default$1["default"].memo(_a=>{var{theme,children,isExpanded,isExpandable,isSelected}=_a,props=__rest(_a,["theme","children","isExpanded","isExpandable","isSelected"]);return React__default$1["default"].createElement(BranchNode,Object.assign({isExpandable:isExpandable,tabIndex:-1},props),isExpandable&&React__default$1["default"].createElement(CollapseIcon,{isExpanded:isExpanded}),React__default$1["default"].createElement(TypeIcon,{symbol:"component",color:"secondary"}),children);});const DocumentNode=React__default$1["default"].memo(_a=>{var{theme,children}=_a,props=__rest(_a,["theme","children"]);return React__default$1["default"].createElement(LeafNode,Object.assign({tabIndex:-1},props),React__default$1["default"].createElement(TypeIcon,{symbol:"document"}),children);});const StoryNode=React__default$1["default"].memo(_a=>{var{theme,children}=_a,props=__rest(_a,["theme","children"]);return React__default$1["default"].createElement(LeafNode,Object.assign({tabIndex:-1},props),React__default$1["default"].createElement(TypeIcon,{symbol:"bookmarkhollow"}),children);});var debounce$1=debounce_1,isObject=isObject_1;/** Error message constants. */var FUNC_ERROR_TEXT='Expected a function';/**
 * Creates a throttled function that only invokes `func` at most once per
 * every `wait` milliseconds. The throttled function comes with a `cancel`
 * method to cancel delayed `func` invocations and a `flush` method to
 * immediately invoke them. Provide `options` to indicate whether `func`
 * should be invoked on the leading and/or trailing edge of the `wait`
 * timeout. The `func` is invoked with the last arguments provided to the
 * throttled function. Subsequent calls to the throttled function return the
 * result of the last `func` invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the throttled function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.throttle` and `_.debounce`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to throttle.
 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=true]
 *  Specify invoking on the leading edge of the timeout.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new throttled function.
 * @example
 *
 * // Avoid excessively updating the position while scrolling.
 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
 *
 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
 * jQuery(element).on('click', throttled);
 *
 * // Cancel the trailing throttled invocation.
 * jQuery(window).on('popstate', throttled.cancel);
 */function throttle(func,wait,options){var leading=true,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(isObject(options)){leading='leading'in options?!!options.leading:leading;trailing='trailing'in options?!!options.trailing:trailing;}return debounce$1(func,wait,{'leading':leading,'maxWait':wait,'trailing':trailing});}var throttle_1=throttle;const codeToKeyMap={// event.code => event.key
Space:' ',Slash:'/',ArrowLeft:'ArrowLeft',ArrowUp:'ArrowUp',ArrowRight:'ArrowRight',ArrowDown:'ArrowDown',Escape:'Escape',Enter:'Enter'};const allFalse={alt:false,ctrl:false,meta:false,shift:false};const matchesModifiers=(modifiers,event)=>{const{alt,ctrl,meta,shift}=modifiers===false?allFalse:modifiers;if(typeof alt==='boolean'&&alt!==event.altKey)return false;if(typeof ctrl==='boolean'&&ctrl!==event.ctrlKey)return false;if(typeof meta==='boolean'&&meta!==event.metaKey)return false;if(typeof shift==='boolean'&&shift!==event.shiftKey)return false;return true;};const matchesKeyCode=(code,event)=>{// event.code is preferable but not supported in IE
return event.code?event.code===code:event.key===codeToKeyMap[code];};const{document:document$6,window:globalWindow$1,DOCS_MODE:DOCS_MODE$3}=window_1;const createId=(itemId,refId)=>!refId||refId===DEFAULT_REF_ID?itemId:`${refId}_${itemId}`;const getLink=(itemId,refId)=>{const type=DOCS_MODE$3?'docs':'story';return`${document$6.location.pathname}?path=/${type}/${createId(itemId,refId)}`;};const get=memoize__default["default"](1000)((id,dataset)=>dataset[id]);const getParent=memoize__default["default"](1000)((id,dataset)=>{const item=get(id,dataset);return item&&!api.isRoot(item)?get(item.parent,dataset):undefined;});const getParents=memoize__default["default"](1000)((id,dataset)=>{const parent=getParent(id,dataset);return parent?[parent,...getParents(parent.id,dataset)]:[];});const getAncestorIds=memoize__default["default"](1000)((data,id)=>getParents(id,data).map(item=>item.id));const getDescendantIds=memoize__default["default"](1000)((data,id,skipLeafs)=>{const{children=[]}=data[id]||{};return children.reduce((acc,childId)=>{if(!data[childId]||skipLeafs&&data[childId].isLeaf)return acc;acc.push(childId,...getDescendantIds(data,childId,skipLeafs));return acc;},[]);});function getPath(item,ref){const parent=!api.isRoot(item)&&item.parent?ref.stories[item.parent]:null;if(parent)return[...getPath(parent,ref),parent.name];return ref.id===DEFAULT_REF_ID?[]:[ref.title||ref.id];}const searchItem=(item,ref)=>{return Object.assign(Object.assign({},item),{refId:ref.id,path:getPath(item,ref)});};function cycle(array,index,delta){let next=index+delta%array.length;if(next<0)next=array.length+next;if(next>=array.length)next-=array.length;return next;}const scrollIntoView$1=(element,center=false)=>{if(!element)return;const{top,bottom}=element.getBoundingClientRect();const isInView=top>=0&&bottom<=(globalWindow$1.innerHeight||document$6.documentElement.clientHeight);if(!isInView)element.scrollIntoView({block:center?'center':'nearest'});};const getStateType=(isLoading,isAuthRequired,isError,isEmpty)=>{switch(true){case isAuthRequired:return'auth';case isError:return'error';case isLoading:return'loading';case isEmpty:return'empty';default:return'ready';}};const isAncestor=(element,maybeAncestor)=>{if(!element||!maybeAncestor)return false;if(element===maybeAncestor)return true;return isAncestor(element.parentElement,maybeAncestor);};const removeNoiseFromName=storyName=>storyName.replaceAll(/(\s|-|_)/gi,'');const isStoryHoistable=(storyName,componentName)=>removeNoiseFromName(storyName)===removeNoiseFromName(componentName);const{document:document$5}=window_1;const initializeExpanded=({refId,data,initialExpanded,highlightedRef,rootIds})=>{var _a,_b;const highlightedAncestors=((_a=highlightedRef.current)===null||_a===void 0?void 0:_a.refId)===refId?getAncestorIds(data,(_b=highlightedRef.current)===null||_b===void 0?void 0:_b.itemId):[];return[...rootIds,...highlightedAncestors].reduce((acc,id)=>Object.assign(acc,{[id]:id in initialExpanded?initialExpanded[id]:true}),{});};const noop$1=()=>{};const useExpanded=({containerRef,isBrowsing,refId,data,initialExpanded,rootIds,highlightedRef,setHighlightedItemId,selectedStoryId,onSelectStoryId})=>{const api$1=api.useStorybookApi();// Track the set of currently expanded nodes within this tree.
// Root nodes are expanded by default.
const[expanded,setExpanded]=React$2.useReducer((state,{ids,value})=>ids.reduce((acc,id)=>Object.assign(acc,{[id]:value}),Object.assign({},state)),{refId,data,highlightedRef,rootIds,initialExpanded},initializeExpanded);const getElementByDataItemId=React$2.useCallback(id=>{var _a;return(_a=containerRef.current)===null||_a===void 0?void 0:_a.querySelector(`[data-item-id="${id}"]`);},[containerRef]);const highlightElement=React$2.useCallback(element=>{setHighlightedItemId(element.getAttribute('data-item-id'));scrollIntoView$1(element);},[setHighlightedItemId]);const updateExpanded=React$2.useCallback(({ids,value})=>{var _a;setExpanded({ids,value});if(ids.length===1){const element=(_a=containerRef.current)===null||_a===void 0?void 0:_a.querySelector(`[data-item-id="${ids[0]}"][data-ref-id="${refId}"]`);if(element)highlightElement(element);}},[containerRef,highlightElement,refId]);// Expand the whole ancestry of the currently selected story whenever it changes.
React$2.useEffect(()=>{setExpanded({ids:getAncestorIds(data,selectedStoryId),value:true});},[data,selectedStoryId]);const collapseAll=React$2.useCallback(()=>{const ids=Object.keys(data).filter(id=>!rootIds.includes(id));setExpanded({ids,value:false});},[data,rootIds]);const expandAll=React$2.useCallback(()=>{setExpanded({ids:Object.keys(data),value:true});},[data]);React$2.useEffect(()=>{if(!api$1)return noop$1;api$1.on(coreEvents.STORIES_COLLAPSE_ALL,collapseAll);api$1.on(coreEvents.STORIES_EXPAND_ALL,expandAll);return()=>{api$1.off(coreEvents.STORIES_COLLAPSE_ALL,collapseAll);api$1.off(coreEvents.STORIES_EXPAND_ALL,expandAll);};},[api$1,collapseAll,expandAll]);// Expand, collapse or select nodes in the tree using keyboard shortcuts.
React$2.useEffect(()=>{const menuElement=document$5.getElementById('storybook-explorer-menu');// Even though we ignore repeated events, use throttle because IE doesn't support event.repeat.
const navigateTree=throttle_1(event=>{var _a,_b;const highlightedItemId=((_a=highlightedRef.current)===null||_a===void 0?void 0:_a.refId)===refId&&((_b=highlightedRef.current)===null||_b===void 0?void 0:_b.itemId);if(!isBrowsing||!containerRef.current||!highlightedItemId||event.repeat)return;if(!matchesModifiers(false,event))return;const isEnter=matchesKeyCode('Enter',event);const isSpace=matchesKeyCode('Space',event);const isArrowLeft=matchesKeyCode('ArrowLeft',event);const isArrowRight=matchesKeyCode('ArrowRight',event);if(!(isEnter||isSpace||isArrowLeft||isArrowRight))return;const highlightedElement=getElementByDataItemId(highlightedItemId);if(!highlightedElement||highlightedElement.getAttribute('data-ref-id')!==refId)return;const target=event.target;if(!isAncestor(menuElement,target)&&!isAncestor(target,menuElement))return;if(target.hasAttribute('data-action')){if(isEnter||isSpace)return;target.blur();}const type=highlightedElement.getAttribute('data-nodetype');if((isEnter||isSpace)&&['component','story','document'].includes(type)){onSelectStoryId(highlightedItemId);}const isExpanded=highlightedElement.getAttribute('aria-expanded');if(isArrowLeft){if(isExpanded==='true'){// The highlighted node is expanded, so we collapse it.
setExpanded({ids:[highlightedItemId],value:false});return;}const parentId=highlightedElement.getAttribute('data-parent-id');const parentElement=parentId&&getElementByDataItemId(parentId);if(parentElement&&parentElement.getAttribute('data-highlightable')==='true'){// The highlighted node isn't expanded, so we move the highlight to its parent instead.
highlightElement(parentElement);return;}// The parent can't be highlighted, which means it must be a root.
// The highlighted node is already collapsed, so we collapse its descendants.
setExpanded({ids:getDescendantIds(data,highlightedItemId,true),value:false});return;}if(isArrowRight){if(isExpanded==='false'){updateExpanded({ids:[highlightedItemId],value:true});}else if(isExpanded==='true'){updateExpanded({ids:getDescendantIds(data,highlightedItemId,true),value:true});}}},60);document$5.addEventListener('keydown',navigateTree);return()=>document$5.removeEventListener('keydown',navigateTree);},[containerRef,isBrowsing,refId,data,highlightedRef,setHighlightedItemId,onSelectStoryId]);return[expanded,updateExpanded];};const Action=theming.styled.button(({theme})=>({display:'inline-flex',alignItems:'center',justifyContent:'center',width:20,height:20,margin:0,marginLeft:'auto',padding:0,outline:0,lineHeight:'normal',background:'none',border:`1px solid transparent`,borderRadius:'100%',cursor:'pointer',transition:'all 150ms ease-out',color:theme.base==='light'?curriedTransparentize$1(0.3,theme.color.defaultText):curriedTransparentize$1(0.6,theme.color.defaultText),'&:hover':{color:theme.color.secondary},'&:focus':{color:theme.color.secondary,borderColor:theme.color.secondary,'&:not(:focus-visible)':{borderColor:'transparent'}},svg:{width:10,height:10}}));const CollapseButton$1=theming.styled.button(({theme})=>({// Reset button
background:'transparent',border:'none',outline:'none',boxSizing:'content-box',cursor:'pointer',position:'relative',textAlign:'left',lineHeight:'normal',font:'inherit',color:'inherit',letterSpacing:'inherit',textTransform:'inherit',display:'flex',flex:'0 1 auto',padding:'3px 10px 1px 1px',margin:0,marginLeft:-19,overflow:'hidden',borderRadius:26,transition:'color 150ms, box-shadow 150ms','span:first-of-type':{marginTop:4,marginRight:7},'&:focus':{boxShadow:`0 0 0 1px ${theme.color.secondary}`,color:theme.color.secondary,'span:first-of-type':{color:theme.color.secondary},'&:not(:focus-visible)':{boxShadow:'none'}}}));const LeafNodeStyleWrapper=theming.styled.div(({theme})=>({position:'relative'}));const SkipToContentLink=theming.styled(components.Button)(({theme})=>({display:'none','@media (min-width: 600px)':{display:'block',zIndex:-1,position:'absolute',top:1,right:20,height:'20px',fontSize:'10px',padding:'5px 10px','&:focus':{background:'white',zIndex:1}}}));const Node=React__default$1["default"].memo(({item,refId,isOrphan,isDisplayed,isSelected,isFullyExpanded,setFullyExpanded,isExpanded,setExpanded,onSelectStoryId})=>{var _a,_b,_c;if(!isDisplayed)return null;const id=createId(item.id,refId);if(api.isStory(item)){const LeafNode=item.isComponent?DocumentNode:StoryNode;return React__default$1["default"].createElement(LeafNodeStyleWrapper,null,React__default$1["default"].createElement(LeafNode,{key:id,id:id,className:"sidebar-item","data-ref-id":refId,"data-item-id":item.id,"data-parent-id":item.parent,"data-nodetype":item.isComponent?'document':'story',"data-selected":isSelected,"data-highlightable":isDisplayed,depth:isOrphan?item.depth:item.depth-1,href:getLink(item.id,refId),onClick:event=>{event.preventDefault();onSelectStoryId(item.id);}},((_a=item.renderLabel)===null||_a===void 0?void 0:_a.call(item,item))||item.name),isSelected&&React__default$1["default"].createElement(SkipToContentLink,{secondary:true,outline:true,isLink:true,href:"#storybook-preview-wrapper"},"Skip to canvas"));}if(api.isRoot(item)){return React__default$1["default"].createElement(RootNode,{key:id,id:id,className:"sidebar-subheading","data-ref-id":refId,"data-item-id":item.id,"data-nodetype":"root"},React__default$1["default"].createElement(CollapseButton$1,{type:"button","data-action":"collapse-root",onClick:event=>{event.preventDefault();setExpanded({ids:[item.id],value:!isExpanded});},"aria-expanded":isExpanded},React__default$1["default"].createElement(CollapseIcon,{isExpanded:isExpanded}),((_b=item.renderLabel)===null||_b===void 0?void 0:_b.call(item,item))||item.name),isExpanded&&React__default$1["default"].createElement(Action,{type:"button",className:"sidebar-subheading-action","aria-label":"expand","data-action":"expand-all","data-expanded":isFullyExpanded,onClick:event=>{event.preventDefault();setFullyExpanded();}},React__default$1["default"].createElement(components.Icons,{icon:isFullyExpanded?'collapse':'expandalt'})));}const BranchNode=item.isComponent?ComponentNode:GroupNode;return React__default$1["default"].createElement(BranchNode,{key:id,id:id,className:"sidebar-item","data-ref-id":refId,"data-item-id":item.id,"data-parent-id":item.parent,"data-nodetype":item.isComponent?'component':'group',"data-highlightable":isDisplayed,"aria-controls":item.children&&item.children[0],"aria-expanded":isExpanded,depth:isOrphan?item.depth:item.depth-1,isComponent:item.isComponent,isExpandable:item.children&&item.children.length>0,isExpanded:isExpanded,onClick:event=>{event.preventDefault();setExpanded({ids:[item.id],value:!isExpanded});if(item.isComponent&&!isExpanded)onSelectStoryId(item.id);}},((_c=item.renderLabel)===null||_c===void 0?void 0:_c.call(item,item))||item.name);});const Root$1=React__default$1["default"].memo(_a=>{var{setExpanded,isFullyExpanded,expandableDescendants}=_a,props=__rest(_a,["setExpanded","isFullyExpanded","expandableDescendants"]);const setFullyExpanded=React$2.useCallback(()=>setExpanded({ids:expandableDescendants,value:!isFullyExpanded}),[setExpanded,isFullyExpanded,expandableDescendants]);return React__default$1["default"].createElement(Node,Object.assign({},props,{setExpanded:setExpanded,isFullyExpanded:isFullyExpanded,setFullyExpanded:setFullyExpanded}));});const Container$4=theming.styled.div(props=>({marginTop:props.hasOrphans?20:0,marginBottom:20}));const Tree=React__default$1["default"].memo(({isBrowsing,isMain,refId,data,highlightedRef,setHighlightedItemId,selectedStoryId,onSelectStoryId})=>{const containerRef=React$2.useRef(null);// Find top-level nodes and group them so we can hoist any orphans and expand any roots.
const[rootIds,orphanIds,initialExpanded]=React$2.useMemo(()=>Object.keys(data).reduce((acc,id)=>{const item=data[id];if(api.isRoot(item))acc[0].push(id);else if(!item.parent)acc[1].push(id);if(api.isRoot(item)&&item.startCollapsed)acc[2][id]=false;return acc;},[[],[],{}]),[data]);// Pull up (hoist) any "orphan" items that don't have a root item as ancestor so they get
// displayed at the top of the tree, before any root items.
// Also create a map of expandable descendants for each root/orphan item, which is needed later.
// Doing that here is a performance enhancement, as it avoids traversing the tree again later.
const{orphansFirst,expandableDescendants}=React$2.useMemo(()=>{return orphanIds.concat(rootIds).reduce((acc,nodeId)=>{const descendantIds=getDescendantIds(data,nodeId,false);acc.orphansFirst.push(nodeId,...descendantIds);acc.expandableDescendants[nodeId]=descendantIds.filter(d=>!data[d].isLeaf);return acc;},{orphansFirst:[],expandableDescendants:{}});},[data,rootIds,orphanIds]);// Create a list of component IDs which have exactly one story, which name exactly matches the component name.
const singleStoryComponentIds=React$2.useMemo(()=>{return orphansFirst.filter(nodeId=>{const{children=[],isComponent,isLeaf,name}=data[nodeId];return!isLeaf&&isComponent&&children.length===1&&api.isStory(data[children[0]])&&isStoryHoistable(data[children[0]].name,name);});},[data,orphansFirst]);// Omit single-story components from the list of nodes.
const collapsedItems=React$2.useMemo(()=>{return orphansFirst.filter(id=>!singleStoryComponentIds.includes(id));},[orphanIds,orphansFirst,singleStoryComponentIds]);// Rewrite the dataset to place the child story in place of the component.
const collapsedData=React$2.useMemo(()=>{return singleStoryComponentIds.reduce((acc,id)=>{const{children,parent}=data[id];const[childId]=children;if(parent){const siblings=[...data[parent].children];siblings[siblings.indexOf(id)]=childId;acc[parent]=Object.assign(Object.assign({},data[parent]),{children:siblings});}acc[childId]=Object.assign(Object.assign({},data[childId]),{parent,depth:data[childId].depth-1});return acc;},Object.assign({},data));},[data]);const ancestry=React$2.useMemo(()=>{return collapsedItems.reduce((acc,id)=>Object.assign(acc,{[id]:getAncestorIds(collapsedData,id)}),{});},[collapsedItems,collapsedData]);// Track expanded nodes, keep it in sync with props and enable keyboard shortcuts.
const[expanded,setExpanded]=useExpanded({containerRef,isBrowsing,refId,data:collapsedData,initialExpanded,rootIds,highlightedRef,setHighlightedItemId,selectedStoryId,onSelectStoryId});return React__default$1["default"].createElement(Container$4,{ref:containerRef,hasOrphans:isMain&&orphanIds.length>0},collapsedItems.map(itemId=>{const item=collapsedData[itemId];const id=createId(itemId,refId);if(api.isRoot(item)){const descendants=expandableDescendants[item.id];const isFullyExpanded=descendants.every(d=>expanded[d]);return React__default$1["default"].createElement(Root$1,{key:id,item:item,refId:refId,isOrphan:false,isDisplayed:true,isSelected:selectedStoryId===itemId,isExpanded:!!expanded[itemId],setExpanded:setExpanded,isFullyExpanded:isFullyExpanded,expandableDescendants:descendants,onSelectStoryId:onSelectStoryId});}const isDisplayed=!item.parent||ancestry[itemId].every(a=>expanded[a]);return React__default$1["default"].createElement(Node,{key:id,item:item,refId:refId,isOrphan:orphanIds.some(oid=>itemId===oid||itemId.startsWith(`${oid}-`)),isDisplayed:isDisplayed,isSelected:selectedStoryId===itemId,isExpanded:!!expanded[itemId],setExpanded:setExpanded,onSelectStoryId:onSelectStoryId});}));});const Wrapper=theming.styled.div(({isMain})=>({position:'relative',marginLeft:-20,marginRight:-20,marginTop:isMain?undefined:0}));const RefHead=theming.styled.div(({theme})=>({fontWeight:theme.typography.weight.black,fontSize:theme.typography.size.s2-1,// Similar to ListItem.tsx
textDecoration:'none',lineHeight:'16px',display:'flex',alignItems:'center',justifyContent:'space-between',background:'transparent',width:'100%',marginTop:20,paddingTop:16,borderTop:`1px solid ${theme.appBorderColor}`,color:theme.base==='light'?theme.color.defaultText:curriedTransparentize$1(0.2,theme.color.defaultText)}));const RefTitle=theming.styled.span(({theme})=>({display:'block',textOverflow:'ellipsis',whiteSpace:'nowrap',flex:1,overflow:'hidden',marginLeft:2}));const CollapseButton=theming.styled.button(({theme})=>({// Reset button
background:'transparent',border:'1px solid transparent',borderRadius:26,outline:'none',boxSizing:'content-box',cursor:'pointer',position:'relative',textAlign:'left',lineHeight:'normal',font:'inherit',color:'inherit',display:'flex',padding:3,paddingLeft:1,paddingRight:12,margin:0,marginLeft:-20,overflow:'hidden','span:first-of-type':{marginTop:5},'&:focus':{borderColor:theme.color.secondary,'span:first-of-type':{borderLeftColor:theme.color.secondary}}}));const Ref=React__default$1["default"].memo(props=>{const api$1=api.useStorybookApi();const{stories,id:refId,title=refId,isLoading:isLoadingMain,isBrowsing,selectedStoryId,highlightedRef,setHighlighted,loginUrl,type,expanded=true,ready,error}=props;const length=React$2.useMemo(()=>stories?Object.keys(stories).length:0,[stories]);const indicatorRef=React$2.useRef(null);const isMain=refId===DEFAULT_REF_ID;const isLoadingInjected=type==='auto-inject'&&!ready;const isLoading=isLoadingMain||isLoadingInjected||type==='unknown';const isError=!!error;const isEmpty=!isLoading&&length===0;const isAuthRequired=!!loginUrl&&length===0;const state=getStateType(isLoading,isAuthRequired,isError,isEmpty);const[isExpanded,setExpanded]=React$2.useState(expanded);const handleClick=React$2.useCallback(()=>setExpanded(value=>!value),[setExpanded]);const setHighlightedItemId=React$2.useCallback(itemId=>setHighlighted({itemId,refId}),[setHighlighted]);const onSelectStoryId=React$2.useCallback(storyId=>api$1&&api$1.selectStory(storyId,undefined,{ref:!isMain&&refId}),[api$1,isMain,refId]);return React__default$1["default"].createElement(React__default$1["default"].Fragment,null,isMain||React__default$1["default"].createElement(RefHead,{"aria-label":`${isExpanded?'Hide':'Show'} ${title} stories`,"aria-expanded":isExpanded},React__default$1["default"].createElement(CollapseButton,{"data-action":"collapse-ref",onClick:handleClick},React__default$1["default"].createElement(CollapseIcon,{isExpanded:isExpanded}),React__default$1["default"].createElement(RefTitle,{title:title},title)),React__default$1["default"].createElement(RefIndicator,Object.assign({},props,{state:state,ref:indicatorRef}))),isExpanded&&React__default$1["default"].createElement(Wrapper,{"data-title":title,isMain:isMain},state==='auth'&&React__default$1["default"].createElement(AuthBlock,{id:refId,loginUrl:loginUrl}),state==='error'&&React__default$1["default"].createElement(ErrorBlock,{error:error}),state==='loading'&&React__default$1["default"].createElement(LoaderBlock,{isMain:isMain}),state==='empty'&&React__default$1["default"].createElement(EmptyBlock,{isMain:isMain}),state==='ready'&&React__default$1["default"].createElement(Tree,{isBrowsing:isBrowsing,isMain:isMain,refId:refId,data:stories,selectedStoryId:selectedStoryId,onSelectStoryId:onSelectStoryId,highlightedRef:highlightedRef,setHighlightedItemId:setHighlightedItemId})));});const{document:document$4,window:globalWindow}=window_1;const fromSelection=selection=>selection?{itemId:selection.storyId,refId:selection.refId}:null;const useHighlighted=({containerRef,isLoading,isBrowsing,dataset,selected})=>{const initialHighlight=fromSelection(selected);const highlightedRef=React$2.useRef(initialHighlight);const[highlighted,setHighlighted]=React$2.useState(initialHighlight);const updateHighlighted=React$2.useCallback(highlight=>{highlightedRef.current=highlight;setHighlighted(highlight);},[highlightedRef]);// Sets the highlighted node and scrolls it into view, using DOM elements as reference
const highlightElement=React$2.useCallback((element,center=false)=>{const itemId=element.getAttribute('data-item-id');const refId=element.getAttribute('data-ref-id');if(!itemId||!refId)return;updateHighlighted({itemId,refId});scrollIntoView$1(element,center);},[updateHighlighted]);// Highlight and scroll to the selected story whenever the selection or dataset changes
React$2.useEffect(()=>{const highlight=fromSelection(selected);updateHighlighted(highlight);if(highlight){const{itemId,refId}=highlight;setTimeout(()=>{var _a;scrollIntoView$1((_a=containerRef.current)===null||_a===void 0?void 0:_a.querySelector(`[data-item-id="${itemId}"][data-ref-id="${refId}"]`),true// make sure it's clearly visible by centering it
);},0);}},[dataset,highlightedRef,containerRef,selected]);// Highlight nodes up/down the tree using arrow keys
React$2.useEffect(()=>{const menuElement=document$4.getElementById('storybook-explorer-menu');let lastRequestId;const navigateTree=event=>{if(isLoading||!isBrowsing||!containerRef.current)return;// allow event.repeat
if(!matchesModifiers(false,event))return;const isArrowUp=matchesKeyCode('ArrowUp',event);const isArrowDown=matchesKeyCode('ArrowDown',event);if(!(isArrowUp||isArrowDown))return;event.preventDefault();const requestId=globalWindow.requestAnimationFrame(()=>{globalWindow.cancelAnimationFrame(lastRequestId);lastRequestId=requestId;const target=event.target;if(!isAncestor(menuElement,target)&&!isAncestor(target,menuElement))return;if(target.hasAttribute('data-action'))target.blur();const highlightable=Array.from(containerRef.current.querySelectorAll('[data-highlightable=true]'));const currentIndex=highlightable.findIndex(el=>{var _a,_b;return el.getAttribute('data-item-id')===((_a=highlightedRef.current)===null||_a===void 0?void 0:_a.itemId)&&el.getAttribute('data-ref-id')===((_b=highlightedRef.current)===null||_b===void 0?void 0:_b.refId);});const nextIndex=cycle(highlightable,currentIndex,isArrowUp?-1:1);const didRunAround=isArrowUp?nextIndex===highlightable.length-1:nextIndex===0;highlightElement(highlightable[nextIndex],didRunAround);});};document$4.addEventListener('keydown',navigateTree);return()=>document$4.removeEventListener('keydown',navigateTree);},[isLoading,isBrowsing,highlightedRef,highlightElement]);return[highlighted,updateHighlighted,highlightedRef];};const HighlightStyles=({refId,itemId})=>React__default$1["default"].createElement(theming.Global,{styles:({color})=>{const background=curriedTransparentize$1(0.85,color.secondary);return{[`[data-ref-id="${refId}"][data-item-id="${itemId}"]:not([data-selected="true"])`]:{[`&[data-nodetype="component"], &[data-nodetype="group"]`]:{background,'&:hover, &:focus':{background}},[`&[data-nodetype="story"], &[data-nodetype="document"]`]:{color:color.defaultText,background,'&:hover, &:focus':{background}}}};}});const Explorer=React__default$1["default"].memo(({isLoading,isBrowsing,dataset,selected})=>{const containerRef=React$2.useRef(null);// Track highlighted nodes, keep it in sync with props and enable keyboard navigation
const[highlighted,setHighlighted,highlightedRef]=useHighlighted({containerRef,isLoading,isBrowsing,dataset,selected});return React__default$1["default"].createElement("div",{ref:containerRef,id:"storybook-explorer-tree","data-highlighted-ref-id":highlighted===null||highlighted===void 0?void 0:highlighted.refId,"data-highlighted-item-id":highlighted===null||highlighted===void 0?void 0:highlighted.itemId},highlighted&&React__default$1["default"].createElement(HighlightStyles,Object.assign({},highlighted)),dataset.entries.map(([refId,ref])=>React__default$1["default"].createElement(Ref,Object.assign({},ref,{key:refId,isLoading:isLoading,isBrowsing:isBrowsing,selectedStoryId:(selected===null||selected===void 0?void 0:selected.refId)===ref.id?selected.storyId:null,highlightedRef:highlightedRef,setHighlighted:setHighlighted}))));});function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;_setPrototypeOf(subClass,superClass);}var reactIs={exports:{}};var reactIs_production_min={};/** @license React v17.0.2
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var b$1=60103,c$1=60106,d$1=60107,e$2=60108,f$1=60114,g$1=60109,h$1=60110,k$1=60112,l$1=60113,m$1=60120,n$2=60115,p$1=60116,q$1=60121,r$2=60122,u$1=60117,v$1=60129,w$1=60131;if("function"===typeof Symbol&&Symbol.for){var x$1=Symbol.for;b$1=x$1("react.element");c$1=x$1("react.portal");d$1=x$1("react.fragment");e$2=x$1("react.strict_mode");f$1=x$1("react.profiler");g$1=x$1("react.provider");h$1=x$1("react.context");k$1=x$1("react.forward_ref");l$1=x$1("react.suspense");m$1=x$1("react.suspense_list");n$2=x$1("react.memo");p$1=x$1("react.lazy");q$1=x$1("react.block");r$2=x$1("react.server.block");u$1=x$1("react.fundamental");v$1=x$1("react.debug_trace_mode");w$1=x$1("react.legacy_hidden");}function y$1(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b$1:switch(a=a.type,a){case d$1:case f$1:case e$2:case l$1:case m$1:return a;default:switch(a=a&&a.$$typeof,a){case h$1:case k$1:case p$1:case n$2:case g$1:return a;default:return t;}}case c$1:return t;}}}var z$1=g$1,A$1=b$1,B$1=k$1,C$1=d$1,D$1=p$1,E$1=n$2,F$1=c$1,G$1=f$1,H$1=e$2,I$1=l$1;reactIs_production_min.ContextConsumer=h$1;reactIs_production_min.ContextProvider=z$1;reactIs_production_min.Element=A$1;reactIs_production_min.ForwardRef=B$1;reactIs_production_min.Fragment=C$1;reactIs_production_min.Lazy=D$1;reactIs_production_min.Memo=E$1;reactIs_production_min.Portal=F$1;reactIs_production_min.Profiler=G$1;reactIs_production_min.StrictMode=H$1;reactIs_production_min.Suspense=I$1;reactIs_production_min.isAsyncMode=function(){return!1;};reactIs_production_min.isConcurrentMode=function(){return!1;};reactIs_production_min.isContextConsumer=function(a){return y$1(a)===h$1;};reactIs_production_min.isContextProvider=function(a){return y$1(a)===g$1;};reactIs_production_min.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b$1;};reactIs_production_min.isForwardRef=function(a){return y$1(a)===k$1;};reactIs_production_min.isFragment=function(a){return y$1(a)===d$1;};reactIs_production_min.isLazy=function(a){return y$1(a)===p$1;};reactIs_production_min.isMemo=function(a){return y$1(a)===n$2;};reactIs_production_min.isPortal=function(a){return y$1(a)===c$1;};reactIs_production_min.isProfiler=function(a){return y$1(a)===f$1;};reactIs_production_min.isStrictMode=function(a){return y$1(a)===e$2;};reactIs_production_min.isSuspense=function(a){return y$1(a)===l$1;};reactIs_production_min.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d$1||a===f$1||a===v$1||a===e$2||a===l$1||a===m$1||a===w$1||"object"===typeof a&&null!==a&&(a.$$typeof===p$1||a.$$typeof===n$2||a.$$typeof===g$1||a.$$typeof===h$1||a.$$typeof===k$1||a.$$typeof===u$1||a.$$typeof===q$1||a[0]===r$2)?!0:!1;};reactIs_production_min.typeOf=y$1;var reactIs_development={};/** @license React v17.0.2
 * 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.
 */if(process.env.NODE_ENV!=="production"){(function(){// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE=0xeac7;var REACT_PORTAL_TYPE=0xeaca;var REACT_FRAGMENT_TYPE=0xeacb;var REACT_STRICT_MODE_TYPE=0xeacc;var REACT_PROFILER_TYPE=0xead2;var REACT_PROVIDER_TYPE=0xeacd;var REACT_CONTEXT_TYPE=0xeace;var REACT_FORWARD_REF_TYPE=0xead0;var REACT_SUSPENSE_TYPE=0xead1;var REACT_SUSPENSE_LIST_TYPE=0xead8;var REACT_MEMO_TYPE=0xead3;var REACT_LAZY_TYPE=0xead4;var REACT_BLOCK_TYPE=0xead9;var REACT_SERVER_BLOCK_TYPE=0xeada;var REACT_FUNDAMENTAL_TYPE=0xead5;var REACT_DEBUG_TRACING_MODE_TYPE=0xeae1;var REACT_LEGACY_HIDDEN_TYPE=0xeae3;if(typeof Symbol==='function'&&Symbol.for){var symbolFor=Symbol.for;REACT_ELEMENT_TYPE=symbolFor('react.element');REACT_PORTAL_TYPE=symbolFor('react.portal');REACT_FRAGMENT_TYPE=symbolFor('react.fragment');REACT_STRICT_MODE_TYPE=symbolFor('react.strict_mode');REACT_PROFILER_TYPE=symbolFor('react.profiler');REACT_PROVIDER_TYPE=symbolFor('react.provider');REACT_CONTEXT_TYPE=symbolFor('react.context');REACT_FORWARD_REF_TYPE=symbolFor('react.forward_ref');REACT_SUSPENSE_TYPE=symbolFor('react.suspense');REACT_SUSPENSE_LIST_TYPE=symbolFor('react.suspense_list');REACT_MEMO_TYPE=symbolFor('react.memo');REACT_LAZY_TYPE=symbolFor('react.lazy');REACT_BLOCK_TYPE=symbolFor('react.block');REACT_SERVER_BLOCK_TYPE=symbolFor('react.server.block');REACT_FUNDAMENTAL_TYPE=symbolFor('react.fundamental');symbolFor('react.scope');symbolFor('react.opaque.id');REACT_DEBUG_TRACING_MODE_TYPE=symbolFor('react.debug_trace_mode');symbolFor('react.offscreen');REACT_LEGACY_HIDDEN_TYPE=symbolFor('react.legacy_hidden');}// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
var enableScopeAPI=false;// Experimental Create Event Handle API.
function isValidElementType(type){if(typeof type==='string'||typeof type==='function'){return true;}// Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if(type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||type===REACT_DEBUG_TRACING_MODE_TYPE||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||type===REACT_LEGACY_HIDDEN_TYPE||enableScopeAPI){return true;}if(typeof type==='object'&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_FUNDAMENTAL_TYPE||type.$$typeof===REACT_BLOCK_TYPE||type[0]===REACT_SERVER_BLOCK_TYPE){return true;}}return false;}function typeOf(object){if(typeof object==='object'&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof;}}case REACT_PORTAL_TYPE:return $$typeof;}}return undefined;}var ContextConsumer=REACT_CONTEXT_TYPE;var ContextProvider=REACT_PROVIDER_TYPE;var Element=REACT_ELEMENT_TYPE;var ForwardRef=REACT_FORWARD_REF_TYPE;var Fragment=REACT_FRAGMENT_TYPE;var Lazy=REACT_LAZY_TYPE;var Memo=REACT_MEMO_TYPE;var Portal=REACT_PORTAL_TYPE;var Profiler=REACT_PROFILER_TYPE;var StrictMode=REACT_STRICT_MODE_TYPE;var Suspense=REACT_SUSPENSE_TYPE;var hasWarnedAboutDeprecatedIsAsyncMode=false;var hasWarnedAboutDeprecatedIsConcurrentMode=false;// AsyncMode should be deprecated
function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 18+.');}}return false;}function isConcurrentMode(object){{if(!hasWarnedAboutDeprecatedIsConcurrentMode){hasWarnedAboutDeprecatedIsConcurrentMode=true;// Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, '+'and will be removed in React 18+.');}}return false;}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE;}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE;}function isElement(object){return typeof object==='object'&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE;}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE;}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE;}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE;}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE;}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE;}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE;}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE;}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE;}reactIs_development.ContextConsumer=ContextConsumer;reactIs_development.ContextProvider=ContextProvider;reactIs_development.Element=Element;reactIs_development.ForwardRef=ForwardRef;reactIs_development.Fragment=Fragment;reactIs_development.Lazy=Lazy;reactIs_development.Memo=Memo;reactIs_development.Portal=Portal;reactIs_development.Profiler=Profiler;reactIs_development.StrictMode=StrictMode;reactIs_development.Suspense=Suspense;reactIs_development.isAsyncMode=isAsyncMode;reactIs_development.isConcurrentMode=isConcurrentMode;reactIs_development.isContextConsumer=isContextConsumer;reactIs_development.isContextProvider=isContextProvider;reactIs_development.isElement=isElement;reactIs_development.isForwardRef=isForwardRef;reactIs_development.isFragment=isFragment;reactIs_development.isLazy=isLazy;reactIs_development.isMemo=isMemo;reactIs_development.isPortal=isPortal;reactIs_development.isProfiler=isProfiler;reactIs_development.isStrictMode=isStrictMode;reactIs_development.isSuspense=isSuspense;reactIs_development.isValidElementType=isValidElementType;reactIs_development.typeOf=typeOf;})();}if(process.env.NODE_ENV==='production'){reactIs.exports=reactIs_production_min;}else{reactIs.exports=reactIs_development;}function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType;}function e$1(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t;}function n$1(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e$1(r.overflowY,n)||e$1(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement;}catch(t){return null;}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth);}(t);}return!1;}function r$1(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0;}function computeScrollIntoView(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h;};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break;}null!=p&&p===document.body&&n$1(p)&&!n$1(document.documentElement)||null!=p&&n$1(p,a)&&s.push(p);}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r$1(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r$1(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r$1(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r$1(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)));}C.push({el:k,top:F,left:G});}return C;}var idCounter=0;/**
 * Accepts a parameter and returns it if it's a function
 * or a noop function if it's not. This allows us to
 * accept a callback, but not worry about it if it's not
 * passed.
 * @param {Function} cb the callback
 * @return {Function} a function
 */function cbToCb(cb){return typeof cb==='function'?cb:noop;}function noop(){}/**
 * Scroll node into view if necessary
 * @param {HTMLElement} node the element that should scroll into view
 * @param {HTMLElement} menuNode the menu element of the component
 */function scrollIntoView(node,menuNode){if(!node){return;}var actions=computeScrollIntoView(node,{boundary:menuNode,block:'nearest',scrollMode:'if-needed'});actions.forEach(function(_ref){var el=_ref.el,top=_ref.top,left=_ref.left;el.scrollTop=top;el.scrollLeft=left;});}/**
 * @param {HTMLElement} parent the parent node
 * @param {HTMLElement} child the child node
 * @param {Window} environment The window context where downshift renders.
 * @return {Boolean} whether the parent is the child or the child is in the parent
 */function isOrContainsNode(parent,child,environment){var result=parent===child||child instanceof environment.Node&&parent.contains&&parent.contains(child);return result;}/**
 * Simple debounce implementation. Will call the given
 * function once after the time given has passed since
 * it was last called.
 * @param {Function} fn the function to call after the time
 * @param {Number} time the time to wait
 * @return {Function} the debounced function
 */function debounce(fn,time){var timeoutId;function cancel(){if(timeoutId){clearTimeout(timeoutId);}}function wrapper(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}cancel();timeoutId=setTimeout(function(){timeoutId=null;fn.apply(void 0,args);},time);}wrapper.cancel=cancel;return wrapper;}/**
 * This is intended to be used to compose event handlers.
 * They are executed in order until one of them sets
 * `event.preventDownshiftDefault = true`.
 * @param {...Function} fns the event handler functions
 * @return {Function} the event handler to add to an element
 */function callAllEventHandlers(){for(var _len2=arguments.length,fns=new Array(_len2),_key2=0;_key2<_len2;_key2++){fns[_key2]=arguments[_key2];}return function(event){for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];}return fns.some(function(fn){if(fn){fn.apply(void 0,[event].concat(args));}return event.preventDownshiftDefault||event.hasOwnProperty('nativeEvent')&&event.nativeEvent.preventDownshiftDefault;});};}function handleRefs(){for(var _len4=arguments.length,refs=new Array(_len4),_key4=0;_key4<_len4;_key4++){refs[_key4]=arguments[_key4];}return function(node){refs.forEach(function(ref){if(typeof ref==='function'){ref(node);}else if(ref){ref.current=node;}});};}/**
 * This generates a unique ID for an instance of Downshift
 * @return {String} the unique ID
 */function generateId(){return String(idCounter++);}/**
 * Default implementation for status message. Only added when menu is open.
 * Will specify if there are results in the list, and if so, how many,
 * and what keys are relevant.
 *
 * @param {Object} param the downshift state and other relevant properties
 * @return {String} the a11y status message
 */function getA11yStatusMessage$1(_ref2){var isOpen=_ref2.isOpen,resultCount=_ref2.resultCount,previousResultCount=_ref2.previousResultCount;if(!isOpen){return'';}if(!resultCount){return'No results are available.';}if(resultCount!==previousResultCount){return resultCount+" result"+(resultCount===1?' is':'s are')+" available, use up and down arrow keys to navigate. Press Enter key to select.";}return'';}/**
 * Takes an argument and if it's an array, returns the first item in the array
 * otherwise returns the argument
 * @param {*} arg the maybe-array
 * @param {*} defaultValue the value if arg is falsey not defined
 * @return {*} the arg or it's first item
 */function unwrapArray(arg,defaultValue){arg=Array.isArray(arg)?/* istanbul ignore next (preact) */arg[0]:arg;if(!arg&&defaultValue){return defaultValue;}else{return arg;}}/**
 * @param {Object} element (P)react element
 * @return {Boolean} whether it's a DOM element
 */function isDOMElement(element){return typeof element.type==='string';}/**
 * @param {Object} element (P)react element
 * @return {Object} the props
 */function getElementProps(element){return element.props;}/**
 * Throws a helpful error message for required properties. Useful
 * to be used as a default in destructuring or object params.
 * @param {String} fnName the function name
 * @param {String} propName the prop name
 */function requiredProp(fnName,propName){// eslint-disable-next-line no-console
console.error("The property \""+propName+"\" is required in \""+fnName+"\"");}var stateKeys=['highlightedIndex','inputValue','isOpen','selectedItem','type'];/**
 * @param {Object} state the state object
 * @return {Object} state that is relevant to downshift
 */function pickState(state){if(state===void 0){state={};}var result={};stateKeys.forEach(function(k){if(state.hasOwnProperty(k)){result[k]=state[k];}});return result;}/**
 * This will perform a shallow merge of the given state object
 * with the state coming from props
 * (for the controlled component scenario)
 * This is used in state updater functions so they're referencing
 * the right state regardless of where it comes from.
 *
 * @param {Object} state The state of the component/hook.
 * @param {Object} props The props that may contain controlled values.
 * @returns {Object} The merged controlled state.
 */function getState(state,props){return Object.keys(state).reduce(function(prevState,key){prevState[key]=isControlledProp(props,key)?props[key]:state[key];return prevState;},{});}/**
 * This determines whether a prop is a "controlled prop" meaning it is
 * state which is controlled by the outside of this component rather
 * than within this component.
 *
 * @param {Object} props The props that may contain controlled values.
 * @param {String} key the key to check
 * @return {Boolean} whether it is a controlled controlled prop
 */function isControlledProp(props,key){return props[key]!==undefined;}/**
 * Normalizes the 'key' property of a KeyboardEvent in IE/Edge
 * @param {Object} event a keyboardEvent object
 * @return {String} keyboard key
 */function normalizeArrowKey(event){var key=event.key,keyCode=event.keyCode;/* istanbul ignore next (ie) */if(keyCode>=37&&keyCode<=40&&key.indexOf('Arrow')!==0){return"Arrow"+key;}return key;}/**
 * Simple check if the value passed is object literal
 * @param {*} obj any things
 * @return {Boolean} whether it's object literal
 */function isPlainObject(obj){return Object.prototype.toString.call(obj)==='[object Object]';}/**
 * Returns the new index in the list, in a circular way. If next value is out of bonds from the total,
 * it will wrap to either 0 or itemCount - 1.
 *
 * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.
 * @param {number} baseIndex The initial position to move from.
 * @param {number} itemCount The total number of items.
 * @param {Function} getItemNodeFromIndex Used to check if item is disabled.
 * @param {boolean} circular Specify if navigation is circular. Default is true.
 * @returns {number} The new index after the move.
 */function getNextWrappingIndex(moveAmount,baseIndex,itemCount,getItemNodeFromIndex,circular){if(circular===void 0){circular=true;}if(itemCount===0){return-1;}var itemsLastIndex=itemCount-1;if(typeof baseIndex!=='number'||baseIndex<0||baseIndex>=itemCount){baseIndex=moveAmount>0?-1:itemsLastIndex+1;}var newIndex=baseIndex+moveAmount;if(newIndex<0){newIndex=circular?itemsLastIndex:0;}else if(newIndex>itemsLastIndex){newIndex=circular?0:itemsLastIndex;}var nonDisabledNewIndex=getNextNonDisabledIndex(moveAmount,newIndex,itemCount,getItemNodeFromIndex,circular);if(nonDisabledNewIndex===-1){return baseIndex>=itemCount?-1:baseIndex;}return nonDisabledNewIndex;}/**
 * Returns the next index in the list of an item that is not disabled.
 *
 * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.
 * @param {number} baseIndex The initial position to move from.
 * @param {number} itemCount The total number of items.
 * @param {Function} getItemNodeFromIndex Used to check if item is disabled.
 * @param {boolean} circular Specify if navigation is circular. Default is true.
 * @returns {number} The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1.
 */function getNextNonDisabledIndex(moveAmount,baseIndex,itemCount,getItemNodeFromIndex,circular){var currentElementNode=getItemNodeFromIndex(baseIndex);if(!currentElementNode||!currentElementNode.hasAttribute('disabled')){return baseIndex;}if(moveAmount>0){for(var index=baseIndex+1;index<itemCount;index++){if(!getItemNodeFromIndex(index).hasAttribute('disabled')){return index;}}}else{for(var _index=baseIndex-1;_index>=0;_index--){if(!getItemNodeFromIndex(_index).hasAttribute('disabled')){return _index;}}}if(circular){return moveAmount>0?getNextNonDisabledIndex(1,0,itemCount,getItemNodeFromIndex,false):getNextNonDisabledIndex(-1,itemCount-1,itemCount,getItemNodeFromIndex,false);}return-1;}/**
 * Checks if event target is within the downshift elements.
 *
 * @param {EventTarget} target Target to check.
 * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).
 * @param {Window} environment The window context where downshift renders.
 * @param {boolean} checkActiveElement Whether to also check activeElement.
 *
 * @returns {boolean} Whether or not the target is within downshift elements.
 */function targetWithinDownshift(target,downshiftElements,environment,checkActiveElement){if(checkActiveElement===void 0){checkActiveElement=true;}return downshiftElements.some(function(contextNode){return contextNode&&(isOrContainsNode(contextNode,target,environment)||checkActiveElement&&isOrContainsNode(contextNode,environment.document.activeElement,environment));});}// eslint-disable-next-line import/no-mutable-exports
var validateControlledUnchanged=noop;/* istanbul ignore next */if(process.env.NODE_ENV!=='production'){validateControlledUnchanged=function validateControlledUnchanged(state,prevProps,nextProps){var warningDescription="This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";Object.keys(state).forEach(function(propKey){if(prevProps[propKey]!==undefined&&nextProps[propKey]===undefined){// eslint-disable-next-line no-console
console.error("downshift: A component has changed the controlled prop \""+propKey+"\" to be uncontrolled. "+warningDescription);}else if(prevProps[propKey]===undefined&&nextProps[propKey]!==undefined){// eslint-disable-next-line no-console
console.error("downshift: A component has changed the uncontrolled prop \""+propKey+"\" to be controlled. "+warningDescription);}});};}var cleanupStatus=debounce(function(documentProp){getStatusDiv(documentProp).textContent='';},500);/**
 * @param {String} status the status message
 * @param {Object} documentProp document passed by the user.
 */function setStatus(status,documentProp){var div=getStatusDiv(documentProp);if(!status){return;}div.textContent=status;cleanupStatus(documentProp);}/**
 * Get the status node or create it if it does not already exist.
 * @param {Object} documentProp document passed by the user.
 * @return {HTMLElement} the status node.
 */function getStatusDiv(documentProp){if(documentProp===void 0){documentProp=document;}var statusDiv=documentProp.getElementById('a11y-status-message');if(statusDiv){return statusDiv;}statusDiv=documentProp.createElement('div');statusDiv.setAttribute('id','a11y-status-message');statusDiv.setAttribute('role','status');statusDiv.setAttribute('aria-live','polite');statusDiv.setAttribute('aria-relevant','additions text');Object.assign(statusDiv.style,{border:'0',clip:'rect(0 0 0 0)',height:'1px',margin:'-1px',overflow:'hidden',padding:'0',position:'absolute',width:'1px'});documentProp.body.appendChild(statusDiv);return statusDiv;}var unknown=process.env.NODE_ENV!=="production"?'__autocomplete_unknown__':0;var mouseUp=process.env.NODE_ENV!=="production"?'__autocomplete_mouseup__':1;var itemMouseEnter=process.env.NODE_ENV!=="production"?'__autocomplete_item_mouseenter__':2;var keyDownArrowUp=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_arrow_up__':3;var keyDownArrowDown=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_arrow_down__':4;var keyDownEscape=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_escape__':5;var keyDownEnter=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_enter__':6;var keyDownHome=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_home__':7;var keyDownEnd=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_end__':8;var clickItem=process.env.NODE_ENV!=="production"?'__autocomplete_click_item__':9;var blurInput=process.env.NODE_ENV!=="production"?'__autocomplete_blur_input__':10;var changeInput=process.env.NODE_ENV!=="production"?'__autocomplete_change_input__':11;var keyDownSpaceButton=process.env.NODE_ENV!=="production"?'__autocomplete_keydown_space_button__':12;var clickButton=process.env.NODE_ENV!=="production"?'__autocomplete_click_button__':13;var blurButton=process.env.NODE_ENV!=="production"?'__autocomplete_blur_button__':14;var controlledPropUpdatedSelectedItem=process.env.NODE_ENV!=="production"?'__autocomplete_controlled_prop_updated_selected_item__':15;var touchEnd=process.env.NODE_ENV!=="production"?'__autocomplete_touchend__':16;var stateChangeTypes$3=/*#__PURE__*/Object.freeze({__proto__:null,unknown:unknown,mouseUp:mouseUp,itemMouseEnter:itemMouseEnter,keyDownArrowUp:keyDownArrowUp,keyDownArrowDown:keyDownArrowDown,keyDownEscape:keyDownEscape,keyDownEnter:keyDownEnter,keyDownHome:keyDownHome,keyDownEnd:keyDownEnd,clickItem:clickItem,blurInput:blurInput,changeInput:changeInput,keyDownSpaceButton:keyDownSpaceButton,clickButton:clickButton,blurButton:blurButton,controlledPropUpdatedSelectedItem:controlledPropUpdatedSelectedItem,touchEnd:touchEnd});var _excluded$4=["refKey","ref"],_excluded2$3=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],_excluded3$2=["onKeyDown","onBlur","onChange","onInput","onChangeText"],_excluded4$1=["refKey","ref"],_excluded5$1=["onMouseMove","onMouseDown","onClick","onPress","index","item"];var Downshift=/*#__PURE__*/function(){var Downshift=/*#__PURE__*/function(_Component){_inheritsLoose(Downshift,_Component);function Downshift(_props){var _this;_this=_Component.call(this,_props)||this;// fancy destructuring + defaults + aliases
// this basically says each value of state should either be set to
// the initial value or the default value if the initial value is not provided
_this.id=_this.props.id||"downshift-"+generateId();_this.menuId=_this.props.menuId||_this.id+"-menu";_this.labelId=_this.props.labelId||_this.id+"-label";_this.inputId=_this.props.inputId||_this.id+"-input";_this.getItemId=_this.props.getItemId||function(index){return _this.id+"-item-"+index;};_this.input=null;_this.items=[];_this.itemCount=null;_this.previousResultCount=0;_this.timeoutIds=[];_this.internalSetTimeout=function(fn,time){var id=setTimeout(function(){_this.timeoutIds=_this.timeoutIds.filter(function(i){return i!==id;});fn();},time);_this.timeoutIds.push(id);};_this.setItemCount=function(count){_this.itemCount=count;};_this.unsetItemCount=function(){_this.itemCount=null;};_this.setHighlightedIndex=function(highlightedIndex,otherStateToSet){if(highlightedIndex===void 0){highlightedIndex=_this.props.defaultHighlightedIndex;}if(otherStateToSet===void 0){otherStateToSet={};}otherStateToSet=pickState(otherStateToSet);_this.internalSetState(_extends({highlightedIndex:highlightedIndex},otherStateToSet));};_this.clearSelection=function(cb){_this.internalSetState({selectedItem:null,inputValue:'',highlightedIndex:_this.props.defaultHighlightedIndex,isOpen:_this.props.defaultIsOpen},cb);};_this.selectItem=function(item,otherStateToSet,cb){otherStateToSet=pickState(otherStateToSet);_this.internalSetState(_extends({isOpen:_this.props.defaultIsOpen,highlightedIndex:_this.props.defaultHighlightedIndex,selectedItem:item,inputValue:_this.props.itemToString(item)},otherStateToSet),cb);};_this.selectItemAtIndex=function(itemIndex,otherStateToSet,cb){var item=_this.items[itemIndex];if(item==null){return;}_this.selectItem(item,otherStateToSet,cb);};_this.selectHighlightedItem=function(otherStateToSet,cb){return _this.selectItemAtIndex(_this.getState().highlightedIndex,otherStateToSet,cb);};_this.internalSetState=function(stateToSet,cb){var isItemSelected,onChangeArg;var onStateChangeArg={};var isStateToSetFunction=typeof stateToSet==='function';// we want to call `onInputValueChange` before the `setState` call
// so someone controlling the `inputValue` state gets notified of
// the input change as soon as possible. This avoids issues with
// preserving the cursor position.
// See https://github.com/downshift-js/downshift/issues/217 for more info.
if(!isStateToSetFunction&&stateToSet.hasOwnProperty('inputValue')){_this.props.onInputValueChange(stateToSet.inputValue,_extends({},_this.getStateAndHelpers(),stateToSet));}return _this.setState(function(state){state=_this.getState(state);var newStateToSet=isStateToSetFunction?stateToSet(state):stateToSet;// Your own function that could modify the state that will be set.
newStateToSet=_this.props.stateReducer(state,newStateToSet);// checks if an item is selected, regardless of if it's different from
// what was selected before
// used to determine if onSelect and onChange callbacks should be called
isItemSelected=newStateToSet.hasOwnProperty('selectedItem');// this keeps track of the object we want to call with setState
var nextState={};// this is just used to tell whether the state changed
var nextFullState={};// we need to call on change if the outside world is controlling any of our state
// and we're trying to update that state. OR if the selection has changed and we're
// trying to update the selection
if(isItemSelected&&newStateToSet.selectedItem!==state.selectedItem){onChangeArg=newStateToSet.selectedItem;}newStateToSet.type=newStateToSet.type||unknown;Object.keys(newStateToSet).forEach(function(key){// onStateChangeArg should only have the state that is
// actually changing
if(state[key]!==newStateToSet[key]){onStateChangeArg[key]=newStateToSet[key];}// the type is useful for the onStateChangeArg
// but we don't actually want to set it in internal state.
// this is an undocumented feature for now... Not all internalSetState
// calls support it and I'm not certain we want them to yet.
// But it enables users controlling the isOpen state to know when
// the isOpen state changes due to mouseup events which is quite handy.
if(key==='type'){return;}nextFullState[key]=newStateToSet[key];// if it's coming from props, then we don't care to set it internally
if(!isControlledProp(_this.props,key)){nextState[key]=newStateToSet[key];}});// if stateToSet is a function, then we weren't able to call onInputValueChange
// earlier, so we'll call it now that we know what the inputValue state will be.
if(isStateToSetFunction&&newStateToSet.hasOwnProperty('inputValue')){_this.props.onInputValueChange(newStateToSet.inputValue,_extends({},_this.getStateAndHelpers(),newStateToSet));}return nextState;},function(){// call the provided callback if it's a function
cbToCb(cb)();// only call the onStateChange and onChange callbacks if
// we have relevant information to pass them.
var hasMoreStateThanType=Object.keys(onStateChangeArg).length>1;if(hasMoreStateThanType){_this.props.onStateChange(onStateChangeArg,_this.getStateAndHelpers());}if(isItemSelected){_this.props.onSelect(stateToSet.selectedItem,_this.getStateAndHelpers());}if(onChangeArg!==undefined){_this.props.onChange(onChangeArg,_this.getStateAndHelpers());}// this is currently undocumented and therefore subject to change
// We'll try to not break it, but just be warned.
_this.props.onUserAction(onStateChangeArg,_this.getStateAndHelpers());});};_this.rootRef=function(node){return _this._rootNode=node;};_this.getRootProps=function(_temp,_temp2){var _extends2;var _ref=_temp===void 0?{}:_temp,_ref$refKey=_ref.refKey,refKey=_ref$refKey===void 0?'ref':_ref$refKey,ref=_ref.ref,rest=_objectWithoutPropertiesLoose(_ref,_excluded$4);var _ref2=_temp2===void 0?{}:_temp2,_ref2$suppressRefErro=_ref2.suppressRefError,suppressRefError=_ref2$suppressRefErro===void 0?false:_ref2$suppressRefErro;// this is used in the render to know whether the user has called getRootProps.
// It uses that to know whether to apply the props automatically
_this.getRootProps.called=true;_this.getRootProps.refKey=refKey;_this.getRootProps.suppressRefError=suppressRefError;var _this$getState=_this.getState(),isOpen=_this$getState.isOpen;return _extends((_extends2={},_extends2[refKey]=handleRefs(ref,_this.rootRef),_extends2.role='combobox',_extends2['aria-expanded']=isOpen,_extends2['aria-haspopup']='listbox',_extends2['aria-owns']=isOpen?_this.menuId:null,_extends2['aria-labelledby']=_this.labelId,_extends2),rest);};_this.keyDownHandlers={ArrowDown:function ArrowDown(event){var _this2=this;event.preventDefault();if(this.getState().isOpen){var amount=event.shiftKey?5:1;this.moveHighlightedIndex(amount,{type:keyDownArrowDown});}else{this.internalSetState({isOpen:true,type:keyDownArrowDown},function(){var itemCount=_this2.getItemCount();if(itemCount>0){var _this2$getState=_this2.getState(),highlightedIndex=_this2$getState.highlightedIndex;var nextHighlightedIndex=getNextWrappingIndex(1,highlightedIndex,itemCount,function(index){return _this2.getItemNodeFromIndex(index);});_this2.setHighlightedIndex(nextHighlightedIndex,{type:keyDownArrowDown});}});}},ArrowUp:function ArrowUp(event){var _this3=this;event.preventDefault();if(this.getState().isOpen){var amount=event.shiftKey?-5:-1;this.moveHighlightedIndex(amount,{type:keyDownArrowUp});}else{this.internalSetState({isOpen:true,type:keyDownArrowUp},function(){var itemCount=_this3.getItemCount();if(itemCount>0){var _this3$getState=_this3.getState(),highlightedIndex=_this3$getState.highlightedIndex;var nextHighlightedIndex=getNextWrappingIndex(-1,highlightedIndex,itemCount,function(index){return _this3.getItemNodeFromIndex(index);});_this3.setHighlightedIndex(nextHighlightedIndex,{type:keyDownArrowUp});}});}},Enter:function Enter(event){if(event.which===229){return;}var _this$getState2=this.getState(),isOpen=_this$getState2.isOpen,highlightedIndex=_this$getState2.highlightedIndex;if(isOpen&&highlightedIndex!=null){event.preventDefault();var item=this.items[highlightedIndex];var itemNode=this.getItemNodeFromIndex(highlightedIndex);if(item==null||itemNode&&itemNode.hasAttribute('disabled')){return;}this.selectHighlightedItem({type:keyDownEnter});}},Escape:function Escape(event){event.preventDefault();this.reset(_extends({type:keyDownEscape},!this.state.isOpen&&{selectedItem:null,inputValue:''}));}};_this.buttonKeyDownHandlers=_extends({},_this.keyDownHandlers,{' ':function _(event){event.preventDefault();this.toggleMenu({type:keyDownSpaceButton});}});_this.inputKeyDownHandlers=_extends({},_this.keyDownHandlers,{Home:function Home(event){var _this4=this;var _this$getState3=this.getState(),isOpen=_this$getState3.isOpen;if(!isOpen){return;}event.preventDefault();var itemCount=this.getItemCount();if(itemCount<=0||!isOpen){return;}// get next non-disabled starting downwards from 0 if that's disabled.
var newHighlightedIndex=getNextNonDisabledIndex(1,0,itemCount,function(index){return _this4.getItemNodeFromIndex(index);},false);this.setHighlightedIndex(newHighlightedIndex,{type:keyDownHome});},End:function End(event){var _this5=this;var _this$getState4=this.getState(),isOpen=_this$getState4.isOpen;if(!isOpen){return;}event.preventDefault();var itemCount=this.getItemCount();if(itemCount<=0||!isOpen){return;}// get next non-disabled starting upwards from last index if that's disabled.
var newHighlightedIndex=getNextNonDisabledIndex(-1,itemCount-1,itemCount,function(index){return _this5.getItemNodeFromIndex(index);},false);this.setHighlightedIndex(newHighlightedIndex,{type:keyDownEnd});}});_this.getToggleButtonProps=function(_temp3){var _ref3=_temp3===void 0?{}:_temp3,onClick=_ref3.onClick;_ref3.onPress;var onKeyDown=_ref3.onKeyDown,onKeyUp=_ref3.onKeyUp,onBlur=_ref3.onBlur,rest=_objectWithoutPropertiesLoose(_ref3,_excluded2$3);var _this$getState5=_this.getState(),isOpen=_this$getState5.isOpen;var enabledEventHandlers={onClick:callAllEventHandlers(onClick,_this.buttonHandleClick),onKeyDown:callAllEventHandlers(onKeyDown,_this.buttonHandleKeyDown),onKeyUp:callAllEventHandlers(onKeyUp,_this.buttonHandleKeyUp),onBlur:callAllEventHandlers(onBlur,_this.buttonHandleBlur)};var eventHandlers=rest.disabled?{}:enabledEventHandlers;return _extends({type:'button',role:'button','aria-label':isOpen?'close menu':'open menu','aria-haspopup':true,'data-toggle':true},eventHandlers,rest);};_this.buttonHandleKeyUp=function(event){// Prevent click event from emitting in Firefox
event.preventDefault();};_this.buttonHandleKeyDown=function(event){var key=normalizeArrowKey(event);if(_this.buttonKeyDownHandlers[key]){_this.buttonKeyDownHandlers[key].call(_assertThisInitialized(_this),event);}};_this.buttonHandleClick=function(event){event.preventDefault();// handle odd case for Safari and Firefox which
// don't give the button the focus properly.
/* istanbul ignore if (can't reasonably test this) */if(_this.props.environment.document.activeElement===_this.props.environment.document.body){event.target.focus();}// to simplify testing components that use downshift, we'll not wrap this in a setTimeout
// if the NODE_ENV is test. With the proper build system, this should be dead code eliminated
// when building for production and should therefore have no impact on production code.
if(process.env.NODE_ENV==='test'){_this.toggleMenu({type:clickButton});}else{// Ensure that toggle of menu occurs after the potential blur event in iOS
_this.internalSetTimeout(function(){return _this.toggleMenu({type:clickButton});});}};_this.buttonHandleBlur=function(event){var blurTarget=event.target;// Save blur target for comparison with activeElement later
// Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element
_this.internalSetTimeout(function(){if(!_this.isMouseDown&&(_this.props.environment.document.activeElement==null||_this.props.environment.document.activeElement.id!==_this.inputId)&&_this.props.environment.document.activeElement!==blurTarget// Do nothing if we refocus the same element again (to solve issue in Safari on iOS)
){_this.reset({type:blurButton});}});};_this.getLabelProps=function(props){return _extends({htmlFor:_this.inputId,id:_this.labelId},props);};_this.getInputProps=function(_temp4){var _ref4=_temp4===void 0?{}:_temp4,onKeyDown=_ref4.onKeyDown,onBlur=_ref4.onBlur,onChange=_ref4.onChange,onInput=_ref4.onInput;_ref4.onChangeText;var rest=_objectWithoutPropertiesLoose(_ref4,_excluded3$2);var onChangeKey;var eventHandlers={};/* istanbul ignore next (preact) */{onChangeKey='onChange';}var _this$getState6=_this.getState(),inputValue=_this$getState6.inputValue,isOpen=_this$getState6.isOpen,highlightedIndex=_this$getState6.highlightedIndex;if(!rest.disabled){var _eventHandlers;eventHandlers=(_eventHandlers={},_eventHandlers[onChangeKey]=callAllEventHandlers(onChange,onInput,_this.inputHandleChange),_eventHandlers.onKeyDown=callAllEventHandlers(onKeyDown,_this.inputHandleKeyDown),_eventHandlers.onBlur=callAllEventHandlers(onBlur,_this.inputHandleBlur),_eventHandlers);}return _extends({'aria-autocomplete':'list','aria-activedescendant':isOpen&&typeof highlightedIndex==='number'&&highlightedIndex>=0?_this.getItemId(highlightedIndex):null,'aria-controls':isOpen?_this.menuId:null,'aria-labelledby':_this.labelId,// https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
// revert back since autocomplete="nope" is ignored on latest Chrome and Opera
autoComplete:'off',value:inputValue,id:_this.inputId},eventHandlers,rest);};_this.inputHandleKeyDown=function(event){var key=normalizeArrowKey(event);if(key&&_this.inputKeyDownHandlers[key]){_this.inputKeyDownHandlers[key].call(_assertThisInitialized(_this),event);}};_this.inputHandleChange=function(event){_this.internalSetState({type:changeInput,isOpen:true,inputValue:event.target.value,highlightedIndex:_this.props.defaultHighlightedIndex});};_this.inputHandleBlur=function(){// Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element
_this.internalSetTimeout(function(){var downshiftButtonIsActive=_this.props.environment.document&&!!_this.props.environment.document.activeElement&&!!_this.props.environment.document.activeElement.dataset&&_this.props.environment.document.activeElement.dataset.toggle&&_this._rootNode&&_this._rootNode.contains(_this.props.environment.document.activeElement);if(!_this.isMouseDown&&!downshiftButtonIsActive){_this.reset({type:blurInput});}});};_this.menuRef=function(node){_this._menuNode=node;};_this.getMenuProps=function(_temp5,_temp6){var _extends3;var _ref5=_temp5===void 0?{}:_temp5,_ref5$refKey=_ref5.refKey,refKey=_ref5$refKey===void 0?'ref':_ref5$refKey,ref=_ref5.ref,props=_objectWithoutPropertiesLoose(_ref5,_excluded4$1);var _ref6=_temp6===void 0?{}:_temp6,_ref6$suppressRefErro=_ref6.suppressRefError,suppressRefError=_ref6$suppressRefErro===void 0?false:_ref6$suppressRefErro;_this.getMenuProps.called=true;_this.getMenuProps.refKey=refKey;_this.getMenuProps.suppressRefError=suppressRefError;return _extends((_extends3={},_extends3[refKey]=handleRefs(ref,_this.menuRef),_extends3.role='listbox',_extends3['aria-labelledby']=props&&props['aria-label']?null:_this.labelId,_extends3.id=_this.menuId,_extends3),props);};_this.getItemProps=function(_temp7){var _enabledEventHandlers;var _ref7=_temp7===void 0?{}:_temp7,onMouseMove=_ref7.onMouseMove,onMouseDown=_ref7.onMouseDown,onClick=_ref7.onClick;_ref7.onPress;var index=_ref7.index,_ref7$item=_ref7.item,item=_ref7$item===void 0?process.env.NODE_ENV==='production'?/* istanbul ignore next */undefined:requiredProp('getItemProps','item'):_ref7$item,rest=_objectWithoutPropertiesLoose(_ref7,_excluded5$1);if(index===undefined){_this.items.push(item);index=_this.items.indexOf(item);}else{_this.items[index]=item;}var onSelectKey='onClick';var customClickHandler=onClick;var enabledEventHandlers=(_enabledEventHandlers={// onMouseMove is used over onMouseEnter here. onMouseMove
// is only triggered on actual mouse movement while onMouseEnter
// can fire on DOM changes, interrupting keyboard navigation
onMouseMove:callAllEventHandlers(onMouseMove,function(){if(index===_this.getState().highlightedIndex){return;}_this.setHighlightedIndex(index,{type:itemMouseEnter});// We never want to manually scroll when changing state based
// on `onMouseMove` because we will be moving the element out
// from under the user which is currently scrolling/moving the
// cursor
_this.avoidScrolling=true;_this.internalSetTimeout(function(){return _this.avoidScrolling=false;},250);}),onMouseDown:callAllEventHandlers(onMouseDown,function(event){// This prevents the activeElement from being changed
// to the item so it can remain with the current activeElement
// which is a more common use case.
event.preventDefault();})},_enabledEventHandlers[onSelectKey]=callAllEventHandlers(customClickHandler,function(){_this.selectItemAtIndex(index,{type:clickItem});}),_enabledEventHandlers);// Passing down the onMouseDown handler to prevent redirect
// of the activeElement if clicking on disabled items
var eventHandlers=rest.disabled?{onMouseDown:enabledEventHandlers.onMouseDown}:enabledEventHandlers;return _extends({id:_this.getItemId(index),role:'option','aria-selected':_this.getState().highlightedIndex===index},eventHandlers,rest);};_this.clearItems=function(){_this.items=[];};_this.reset=function(otherStateToSet,cb){if(otherStateToSet===void 0){otherStateToSet={};}otherStateToSet=pickState(otherStateToSet);_this.internalSetState(function(_ref8){var selectedItem=_ref8.selectedItem;return _extends({isOpen:_this.props.defaultIsOpen,highlightedIndex:_this.props.defaultHighlightedIndex,inputValue:_this.props.itemToString(selectedItem)},otherStateToSet);},cb);};_this.toggleMenu=function(otherStateToSet,cb){if(otherStateToSet===void 0){otherStateToSet={};}otherStateToSet=pickState(otherStateToSet);_this.internalSetState(function(_ref9){var isOpen=_ref9.isOpen;return _extends({isOpen:!isOpen},isOpen&&{highlightedIndex:_this.props.defaultHighlightedIndex},otherStateToSet);},function(){var _this$getState7=_this.getState(),isOpen=_this$getState7.isOpen,highlightedIndex=_this$getState7.highlightedIndex;if(isOpen){if(_this.getItemCount()>0&&typeof highlightedIndex==='number'){_this.setHighlightedIndex(highlightedIndex,otherStateToSet);}}cbToCb(cb)();});};_this.openMenu=function(cb){_this.internalSetState({isOpen:true},cb);};_this.closeMenu=function(cb){_this.internalSetState({isOpen:false},cb);};_this.updateStatus=debounce(function(){var state=_this.getState();var item=_this.items[state.highlightedIndex];var resultCount=_this.getItemCount();var status=_this.props.getA11yStatusMessage(_extends({itemToString:_this.props.itemToString,previousResultCount:_this.previousResultCount,resultCount:resultCount,highlightedItem:item},state));_this.previousResultCount=resultCount;setStatus(status,_this.props.environment.document);},200);var _this$props=_this.props,defaultHighlightedIndex=_this$props.defaultHighlightedIndex,_this$props$initialHi=_this$props.initialHighlightedIndex,_highlightedIndex=_this$props$initialHi===void 0?defaultHighlightedIndex:_this$props$initialHi,defaultIsOpen=_this$props.defaultIsOpen,_this$props$initialIs=_this$props.initialIsOpen,_isOpen=_this$props$initialIs===void 0?defaultIsOpen:_this$props$initialIs,_this$props$initialIn=_this$props.initialInputValue,_inputValue=_this$props$initialIn===void 0?'':_this$props$initialIn,_this$props$initialSe=_this$props.initialSelectedItem,_selectedItem=_this$props$initialSe===void 0?null:_this$props$initialSe;var _state=_this.getState({highlightedIndex:_highlightedIndex,isOpen:_isOpen,inputValue:_inputValue,selectedItem:_selectedItem});if(_state.selectedItem!=null&&_this.props.initialInputValue===undefined){_state.inputValue=_this.props.itemToString(_state.selectedItem);}_this.state=_state;return _this;}var _proto=Downshift.prototype;/**
     * Clear all running timeouts
     */_proto.internalClearTimeouts=function internalClearTimeouts(){this.timeoutIds.forEach(function(id){clearTimeout(id);});this.timeoutIds=[];}/**
     * Gets the state based on internal state or props
     * If a state value is passed via props, then that
     * is the value given, otherwise it's retrieved from
     * stateToMerge
     *
     * @param {Object} stateToMerge defaults to this.state
     * @return {Object} the state
     */;_proto.getState=function getState$1(stateToMerge){if(stateToMerge===void 0){stateToMerge=this.state;}return getState(stateToMerge,this.props);};_proto.getItemCount=function getItemCount(){// things read better this way. They're in priority order:
// 1. `this.itemCount`
// 2. `this.props.itemCount`
// 3. `this.items.length`
var itemCount=this.items.length;if(this.itemCount!=null){itemCount=this.itemCount;}else if(this.props.itemCount!==undefined){itemCount=this.props.itemCount;}return itemCount;};_proto.getItemNodeFromIndex=function getItemNodeFromIndex(index){return this.props.environment.document.getElementById(this.getItemId(index));};_proto.scrollHighlightedItemIntoView=function scrollHighlightedItemIntoView(){/* istanbul ignore else (react-native) */{var node=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(node,this._menuNode);}};_proto.moveHighlightedIndex=function moveHighlightedIndex(amount,otherStateToSet){var _this6=this;var itemCount=this.getItemCount();var _this$getState8=this.getState(),highlightedIndex=_this$getState8.highlightedIndex;if(itemCount>0){var nextHighlightedIndex=getNextWrappingIndex(amount,highlightedIndex,itemCount,function(index){return _this6.getItemNodeFromIndex(index);});this.setHighlightedIndex(nextHighlightedIndex,otherStateToSet);}};_proto.getStateAndHelpers=function getStateAndHelpers(){var _this$getState9=this.getState(),highlightedIndex=_this$getState9.highlightedIndex,inputValue=_this$getState9.inputValue,selectedItem=_this$getState9.selectedItem,isOpen=_this$getState9.isOpen;var itemToString=this.props.itemToString;var id=this.id;var getRootProps=this.getRootProps,getToggleButtonProps=this.getToggleButtonProps,getLabelProps=this.getLabelProps,getMenuProps=this.getMenuProps,getInputProps=this.getInputProps,getItemProps=this.getItemProps,openMenu=this.openMenu,closeMenu=this.closeMenu,toggleMenu=this.toggleMenu,selectItem=this.selectItem,selectItemAtIndex=this.selectItemAtIndex,selectHighlightedItem=this.selectHighlightedItem,setHighlightedIndex=this.setHighlightedIndex,clearSelection=this.clearSelection,clearItems=this.clearItems,reset=this.reset,setItemCount=this.setItemCount,unsetItemCount=this.unsetItemCount,setState=this.internalSetState;return{// prop getters
getRootProps:getRootProps,getToggleButtonProps:getToggleButtonProps,getLabelProps:getLabelProps,getMenuProps:getMenuProps,getInputProps:getInputProps,getItemProps:getItemProps,// actions
reset:reset,openMenu:openMenu,closeMenu:closeMenu,toggleMenu:toggleMenu,selectItem:selectItem,selectItemAtIndex:selectItemAtIndex,selectHighlightedItem:selectHighlightedItem,setHighlightedIndex:setHighlightedIndex,clearSelection:clearSelection,clearItems:clearItems,setItemCount:setItemCount,unsetItemCount:unsetItemCount,setState:setState,// props
itemToString:itemToString,// derived
id:id,// state
highlightedIndex:highlightedIndex,inputValue:inputValue,isOpen:isOpen,selectedItem:selectedItem};}//////////////////////////// ROOT
;_proto.componentDidMount=function componentDidMount(){var _this7=this;/* istanbul ignore if (react-native) */if(process.env.NODE_ENV!=='production'&&!false&&this.getMenuProps.called&&!this.getMenuProps.suppressRefError){validateGetMenuPropsCalledCorrectly(this._menuNode,this.getMenuProps);}/* istanbul ignore if (react-native) */{// this.isMouseDown helps us track whether the mouse is currently held down.
// This is useful when the user clicks on an item in the list, but holds the mouse
// down long enough for the list to disappear (because the blur event fires on the input)
// this.isMouseDown is used in the blur handler on the input to determine whether the blur event should
// trigger hiding the menu.
var onMouseDown=function onMouseDown(){_this7.isMouseDown=true;};var onMouseUp=function onMouseUp(event){_this7.isMouseDown=false;// if the target element or the activeElement is within a downshift node
// then we don't want to reset downshift
var contextWithinDownshift=targetWithinDownshift(event.target,[_this7._rootNode,_this7._menuNode],_this7.props.environment);if(!contextWithinDownshift&&_this7.getState().isOpen){_this7.reset({type:mouseUp},function(){return _this7.props.onOuterClick(_this7.getStateAndHelpers());});}};// Touching an element in iOS gives focus and hover states, but touching out of
// the element will remove hover, and persist the focus state, resulting in the
// blur event not being triggered.
// this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.
// If the user taps outside of Downshift, the component should be reset,
// but not if the user is swiping
var onTouchStart=function onTouchStart(){_this7.isTouchMove=false;};var onTouchMove=function onTouchMove(){_this7.isTouchMove=true;};var onTouchEnd=function onTouchEnd(event){var contextWithinDownshift=targetWithinDownshift(event.target,[_this7._rootNode,_this7._menuNode],_this7.props.environment,false);if(!_this7.isTouchMove&&!contextWithinDownshift&&_this7.getState().isOpen){_this7.reset({type:touchEnd},function(){return _this7.props.onOuterClick(_this7.getStateAndHelpers());});}};var environment=this.props.environment;environment.addEventListener('mousedown',onMouseDown);environment.addEventListener('mouseup',onMouseUp);environment.addEventListener('touchstart',onTouchStart);environment.addEventListener('touchmove',onTouchMove);environment.addEventListener('touchend',onTouchEnd);this.cleanup=function(){_this7.internalClearTimeouts();_this7.updateStatus.cancel();environment.removeEventListener('mousedown',onMouseDown);environment.removeEventListener('mouseup',onMouseUp);environment.removeEventListener('touchstart',onTouchStart);environment.removeEventListener('touchmove',onTouchMove);environment.removeEventListener('touchend',onTouchEnd);};}};_proto.shouldScroll=function shouldScroll(prevState,prevProps){var _ref10=this.props.highlightedIndex===undefined?this.getState():this.props,currentHighlightedIndex=_ref10.highlightedIndex;var _ref11=prevProps.highlightedIndex===undefined?prevState:prevProps,prevHighlightedIndex=_ref11.highlightedIndex;var scrollWhenOpen=currentHighlightedIndex&&this.getState().isOpen&&!prevState.isOpen;var scrollWhenNavigating=currentHighlightedIndex!==prevHighlightedIndex;return scrollWhenOpen||scrollWhenNavigating;};_proto.componentDidUpdate=function componentDidUpdate(prevProps,prevState){if(process.env.NODE_ENV!=='production'){validateControlledUnchanged(this.state,prevProps,this.props);/* istanbul ignore if (react-native) */if(this.getMenuProps.called&&!this.getMenuProps.suppressRefError){validateGetMenuPropsCalledCorrectly(this._menuNode,this.getMenuProps);}}if(isControlledProp(this.props,'selectedItem')&&this.props.selectedItemChanged(prevProps.selectedItem,this.props.selectedItem)){this.internalSetState({type:controlledPropUpdatedSelectedItem,inputValue:this.props.itemToString(this.props.selectedItem)});}if(!this.avoidScrolling&&this.shouldScroll(prevState,prevProps)){this.scrollHighlightedItemIntoView();}/* istanbul ignore else (react-native) */{this.updateStatus();}};_proto.componentWillUnmount=function componentWillUnmount(){this.cleanup();// avoids memory leak
};_proto.render=function render(){var children=unwrapArray(this.props.children,noop);// because the items are rerendered every time we call the children
// we clear this out each render and it will be populated again as
// getItemProps is called.
this.clearItems();// we reset this so we know whether the user calls getRootProps during
// this render. If they do then we don't need to do anything,
// if they don't then we need to clone the element they return and
// apply the props for them.
this.getRootProps.called=false;this.getRootProps.refKey=undefined;this.getRootProps.suppressRefError=undefined;// we do something similar for getMenuProps
this.getMenuProps.called=false;this.getMenuProps.refKey=undefined;this.getMenuProps.suppressRefError=undefined;// we do something similar for getLabelProps
this.getLabelProps.called=false;// and something similar for getInputProps
this.getInputProps.called=false;var element=unwrapArray(children(this.getStateAndHelpers()));if(!element){return null;}if(this.getRootProps.called||this.props.suppressRefError){if(process.env.NODE_ENV!=='production'&&!this.getRootProps.suppressRefError&&!this.props.suppressRefError){validateGetRootPropsCalledCorrectly(element,this.getRootProps);}return element;}else if(isDOMElement(element)){// they didn't apply the root props, but we can clone
// this and apply the props ourselves
return/*#__PURE__*/React$2.cloneElement(element,this.getRootProps(getElementProps(element)));}/* istanbul ignore else */if(process.env.NODE_ENV!=='production'){// they didn't apply the root props, but they need to
// otherwise we can't query around the autocomplete
throw new Error('downshift: If you return a non-DOM element, you must apply the getRootProps function');}/* istanbul ignore next */return undefined;};return Downshift;}(React$2.Component);Downshift.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:false,getA11yStatusMessage:getA11yStatusMessage$1,itemToString:function itemToString(i){if(i==null){return'';}if(process.env.NODE_ENV!=='production'&&isPlainObject(i)&&!i.hasOwnProperty('toString')){// eslint-disable-next-line no-console
console.warn('downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.','The object that was passed:',i);}return String(i);},onStateChange:noop,onInputValueChange:noop,onUserAction:noop,onChange:noop,onSelect:noop,onOuterClick:noop,selectedItemChanged:function selectedItemChanged(prevItem,item){return prevItem!==item;},environment:/* istanbul ignore next (ssr) */typeof window==='undefined'?{}:window,stateReducer:function stateReducer(state,stateToSet){return stateToSet;},suppressRefError:false,scrollIntoView:scrollIntoView};Downshift.stateChangeTypes=stateChangeTypes$3;return Downshift;}();process.env.NODE_ENV!=="production"?Downshift.propTypes={children:PropTypes.func,defaultHighlightedIndex:PropTypes.number,defaultIsOpen:PropTypes.bool,initialHighlightedIndex:PropTypes.number,initialSelectedItem:PropTypes.any,initialInputValue:PropTypes.string,initialIsOpen:PropTypes.bool,getA11yStatusMessage:PropTypes.func,itemToString:PropTypes.func,onChange:PropTypes.func,onSelect:PropTypes.func,onStateChange:PropTypes.func,onInputValueChange:PropTypes.func,onUserAction:PropTypes.func,onOuterClick:PropTypes.func,selectedItemChanged:PropTypes.func,stateReducer:PropTypes.func,itemCount:PropTypes.number,id:PropTypes.string,environment:PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})}),suppressRefError:PropTypes.bool,scrollIntoView:PropTypes.func,// things we keep in state for uncontrolled components
// but can accept as props for controlled components
/* eslint-disable react/no-unused-prop-types */selectedItem:PropTypes.any,isOpen:PropTypes.bool,inputValue:PropTypes.string,highlightedIndex:PropTypes.number,labelId:PropTypes.string,inputId:PropTypes.string,menuId:PropTypes.string,getItemId:PropTypes.func/* eslint-enable react/no-unused-prop-types */}:void 0;var Downshift$1=Downshift;function validateGetMenuPropsCalledCorrectly(node,_ref12){var refKey=_ref12.refKey;if(!node){// eslint-disable-next-line no-console
console.error("downshift: The ref prop \""+refKey+"\" from getMenuProps was not applied correctly on your menu element.");}}function validateGetRootPropsCalledCorrectly(element,_ref13){var refKey=_ref13.refKey;var refKeySpecified=refKey!=='ref';var isComposite=!isDOMElement(element);if(isComposite&&!refKeySpecified&&!reactIs.exports.isForwardRef(element)){// eslint-disable-next-line no-console
console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');}else if(!isComposite&&refKeySpecified){// eslint-disable-next-line no-console
console.error("downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \""+refKey+"\"");}if(!reactIs.exports.isForwardRef(element)&&!getElementProps(element)[refKey]){// eslint-disable-next-line no-console
console.error("downshift: You must apply the ref prop \""+refKey+"\" from getRootProps onto your root element.");}}/**
 * Default state reducer that returns the changes.
 *
 * @param {Object} s state.
 * @param {Object} a action with changes.
 * @returns {Object} changes.
 */function stateReducer(s,a){return a.changes;}/**
 * Returns a message to be added to aria-live region when item is selected.
 *
 * @param {Object} selectionParameters Parameters required to build the message.
 * @returns {string} The a11y message.
 */function getA11ySelectionMessage(selectionParameters){var selectedItem=selectionParameters.selectedItem,itemToStringLocal=selectionParameters.itemToString;return selectedItem?itemToStringLocal(selectedItem)+" has been selected.":'';}/**
 * Debounced call for updating the a11y message.
 */debounce(function(getA11yMessage,document){setStatus(getA11yMessage(),document);},200);// istanbul ignore next
function itemToString(item){return item?String(item):'';}var defaultProps$3={itemToString:itemToString,stateReducer:stateReducer,getA11ySelectionMessage:getA11ySelectionMessage,scrollIntoView:scrollIntoView,circularNavigation:false,environment:/* istanbul ignore next (ssr) */typeof window==='undefined'?{}:window};/**
 * Custom hook that checks if getter props are called correctly.
 *
 * @param  {...any} propKeys Getter prop names to be handled.
 * @returns {Function} Setter function called inside getter props to set call information.
 */ /* istanbul ignore next */if(process.env.NODE_ENV!=='production');/* istanbul ignore next */if(process.env.NODE_ENV!=='production');({items:PropTypes.array.isRequired,itemToString:PropTypes.func,getA11yStatusMessage:PropTypes.func,getA11ySelectionMessage:PropTypes.func,circularNavigation:PropTypes.bool,highlightedIndex:PropTypes.number,defaultHighlightedIndex:PropTypes.number,initialHighlightedIndex:PropTypes.number,isOpen:PropTypes.bool,defaultIsOpen:PropTypes.bool,initialIsOpen:PropTypes.bool,selectedItem:PropTypes.any,initialSelectedItem:PropTypes.any,defaultSelectedItem:PropTypes.any,id:PropTypes.string,labelId:PropTypes.string,menuId:PropTypes.string,getItemId:PropTypes.func,toggleButtonId:PropTypes.string,stateReducer:PropTypes.func,onSelectedItemChange:PropTypes.func,onHighlightedIndexChange:PropTypes.func,onStateChange:PropTypes.func,onIsOpenChange:PropTypes.func,environment:PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})})});/**
 * Default implementation for status message. Only added when menu is open.
 * Will specift if there are results in the list, and if so, how many,
 * and what keys are relevant.
 *
 * @param {Object} param the downshift state and other relevant properties
 * @return {String} the a11y status message
 */function getA11yStatusMessage(_a){var isOpen=_a.isOpen,resultCount=_a.resultCount,previousResultCount=_a.previousResultCount;if(!isOpen){return'';}if(!resultCount){return'No results are available.';}if(resultCount!==previousResultCount){return resultCount+" result"+(resultCount===1?' is':'s are')+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.";}return'';}__assign(__assign({},defaultProps$3),{getA11yStatusMessage:getA11yStatusMessage});// eslint-disable-next-line import/no-mutable-exports
/* istanbul ignore next */if(process.env.NODE_ENV!=='production');process.env.NODE_ENV!=="production"?'__menu_keydown_arrow_down__':0;process.env.NODE_ENV!=="production"?'__menu_keydown_arrow_up__':1;process.env.NODE_ENV!=="production"?'__menu_keydown_escape__':2;process.env.NODE_ENV!=="production"?'__menu_keydown_home__':3;process.env.NODE_ENV!=="production"?'__menu_keydown_end__':4;process.env.NODE_ENV!=="production"?'__menu_keydown_enter__':5;process.env.NODE_ENV!=="production"?'__menu_keydown_space_button__':6;process.env.NODE_ENV!=="production"?'__menu_keydown_character__':7;process.env.NODE_ENV!=="production"?'__menu_blur__':8;process.env.NODE_ENV!=="production"?'__menu_mouse_leave__':9;process.env.NODE_ENV!=="production"?'__item_mouse_move__':10;process.env.NODE_ENV!=="production"?'__item_click__':11;process.env.NODE_ENV!=="production"?'__togglebutton_click__':12;process.env.NODE_ENV!=="production"?'__togglebutton_keydown_arrow_down__':13;process.env.NODE_ENV!=="production"?'__togglebutton_keydown_arrow_up__':14;process.env.NODE_ENV!=="production"?'__togglebutton_keydown_character__':15;process.env.NODE_ENV!=="production"?'__function_toggle_menu__':16;process.env.NODE_ENV!=="production"?'__function_open_menu__':17;process.env.NODE_ENV!=="production"?'__function_close_menu__':18;process.env.NODE_ENV!=="production"?'__function_set_highlighted_index__':19;process.env.NODE_ENV!=="production"?'__function_select_item__':20;process.env.NODE_ENV!=="production"?'__function_set_input_value__':21;process.env.NODE_ENV!=="production"?'__function_reset__':22;process.env.NODE_ENV!=="production"?'__input_keydown_arrow_down__':0;process.env.NODE_ENV!=="production"?'__input_keydown_arrow_up__':1;process.env.NODE_ENV!=="production"?'__input_keydown_escape__':2;process.env.NODE_ENV!=="production"?'__input_keydown_home__':3;process.env.NODE_ENV!=="production"?'__input_keydown_end__':4;process.env.NODE_ENV!=="production"?'__input_keydown_enter__':5;process.env.NODE_ENV!=="production"?'__input_change__':6;process.env.NODE_ENV!=="production"?'__input_blur__':7;process.env.NODE_ENV!=="production"?'__menu_mouse_leave__':8;process.env.NODE_ENV!=="production"?'__item_mouse_move__':9;process.env.NODE_ENV!=="production"?'__item_click__':10;process.env.NODE_ENV!=="production"?'__togglebutton_click__':11;process.env.NODE_ENV!=="production"?'__function_toggle_menu__':12;process.env.NODE_ENV!=="production"?'__function_open_menu__':13;process.env.NODE_ENV!=="production"?'__function_close_menu__':14;process.env.NODE_ENV!=="production"?'__function_set_highlighted_index__':15;process.env.NODE_ENV!=="production"?'__function_select_item__':16;process.env.NODE_ENV!=="production"?'__function_set_input_value__':17;process.env.NODE_ENV!=="production"?'__function_reset__':18;process.env.NODE_ENV!=="production"?'__controlled_prop_updated_selected_item__':19;({items:PropTypes.array.isRequired,itemToString:PropTypes.func,getA11yStatusMessage:PropTypes.func,getA11ySelectionMessage:PropTypes.func,circularNavigation:PropTypes.bool,highlightedIndex:PropTypes.number,defaultHighlightedIndex:PropTypes.number,initialHighlightedIndex:PropTypes.number,isOpen:PropTypes.bool,defaultIsOpen:PropTypes.bool,initialIsOpen:PropTypes.bool,selectedItem:PropTypes.any,initialSelectedItem:PropTypes.any,defaultSelectedItem:PropTypes.any,inputValue:PropTypes.string,defaultInputValue:PropTypes.string,initialInputValue:PropTypes.string,id:PropTypes.string,labelId:PropTypes.string,menuId:PropTypes.string,getItemId:PropTypes.func,inputId:PropTypes.string,toggleButtonId:PropTypes.string,stateReducer:PropTypes.func,onSelectedItemChange:PropTypes.func,onHighlightedIndexChange:PropTypes.func,onStateChange:PropTypes.func,onIsOpenChange:PropTypes.func,onInputValueChange:PropTypes.func,environment:PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})})});/* istanbul ignore next */if(process.env.NODE_ENV!=='production');_extends({},defaultProps$3,{getA11yStatusMessage:getA11yStatusMessage$1,circularNavigation:true});/**
 * Returns a message to be added to aria-live region when item is removed.
 *
 * @param {Object} selectionParameters Parameters required to build the message.
 * @returns {string} The a11y message.
 */function getA11yRemovalMessage(selectionParameters){var removedSelectedItem=selectionParameters.removedSelectedItem,itemToStringLocal=selectionParameters.itemToString;return itemToStringLocal(removedSelectedItem)+" has been removed.";}({selectedItems:PropTypes.array,initialSelectedItems:PropTypes.array,defaultSelectedItems:PropTypes.array,itemToString:PropTypes.func,getA11yRemovalMessage:PropTypes.func,stateReducer:PropTypes.func,activeIndex:PropTypes.number,initialActiveIndex:PropTypes.number,defaultActiveIndex:PropTypes.number,onActiveIndexChange:PropTypes.func,onSelectedItemsChange:PropTypes.func,keyNavigationNext:PropTypes.string,keyNavigationPrevious:PropTypes.string,environment:PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})})});({itemToString:defaultProps$3.itemToString,stateReducer:defaultProps$3.stateReducer,environment:defaultProps$3.environment,getA11yRemovalMessage:getA11yRemovalMessage,keyNavigationNext:'ArrowRight',keyNavigationPrevious:'ArrowLeft'});// eslint-disable-next-line import/no-mutable-exports
/* istanbul ignore next */if(process.env.NODE_ENV!=='production');process.env.NODE_ENV!=="production"?'__selected_item_click__':0;process.env.NODE_ENV!=="production"?'__selected_item_keydown_delete__':1;process.env.NODE_ENV!=="production"?'__selected_item_keydown_backspace__':2;process.env.NODE_ENV!=="production"?'__selected_item_keydown_navigation_next__':3;process.env.NODE_ENV!=="production"?'__selected_item_keydown_navigation_previous__':4;process.env.NODE_ENV!=="production"?'__dropdown_keydown_navigation_previous__':5;process.env.NODE_ENV!=="production"?'__dropdown_keydown_backspace__':6;process.env.NODE_ENV!=="production"?'__dropdown_click__':7;process.env.NODE_ENV!=="production"?'__function_add_selected_item__':8;process.env.NODE_ENV!=="production"?'__function_remove_selected_item__':9;process.env.NODE_ENV!=="production"?'__function_set_selected_items__':10;process.env.NODE_ENV!=="production"?'__function_set_active_index__':11;process.env.NODE_ENV!=="production"?'__function_reset__':12;var fuse={exports:{}};/*!
 * Fuse.js v3.6.1 - Lightweight fuzzy-search (http://fusejs.io)
 * 
 * Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me)
 * All Rights Reserved. Apache Software License 2.0
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 */(function(module,exports){!function(e,t){module.exports=t();}(commonjsGlobal,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports;}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t];}.bind(null,o));return n;},r.n=function(e){var t=e&&e.__esModule?function(){return e.default;}:function(){return e;};return r.d(t,"a",t),t;},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t);},r.p="",r(r.s=0);}([function(e,t,r){function n(e){return(n="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;})(e);}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n);}}var i=r(1),a=r(7),s=a.get,c=(a.deepValue,a.isArray),h=function(){function e(t,r){var n=r.location,o=void 0===n?0:n,i=r.distance,a=void 0===i?100:i,c=r.threshold,h=void 0===c?.6:c,l=r.maxPatternLength,u=void 0===l?32:l,f=r.caseSensitive,v=void 0!==f&&f,p=r.tokenSeparator,d=void 0===p?/ +/g:p,g=r.findAllMatches,y=void 0!==g&&g,m=r.minMatchCharLength,k=void 0===m?1:m,b=r.id,S=void 0===b?null:b,x=r.keys,M=void 0===x?[]:x,_=r.shouldSort,w=void 0===_||_,L=r.getFn,A=void 0===L?s:L,O=r.sortFn,C=void 0===O?function(e,t){return e.score-t.score;}:O,j=r.tokenize,P=void 0!==j&&j,I=r.matchAllTokens,F=void 0!==I&&I,T=r.includeMatches,N=void 0!==T&&T,z=r.includeScore,E=void 0!==z&&z,W=r.verbose,K=void 0!==W&&W;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");}(this,e),this.options={location:o,distance:a,threshold:h,maxPatternLength:u,isCaseSensitive:v,tokenSeparator:d,findAllMatches:y,minMatchCharLength:k,id:S,keys:M,includeMatches:N,includeScore:E,shouldSort:w,getFn:A,sortFn:C,verbose:K,tokenize:P,matchAllTokens:F},this.setCollection(t),this._processKeys(M);}var t,r;return t=e,(r=[{key:"setCollection",value:function(e){return this.list=e,e;}},{key:"_processKeys",value:function(e){if(this._keyWeights={},this._keyNames=[],e.length&&"string"==typeof e[0])for(var t=0,r=e.length;t<r;t+=1){var n=e[t];this._keyWeights[n]=1,this._keyNames.push(n);}else{for(var a=0,s=0,c=e.length;s<c;s+=1){var h=e[s];if(!h.hasOwnProperty("name"))throw new Error('Missing "name" property in key object');var l=h.name;if(this._keyNames.push(l),!h.hasOwnProperty("weight"))throw new Error('Missing "weight" property in key object');var u=h.weight;if(u<0||u>1)throw new Error('"weight" property in key must bein the range of [0, 1)');this._keyWeights[l]=u,a+=u;}if(a>1)throw new Error("Total of weights cannot exceed 1");}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var r=this._prepareSearchers(e),n=r.tokenSearchers,o=r.fullSearcher,i=this._search(n,o);return this._computeScore(i),this.options.shouldSort&&this._sort(i),t.limit&&"number"==typeof t.limit&&(i=i.slice(0,t.limit)),this._format(i);}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var r=e.split(this.options.tokenSeparator),n=0,o=r.length;n<o;n+=1)t.push(new i(r[n],this.options));return{tokenSearchers:t,fullSearcher:new i(e,this.options)};}},{key:"_search",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=this.list,n={},o=[];if("string"==typeof r[0]){for(var i=0,a=r.length;i<a;i+=1)this._analyze({key:"",value:r[i],record:i,index:i},{resultMap:n,results:o,tokenSearchers:e,fullSearcher:t});return o;}for(var s=0,c=r.length;s<c;s+=1)for(var h=r[s],l=0,u=this._keyNames.length;l<u;l+=1){var f=this._keyNames[l];this._analyze({key:f,value:this.options.getFn(h,f),record:h,index:s},{resultMap:n,results:o,tokenSearchers:e,fullSearcher:t});}return o;}},{key:"_analyze",value:function(e,t){var r=this,n=e.key,o=e.arrayIndex,i=void 0===o?-1:o,a=e.value,s=e.record,h=e.index,l=t.tokenSearchers,u=void 0===l?[]:l,f=t.fullSearcher,v=t.resultMap,p=void 0===v?{}:v,d=t.results,g=void 0===d?[]:d;!function e(t,o,i,a){if(null!=o)if("string"==typeof o){var s=!1,h=-1,l=0;r._log("\nKey: ".concat(""===n?"--":n));var v=f.search(o);if(r._log('Full text: "'.concat(o,'", score: ').concat(v.score)),r.options.tokenize){for(var d=o.split(r.options.tokenSeparator),y=d.length,m=[],k=0,b=u.length;k<b;k+=1){var S=u[k];r._log('\nPattern: "'.concat(S.pattern,'"'));for(var x=!1,M=0;M<y;M+=1){var _=d[M],w=S.search(_),L={};w.isMatch?(L[_]=w.score,s=!0,x=!0,m.push(w.score)):(L[_]=1,r.options.matchAllTokens||m.push(1)),r._log('Token: "'.concat(_,'", score: ').concat(L[_]));}x&&(l+=1);}h=m[0];for(var A=m.length,O=1;O<A;O+=1)h+=m[O];h/=A,r._log("Token score average:",h);}var C=v.score;h>-1&&(C=(C+h)/2),r._log("Score average:",C);var j=!r.options.tokenize||!r.options.matchAllTokens||l>=u.length;if(r._log("\nCheck Matches: ".concat(j)),(s||v.isMatch)&&j){var P={key:n,arrayIndex:t,value:o,score:C};r.options.includeMatches&&(P.matchedIndices=v.matchedIndices);var I=p[a];I?I.output.push(P):(p[a]={item:i,output:[P]},g.push(p[a]));}}else if(c(o))for(var F=0,T=o.length;F<T;F+=1)e(F,o[F],i,a);}(i,a,s,h);}},{key:"_computeScore",value:function(e){this._log("\n\nComputing score:\n");for(var t=this._keyWeights,r=!!Object.keys(t).length,n=0,o=e.length;n<o;n+=1){for(var i=e[n],a=i.output,s=a.length,c=1,h=0;h<s;h+=1){var l=a[h],u=l.key,f=r?t[u]:1,v=0===l.score&&t&&t[u]>0?Number.EPSILON:l.score;c*=Math.pow(v,f);}i.score=c,this._log(i);}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn);}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var r=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,function(e,t){if("object"===n(t)&&null!==t){if(-1!==r.indexOf(t))return;r.push(t);}return t;},2)),r=null;}var o=[];this.options.includeMatches&&o.push(function(e,t){var r=e.output;t.matches=[];for(var n=0,o=r.length;n<o;n+=1){var i=r[n];if(0!==i.matchedIndices.length){var a={indices:i.matchedIndices,value:i.value};i.key&&(a.key=i.key),i.hasOwnProperty("arrayIndex")&&i.arrayIndex>-1&&(a.arrayIndex=i.arrayIndex),t.matches.push(a);}}}),this.options.includeScore&&o.push(function(e,t){t.score=e.score;});for(var i=0,a=e.length;i<a;i+=1){var s=e[i];if(this.options.id&&(s.item=this.options.getFn(s.item,this.options.id)[0]),o.length){for(var c={item:s.item},h=0,l=o.length;h<l;h+=1)o[h](s,c);t.push(c);}else t.push(s.item);}return t;}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments);}}])&&o(t.prototype,r),e;}();e.exports=h;},function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n);}}var o=r(2),i=r(3),a=r(6),s=function(){function e(t,r){var n=r.location,o=void 0===n?0:n,i=r.distance,s=void 0===i?100:i,c=r.threshold,h=void 0===c?.6:c,l=r.maxPatternLength,u=void 0===l?32:l,f=r.isCaseSensitive,v=void 0!==f&&f,p=r.tokenSeparator,d=void 0===p?/ +/g:p,g=r.findAllMatches,y=void 0!==g&&g,m=r.minMatchCharLength,k=void 0===m?1:m,b=r.includeMatches,S=void 0!==b&&b;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");}(this,e),this.options={location:o,distance:s,threshold:h,maxPatternLength:u,isCaseSensitive:v,tokenSeparator:d,findAllMatches:y,includeMatches:S,minMatchCharLength:k},this.pattern=v?t:t.toLowerCase(),this.pattern.length<=u&&(this.patternAlphabet=a(this.pattern));}var t,r;return t=e,(r=[{key:"search",value:function(e){var t=this.options,r=t.isCaseSensitive,n=t.includeMatches;if(r||(e=e.toLowerCase()),this.pattern===e){var a={isMatch:!0,score:0};return n&&(a.matchedIndices=[[0,e.length-1]]),a;}var s=this.options,c=s.maxPatternLength,h=s.tokenSeparator;if(this.pattern.length>c)return o(e,this.pattern,h);var l=this.options,u=l.location,f=l.distance,v=l.threshold,p=l.findAllMatches,d=l.minMatchCharLength;return i(e,this.pattern,this.patternAlphabet,{location:u,distance:f,threshold:v,findAllMatches:p,minMatchCharLength:d,includeMatches:n});}}])&&n(t.prototype,r),e;}();e.exports=s;},function(e,t){var r=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(r,"\\$&").replace(n,"|")),i=e.match(o),a=!!i,s=[];if(a)for(var c=0,h=i.length;c<h;c+=1){var l=i[c];s.push([e.indexOf(l),l.length-1]);}return{score:a?.5:1,isMatch:a,matchedIndices:s};};},function(e,t,r){var n=r(4),o=r(5);e.exports=function(e,t,r,i){for(var a=i.location,s=void 0===a?0:a,c=i.distance,h=void 0===c?100:c,l=i.threshold,u=void 0===l?.6:l,f=i.findAllMatches,v=void 0!==f&&f,p=i.minMatchCharLength,d=void 0===p?1:p,g=i.includeMatches,y=void 0!==g&&g,m=s,k=e.length,b=u,S=e.indexOf(t,m),x=t.length,M=[],_=0;_<k;_+=1)M[_]=0;if(-1!==S){var w=n(t,{errors:0,currentLocation:S,expectedLocation:m,distance:h});if(b=Math.min(w,b),-1!==(S=e.lastIndexOf(t,m+x))){var L=n(t,{errors:0,currentLocation:S,expectedLocation:m,distance:h});b=Math.min(L,b);}}S=-1;for(var A=[],O=1,C=x+k,j=1<<(x<=31?x-1:30),P=0;P<x;P+=1){for(var I=0,F=C;I<F;){n(t,{errors:P,currentLocation:m+F,expectedLocation:m,distance:h})<=b?I=F:C=F,F=Math.floor((C-I)/2+I);}C=F;var T=Math.max(1,m-F+1),N=v?k:Math.min(m+F,k)+x,z=Array(N+2);z[N+1]=(1<<P)-1;for(var E=N;E>=T;E-=1){var W=E-1,K=r[e.charAt(W)];if(K&&(M[W]=1),z[E]=(z[E+1]<<1|1)&K,0!==P&&(z[E]|=(A[E+1]|A[E])<<1|1|A[E+1]),z[E]&j&&(O=n(t,{errors:P,currentLocation:W,expectedLocation:m,distance:h}))<=b){if(b=O,(S=W)<=m)break;T=Math.max(1,2*m-S);}}if(n(t,{errors:P+1,currentLocation:m,expectedLocation:m,distance:h})>b)break;A=z;}var $={isMatch:S>=0,score:0===O?.001:O};return y&&($.matchedIndices=o(M,d)),$;};},function(e,t){e.exports=function(e,t){var r=t.errors,n=void 0===r?0:r,o=t.currentLocation,i=void 0===o?0:o,a=t.expectedLocation,s=void 0===a?0:a,c=t.distance,h=void 0===c?100:c,l=n/e.length,u=Math.abs(s-i);return h?l+u/h:u?1:l;};},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=-1,o=-1,i=0,a=e.length;i<a;i+=1){var s=e[i];s&&-1===n?n=i:s||-1===n||((o=i-1)-n+1>=t&&r.push([n,o]),n=-1);}return e[i-1]&&i-n>=t&&r.push([n,i-1]),r;};},function(e,t){e.exports=function(e){for(var t={},r=e.length,n=0;n<r;n+=1)t[e.charAt(n)]=0;for(var o=0;o<r;o+=1)t[e.charAt(o)]|=1<<r-o-1;return t;};},function(e,t){var r=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e);},n=function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t;}(e);},o=function(e){return"string"==typeof e;},i=function(e){return"number"==typeof e;};e.exports={get:function(e,t){var a=[];return function e(t,s){if(s){var c=s.indexOf("."),h=s,l=null;-1!==c&&(h=s.slice(0,c),l=s.slice(c+1));var u=t[h];if(null!=u)if(l||!o(u)&&!i(u)){if(r(u))for(var f=0,v=u.length;f<v;f+=1)e(u[f],l);else l&&e(u,l);}else a.push(n(u));}else a.push(t);}(e,t),a;},isArray:r,isString:o,isNum:i,toString:n};}]);});})(fuse);var Fuse=/*@__PURE__*/getDefaultExportFromCjs(fuse.exports);function isCloseType(x){return!!(x&&x.closeMenu);}function isClearType(x){return!!(x&&x.clearLastViewed);}function isExpandType(x){return!!(x&&x.showAll);}function isSearchResult(x){return!!(x&&x.item);}const{document:document$3}=window_1;const DEFAULT_MAX_SEARCH_RESULTS=50;const options={shouldSort:true,tokenize:true,findAllMatches:true,includeScore:true,includeMatches:true,threshold:0.2,location:0,distance:100,maxPatternLength:32,minMatchCharLength:1,keys:[{name:'name',weight:0.7},{name:'path',weight:0.3}]};const ScreenReaderLabel=theming.styled.label({position:'absolute',left:-10000,top:'auto',width:1,height:1,overflow:'hidden'});const SearchIcon=theming.styled(components.Icons)(({theme})=>({width:12,height:12,position:'absolute',top:8,left:10,zIndex:1,pointerEvents:'none',color:theme.textMutedColor}));const SearchField=theming.styled.div(({theme})=>({display:'flex',flexDirection:'column',position:'relative','&:focus-within svg':{color:theme.color.defaultText}}));const Input$1=theming.styled.input(({theme})=>({appearance:'none',height:28,paddingLeft:28,paddingRight:28,border:`1px solid ${curriedTransparentize$1(0.6,theme.color.mediumdark)}`,background:'transparent',borderRadius:28,fontSize:`${theme.typography.size.s1}px`,fontFamily:'inherit',transition:'all 150ms',color:theme.color.defaultText,'&:focus, &:active':{outline:0,borderColor:theme.color.secondary,background:theme.background.app},'&::placeholder':{color:theme.textMutedColor},'&:valid ~ code, &:focus ~ code':{display:'none'},'&:invalid ~ svg':{display:'none'},'&:valid ~ svg':{display:'block'},'&::-ms-clear':{display:'none'},'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration':{display:'none'}}));const FocusKey=theming.styled.code(({theme})=>({position:'absolute',top:6,right:12,width:16,height:16,zIndex:1,lineHeight:'17px',textAlign:'center',fontSize:'11px',background:'rgba(0,0,0,0.1)',color:theme.textMutedColor,borderRadius:2,userSelect:'none',pointerEvents:'none'}));const ClearIcon=theming.styled(components.Icons)(({theme})=>({width:16,height:16,padding:4,position:'absolute',top:6,right:8,zIndex:1,background:'rgba(0,0,0,0.1)',borderRadius:16,color:theme.color.defaultText,cursor:'pointer'}));const FocusContainer=theming.styled.div({outline:0});const Search=React__default$1["default"].memo(({children,dataset,isLoading=false,enableShortcuts=true,getLastViewed,clearLastViewed,initialQuery=''})=>{const api$1=api.useStorybookApi();const inputRef=React$2.useRef(null);const[inputPlaceholder,setPlaceholder]=React$2.useState('Find components');const[allComponents,showAllComponents]=React$2.useState(false);const selectStory=React$2.useCallback((id,refId)=>{if(api$1)api$1.selectStory(id,undefined,{ref:refId!==DEFAULT_REF_ID&&refId});inputRef.current.blur();showAllComponents(false);},[api$1,inputRef,showAllComponents,DEFAULT_REF_ID]);const list=React$2.useMemo(()=>{return dataset.entries.reduce((acc,[refId,{stories}])=>{if(stories){acc.push(...Object.values(stories).map(item=>searchItem(item,dataset.hash[refId])));}return acc;},[]);},[dataset]);const fuse=React$2.useMemo(()=>new Fuse(list,options),[list]);const getResults=React$2.useCallback(input=>{if(!input)return[];let results=[];const resultIds=new Set();const distinctResults=fuse.search(input).filter(({item})=>{if(!(item.isComponent||item.isLeaf)||resultIds.has(item.parent))return false;resultIds.add(item.id);return true;});if(distinctResults.length){results=distinctResults.slice(0,allComponents?1000:DEFAULT_MAX_SEARCH_RESULTS);if(distinctResults.length>DEFAULT_MAX_SEARCH_RESULTS&&!allComponents){results.push({showAll:()=>showAllComponents(true),totalCount:distinctResults.length,moreCount:distinctResults.length-DEFAULT_MAX_SEARCH_RESULTS});}}return results;},[allComponents,fuse]);const stateReducer=React$2.useCallback((state,changes)=>{switch(changes.type){case Downshift$1.stateChangeTypes.blurInput:{return Object.assign(Object.assign({},changes),{// Prevent clearing the input on blur
inputValue:state.inputValue,// Return to the tree view after selecting an item
isOpen:state.inputValue&&!state.selectedItem,selectedItem:null});}case Downshift$1.stateChangeTypes.mouseUp:{// Prevent clearing the input on refocus
return{};}case Downshift$1.stateChangeTypes.keyDownEscape:{if(state.inputValue){// Clear the inputValue, but don't return to the tree view
return Object.assign(Object.assign({},changes),{inputValue:'',isOpen:true,selectedItem:null});}// When pressing escape a second time, blur the input and return to the tree view
inputRef.current.blur();return Object.assign(Object.assign({},changes),{isOpen:false,selectedItem:null});}case Downshift$1.stateChangeTypes.clickItem:case Downshift$1.stateChangeTypes.keyDownEnter:{if(isSearchResult(changes.selectedItem)){const{id,refId}=changes.selectedItem.item;selectStory(id,refId);// Return to the tree view, but keep the input value
return Object.assign(Object.assign({},changes),{inputValue:state.inputValue,isOpen:false});}if(isExpandType(changes.selectedItem)){changes.selectedItem.showAll();// Downshift should completely ignore this
return{};}if(isClearType(changes.selectedItem)){changes.selectedItem.clearLastViewed();inputRef.current.blur();// Nothing to see anymore, so return to the tree view
return{isOpen:false};}if(isCloseType(changes.selectedItem)){inputRef.current.blur();// Return to the tree view
return{isOpen:false};}return changes;}case Downshift$1.stateChangeTypes.changeInput:{// Reset the "show more" state whenever the input changes
showAllComponents(false);return changes;}default:return changes;}},[inputRef,selectStory,showAllComponents]);return React__default$1["default"].createElement(Downshift$1,{initialInputValue:initialQuery,stateReducer:stateReducer,// @ts-ignore
itemToString:result=>{var _a;return((_a=result===null||result===void 0?void 0:result.item)===null||_a===void 0?void 0:_a.name)||'';}},({isOpen,openMenu,closeMenu,inputValue,clearSelection,getInputProps,getItemProps,getLabelProps,getMenuProps,getRootProps,highlightedIndex})=>{const input=inputValue?inputValue.trim():'';let results=input?getResults(input):[];const lastViewed=!input&&getLastViewed();if(lastViewed&&lastViewed.length){results=lastViewed.reduce((acc,{storyId,refId})=>{const data=dataset.hash[refId];if(data&&data.stories&&data.stories[storyId]){const story=data.stories[storyId];const item=story.isLeaf&&!story.isComponent&&!story.isRoot?data.stories[story.parent]:story;// prevent duplicates
if(!acc.some(res=>res.item.refId===refId&&res.item.id===item.id)){acc.push({item:searchItem(item,dataset.hash[refId]),matches:[],score:0});}}return acc;},[]);results.push({closeMenu});if(results.length>0){results.push({clearLastViewed});}}const inputProps=getInputProps({id:'storybook-explorer-searchfield',ref:inputRef,required:true,type:'search',placeholder:inputPlaceholder,onFocus:()=>{openMenu();setPlaceholder('Type to find...');},onBlur:()=>setPlaceholder('Find components')});return React__default$1["default"].createElement(React__default$1["default"].Fragment,null,React__default$1["default"].createElement(ScreenReaderLabel,Object.assign({},getLabelProps()),"Search for components"),React__default$1["default"].createElement(SearchField,Object.assign({},getRootProps({refKey:''},{suppressRefError:true}),{className:"search-field"}),React__default$1["default"].createElement(SearchIcon,{icon:"search"}),React__default$1["default"].createElement(Input$1,Object.assign({},inputProps)),enableShortcuts&&React__default$1["default"].createElement(FocusKey,null,"/"),React__default$1["default"].createElement(ClearIcon,{icon:"cross",onClick:()=>clearSelection()})),React__default$1["default"].createElement(FocusContainer,{tabIndex:0,id:"storybook-explorer-menu"},children({query:input,results,isBrowsing:!isOpen&&document$3.activeElement!==inputRef.current,closeMenu,getMenuProps,getItemProps,highlightedIndex})));});});const{document:document$2,DOCS_MODE:DOCS_MODE$2}=window_1;const ResultsList=theming.styled.ol({listStyle:'none',margin:0,marginLeft:-20,marginRight:-20,padding:0});const ResultRow=theming.styled.li(({theme,isHighlighted})=>({display:'block',margin:0,padding:0,background:isHighlighted?theme.background.hoverable:'transparent',cursor:'pointer','a:hover, button:hover':{background:'transparent'}}));const NoResults=theming.styled.div(({theme})=>({marginTop:20,textAlign:'center',fontSize:`${theme.typography.size.s2-1}px`,lineHeight:`18px`,color:theme.color.defaultText,small:{color:theme.barTextColor,fontSize:`${theme.typography.size.s1}px`}}));const Mark=theming.styled.mark(({theme})=>({background:'transparent',color:theme.color.secondary}));const ActionRow=theming.styled(ResultRow)({display:'flex',padding:'6px 19px',alignItems:'center'});const BackActionRow=theming.styled(ActionRow)({marginTop:8});const ActionLabel=theming.styled.span(({theme})=>({flexGrow:1,color:theme.color.mediumdark,fontSize:`${theme.typography.size.s1}px`}));const ActionIcon=theming.styled(components.Icons)(({theme})=>({display:'inline-block',width:10,height:10,marginRight:6,color:theme.color.mediumdark}));const ActionKey=theming.styled.code(({theme})=>({minWidth:16,height:16,lineHeight:'17px',textAlign:'center',fontSize:'11px',background:'rgba(0,0,0,0.1)',color:theme.textMutedColor,borderRadius:2,userSelect:'none',pointerEvents:'none'}));const Highlight=React__default$1["default"].memo(({children,match})=>{if(!match)return React__default$1["default"].createElement(React__default$1["default"].Fragment,null,children);const{value,indices}=match;const{nodes:result}=indices.reduce(({cursor,nodes},[start,end],index,{length})=>{/* eslint-disable react/no-array-index-key */nodes.push(React__default$1["default"].createElement("span",{key:`${index}-0`},value.slice(cursor,start)));nodes.push(React__default$1["default"].createElement(Mark,{key:`${index}-1`},value.slice(start,end+1)));if(index===length-1){nodes.push(React__default$1["default"].createElement("span",{key:`${index}-2`},value.slice(end+1)));}/* eslint-enable react/no-array-index-key */return{cursor:end+1,nodes};},{cursor:0,nodes:[]});return React__default$1["default"].createElement(React__default$1["default"].Fragment,null,result);});const Result=React__default$1["default"].memo(_a=>{var{item,matches,icon,onClick}=_a,props=__rest(_a,["item","matches","icon","onClick"]);const click=React$2.useCallback(event=>{event.preventDefault();onClick(event);},[onClick]);const nameMatch=matches.find(match=>match.key==='name');const pathMatches=matches.filter(match=>match.key==='path');const label=React__default$1["default"].createElement("div",{className:"search-result-item--label"},React__default$1["default"].createElement("strong",null,React__default$1["default"].createElement(Highlight,{match:nameMatch},item.name)),React__default$1["default"].createElement(Path,null,item.path.map((group,index)=>// eslint-disable-next-line react/no-array-index-key
React__default$1["default"].createElement("span",{key:index},React__default$1["default"].createElement(Highlight,{match:pathMatches.find(match=>match.arrayIndex===index)},group)))));const title=`${item.path.join(' / ')} / ${item.name}`;if(DOCS_MODE$2){return React__default$1["default"].createElement(ResultRow,Object.assign({},props),React__default$1["default"].createElement(DocumentNode,{depth:0,onClick:click,href:getLink(item.id,item.refId),title:title},label));}const TreeNode=item.isComponent?ComponentNode:StoryNode;return React__default$1["default"].createElement(ResultRow,Object.assign({},props),React__default$1["default"].createElement(TreeNode,{isExpanded:false,depth:0,onClick:onClick,title:title},label));});const SearchResults=React__default$1["default"].memo(({query,results,closeMenu,getMenuProps,getItemProps,highlightedIndex,isLoading=false,enableShortcuts=true})=>{React$2.useEffect(()=>{const handleEscape=event=>{if(!enableShortcuts||isLoading||event.repeat)return;if(matchesModifiers(false,event)&&matchesKeyCode('Escape',event)){const target=event.target;if((target===null||target===void 0?void 0:target.id)==='storybook-explorer-searchfield')return;// handled by downshift
event.preventDefault();closeMenu();}};document$2.addEventListener('keydown',handleEscape);return()=>document$2.removeEventListener('keydown',handleEscape);},[enableShortcuts,isLoading]);return React__default$1["default"].createElement(ResultsList,Object.assign({},getMenuProps()),results.length>0&&!query&&React__default$1["default"].createElement("li",null,React__default$1["default"].createElement(RootNode,{className:"search-result-recentlyOpened"},"Recently opened")),results.length===0&&query&&React__default$1["default"].createElement("li",null,React__default$1["default"].createElement(NoResults,null,React__default$1["default"].createElement("strong",null,"No components found"),React__default$1["default"].createElement("br",null),React__default$1["default"].createElement("small",null,"Find components by name or path."))),results.map((result,index)=>{if(isCloseType(result)){return React__default$1["default"].createElement(BackActionRow,Object.assign({},result,getItemProps({key:index,index,item:result}),{isHighlighted:highlightedIndex===index,className:"search-result-back"}),React__default$1["default"].createElement(ActionIcon,{icon:"arrowleft"}),React__default$1["default"].createElement(ActionLabel,null,"Back to components"),React__default$1["default"].createElement(ActionKey,null,"ESC"));}if(isClearType(result)){return React__default$1["default"].createElement(ActionRow,Object.assign({},result,getItemProps({key:index,index,item:result}),{isHighlighted:highlightedIndex===index,className:"search-result-clearHistory"}),React__default$1["default"].createElement(ActionIcon,{icon:"trash"}),React__default$1["default"].createElement(ActionLabel,null,"Clear history"));}if(isExpandType(result)){return React__default$1["default"].createElement(ActionRow,Object.assign({},result,getItemProps({key:index,index,item:result}),{isHighlighted:highlightedIndex===index,className:"search-result-more"}),React__default$1["default"].createElement(ActionIcon,{icon:"plus"}),React__default$1["default"].createElement(ActionLabel,null,"Show ",result.moreCount," more results"));}const{item}=result;const key=`${item.refId}::${item.id}`;return React__default$1["default"].createElement(Result,Object.assign({},result,getItemProps({key,index,item:result}),{isHighlighted:highlightedIndex===index,className:"search-result-item"}));}));});const save=debounce_1(value=>store.set('lastViewedStoryIds',value),1000);const useLastViewed=selection=>{const initialLastViewedStoryIds=React$2.useMemo(()=>{const items=store.get('lastViewedStoryIds');if(!items||!Array.isArray(items))return[];if(!items.some(item=>typeof item==='object'&&item.storyId&&item.refId))return[];return items;},[store]);const lastViewedRef=React$2.useRef(initialLastViewedStoryIds);const updateLastViewed=React$2.useCallback(story=>{const items=lastViewedRef.current;const index=items.findIndex(({storyId,refId})=>storyId===story.storyId&&refId===story.refId);if(index===0)return;if(index===-1){lastViewedRef.current=[story,...items];}else{lastViewedRef.current=[story,...items.slice(0,index),...items.slice(index+1)];}save(lastViewedRef.current);},[lastViewedRef]);React$2.useEffect(()=>{if(selection)updateLastViewed(selection);},[selection]);return{getLastViewed:React$2.useCallback(()=>lastViewedRef.current,[lastViewedRef]),clearLastViewed:React$2.useCallback(()=>{lastViewedRef.current=lastViewedRef.current.slice(0,1);save(lastViewedRef.current);},[lastViewedRef])};};const{DOCS_MODE:DOCS_MODE$1}=window_1;const Container$3=theming.styled.nav({position:'absolute',zIndex:1,left:0,top:0,bottom:0,right:0,width:'100%',height:'100%'});const StyledSpaced=theming.styled(components.Spaced)({paddingBottom:'2.5rem'});const CustomScrollArea=theming.styled(components.ScrollArea)({'&&&&& .os-scrollbar-handle:before':{left:-12},'&&&&& .os-scrollbar-vertical':{right:5},padding:20});const Swap=React__default$1["default"].memo(({children,condition})=>{const[a,b]=React__default$1["default"].Children.toArray(children);return React__default$1["default"].createElement(React__default$1["default"].Fragment,null,React__default$1["default"].createElement("div",{style:{display:condition?'block':'none'}},a),React__default$1["default"].createElement("div",{style:{display:condition?'none':'block'}},b));});const useCombination=(stories,ready,error,refs)=>{const hash=React$2.useMemo(()=>Object.assign({[DEFAULT_REF_ID]:{stories,title:null,id:DEFAULT_REF_ID,url:'iframe.html',ready,error}},refs),[refs,stories]);return React$2.useMemo(()=>({hash,entries:Object.entries(hash)}),[hash]);};const Sidebar$1=React__default$1["default"].memo(({storyId=null,refId=DEFAULT_REF_ID,stories:storiesHash,storiesConfigured,storiesFailed,menu,menuHighlighted=false,enableShortcuts=true,refs={}})=>{const collapseFn=DOCS_MODE$1?collapseAllStories:collapseDocsOnlyStories;const selected=React$2.useMemo(()=>storyId&&{storyId,refId},[storyId,refId]);const stories=React$2.useMemo(()=>collapseFn(storiesHash),[DOCS_MODE$1,storiesHash]);const adaptedRefs=React$2.useMemo(()=>{return Object.entries(refs).reduce((acc,[id,ref])=>{if(ref.stories){acc[id]=Object.assign(Object.assign({},ref),{stories:collapseFn(ref.stories)});}else{acc[id]=ref;}return acc;},{});},[DOCS_MODE$1,refs]);const dataset=useCombination(stories,storiesConfigured,storiesFailed,adaptedRefs);const isLoading=!dataset.hash[DEFAULT_REF_ID].ready;const lastViewedProps=useLastViewed(selected);return React__default$1["default"].createElement(Container$3,{className:"container sidebar-container"},React__default$1["default"].createElement(CustomScrollArea,{vertical:true},React__default$1["default"].createElement(StyledSpaced,{row:1.6},React__default$1["default"].createElement(Heading,{className:"sidebar-header",menuHighlighted:menuHighlighted,menu:menu,skipLinkHref:"#storybook-preview-wrapper"}),React__default$1["default"].createElement(Search,Object.assign({dataset:dataset,isLoading:isLoading,enableShortcuts:enableShortcuts},lastViewedProps),({query,results,isBrowsing,closeMenu,getMenuProps,getItemProps,highlightedIndex})=>React__default$1["default"].createElement(Swap,{condition:isBrowsing},React__default$1["default"].createElement(Explorer,{dataset:dataset,selected:selected,isLoading:isLoading,isBrowsing:isBrowsing}),React__default$1["default"].createElement(SearchResults,{query:query,results:results,closeMenu:closeMenu,getMenuProps:getMenuProps,getItemProps:getItemProps,highlightedIndex:highlightedIndex,enableShortcuts:enableShortcuts,isLoading:isLoading}))))));});const focusableUIElements={storySearchField:'storybook-explorer-searchfield',storyListMenu:'storybook-explorer-menu',storyPanelRoot:'storybook-panel-root'};const Key=theming.styled.code(({theme})=>({width:16,height:16,lineHeight:'17px',textAlign:'center',fontSize:'11px',background:'rgba(0,0,0,0.07)',color:theme.color.defaultText,borderRadius:2,userSelect:'none',pointerEvents:'none','& + &':{marginLeft:2}}));const Shortcut=({keys})=>React__default$1["default"].createElement(React__default$1["default"].Fragment,null,keys.map((key,index)=>// eslint-disable-next-line react/no-array-index-key
React__default$1["default"].createElement(Key,{key:index},shortcut.shortcutToHumanString([key]))));const useMenu=(api,showToolbar,isFullscreen,showPanel,showNav,enableShortcuts)=>{const theme=theming.useTheme();const shortcutKeys=api.getShortcutKeys();const about=React$2.useMemo(()=>({id:'about',title:'About your Storybook',onClick:()=>api.navigateToSettingsPage('/settings/about'),right:api.versionUpdateAvailable()&&React__default$1["default"].createElement(components.Badge,{status:"positive"},"Update"),left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const releaseNotes=React$2.useMemo(()=>({id:'release-notes',title:'Release notes',onClick:()=>api.navigateToSettingsPage('/settings/release-notes'),left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const shortcuts=React$2.useMemo(()=>({id:'shortcuts',title:'Keyboard shortcuts',onClick:()=>api.navigateToSettingsPage('/settings/shortcuts'),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.shortcutsPage}):null,left:React__default$1["default"].createElement(MenuItemIcon,null),style:{borderBottom:`4px solid ${theme.appBorderColor}`}}),[api,enableShortcuts,shortcutKeys]);const sidebarToggle=React$2.useMemo(()=>({id:'S',title:'Show sidebar',onClick:()=>api.toggleNav(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.toggleNav}):null,left:showNav?React__default$1["default"].createElement(MenuItemIcon,{icon:"check"}):React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys,showNav]);const toolbarToogle=React$2.useMemo(()=>({id:'T',title:'Show toolbar',onClick:()=>api.toggleToolbar(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.toolbar}):null,left:showToolbar?React__default$1["default"].createElement(MenuItemIcon,{icon:"check"}):React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys,showToolbar]);const addonsToggle=React$2.useMemo(()=>({id:'A',title:'Show addons',onClick:()=>api.togglePanel(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.togglePanel}):null,left:showPanel?React__default$1["default"].createElement(MenuItemIcon,{icon:"check"}):React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys,showPanel]);const addonsOrientationToggle=React$2.useMemo(()=>({id:'D',title:'Change addons orientation',onClick:()=>api.togglePanelPosition(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.panelPosition}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const fullscreenToggle=React$2.useMemo(()=>({id:'F',title:'Go full screen',onClick:()=>api.toggleFullscreen(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.fullScreen}):null,left:isFullscreen?'check':React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys,isFullscreen]);const searchToggle=React$2.useMemo(()=>({id:'/',title:'Search',onClick:()=>api.focusOnUIElement(focusableUIElements.storySearchField),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.search}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const up=React$2.useMemo(()=>({id:'up',title:'Previous component',onClick:()=>api.jumpToComponent(-1),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.prevComponent}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const down=React$2.useMemo(()=>({id:'down',title:'Next component',onClick:()=>api.jumpToComponent(1),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.nextComponent}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const prev=React$2.useMemo(()=>({id:'prev',title:'Previous story',onClick:()=>api.jumpToStory(-1),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.prevStory}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const next=React$2.useMemo(()=>({id:'next',title:'Next story',onClick:()=>api.jumpToStory(1),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.nextStory}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const collapse=React$2.useMemo(()=>({id:'collapse',title:'Collapse all',onClick:()=>api.collapseAll(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:shortcutKeys.collapseAll}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}),[api,enableShortcuts,shortcutKeys]);const getAddonsShortcuts=()=>{const addonsShortcuts=api.getAddonsShortcuts();const keys=shortcutKeys;return Object.entries(addonsShortcuts).filter(([actionName,{showInMenu}])=>showInMenu).map(([actionName,{label,action}])=>({id:actionName,title:label,onClick:()=>action(),right:enableShortcuts?React__default$1["default"].createElement(Shortcut,{keys:keys[actionName]}):null,left:React__default$1["default"].createElement(MenuItemIcon,null)}));};return React$2.useMemo(()=>[about,...(api.releaseNotesVersion()?[releaseNotes]:[]),shortcuts,sidebarToggle,toolbarToogle,addonsToggle,addonsOrientationToggle,fullscreenToggle,searchToggle,up,down,prev,next,collapse,...getAddonsShortcuts()],[about,...(api.releaseNotesVersion()?[releaseNotes]:[]),shortcuts,sidebarToggle,toolbarToogle,addonsToggle,addonsOrientationToggle,fullscreenToggle,searchToggle,up,down,prev,next,collapse]);};const Sidebar=React__default$1["default"].memo(()=>{const mapper=({state,api})=>{const{ui:{name,url,enableShortcuts},viewMode,storyId,refId,layout:{showToolbar,isFullscreen,showPanel,showNav},storiesHash,storiesConfigured,storiesFailed,refs}=state;const menu=useMenu(api,showToolbar,isFullscreen,showPanel,showNav,enableShortcuts);return{title:name,url,stories:storiesHash,storiesFailed,storiesConfigured,refs,storyId,refId,viewMode,menu,menuHighlighted:api.versionUpdateAvailable(),enableShortcuts};};return React__default$1["default"].createElement(api.Consumer,{filter:mapper},fromState=>{return React__default$1["default"].createElement(Sidebar$1,Object.assign({},fromState));});});const FrameWrap=theming.styled.div(({offset})=>({position:'absolute',overflow:'auto',left:0,right:0,bottom:0,top:offset,zIndex:3,transition:'all 0.1s linear',height:`calc(100% - ${offset}px)`,background:'transparent'}));const UnstyledLink=theming.styled(router.Link)({color:'inherit',textDecoration:'inherit',display:'inline-block'});theming.styled.span({// Hides full screen icon at mobile breakpoint defined in app.js
'@media (max-width: 599px)':{display:'none'}});const IframeWrapper=theming.styled.div(({theme})=>({position:'absolute',top:0,left:0,bottom:0,right:0,width:'100%',height:'100%',background:theme.background.content}));const LoaderWrapper$1=theming.styled.div(({theme})=>({position:'absolute',top:0,left:0,bottom:0,right:0,background:theme.background.content,zIndex:1}));const initialZoom=1;const Context=React__default$1["default"].createContext({value:initialZoom,set:v=>{}});class ZoomProvider extends React$2.Component{constructor(){super(...arguments);this.state={value:initialZoom};this.set=value=>this.setState({value});}render(){const{children,shouldScale}=this.props;const{set}=this;const{value}=this.state;return React__default$1["default"].createElement(Context.Provider,{value:{value:shouldScale?value:initialZoom,set}},children);}}const{Consumer:ZoomConsumer}=Context;const Zoom=React__default$1["default"].memo(({zoomIn,zoomOut,reset})=>React__default$1["default"].createElement(React__default$1["default"].Fragment,null,React__default$1["default"].createElement(components.IconButton,{key:"zoomin",onClick:zoomIn,title:"Zoom in"},React__default$1["default"].createElement(components.Icons,{icon:"zoom"})),React__default$1["default"].createElement(components.IconButton,{key:"zoomout",onClick:zoomOut,title:"Zoom out"},React__default$1["default"].createElement(components.Icons,{icon:"zoomout"})),React__default$1["default"].createElement(components.IconButton,{key:"zoomreset",onClick:reset,title:"Reset zoom"},React__default$1["default"].createElement(components.Icons,{icon:"zoomreset"}))));const ZoomWrapper=React__default$1["default"].memo(({set,value})=>{const zoomIn=React$2.useCallback(e=>{e.preventDefault();set(0.8*value);},[set,value]);const zoomOut=React$2.useCallback(e=>{e.preventDefault();set(1.25*value);},[set,value]);const reset=React$2.useCallback(e=>{e.preventDefault();set(initialZoom);},[set,initialZoom]);return React__default$1["default"].createElement(Zoom,Object.assign({key:"zoom"},{zoomIn,zoomOut,reset}));});const zoomTool={title:'zoom',id:'zoom',match:({viewMode})=>viewMode==='story',render:React__default$1["default"].memo(()=>React__default$1["default"].createElement(React__default$1["default"].Fragment,null,React__default$1["default"].createElement(ZoomConsumer,null,({set,value})=>React__default$1["default"].createElement(ZoomWrapper,Object.assign({},{set,value}))),React__default$1["default"].createElement(components.Separator,null)))};const ApplyWrappers=({wrappers,id,storyId,active,children})=>{return React__default$1["default"].createElement(React$2.Fragment,null,wrappers.reduceRight((acc,wrapper,index)=>wrapper.render({index,children:acc,id,storyId,active}),children));};const defaultWrappers=[{render:p=>React__default$1["default"].createElement(IframeWrapper,{id:"storybook-preview-wrapper",hidden:!p.active},p.children)}];var toggleSelection=function(){var selection=document.getSelection();if(!selection.rangeCount){return function(){};}var active=document.activeElement;var ranges=[];for(var i=0;i<selection.rangeCount;i++){ranges.push(selection.getRangeAt(i));}switch(active.tagName.toUpperCase()){// .toUpperCase handles XHTML
case'INPUT':case'TEXTAREA':active.blur();break;default:active=null;break;}selection.removeAllRanges();return function(){selection.type==='Caret'&&selection.removeAllRanges();if(!selection.rangeCount){ranges.forEach(function(range){selection.addRange(range);});}active&&active.focus();};};var deselectCurrent=toggleSelection;var clipboardToIE11Formatting={"text/plain":"Text","text/html":"Url","default":"Text"};var defaultMessage="Copy to clipboard: #{key}, Enter";function format(message){var copyKey=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return message.replace(/#{\s*key\s*}/g,copyKey);}function copy(text,options){var debug,message,reselectPrevious,range,selection,mark,success=false;if(!options){options={};}debug=options.debug||false;try{reselectPrevious=deselectCurrent();range=document.createRange();selection=document.getSelection();mark=document.createElement("span");mark.textContent=text;// reset user styles for span element
mark.style.all="unset";// prevents scrolling to the end of the page
mark.style.position="fixed";mark.style.top=0;mark.style.clip="rect(0, 0, 0, 0)";// used to preserve spaces and line breaks
mark.style.whiteSpace="pre";// do not inherit user-select (it may be `none`)
mark.style.webkitUserSelect="text";mark.style.MozUserSelect="text";mark.style.msUserSelect="text";mark.style.userSelect="text";mark.addEventListener("copy",function(e){e.stopPropagation();if(options.format){e.preventDefault();if(typeof e.clipboardData==="undefined"){// IE 11
debug&&console.warn("unable to use e.clipboardData");debug&&console.warn("trying IE specific stuff");window.clipboardData.clearData();var format=clipboardToIE11Formatting[options.format]||clipboardToIE11Formatting["default"];window.clipboardData.setData(format,text);}else{// all other browsers
e.clipboardData.clearData();e.clipboardData.setData(options.format,text);}}if(options.onCopy){e.preventDefault();options.onCopy(e.clipboardData);}});document.body.appendChild(mark);range.selectNodeContents(mark);selection.addRange(range);var successful=document.execCommand("copy");if(!successful){throw new Error("copy command was unsuccessful");}success=true;}catch(err){debug&&console.error("unable to copy using execCommand: ",err);debug&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(options.format||"text",text);options.onCopy&&options.onCopy(window.clipboardData);success=true;}catch(err){debug&&console.error("unable to copy using clipboardData: ",err);debug&&console.error("falling back to prompt");message=format("message"in options?options.message:defaultMessage);window.prompt(message,text);}}finally{if(selection){if(typeof selection.removeRange=="function"){selection.removeRange(range);}else{selection.removeAllRanges();}}if(mark){document.body.removeChild(mark);}reselectPrevious();}return success;}var copyToClipboard=copy;const{PREVIEW_URL:PREVIEW_URL$2}=window_1;const copyMapper=({state})=>{const{storyId,refId,refs}=state;const ref=refs[refId];return{refId,baseUrl:ref?`${ref.url}/iframe.html`:PREVIEW_URL$2||'iframe.html',storyId,queryParams:state.customQueryParams};};const copyTool={title:'copy',id:'copy',match:({viewMode})=>viewMode==='story',render:()=>React__default$1["default"].createElement(api.Consumer,{filter:copyMapper},({baseUrl,storyId,queryParams})=>storyId?React__default$1["default"].createElement(components.IconButton,{key:"copy",onClick:()=>copyToClipboard(components.getStoryHref(baseUrl,storyId,queryParams)),title:"Copy canvas link"},React__default$1["default"].createElement(components.Icons,{icon:"link"})):null)};const{PREVIEW_URL:PREVIEW_URL$1}=window_1;const ejectMapper=({state})=>{const{storyId,refId,refs}=state;const ref=refs[refId];return{refId,baseUrl:ref?`${ref.url}/iframe.html`:PREVIEW_URL$1||'iframe.html',storyId,queryParams:state.customQueryParams};};const ejectTool={title:'eject',id:'eject',match:({viewMode})=>viewMode==='story',render:()=>React__default$1["default"].createElement(api.Consumer,{filter:ejectMapper},({baseUrl,storyId,queryParams})=>storyId?React__default$1["default"].createElement(components.IconButton,{key:"opener",href:components.getStoryHref(baseUrl,storyId,queryParams),target:"_blank",title:"Open canvas in new tab"},React__default$1["default"].createElement(components.Icons,{icon:"sharealt"})):null)};const menuMapper$2=({api,state})=>({isVisible:state.layout.showNav,singleStory:state.singleStory,toggle:()=>api.toggleNav()});const menuTool={title:'menu',id:'menu',match:({viewMode})=>viewMode==='story',render:()=>React__default$1["default"].createElement(api.Consumer,{filter:menuMapper$2},({isVisible,toggle,singleStory})=>!singleStory&&!isVisible&&React__default$1["default"].createElement(React__default$1["default"].Fragment,null,React__default$1["default"].createElement(components.IconButton,{"aria-label":"Show sidebar",key:"menu",onClick:toggle,title:"Show sidebar"},React__default$1["default"].createElement(components.Icons,{icon:"menu"})),React__default$1["default"].createElement(components.Separator,null)))};const menuMapper$1=({api,state})=>({isVisible:state.layout.showPanel,singleStory:state.singleStory,panelPosition:state.layout.panelPosition,toggle:()=>api.togglePanel()});const addonsTool={title:'addons',id:'addons',match:({viewMode})=>viewMode==='story',render:()=>React__default$1["default"].createElement(api.Consumer,{filter:menuMapper$1},({isVisible,toggle,singleStory,panelPosition})=>!singleStory&&!isVisible&&React__default$1["default"].createElement(React__default$1["default"].Fragment,null,React__default$1["default"].createElement(components.IconButton,{"aria-label":"Show addons",key:"addons",onClick:toggle,title:"Show addons"},React__default$1["default"].createElement(components.Icons,{icon:panelPosition==='bottom'?'bottombar':'sidebaralt'}))))};const StyledAnimatedIconButton=theming.styled(components.IconButton)(({theme,animating,disabled})=>({opacity:disabled?0.5:1,svg:{animation:animating&&`${theme.animation.rotate360} 1000ms ease-out`}}));const menuMapper=({api,state})=>{const{storyId}=state;return{storyId,remount:()=>api.emit(coreEvents.FORCE_REMOUNT,{storyId:state.storyId})};};const remountTool={title:'remount',id:'remount',match:({viewMode})=>viewMode==='story',render:()=>React__default$1["default"].createElement(api.Consumer,{filter:menuMapper},({remount,storyId})=>{const[isAnimating,setIsAnimating]=React$2.useState(false);const animateAndReplay=()=>{if(!storyId)return;setIsAnimating(true);remount();};return React__default$1["default"].createElement(StyledAnimatedIconButton,{key:"remount",title:"Remount component",onClick:animateAndReplay,onAnimationEnd:()=>setIsAnimating(false),animating:isAnimating,disabled:!storyId},React__default$1["default"].createElement(components.Icons,{icon:"sync"}));})};const getTools=getFn=>Object.values(getFn(addons.types.TOOL));const getToolsExtra=getFn=>Object.values(getFn(addons.types.TOOLEXTRA));const Bar=_a=>{var props=__rest(_a,["shown"]);return React__default$1["default"].createElement(components.FlexBar,Object.assign({},props));};const Toolbar=theming.styled(Bar)({position:'absolute',left:0,right:0,top:0,transition:'transform .2s linear'},({shown})=>({transform:shown?'translateY(0px)':'translateY(-40px)'}));const fullScreenMapper=({api,state})=>({toggle:api.toggleFullscreen,value:state.layout.isFullscreen,shortcut:shortcut.shortcutToHumanString(api.getShortcutKeys().fullScreen),hasPanel:Object.keys(api.getPanels()).length>0,singleStory:state.singleStory});const fullScreenTool={title:'fullscreen',id:'fullscreen',match:p=>['story','docs'].includes(p.viewMode),render:()=>React__default$1["default"].createElement(api.Consumer,{filter:fullScreenMapper},({toggle,value,shortcut,hasPanel,singleStory})=>(!singleStory||singleStory&&hasPanel)&&React__default$1["default"].createElement(components.IconButton,{key:"full",onClick:toggle,title:`${value?'Exit full screen':'Go full screen'} [${shortcut}]`},React__default$1["default"].createElement(components.Icons,{icon:value?'close':'expand'})))};const tabsMapper=({state})=>({viewMode:state.docsOnly,storyId:state.storyId,path:state.path,location:state.location,refId:state.refId});const createTabsTool=tabs=>({title:'title',id:'title',render:()=>React__default$1["default"].createElement(api.Consumer,{filter:tabsMapper},rp=>React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(components.TabBar,{key:"tabs"},tabs.filter(p=>!p.hidden).map((t,index)=>{const to=t.route(rp);const isActive=rp.path===to;return React__default$1["default"].createElement(UnstyledLink,{key:t.id||`l${index}`,to:to},React__default$1["default"].createElement(components.TabButton,{disabled:t.disabled,active:isActive},t.title));})),React__default$1["default"].createElement(components.Separator,null)))});const defaultTools=[remountTool,zoomTool];const defaultToolsExtra=[addonsTool,fullScreenTool,ejectTool,copyTool];const useTools=(getElements,tabs,viewMode,story,location,path)=>{const toolsFromConfig=React$2.useMemo(()=>getTools(getElements),[getElements]);const toolsExtraFromConfig=React$2.useMemo(()=>getToolsExtra(getElements),[getElements]);const tools=React$2.useMemo(()=>[...defaultTools,...toolsFromConfig],[defaultTools,toolsFromConfig]);const toolsExtra=React$2.useMemo(()=>[...defaultToolsExtra,...toolsExtraFromConfig],[defaultToolsExtra,toolsExtraFromConfig]);return React$2.useMemo(()=>{return story&&story.parameters?filterTools(tools,toolsExtra,tabs,{viewMode,story,location,path}):{left:tools,right:toolsExtra};},[viewMode,story,location,path,tools,toolsExtra,tabs]);};const ToolRes=React__default$1["default"].memo(({api,story,tabs,isShown,location,path,viewMode})=>{const{left,right}=useTools(api.getElements,tabs,viewMode,story,location,path);return left||right?React__default$1["default"].createElement(Toolbar,{key:"toolbar",shown:isShown,border:true},React__default$1["default"].createElement(Tools,{key:"left",list:left}),React__default$1["default"].createElement(Tools,{key:"right",list:right})):null;});const ToolbarComp=React__default$1["default"].memo(props=>React__default$1["default"].createElement(router.Location,null,({location,path,viewMode})=>React__default$1["default"].createElement(ToolRes,Object.assign({},props,{location,path,viewMode}))));const Tools=React__default$1["default"].memo(({list})=>React__default$1["default"].createElement(React__default$1["default"].Fragment,null,list.filter(Boolean).map((_a,index)=>{var{render:Render,id}=_a,t=__rest(_a,["render","id"]);return(// @ts-ignore
React__default$1["default"].createElement(Render,{key:id||t.key||`f-${index}`}));})));function toolbarItemHasBeenExcluded(item,story){var _a;const toolbarItemsFromStoryParameters='toolbar'in story.parameters?story.parameters.toolbar:undefined;const{toolbar:toolbarItemsFromAddonsConfig}=addons.addons.getConfig();const toolbarItems=api.merge(toolbarItemsFromAddonsConfig,toolbarItemsFromStoryParameters);return toolbarItems?!!((_a=toolbarItems[item.id])===null||_a===void 0?void 0:_a.hidden):false;}function filterTools(tools,toolsExtra,tabs,{viewMode,story,location,path}){const toolsLeft=[menuTool,tabs.filter(p=>!p.hidden).length>=1&&createTabsTool(tabs),...tools];const toolsRight=[...toolsExtra];const filter=item=>item&&(!item.match||item.match({storyId:story.id,refId:story.refId,viewMode,location,path}))&&!toolbarItemHasBeenExcluded(item,story);const left=toolsLeft.filter(filter);const right=toolsRight.filter(filter);return{left,right};}const StyledIframe=theming.styled.iframe({position:'absolute',display:'block',boxSizing:'content-box',height:'100%',width:'100%',border:'0 none',transition:'all .3s, background-position 0s, visibility 0s',backgroundPosition:'-1px -1px, -1px -1px, -1px -1px, -1px -1px'});function IFrame(props){const{active,id,title,src,allowFullScreen,scale}=props,rest=__rest(props,["active","id","title","src","allowFullScreen","scale"]);const iFrameRef=React__default$1["default"].useRef(null);return React__default$1["default"].createElement(components.Zoom.IFrame,{scale:scale,active:active,iFrameRef:iFrameRef},React__default$1["default"].createElement(StyledIframe,Object.assign({"data-is-storybook":active?'true':'false',onLoad:e=>e.currentTarget.setAttribute('data-is-loaded','true'),id:id,title:title,src:src,allowFullScreen:allowFullScreen,ref:iFrameRef},rest)));}const stringifyQueryParams=queryParams=>qs__default["default"].stringify(queryParams,{addQueryPrefix:true,encode:false}).replace(/^\?/,'&');const getActive=refId=>{if(refId){return`storybook-ref-${refId}`;}return'storybook-preview-iframe';};const SkipToSidebarLink=theming.styled(components.Button)(({theme})=>({display:'none','@media (min-width: 600px)':{position:'absolute',display:'block',top:10,right:15,padding:'10px 15px',fontSize:theme.typography.size.s1,transform:'translateY(-100px)','&:focus':{transform:'translateY(0)',zIndex:1}}}));const whenSidebarIsVisible=({state})=>({isFullscreen:state.layout.isFullscreen,showNav:state.layout.showNav,selectedStoryId:state.storyId});const FramesRenderer=({refs,story,scale,viewMode='story',refId,queryParams={},baseUrl,storyId='*'})=>{var _a;const version=(_a=refs[refId])===null||_a===void 0?void 0:_a.version;const stringifiedQueryParams=stringifyQueryParams(Object.assign(Object.assign({},queryParams),version&&{version}));const active=getActive(refId);const styles=React$2.useMemo(()=>{// add #root to make the selector high enough in specificity
return{'#root [data-is-storybook="false"]':{display:'none'},'#root [data-is-storybook="true"]':{display:'block'}};},[]);const[frames,setFrames]=React$2.useState({'storybook-preview-iframe':components.getStoryHref(baseUrl,storyId,Object.assign(Object.assign(Object.assign({},queryParams),version&&{version}),{viewMode}))});React$2.useEffect(()=>{const newFrames=Object.values(refs).filter(r=>{if(r.error){return false;}if(r.type==='auto-inject'){return true;}if(story&&r.id===story.refId){return true;}return false;}).reduce((acc,r)=>{return Object.assign(Object.assign({},acc),{[`storybook-ref-${r.id}`]:`${r.url}/iframe.html?id=${storyId}&viewMode=${viewMode}&refId=${r.id}${stringifiedQueryParams}`});},frames);setFrames(newFrames);},[storyId,story,refs]);return React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(theming.Global,{styles:styles}),React__default$1["default"].createElement(api.Consumer,{filter:whenSidebarIsVisible},({isFullscreen,showNav,selectedStoryId})=>{if(!isFullscreen&&!!showNav&&selectedStoryId){return React__default$1["default"].createElement(SkipToSidebarLink,{secondary:true,isLink:true,tabIndex:0,href:`#${selectedStoryId}`},"Skip to sidebar");}return null;}),Object.entries(frames).map(([id,src])=>React__default$1["default"].createElement(React$2.Fragment,{key:id},React__default$1["default"].createElement(IFrame,{active:id===active,key:refs[id]?refs[id].url:id,id:id,title:id,src:src,allowFullScreen:true,scale:scale}))));};const getWrappers=getFn=>Object.values(getFn(addons.types.PREVIEW));const getTabs=getFn=>Object.values(getFn(addons.types.TAB));const canvasMapper=({state,api})=>({storyId:state.storyId,refId:state.refId,viewMode:state.viewMode,customCanvas:api.renderPreview,queryParams:state.customQueryParams,getElements:api.getElements,story:api.getData(state.storyId,state.refId),storiesConfigured:state.storiesConfigured,storiesFailed:state.storiesFailed,refs:state.refs,active:!!(state.viewMode&&state.viewMode.match(/^(story|docs)$/))});const createCanvas=(id,baseUrl='iframe.html',withLoader=true)=>({id:'canvas',title:'Canvas',route:({storyId,refId})=>refId?`/story/${refId}_${storyId}`:`/story/${storyId}`,match:({viewMode})=>!!(viewMode&&viewMode.match(/^(story|docs)$/)),render:()=>{return React__default$1["default"].createElement(api.Consumer,{filter:canvasMapper},({story,refs,customCanvas,storyId,refId,viewMode,queryParams,getElements,storiesConfigured,storiesFailed,active})=>{const wrappers=React$2.useMemo(()=>[...defaultWrappers,...getWrappers(getElements)],[getElements,...defaultWrappers]);const isLoading=story?!!refs[refId]&&!refs[refId].ready:!storiesFailed&&!storiesConfigured;return React__default$1["default"].createElement(ZoomConsumer,null,({value:scale})=>{return React__default$1["default"].createElement(React__default$1["default"].Fragment,null,withLoader&&isLoading&&React__default$1["default"].createElement(LoaderWrapper$1,null,React__default$1["default"].createElement(components.Loader,{id:"preview-loader",role:"progressbar"})),React__default$1["default"].createElement(ApplyWrappers,{id:id,storyId:storyId,viewMode:viewMode,active:active,wrappers:wrappers},customCanvas?customCanvas(storyId,viewMode,id,baseUrl,scale,queryParams):React__default$1["default"].createElement(FramesRenderer,{baseUrl:baseUrl,refs:refs,scale:scale,story:story,viewMode:viewMode,refId:refId,queryParams:queryParams,storyId:storyId})));});});}});const useTabs=(id,baseUrl,withLoader,getElements,story)=>{const canvas=React$2.useMemo(()=>{return createCanvas(id,baseUrl,withLoader);},[id,baseUrl,withLoader]);const tabsFromConfig=React$2.useMemo(()=>{return getTabs(getElements);},[getElements]);return React$2.useMemo(()=>{if(story===null||story===void 0?void 0:story.parameters){return filterTabs([canvas,...tabsFromConfig],story.parameters);}return[canvas,...tabsFromConfig];},[story,canvas,...tabsFromConfig]);};const Preview=React__default$1["default"].memo(props=>{const{api,id:previewId,options,viewMode,storyId,story=undefined,description,baseUrl,withLoader=true}=props;const{getElements}=api;const tabs=useTabs(previewId,baseUrl,withLoader,getElements,story);const shouldScale=viewMode==='story';const{showToolbar,showTabs=true}=options;const visibleTabsInToolbar=showTabs?tabs:[];const previousStoryId=React$2.useRef(storyId);const previousViewMode=React$2.useRef(viewMode);React$2.useEffect(()=>{if(story&&viewMode){// Don't emit the event on first ("real") render, only when story or mode changes
if(storyId!==previousStoryId.current||viewMode!==previousViewMode.current){previousStoryId.current=storyId;previousViewMode.current=viewMode;if(viewMode.match(/docs|story/)){const{refId,id}=story;api.emit(coreEvents.SET_CURRENT_STORY,{storyId:id,viewMode,options:{target:refId?`storybook-ref-${refId}`:'storybook-preview-iframe'}});}}}},[story,viewMode]);return React__default$1["default"].createElement(React$2.Fragment,null,previewId==='main'&&React__default$1["default"].createElement(W$1,{key:"description"},React__default$1["default"].createElement("title",null,description)),React__default$1["default"].createElement(ZoomProvider,{shouldScale:shouldScale},React__default$1["default"].createElement(ToolbarComp,{key:"tools",story:story,api:api,isShown:showToolbar,tabs:visibleTabsInToolbar}),React__default$1["default"].createElement(FrameWrap,{key:"frame",offset:showToolbar?40:0},tabs.map((_a,i)=>{var{render:Render,match}=_a,t=__rest(_a,["render","match"]);// @ts-ignore
const key=t.id||t.key||i;return React__default$1["default"].createElement(React$2.Fragment,{key:key},React__default$1["default"].createElement(router.Location,null,lp=>React__default$1["default"].createElement(Render,{active:match(lp)})));}))));});function filterTabs(panels,parameters){const{previewTabs}=addons.addons.getConfig();const parametersTabs=parameters?parameters.previewTabs:undefined;if(previewTabs||parametersTabs){// deep merge global and local settings
const tabs=api.merge(previewTabs,parametersTabs);const arrTabs=Object.keys(tabs).map((key,index)=>Object.assign(Object.assign({index},typeof tabs[key]==='string'?{title:tabs[key]}:tabs[key]),{id:key}));return panels.filter(panel=>{const t=arrTabs.find(tab=>tab.id===panel.id);return t===undefined||t.id==='canvas'||!t.hidden;}).map((panel,index)=>Object.assign(Object.assign({},panel),{index})).sort((p1,p2)=>{const tab_1=arrTabs.find(tab=>tab.id===p1.id);// @ts-ignore
const index_1=tab_1?tab_1.index:arrTabs.length+p1.index;const tab_2=arrTabs.find(tab=>tab.id===p2.id);// @ts-ignore
const index_2=tab_2?tab_2.index:arrTabs.length+p2.index;return index_1-index_2;}).map(panel=>{const t=arrTabs.find(tab=>tab.id===panel.id);if(t){return Object.assign(Object.assign({},panel),{title:t.title||panel.title,disabled:t.disabled,hidden:t.hidden});}return panel;});}return panels;}const{PREVIEW_URL}=window_1;const splitTitleAddExtraSpace=input=>input.split('/').join(' / ').replace(/\s\s/,' ');const getDescription=item=>{if(api.isRoot(item)){return item.name?`${item.name} ⋅ Storybook`:'Storybook';}if(api.isGroup(item)){return item.name?`${item.name} ⋅ Storybook`:'Storybook';}if(api.isStory(item)){const{kind,name}=item;return kind&&name?splitTitleAddExtraSpace(`${kind} - ${name} ⋅ Storybook`):'Storybook';}return'Storybook';};const mapper$2=({api,state})=>{const{layout,location,customQueryParams,storyId,refs,viewMode,path,refId}=state;const story=api.getData(storyId,refId);const docsOnly=story&&story.parameters?!!story.parameters.docsOnly:false;return{api,story,options:layout,description:getDescription(story),viewMode,path,refs,storyId,baseUrl:PREVIEW_URL||'iframe.html',queryParams:customQueryParams,docsOnly,location};};const PreviewConnected=React__default$1["default"].memo(props=>React__default$1["default"].createElement(api.Consumer,{filter:mapper$2},fromState=>React__default$1["default"].createElement(Preview,Object.assign({},props,fromState))));const DesktopOnlyIconButton=theming.styled(components.IconButton)({// Hides full screen icon at mobile breakpoint defined in app.js
'@media (max-width: 599px)':{display:'none'}});const SafeTabContent=React__default$1["default"].memo(({children})=>children);class SafeTab extends React$2.Component{constructor(props){super(props);this.state={hasError:false};}componentDidCatch(error,info){this.setState({hasError:true});// eslint-disable-next-line no-console
console.error(error,info);}render(){const{hasError}=this.state;const{children,title,id}=this.props;if(hasError){return React__default$1["default"].createElement("h1",null,"Something went wrong.");}return React__default$1["default"].createElement(SafeTabContent,{id:id,title:title},children);}}const AddonPanel=React__default$1["default"].memo(({panels,shortcuts,actions,selectedPanel=null,panelPosition='right',absolute=true})=>React__default$1["default"].createElement(components.Tabs,{absolute:absolute,selected:selectedPanel,actions:actions,tools:React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(DesktopOnlyIconButton,{key:"position",onClick:actions.togglePosition,title:`Change addon orientation [${shortcut.shortcutToHumanString(shortcuts.panelPosition)}]`},React__default$1["default"].createElement(components.Icons,{icon:panelPosition==='bottom'?'sidebaralt':'bottombar'})),React__default$1["default"].createElement(DesktopOnlyIconButton,{key:"visibility",onClick:actions.toggleVisibility,title:`Hide addons [${shortcut.shortcutToHumanString(shortcuts.togglePanel)}]`},React__default$1["default"].createElement(components.Icons,{icon:"close"}))),id:"storybook-panel-root"},Object.entries(panels).map(([k,v])=>React__default$1["default"].createElement(SafeTab,{key:k,id:k,title:v.title},v.render))));AddonPanel.displayName='AddonPanel';const createPanelActions=memoize__default["default"](1)(api=>({onSelect:panel=>api.setSelectedPanel(panel),toggleVisibility:()=>api.togglePanel(),togglePosition:()=>api.togglePanelPosition()}));const mapper$1=({state,api})=>({panels:api.getStoryPanels(),selectedPanel:api.getSelectedPanel(),panelPosition:state.layout.panelPosition,actions:createPanelActions(api),shortcuts:api.getShortcutKeys()});const Panel=props=>React__default$1["default"].createElement(api.Consumer,{filter:mapper$1},customProps=>React__default$1["default"].createElement(AddonPanel,Object.assign({},props,customProps)));const DEFAULT_ICON_COLOUR='#66BF3C';const Notification=theming.styled.div(({theme})=>({position:'relative',display:'flex',padding:15,width:280,borderRadius:4,alignItems:'center',background:theme.base==='light'?'rgba(50,53,71,0.97)':'linear-gradient(0deg, rgba(248,248,248,0.97) 0%, rgba(247,252,255,0.97) 100%)',boxShadow:`0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)`,color:theme.color.inverseText,textDecoration:'none'}));const NotificationWithInteractiveStates=theming.styled(Notification)(()=>({transition:'all 150ms ease-out',transform:'translate3d(0, 0, 0)','&:hover':{transform:'translate3d(0, -3px, 0)',boxShadow:'0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)'},'&:active':{transform:'translate3d(0, 0, 0)',boxShadow:'0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)'},'&:focus':{boxShadow:'0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)'}}));const NotificationLink=NotificationWithInteractiveStates.withComponent(router.Link);const NotificationIconWrapper=theming.styled.div(()=>({display:'flex',marginRight:10,alignItems:'center'}));const NotificationTextWrapper=theming.styled.div(()=>({width:'100%',display:'flex',flexDirection:'column'}));const Headline=theming.styled.div(({theme,hasIcon})=>({height:'100%',width:hasIcon?205:230,alignItems:'center',whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis',fontSize:theme.typography.size.s1,lineHeight:'16px',fontWeight:theme.typography.weight.bold}));const SubHeadline=theming.styled.div(({theme})=>({color:curriedTransparentize$1(0.25,theme.color.inverseText),fontSize:theme.typography.size.s1-1,lineHeight:'14px',marginTop:2}));const ItemContent=({icon,content:{headline,subHeadline}})=>React__default$1["default"].createElement(React__default$1["default"].Fragment,null,!icon||React__default$1["default"].createElement(NotificationIconWrapper,null,React__default$1["default"].createElement(components.Icons,{icon:icon.name,width:16,color:icon.color||DEFAULT_ICON_COLOUR})),React__default$1["default"].createElement(NotificationTextWrapper,null,React__default$1["default"].createElement(Headline,{title:headline,hasIcon:!!icon},headline),subHeadline&&React__default$1["default"].createElement(SubHeadline,null,subHeadline)));const DismissButtonWrapper=theming.styled(components.IconButton)(({theme})=>({alignSelf:'center',marginTop:0,color:theme.base==='light'?'rgba(255,255,255,0.7)':' #999999'}));const DismissNotificationItem=({onDismiss})=>React__default$1["default"].createElement(DismissButtonWrapper,{title:"Dismiss notification",onClick:e=>{e.preventDefault();onDismiss();}},React__default$1["default"].createElement(components.Icons,{icon:"closeAlt",height:12,width:12}));theming.styled.div({height:48});const NotificationItem=({notification:{content,link,onClear,id,icon},onDismissNotification})=>{const dismissNotificationItem=()=>{onDismissNotification(id);onClear();};return link?React__default$1["default"].createElement(NotificationLink,{to:link},React__default$1["default"].createElement(ItemContent,{icon:icon,content:content}),React__default$1["default"].createElement(DismissNotificationItem,{onDismiss:dismissNotificationItem})):React__default$1["default"].createElement(Notification,null,React__default$1["default"].createElement(ItemContent,{icon:icon,content:content}),React__default$1["default"].createElement(DismissNotificationItem,{onDismiss:dismissNotificationItem}));};const List=theming.styled.div({zIndex:10,'> * + *':{marginTop:10},'&:empty':{display:'none'}},({placement})=>placement||{bottom:0,left:0,right:0,position:'fixed'});const NotificationList=({notifications,clearNotification,placement=undefined})=>React__default$1["default"].createElement(List,{placement:placement},notifications.map(notification=>React__default$1["default"].createElement(NotificationItem,{key:notification.id,onDismissNotification:id=>clearNotification(id),notification:notification})));const mapper=({state})=>{const{clearNotification}=api.useStorybookApi();const{notifications}=state;return{notifications,clearNotification};};const NotificationConnect=props=>React__default$1["default"].createElement(api.Consumer,{filter:mapper},fromState=>React__default$1["default"].createElement(NotificationList,Object.assign({},props,fromState)));function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t;}).apply(this,arguments);}var n=/[\'\"]/;const r=["children","options"],o=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{for:"htmlFor"}),c={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},a=["style","script"],u=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,i=/mailto:/i,l=/\n{2,}$/,s=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,_=/^ *> ?/gm,f=/^ {2,}\n/,d=/^(?:( *[-*_]) *){3,}(?:\n *)+\n/,p=/^\s*(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,m=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,y=/^(?:\n *)*\n/,h=/\r\n?/g,k=/^\[\^([^\]]+)](:.*)\n/,x=/^\[\^([^\]]+)]/,v=/\f/g,b=/^\s*?\[(x|\s)\]/,S=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,$=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,w=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,z=/&([a-z]+);/g,E=/^<!--[\s\S]*?(?:-->)/,A=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,R=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,I=/^\{.*\}$/,M=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,O=/^<([^ >]+@[^ >]+)>/,B=/^<([^ >]+:\/[^ >]+)>/,L=/ *\n+$/,T=/(?:^|\n)( *)$/,j=/-([a-z])?/gi,C=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,D=/^\[([^\]]*)\]:\s*(\S+)\s*("([^"]*)")?/,N=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Z=/^\[([^\]]*)\] ?\[([^\]]*)\]/,F=/(\[|\])/g,P=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,G=/\t/g,H=/^ *\| */,q=/(^ *\||\| *$)/g,U=/ *$/,V=/^ *:-+: *$/,W=/^ *:-+ *$/,Q=/^ *-+: *$/,X=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,J=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,K=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,Y=/^\\([^0-9A-Za-z\s])/,tt=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,et=/^\n+/,nt=/^([ \t]*)/,rt=/\\([^0-9A-Z\s])/gi,ot=new RegExp("^( *)((?:[*+-]|\\d+\\.)) +"),ct=new RegExp("^( *)((?:[*+-]|\\d+\\.)) +[^\\n]*(?:\\n(?!\\1(?:[*+-]|\\d+\\.) )[^\\n]*)*(\\n|$)","gm"),at=new RegExp("^( *)((?:[*+-]|\\d+\\.)) [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1(?:[*+-]|\\d+\\.) (?!(?:[*+-]|\\d+\\.) ))\\n*|\\s*\\n*$)"),ut="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",it=new RegExp("^\\[("+ut+")\\]\\(\\s*<?((?:[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),lt=new RegExp("^!\\[("+ut+")\\]\\(\\s*<?((?:[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),st=[s,g,p,S,$,E,ct,at,C],_t=[...st,/^[^\n]+(?:  \n|\n{2,})/,w,R];function ft(t){return t.replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase();}function dt(t){return Q.test(t)?"right":V.test(t)?"center":W.test(t)?"left":null;}function pt(t,e,n){const r=n.t;n.t=!0;const o=e(t.trim(),n);n.t=r;let c=[[]];return o.forEach(function(t,e){"tableSeparator"===t.type?0!==e&&e!==o.length-1&&c.push([]):("text"!==t.type||null!=o[e+1]&&"tableSeparator"!==o[e+1].type||(t.content=t.content.replace(U,"")),c[c.length-1].push(t));}),c;}function gt(t,e,n){n.o=!0;const r=pt(t[1],e,n),o=t[2].replace(q,"").split("|").map(dt),c=function(t,e,n){return t.trim().split("\n").map(function(t){return pt(t,e,n);});}(t[3],e,n);return n.o=!1,{align:o,cells:c,header:r,type:"table"};}function mt(t,e){return null==t.align[e]?{}:{textAlign:t.align[e]};}function yt(t){return function(e,n){return n.o?t.exec(e):null;};}function ht(t){return function(e,n){return n.o||n.u?t.exec(e):null;};}function kt(t){return function(e,n){return n.o||n.u?null:t.exec(e);};}function xt(t){return function(e){return t.exec(e);};}function vt(t,e,n){if(e.o||e.u)return null;if(n&&!n.endsWith("\n"))return null;let r="";t.split("\n").every(t=>!st.some(e=>e.test(t))&&(r+=t+"\n",t.trim()));const o=r.trimEnd();return""==o?null:[r,o];}function bt(t){try{if(decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data):/i))return null;}catch(t){return null;}return t;}function St(t){return t.replace(rt,"$1");}function $t(t,e,n){const r=n.o||!1,o=n.u||!1;n.o=!0,n.u=!0;const c=t(e,n);return n.o=r,n.u=o,c;}function wt(t,e,n){const r=n.o||!1,o=n.u||!1;n.o=!1,n.u=!0;const c=t(e,n);return n.o=r,n.u=o,c;}function zt(t,e,n){return n.o=!1,t(e+"\n\n",n);}const Et=(t,e,n)=>({content:$t(e,t[1],n)});function At(){return{};}function Rt(){return null;}function It(...t){return t.filter(Boolean).join(" ");}function Mt(t,e,n){let r=t;const o=e.split(".");for(;o.length&&(r=r[o[0]],void 0!==r);)o.shift();return r||n;}var Ot;function Bt(r,q={}){q.overrides=q.overrides||{},q.slugify=q.slugify||ft,q.namedCodesToUnicode=q.namedCodesToUnicode?e({},c,q.namedCodesToUnicode):c;const U=q.createElement||React__default$1["default"].createElement;function V(t,n,...r){const o=Mt(q.overrides,`${t}.props`,{});return U(function(t,e){const n=Mt(e,t);return n?"function"==typeof n||"object"==typeof n&&"render"in n?n:Mt(e,`${t}.component`,t):t;}(t,q.overrides),e({},n,o,{className:It(null==n?void 0:n.className,o.className)||void 0}),...r);}function W(e){let n=!1;q.forceInline?n=!0:q.forceBlock||(n=!1===P.test(e));const r=pt(dt(n?e:`${e.trimEnd().replace(et,"")}\n\n`,{o:n}));for(;"string"==typeof r[r.length-1]&&!r[r.length-1].trim();)r.pop();if(null===q.wrapper)return r;const o=q.wrapper||(n?"span":"div");let c;if(r.length>1||q.forceWrapper)c=r;else{if(1===r.length)return c=r[0],"string"==typeof c?V("span",{key:"outer"},c):c;c=null;}return React__default$1["default"].createElement(o,{key:"outer"},c);}function Q(e){const r=e.match(u);return r?r.reduce(function(e,r,c){const a=r.indexOf("=");if(-1!==a){const u=function(t){return-1!==t.indexOf("-")&&null===t.match(A)&&(t=t.replace(j,function(t,e){return e.toUpperCase();})),t;}(r.slice(0,a)).trim(),i=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):"";}(r.slice(a+1).trim()),l=o[u]||u,s=e[l]=function(t,e){return"style"===t?e.split(/;\s?/).reduce(function(t,e){const n=e.slice(0,e.indexOf(":"));return t[n.replace(/(-[a-z])/g,t=>t[1].toUpperCase())]=e.slice(n.length+1).trim(),t;},{}):"href"===t?bt(e):(e.match(I)&&(e=e.slice(1,e.length-1)),"true"===e||"false"!==e&&e);}(u,i);"string"==typeof s&&(w.test(s)||R.test(s))&&(e[l]=React__default$1["default"].cloneElement(W(s.trim()),{key:c}));}else"style"!==r&&(e[o[r]||r]=!0);return e;},{}):void 0;}const rt=[],ut={},st={blockQuote:{i:kt(s),l:Ot.HIGH,_:(t,e,n)=>({content:e(t[0].replace(_,""),n)}),p:(t,e,n)=>V("blockquote",{key:n.g},e(t.content,n))},breakLine:{i:xt(f),l:Ot.HIGH,_:At,p:(t,e,n)=>V("br",{key:n.g})},breakThematic:{i:kt(d),l:Ot.HIGH,_:At,p:(t,e,n)=>V("hr",{key:n.g})},codeBlock:{i:kt(g),l:Ot.MAX,_:t=>({content:t[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),lang:void 0}),p:(t,e,n)=>V("pre",{key:n.g},V("code",{className:t.lang?`lang-${t.lang}`:""},t.content))},codeFenced:{i:kt(p),l:Ot.MAX,_:t=>({content:t[3],lang:t[2]||void 0,type:"codeBlock"})},codeInline:{i:ht(m),l:Ot.LOW,_:t=>({content:t[2]}),p:(t,e,n)=>V("code",{key:n.g},t.content)},footnote:{i:kt(k),l:Ot.MAX,_:t=>(rt.push({footnote:t[2],identifier:t[1]}),{}),p:Rt},footnoteReference:{i:yt(x),l:Ot.HIGH,_:t=>({content:t[1],target:`#${q.slugify(t[1])}`}),p:(t,e,n)=>V("a",{key:n.g,href:bt(t.target)},V("sup",{key:n.g},t.content))},gfmTask:{i:yt(b),l:Ot.HIGH,_:t=>({completed:"x"===t[1].toLowerCase()}),p:(t,e,n)=>V("input",{checked:t.completed,key:n.g,readOnly:!0,type:"checkbox"})},heading:{i:kt(S),l:Ot.HIGH,_:(t,e,n)=>({content:$t(e,t[2],n),id:q.slugify(t[2]),level:t[1].length}),p:(t,e,n)=>(t.tag=`h${t.level}`,V(t.tag,{id:t.id,key:n.g},e(t.content,n)))},headingSetext:{i:kt($),l:Ot.MAX,_:(t,e,n)=>({content:$t(e,t[1],n),level:"="===t[2]?1:2,type:"heading"})},htmlComment:{i:xt(E),l:Ot.HIGH,_:()=>({}),p:Rt},image:{i:ht(lt),l:Ot.HIGH,_:t=>({alt:t[1],target:St(t[2]),title:t[3]}),p:(t,e,n)=>V("img",{key:n.g,alt:t.alt||void 0,title:t.title||void 0,src:bt(t.target)})},link:{i:yt(it),l:Ot.LOW,_:(t,e,n)=>({content:wt(e,t[1],n),target:St(t[2]),title:t[3]}),p:(t,e,n)=>V("a",{key:n.g,href:bt(t.target),title:t.title},e(t.content,n))},linkAngleBraceStyleDetector:{i:yt(B),l:Ot.MAX,_:t=>({content:[{content:t[1],type:"text"}],target:t[1],type:"link"})},linkBareUrlDetector:{i:(t,e)=>e.m?null:yt(M)(t,e),l:Ot.MAX,_:t=>({content:[{content:t[1],type:"text"}],target:t[1],title:void 0,type:"link"})},linkMailtoDetector:{i:yt(O),l:Ot.MAX,_(t){let e=t[1],n=t[1];return i.test(n)||(n="mailto:"+n),{content:[{content:e.replace("mailto:",""),type:"text"}],target:n,type:"link"};}},list:{i(t,e,n){const r=T.exec(n);return!r||!e.h&&e.o?null:at.exec(t=r[1]+t);},l:Ot.HIGH,_(t,e,n){const r=t[2],o=r.length>1,c=o?+r:void 0,a=t[0].replace(l,"\n").match(ct);let u=!1;return{items:a.map(function(t,r){const o=ot.exec(t)[0].length,c=new RegExp("^ {1,"+o+"}","gm"),i=t.replace(c,"").replace(ot,""),l=r===a.length-1,s=-1!==i.indexOf("\n\n")||l&&u;u=s;const _=n.o,f=n.h;let d;n.h=!0,s?(n.o=!1,d=i.replace(L,"\n\n")):(n.o=!0,d=i.replace(L,""));const p=e(d,n);return n.o=_,n.h=f,p;}),ordered:o,start:c};},p:(t,e,n)=>V(t.ordered?"ol":"ul",{key:n.g,start:t.start},t.items.map(function(t,r){return V("li",{key:r},e(t,n));}))},newlineCoalescer:{i:kt(y),l:Ot.LOW,_:At,p:()=>"\n"},paragraph:{i:vt,l:Ot.LOW,_:Et,p:(t,e,n)=>V("p",{key:n.g},e(t.content,n))},ref:{i:yt(D),l:Ot.MAX,_:t=>(ut[t[1]]={target:t[2],title:t[4]},{}),p:Rt},refImage:{i:ht(N),l:Ot.MAX,_:t=>({alt:t[1]||void 0,ref:t[2]}),p:(t,e,n)=>V("img",{key:n.g,alt:t.alt,src:bt(ut[t.ref].target),title:ut[t.ref].title})},refLink:{i:yt(Z),l:Ot.MAX,_:(t,e,n)=>({content:e(t[1],n),fallbackContent:e(t[0].replace(F,"\\$1"),n),ref:t[2]}),p:(t,e,n)=>ut[t.ref]?V("a",{key:n.g,href:bt(ut[t.ref].target),title:ut[t.ref].title},e(t.content,n)):V("span",{key:n.g},e(t.fallbackContent,n))},table:{i:kt(C),l:Ot.HIGH,_:gt,p:(t,e,n)=>V("table",{key:n.g},V("thead",null,V("tr",null,t.header.map(function(r,o){return V("th",{key:o,style:mt(t,o)},e(r,n));}))),V("tbody",null,t.cells.map(function(r,o){return V("tr",{key:o},r.map(function(r,o){return V("td",{key:o,style:mt(t,o)},e(r,n));}));})))},tableSeparator:{i:function(t,e){return e.t?H.exec(t):null;},l:Ot.HIGH,_:function(){return{type:"tableSeparator"};},p:()=>" | "},text:{i:xt(tt),l:Ot.MIN,_:t=>({content:t[0].replace(z,(t,e)=>q.namedCodesToUnicode[e]?q.namedCodesToUnicode[e]:t)}),p:t=>t.content},textBolded:{i:ht(X),l:Ot.MED,_:(t,e,n)=>({content:e(t[2],n)}),p:(t,e,n)=>V("strong",{key:n.g},e(t.content,n))},textEmphasized:{i:ht(J),l:Ot.LOW,_:(t,e,n)=>({content:e(t[2],n)}),p:(t,e,n)=>V("em",{key:n.g},e(t.content,n))},textEscaped:{i:ht(Y),l:Ot.HIGH,_:t=>({content:t[1],type:"text"})},textStrikethroughed:{i:ht(K),l:Ot.LOW,_:Et,p:(t,e,n)=>V("del",{key:n.g},e(t.content,n))}};!0!==q.disableParsingRawHTML&&(st.htmlBlock={i:xt(w),l:Ot.HIGH,_(t,e,n){const[,r]=t[3].match(nt),o=new RegExp(`^${r}`,"gm"),c=t[3].replace(o,""),u=(i=c,_t.some(t=>t.test(i))?zt:$t);var i;const l=t[1].toLowerCase(),s=-1!==a.indexOf(l);n.m=n.m||"a"===l;const _=s?t[3]:u(e,c,n);return n.m=!1,{attrs:Q(t[2]),content:_,noInnerParse:s,tag:s?l:t[1]};},p:(t,n,r)=>V(t.tag,e({key:r.g},t.attrs),t.noInnerParse?t.content:n(t.content,r))},st.htmlSelfClosing={i:xt(R),l:Ot.HIGH,_:t=>({attrs:Q(t[2]||""),tag:t[1]}),p:(t,n,r)=>V(t.tag,e({},t.attrs,{key:r.g}))});const dt=function(t){let e=Object.keys(t);function n(r,o){let c=[],a="";for(;r;){let u=0;for(;u<e.length;){const i=e[u],l=t[i],s=l.i(r,o,a);if(s){const t=s[0];r=r.substring(t.length);const e=l._(s,n,o);null==e.type&&(e.type=i),c.push(e),a=t;break;}u++;}}return c;}return e.sort(function(e,n){let r=t[e].l,o=t[n].l;return r!==o?r-o:e<n?-1:1;}),function(t,e){return n(function(t){return t.replace(h,"\n").replace(v,"").replace(G,"    ");}(t),e);};}(st),pt=(Bt=function(t){return function(e,n,r){return t[e.type].p(e,n,r);};}(st),function t(e,n={}){if(Array.isArray(e)){const r=n.g,o=[];let c=!1;for(let r=0;r<e.length;r++){n.g=r;const a=t(e[r],n),u="string"==typeof a;u&&c?o[o.length-1]+=a:null!==a&&o.push(a),c=u;}return n.g=r,o;}return Bt(e,t,n);});var Bt;const Lt=W(r);return rt.length?V("div",null,Lt,V("footer",{key:"footer"},rt.map(function(t){return V("div",{id:q.slugify(t.identifier),key:t.identifier},t.identifier,pt(dt(t.footnote,{o:!0})));}))):Lt;}!function(t){t[t.MAX=0]="MAX",t[t.HIGH=1]="HIGH",t[t.MED=2]="MED",t[t.LOW=3]="LOW",t[t.MIN=4]="MIN";}(Ot||(Ot={}));var Markdown=e=>{let{children:n,options:o}=e,c=function(t,e){if(null==t)return{};var n,r,o={},c=Object.keys(t);for(r=0;r<c.length;r++)e.indexOf(n=c[r])>=0||(o[n]=t[n]);return o;}(e,r);return React__default$1["default"].cloneElement(Bt(n,o),c);};const Footer=theming.styled.div(({theme})=>({display:'flex',paddingTop:20,marginTop:20,borderTop:`1px solid ${theme.appBorderColor}`,fontWeight:theme.typography.weight.bold,'& > * + *':{marginLeft:20}}));const SettingsFooter=props=>React__default$1["default"].createElement(Footer,Object.assign({},props),React__default$1["default"].createElement(components.Link,{secondary:true,href:"https://storybook.js.org",cancel:false,target:"_blank"},"Docs"),React__default$1["default"].createElement(components.Link,{secondary:true,href:"https://github.com/storybookjs/storybook",cancel:false,target:"_blank"},"GitHub"),React__default$1["default"].createElement(components.Link,{secondary:true,href:"https://storybook.js.org/support",cancel:false,target:"_blank"},"Support"));const Header$1=theming.styled.header(({theme})=>({marginBottom:20,fontSize:theme.typography.size.m3,fontWeight:theme.typography.weight.black,alignItems:'center',display:'flex','> svg':{height:32,width:'auto',marginRight:8}}));const Subheading=theming.styled.span(({theme})=>({letterSpacing:'0.35em',textTransform:'uppercase',fontWeight:theme.typography.weight.black,fontSize:theme.typography.size.s2-1,lineHeight:'24px',color:theme.color.mediumdark}));const SubheadingLink=theming.styled(components.Link)(({theme})=>({fontSize:theme.typography.size.s1}));const Subheader=theming.styled.div({display:'flex',justifyContent:'space-between',alignItems:'center',marginBottom:'.75rem'});const UpdateMessage=theming.styled.div(({status,theme})=>{if(status==='positive'){return{background:theme.background.positive,color:theme.color.positive};}if(status==='negative'){return{background:theme.background.negative,color:theme.color.negative};}return{background:'#EAF3FC',color:theme.color.darkest};},({theme})=>({fontWeight:theme.typography.weight.bold,fontSize:theme.typography.size.s2,padding:'10px 20px',marginBottom:24,borderRadius:theme.appBorderRadius,border:`1px solid ${theme.appBorderColor}`,textAlign:'center'}));const ErrorMessage=theming.styled.div(({theme})=>({fontWeight:theme.typography.weight.bold,textAlign:'center'}));const Upgrade=theming.styled.div(({theme})=>({marginTop:20,borderTop:`1px solid ${theme.appBorderColor}`}));const Container$2=theming.styled.div({padding:`3rem 20px`,maxWidth:600,margin:'0 auto'});const AboutScreen=({latest=null,current})=>{const canUpdate=latest&&semver__default["default"].gt(latest.version,current.version);let updateMessage;if(latest){if(canUpdate){updateMessage=React__default$1["default"].createElement(UpdateMessage,{status:"positive"},"Storybook ",latest.version," is available. Upgrade from ",current.version," now.");}else{updateMessage=React__default$1["default"].createElement(UpdateMessage,{status:"neutral"},"Looking good! You're up to date.");}}else{updateMessage=React__default$1["default"].createElement(UpdateMessage,{status:"negative"},"Oops! The latest version of Storybook couldn't be fetched.");}return React__default$1["default"].createElement(Container$2,null,React__default$1["default"].createElement(Header$1,null,React__default$1["default"].createElement(components.StorybookIcon,null),"Storybook ",current.version),updateMessage,latest?React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(Subheader,null,React__default$1["default"].createElement(Subheading,null,latest.version," Changelog"),React__default$1["default"].createElement(SubheadingLink,{secondary:true,href:"https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md",withArrow:true,cancel:false,target:"_blank"},"Read full changelog")),React__default$1["default"].createElement(components.DocumentWrapper,null,React__default$1["default"].createElement(Markdown,null,latest.info.plain))):React__default$1["default"].createElement(ErrorMessage,null,React__default$1["default"].createElement(components.Link,{href:"https://github.com/storybookjs/storybook/releases",target:"_blank",withArrow:true,secondary:true,cancel:false},"Check Storybook's release history")),canUpdate&&React__default$1["default"].createElement(Upgrade,null,React__default$1["default"].createElement(components.DocumentWrapper,null,React__default$1["default"].createElement("p",null,React__default$1["default"].createElement("b",null,"Upgrade all Storybook packages to latest:")),React__default$1["default"].createElement(components.SyntaxHighlighter,{language:"bash",copyable:true,padded:true,bordered:true},"npx sb upgrade"))),React__default$1["default"].createElement(SettingsFooter,null));};// Clear a notification on mount. This could be exported by core/notifications.js perhaps?
class NotificationClearer extends React$2.Component{componentDidMount(){const{api,notificationId}=this.props;api.clearNotification(notificationId);}render(){const{children}=this.props;return children;}}const AboutPage=()=>{const api$1=api.useStorybookApi();return React__default$1["default"].createElement(NotificationClearer,{api:api$1,notificationId:"update"},React__default$1["default"].createElement(AboutScreen,{current:api$1.getCurrentVersion(),latest:api$1.getLatestVersion()}));};const Centered=theming.styled.div({top:'50%',position:'absolute',transform:'translateY(-50%)',width:'100%',textAlign:'center'});const LoaderWrapper=theming.styled.div({position:'relative',height:'32px'});const Message=theming.styled.div(({theme})=>({paddingTop:'12px',color:theme.color.mediumdark,maxWidth:'295px',margin:'0 auto',fontSize:`${theme.typography.size.s1}px`,lineHeight:`16px`}));const Iframe=theming.styled.iframe({position:'absolute',top:0,left:0,right:0,bottom:0,border:0,margin:0,padding:0,width:'100%',height:'100%'},({isLoaded})=>({visibility:isLoaded?'visible':'hidden'}));const AlertIcon=theming.styled(props=>React__default$1["default"].createElement(components.Icons,Object.assign({icon:"alert"},props)))(({theme})=>({color:theme.color.mediumdark,width:40,margin:'0 auto'}));const getIframeUrl=version=>{const[major,minor]=version.split('.');return`https://storybook.js.org/releases/iframe/${major}.${minor}`;};const ReleaseNotesLoader=()=>React__default$1["default"].createElement(Centered,null,React__default$1["default"].createElement(LoaderWrapper,null,React__default$1["default"].createElement(components.Loader,null)),React__default$1["default"].createElement(Message,null,"Loading release notes"));const MaxWaitTimeMessaging=()=>React__default$1["default"].createElement(Centered,null,React__default$1["default"].createElement(AlertIcon,null),React__default$1["default"].createElement(Message,null,"The release notes couldn't be loaded. Check your internet connection and try again."));const PureReleaseNotesScreen=({didHitMaxWaitTime,isLoaded,setLoaded,version})=>React__default$1["default"].createElement(React$2.Fragment,null,!isLoaded&&!didHitMaxWaitTime&&React__default$1["default"].createElement(ReleaseNotesLoader,null),didHitMaxWaitTime?React__default$1["default"].createElement(MaxWaitTimeMessaging,null):React__default$1["default"].createElement(Iframe,{isLoaded:isLoaded,onLoad:()=>setLoaded(true),src:getIframeUrl(version),title:`Release notes for Storybook version ${version}`}));const MAX_WAIT_TIME=10000;// 10 seconds
const ReleaseNotesScreen=({version})=>{const[isLoaded,setLoaded]=React$2.useState(false);const[didHitMaxWaitTime,setDidHitMaxWaitTime]=React$2.useState(false);React$2.useEffect(()=>{const timer=setTimeout(()=>!isLoaded&&setDidHitMaxWaitTime(true),MAX_WAIT_TIME);return()=>clearTimeout(timer);},[isLoaded]);return React__default$1["default"].createElement(PureReleaseNotesScreen,{didHitMaxWaitTime:didHitMaxWaitTime,isLoaded:isLoaded,setLoaded:setLoaded,version:version});};const ReleaseNotesPage=()=>{const api$1=api.useStorybookApi();React$2.useEffect(()=>{api$1.setDidViewReleaseNotes();},[]);const version=api$1.releaseNotesVersion();return React__default$1["default"].createElement(ReleaseNotesScreen,{version:version});};const{Button,Input}=components.Form;const Header=theming.styled.header(({theme})=>({marginBottom:20,fontSize:theme.typography.size.m3,fontWeight:theme.typography.weight.black,alignItems:'center',display:'flex'}));// Grid
const HeaderItem=theming.styled.div(({theme})=>({fontWeight:theme.typography.weight.bold}));const GridHeaderRow=theming.styled.div({alignSelf:'flex-end',display:'grid',margin:'10px 0',gridTemplateColumns:'1fr 1fr 12px','& > *:last-of-type':{gridColumn:'2 / 2',justifySelf:'flex-end',gridRow:'1'}});const Row=theming.styled.div(({theme})=>({padding:'6px 0',borderTop:`1px solid ${theme.appBorderColor}`,display:'grid',gridTemplateColumns:'1fr 1fr 0px'}));const GridWrapper=theming.styled.div({display:'grid',gridTemplateColumns:'1fr',gridAutoRows:'minmax(auto, auto)',marginBottom:20});// Form
const Description=theming.styled.div({alignSelf:'center'});const TextInput=theming.styled(Input)(({valid,theme})=>valid==='error'?{animation:`${theme.animation.jiggle} 700ms ease-out`}:{},{display:'flex',width:80,flexDirection:'column',justifySelf:'flex-end',paddingLeft:4,paddingRight:4,textAlign:'center'});const Fade=theming.keyframes`
0%,100% { opacity: 0; }
  50% { opacity: 1; }
`;const SuccessIcon=theming.styled(components.Icons)(({valid,theme})=>valid==='valid'?{color:theme.color.positive,animation:`${Fade} 2s ease forwards`}:{opacity:0},{alignSelf:'center',display:'flex',marginLeft:10,height:14,width:14});const Container$1=theming.styled.div(({theme})=>({fontSize:theme.typography.size.s2,padding:`3rem 20px`,maxWidth:600,margin:'0 auto'}));const shortcutLabels={fullScreen:'Go full screen',togglePanel:'Toggle addons',panelPosition:'Toggle addons orientation',toggleNav:'Toggle sidebar',toolbar:'Toggle canvas toolbar',search:'Focus search',focusNav:'Focus sidebar',focusIframe:'Focus canvas',focusPanel:'Focus addons',prevComponent:'Previous component',nextComponent:'Next component',prevStory:'Previous story',nextStory:'Next story',shortcutsPage:'Go to shortcuts page',aboutPage:'Go to about page',collapseAll:'Collapse all items on sidebar',expandAll:'Expand all items on sidebar'};// Shortcuts that cannot be configured
const fixedShortcuts=['escape'];function toShortcutState(shortcutKeys){return Object.entries(shortcutKeys).reduce((acc,[feature,shortcut])=>fixedShortcuts.includes(feature)?acc:Object.assign(Object.assign({},acc),{[feature]:{shortcut,error:false}}),{});}class ShortcutsScreen extends React$2.Component{constructor(props){super(props);this.onKeyDown=e=>{const{activeFeature,shortcutKeys}=this.state;if(e.key==='Backspace'){return this.restoreDefault();}const shortcut$1=shortcut.eventToShortcut(e);// Keypress is not a potential shortcut
if(!shortcut$1){return false;}// Check we don't match any other shortcuts
const error=!!Object.entries(shortcutKeys).find(([feature,{shortcut:existingShortcut}])=>feature!==activeFeature&&existingShortcut&&shortcut.shortcutMatchesShortcut(shortcut$1,existingShortcut));return this.setState({shortcutKeys:Object.assign(Object.assign({},shortcutKeys),{[activeFeature]:{shortcut:shortcut$1,error}})});};this.onFocus=focusedInput=>()=>{const{shortcutKeys}=this.state;this.setState({activeFeature:focusedInput,shortcutKeys:Object.assign(Object.assign({},shortcutKeys),{[focusedInput]:{shortcut:null,error:false}})});};this.onBlur=()=>__awaiter(this,void 0,void 0,function*(){const{shortcutKeys,activeFeature}=this.state;if(shortcutKeys[activeFeature]){const{shortcut,error}=shortcutKeys[activeFeature];if(!shortcut||error){return this.restoreDefault();}return this.saveShortcut();}return false;});this.saveShortcut=()=>__awaiter(this,void 0,void 0,function*(){const{activeFeature,shortcutKeys}=this.state;const{setShortcut}=this.props;yield setShortcut(activeFeature,shortcutKeys[activeFeature].shortcut);this.setState({successField:activeFeature});});this.restoreDefaults=()=>__awaiter(this,void 0,void 0,function*(){const{restoreAllDefaultShortcuts}=this.props;const defaultShortcuts=yield restoreAllDefaultShortcuts();return this.setState({shortcutKeys:toShortcutState(defaultShortcuts)});});this.restoreDefault=()=>__awaiter(this,void 0,void 0,function*(){const{activeFeature,shortcutKeys}=this.state;const{restoreDefaultShortcut}=this.props;const defaultShortcut=yield restoreDefaultShortcut(activeFeature);return this.setState({shortcutKeys:Object.assign(Object.assign({},shortcutKeys),toShortcutState({[activeFeature]:defaultShortcut}))});});this.displaySuccessMessage=activeElement=>{const{successField,shortcutKeys}=this.state;return activeElement===successField&&shortcutKeys[activeElement].error===false?'valid':undefined;};this.displayError=activeElement=>{const{activeFeature,shortcutKeys}=this.state;return activeElement===activeFeature&&shortcutKeys[activeElement].error===true?'error':undefined;};this.renderKeyInput=()=>{const{shortcutKeys,addonsShortcutLabels}=this.state;const arr=Object.entries(shortcutKeys).map(([feature,{shortcut:shortcut$1}])=>React__default$1["default"].createElement(Row,{key:feature},React__default$1["default"].createElement(Description,null,shortcutLabels[feature]||addonsShortcutLabels[feature]),React__default$1["default"].createElement(TextInput,{spellCheck:"false",valid:this.displayError(feature),className:"modalInput",onBlur:this.onBlur,onFocus:this.onFocus(feature),// @ts-ignore
onKeyDown:this.onKeyDown,value:shortcut$1?shortcut.shortcutToHumanString(shortcut$1):'',placeholder:"Type keys",readOnly:true}),React__default$1["default"].createElement(SuccessIcon,{valid:this.displaySuccessMessage(feature),icon:"check"})));return arr;};this.renderKeyForm=()=>React__default$1["default"].createElement(GridWrapper,null,React__default$1["default"].createElement(GridHeaderRow,null,React__default$1["default"].createElement(HeaderItem,null,"Commands"),React__default$1["default"].createElement(HeaderItem,null,"Shortcut")),this.renderKeyInput());this.state={activeFeature:undefined,successField:undefined,// The initial shortcutKeys that come from props are the defaults/what was saved
// As the user interacts with the page, the state stores the temporary, unsaved shortcuts
// This object also includes the error attached to each shortcut
shortcutKeys:toShortcutState(props.shortcutKeys),addonsShortcutLabels:props.addonsShortcutLabels};}render(){const layout=this.renderKeyForm();return React__default$1["default"].createElement(Container$1,null,React__default$1["default"].createElement(Header,null,"Keyboard shortcuts"),layout,React__default$1["default"].createElement(Button,{tertiary:true,small:true,id:"restoreDefaultsHotkeys",onClick:this.restoreDefaults},"Restore defaults"),React__default$1["default"].createElement(SettingsFooter,null));}}const ShortcutsPage=()=>React__default$1["default"].createElement(api.Consumer,null,({api:{getShortcutKeys,getAddonsShortcutLabels,setShortcut,restoreDefaultShortcut,restoreAllDefaultShortcuts}})=>React__default$1["default"].createElement(ShortcutsScreen,Object.assign({shortcutKeys:getShortcutKeys(),addonsShortcutLabels:getAddonsShortcutLabels()},{setShortcut,restoreDefaultShortcut,restoreAllDefaultShortcuts})));const{document:document$1}=window_1;const TabBarButton=React__default$1["default"].memo(({changeTab,id,title})=>React__default$1["default"].createElement(router.Location,null,({path})=>{const active=path.includes(`settings/${id}`);return React__default$1["default"].createElement(components.TabButton,{id:`tabbutton-${id}`,className:['tabbutton'].concat(active?['tabbutton-active']:[]).join(' '),type:"button",key:"id",active:active,onClick:()=>changeTab(id),role:"tab"},title);}));const Content=theming.styled(components.ScrollArea)({position:'absolute',top:40,left:0,right:0,bottom:0,overflow:'auto'},({theme})=>({background:theme.background.content}));const Pages=({changeTab,onClose,enableShortcuts=true,hasReleaseNotes=false})=>{React__default$1["default"].useEffect(()=>{const handleEscape=event=>{if(!enableShortcuts||event.repeat)return;if(matchesModifiers(false,event)&&matchesKeyCode('Escape',event)){event.preventDefault();onClose();}};document$1.addEventListener('keydown',handleEscape);return()=>document$1.removeEventListener('keydown',handleEscape);},[]);return React__default$1["default"].createElement(React$2.Fragment,null,React__default$1["default"].createElement(components.FlexBar,{border:true},React__default$1["default"].createElement(components.TabBar,{role:"tablist"},React__default$1["default"].createElement(TabBarButton,{id:"about",title:"About",changeTab:changeTab}),hasReleaseNotes&&React__default$1["default"].createElement(TabBarButton,{id:"release-notes",title:"Release notes",changeTab:changeTab}),React__default$1["default"].createElement(TabBarButton,{id:"shortcuts",title:"Keyboard shortcuts",changeTab:changeTab})),React__default$1["default"].createElement(components.IconButton,{onClick:e=>{e.preventDefault();return onClose();},title:"Close settings page"},React__default$1["default"].createElement(components.Icons,{icon:"close"}))),React__default$1["default"].createElement(Content,{vertical:true,horizontal:false},React__default$1["default"].createElement(router.Route,{path:"about"},React__default$1["default"].createElement(AboutPage,{key:"about"})),React__default$1["default"].createElement(router.Route,{path:"release-notes"},React__default$1["default"].createElement(ReleaseNotesPage,{key:"release-notes"})),React__default$1["default"].createElement(router.Route,{path:"shortcuts"},React__default$1["default"].createElement(ShortcutsPage,{key:"shortcuts"}))));};const SettingsPages=()=>{const api$1=api.useStorybookApi();const state=api.useStorybookState();const changeTab=tab=>api$1.changeSettingsTab(tab);return React__default$1["default"].createElement(Pages,{hasReleaseNotes:!!api$1.releaseNotesVersion(),enableShortcuts:state.ui.enableShortcuts,changeTab:changeTab,onClose:api$1.closeSettings});};const View=theming.styled.div({position:'fixed',overflow:'hidden',height:'100vh',width:'100vw'});const App=React__default$1["default"].memo(({viewMode,docsOnly,layout,panelCount,size:{width,height}})=>{let content;const props=React$2.useMemo(()=>({Sidebar,Preview:PreviewConnected,Panel,Notifications:NotificationConnect,pages:[{key:'settings',render:()=>React__default$1["default"].createElement(SettingsPages,null),route:({children})=>React__default$1["default"].createElement(router.Route,{path:"/settings/",startsWith:true},children)}]}),[]);if(!width||!height){content=React__default$1["default"].createElement("div",null);}else if(width<600){content=React__default$1["default"].createElement(Mobile,Object.assign({},props,{viewMode:viewMode,options:layout,docsOnly:docsOnly}));}else{content=React__default$1["default"].createElement(Desktop,Object.assign({},props,{viewMode:viewMode,options:layout,docsOnly:docsOnly},{width,height},{panelCount:panelCount}));}return React__default$1["default"].createElement(View,null,React__default$1["default"].createElement(theming.Global,{styles:theming.createGlobal}),React__default$1["default"].createElement(components.Symbols,{icons:['folder','component','document','bookmarkhollow']}),content);},// This is the default shallowEqual implementation, but with custom behavior for the `size` prop.
(prevProps,nextProps)=>{if(Object.is(prevProps,nextProps))return true;if(typeof prevProps!=='object'||prevProps===null)return false;if(typeof nextProps!=='object'||nextProps===null)return false;const keysA=Object.keys(prevProps);const keysB=Object.keys(nextProps);if(keysA.length!==keysB.length)return false;// eslint-disable-next-line no-restricted-syntax
for(const key of keysA){if(key==='size'){// SizeMe injects a new `size` object every time, even if the width/height doesn't change,
// so we chech that one manually.
if(prevProps[key].width!==nextProps[key].width)return false;if(prevProps[key].height!==nextProps[key].height)return false;}else{if(!Object.prototype.hasOwnProperty.call(nextProps,key))return false;if(!Object.is(prevProps[key],nextProps[key]))return false;}}return true;});const SizedApp=reactSizeme({monitorHeight:true})(App);App.displayName='App';class Provider{getElements(_type){throw new Error('Provider.getElements() is not implemented!');}handleAPI(_api){throw new Error('Provider.handleAPI() is not implemented!');}getConfig(){console.error('Provider.getConfig() is not implemented!');return{};}}// eslint-disable-next-line @typescript-eslint/triple-slash-reference
const emotionCache=theming.createCache({key:'sto'});emotionCache.compat=true;const{DOCS_MODE}=window_1;// @ts-ignore
theming.ThemeProvider.displayName='ThemeProvider';// @ts-ignore
q$2.displayName='HelmetProvider';const getDocsMode=()=>{try{return!!DOCS_MODE;}catch(e){return false;}};const Container=process.env.XSTORYBOOK_EXAMPLE_APP?React__default$1["default"].StrictMode:React__default$1["default"].Fragment;const Root=({provider})=>React__default$1["default"].createElement(Container,{key:"container"},React__default$1["default"].createElement(q$2,{key:"helmet.Provider"},React__default$1["default"].createElement(router.LocationProvider,{key:"location.provider"},React__default$1["default"].createElement(Main,{provider:provider}))));const Main=({provider})=>{const navigate=router.useNavigate();return React__default$1["default"].createElement(router.Location,{key:"location.consumer"},locationData=>React__default$1["default"].createElement(api.Provider,Object.assign({key:"manager",provider:provider},locationData,{navigate:navigate,docsMode:getDocsMode()}),({state,api})=>{const panelCount=Object.keys(api.getPanels()).length;const story=api.getData(state.storyId,state.refId);const isLoading=story?!!state.refs[state.refId]&&!state.refs[state.refId].ready:!state.storiesFailed&&!state.storiesConfigured;return React__default$1["default"].createElement(theming.CacheProvider,{value:emotionCache},React__default$1["default"].createElement(theming.ThemeProvider,{key:"theme.provider",theme:theming.ensure(state.theme)},React__default$1["default"].createElement(SizedApp,{key:"app",viewMode:state.viewMode,layout:isLoading?Object.assign(Object.assign({},state.layout),{showPanel:false}):state.layout,panelCount:panelCount,docsOnly:story&&story.parameters&&story.parameters.docsOnly})));}));};function renderStorybookUI(domNode,provider){if(!(provider instanceof Provider)){throw new Error('provider is not extended from the base Provider');}require$$2__default["default"].render(React__default$1["default"].createElement(Root,{key:"root",provider:provider}),domNode);}exports.Provider=Provider;exports.Root=Root;exports["default"]=renderStorybookUI;
