\r\n \r\n \r\n Not Authorized\r\n \r\n {locationState && locationState.from && locationState.from.pathname !== \"/\" ? (\r\n <>\r\n \r\n You are not authorized to view {locationState.from.pathname}.\r\n \r\n \r\n >\r\n ) : (\r\n <>\r\n \r\n You have not yet been authorized to use this application.\r\n \r\n {baseRoleGroupName ? (\r\n \r\n Please contact an administrator, and request that you be assigned to the \r\n {baseRoleGroupName} Active Directory (AD) group.\r\n \r\n ) : (\r\n \r\n Please contact an administrator for assistance.\r\n \r\n )}\r\n >\r\n )}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport const NotAuthorizedPage = withStyles(styles)(NotAuthorizedPageComponent);\r\n","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","import Button from \"@material-ui/core/Button\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport { createStyles, Theme, WithStyles, withStyles } from \"@material-ui/core/styles\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport React from \"react\";\r\nimport { getUserManager } from \"../../auth\";\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n container: {\r\n padding: theme.spacing(2),\r\n },\r\n root: {\r\n maxWidth: 360,\r\n margin: `${theme.spacing(6)}px auto`,\r\n padding: theme.spacing(2),\r\n },\r\n title: {\r\n marginBottom: theme.spacing(2),\r\n },\r\n message: {\r\n marginTop: theme.spacing(1),\r\n },\r\n button: {\r\n marginTop: theme.spacing(2),\r\n marginBottom: theme.spacing(0.5),\r\n width: \"100%\",\r\n },\r\n });\r\n\r\ninterface SignedOutPageProps extends WithStyles {\r\n onSignInError: (error: Error) => void;\r\n}\r\n\r\ninterface SignedOutPageState {\r\n isSignInPending: boolean;\r\n}\r\n\r\nexport const SignedOutPageComponent = class extends React.Component {\r\n constructor(props: SignedOutPageProps) {\r\n super(props);\r\n\r\n this.state = { isSignInPending: false };\r\n }\r\n\r\n public render() {\r\n const { classes } = this.props;\r\n const { isSignInPending } = this.state;\r\n\r\n return (\r\n
\r\n \r\n \r\n Signed Out\r\n \r\n \r\n You are seeing this message because you explicitly signed out of your Account, or your device has been\r\n inactive for an extended period of time and your session expired.\r\n \r\n \r\n If you'd like to sign back in, select the button below.\r\n \r\n \r\n \r\n
\r\n \r\n \r\n Not Found\r\n \r\n \r\n There is nothing to show at {location.pathname}.\r\n \r\n \r\n Please check your spelling and try again. Otherwise, return to the last page using the button below.\r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport const NotFoundPage = withStyles(styles)(NotFoundPageComponent);\r\n","import { UserState } from \"redux-oidc\";\r\nimport { actionCreators as appActionCreators, AppState } from \"./App\";\r\nexport { AppState } from \"./App\";\r\nexport * from \"./models\";\r\nexport * from \"./utils\";\r\n\r\nexport type OidcState = UserState;\r\n\r\nexport type AppActions = typeof appActionCreators;\r\n\r\nexport interface BaseApplicationState {\r\n oidc: OidcState;\r\n app: AppState;\r\n}\r\n\r\nexport const baseActionCreators = {\r\n app: appActionCreators,\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport type AppThunkAction = (dispatch: (action: TAction) => void, getState: () => TState) => void;\r\n","import { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport ListItem from \"@material-ui/core/ListItem\";\r\nimport ListItemIcon from \"@material-ui/core/ListItemIcon\";\r\nimport ListItemText from \"@material-ui/core/ListItemText\";\r\nimport { createStyles, Theme, WithStyles, withStyles } from \"@material-ui/core/styles\";\r\nimport classNames from \"classnames\";\r\nimport React, { forwardRef, useMemo } from \"react\";\r\nimport { Link, LinkProps } from \"react-router-dom\";\r\nimport { DrawerMenuItemSchema } from \"./models\";\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n listItemButton: {\r\n \"&:hover\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n },\r\n listItemRoot: {\r\n padding: theme.spacing(2),\r\n },\r\n listItemIconRoot: {\r\n width: \"1rem\",\r\n height: \"1rem\",\r\n color: theme.palette.getContrastText(theme.palette.background.paper),\r\n flexShrink: \"unset\",\r\n marginRight: 0,\r\n },\r\n listItemTextRoot: {\r\n padding: 0,\r\n },\r\n listItemTextText: {\r\n color: theme.palette.getContrastText(theme.palette.background.paper),\r\n },\r\n activeListItemRoot: {\r\n backgroundColor: theme.palette.action.selected,\r\n },\r\n activeListItemIconRoot: {\r\n color: theme.palette.getContrastText(theme.palette.background.paper),\r\n },\r\n activeListItemTextText: {\r\n color: theme.palette.getContrastText(theme.palette.background.paper),\r\n },\r\n });\r\n\r\ninterface DrawerMenuItemProps extends WithStyles {\r\n schema: DrawerMenuItemSchema;\r\n currentLocation: string;\r\n}\r\n\r\nexport const DrawerMenuItemComponent = (props: DrawerMenuItemProps) => {\r\n const { schema, currentLocation, classes } = props;\r\n const { label, faIconName, linkUrl, activeLinkUrlRegex, onClick } = schema;\r\n\r\n const active = linkUrl && activeLinkUrlRegex && activeLinkUrlRegex.test(currentLocation);\r\n\r\n const listItemRootClass = classNames(classes.listItemRoot, active && classes.activeListItemRoot);\r\n const listItemIconRootClass = classNames(classes.listItemIconRoot, active && classes.activeListItemIconRoot);\r\n const listItemTextTextClass = classNames(classes.listItemTextText, active && classes.activeListItemTextText);\r\n\r\n // Use a Link component for the ListItem if a linkUrl is specified\r\n const ListItemLink = useMemo(\r\n () =>\r\n linkUrl\r\n ? forwardRef>((linkProps, ref) => )\r\n : undefined,\r\n [linkUrl],\r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const DrawerMenuItem = withStyles(styles)(DrawerMenuItemComponent);\r\n","import Divider from \"@material-ui/core/Divider\";\r\nimport List from \"@material-ui/core/List\";\r\nimport { createStyles, Theme, withStyles, WithStyles } from \"@material-ui/core/styles\";\r\nimport React from \"react\";\r\nimport { DrawerMenuItem } from \"./DrawerMenuItem\";\r\nimport { DrawerMenuOptions } from \"./models\";\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n bottomList: {\r\n position: \"absolute\",\r\n bottom: 0,\r\n width: \"100%\",\r\n },\r\n });\r\n\r\ninterface DrawerMenuProps extends WithStyles {\r\n options: DrawerMenuOptions;\r\n currentLocation: string;\r\n}\r\n\r\nexport const DrawerMenuComponent = (props: DrawerMenuProps) => {\r\n const { options, currentLocation, classes } = props;\r\n const { items, onHelpMenuItemClick } = options;\r\n\r\n const menuItems = items.map((item, index) => (\r\n \r\n ));\r\n\r\n return (\r\n
\r\n );\r\n};\r\n\r\nexport const AppPageFrame = withStyles(styles)(AppPageFrameComponent);\r\n","import React from \"react\";\r\nimport { StaticContext } from \"react-router\";\r\nimport { Redirect, Route, RouteComponentProps, RouteProps } from \"react-router-dom\";\r\nimport { isUserAuthorized, isUserLoading, isUserSignedIn } from \"../../auth\";\r\nimport { Loader } from \"../navigation\";\r\n\r\ninterface ProtectedRouteProps extends RouteProps {\r\n authorizationPolicies?: string[];\r\n}\r\n\r\nexport const ProtectedRouteComponent = (props: ProtectedRouteProps) => {\r\n const { component: Component, authorizationPolicies, ...rest } = props;\r\n\r\n return (\r\n ) =>\r\n isUserLoading() ? (\r\n \r\n ) : isUserSignedIn() ? (\r\n isUserAuthorized(authorizationPolicies) ? (\r\n Component && \r\n ) : (\r\n \r\n )\r\n ) : (\r\n \r\n )\r\n }\r\n />\r\n );\r\n};\r\n\r\nexport const ProtectedRoute = ProtectedRouteComponent;\r\n","import blue from \"@material-ui/core/colors/blue\";\r\nimport { SnackbarOrigin } from \"@material-ui/core/Snackbar\";\r\nimport { Theme } from \"@material-ui/core/styles\";\r\nimport createMuiTheme from \"@material-ui/core/styles/createMuiTheme\";\r\nimport createPalette from \"@material-ui/core/styles/createPalette\";\r\nimport createTypography from \"@material-ui/core/styles/createTypography\";\r\nimport { OptionsObject } from \"notistack\";\r\nimport { Reducer } from \"redux\";\r\nimport { getUserPreferences, setUserPreferences } from \"../auth\";\r\nimport { SnackbarVariants } from \"../components/snackbars\";\r\nimport { getClientConfiguration } from \"../configuration\";\r\n\r\nexport interface AppState {\r\n theme: Theme;\r\n appFrame: {\r\n height: number;\r\n contentHeight: number;\r\n };\r\n snackbarMessage?: {\r\n message: string | React.ReactNode;\r\n messageKey: string | number;\r\n messageOptions: {\r\n variant?: SnackbarVariants;\r\n anchorOrigin?: SnackbarOrigin;\r\n autoHideDuration?: number | null;\r\n };\r\n };\r\n snackbarNotifications: Array<{\r\n message: string | React.ReactNode;\r\n messageKey: string | number;\r\n messageOptions: OptionsObject;\r\n messageDismissed: boolean;\r\n }>;\r\n}\r\n\r\ninterface AppThemeUpdateAction {\r\n type: \"APP_THEME_UPDATE\";\r\n theme: Theme;\r\n}\r\n\r\ninterface AppFrameUpdateAction {\r\n type: \"APP_FRAME_UPDATE\";\r\n height: number;\r\n contentHeight: number;\r\n}\r\n\r\ninterface AppPostSnackbarMessageAction {\r\n type: \"APP_POST_SNACKBAR_MESSAGE\";\r\n message: string | React.ReactNode;\r\n messageKey: string | number;\r\n messageOptions: {\r\n variant?: SnackbarVariants;\r\n anchorOrigin?: SnackbarOrigin;\r\n autoHideDuration?: number | null;\r\n };\r\n}\r\n\r\ninterface AppPostSnackbarNotificationAction {\r\n type: \"APP_POST_SNACKBAR_NOTIFICATION\";\r\n message: string | React.ReactNode;\r\n messageKey: string | number;\r\n messageOptions: OptionsObject;\r\n}\r\n\r\ninterface AppCloseAllSnackbarNotificationsAction {\r\n type: \"APP_CLOSE_ALL_SNACKBAR_NOTIFICATIONS\";\r\n messageKeyRegexPattern?: string;\r\n}\r\n\r\ninterface AppCloseSnackbarNotificationAction {\r\n type: \"APP_CLOSE_SNACKBAR_NOTIFICATION\";\r\n messageKey: string | number;\r\n}\r\n\r\ninterface AppRemoveSnackbarNotificationAction {\r\n type: \"APP_REMOVE_SNACKBAR_NOTIFICATION\";\r\n messageKey: string | number;\r\n}\r\n\r\ntype KnownAction =\r\n | AppThemeUpdateAction\r\n | AppFrameUpdateAction\r\n | AppPostSnackbarMessageAction\r\n | AppPostSnackbarNotificationAction\r\n | AppCloseAllSnackbarNotificationsAction\r\n | AppCloseSnackbarNotificationAction\r\n | AppRemoveSnackbarNotificationAction;\r\n\r\nexport const actionCreators = {\r\n updateTheme: (themeName: string | undefined) => {\r\n if (themeName) {\r\n setUserPreferences({ theme: themeName });\r\n }\r\n return {\r\n type: \"APP_THEME_UPDATE\",\r\n theme: themeName && createTheme(themeName === \"dark\" ? \"dark\" : \"light\"),\r\n };\r\n },\r\n\r\n updateHeight: (height: number, contentHeight: number) => ({\r\n type: \"APP_FRAME_UPDATE\",\r\n height,\r\n contentHeight,\r\n }),\r\n\r\n postSnackbarMessage: (\r\n message: string | React.ReactNode,\r\n options?: {\r\n variant?: SnackbarVariants;\r\n anchorOrigin?: SnackbarOrigin;\r\n autoHideDuration?: number | null;\r\n },\r\n ) => {\r\n const messageKey = new Date().getTime() + Math.random();\r\n const messageOptions = { ...(options || {}) };\r\n\r\n return {\r\n type: \"APP_POST_SNACKBAR_MESSAGE\",\r\n message,\r\n messageKey,\r\n messageOptions,\r\n };\r\n },\r\n\r\n postSnackbarNotification: (message: string | React.ReactNode, options?: OptionsObject) => {\r\n const messageKey = (options && options.key) || new Date().getTime() + Math.random();\r\n const messageOptions = { ...(options || {}) };\r\n\r\n return {\r\n type: \"APP_POST_SNACKBAR_NOTIFICATION\",\r\n message,\r\n messageKey,\r\n messageOptions,\r\n };\r\n },\r\n\r\n closeAllSnackbarNotifications: (messageKeyRegexPattern?: string) => ({\r\n type: \"APP_CLOSE_ALL_SNACKBAR_NOTIFICATIONS\",\r\n messageKeyRegexPattern,\r\n }),\r\n\r\n closeSnackbarNotification: (messageKey: string | number) => ({\r\n type: \"APP_CLOSE_SNACKBAR_NOTIFICATION\",\r\n messageKey,\r\n }),\r\n\r\n removeSnackbarNotification: (messageKey: string | number) => ({\r\n type: \"APP_REMOVE_SNACKBAR_NOTIFICATION\",\r\n messageKey,\r\n }),\r\n};\r\n\r\nconst createTheme = (themeName?: \"light\" | \"dark\") => {\r\n const clientConfiguration = getClientConfiguration();\r\n const uiTheme = clientConfiguration && clientConfiguration.ui && clientConfiguration.ui.theme;\r\n\r\n // If the theme type was not specified, try to source it from User Preferences in local storage (if available)...\r\n if (!themeName) {\r\n const userPreferences = getUserPreferences();\r\n themeName =\r\n userPreferences && (userPreferences as any).theme\r\n ? ((userPreferences as any).theme as \"light\" | \"dark\")\r\n : (uiTheme && uiTheme.type) || \"light\";\r\n }\r\n\r\n const palette = createPalette({\r\n type: themeName,\r\n primary: {\r\n main: (uiTheme && uiTheme.colours && uiTheme.colours.primary) || blue[800],\r\n },\r\n secondary: {\r\n main: (uiTheme && uiTheme.colours && uiTheme.colours.secondary) || blue.A700,\r\n },\r\n });\r\n\r\n const theme = createMuiTheme({\r\n palette,\r\n typography: createTypography(palette, {\r\n fontFamily: \"inherit\",\r\n allVariants: {\r\n lineHeight: 1.35,\r\n },\r\n }),\r\n });\r\n\r\n return theme;\r\n};\r\n\r\nconst initialState = (): AppState => ({\r\n theme: createTheme(),\r\n appFrame: {\r\n height: 1080,\r\n contentHeight: 1080,\r\n },\r\n snackbarNotifications: [],\r\n});\r\n\r\nexport const reducer: Reducer = (state, action) => {\r\n state = state || initialState();\r\n\r\n switch (action.type) {\r\n case \"APP_THEME_UPDATE\":\r\n state = {\r\n ...state,\r\n theme: action.theme || state.theme,\r\n };\r\n break;\r\n case \"APP_FRAME_UPDATE\":\r\n state = {\r\n ...state,\r\n appFrame: {\r\n height: action.height,\r\n contentHeight: action.contentHeight,\r\n },\r\n };\r\n break;\r\n case \"APP_POST_SNACKBAR_MESSAGE\":\r\n state = {\r\n ...state,\r\n snackbarMessage: {\r\n message: action.message,\r\n messageKey: action.messageKey,\r\n messageOptions: action.messageOptions,\r\n },\r\n };\r\n break;\r\n case \"APP_POST_SNACKBAR_NOTIFICATION\":\r\n state = {\r\n ...state,\r\n snackbarNotifications: [\r\n ...state.snackbarNotifications,\r\n {\r\n message: action.message,\r\n messageKey: action.messageKey,\r\n messageOptions: action.messageOptions,\r\n messageDismissed: false,\r\n },\r\n ],\r\n };\r\n break;\r\n case \"APP_CLOSE_ALL_SNACKBAR_NOTIFICATIONS\":\r\n const messageKeyRegex = action.messageKeyRegexPattern ? new RegExp(action.messageKeyRegexPattern) : undefined;\r\n state = {\r\n ...state,\r\n snackbarNotifications: state.snackbarNotifications.map(snackbarNotification =>\r\n (messageKeyRegex\r\n ? messageKeyRegex.test(`${snackbarNotification.messageKey}`)\r\n : true)\r\n ? {\r\n ...snackbarNotification,\r\n messageDismissed: true,\r\n }\r\n : snackbarNotification,\r\n ),\r\n };\r\n break;\r\n case \"APP_CLOSE_SNACKBAR_NOTIFICATION\":\r\n state = {\r\n ...state,\r\n snackbarNotifications: state.snackbarNotifications.map(snackbarNotification =>\r\n snackbarNotification.messageKey === action.messageKey\r\n ? { ...snackbarNotification, messageDismissed: true }\r\n : snackbarNotification,\r\n ),\r\n };\r\n break;\r\n case \"APP_REMOVE_SNACKBAR_NOTIFICATION\":\r\n state = {\r\n ...state,\r\n snackbarNotifications: state.snackbarNotifications.filter(\r\n snackbarNotification => snackbarNotification.messageKey !== action.messageKey,\r\n ),\r\n };\r\n break;\r\n default:\r\n }\r\n\r\n return state;\r\n};\r\n","import { connectRouter } from \"connected-react-router\";\r\nimport { History } from \"history\";\r\nimport { combineReducers } from \"redux\";\r\nimport { reducer as oidcReducer } from \"redux-oidc\";\r\nimport { reducer as appReducer } from \"../App\";\r\n\r\nexport const createRootReducer = (reducers: {}, history: History) =>\r\n combineReducers({ ...reducers, router: connectRouter(history), app: appReducer, oidc: oidcReducer });\r\n","import { routerMiddleware } from \"connected-react-router\";\r\nimport { History } from \"history\";\r\nimport { applyMiddleware, compose, createStore, StoreEnhancer } from \"redux\";\r\nimport { loadUser } from \"redux-oidc\";\r\nimport thunk from \"redux-thunk\";\r\nimport { getUserManager } from \"../../auth\";\r\nimport { createRootReducer } from \"./rootReducerHelper\";\r\n\r\nexport const configureStore = (reducers: {}, initialState: T, history: History) => {\r\n const middleware = [thunk, routerMiddleware(history)];\r\n\r\n // In development, use the browser's Redux dev tools extension if installed\r\n const enhancers: StoreEnhancer[] = [];\r\n const isDevelopment = process.env.NODE_ENV === \"development\";\r\n if (isDevelopment && typeof window !== \"undefined\" && (window as any).devToolsExtension) {\r\n enhancers.push((window as any).devToolsExtension() as StoreEnhancer);\r\n }\r\n\r\n const store = createStore(\r\n // New root reducer with router state\r\n createRootReducer(reducers, history),\r\n initialState,\r\n compose(\r\n // For dispatching history actions\r\n applyMiddleware(...middleware),\r\n ...enhancers,\r\n ),\r\n );\r\n\r\n loadUser(store, getUserManager());\r\n\r\n return store;\r\n};\r\n","import { IconDefinition, library } from \"@fortawesome/fontawesome-svg-core\";\r\nimport { ClientUIConfiguration, getClientConfiguration } from \"../../configuration\";\r\n\r\nexport const setClientUIConfiguration = (uiConfiguration: ClientUIConfiguration, icons: IconDefinition[]) => {\r\n const clientConfiguration = getClientConfiguration();\r\n // If the Client Configuration was resolved from the window, or has otherwise been set...\r\n if (clientConfiguration) {\r\n clientConfiguration.ui = uiConfiguration;\r\n }\r\n // If there are icons to add to the library...\r\n if (icons.length) {\r\n library.add(...icons);\r\n }\r\n};\r\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","export const COMMON_MIME_TYPES = new Map([\n ['avi', 'video/avi'],\n ['gif', 'image/gif'],\n ['ico', 'image/x-icon'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['mp4', 'video/mp4'],\n ['pdf', 'application/pdf'],\n ['png', 'image/png'],\n ['zip', 'application/zip'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']\n]);\n\n\nexport function toFileWithPath(file: FileWithPath, path?: string): FileWithPath {\n const f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n const {webkitRelativePath} = file as FileWithWebkitPath;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return f;\n}\n\ninterface DOMFile extends Blob {\n readonly lastModified: number;\n readonly name: string;\n}\n\nexport interface FileWithPath extends DOMFile {\n readonly path?: string;\n}\n\ninterface FileWithWebkitPath extends File {\n readonly webkitRelativePath?: string;\n}\n\nfunction withMimeType(file: FileWithPath) {\n const {name} = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const ext = name.split('.')\n .pop()!.toLowerCase();\n const type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n}\n","import {FileWithPath, toFileWithPath} from './file';\n\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n * @param evt\n */\nexport async function fromEvent(evt: Event): Promise<(FileWithPath | DataTransferItem)[]> {\n return isDragEvt(evt) && evt.dataTransfer\n ? getDataTransferFiles(evt.dataTransfer, evt.type)\n : getInputFiles(evt);\n}\n\nfunction isDragEvt(value: any): value is DragEvent {\n return !!value.dataTransfer;\n}\n\nfunction getInputFiles(evt: Event) {\n const files = isInput(evt.target)\n ? evt.target.files\n ? fromList(evt.target.files)\n : []\n : [];\n return files.map(file => toFileWithPath(file));\n}\n\nfunction isInput(value: EventTarget | null): value is HTMLInputElement {\n return value !== null;\n}\n\nasync function getDataTransferFiles(dt: DataTransfer, type: string) {\n // IE11 does not support dataTransfer.items\n // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility\n if (dt.items) {\n const items = fromList(dt.items)\n .filter(item => item.kind === 'file');\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return items;\n }\n const files = await Promise.all(items.map(toFilePromises));\n return noIgnoredFiles(flatten(files));\n }\n\n return noIgnoredFiles(fromList(dt.files)\n .map(file => toFileWithPath(file)));\n}\n\nfunction noIgnoredFiles(files: FileWithPath[]) {\n return files.filter(file => FILES_TO_IGNORE.indexOf(file.name) === -1);\n}\n\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items: DataTransferItemList | FileList): T[] {\n const files = [];\n\n // tslint:disable: prefer-for-of\n for (let i = 0; i < items.length; i++) {\n const file = items[i];\n files.push(file);\n }\n\n return files as any;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item: DataTransferItem) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n\n const entry = item.webkitGetAsEntry();\n\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry) as any;\n }\n\n return fromDataTransferItem(item);\n}\n\nfunction flatten(items: any[]): T[] {\n return items.reduce((acc, files) => [\n ...acc,\n ...(Array.isArray(files) ? flatten(files) : [files])\n ], []);\n}\n\nfunction fromDataTransferItem(item: DataTransferItem) {\n const file = item.getAsFile();\n if (!file) {\n return Promise.reject(`${item} is not a File`);\n }\n const fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nasync function fromEntry(entry: any) {\n return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry: any) {\n const reader = entry.createReader();\n\n return new Promise((resolve, reject) => {\n const entries: Promise[] = [];\n\n function readEntries() {\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(async (batch: any[]) => {\n if (!batch.length) {\n // Done reading directory\n try {\n const files = await Promise.all(entries);\n resolve(files);\n } catch (err) {\n reject(err);\n }\n } else {\n const items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n\n // Continue reading\n readEntries();\n }\n }, (err: any) => {\n reject(err);\n });\n }\n\n readEntries();\n });\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nasync function fromFileEntry(entry: any) {\n return new Promise((resolve, reject) => {\n entry.file((file: FileWithPath) => {\n const fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, (err: any) => {\n reject(err);\n });\n });\n}\n\n// Infinite type recursion\n// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540\ninterface FileArray extends Array {}\ntype FileValue = FileWithPath\n | FileArray[];\n","function _typeof(obj) { 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); }\n\nimport accepts from 'attr-accept'; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n return file.type === 'application/x-moz-file' || accepts(file, accept);\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) return file.size >= minSize && file.size <= maxSize;else if (isDefined(minSize)) return file.size >= minSize;else if (isDefined(maxSize)) return file.size <= maxSize;\n }\n\n return true;\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple;\n\n if (!multiple && files.length > 1) {\n return false;\n }\n\n return files.every(function (file) {\n return fileAccepted(file, accept) && fileMatchSize(file, minSize, maxSize);\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === 'function') {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== 'undefined') {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === 'Files' || type === 'application/x-moz-file';\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === 'object' && item !== null && item.kind === 'file';\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf('MSIE') !== -1 || userAgent.indexOf('Trident/') !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf('Edge/') !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction 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; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _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; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
\n * \n *
Drag 'n' drop some files here, or click to select files
\n *
\n * )}\n * \n * ```\n */\n\nvar Dropzone = forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, [\"children\"]);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, [\"open\"]);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return React.createElement(Fragment, null, children(_objectSpread({}, props, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone';\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {File[]} params.rejectedFiles Rejected files\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are droppped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {File[]} rejectedFiles\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {object[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {File[]} rejectedFiles List of rejected files\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {File[]} rejectedFiles Rejected files\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n rejectedFiles: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
\n * \n *
Drag and drop some files here, or click to select files
\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are droppped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n accept = _ref2.accept,\n _ref2$disabled = _ref2.disabled,\n disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,\n _ref2$getFilesFromEve = _ref2.getFilesFromEvent,\n getFilesFromEvent = _ref2$getFilesFromEve === void 0 ? fromEvent : _ref2$getFilesFromEve,\n _ref2$maxSize = _ref2.maxSize,\n maxSize = _ref2$maxSize === void 0 ? Infinity : _ref2$maxSize,\n _ref2$minSize = _ref2.minSize,\n minSize = _ref2$minSize === void 0 ? 0 : _ref2$minSize,\n _ref2$multiple = _ref2.multiple,\n multiple = _ref2$multiple === void 0 ? true : _ref2$multiple,\n onDragEnter = _ref2.onDragEnter,\n onDragLeave = _ref2.onDragLeave,\n onDragOver = _ref2.onDragOver,\n onDrop = _ref2.onDrop,\n onDropAccepted = _ref2.onDropAccepted,\n onDropRejected = _ref2.onDropRejected,\n onFileDialogCancel = _ref2.onFileDialogCancel,\n _ref2$preventDropOnDo = _ref2.preventDropOnDocument,\n preventDropOnDocument = _ref2$preventDropOnDo === void 0 ? true : _ref2$preventDropOnDo,\n _ref2$noClick = _ref2.noClick,\n noClick = _ref2$noClick === void 0 ? false : _ref2$noClick,\n _ref2$noKeyboard = _ref2.noKeyboard,\n noKeyboard = _ref2$noKeyboard === void 0 ? false : _ref2$noKeyboard,\n _ref2$noDrag = _ref2.noDrag,\n noDrag = _ref2$noDrag === void 0 ? false : _ref2$noDrag,\n _ref2$noDragEventsBub = _ref2.noDragEventsBubbling,\n noDragEventsBubbling = _ref2$noDragEventsBub === void 0 ? false : _ref2$noDragEventsBub;\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch]); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n\n if (typeof onFileDialogCancel === 'function') {\n onFileDialogCancel();\n }\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancel]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event); // Count the dropzone and any children that are entered.\n\n if (dragTargetsRef.current.indexOf(event.target) === -1) {\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n }\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n\n if (event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (isEvtWithFiles(event) && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return target !== event.target && rootRef.current && rootRef.current.contains(target);\n });\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var acceptedFiles = [];\n var rejectedFiles = [];\n files.forEach(function (file) {\n if (fileAccepted(file, accept) && fileMatchSize(file, minSize, maxSize)) {\n acceptedFiles.push(file);\n } else {\n rejectedFiles.push(file);\n }\n });\n\n if (!multiple && acceptedFiles.length > 1) {\n rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(0))); // Reject everything and empty accepted files\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n rejectedFiles: rejectedFiles,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, rejectedFiles, event);\n }\n\n if (rejectedFiles.length > 0 && onDropRejected) {\n onDropRejected(rejectedFiles, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [multiple, accept, minSize, maxSize, getFilesFromEvent, onDrop, onDropAccepted, onDropRejected, noDragEventsBubbling]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onKeyDown = _ref3.onKeyDown,\n onFocus = _ref3.onFocus,\n onBlur = _ref3.onBlur,\n onClick = _ref3.onClick,\n onDragEnter = _ref3.onDragEnter,\n onDragOver = _ref3.onDragOver,\n onDragLeave = _ref3.onDragLeave,\n onDrop = _ref3.onDrop,\n rest = _objectWithoutProperties(_ref3, [\"refKey\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"]);\n\n return _objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb))\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}, {}, rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref4$refKey = _ref4.refKey,\n refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,\n onChange = _ref4.onChange,\n onClick = _ref4.onClick,\n rest = _objectWithoutProperties(_ref4, [\"refKey\", \"onChange\", \"onClick\"]);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread({}, inputProps, {}, rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread({}, state, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread({}, state, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread({}, state, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread({}, state, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread({}, state, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread({}, state, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread({}, state, {\n acceptedFiles: action.acceptedFiles,\n rejectedFiles: action.rejectedFiles\n });\n\n case 'reset':\n return _objectSpread({}, state, {\n isFileDialogActive: false,\n isDragActive: false,\n draggedFiles: [],\n acceptedFiles: [],\n rejectedFiles: []\n });\n\n default:\n return state;\n }\n}","export default function updateMutation(mutation, originalOffset, originalLength, newLength, prefixLength, suffixLength) {\n // three cases we can reasonably adjust - disjoint mutations that\n // happen later on where the offset will need to be changed,\n // mutations that completely contain the new one where we can adjust\n // the length, and mutations that occur partially within the new one.\n var lengthDiff = newLength - originalLength;\n var mutationAfterChange = originalOffset + originalLength <= mutation.offset;\n\n if (mutationAfterChange) {\n return Object.assign({}, mutation, {\n offset: mutation.offset + lengthDiff\n });\n }\n\n var mutationContainsChange = originalOffset >= mutation.offset && originalOffset + originalLength <= mutation.offset + mutation.length;\n\n if (mutationContainsChange) {\n return Object.assign({}, mutation, {\n length: mutation.length + lengthDiff\n });\n }\n\n var mutationWithinPrefixChange = mutation.offset >= originalOffset && mutation.offset + mutation.length <= originalOffset + originalLength && prefixLength > 0;\n\n if (mutationWithinPrefixChange) {\n return Object.assign({}, mutation, {\n offset: mutation.offset + prefixLength\n });\n }\n\n var mutationContainsPrefix = mutation.offset < originalOffset && mutation.offset + mutation.length <= originalOffset + originalLength && mutation.offset + mutation.length > originalOffset && prefixLength > 0;\n\n if (mutationContainsPrefix) {\n return [Object.assign({}, mutation, {\n length: originalOffset - mutation.offset\n }), Object.assign({}, mutation, {\n offset: originalOffset + prefixLength,\n length: mutation.offset - originalOffset + mutation.length\n })];\n }\n\n var mutationContainsSuffix = mutation.offset >= originalOffset && mutation.offset + mutation.length > originalOffset + originalLength && originalOffset + originalLength > mutation.offset && suffixLength > 0;\n\n if (mutationContainsSuffix) {\n return [Object.assign({}, mutation, {\n offset: mutation.offset + prefixLength,\n length: originalOffset + originalLength - mutation.offset\n }), Object.assign({}, mutation, {\n offset: originalOffset + originalLength + prefixLength + suffixLength,\n length: mutation.offset + mutation.length - (originalOffset + originalLength)\n })];\n }\n\n return mutation;\n}","export default (function (r1, r2) {\n if (r1.offset === r2.offset) {\n return r2.length - r1.length;\n }\n\n return r1.offset - r2.offset;\n});","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport updateMutation from './util/updateMutation';\nimport rangeSort from './util/rangeSort';\nvar ENTITY_MAP = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`',\n '\\n': ' '\n};\nexport default (function (block) {\n var blockText = _toConsumableArray(block.text);\n\n var entities = block.entityRanges.sort(rangeSort);\n var styles = block.inlineStyleRanges.sort(rangeSort);\n var resultText = '';\n\n var _loop = function _loop(index) {\n var _char = blockText[index];\n\n if (ENTITY_MAP[_char] !== undefined) {\n var encoded = ENTITY_MAP[_char];\n\n var resultIndex = _toConsumableArray(resultText).length;\n\n resultText += encoded;\n\n var updateForChar = function updateForChar(mutation) {\n return updateMutation(mutation, resultIndex, _char.length, encoded.length, 0, 0);\n };\n\n entities = entities.map(updateForChar);\n styles = styles.map(updateForChar);\n } else {\n resultText += _char;\n }\n };\n\n for (var index = 0; index < blockText.length; index++) {\n _loop(index);\n }\n\n return Object.assign({}, block, {\n text: resultText,\n inlineStyleRanges: styles,\n entityRanges: entities\n });\n});","import invariant from 'invariant';\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server'; // see http://w3c.github.io/html/syntax.html#writing-html-documents-elements\n\nvar VOID_TAGS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];\nexport default function splitReactElement(element) {\n if (VOID_TAGS.indexOf(element.type) !== -1) {\n return ReactDOMServer.renderToStaticMarkup(element);\n }\n\n var tags = ReactDOMServer.renderToStaticMarkup(React.cloneElement(element, {}, '\\r')).split('\\r');\n invariant(tags.length > 1, \"convertToHTML: Element of type \".concat(element.type, \" must render children\"));\n invariant(tags.length < 3, \"convertToHTML: Element of type \".concat(element.type, \" cannot use carriage return character\"));\n return {\n start: tags[0],\n end: tags[1]\n };\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport invariant from 'invariant';\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server';\nimport splitReactElement from './splitReactElement';\n\nfunction hasChildren(element) {\n return React.isValidElement(element) && React.Children.count(element.props.children) > 0;\n}\n\nexport default function getElementHTML(element) {\n var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (element === undefined || element === null) {\n return element;\n }\n\n if (typeof element === 'string') {\n return element;\n }\n\n if (React.isValidElement(element)) {\n if (hasChildren(element)) {\n return ReactDOMServer.renderToStaticMarkup(element);\n }\n\n var tags = splitReactElement(element);\n\n if (text !== null && _typeof(tags) === 'object') {\n var start = tags.start,\n end = tags.end;\n return start + text + end;\n }\n\n return tags;\n }\n\n invariant(Object.prototype.hasOwnProperty.call(element, 'start') && Object.prototype.hasOwnProperty.call(element, 'end'), 'convertToHTML: received conversion data without either an HTML string, ReactElement or an object with start/end tags');\n\n if (text !== null) {\n var _start = element.start,\n _end = element.end;\n return _start + text + _end;\n }\n\n return element;\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React from 'react';\nimport splitReactElement from './splitReactElement';\n\nvar getElementTagLength = function getElementTagLength(element) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'start';\n\n if (React.isValidElement(element)) {\n var splitElement = splitReactElement(element);\n\n if (typeof splitElement === 'string') {\n return 0;\n }\n\n var length = splitElement[type].length;\n var child = React.Children.toArray(element.props.children)[0];\n return length + (child && React.isValidElement(child) ? getElementTagLength(child, type) : 0);\n }\n\n if (_typeof(element) === 'object') {\n return element[type] ? element[type].length : 0;\n }\n\n return 0;\n};\n\nexport default getElementTagLength;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport updateMutation from './util/updateMutation';\nimport rangeSort from './util/rangeSort';\nimport getElementHTML from './util/getElementHTML';\nimport getElementTagLength from './util/getElementTagLength';\n\nvar converter = function converter() {\n var entity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var originalText = arguments.length > 1 ? arguments[1] : undefined;\n return originalText;\n};\n\nexport default (function (block, entityMap) {\n var entityConverter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : converter;\n\n var resultText = _toConsumableArray(block.text);\n\n var getEntityHTML = entityConverter;\n\n if (entityConverter.__isMiddleware) {\n getEntityHTML = entityConverter(converter);\n }\n\n if (Object.prototype.hasOwnProperty.call(block, 'entityRanges') && block.entityRanges.length > 0) {\n var entities = block.entityRanges.sort(rangeSort);\n var styles = block.inlineStyleRanges;\n\n var _loop = function _loop(index) {\n var entityRange = entities[index];\n var entity = entityMap[entityRange.key];\n var originalText = resultText.slice(entityRange.offset, entityRange.offset + entityRange.length).join('');\n var entityHTML = getEntityHTML(entity, originalText);\n var elementHTML = getElementHTML(entityHTML, originalText);\n var converted = void 0;\n\n if (!!elementHTML || elementHTML === '') {\n converted = _toConsumableArray(elementHTML);\n } else {\n converted = originalText;\n }\n\n var prefixLength = getElementTagLength(entityHTML, 'start');\n var suffixLength = getElementTagLength(entityHTML, 'end');\n\n var updateLaterMutation = function updateLaterMutation(mutation, mutationIndex) {\n if (mutationIndex > index || Object.prototype.hasOwnProperty.call(mutation, 'style')) {\n return updateMutation(mutation, entityRange.offset, entityRange.length, converted.length, prefixLength, suffixLength);\n }\n\n return mutation;\n };\n\n var updateLaterMutations = function updateLaterMutations(mutationList) {\n return mutationList.reduce(function (acc, mutation, mutationIndex) {\n var updatedMutation = updateLaterMutation(mutation, mutationIndex);\n\n if (Array.isArray(updatedMutation)) {\n return acc.concat(updatedMutation);\n }\n\n return acc.concat([updatedMutation]);\n }, []);\n };\n\n entities = updateLaterMutations(entities);\n styles = updateLaterMutations(styles);\n resultText = [].concat(_toConsumableArray(resultText.slice(0, entityRange.offset)), _toConsumableArray(converted), _toConsumableArray(resultText.slice(entityRange.offset + entityRange.length)));\n };\n\n for (var index = 0; index < entities.length; index++) {\n _loop(index);\n }\n\n return Object.assign({}, block, {\n text: resultText.join(''),\n inlineStyleRanges: styles,\n entityRanges: entities\n });\n }\n\n return block;\n});","export default (function (object) {\n return function (style) {\n if (typeof object === 'function') {\n return object(style);\n }\n\n return object[style];\n };\n});","export default (function (newFn, rest) {\n return function () {\n var newResult = newFn.apply(void 0, arguments);\n\n if (newResult !== undefined && newResult !== null) {\n return newResult;\n }\n\n return rest.apply(void 0, arguments);\n };\n});","import React from 'react';\nexport default function defaultInlineHTML(style) {\n switch (style) {\n case 'BOLD':\n return React.createElement(\"strong\", null);\n\n case 'ITALIC':\n return React.createElement(\"em\", null);\n\n case 'UNDERLINE':\n return React.createElement(\"u\", null);\n\n case 'CODE':\n return React.createElement(\"code\", null);\n\n default:\n return {\n start: '',\n end: ''\n };\n }\n}","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport invariant from 'invariant';\nimport styleObjectFunction from './util/styleObjectFunction';\nimport accumulateFunction from './util/accumulateFunction';\nimport getElementHTML from './util/getElementHTML';\nimport rangeSort from './util/rangeSort';\nimport defaultInlineHTML from './default/defaultInlineHTML';\n\nvar subtractStyles = function subtractStyles(original, toRemove) {\n return original.filter(function (el) {\n return !toRemove.some(function (elToRemove) {\n return elToRemove.style === el.style;\n });\n });\n};\n\nvar popEndingStyles = function popEndingStyles(styleStack, endingStyles) {\n return endingStyles.reduceRight(function (stack, style) {\n var styleToRemove = stack[stack.length - 1];\n invariant(styleToRemove.style === style.style, \"Style \".concat(styleToRemove.style, \" to be removed doesn't match expected \").concat(style.style));\n return stack.slice(0, -1);\n }, styleStack);\n};\n\nvar characterStyles = function characterStyles(offset, ranges) {\n return ranges.filter(function (range) {\n return offset >= range.offset && offset < range.offset + range.length;\n });\n};\n\nvar rangeIsSubset = function rangeIsSubset(firstRange, secondRange) {\n // returns true if the second range is a subset of the first\n var secondStartWithinFirst = firstRange.offset <= secondRange.offset;\n var secondEndWithinFirst = firstRange.offset + firstRange.length >= secondRange.offset + secondRange.length;\n return secondStartWithinFirst && secondEndWithinFirst;\n};\n\nvar latestStyleLast = function latestStyleLast(s1, s2) {\n // make sure longer-lasting styles are added first\n var s2endIndex = s2.offset + s2.length;\n var s1endIndex = s1.offset + s1.length;\n return s2endIndex - s1endIndex;\n};\n\nvar getStylesToReset = function getStylesToReset(remainingStyles, newStyles) {\n var i = 0;\n\n while (i < remainingStyles.length) {\n if (newStyles.every(rangeIsSubset.bind(null, remainingStyles[i]))) {\n i++;\n } else {\n return remainingStyles.slice(i);\n }\n }\n\n return [];\n};\n\nvar appendStartMarkup = function appendStartMarkup(inlineHTML, string, styleRange) {\n return string + getElementHTML(inlineHTML(styleRange.style)).start;\n};\n\nvar prependEndMarkup = function prependEndMarkup(inlineHTML, string, styleRange) {\n return getElementHTML(inlineHTML(styleRange.style)).end + string;\n};\n\nvar defaultCustomInlineHTML = function defaultCustomInlineHTML(next) {\n return function (style) {\n return next(style);\n };\n};\n\ndefaultCustomInlineHTML.__isMiddleware = true;\nexport default (function (rawBlock) {\n var customInlineHTML = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultCustomInlineHTML;\n invariant(rawBlock !== null && rawBlock !== undefined, 'Expected raw block to be non-null');\n var inlineHTML;\n\n if (customInlineHTML.__isMiddleware === true) {\n inlineHTML = customInlineHTML(defaultInlineHTML);\n } else {\n inlineHTML = accumulateFunction(styleObjectFunction(customInlineHTML), styleObjectFunction(defaultInlineHTML));\n }\n\n var result = '';\n var styleStack = [];\n var sortedRanges = rawBlock.inlineStyleRanges.sort(rangeSort);\n\n var originalTextArray = _toConsumableArray(rawBlock.text);\n\n for (var i = 0; i < originalTextArray.length; i++) {\n var styles = characterStyles(i, sortedRanges);\n var endingStyles = subtractStyles(styleStack, styles);\n var newStyles = subtractStyles(styles, styleStack);\n var remainingStyles = subtractStyles(styleStack, endingStyles); // reset styles: look for any already existing styles that will need to\n // end before styles that are being added on this character. to solve this\n // close out those current tags and all nested children,\n // then open new ones nested within the new styles.\n\n var resetStyles = getStylesToReset(remainingStyles, newStyles);\n var openingStyles = resetStyles.concat(newStyles).sort(latestStyleLast);\n var openingStyleTags = openingStyles.reduce(appendStartMarkup.bind(null, inlineHTML), '');\n var endingStyleTags = endingStyles.concat(resetStyles).reduce(prependEndMarkup.bind(null, inlineHTML), '');\n result += endingStyleTags + openingStyleTags + originalTextArray[i];\n styleStack = popEndingStyles(styleStack, resetStyles.concat(endingStyles));\n styleStack = styleStack.concat(openingStyles);\n invariant(styleStack.length === styles.length, \"Character \".concat(i, \": \").concat(styleStack.length - styles.length, \" styles left on stack that should no longer be there\"));\n }\n\n result = styleStack.reduceRight(function (res, openStyle) {\n return res + getElementHTML(inlineHTML(openStyle.style)).end;\n }, result);\n return result;\n});","export default (function (typeObject) {\n return function (block) {\n if (typeof typeObject === 'function') {\n // handle case where typeObject is already a function\n return typeObject(block);\n }\n\n return typeObject[block.type];\n };\n});","import invariant from 'invariant';\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server';\nimport splitReactElement from './splitReactElement';\n\nfunction hasChildren(element) {\n return React.isValidElement(element) && React.Children.count(element.props.children) > 0;\n}\n\nexport default function getBlockTags(blockHTML) {\n invariant(blockHTML !== null && blockHTML !== undefined, 'Expected block HTML value to be non-null');\n\n if (typeof blockHTML === 'string') {\n return blockHTML;\n }\n\n if (React.isValidElement(blockHTML)) {\n if (hasChildren(blockHTML)) {\n return ReactDOMServer.renderToStaticMarkup(blockHTML);\n }\n\n return splitReactElement(blockHTML);\n }\n\n if (Object.prototype.hasOwnProperty.call(blockHTML, 'element') && React.isValidElement(blockHTML.element)) {\n return Object.assign({}, blockHTML, splitReactElement(blockHTML.element));\n }\n\n invariant(Object.prototype.hasOwnProperty.call(blockHTML, 'start') && Object.prototype.hasOwnProperty.call(blockHTML, 'end'), 'convertToHTML: received block information without either a ReactElement or an object with start/end tags');\n return blockHTML;\n}","import invariant from 'invariant';\nimport React from 'react';\nimport splitReactElement from './splitReactElement';\nexport default function getNestedBlockTags(blockHTML, depth) {\n invariant(blockHTML !== null && blockHTML !== undefined, 'Expected block HTML value to be non-null');\n\n if (typeof blockHTML.nest === 'function') {\n var _splitReactElement = splitReactElement(blockHTML.nest(depth)),\n start = _splitReactElement.start,\n end = _splitReactElement.end;\n\n return Object.assign({}, blockHTML, {\n nestStart: start,\n nestEnd: end\n });\n }\n\n if (React.isValidElement(blockHTML.nest)) {\n var _splitReactElement2 = splitReactElement(blockHTML.nest),\n _start = _splitReactElement2.start,\n _end = _splitReactElement2.end;\n\n return Object.assign({}, blockHTML, {\n nestStart: _start,\n nestEnd: _end\n });\n }\n\n invariant(Object.prototype.hasOwnProperty.call(blockHTML, 'nestStart') && Object.prototype.hasOwnProperty.call(blockHTML, 'nestEnd'), 'convertToHTML: received block information without either a ReactElement or an object with start/end tags');\n return blockHTML;\n}","import React from 'react'; // based on Draft.js' custom list depth styling\n\nvar ORDERED_LIST_TYPES = ['1', 'a', 'i'];\nexport default {\n unstyled: React.createElement(\"p\", null),\n paragraph: React.createElement(\"p\", null),\n 'header-one': React.createElement(\"h1\", null),\n 'header-two': React.createElement(\"h2\", null),\n 'header-three': React.createElement(\"h3\", null),\n 'header-four': React.createElement(\"h4\", null),\n 'header-five': React.createElement(\"h5\", null),\n 'header-six': React.createElement(\"h6\", null),\n blockquote: React.createElement(\"blockquote\", null),\n 'unordered-list-item': {\n element: React.createElement(\"li\", null),\n nest: React.createElement(\"ul\", null)\n },\n 'ordered-list-item': {\n element: React.createElement(\"li\", null),\n nest: function nest(depth) {\n var type = ORDERED_LIST_TYPES[depth % 3];\n return React.createElement(\"ol\", {\n type: type\n });\n }\n },\n media: React.createElement(\"figure\", null),\n atomic: React.createElement(\"figure\", null)\n};","// import Immutable from 'immutable'; // eslint-disable-line no-unused-vars\nimport invariant from 'invariant';\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server';\nimport { convertToRaw } from 'draft-js';\nimport encodeBlock from './encodeBlock';\nimport blockEntities from './blockEntities';\nimport blockInlineStyles from './blockInlineStyles';\nimport accumulateFunction from './util/accumulateFunction';\nimport blockTypeObjectFunction from './util/blockTypeObjectFunction';\nimport getBlockTags from './util/getBlockTags';\nimport getNestedBlockTags from './util/getNestedBlockTags';\nimport defaultBlockHTML from './default/defaultBlockHTML';\n\nvar defaultEntityToHTML = function defaultEntityToHTML(entity, originalText) {\n return originalText;\n};\n\nvar convertToHTML = function convertToHTML(_ref) {\n var _ref$styleToHTML = _ref.styleToHTML,\n styleToHTML = _ref$styleToHTML === void 0 ? {} : _ref$styleToHTML,\n _ref$blockToHTML = _ref.blockToHTML,\n blockToHTML = _ref$blockToHTML === void 0 ? {} : _ref$blockToHTML,\n _ref$entityToHTML = _ref.entityToHTML,\n entityToHTML = _ref$entityToHTML === void 0 ? defaultEntityToHTML : _ref$entityToHTML;\n return function (contentState) {\n invariant(contentState !== null && contentState !== undefined, 'Expected contentState to be non-null');\n var getBlockHTML;\n\n if (blockToHTML.__isMiddleware === true) {\n getBlockHTML = blockToHTML(blockTypeObjectFunction(defaultBlockHTML));\n } else {\n getBlockHTML = accumulateFunction(blockTypeObjectFunction(blockToHTML), blockTypeObjectFunction(defaultBlockHTML));\n }\n\n var rawState = convertToRaw(contentState);\n var listStack = [];\n var result = rawState.blocks.map(function (block) {\n var type = block.type,\n depth = block.depth;\n var closeNestTags = '';\n var openNestTags = '';\n var blockHTMLResult = getBlockHTML(block);\n\n if (!blockHTMLResult) {\n throw new Error(\"convertToHTML: missing HTML definition for block with type \".concat(block.type));\n }\n\n if (!blockHTMLResult.nest) {\n // this block can't be nested, so reset all nesting if necessary\n closeNestTags = listStack.reduceRight(function (string, nestedBlock) {\n return string + getNestedBlockTags(getBlockHTML(nestedBlock), depth).nestEnd;\n }, '');\n listStack = [];\n } else {\n while (depth + 1 !== listStack.length || type !== listStack[depth].type) {\n if (depth + 1 === listStack.length) {\n // depth is right but doesn't match type\n var blockToClose = listStack[depth];\n closeNestTags += getNestedBlockTags(getBlockHTML(blockToClose), depth).nestEnd;\n openNestTags += getNestedBlockTags(getBlockHTML(block), depth).nestStart;\n listStack[depth] = block;\n } else if (depth + 1 < listStack.length) {\n var _blockToClose = listStack[listStack.length - 1];\n closeNestTags += getNestedBlockTags(getBlockHTML(_blockToClose), depth).nestEnd;\n listStack = listStack.slice(0, -1);\n } else {\n openNestTags += getNestedBlockTags(getBlockHTML(block), depth).nestStart;\n listStack.push(block);\n }\n }\n }\n\n var innerHTML = blockInlineStyles(blockEntities(encodeBlock(block), rawState.entityMap, entityToHTML), styleToHTML);\n var blockHTML = getBlockTags(getBlockHTML(block));\n var html;\n\n if (typeof blockHTML === 'string') {\n html = blockHTML;\n } else {\n html = blockHTML.start + innerHTML + blockHTML.end;\n }\n\n if (innerHTML.length === 0 && Object.prototype.hasOwnProperty.call(blockHTML, 'empty')) {\n if (React.isValidElement(blockHTML.empty)) {\n html = ReactDOMServer.renderToStaticMarkup(blockHTML.empty);\n } else {\n html = blockHTML.empty;\n }\n }\n\n return closeNestTags + openNestTags + html;\n }).join('');\n result = listStack.reduce(function (res, nestBlock) {\n return res + getNestedBlockTags(getBlockHTML(nestBlock), nestBlock.depth).nestEnd;\n }, result);\n return result;\n };\n};\n\nexport default (function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 1 && Object.prototype.hasOwnProperty.call(args[0], '_map') && args[0].getBlockMap != null) {\n // skip higher-order function and use defaults\n return convertToHTML({}).apply(void 0, args);\n }\n\n return convertToHTML.apply(void 0, args);\n});","var fallback = function fallback(html) {\n var doc = document.implementation.createHTMLDocument('');\n doc.documentElement.innerHTML = html;\n return doc;\n};\n\nexport default function parseHTML(html) {\n var doc;\n\n if (typeof DOMParser !== 'undefined') {\n var parser = new DOMParser();\n doc = parser.parseFromString(html, 'text/html');\n\n if (doc === null || doc.body === null) {\n doc = fallback(html);\n }\n } else {\n doc = fallback(html);\n }\n\n return doc.body;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the /src directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\nimport { List, OrderedSet, Map } from 'immutable';\nimport { ContentState, CharacterMetadata, ContentBlock, Entity, BlockMapBuilder, genKey, SelectionState } from 'draft-js';\nimport getSafeBodyFromHTML from './util/parseHTML';\nimport rangeSort from './util/rangeSort';\nvar NBSP = ' ';\nvar SPACE = ' '; // Arbitrary max indent\n\nvar MAX_DEPTH = 4; // used for replacing characters in HTML\n\n/* eslint-disable no-control-regex */\n\nvar REGEX_CR = new RegExp('\\r', 'g');\nvar REGEX_LF = new RegExp('\\n', 'g');\nvar REGEX_NBSP = new RegExp(NBSP, 'g');\nvar REGEX_BLOCK_DELIMITER = new RegExp('\\r', 'g');\n/* eslint-enable no-control-regex */\n// Block tag flow is different because LIs do not have\n// a deterministic style ;_;\n\nvar blockTags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'blockquote', 'pre'];\nvar inlineTags = {\n b: 'BOLD',\n code: 'CODE',\n del: 'STRIKETHROUGH',\n em: 'ITALIC',\n i: 'ITALIC',\n s: 'STRIKETHROUGH',\n strike: 'STRIKETHROUGH',\n strong: 'BOLD',\n u: 'UNDERLINE'\n};\n\nvar handleMiddleware = function handleMiddleware(maybeMiddleware, base) {\n if (maybeMiddleware && maybeMiddleware.__isMiddleware === true) {\n return maybeMiddleware(base);\n }\n\n return maybeMiddleware;\n};\n\nvar defaultHTMLToBlock = function defaultHTMLToBlock(nodeName, node, lastList) {\n return undefined;\n};\n\nvar defaultHTMLToStyle = function defaultHTMLToStyle(nodeName, node, currentStyle) {\n return currentStyle;\n};\n\nvar defaultHTMLToEntity = function defaultHTMLToEntity(nodeName, node) {\n return undefined;\n};\n\nvar defaultTextToEntity = function defaultTextToEntity(text) {\n return [];\n};\n\nvar nullthrows = function nullthrows(x) {\n if (x != null) {\n return x;\n }\n\n throw new Error('Got unexpected null or undefined');\n};\n\nvar sanitizeDraftText = function sanitizeDraftText(input) {\n return input.replace(REGEX_BLOCK_DELIMITER, '');\n};\n\nfunction getEmptyChunk() {\n return {\n text: '',\n inlines: [],\n entities: [],\n blocks: []\n };\n}\n\nfunction getWhitespaceChunk(inEntity) {\n var entities = new Array(1);\n\n if (inEntity) {\n entities[0] = inEntity;\n }\n\n return {\n text: SPACE,\n inlines: [OrderedSet()],\n entities: entities,\n blocks: []\n };\n}\n\nfunction getSoftNewlineChunk(block, depth) {\n var flat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Map();\n\n if (flat === true) {\n return {\n text: '\\r',\n inlines: [OrderedSet()],\n entities: new Array(1),\n blocks: [{\n type: block,\n data: data,\n depth: Math.max(0, Math.min(MAX_DEPTH, depth))\n }],\n isNewline: true\n };\n }\n\n return {\n text: '\\n',\n inlines: [OrderedSet()],\n entities: new Array(1),\n blocks: []\n };\n}\n\nfunction getBlockDividerChunk(block, depth) {\n var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Map();\n return {\n text: '\\r',\n inlines: [OrderedSet()],\n entities: new Array(1),\n blocks: [{\n type: block,\n data: data,\n depth: Math.max(0, Math.min(MAX_DEPTH, depth))\n }]\n };\n}\n\nfunction getBlockTypeForTag(tag, lastList) {\n switch (tag) {\n case 'h1':\n return 'header-one';\n\n case 'h2':\n return 'header-two';\n\n case 'h3':\n return 'header-three';\n\n case 'h4':\n return 'header-four';\n\n case 'h5':\n return 'header-five';\n\n case 'h6':\n return 'header-six';\n\n case 'li':\n if (lastList === 'ol') {\n return 'ordered-list-item';\n }\n\n return 'unordered-list-item';\n\n case 'blockquote':\n return 'blockquote';\n\n case 'pre':\n return 'code-block';\n\n case 'div':\n case 'p':\n return 'unstyled';\n\n default:\n return null;\n }\n}\n\nfunction baseCheckBlockType(nodeName, node, lastList) {\n return getBlockTypeForTag(nodeName, lastList);\n}\n\nfunction processInlineTag(tag, node, currentStyle) {\n var styleToCheck = inlineTags[tag];\n\n if (styleToCheck) {\n currentStyle = currentStyle.add(styleToCheck).toOrderedSet();\n } else if (node instanceof HTMLElement) {\n var htmlElement = node;\n currentStyle = currentStyle.withMutations(function (style) {\n if (htmlElement.style.fontWeight === 'bold') {\n style.add('BOLD');\n }\n\n if (htmlElement.style.fontStyle === 'italic') {\n style.add('ITALIC');\n }\n\n if (htmlElement.style.textDecoration === 'underline') {\n style.add('UNDERLINE');\n }\n\n if (htmlElement.style.textDecoration === 'line-through') {\n style.add('STRIKETHROUGH');\n }\n }).toOrderedSet();\n }\n\n return currentStyle;\n}\n\nfunction baseProcessInlineTag(tag, node) {\n var inlineStyles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : OrderedSet();\n return processInlineTag(tag, node, inlineStyles);\n}\n\nfunction joinChunks(A, B) {\n var flat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // Sometimes two blocks will touch in the DOM and we need to strip the\n // extra delimiter to preserve niceness.\n var firstInB = B.text.slice(0, 1);\n var lastInA = A.text.slice(-1);\n var adjacentDividers = lastInA === '\\r' && firstInB === '\\r';\n var isJoiningBlocks = A.text !== '\\r' && B.text !== '\\r'; // when joining two full blocks like this we want to pop one divider\n\n var addingNewlineToEmptyBlock = A.text === '\\r' && !A.isNewline && B.isNewline; // when joining a newline to an empty block we want to remove the newline\n\n if (adjacentDividers && (isJoiningBlocks || addingNewlineToEmptyBlock)) {\n A.text = A.text.slice(0, -1);\n A.inlines.pop();\n A.entities.pop();\n A.blocks.pop();\n } // Kill whitespace after blocks if flat mode is on\n\n\n if (A.text.slice(-1) === '\\r' && flat === true) {\n if (B.text === SPACE || B.text === '\\n') {\n return A;\n } else if (firstInB === SPACE || firstInB === '\\n') {\n B.text = B.text.slice(1);\n B.inlines.shift();\n B.entities.shift();\n }\n }\n\n var isNewline = A.text.length === 0 && B.isNewline;\n return {\n text: A.text + B.text,\n inlines: A.inlines.concat(B.inlines),\n entities: A.entities.concat(B.entities),\n blocks: A.blocks.concat(B.blocks),\n isNewline: isNewline\n };\n}\n/*\n * Check to see if we have anything like
... to create\n * block tags from. If we do, we can use those and ignore
tags. If we\n * don't, we can treat
tags as meaningful (unstyled) blocks.\n */\n\n\nfunction containsSemanticBlockMarkup(html) {\n return blockTags.some(function (tag) {\n return html.indexOf(\"<\".concat(tag)) !== -1;\n });\n}\n\nfunction genFragment(node, inlineStyle, lastList, inBlock, fragmentBlockTags, depth, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, inEntity) {\n var nodeName = node.nodeName.toLowerCase();\n var newBlock = false;\n var nextBlockType = 'unstyled'; // Base Case\n\n if (nodeName === '#text') {\n var text = node.textContent;\n\n if (text.trim() === '' && inBlock === null) {\n return getEmptyChunk();\n }\n\n if (text.trim() === '' && inBlock !== 'code-block') {\n return getWhitespaceChunk(inEntity);\n }\n\n if (inBlock !== 'code-block') {\n // Can't use empty string because MSWord\n text = text.replace(REGEX_LF, SPACE);\n }\n\n var entities = Array(text.length).fill(inEntity);\n var offsetChange = 0;\n var textEntities = checkEntityText(text, createEntity, getEntity, mergeEntityData, replaceEntityData).sort(rangeSort);\n textEntities.forEach(function (_ref) {\n var entity = _ref.entity,\n offset = _ref.offset,\n length = _ref.length,\n result = _ref.result;\n var adjustedOffset = offset + offsetChange;\n\n if (result === null || result === undefined) {\n result = text.substr(adjustedOffset, length);\n }\n\n var textArray = text.split('');\n textArray.splice.bind(textArray, adjustedOffset, length).apply(textArray, result.split(''));\n text = textArray.join('');\n entities.splice.bind(entities, adjustedOffset, length).apply(entities, Array(result.length).fill(entity));\n offsetChange += result.length - length;\n });\n return {\n text: text,\n inlines: Array(text.length).fill(inlineStyle),\n entities: entities,\n blocks: []\n };\n } // BR tags\n\n\n if (nodeName === 'br') {\n var _blockType = inBlock;\n\n if (_blockType === null) {\n // BR tag is at top level, treat it as an unstyled block\n return getSoftNewlineChunk('unstyled', depth, true);\n }\n\n return getSoftNewlineChunk(_blockType || 'unstyled', depth, options.flat);\n }\n\n var chunk = getEmptyChunk();\n var newChunk = null; // Inline tags\n\n inlineStyle = processInlineTag(nodeName, node, inlineStyle);\n inlineStyle = processCustomInlineStyles(nodeName, node, inlineStyle); // Handle lists\n\n if (nodeName === 'ul' || nodeName === 'ol') {\n if (lastList) {\n depth += 1;\n }\n\n lastList = nodeName;\n inBlock = null;\n } // Block Tags\n\n\n var blockInfo = checkBlockType(nodeName, node, lastList, inBlock);\n var blockType;\n var blockDataMap;\n\n if (blockInfo === false) {\n return getEmptyChunk();\n }\n\n blockInfo = blockInfo || {};\n\n if (typeof blockInfo === 'string') {\n blockType = blockInfo;\n blockDataMap = Map();\n } else {\n blockType = typeof blockInfo === 'string' ? blockInfo : blockInfo.type;\n blockDataMap = blockInfo.data ? Map(blockInfo.data) : Map();\n }\n\n if (!inBlock && (fragmentBlockTags.indexOf(nodeName) !== -1 || blockType)) {\n chunk = getBlockDividerChunk(blockType || getBlockTypeForTag(nodeName, lastList), depth, blockDataMap);\n inBlock = blockType || getBlockTypeForTag(nodeName, lastList);\n newBlock = true;\n } else if (lastList && (inBlock === 'ordered-list-item' || inBlock === 'unordered-list-item') && nodeName === 'li') {\n var listItemBlockType = getBlockTypeForTag(nodeName, lastList);\n chunk = getBlockDividerChunk(listItemBlockType, depth);\n inBlock = listItemBlockType;\n newBlock = true;\n nextBlockType = lastList === 'ul' ? 'unordered-list-item' : 'ordered-list-item';\n } else if (inBlock && inBlock !== 'atomic' && blockType === 'atomic') {\n inBlock = blockType;\n newBlock = true;\n chunk = getSoftNewlineChunk(blockType, depth, true, // atomic blocks within non-atomic blocks must always be split out\n blockDataMap);\n } // Recurse through children\n\n\n var child = node.firstChild; // hack to allow conversion of atomic blocks from HTML (e.g. ). since metadata must be stored on an entity text\n // must exist for the entity to apply to. the way chunks are joined strips\n // whitespace at the end so it cannot be a space character.\n\n if (child == null && inEntity && (blockType === 'atomic' || inBlock === 'atomic')) {\n child = document.createTextNode('a');\n }\n\n if (child != null) {\n nodeName = child.nodeName.toLowerCase();\n }\n\n var entityId = null;\n\n while (child) {\n entityId = checkEntityNode(nodeName, child, createEntity, getEntity, mergeEntityData, replaceEntityData);\n newChunk = genFragment(child, inlineStyle, lastList, inBlock, fragmentBlockTags, depth, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, entityId || inEntity);\n chunk = joinChunks(chunk, newChunk, options.flat);\n var sibling = child.nextSibling; // Put in a newline to break up blocks inside blocks\n\n if (sibling && fragmentBlockTags.indexOf(nodeName) >= 0 && inBlock) {\n var newBlockInfo = checkBlockType(nodeName, child, lastList, inBlock);\n var newBlockType = void 0;\n var newBlockData = void 0;\n\n if (newBlockInfo !== false) {\n newBlockInfo = newBlockInfo || {};\n\n if (typeof newBlockInfo === 'string') {\n newBlockType = newBlockInfo;\n newBlockData = Map();\n } else {\n newBlockType = newBlockInfo.type || getBlockTypeForTag(nodeName, lastList);\n newBlockData = newBlockInfo.data ? Map(newBlockInfo.data) : Map();\n }\n\n chunk = joinChunks(chunk, getSoftNewlineChunk(newBlockType, depth, options.flat, newBlockData), options.flat);\n }\n }\n\n if (sibling) {\n nodeName = sibling.nodeName.toLowerCase();\n }\n\n child = sibling;\n }\n\n if (newBlock) {\n chunk = joinChunks(chunk, getBlockDividerChunk(nextBlockType, depth, Map()), options.flat);\n }\n\n return chunk;\n}\n\nfunction getChunkForHTML(html, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, DOMBuilder) {\n html = html.trim().replace(REGEX_CR, '').replace(REGEX_NBSP, SPACE);\n var safeBody = DOMBuilder(html);\n\n if (!safeBody) {\n return null;\n } // Sometimes we aren't dealing with content that contains nice semantic\n // tags. In this case, use divs to separate everything out into paragraphs\n // and hope for the best.\n\n\n var workingBlocks = containsSemanticBlockMarkup(html) ? blockTags.concat(['div']) : ['div']; // Start with -1 block depth to offset the fact that we are passing in a fake\n // UL block to sta rt with.\n\n var chunk = genFragment(safeBody, OrderedSet(), 'ul', null, workingBlocks, -1, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options); // join with previous block to prevent weirdness on paste\n\n if (chunk.text.indexOf('\\r') === 0) {\n chunk = {\n text: chunk.text.slice(1),\n inlines: chunk.inlines.slice(1),\n entities: chunk.entities.slice(1),\n blocks: chunk.blocks\n };\n } // Kill block delimiter at the end\n\n\n if (chunk.text.slice(-1) === '\\r') {\n chunk.text = chunk.text.slice(0, -1);\n chunk.inlines = chunk.inlines.slice(0, -1);\n chunk.entities = chunk.entities.slice(0, -1);\n chunk.blocks.pop();\n } // If we saw no block tags, put an unstyled one in\n\n\n if (chunk.blocks.length === 0) {\n chunk.blocks.push({\n type: 'unstyled',\n data: Map(),\n depth: 0\n });\n } // Sometimes we start with text that isn't in a block, which is then\n // followed by blocks. Need to fix up the blocks to add in\n // an unstyled block for this content\n\n\n if (chunk.text.split('\\r').length === chunk.blocks.length + 1) {\n chunk.blocks.unshift({\n type: 'unstyled',\n data: Map(),\n depth: 0\n });\n }\n\n return chunk;\n}\n\nfunction convertFromHTMLtoContentBlocks(html, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, DOMBuilder, generateKey) {\n // Be ABSOLUTELY SURE that the dom builder you pass hare won't execute\n // arbitrary code in whatever environment you're running this in. For an\n // example of how we try to do this in-browser, see getSafeBodyFromHTML.\n var chunk = getChunkForHTML(html, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, DOMBuilder, generateKey);\n\n if (chunk == null) {\n return [];\n }\n\n var start = 0;\n return chunk.text.split('\\r').map(function (textBlock, blockIndex) {\n // Make absolutely certain that our text is acceptable.\n textBlock = sanitizeDraftText(textBlock);\n var end = start + textBlock.length;\n var inlines = nullthrows(chunk).inlines.slice(start, end);\n var entities = nullthrows(chunk).entities.slice(start, end);\n var characterList = List(inlines.map(function (style, entityIndex) {\n var data = {\n style: style,\n entity: null\n };\n\n if (entities[entityIndex]) {\n data.entity = entities[entityIndex];\n }\n\n return CharacterMetadata.create(data);\n }));\n start = end + 1;\n return new ContentBlock({\n key: generateKey(),\n type: nullthrows(chunk).blocks[blockIndex].type,\n data: nullthrows(chunk).blocks[blockIndex].data,\n depth: nullthrows(chunk).blocks[blockIndex].depth,\n text: textBlock,\n characterList: characterList\n });\n });\n}\n\nvar convertFromHTML = function convertFromHTML(_ref2) {\n var _ref2$htmlToStyle = _ref2.htmlToStyle,\n htmlToStyle = _ref2$htmlToStyle === void 0 ? defaultHTMLToStyle : _ref2$htmlToStyle,\n _ref2$htmlToEntity = _ref2.htmlToEntity,\n htmlToEntity = _ref2$htmlToEntity === void 0 ? defaultHTMLToEntity : _ref2$htmlToEntity,\n _ref2$textToEntity = _ref2.textToEntity,\n textToEntity = _ref2$textToEntity === void 0 ? defaultTextToEntity : _ref2$textToEntity,\n _ref2$htmlToBlock = _ref2.htmlToBlock,\n htmlToBlock = _ref2$htmlToBlock === void 0 ? defaultHTMLToBlock : _ref2$htmlToBlock;\n return function (html) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n flat: false\n };\n var DOMBuilder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getSafeBodyFromHTML;\n var generateKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : genKey;\n var contentState = ContentState.createFromText('');\n\n var createEntityWithContentState = function createEntityWithContentState() {\n if (contentState.createEntity) {\n var _contentState;\n\n contentState = (_contentState = contentState).createEntity.apply(_contentState, arguments);\n return contentState.getLastCreatedEntityKey();\n }\n\n return Entity.create.apply(Entity, arguments);\n };\n\n var getEntityWithContentState = function getEntityWithContentState() {\n if (contentState.getEntity) {\n var _contentState2;\n\n return (_contentState2 = contentState).getEntity.apply(_contentState2, arguments);\n }\n\n return Entity.get.apply(Entity, arguments);\n };\n\n var mergeEntityDataWithContentState = function mergeEntityDataWithContentState() {\n if (contentState.mergeEntityData) {\n var _contentState3;\n\n contentState = (_contentState3 = contentState).mergeEntityData.apply(_contentState3, arguments);\n return;\n }\n\n Entity.mergeData.apply(Entity, arguments);\n };\n\n var replaceEntityDataWithContentState = function replaceEntityDataWithContentState() {\n if (contentState.replaceEntityData) {\n var _contentState4;\n\n contentState = (_contentState4 = contentState).replaceEntityData.apply(_contentState4, arguments);\n return;\n }\n\n Entity.replaceData.apply(Entity, arguments);\n };\n\n var contentBlocks = convertFromHTMLtoContentBlocks(html, handleMiddleware(htmlToStyle, baseProcessInlineTag), handleMiddleware(htmlToEntity, defaultHTMLToEntity), handleMiddleware(textToEntity, defaultTextToEntity), handleMiddleware(htmlToBlock, baseCheckBlockType), createEntityWithContentState, getEntityWithContentState, mergeEntityDataWithContentState, replaceEntityDataWithContentState, options, DOMBuilder, generateKey);\n var blockMap = BlockMapBuilder.createFromArray(contentBlocks);\n var firstBlockKey = contentBlocks[0].getKey();\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: SelectionState.createEmpty(firstBlockKey),\n selectionAfter: SelectionState.createEmpty(firstBlockKey)\n });\n };\n};\n\nexport default (function () {\n if (arguments.length >= 1 && typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n return convertFromHTML({}).apply(void 0, arguments);\n }\n\n return convertFromHTML.apply(void 0, arguments);\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { refType } from '@material-ui/utils';\nimport Input from '../Input';\nimport FilledInput from '../FilledInput';\nimport OutlinedInput from '../OutlinedInput';\nimport InputLabel from '../InputLabel';\nimport FormControl from '../FormControl';\nimport FormHelperText from '../FormHelperText';\nimport Select from '../Select';\nimport withStyles from '../styles/withStyles';\nvar variantComponent = {\n standard: Input,\n filled: FilledInput,\n outlined: OutlinedInput\n};\nexport var styles = {\n /* Styles applied to the root element. */\n root: {}\n};\n/**\n * The `TextField` is a convenience wrapper for the most common cases (80%).\n * It cannot be all things to all people, otherwise the API would grow out of control.\n *\n * ## Advanced Configuration\n *\n * It's important to understand that the text field is a simple abstraction\n * on top of the following components:\n *\n * - [FormControl](/api/form-control/)\n * - [InputLabel](/api/input-label/)\n * - [FilledInput](/api/filled-input/)\n * - [OutlinedInput](/api/outlined-input/)\n * - [Input](/api/input/)\n * - [FormHelperText](/api/form-helper-text/)\n *\n * If you wish to alter the props applied to the `input` element, you can do so as follows:\n *\n * ```jsx\n * const inputProps = {\n * step: 300,\n * };\n *\n * return ;\n * ```\n *\n * For advanced cases, please look at the source of TextField by clicking on the\n * \"Edit this page\" button above. Consider either:\n *\n * - using the upper case props for passing values directly to the components\n * - using the underlying components directly as shown in the demos\n */\n\nvar TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {\n var autoComplete = props.autoComplete,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus,\n children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'primary' : _props$color,\n defaultValue = props.defaultValue,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$error = props.error,\n error = _props$error === void 0 ? false : _props$error,\n FormHelperTextProps = props.FormHelperTextProps,\n _props$fullWidth = props.fullWidth,\n fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,\n helperText = props.helperText,\n hiddenLabel = props.hiddenLabel,\n id = props.id,\n InputLabelProps = props.InputLabelProps,\n inputProps = props.inputProps,\n InputProps = props.InputProps,\n inputRef = props.inputRef,\n label = props.label,\n _props$multiline = props.multiline,\n multiline = _props$multiline === void 0 ? false : _props$multiline,\n name = props.name,\n onBlur = props.onBlur,\n onChange = props.onChange,\n onFocus = props.onFocus,\n placeholder = props.placeholder,\n _props$required = props.required,\n required = _props$required === void 0 ? false : _props$required,\n rows = props.rows,\n rowsMax = props.rowsMax,\n _props$select = props.select,\n select = _props$select === void 0 ? false : _props$select,\n SelectProps = props.SelectProps,\n type = props.type,\n value = props.value,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'standard' : _props$variant,\n other = _objectWithoutProperties(props, [\"autoComplete\", \"autoFocus\", \"children\", \"classes\", \"className\", \"color\", \"defaultValue\", \"disabled\", \"error\", \"FormHelperTextProps\", \"fullWidth\", \"helperText\", \"hiddenLabel\", \"id\", \"InputLabelProps\", \"inputProps\", \"InputProps\", \"inputRef\", \"label\", \"multiline\", \"name\", \"onBlur\", \"onChange\", \"onFocus\", \"placeholder\", \"required\", \"rows\", \"rowsMax\", \"select\", \"SelectProps\", \"type\", \"value\", \"variant\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (select && !children) {\n console.error('Material-UI: `children` must be passed when using the `TextField` component with `select`.');\n }\n }\n\n var InputMore = {};\n\n if (variant === 'outlined') {\n if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {\n InputMore.notched = InputLabelProps.shrink;\n }\n\n if (label) {\n var _InputLabelProps$requ;\n\n var displayRequired = (_InputLabelProps$requ = InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.required) !== null && _InputLabelProps$requ !== void 0 ? _InputLabelProps$requ : required;\n InputMore.label = /*#__PURE__*/React.createElement(React.Fragment, null, label, displayRequired && \"\\xA0*\");\n }\n }\n\n if (select) {\n // unset defaults from textbox inputs\n if (!SelectProps || !SelectProps.native) {\n InputMore.id = undefined;\n }\n\n InputMore['aria-describedby'] = undefined;\n }\n\n var helperTextId = helperText && id ? \"\".concat(id, \"-helper-text\") : undefined;\n var inputLabelId = label && id ? \"\".concat(id, \"-label\") : undefined;\n var InputComponent = variantComponent[variant];\n var InputElement = /*#__PURE__*/React.createElement(InputComponent, _extends({\n \"aria-describedby\": helperTextId,\n autoComplete: autoComplete,\n autoFocus: autoFocus,\n defaultValue: defaultValue,\n fullWidth: fullWidth,\n multiline: multiline,\n name: name,\n rows: rows,\n rowsMax: rowsMax,\n type: type,\n value: value,\n id: id,\n inputRef: inputRef,\n onBlur: onBlur,\n onChange: onChange,\n onFocus: onFocus,\n placeholder: placeholder,\n inputProps: inputProps\n }, InputMore, InputProps));\n return /*#__PURE__*/React.createElement(FormControl, _extends({\n className: clsx(classes.root, className),\n disabled: disabled,\n error: error,\n fullWidth: fullWidth,\n hiddenLabel: hiddenLabel,\n ref: ref,\n required: required,\n color: color,\n variant: variant\n }, other), label && /*#__PURE__*/React.createElement(InputLabel, _extends({\n htmlFor: id,\n id: inputLabelId\n }, InputLabelProps), label), select ? /*#__PURE__*/React.createElement(Select, _extends({\n \"aria-describedby\": helperTextId,\n id: id,\n labelId: inputLabelId,\n value: value,\n input: InputElement\n }, SelectProps), children) : InputElement, helperText && /*#__PURE__*/React.createElement(FormHelperText, _extends({\n id: helperTextId\n }, FormHelperTextProps), helperText));\n});\nprocess.env.NODE_ENV !== \"production\" ? TextField.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoComplete: PropTypes.string,\n\n /**\n * If `true`, the `input` element will be focused during the first mount.\n */\n autoFocus: PropTypes.bool,\n\n /**\n * @ignore\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['primary', 'secondary']),\n\n /**\n * The default value of the `input` element.\n */\n defaultValue: PropTypes.any,\n\n /**\n * If `true`, the `input` element will be disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the label will be displayed in an error state.\n */\n error: PropTypes.bool,\n\n /**\n * Props applied to the [`FormHelperText`](/api/form-helper-text/) element.\n */\n FormHelperTextProps: PropTypes.object,\n\n /**\n * If `true`, the input will take up the full width of its container.\n */\n fullWidth: PropTypes.bool,\n\n /**\n * The helper text content.\n */\n helperText: PropTypes.node,\n\n /**\n * @ignore\n */\n hiddenLabel: PropTypes.bool,\n\n /**\n * The id of the `input` element.\n * Use this prop to make `label` and `helperText` accessible for screen readers.\n */\n id: PropTypes.string,\n\n /**\n * Props applied to the [`InputLabel`](/api/input-label/) element.\n */\n InputLabelProps: PropTypes.object,\n\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n\n /**\n * Props applied to the Input element.\n * It will be a [`FilledInput`](/api/filled-input/),\n * [`OutlinedInput`](/api/outlined-input/) or [`Input`](/api/input/)\n * component depending on the `variant` prop value.\n */\n InputProps: PropTypes.object,\n\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n\n /**\n * The label content.\n */\n label: PropTypes.node,\n\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n */\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n\n /**\n * If `true`, a textarea element will be rendered instead of an input.\n */\n multiline: PropTypes.bool,\n\n /**\n * Name attribute of the `input` element.\n */\n name: PropTypes.string,\n\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * Callback fired when the value is changed.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n */\n onChange: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n\n /**\n * The short hint displayed in the input before the user enters a value.\n */\n placeholder: PropTypes.string,\n\n /**\n * If `true`, the label is displayed as required and the `input` element` will be required.\n */\n required: PropTypes.bool,\n\n /**\n * Number of rows to display when multiline option is set to true.\n */\n rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Maximum number of rows to display when multiline option is set to true.\n */\n rowsMax: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Render a [`Select`](/api/select/) element while passing the Input element to `Select` as `input` parameter.\n * If this option is set you must pass the options of the select as children.\n */\n select: PropTypes.bool,\n\n /**\n * Props applied to the [`Select`](/api/select/) element.\n */\n SelectProps: PropTypes.object,\n\n /**\n * The size of the text field.\n */\n size: PropTypes.oneOf(['medium', 'small']),\n\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type: PropTypes.string,\n\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value: PropTypes.any,\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiTextField'\n})(TextField);","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\n","import {IMPORT, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset:\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d m s\n\t\t\t\t\t\t\t\t\tcase 100: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = element.parent === children[0]; // in nested rules comments become children of the \"auto-inserted\" rule\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? children[0].children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if ( key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport default createCache;\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n var maybeStyles = cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport default murmur2;\n","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport default unitlessKeys;\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","import * as React from 'react';\nimport { useLayoutEffect } from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import { createContext, useContext, forwardRef, createElement, Fragment } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar hasOwnProperty = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = useContext(ThemeContext);\n return /*#__PURE__*/createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nexport { CacheProvider as C, Emotion as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwnProperty as h, useTheme as u, withEmotionCache as w };\n","import { createElement, useContext, useRef, Fragment } from 'react';\nimport '@emotion/cache';\nimport { h as hasOwnProperty, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext } from './emotion-element-6a883da9.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-6a883da9.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport 'hoist-non-react-statics';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.10.5\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": \"./macro.js\"\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.js\",\n\t\t\"macro.d.ts\",\n\t\t\"macro.js.flow\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.10.5\",\n\t\t\"@emotion/cache\": \"^11.10.5\",\n\t\t\"@emotion/serialize\": \"^1.1.1\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.0\",\n\t\t\"@emotion/utils\": \"^1.2.0\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.0\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\t\"@babel/core\": \"^7.0.0\",\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@babel/core\": {\n\t\t\toptional: true\n\t\t},\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@babel/core\": \"^7.18.5\",\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.10.5\",\n\t\t\"@emotion/css-prettifier\": \"1.1.1\",\n\t\t\"@emotion/server\": \"11.10.0\",\n\t\t\"@emotion/styled\": \"11.10.5\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": \"./macro.js\"\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwnProperty.call(props, 'css')) {\n // $FlowFixMe\n return createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n var res = insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport { _ as _createSuper } from './index-b19cc27c.browser.esm.js';\nimport React, { Component } from 'react';\n\nvar defaultProps = {\n defaultInputValue: '',\n defaultMenuIsOpen: false,\n defaultValue: null\n};\n\nvar manageState = function manageState(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(StateManager, _Component);\n\n var _super = _createSuper(StateManager);\n\n function StateManager() {\n var _this;\n\n _classCallCheck(this, StateManager);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.select = void 0;\n _this.state = {\n inputValue: _this.props.inputValue !== undefined ? _this.props.inputValue : _this.props.defaultInputValue,\n menuIsOpen: _this.props.menuIsOpen !== undefined ? _this.props.menuIsOpen : _this.props.defaultMenuIsOpen,\n value: _this.props.value !== undefined ? _this.props.value : _this.props.defaultValue\n };\n\n _this.onChange = function (value, actionMeta) {\n _this.callProp('onChange', value, actionMeta);\n\n _this.setState({\n value: value\n });\n };\n\n _this.onInputChange = function (value, actionMeta) {\n // TODO: for backwards compatibility, we allow the prop to return a new\n // value, but now inputValue is a controllable prop we probably shouldn't\n var newValue = _this.callProp('onInputChange', value, actionMeta);\n\n _this.setState({\n inputValue: newValue !== undefined ? newValue : value\n });\n };\n\n _this.onMenuOpen = function () {\n _this.callProp('onMenuOpen');\n\n _this.setState({\n menuIsOpen: true\n });\n };\n\n _this.onMenuClose = function () {\n _this.callProp('onMenuClose');\n\n _this.setState({\n menuIsOpen: false\n });\n };\n\n return _this;\n }\n\n _createClass(StateManager, [{\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n } // FIXME: untyped flow code, return any\n\n }, {\n key: \"getProp\",\n value: function getProp(key) {\n return this.props[key] !== undefined ? this.props[key] : this.state[key];\n } // FIXME: untyped flow code, return any\n\n }, {\n key: \"callProp\",\n value: function callProp(name) {\n if (typeof this.props[name] === 'function') {\n var _this$props;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return (_this$props = this.props)[name].apply(_this$props, args);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props2 = this.props;\n _this$props2.defaultInputValue;\n _this$props2.defaultMenuIsOpen;\n _this$props2.defaultValue;\n var props = _objectWithoutProperties(_this$props2, [\"defaultInputValue\", \"defaultMenuIsOpen\", \"defaultValue\"]);\n\n return /*#__PURE__*/React.createElement(SelectComponent, _extends({}, props, {\n ref: function ref(_ref) {\n _this2.select = _ref;\n },\n inputValue: this.getProp('inputValue'),\n menuIsOpen: this.getProp('menuIsOpen'),\n onChange: this.onChange,\n onInputChange: this.onInputChange,\n onMenuClose: this.onMenuClose,\n onMenuOpen: this.onMenuOpen,\n value: this.getProp('value')\n }));\n }\n }]);\n\n return StateManager;\n }(Component), _class.defaultProps = defaultProps, _temp;\n};\n\nexport { manageState as m };\n","import { S as Select } from './Select-0b2b7701.browser.esm.js';\nexport { c as createFilter, d as defaultTheme, m as mergeStyles } from './Select-0b2b7701.browser.esm.js';\nimport { m as manageState } from './stateManager-ffc9d993.browser.esm.js';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport { _ as _createSuper } from './index-b19cc27c.browser.esm.js';\nexport { c as components } from './index-b19cc27c.browser.esm.js';\nimport React, { Component } from 'react';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport memoizeOne from 'memoize-one';\nimport '@babel/runtime/helpers/extends';\nimport '@babel/runtime/helpers/toConsumableArray';\nimport '@babel/runtime/helpers/objectWithoutProperties';\nimport '@babel/runtime/helpers/taggedTemplateLiteral';\nimport 'react-input-autosize';\nimport '@babel/runtime/helpers/defineProperty';\nimport 'react-dom';\nimport '@babel/runtime/helpers/typeof';\n\nvar NonceProvider = /*#__PURE__*/function (_Component) {\n _inherits(NonceProvider, _Component);\n\n var _super = _createSuper(NonceProvider);\n\n function NonceProvider(props) {\n var _this;\n\n _classCallCheck(this, NonceProvider);\n\n _this = _super.call(this, props);\n\n _this.createEmotionCache = function (nonce, key) {\n return createCache({\n nonce: nonce,\n key: key\n });\n };\n\n _this.createEmotionCache = memoizeOne(_this.createEmotionCache);\n return _this;\n }\n\n _createClass(NonceProvider, [{\n key: \"render\",\n value: function render() {\n var emotionCache = this.createEmotionCache(this.props.nonce, this.props.cacheKey);\n return /*#__PURE__*/React.createElement(CacheProvider, {\n value: emotionCache\n }, this.props.children);\n }\n }]);\n\n return NonceProvider;\n}(Component);\n\nvar index = manageState(Select);\n\nexport default index;\nexport { NonceProvider };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport { _ as _createSuper, G as handleInputChange, a as _objectSpread2 } from '../../dist/index-b19cc27c.browser.esm.js';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport React, { Component } from 'react';\nimport { S as Select } from '../../dist/Select-0b2b7701.browser.esm.js';\nimport { m as manageState } from '../../dist/stateManager-ffc9d993.browser.esm.js';\nimport '@emotion/react';\nimport '@babel/runtime/helpers/taggedTemplateLiteral';\nimport 'react-input-autosize';\nimport 'react-dom';\nimport '@babel/runtime/helpers/typeof';\nimport '@babel/runtime/helpers/toConsumableArray';\n\nvar defaultProps = {\n cacheOptions: false,\n defaultOptions: false,\n filterOption: null,\n isLoading: false\n};\nvar makeAsyncSelect = function makeAsyncSelect(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(Async, _Component);\n\n var _super = _createSuper(Async);\n\n function Async(props) {\n var _this;\n\n _classCallCheck(this, Async);\n\n _this = _super.call(this);\n _this.select = void 0;\n _this.lastRequest = void 0;\n _this.mounted = false;\n\n _this.handleInputChange = function (newValue, actionMeta) {\n var _this$props = _this.props,\n cacheOptions = _this$props.cacheOptions,\n onInputChange = _this$props.onInputChange; // TODO\n\n var inputValue = handleInputChange(newValue, actionMeta, onInputChange);\n\n if (!inputValue) {\n delete _this.lastRequest;\n\n _this.setState({\n inputValue: '',\n loadedInputValue: '',\n loadedOptions: [],\n isLoading: false,\n passEmptyOptions: false\n });\n\n return;\n }\n\n if (cacheOptions && _this.state.optionsCache[inputValue]) {\n _this.setState({\n inputValue: inputValue,\n loadedInputValue: inputValue,\n loadedOptions: _this.state.optionsCache[inputValue],\n isLoading: false,\n passEmptyOptions: false\n });\n } else {\n var request = _this.lastRequest = {};\n\n _this.setState({\n inputValue: inputValue,\n isLoading: true,\n passEmptyOptions: !_this.state.loadedInputValue\n }, function () {\n _this.loadOptions(inputValue, function (options) {\n if (!_this.mounted) return;\n if (request !== _this.lastRequest) return;\n delete _this.lastRequest;\n\n _this.setState(function (state) {\n return {\n isLoading: false,\n loadedInputValue: inputValue,\n loadedOptions: options || [],\n passEmptyOptions: false,\n optionsCache: options ? _objectSpread2(_objectSpread2({}, state.optionsCache), {}, _defineProperty({}, inputValue, options)) : state.optionsCache\n };\n });\n });\n });\n }\n\n return inputValue;\n };\n\n _this.state = {\n defaultOptions: Array.isArray(props.defaultOptions) ? props.defaultOptions : undefined,\n inputValue: typeof props.inputValue !== 'undefined' ? props.inputValue : '',\n isLoading: props.defaultOptions === true,\n loadedOptions: [],\n passEmptyOptions: false,\n optionsCache: {},\n prevDefaultOptions: undefined,\n prevCacheOptions: undefined\n };\n return _this;\n }\n\n _createClass(Async, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.mounted = true;\n var defaultOptions = this.props.defaultOptions;\n var inputValue = this.state.inputValue;\n\n if (defaultOptions === true) {\n this.loadOptions(inputValue, function (options) {\n if (!_this2.mounted) return;\n var isLoading = !!_this2.lastRequest;\n\n _this2.setState({\n defaultOptions: options || [],\n isLoading: isLoading\n });\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mounted = false;\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n }\n }, {\n key: \"loadOptions\",\n value: function loadOptions(inputValue, callback) {\n var loadOptions = this.props.loadOptions;\n if (!loadOptions) return callback();\n var loader = loadOptions(inputValue, callback);\n\n if (loader && typeof loader.then === 'function') {\n loader.then(callback, function () {\n return callback();\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _this$props2 = this.props;\n _this$props2.loadOptions;\n var isLoadingProp = _this$props2.isLoading,\n props = _objectWithoutProperties(_this$props2, [\"loadOptions\", \"isLoading\"]);\n\n var _this$state = this.state,\n defaultOptions = _this$state.defaultOptions,\n inputValue = _this$state.inputValue,\n isLoading = _this$state.isLoading,\n loadedInputValue = _this$state.loadedInputValue,\n loadedOptions = _this$state.loadedOptions,\n passEmptyOptions = _this$state.passEmptyOptions;\n var options = passEmptyOptions ? [] : inputValue && loadedInputValue ? loadedOptions : defaultOptions || [];\n return /*#__PURE__*/React.createElement(SelectComponent, _extends({}, props, {\n ref: function ref(_ref) {\n _this3.select = _ref;\n },\n options: options,\n isLoading: isLoading || isLoadingProp,\n onInputChange: this.handleInputChange\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n var newCacheOptionsState = props.cacheOptions !== state.prevCacheOptions ? {\n prevCacheOptions: props.cacheOptions,\n optionsCache: {}\n } : {};\n var newDefaultOptionsState = props.defaultOptions !== state.prevDefaultOptions ? {\n prevDefaultOptions: props.defaultOptions,\n defaultOptions: Array.isArray(props.defaultOptions) ? props.defaultOptions : undefined\n } : {};\n return _objectSpread2(_objectSpread2({}, newCacheOptionsState), newDefaultOptionsState);\n }\n }]);\n\n return Async;\n }(Component), _class.defaultProps = defaultProps, _temp;\n};\nvar SelectState = manageState(Select);\nvar Async = makeAsyncSelect(SelectState);\n\nexport default Async;\nexport { defaultProps, makeAsyncSelect };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport { a as _objectSpread2, _ as _createSuper, D as cleanValue } from '../../dist/index-b19cc27c.browser.esm.js';\nimport React, { Component } from 'react';\nimport { S as Select } from '../../dist/Select-0b2b7701.browser.esm.js';\nimport { m as manageState } from '../../dist/stateManager-ffc9d993.browser.esm.js';\nimport '@emotion/react';\nimport '@babel/runtime/helpers/taggedTemplateLiteral';\nimport '@babel/runtime/helpers/objectWithoutProperties';\nimport 'react-input-autosize';\nimport '@babel/runtime/helpers/defineProperty';\nimport 'react-dom';\nimport '@babel/runtime/helpers/typeof';\n\nvar compareOption = function compareOption() {\n var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var option = arguments.length > 1 ? arguments[1] : undefined;\n var candidate = String(inputValue).toLowerCase();\n var optionValue = String(option.value).toLowerCase();\n var optionLabel = String(option.label).toLowerCase();\n return optionValue === candidate || optionLabel === candidate;\n};\n\nvar builtins = {\n formatCreateLabel: function formatCreateLabel(inputValue) {\n return \"Create \\\"\".concat(inputValue, \"\\\"\");\n },\n isValidNewOption: function isValidNewOption(inputValue, selectValue, selectOptions) {\n return !(!inputValue || selectValue.some(function (option) {\n return compareOption(inputValue, option);\n }) || selectOptions.some(function (option) {\n return compareOption(inputValue, option);\n }));\n },\n getNewOptionData: function getNewOptionData(inputValue, optionLabel) {\n return {\n label: optionLabel,\n value: inputValue,\n __isNew__: true\n };\n }\n};\nvar defaultProps = _objectSpread2({\n allowCreateWhileLoading: false,\n createOptionPosition: 'last'\n}, builtins);\nvar makeCreatableSelect = function makeCreatableSelect(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(Creatable, _Component);\n\n var _super = _createSuper(Creatable);\n\n function Creatable(props) {\n var _this;\n\n _classCallCheck(this, Creatable);\n\n _this = _super.call(this, props);\n _this.select = void 0;\n\n _this.onChange = function (newValue, actionMeta) {\n var _this$props = _this.props,\n getNewOptionData = _this$props.getNewOptionData,\n inputValue = _this$props.inputValue,\n isMulti = _this$props.isMulti,\n onChange = _this$props.onChange,\n onCreateOption = _this$props.onCreateOption,\n value = _this$props.value,\n name = _this$props.name;\n\n if (actionMeta.action !== 'select-option') {\n return onChange(newValue, actionMeta);\n }\n\n var newOption = _this.state.newOption;\n var valueArray = Array.isArray(newValue) ? newValue : [newValue];\n\n if (valueArray[valueArray.length - 1] === newOption) {\n if (onCreateOption) onCreateOption(inputValue);else {\n var newOptionData = getNewOptionData(inputValue, inputValue);\n var newActionMeta = {\n action: 'create-option',\n name: name\n };\n\n if (isMulti) {\n onChange([].concat(_toConsumableArray(cleanValue(value)), [newOptionData]), newActionMeta);\n } else {\n onChange(newOptionData, newActionMeta);\n }\n }\n return;\n }\n\n onChange(newValue, actionMeta);\n };\n\n var options = props.options || [];\n _this.state = {\n newOption: undefined,\n options: options\n };\n return _this;\n }\n\n _createClass(Creatable, [{\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var options = this.state.options;\n return /*#__PURE__*/React.createElement(SelectComponent, _extends({}, this.props, {\n ref: function ref(_ref) {\n _this2.select = _ref;\n },\n options: options,\n onChange: this.onChange\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n var allowCreateWhileLoading = props.allowCreateWhileLoading,\n createOptionPosition = props.createOptionPosition,\n formatCreateLabel = props.formatCreateLabel,\n getNewOptionData = props.getNewOptionData,\n inputValue = props.inputValue,\n isLoading = props.isLoading,\n isValidNewOption = props.isValidNewOption,\n value = props.value;\n var options = props.options || [];\n var newOption = state.newOption;\n\n if (isValidNewOption(inputValue, cleanValue(value), options)) {\n newOption = getNewOptionData(inputValue, formatCreateLabel(inputValue));\n } else {\n newOption = undefined;\n }\n\n return {\n newOption: newOption,\n options: (allowCreateWhileLoading || !isLoading) && newOption ? createOptionPosition === 'first' ? [newOption].concat(_toConsumableArray(options)) : [].concat(_toConsumableArray(options), [newOption]) : options\n };\n }\n }]);\n\n return Creatable;\n }(Component), _class.defaultProps = defaultProps, _temp;\n}; // TODO: do this in package entrypoint\n\nvar SelectCreatable = makeCreatableSelect(Select);\nvar Creatable = manageState(SelectCreatable);\n\nexport default Creatable;\nexport { defaultProps, makeCreatableSelect };\n","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","import { Configuration, fetchOptions, OptionItem } from \"@interface48/api\";\r\nimport Input from \"@material-ui/core/Input\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport { createStyles, Theme, withStyles, WithStyles } from \"@material-ui/core/styles\";\r\nimport match from \"autosuggest-highlight/match\";\r\nimport parse from \"autosuggest-highlight/parse\";\r\nimport classNames from \"classnames\";\r\nimport React from \"react\";\r\nimport ReactAutosuggest, {\r\n ChangeEvent,\r\n SuggestionSelectedEventData,\r\n SuggestionsFetchRequestedParams,\r\n} from \"react-autosuggest\";\r\nimport { AutosuggestRemoteOptions } from \"./models\";\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n container: {\r\n flexGrow: 1,\r\n position: \"relative\",\r\n },\r\n suggestionsContainerOpen: {\r\n position: \"absolute\",\r\n marginBottom: theme.spacing(3),\r\n left: 0,\r\n right: 0,\r\n zIndex: 1,\r\n },\r\n suggestion: {\r\n display: \"block\",\r\n },\r\n suggestionsList: {\r\n margin: 0,\r\n padding: 0,\r\n listStyleType: \"none\",\r\n },\r\n textField: {\r\n marginTop: theme.spacing(2),\r\n width: \"100%\",\r\n },\r\n });\r\n\r\nconst renderInput = (inputProps: any) => {\r\n // Discard placeholder, as we're using a shrinkable label instead\r\n const { classes, value, ref, placeholder, ...other } = inputProps;\r\n\r\n return ;\r\n};\r\n\r\nconst renderSuggestion = (suggestion: any, { query, isHighlighted }: { query: any; isHighlighted: boolean }) => {\r\n const matches = match(suggestion.label, query);\r\n const parts = parse(suggestion.label, matches);\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst renderSuggestionsContainer = (options: any) => {\r\n const { containerProps, children } = options;\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nconst getSuggestionValue = (option: OptionItem) => {\r\n return option.value;\r\n};\r\n\r\nconst getSuggestions = (options: Array>, value: string) => {\r\n const inputValue = value.trim().toLowerCase();\r\n const inputLength = inputValue.length;\r\n let count = 0;\r\n\r\n return inputLength === 0\r\n ? []\r\n : options\r\n .filter(option => {\r\n const keep = count < 10 && option.label.toLowerCase().indexOf(inputValue) !== -1;\r\n\r\n if (keep) {\r\n count += 1;\r\n }\r\n\r\n return keep;\r\n })\r\n .sort((aOption, bOption) => aOption.label.localeCompare(bOption.label));\r\n};\r\n\r\ninterface AutosuggestProps extends WithStyles {\r\n id: string;\r\n label?: string;\r\n placeholder?: string;\r\n value: string | null | undefined;\r\n options?: Array>;\r\n remoteOptions?: AutosuggestRemoteOptions;\r\n className?: string;\r\n getApiConfiguration?: () => Promise;\r\n processValue?: (value: string | null | undefined) => string | null | undefined;\r\n onChange: (value: string | null | undefined, id?: string, otherData?: any) => void;\r\n}\r\n\r\ninterface AutosuggestState {\r\n value?: string | null;\r\n optionItems: Array>;\r\n suggestedOptionItems: Array>;\r\n}\r\n\r\nexport const AutosuggestComponent = class extends React.Component {\r\n constructor(props: AutosuggestProps) {\r\n super(props);\r\n\r\n const { value, options, remoteOptions } = this.props;\r\n\r\n // If a Remote URL has been specified, then options will be fetched when mounted\r\n const optionItems = remoteOptions ? [] : options || [];\r\n\r\n this.state = { value, optionItems, suggestedOptionItems: [] };\r\n }\r\n\r\n public async componentDidMount() {\r\n const { remoteOptions, getApiConfiguration } = this.props;\r\n const { value } = this.state;\r\n\r\n // If the Select has Remote Options...\r\n if (remoteOptions) {\r\n await this.loadRemoteOptions(value, remoteOptions, getApiConfiguration);\r\n }\r\n }\r\n\r\n public render() {\r\n const { id, placeholder, label, className, classes } = this.props;\r\n const { value, suggestedOptionItems } = this.state;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n public async componentDidUpdate(prevProps: AutosuggestProps) {\r\n const { value: prevValue, options: prevOptions, remoteOptions: prevRemoteOptions } = prevProps;\r\n const { value, options, remoteOptions, getApiConfiguration } = this.props;\r\n\r\n // If the Options were updated via props...\r\n if (options && prevOptions !== options) {\r\n this.loadOptions(value, options);\r\n }\r\n // Otherwise, if the Select has Remote Options, check to see if the URL was updated via props...\r\n else if (prevRemoteOptions && remoteOptions && prevRemoteOptions.url !== remoteOptions.url) {\r\n this.loadRemoteOptions(value, remoteOptions, getApiConfiguration);\r\n }\r\n // Otherwise, if the value was updated via props...\r\n else if (prevValue !== value) {\r\n this.setState({ ...this.state, value });\r\n }\r\n }\r\n\r\n public handleSuggestionSelected = (event: React.FormEvent, data: SuggestionSelectedEventData) => {\r\n // Prevent form submission on enter to select value\r\n if (data.method === \"enter\") {\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n public handleSuggestionsFetchRequested = (request: SuggestionsFetchRequestedParams) => {\r\n const { value } = request;\r\n const { optionItems } = this.state;\r\n\r\n this.setState((prevState: AutosuggestState) => {\r\n return { ...prevState, suggestedOptionItems: getSuggestions(optionItems, value) };\r\n });\r\n };\r\n\r\n public handleSuggestionsClearRequested = () => {\r\n this.setState((prevState: AutosuggestState) => {\r\n return { ...prevState, suggestedOptionItems: [] };\r\n });\r\n };\r\n\r\n public handleChange = (event: any, params: ChangeEvent) => {\r\n const { newValue } = params;\r\n\r\n this.setState((prevState: AutosuggestState) => {\r\n return { ...prevState, value: newValue };\r\n });\r\n };\r\n\r\n public handleBlur = (event: any, { highlightedSuggestion }: { highlightedSuggestion: OptionItem }) => {\r\n const { onChange, processValue } = this.props;\r\n const { value } = this.state;\r\n\r\n if (highlightedSuggestion) {\r\n const suggestionValue = getSuggestionValue(highlightedSuggestion);\r\n onChange(suggestionValue);\r\n } else {\r\n const processedValue = processValue ? (processValue(value) as string | null | undefined) : value && value.trim();\r\n onChange(processedValue);\r\n }\r\n };\r\n\r\n public loadOptions = (value: string | null | undefined, options: Array>) => {\r\n this.setState({ ...this.state, value, optionItems: options });\r\n };\r\n\r\n public loadRemoteOptions = async (\r\n value: string | null | undefined,\r\n remoteOptions: AutosuggestRemoteOptions,\r\n getApiConfiguration?: () => Promise,\r\n ) => {\r\n const { id, label } = this.props;\r\n\r\n const autosuggestRemoteOptions = remoteOptions as AutosuggestRemoteOptions;\r\n\r\n try {\r\n const options = await fetchOptions(\r\n autosuggestRemoteOptions.url,\r\n \"string\", // Autosuggest only supports string values\r\n undefined, // Default Option Item not applicable for Autosuggest\r\n autosuggestRemoteOptions.sort,\r\n getApiConfiguration,\r\n );\r\n\r\n this.loadOptions(value, options);\r\n } catch (error) {\r\n console.error(error);\r\n\r\n alert(\r\n `An error occurred upon attempting to initialize the ${label || id} field.\\n\\n` +\r\n `Please reload the page and try again. If the error persists, please contact an Administrator for assistance.`,\r\n );\r\n }\r\n };\r\n};\r\n\r\nexport const Autosuggest = withStyles(styles)(AutosuggestComponent);\r\n","import { Configuration } from \"@interface48/api\";\r\nimport Input from \"@material-ui/core/Input\";\r\nimport \"cleave.js/dist/addons/cleave-phone.ca.js\";\r\nimport { CleaveOptions } from \"cleave.js/options\";\r\nimport Cleave from \"cleave.js/react\";\r\nimport React from \"react\";\r\n\r\nconst CleaveInputHelper = (props: any) => {\r\n const { cleaveOptions, inputRef, ...rest } = props;\r\n\r\n return ;\r\n};\r\n\r\ninterface CleaveInputProps {\r\n id: string;\r\n placeholder?: string;\r\n value: string | number | null | undefined;\r\n startAdornment?: React.ReactNode;\r\n endAdornment?: React.ReactNode;\r\n cleaveOptions: CleaveOptions;\r\n className?: string;\r\n getApiConfiguration?: () => Promise;\r\n processValue?: (value: string | number | undefined | null) => string | number | null | undefined;\r\n onChange: (value: string | number | undefined | null, id?: string, otherData?: any) => void;\r\n}\r\n\r\ninterface CleaveInputState {\r\n value: string | number | undefined | null;\r\n}\r\n\r\nexport const CleaveInputComponent = class extends React.Component {\r\n constructor(props: CleaveInputProps) {\r\n super(props);\r\n\r\n const { value } = this.props;\r\n this.state = { value };\r\n }\r\n\r\n public render() {\r\n const { id, placeholder, startAdornment, endAdornment, className } = this.props;\r\n const { cleaveOptions } = this.props;\r\n const { value } = this.state;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n public componentDidUpdate(prevProps: CleaveInputProps, prevState: CleaveInputState) {\r\n const { value: prevValue } = prevProps;\r\n const { value } = this.props;\r\n\r\n if (prevValue !== value) {\r\n this.setState({ value });\r\n }\r\n }\r\n\r\n public handleChange = (event: any) => {\r\n const value = event.target.value;\r\n\r\n this.setState((prevState: CleaveInputState) => {\r\n return { ...prevState, value };\r\n });\r\n };\r\n\r\n public handleBlur = (event: any) => {\r\n const { onChange, processValue } = this.props;\r\n const { value } = this.state;\r\n\r\n const processedValue = processValue\r\n ? (processValue(value) as string | undefined | null)\r\n : typeof value === \"string\"\r\n ? value.trim()\r\n : value;\r\n\r\n onChange(processedValue);\r\n };\r\n};\r\n\r\nexport const CleaveInput = CleaveInputComponent;\r\n","import Input from \"@material-ui/core/Input\";\r\nimport { createStyles, Theme, WithStyles, withStyles } from \"@material-ui/core/styles\";\r\nimport classNames from \"classnames\";\r\nimport moment from \"moment\";\r\nimport React from \"react\";\r\nimport DateTime from \"react-datetime\";\r\nimport \"react-datetime/css/react-datetime.css\";\r\nimport { DateTimePickerOptions } from \"./models\";\r\n\r\nconst DateTimePickerWidth = 250;\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n container: {\r\n flexGrow: 1,\r\n position: \"relative\",\r\n \"& .rdtPicker\": {\r\n marginTop: 0,\r\n width: DateTimePickerWidth,\r\n border: 0,\r\n boxShadow: theme.shadows[2],\r\n backgroundColor: theme.palette.background.paper,\r\n color: theme.palette.text.primary,\r\n fontFamily: theme.typography.fontFamily,\r\n },\r\n \"& .rdtPicker th\": {\r\n borderBottomColor: theme.palette.divider,\r\n },\r\n \"& .rdtPicker td.rdtMonth:hover, td.rdtYear:hover\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n \"& .rdtPicker thead tr:first-child th:hover\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n \"& .rdtPicker td.rdtDay:hover, .rdtPicker .rdtTimeToggle:hover\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n \"& .rdtPicker td.rdtHour:hover, .rdtPicker td.rdtMinute:hover, .rdtPicker td.rdtSecond:hover\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n \"& .rdtPicker td.rdtActive, .rdtPicker td.rdtActive:hover\": {\r\n backgroundColor: theme.palette.action.selected,\r\n color: theme.palette.text.primary,\r\n textShadow: \"none\",\r\n },\r\n \"& .rdtPicker td.rdtToday:before\": {\r\n borderBottomColor: theme.palette.secondary.main,\r\n },\r\n \"& .rdtPicker .rdtCounters\": {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n },\r\n \"& .rdtPicker .rdtCounter\": {\r\n height: \"auto\",\r\n width: \"auto\",\r\n },\r\n \"& .rdtPicker .rdtCounterSeparator\": {\r\n lineHeight: \"unset\",\r\n marginTop: -3,\r\n },\r\n \"& .rdtPicker .rdtCounter .rdtBtn\": {\r\n height: \"auto\",\r\n lineHeight: \"unset\",\r\n padding: theme.spacing(1),\r\n },\r\n \"& .rdtPicker .rdtCounter .rdtCount\": {\r\n height: \"auto\",\r\n fontSize: \"unset\",\r\n padding: theme.spacing(1),\r\n },\r\n \"& .rdtPicker .rdtCounter .rdtBtn:hover\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n },\r\n containerRightAlignDatePicker: {\r\n \"& .rdtPicker\": {\r\n right: 0,\r\n },\r\n },\r\n textField: {\r\n marginTop: theme.spacing(2),\r\n width: \"100%\",\r\n },\r\n });\r\n\r\ninterface DateTimePickerProps extends WithStyles {\r\n id: string;\r\n label?: string;\r\n placeholder?: string;\r\n disabled?: boolean;\r\n value: string | null | undefined;\r\n valueFormat?: {\r\n date?: string;\r\n time?: string | false;\r\n };\r\n options?: DateTimePickerOptions;\r\n className?: string;\r\n processValue?: (value: string | null | undefined) => string | null | undefined;\r\n onChange: (value: string | null | undefined) => void;\r\n}\r\n\r\ninterface DateTimePickerState {\r\n value: string | null | undefined;\r\n alignment: \"left\" | \"right\";\r\n}\r\n\r\nexport const DateTimePickerComponent = class extends React.Component {\r\n public valueFormat = {\r\n date: \"YYYY-MM-DD\",\r\n time: \"HH:mm\",\r\n };\r\n public inputRef: React.RefObject;\r\n public inputBlurTimeout: number | undefined;\r\n\r\n constructor(props: DateTimePickerProps) {\r\n super(props);\r\n\r\n const { value: isoDateTimeString, valueFormat: valueFormatOptions } = this.props;\r\n\r\n // If the default Date format is to be overridden...\r\n if (valueFormatOptions && valueFormatOptions.date) {\r\n this.valueFormat.date = valueFormatOptions.date;\r\n }\r\n // If the default Time format is to be overridden...\r\n if (valueFormatOptions) {\r\n // If the Time portion of the Date/Time Picker is to be used...\r\n if (valueFormatOptions.time) {\r\n this.valueFormat.time = valueFormatOptions.time;\r\n }\r\n // Otherwise, if the Time portion is not to be used (i.e. just a Date Picker)...\r\n else if (valueFormatOptions.time === false) {\r\n this.valueFormat.time = \"\";\r\n }\r\n }\r\n\r\n const value = isoDateTimeString && this.toDateTimeString(moment(isoDateTimeString));\r\n\r\n this.state = {\r\n value,\r\n alignment: \"left\",\r\n };\r\n\r\n this.inputRef = React.createRef();\r\n }\r\n\r\n public render() {\r\n const { id, disabled, placeholder, label, className, classes } = this.props;\r\n const { value, alignment } = this.state;\r\n\r\n const containerClassName = classNames(\r\n classes.container,\r\n alignment === \"right\" ? classes.containerRightAlignDatePicker : undefined,\r\n className,\r\n );\r\n\r\n const dateTimePickerProps = {\r\n className: containerClassName,\r\n renderInput: this.renderInput,\r\n inputProps: {\r\n id,\r\n className: classes.textField,\r\n disabled,\r\n label,\r\n placeholder,\r\n ref: this.inputRef,\r\n autoComplete: \"off\",\r\n onBlur: this.handleInputBlur,\r\n },\r\n value,\r\n dateFormat: this.valueFormat.date,\r\n timeFormat: this.valueFormat.time || false,\r\n closeOnSelect: true,\r\n onChange: this.handleChange,\r\n onBlur: this.handleBlur,\r\n isValidDate: this.handleIsValidDate,\r\n } as DateTime.DatetimepickerProps;\r\n\r\n return ;\r\n }\r\n\r\n public componentDidUpdate(prevProps: DateTimePickerProps) {\r\n const { value: prevValue } = prevProps;\r\n const { value: nextValue } = this.props;\r\n const { alignment: currAlignment } = this.state;\r\n\r\n let alignment = currAlignment;\r\n const dateTimePickerBoundingClientRect = this.inputRef.current && this.inputRef.current.getBoundingClientRect();\r\n const dateTimePickerCollidingAtRight =\r\n dateTimePickerBoundingClientRect &&\r\n dateTimePickerBoundingClientRect.left + DateTimePickerWidth > window.innerWidth;\r\n // If the DateTimePicker is colliding with the right edge of the viewport, and it is not yet right-aligned...\r\n if (dateTimePickerCollidingAtRight && alignment !== \"right\") {\r\n alignment = \"right\";\r\n }\r\n // Otherwise, ensure the alignment is left if it isn't already...\r\n else if (!dateTimePickerCollidingAtRight && alignment !== \"left\") {\r\n alignment = \"left\";\r\n }\r\n\r\n // If the value was updated outside the input (i.e. custom formData manipulation at form-level)...\r\n if (prevValue !== nextValue) {\r\n const value = nextValue && this.toDateTimeString(moment(nextValue));\r\n\r\n this.setState({ ...this.state, value });\r\n }\r\n if (currAlignment !== alignment) {\r\n this.setState({ ...this.state, alignment });\r\n }\r\n }\r\n\r\n public renderInput = (inputProps: any) => {\r\n // Discard placeholder, as we're using a shrinkable label instead\r\n const { className, value, ref, placeholder, disabled, ...remainingProps } = inputProps;\r\n const { onClick, onFocus, onKeyDown, onChange, ...remainingPropsWithoutHandlers } = remainingProps;\r\n\r\n let props = remainingProps;\r\n\r\n // If the input is disabled, do not wire up the event handlers to prevent the calendar from opening...\r\n if (disabled) {\r\n props = remainingPropsWithoutHandlers;\r\n }\r\n\r\n return ;\r\n };\r\n\r\n public handleIsValidDate = (current: moment.Moment | string) => {\r\n const { options } = this.props;\r\n\r\n if (options) {\r\n const { validStartDate, validEndDate } = options as DateTimePickerOptions;\r\n\r\n const validStart = moment(validStartDate).startOf(\"day\");\r\n const validEnd = moment(validEndDate).endOf(\"day\");\r\n\r\n let currentMoment: moment.Moment;\r\n\r\n if (moment.isMoment(current)) {\r\n currentMoment = current;\r\n } else {\r\n currentMoment = moment(current);\r\n }\r\n\r\n let isValidDate = true;\r\n\r\n if (validStartDate && validEndDate) {\r\n isValidDate = currentMoment.isBetween(validStart, validEnd, undefined, \"[]\");\r\n } else if (validStartDate) {\r\n isValidDate = currentMoment.isSameOrAfter(validStart);\r\n } else if (validEndDate) {\r\n isValidDate = currentMoment.isSameOrBefore(validEnd);\r\n }\r\n\r\n return isValidDate;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n public handleChange = (value: moment.Moment | string) => {\r\n let dateTimeString;\r\n // If a valid date/time has been specified, then a moment has been passed in...\r\n if (moment.isMoment(value)) {\r\n dateTimeString = this.toDateTimeString(value);\r\n } else {\r\n // Otherwise, if the user is still specifying a valid date/time, and a string has been passed in...\r\n dateTimeString = value;\r\n }\r\n\r\n this.setState({ ...this.state, value: dateTimeString });\r\n };\r\n\r\n public handleBlur = (value: moment.Moment | string) => {\r\n const { processValue, onChange } = this.props;\r\n\r\n // If the input blurred, but the picker has actually blurred, handle blur here instead of via input handler...\r\n if (this.inputBlurTimeout) {\r\n clearTimeout(this.inputBlurTimeout);\r\n\r\n this.inputBlurTimeout = undefined;\r\n }\r\n\r\n const { dateTimeString, isoDateTimeString } = this.processDateTimeValue(value);\r\n\r\n this.setState({ ...this.state, value: dateTimeString }, () => {\r\n const processedValue = processValue\r\n ? (processValue(isoDateTimeString) as string | null | undefined)\r\n : isoDateTimeString && isoDateTimeString.trim();\r\n\r\n onChange(processedValue);\r\n });\r\n };\r\n\r\n public handleInputBlur = (event: React.FocusEvent) => {\r\n const { processValue, onChange } = this.props;\r\n const { value } = this.props;\r\n\r\n const inputElement = event.target as HTMLInputElement;\r\n const inputValue = inputElement.value;\r\n\r\n this.inputBlurTimeout = window.setTimeout(() => {\r\n const { dateTimeString, isoDateTimeString } = this.processDateTimeValue(inputValue);\r\n // If the value has changed, schedule a setState/onChange from this inputBlur event, in case the following\r\n // DateTimePicker's blur event does not fire (which happens in the case of copy/paste, autocomplete, etc.)...\r\n if (value !== isoDateTimeString) {\r\n this.setState({ ...this.state, value: dateTimeString }, () => {\r\n const processedValue = processValue\r\n ? (processValue(isoDateTimeString) as string | null | undefined)\r\n : isoDateTimeString && isoDateTimeString.trim();\r\n\r\n onChange(processedValue);\r\n });\r\n }\r\n }, 150);\r\n };\r\n\r\n public processDateTimeValue = (value: moment.Moment | string) => {\r\n if (typeof value === \"string\") {\r\n const noColonTimeMatch = /^(\\d{4}-\\d{1,2}-\\d{1,2}) (\\d{3,4}|\\d{1,2}:\\d{2})$/.exec(value);\r\n // If the incoming string-based value is in the format yyyy-MM-dd [H]Hmm, parse it is a date/time value\r\n // where the time value is lacking a colon...\r\n if (noColonTimeMatch) {\r\n const colonPosition = value.length - 2;\r\n const colonTimeValue = `${value.substring(0, colonPosition)}:${value.substring(colonPosition, value.length)}`;\r\n\r\n value = moment(colonTimeValue, this.getDateTimeFormatString());\r\n } else {\r\n value = moment(value, this.getDateTimeFormatString());\r\n }\r\n }\r\n\r\n let dateTimeString: string | undefined;\r\n let isoDateTimeString: string | undefined;\r\n // If a valid date/time has been specified, then a moment has been passed in...\r\n if (moment.isMoment(value) && value.isValid()) {\r\n dateTimeString = this.toDateTimeString(value);\r\n // If a Time portion is involved, use moment's toISOString utility method which formats the ISO8601 string to\r\n // always include the Time portion...\r\n if (this.valueFormat.time) {\r\n isoDateTimeString = value.toISOString();\r\n }\r\n // Otherwise, if a Time portion is not involved, then format the isoDateTimeString without moment's toISOString\r\n // utility method (which always includes the Time potion), and instead simply format as YYYY-MM-DD, which is the\r\n // expected format for a Date-only ISO8601 string (https://en.wikipedia.org/wiki/ISO_8601)...\r\n else {\r\n isoDateTimeString = value.format(\"YYYY-MM-DD\");\r\n }\r\n }\r\n\r\n return { dateTimeString, isoDateTimeString };\r\n };\r\n\r\n public getDateTimeFormatString = () => {\r\n return this.valueFormat.date + (this.valueFormat.time ? ` ${this.valueFormat.time}` : \"\");\r\n };\r\n\r\n public toDateTimeString = (value: moment.Moment) => {\r\n return value ? value.format(this.getDateTimeFormatString()) : undefined;\r\n };\r\n};\r\n\r\nexport const DateTimePicker = withStyles(styles)(DateTimePickerComponent);\r\n","import { formatFileSize } from \"@interface48/formatting\";\r\n\r\nexport const getFileDescription = (fileName: string, fileSizeBytes: number): string => {\r\n return `${fileName!} (${formatFileSize(fileSizeBytes!)})`;\r\n};\r\n","import { Configuration, genericFileApi } from \"@interface48/api\";\r\nimport { formatFileSize } from \"@interface48/formatting\";\r\nimport LinearProgress from \"@material-ui/core/LinearProgress\";\r\nimport { createStyles, Theme, withStyles, WithStyles } from \"@material-ui/core/styles\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport classNames from \"classnames\";\r\nimport React from \"react\";\r\nimport Dropzone, { DropEvent } from \"react-dropzone\";\r\nimport { FileDetails, FilePickerOptions } from \"./models\";\r\nimport { getFileDescription } from \"./utils\";\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n root: {\r\n marginTop: theme.spacing(3),\r\n },\r\n existingFilePicker: {\r\n marginTop: theme.spacing(2),\r\n },\r\n displayField: {\r\n marginTop: theme.spacing(1.5),\r\n paddingBottom: 0,\r\n },\r\n fileDescription: {\r\n marginBottom: theme.spacing(1),\r\n },\r\n fileUploadRegion: {\r\n cursor: \"pointer\",\r\n padding: theme.spacing(2),\r\n // Border Colour to match Input field underlines, as per\r\n // https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Input/Input.js#L9\r\n border: `solid 1px ${theme.palette.type === \"light\" ? \"rgba(0, 0, 0, 0.42)\" : \"rgba(255, 255, 255, 0.7)\"}`,\r\n borderRadius: theme.shape.borderRadius,\r\n backgroundColor: theme.palette.background.paper,\r\n },\r\n fileUploadRegionError: {\r\n borderColor: theme.palette.error.main,\r\n color: theme.palette.error.main,\r\n },\r\n fileUploadRegionDisabled: {\r\n cursor: \"default\",\r\n },\r\n progress: {\r\n height: 4,\r\n marginTop: -4,\r\n borderBottomLeftRadius: theme.shape.borderRadius,\r\n borderBottomRightRadius: theme.shape.borderRadius,\r\n },\r\n });\r\n\r\ninterface FilePickerProps extends WithStyles {\r\n id: string;\r\n fileDetails?: {\r\n fileName: string;\r\n fileSizeBytes: number;\r\n };\r\n options: FilePickerOptions;\r\n errors?: string[];\r\n className?: string;\r\n getApiConfiguration?: () => Promise;\r\n onChange: (fileUploadId: string, fileDetails: { fileName: string; fileSizeBytes: number }) => void;\r\n}\r\n\r\ninterface FilePickerState {\r\n fileUploadId?: string;\r\n fileDetails?: FileDetails;\r\n uploadProgress?: number;\r\n transientError?: string;\r\n}\r\n\r\nexport const FilePickerComponent = class extends React.Component {\r\n public transientErrorTimeoutId: number | undefined;\r\n\r\n constructor(props: FilePickerProps) {\r\n super(props);\r\n\r\n const { fileDetails } = this.props;\r\n\r\n this.state = { fileDetails };\r\n }\r\n\r\n public render() {\r\n const { id, options, errors, className, classes } = this.props;\r\n const { acceptedMimeTypes, maxSizeBytes } = options;\r\n const { fileDetails, uploadProgress, transientError } = this.state;\r\n\r\n return (\r\n <>\r\n