) but must be treated as such.\n\n\n var focusable = !disabled && importantForAccessibility !== 'no' && importantForAccessibility !== 'no-hide-descendants';\n\n if (role === 'link' || component === 'a' || component === 'button' || component === 'input' || component === 'select' || component === 'textarea') {\n if (accessible === false || !focusable) {\n domProps.tabIndex = '-1';\n } else {\n domProps['data-focusable'] = true;\n }\n } else if (AccessibilityUtil.buttonLikeRoles[role] || role === 'textbox') {\n if (accessible !== false && focusable) {\n domProps['data-focusable'] = true;\n domProps.tabIndex = '0';\n }\n } else {\n if (accessible === true && focusable) {\n domProps['data-focusable'] = true;\n domProps.tabIndex = '0';\n }\n } // STYLE\n\n\n var reactNativeStyle = StyleSheet.compose(pointerEvents && pointerEventsStyles[pointerEvents], StyleSheet.compose(providedStyle, placeholderTextColor && {\n placeholderTextColor: placeholderTextColor\n })); // Additional style resets for interactive elements\n\n var needsCursor = (role === 'button' || role === 'link') && !disabled;\n var needsReset = component === 'a' || component === 'button' || component === 'li' || component === 'ul' || role === 'heading'; // Classic CSS styles\n\n var finalClassList = [deprecatedClassName, needsReset && classes.reset, needsCursor && classes.cursor, classList]; // Resolve styles\n\n var _styleResolver = styleResolver(reactNativeStyle, finalClassList),\n className = _styleResolver.className,\n style = _styleResolver.style;\n\n if (className != null && className !== '') {\n domProps.className = className;\n }\n\n if (style) {\n domProps.style = style;\n } // OTHER\n // Native element ID\n\n\n if (nativeID && nativeID.constructor === String) {\n domProps.id = nativeID;\n } // Link security\n // https://mathiasbynens.github.io/rel-noopener/\n // Note: using \"noreferrer\" doesn't impact referrer tracking for https\n // transfers (i.e., from https to https).\n\n\n if (component === 'a' && domProps.target === '_blank') {\n domProps.rel = (domProps.rel || '') + \" noopener noreferrer\";\n } // Automated test IDs\n\n\n if (testID && testID.constructor === String) {\n domProps['data-testid'] = testID;\n }\n\n return domProps;\n};\n\nexport default createDOMProps;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport getBoundingClientRect from '../getBoundingClientRect';\nvar emptyArray = [];\n\nvar emptyFunction = function emptyFunction() {}; // Mobile Safari re-uses touch objects, so we copy the properties we want and normalize the identifier\n\n\nvar normalizeTouches = function normalizeTouches(touches) {\n if (!touches) {\n return emptyArray;\n }\n\n return Array.prototype.slice.call(touches).map(function (touch) {\n var identifier = touch.identifier > 20 ? touch.identifier % 20 : touch.identifier;\n var rect;\n return {\n _normalized: true,\n clientX: touch.clientX,\n clientY: touch.clientY,\n force: touch.force,\n\n get locationX() {\n rect = rect || getBoundingClientRect(touch.target);\n\n if (rect) {\n return touch.pageX - rect.left;\n }\n },\n\n get locationY() {\n rect = rect || getBoundingClientRect(touch.target);\n\n if (rect) {\n return touch.pageY - rect.top;\n }\n },\n\n identifier: identifier,\n pageX: touch.pageX,\n pageY: touch.pageY,\n radiusX: touch.radiusX,\n radiusY: touch.radiusY,\n rotationAngle: touch.rotationAngle,\n screenX: touch.screenX,\n screenY: touch.screenY,\n target: touch.target,\n // normalize the timestamp\n // https://stackoverflow.com/questions/26177087/ios-8-mobile-safari-wrong-timestamp-on-touch-events\n timestamp: Date.now()\n };\n });\n};\n\nfunction normalizeTouchEvent(nativeEvent) {\n var changedTouches = normalizeTouches(nativeEvent.changedTouches);\n var touches = normalizeTouches(nativeEvent.touches);\n var preventDefault = typeof nativeEvent.preventDefault === 'function' ? nativeEvent.preventDefault.bind(nativeEvent) : emptyFunction;\n var stopImmediatePropagation = typeof nativeEvent.stopImmediatePropagation === 'function' ? nativeEvent.stopImmediatePropagation.bind(nativeEvent) : emptyFunction;\n var stopPropagation = typeof nativeEvent.stopPropagation === 'function' ? nativeEvent.stopPropagation.bind(nativeEvent) : emptyFunction;\n var singleChangedTouch = changedTouches[0];\n var event = {\n _normalized: true,\n bubbles: nativeEvent.bubbles,\n cancelable: nativeEvent.cancelable,\n changedTouches: changedTouches,\n defaultPrevented: nativeEvent.defaultPrevented,\n identifier: singleChangedTouch ? singleChangedTouch.identifier : undefined,\n\n get locationX() {\n return singleChangedTouch ? singleChangedTouch.locationX : undefined;\n },\n\n get locationY() {\n return singleChangedTouch ? singleChangedTouch.locationY : undefined;\n },\n\n pageX: singleChangedTouch ? singleChangedTouch.pageX : nativeEvent.pageX,\n pageY: singleChangedTouch ? singleChangedTouch.pageY : nativeEvent.pageY,\n preventDefault: preventDefault,\n stopImmediatePropagation: stopImmediatePropagation,\n stopPropagation: stopPropagation,\n target: nativeEvent.target,\n // normalize the timestamp\n // https://stackoverflow.com/questions/26177087/ios-8-mobile-safari-wrong-timestamp-on-touch-events\n timestamp: Date.now(),\n touches: touches,\n type: nativeEvent.type,\n which: nativeEvent.which\n };\n return event;\n}\n\nfunction normalizeMouseEvent(nativeEvent) {\n var rect;\n var touches = [{\n _normalized: true,\n clientX: nativeEvent.clientX,\n clientY: nativeEvent.clientY,\n force: nativeEvent.force,\n identifier: 0,\n\n get locationX() {\n rect = rect || getBoundingClientRect(nativeEvent.target);\n\n if (rect) {\n return nativeEvent.pageX - rect.left;\n }\n },\n\n get locationY() {\n rect = rect || getBoundingClientRect(nativeEvent.target);\n\n if (rect) {\n return nativeEvent.pageY - rect.top;\n }\n },\n\n pageX: nativeEvent.pageX,\n pageY: nativeEvent.pageY,\n screenX: nativeEvent.screenX,\n screenY: nativeEvent.screenY,\n target: nativeEvent.target,\n timestamp: Date.now()\n }];\n var preventDefault = typeof nativeEvent.preventDefault === 'function' ? nativeEvent.preventDefault.bind(nativeEvent) : emptyFunction;\n var stopImmediatePropagation = typeof nativeEvent.stopImmediatePropagation === 'function' ? nativeEvent.stopImmediatePropagation.bind(nativeEvent) : emptyFunction;\n var stopPropagation = typeof nativeEvent.stopPropagation === 'function' ? nativeEvent.stopPropagation.bind(nativeEvent) : emptyFunction;\n return {\n _normalized: true,\n bubbles: nativeEvent.bubbles,\n cancelable: nativeEvent.cancelable,\n changedTouches: touches,\n defaultPrevented: nativeEvent.defaultPrevented,\n identifier: touches[0].identifier,\n\n get locationX() {\n return touches[0].locationX;\n },\n\n get locationY() {\n return touches[0].locationY;\n },\n\n pageX: nativeEvent.pageX,\n pageY: nativeEvent.pageY,\n preventDefault: preventDefault,\n stopImmediatePropagation: stopImmediatePropagation,\n stopPropagation: stopPropagation,\n target: nativeEvent.target,\n timestamp: touches[0].timestamp,\n touches: nativeEvent.type === 'mouseup' ? emptyArray : touches,\n type: nativeEvent.type,\n which: nativeEvent.which\n };\n} // TODO: how to best handle keyboard events?\n\n\nfunction normalizeNativeEvent(nativeEvent) {\n if (!nativeEvent || nativeEvent._normalized) {\n return nativeEvent;\n }\n\n var eventType = nativeEvent.type || '';\n var mouse = eventType.indexOf('mouse') >= 0;\n\n if (mouse) {\n return normalizeMouseEvent(nativeEvent);\n } else {\n return normalizeTouchEvent(nativeEvent);\n }\n}\n\nexport default normalizeNativeEvent;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n// based on https://github.com/facebook/react/pull/4303/files\nimport normalizeNativeEvent from '../normalizeNativeEvent';\nimport ReactDOMUnstableNativeDependencies from 'react-dom/unstable-native-dependencies';\nvar ResponderEventPlugin = ReactDOMUnstableNativeDependencies.ResponderEventPlugin,\n ResponderTouchHistoryStore = ReactDOMUnstableNativeDependencies.ResponderTouchHistoryStore; // On older versions of React (< 16.4) we have to inject the dependencies in\n// order for the plugin to work properly in the browser. This version still\n// uses `top*` strings to identify the internal event names.\n// https://github.com/facebook/react/pull/12629\n\nif (!ResponderEventPlugin.eventTypes.responderMove.dependencies) {\n var topMouseDown = 'topMouseDown';\n var topMouseMove = 'topMouseMove';\n var topMouseUp = 'topMouseUp';\n var topScroll = 'topScroll';\n var topSelectionChange = 'topSelectionChange';\n var topTouchCancel = 'topTouchCancel';\n var topTouchEnd = 'topTouchEnd';\n var topTouchMove = 'topTouchMove';\n var topTouchStart = 'topTouchStart';\n var endDependencies = [topTouchCancel, topTouchEnd, topMouseUp];\n var moveDependencies = [topTouchMove, topMouseMove];\n var startDependencies = [topTouchStart, topMouseDown];\n /**\n * Setup ResponderEventPlugin dependencies\n */\n\n ResponderEventPlugin.eventTypes.responderMove.dependencies = moveDependencies;\n ResponderEventPlugin.eventTypes.responderEnd.dependencies = endDependencies;\n ResponderEventPlugin.eventTypes.responderStart.dependencies = startDependencies;\n ResponderEventPlugin.eventTypes.responderRelease.dependencies = endDependencies;\n ResponderEventPlugin.eventTypes.responderTerminationRequest.dependencies = [];\n ResponderEventPlugin.eventTypes.responderGrant.dependencies = [];\n ResponderEventPlugin.eventTypes.responderReject.dependencies = [];\n ResponderEventPlugin.eventTypes.responderTerminate.dependencies = [];\n ResponderEventPlugin.eventTypes.moveShouldSetResponder.dependencies = moveDependencies;\n ResponderEventPlugin.eventTypes.selectionChangeShouldSetResponder.dependencies = [topSelectionChange];\n ResponderEventPlugin.eventTypes.scrollShouldSetResponder.dependencies = [topScroll];\n ResponderEventPlugin.eventTypes.startShouldSetResponder.dependencies = startDependencies;\n}\n\nvar lastActiveTouchTimestamp = null; // The length of time after a touch that we ignore the browser's emulated mouse events\n// https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events\n\nvar EMULATED_MOUSE_THERSHOLD_MS = 1000;\nvar originalExtractEvents = ResponderEventPlugin.extractEvents;\n\nResponderEventPlugin.extractEvents = function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var hasActiveTouches = ResponderTouchHistoryStore.touchHistory.numberActiveTouches > 0;\n var eventType = nativeEvent.type;\n var shouldSkipMouseAfterTouch = false;\n\n if (eventType.indexOf('touch') > -1) {\n lastActiveTouchTimestamp = Date.now();\n } else if (lastActiveTouchTimestamp && eventType.indexOf('mouse') > -1) {\n var now = Date.now();\n shouldSkipMouseAfterTouch = now - lastActiveTouchTimestamp < EMULATED_MOUSE_THERSHOLD_MS;\n }\n\n if ( // Filter out mousemove and mouseup events when a touch hasn't started yet\n (eventType === 'mousemove' || eventType === 'mouseup') && !hasActiveTouches || // Filter out events from wheel/middle and right click.\n nativeEvent.button === 1 || nativeEvent.button === 2 || // Filter out mouse events that browsers dispatch immediately after touch events end\n // Prevents the REP from calling handlers twice for touch interactions.\n // See #802 and #932.\n shouldSkipMouseAfterTouch) {\n return;\n }\n\n var normalizedEvent = normalizeNativeEvent(nativeEvent);\n return originalExtractEvents.call(ResponderEventPlugin, topLevelType, targetInst, normalizedEvent, nativeEventTarget);\n};\n\nexport default ResponderEventPlugin;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport AccessibilityUtil from '../../modules/AccessibilityUtil';\nimport createDOMProps from '../../modules/createDOMProps';\nimport { injectEventPluginsByName } from 'react-dom/unstable-native-dependencies';\nimport normalizeNativeEvent from '../../modules/normalizeNativeEvent';\nimport React from 'react';\nimport ResponderEventPlugin from '../../modules/ResponderEventPlugin';\ninjectEventPluginsByName({\n ResponderEventPlugin: ResponderEventPlugin\n});\n\nvar isModifiedEvent = function isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n};\n/**\n * Ensure event handlers receive an event of the expected shape. The 'button'\n * role – for accessibility reasons and functional equivalence to the native\n * button element – must also support synthetic keyboard activation of onclick,\n * and remove event handlers when disabled.\n */\n\n\nvar eventHandlerNames = {\n onBlur: true,\n onClick: true,\n onClickCapture: true,\n onContextMenu: true,\n onFocus: true,\n onResponderRelease: true,\n onTouchCancel: true,\n onTouchCancelCapture: true,\n onTouchEnd: true,\n onTouchEndCapture: true,\n onTouchMove: true,\n onTouchMoveCapture: true,\n onTouchStart: true,\n onTouchStartCapture: true\n};\n\nvar adjustProps = function adjustProps(domProps) {\n var onClick = domProps.onClick,\n onResponderRelease = domProps.onResponderRelease,\n role = domProps.role;\n var isButtonLikeRole = AccessibilityUtil.buttonLikeRoles[role];\n var isDisabled = AccessibilityUtil.isDisabled(domProps);\n var isLinkRole = role === 'link';\n Object.keys(domProps).forEach(function (propName) {\n var prop = domProps[propName];\n var isEventHandler = typeof prop === 'function' && eventHandlerNames[propName];\n\n if (isEventHandler) {\n if (isButtonLikeRole && isDisabled) {\n domProps[propName] = undefined;\n } else {\n // TODO: move this out of the render path\n domProps[propName] = function (e) {\n e.nativeEvent = normalizeNativeEvent(e.nativeEvent);\n return prop(e);\n };\n }\n }\n }); // Cancel click events if the responder system is being used on a link\n // element. Click events are not an expected part of the React Native API,\n // and browsers dispatch click events that cannot otherwise be cancelled from\n // preceding mouse events in the responder system.\n\n if (isLinkRole && onResponderRelease) {\n domProps.onClick = function (e) {\n if (!e.isDefaultPrevented() && !isModifiedEvent(e.nativeEvent) && !domProps.target) {\n e.preventDefault();\n }\n };\n } // Button-like roles should trigger 'onClick' if SPACE or ENTER keys are pressed.\n\n\n if (isButtonLikeRole && !isDisabled) {\n domProps.onKeyPress = function (e) {\n if (!e.isDefaultPrevented() && (e.which === 13 || e.which === 32)) {\n e.preventDefault();\n\n if (onClick) {\n onClick(e);\n }\n }\n };\n }\n};\n\nvar createElement = function createElement(component, props) {\n // use equivalent platform elements where possible\n var accessibilityComponent;\n\n if (component && component.constructor === String) {\n accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props);\n }\n\n var Component = accessibilityComponent || component;\n var domProps = createDOMProps(Component, props);\n adjustProps(domProps);\n\n for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n children[_key - 2] = arguments[_key];\n }\n\n return React.createElement.apply(React, [Component, domProps].concat(children));\n};\n\nexport default createElement;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { findDOMNode } from 'react-dom';\n\nvar findNodeHandle = function findNodeHandle(component) {\n var node;\n\n try {\n node = findDOMNode(component);\n } catch (e) {}\n\n return node;\n};\n\nexport default findNodeHandle;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { render } from 'react-dom';\nexport default render;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { unmountComponentAtNode } from 'react-dom';\nexport default unmountComponentAtNode;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport invariant from 'fbjs/lib/invariant';\n\nfunction createStrictShapeTypeChecker(shapeTypes) {\n function checkType(isRequired, props, propName, componentName, location) {\n if (!props[propName]) {\n if (isRequired) {\n invariant(false, \"Required object `\" + propName + \"` was not specified in `\" + componentName + \"`.\");\n }\n\n return;\n }\n\n var propValue = props[propName];\n var propType = typeof propValue;\n var locationName = location || '(unknown)';\n\n if (propType !== 'object') {\n invariant(false, \"Invalid \" + locationName + \" `\" + propName + \"` of type `\" + propType + \"` \" + (\"supplied to `\" + componentName + \"`, expected `object`.\"));\n } // We need to check all keys in case some are required but missing from\n // props.\n\n\n var allKeys = _objectSpread({}, props[propName], shapeTypes);\n\n for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n rest[_key - 5] = arguments[_key];\n }\n\n for (var _key2 in allKeys) {\n var checker = shapeTypes[_key2];\n\n if (!checker) {\n invariant(false, \"Invalid props.\" + propName + \" key `\" + _key2 + \"` supplied to `\" + componentName + \"`.\" + '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));\n }\n\n var error = checker.apply(void 0, [propValue, _key2, componentName, location].concat(rest));\n\n if (error) {\n invariant(false, error.message + '\\nBad object: ' + JSON.stringify(props[propName], null, ' '));\n }\n }\n }\n\n function chainedCheckType(props, propName, componentName, location) {\n for (var _len2 = arguments.length, rest = new Array(_len2 > 4 ? _len2 - 4 : 0), _key3 = 4; _key3 < _len2; _key3++) {\n rest[_key3 - 4] = arguments[_key3];\n }\n\n return checkType.apply(void 0, [false, props, propName, componentName, location].concat(rest));\n }\n\n chainedCheckType.isRequired = checkType.bind(null, true);\n return chainedCheckType;\n}\n\nexport default createStrictShapeTypeChecker;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport createStrictShapeTypeChecker from '../createStrictShapeTypeChecker';\nimport StyleSheet from '../../exports/StyleSheet';\n\nfunction StyleSheetPropType(shape) {\n var shapePropType = createStrictShapeTypeChecker(shape);\n return function (props, propName, componentName, location) {\n var newProps = props;\n\n if (props[propName]) {\n // Just make a dummy prop object with only the flattened style\n newProps = {};\n var flatStyle = StyleSheet.flatten(props[propName]); // Remove custom properties from check\n\n var nextStyle = Object.keys(flatStyle).reduce(function (acc, curr) {\n if (curr.indexOf('--') !== 0) {\n acc[curr] = flatStyle[curr];\n }\n\n return acc;\n }, {});\n newProps[propName] = nextStyle;\n }\n\n for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {\n rest[_key - 4] = arguments[_key];\n }\n\n return shapePropType.apply(void 0, [newProps, propName, componentName, location].concat(rest));\n };\n}\n\nexport default StyleSheetPropType;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport normalizeColor from '../../modules/normalizeColor';\n\nvar colorPropType = function colorPropType(isRequired, props, propName, componentName, location, propFullName) {\n var color = props[propName];\n\n if (color === undefined || color === null) {\n if (isRequired) {\n return new Error('Required ' + location + ' `' + (propFullName || propName) + '` was not specified in `' + componentName + '`.');\n }\n\n return;\n }\n\n if (typeof color === 'number') {\n // Developers should not use a number, but we are using the prop type\n // both for user provided colors and for transformed ones. This isn't ideal\n // and should be fixed but will do for now...\n return;\n }\n\n if (normalizeColor(color) === null) {\n return new Error('Invalid ' + location + ' `' + (propFullName || propName) + '` supplied to `' + componentName + '`: ' + color + '\\n' + \"Valid color formats are\\n - '#f0f' (#rgb)\\n - '#f0fc' (#rgba)\\n - '#ff00ff' (#rrggbb)\\n - '#ff00ff00' (#rrggbbaa)\\n - 'rgb(255, 255, 255)'\\n - 'rgba(255, 255, 255, 1.0)'\\n - 'hsl(360, 100%, 100%)'\\n - 'hsla(360, 100%, 100%, 1.0)'\\n - 'transparent'\\n - 'red'\\n - 0xff00ff00 (0xrrggbbaa)\\n\");\n }\n};\n\nvar ColorPropType;\n\nif (process.env.NODE_ENV !== 'production') {\n ColorPropType = colorPropType.bind(null, false\n /* isRequired */\n );\n ColorPropType.isRequired = colorPropType.bind(null, true\n /* isRequired */\n );\n} else {\n ColorPropType = function ColorPropType() {};\n}\n\nexport default ColorPropType;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { arrayOf, number, object, oneOf, oneOfType, string } from 'prop-types';\nvar animationDirectionEnum = ['alternate', 'alternate-reverse', 'normal', 'reverse'];\nvar animationFillModeEnum = ['none', 'forwards', 'backwards', 'both'];\nvar animationPlayStateEnum = ['paused', 'running'];\nvar AnimationPropTypes = {\n animationDelay: oneOfType([string, arrayOf(string)]),\n animationDirection: oneOfType([oneOf(animationDirectionEnum), arrayOf(animationDirectionEnum)]),\n animationDuration: oneOfType([string, arrayOf(string)]),\n animationFillMode: oneOfType([oneOf(animationFillModeEnum), arrayOf(animationFillModeEnum)]),\n animationIterationCount: oneOfType([number, oneOf(['infinite']), arrayOf(oneOfType([number, oneOf(['infinite'])]))]),\n animationKeyframes: oneOfType([string, object, arrayOf(oneOfType([string, object]))]),\n animationPlayState: oneOfType([oneOf(animationPlayStateEnum), arrayOf(animationPlayStateEnum)]),\n animationTimingFunction: oneOfType([string, arrayOf(string)]),\n transitionDelay: oneOfType([string, arrayOf(string)]),\n transitionDuration: oneOfType([string, arrayOf(string)]),\n transitionProperty: oneOfType([string, arrayOf(string)]),\n transitionTimingFunction: oneOfType([string, arrayOf(string)])\n};\nexport default AnimationPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport ColorPropType from '../../exports/ColorPropType';\nimport { number, oneOf, oneOfType, string } from 'prop-types';\nvar numberOrString = oneOfType([number, string]);\nvar BorderStylePropType = oneOf(['solid', 'dotted', 'dashed']);\nvar BorderPropTypes = {\n borderColor: ColorPropType,\n borderBottomColor: ColorPropType,\n borderEndColor: ColorPropType,\n borderLeftColor: ColorPropType,\n borderRightColor: ColorPropType,\n borderStartColor: ColorPropType,\n borderTopColor: ColorPropType,\n borderRadius: numberOrString,\n borderBottomEndRadius: numberOrString,\n borderBottomLeftRadius: numberOrString,\n borderBottomRightRadius: numberOrString,\n borderBottomStartRadius: numberOrString,\n borderTopEndRadius: numberOrString,\n borderTopLeftRadius: numberOrString,\n borderTopRightRadius: numberOrString,\n borderTopStartRadius: numberOrString,\n borderStyle: BorderStylePropType,\n borderBottomStyle: BorderStylePropType,\n borderEndStyle: BorderStylePropType,\n borderLeftStyle: BorderStylePropType,\n borderRightStyle: BorderStylePropType,\n borderStartStyle: BorderStylePropType,\n borderTopStyle: BorderStylePropType\n};\nexport default BorderPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { oneOf, string } from 'prop-types';\nvar InteractionPropTypes = {\n cursor: string,\n touchAction: oneOf(['auto', 'inherit', 'manipulation', 'none', 'pan-down', 'pan-left', 'pan-right', 'pan-up', 'pan-x', 'pan-y', 'pinch-zoom']),\n userSelect: string,\n willChange: string\n};\nexport default InteractionPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { number, oneOf, oneOfType, string } from 'prop-types';\nvar OverflowPropType = oneOf(['auto', 'hidden', 'scroll', 'visible']);\nvar hiddenOrVisible = oneOf(['hidden', 'visible']);\nvar numberOrString = oneOfType([number, string]);\nvar LayoutPropTypes = {\n alignContent: oneOf(['center', 'flex-end', 'flex-start', 'space-around', 'space-between', 'stretch']),\n alignItems: oneOf(['baseline', 'center', 'flex-end', 'flex-start', 'stretch']),\n alignSelf: oneOf(['auto', 'baseline', 'center', 'flex-end', 'flex-start', 'stretch']),\n backfaceVisibility: hiddenOrVisible,\n borderWidth: numberOrString,\n borderBottomWidth: numberOrString,\n borderEndWidth: numberOrString,\n borderLeftWidth: numberOrString,\n borderRightWidth: numberOrString,\n borderStartWidth: numberOrString,\n borderTopWidth: numberOrString,\n bottom: numberOrString,\n boxSizing: string,\n direction: oneOf(['inherit', 'ltr', 'rtl']),\n display: string,\n end: numberOrString,\n flex: number,\n flexBasis: numberOrString,\n flexDirection: oneOf(['column', 'column-reverse', 'row', 'row-reverse']),\n flexGrow: number,\n flexShrink: number,\n flexWrap: oneOf(['nowrap', 'wrap', 'wrap-reverse']),\n height: numberOrString,\n justifyContent: oneOf(['center', 'flex-end', 'flex-start', 'space-around', 'space-between', 'space-evenly']),\n left: numberOrString,\n margin: numberOrString,\n marginBottom: numberOrString,\n marginHorizontal: numberOrString,\n marginEnd: numberOrString,\n marginLeft: numberOrString,\n marginRight: numberOrString,\n marginStart: numberOrString,\n marginTop: numberOrString,\n marginVertical: numberOrString,\n maxHeight: numberOrString,\n maxWidth: numberOrString,\n minHeight: numberOrString,\n minWidth: numberOrString,\n order: number,\n overflow: OverflowPropType,\n overflowX: OverflowPropType,\n overflowY: OverflowPropType,\n padding: numberOrString,\n paddingBottom: numberOrString,\n paddingHorizontal: numberOrString,\n paddingEnd: numberOrString,\n paddingLeft: numberOrString,\n paddingRight: numberOrString,\n paddingStart: numberOrString,\n paddingTop: numberOrString,\n paddingVertical: numberOrString,\n position: oneOf(['absolute', 'fixed', 'relative', 'static', 'sticky']),\n right: numberOrString,\n start: numberOrString,\n top: numberOrString,\n visibility: hiddenOrVisible,\n width: numberOrString,\n zIndex: number,\n\n /**\n * @platform unsupported\n */\n aspectRatio: number,\n\n /**\n * @platform web\n */\n gridAutoColumns: string,\n gridAutoFlow: string,\n gridAutoRows: string,\n gridColumnEnd: string,\n gridColumnGap: string,\n gridColumnStart: string,\n gridRowEnd: string,\n gridRowGap: string,\n gridRowStart: string,\n gridTemplateColumns: string,\n gridTemplateRows: string,\n gridTemplateAreas: string\n};\nexport default LayoutPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport ColorPropType from '../../exports/ColorPropType';\nimport { number, oneOfType, shape, string } from 'prop-types';\nvar numberOrString = oneOfType([number, string]);\nvar ShadowPropTypes = {\n shadowColor: ColorPropType,\n shadowOffset: shape({\n width: numberOrString,\n height: numberOrString\n }),\n shadowOpacity: number,\n shadowRadius: numberOrString,\n shadowSpread: numberOrString\n};\nexport default ShadowPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { arrayOf, number, oneOf, oneOfType, shape, string } from 'prop-types';\nvar numberOrString = oneOfType([number, string]);\nvar TransformPropTypes = {\n perspective: oneOfType([number, string]),\n perspectiveOrigin: string,\n transform: arrayOf(oneOfType([shape({\n perspective: numberOrString\n }), shape({\n rotate: string\n }), shape({\n rotateX: string\n }), shape({\n rotateY: string\n }), shape({\n rotateZ: string\n }), shape({\n scale: number\n }), shape({\n scaleX: number\n }), shape({\n scaleY: number\n }), shape({\n scaleZ: number\n }), shape({\n scale3d: string\n }), shape({\n skewX: string\n }), shape({\n skewY: string\n }), shape({\n translateX: numberOrString\n }), shape({\n translateY: numberOrString\n }), shape({\n translateZ: numberOrString\n }), shape({\n translate3d: string\n })])),\n transformOrigin: string,\n transformStyle: oneOf(['flat', 'preserve-3d'])\n};\nexport default TransformPropTypes;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport AnimationPropTypes from '../../modules/AnimationPropTypes';\nimport BorderPropTypes from '../../modules/BorderPropTypes';\nimport ColorPropType from '../ColorPropType';\nimport InteractionPropTypes from '../../modules/InteractionPropTypes';\nimport LayoutPropTypes from '../../modules/LayoutPropTypes';\nimport ShadowPropTypes from '../../modules/ShadowPropTypes';\nimport TransformPropTypes from '../../modules/TransformPropTypes';\nimport { number, oneOf, oneOfType, string } from 'prop-types';\nvar stringOrNumber = oneOfType([string, number]);\nvar overscrollBehaviorType = oneOf(['auto', 'contain', 'none']);\n\nvar ViewStylePropTypes = _objectSpread({}, AnimationPropTypes, BorderPropTypes, InteractionPropTypes, LayoutPropTypes, ShadowPropTypes, TransformPropTypes, {\n backgroundColor: ColorPropType,\n opacity: number,\n\n /**\n * @platform unsupported\n */\n elevation: number,\n\n /**\n * @platform web\n */\n backdropFilter: string,\n backgroundAttachment: string,\n backgroundBlendMode: string,\n backgroundClip: string,\n backgroundImage: string,\n backgroundOrigin: oneOf(['border-box', 'content-box', 'padding-box']),\n backgroundPosition: string,\n backgroundRepeat: string,\n backgroundSize: string,\n boxShadow: string,\n clip: string,\n filter: string,\n outlineColor: ColorPropType,\n outlineOffset: stringOrNumber,\n outlineStyle: string,\n outlineWidth: stringOrNumber,\n overscrollBehavior: overscrollBehaviorType,\n overscrollBehaviorX: overscrollBehaviorType,\n overscrollBehaviorY: overscrollBehaviorType,\n scrollbarWidth: oneOf(['auto', 'none']),\n scrollSnapAlign: string,\n scrollSnapType: string,\n WebkitMaskImage: string,\n WebkitOverflowScrolling: oneOf(['auto', 'touch'])\n});\n\nexport default ViewStylePropTypes;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport ColorPropType from '../ColorPropType';\nimport ViewStylePropTypes from '../View/ViewStylePropTypes';\nimport { array, number, oneOf, oneOfType, shape, string } from 'prop-types';\nvar numberOrString = oneOfType([number, string]);\n\nvar TextStylePropTypes = _objectSpread({}, ViewStylePropTypes, {\n color: ColorPropType,\n fontFamily: string,\n fontFeatureSettings: string,\n fontSize: numberOrString,\n fontStyle: string,\n fontWeight: string,\n fontVariant: array,\n letterSpacing: numberOrString,\n lineHeight: numberOrString,\n textAlign: oneOf(['center', 'end', 'inherit', 'justify', 'justify-all', 'left', 'right', 'start']),\n textAlignVertical: string,\n textDecorationColor: ColorPropType,\n textDecorationLine: string,\n textDecorationStyle: string,\n textShadowColor: ColorPropType,\n textShadowOffset: shape({\n width: number,\n height: number\n }),\n textShadowRadius: number,\n textTransform: oneOf(['capitalize', 'lowercase', 'none', 'uppercase']),\n writingDirection: oneOf(['auto', 'ltr', 'rtl']),\n\n /* @platform web */\n textIndent: numberOrString,\n textOverflow: string,\n textRendering: oneOf(['auto', 'geometricPrecision', 'optimizeLegibility', 'optimizeSpeed']),\n unicodeBidi: oneOf(['normal', 'bidi-override', 'embed', 'isolate', 'isolate-override', 'plaintext']),\n whiteSpace: string,\n wordBreak: oneOf(['normal', 'break-all', 'break-word', 'keep-all']),\n wordWrap: string,\n MozOsxFontSmoothing: string,\n WebkitFontSmoothing: string\n});\n\nexport default TextStylePropTypes;","import TextPropTypes from '../Text/TextPropTypes';\nexport default TextPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport StyleSheetPropType from '../../modules/StyleSheetPropType';\nimport TextStylePropTypes from './TextStylePropTypes';\nimport { any, array, bool, func, number, oneOf, oneOfType, string } from 'prop-types';\nvar TextPropTypes = {\n accessibilityComponentType: string,\n accessibilityLabel: string,\n accessibilityLiveRegion: oneOf(['assertive', 'none', 'polite']),\n accessibilityRole: oneOf(['button', 'header', 'heading', 'label', 'link', 'listitem', 'none', 'text']),\n accessibilityTraits: oneOfType([array, string]),\n accessible: bool,\n children: any,\n importantForAccessibility: oneOf(['auto', 'no', 'no-hide-descendants', 'yes']),\n maxFontSizeMultiplier: number,\n nativeID: string,\n numberOfLines: number,\n onBlur: func,\n onFocus: func,\n onLayout: func,\n onPress: func,\n selectable: bool,\n style: StyleSheetPropType(TextStylePropTypes),\n testID: string,\n // web extensions\n onContextMenu: func,\n itemID: string,\n itemRef: string,\n itemProp: string,\n itemScope: string,\n itemType: string\n};\nexport default TextPropTypes;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport createStrictShapeTypeChecker from '../../modules/createStrictShapeTypeChecker';\nimport { number } from 'prop-types';\nvar EdgeInsetsPropType = createStrictShapeTypeChecker({\n top: number,\n left: number,\n bottom: number,\n right: number\n});\nexport default EdgeInsetsPropType;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport EdgeInsetsPropType from '../EdgeInsetsPropType';\nimport StyleSheetPropType from '../../modules/StyleSheetPropType';\nimport ViewStylePropTypes from './ViewStylePropTypes';\nimport { any, array, arrayOf, bool, func, object, oneOf, oneOfType, string } from 'prop-types';\nvar stylePropType = StyleSheetPropType(ViewStylePropTypes);\nvar ViewPropTypes = {\n accessibilityComponentType: string,\n accessibilityLabel: string,\n accessibilityLiveRegion: oneOf(['assertive', 'none', 'polite']),\n accessibilityRole: string,\n accessibilityStates: arrayOf(oneOf(['disabled', 'selected',\n /* web-only */\n 'busy', 'checked', 'expanded', 'grabbed', 'invalid', 'pressed'])),\n accessibilityTraits: oneOfType([array, string]),\n accessible: bool,\n children: any,\n hitSlop: EdgeInsetsPropType,\n importantForAccessibility: oneOf(['auto', 'no', 'no-hide-descendants', 'yes']),\n nativeID: string,\n onBlur: func,\n onClick: func,\n onClickCapture: func,\n onFocus: func,\n onLayout: func,\n onMoveShouldSetResponder: func,\n onMoveShouldSetResponderCapture: func,\n onResponderGrant: func,\n onResponderMove: func,\n onResponderReject: func,\n onResponderRelease: func,\n onResponderTerminate: func,\n onResponderTerminationRequest: func,\n onStartShouldSetResponder: func,\n onStartShouldSetResponderCapture: func,\n onTouchCancel: func,\n onTouchCancelCapture: func,\n onTouchEnd: func,\n onTouchEndCapture: func,\n onTouchMove: func,\n onTouchMoveCapture: func,\n onTouchStart: func,\n onTouchStartCapture: func,\n pointerEvents: oneOf(['auto', 'box-none', 'box-only', 'none']),\n style: stylePropType,\n testID: string,\n // web extensions\n onContextMenu: func,\n itemID: string,\n itemRef: string,\n itemProp: string,\n itemScope: string,\n itemType: string,\n // compatibility with React Native\n accessibilityViewIsModal: bool,\n collapsable: bool,\n needsOffscreenAlphaCompositing: bool,\n onAccessibilityTap: func,\n onMagicTap: func,\n removeClippedSubviews: bool,\n renderToHardwareTextureAndroid: bool,\n shouldRasterizeIOS: bool,\n tvParallaxProperties: object\n};\nexport default ViewPropTypes;","import ViewPropTypes from '../View/ViewPropTypes';\nexport default ViewPropTypes;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nfunction emptyFunction() {}\n\nvar AccessibilityInfo = {\n /**\n * Query whether a screen reader is currently enabled.\n *\n * Returns a promise which resolves to a boolean.\n * The result is `true` when a screen reader is enabled and `false` otherwise.\n */\n fetch: function fetch() {\n return new Promise(function (resolve, reject) {\n resolve(true);\n });\n },\n\n /**\n * Add an event handler. Supported events:\n */\n addEventListener: function addEventListener(eventName, handler) {\n return {\n remove: emptyFunction\n };\n },\n\n /**\n * Set accessibility focus to a react component.\n */\n setAccessibilityFocus: function setAccessibilityFocus(reactTag) {},\n\n /**\n * Post a string to be announced by the screen reader.\n */\n announceForAccessibility: function announceForAccessibility(announcement) {},\n\n /**\n * Remove an event handler.\n */\n removeEventListener: function removeEventListener(eventName, handler) {\n return;\n }\n};\nexport default AccessibilityInfo;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar Alert =\n/*#__PURE__*/\nfunction () {\n function Alert() {}\n\n Alert.alert = function alert() {};\n\n return Alert;\n}();\n\nexport default Alert;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nimport AnimatedValue from './nodes/AnimatedValue';\nimport NativeAnimatedHelper from './NativeAnimatedHelper';\nimport findNodeHandle from '../../../exports/findNodeHandle';\nimport invariant from 'fbjs/lib/invariant';\nvar shouldUseNativeDriver = NativeAnimatedHelper.shouldUseNativeDriver;\n\nfunction attachNativeEvent(viewRef, eventName, argMapping) {\n // Find animated values in `argMapping` and create an array representing their\n // key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].\n var eventMappings = [];\n\n var traverse = function traverse(value, path) {\n if (value instanceof AnimatedValue) {\n value.__makeNative();\n\n eventMappings.push({\n nativeEventPath: path,\n animatedValueTag: value.__getNativeTag()\n });\n } else if (typeof value === 'object') {\n for (var _key in value) {\n traverse(value[_key], path.concat(_key));\n }\n }\n };\n\n invariant(argMapping[0] && argMapping[0].nativeEvent, 'Native driven events only support animated values contained inside `nativeEvent`.'); // Assume that the event containing `nativeEvent` is always the first argument.\n\n traverse(argMapping[0].nativeEvent, []);\n var viewTag = findNodeHandle(viewRef);\n eventMappings.forEach(function (mapping) {\n NativeAnimatedHelper.API.addAnimatedEventToView(viewTag, eventName, mapping);\n });\n return {\n detach: function detach() {\n eventMappings.forEach(function (mapping) {\n NativeAnimatedHelper.API.removeAnimatedEventFromView(viewTag, eventName, mapping.animatedValueTag);\n });\n }\n };\n}\n\nvar AnimatedEvent =\n/*#__PURE__*/\nfunction () {\n function AnimatedEvent(argMapping, config) {\n if (config === void 0) {\n config = {};\n }\n\n this._listeners = [];\n this._argMapping = argMapping;\n\n if (config.listener) {\n this.__addListener(config.listener);\n }\n\n this._callListeners = this._callListeners.bind(this);\n this._attachedEvent = null;\n this.__isNative = shouldUseNativeDriver(config);\n\n if (process.env.NODE_ENV !== 'production') {\n this._validateMapping();\n }\n }\n\n var _proto = AnimatedEvent.prototype;\n\n _proto.__addListener = function __addListener(callback) {\n this._listeners.push(callback);\n };\n\n _proto.__removeListener = function __removeListener(callback) {\n this._listeners = this._listeners.filter(function (listener) {\n return listener !== callback;\n });\n };\n\n _proto.__attach = function __attach(viewRef, eventName) {\n invariant(this.__isNative, 'Only native driven events need to be attached.');\n this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping);\n };\n\n _proto.__detach = function __detach(viewTag, eventName) {\n invariant(this.__isNative, 'Only native driven events need to be detached.');\n this._attachedEvent && this._attachedEvent.detach();\n };\n\n _proto.__getHandler = function __getHandler() {\n var _this = this;\n\n if (this.__isNative) {\n return this._callListeners;\n }\n\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var traverse = function traverse(recMapping, recEvt, key) {\n if (typeof recEvt === 'number' && recMapping instanceof AnimatedValue) {\n recMapping.setValue(recEvt);\n } else if (typeof recMapping === 'object') {\n for (var mappingKey in recMapping) {\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n * comment suppresses an error when upgrading Flow's support for\n * React. To see the error delete this comment and run Flow. */\n traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);\n }\n }\n };\n\n if (!_this.__isNative) {\n _this._argMapping.forEach(function (mapping, idx) {\n traverse(mapping, args[idx], 'arg' + idx);\n });\n }\n\n _this._callListeners.apply(_this, args);\n };\n };\n\n _proto._callListeners = function _callListeners() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n this._listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n };\n\n _proto._validateMapping = function _validateMapping() {\n var traverse = function traverse(recMapping, recEvt, key) {\n if (typeof recEvt === 'number') {\n invariant(recMapping instanceof AnimatedValue, 'Bad mapping of type ' + typeof recMapping + ' for key ' + key + ', event value must map to AnimatedValue');\n return;\n }\n\n invariant(typeof recMapping === 'object', 'Bad mapping of type ' + typeof recMapping + ' for key ' + key);\n invariant(typeof recEvt === 'object', 'Bad event of type ' + typeof recEvt + ' for key ' + key);\n\n for (var mappingKey in recMapping) {\n traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);\n }\n };\n };\n\n return AnimatedEvent;\n}();\n\nexport { AnimatedEvent, attachNativeEvent };\nexport default {\n AnimatedEvent: AnimatedEvent,\n attachNativeEvent: attachNativeEvent\n};","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nvar AnimatedAddition =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedAddition, _AnimatedWithChildren);\n\n function AnimatedAddition(a, b) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n _this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n return _this;\n }\n\n var _proto = AnimatedAddition.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._a.__makeNative();\n\n this._b.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n return this._a.__getValue() + this._b.__getValue();\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__attach = function __attach() {\n this._a.__addChild(this);\n\n this._b.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._a.__removeChild(this);\n\n this._b.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n return {\n type: 'addition',\n input: [this._a.__getNativeTag(), this._b.__getNativeTag()]\n };\n };\n\n return AnimatedAddition;\n}(AnimatedWithChildren);\n\nexport default AnimatedAddition;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nvar AnimatedDiffClamp =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedDiffClamp, _AnimatedWithChildren);\n\n function AnimatedDiffClamp(a, min, max) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._a = a;\n _this._min = min;\n _this._max = max;\n _this._value = _this._lastValue = _this._a.__getValue();\n return _this;\n }\n\n var _proto = AnimatedDiffClamp.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._a.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__getValue = function __getValue() {\n var value = this._a.__getValue();\n\n var diff = value - this._lastValue;\n this._lastValue = value;\n this._value = Math.min(Math.max(this._value + diff, this._min), this._max);\n return this._value;\n };\n\n _proto.__attach = function __attach() {\n this._a.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._a.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n return {\n type: 'diffclamp',\n input: this._a.__getNativeTag(),\n min: this._min,\n max: this._max\n };\n };\n\n return AnimatedDiffClamp;\n}(AnimatedWithChildren);\n\nexport default AnimatedDiffClamp;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nvar AnimatedDivision =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedDivision, _AnimatedWithChildren);\n\n function AnimatedDivision(a, b) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n _this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n return _this;\n }\n\n var _proto = AnimatedDivision.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._a.__makeNative();\n\n this._b.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n var a = this._a.__getValue();\n\n var b = this._b.__getValue();\n\n if (b === 0) {\n console.error('Detected division by zero in AnimatedDivision');\n }\n\n return a / b;\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__attach = function __attach() {\n this._a.__addChild(this);\n\n this._b.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._a.__removeChild(this);\n\n this._b.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n return {\n type: 'division',\n input: [this._a.__getNativeTag(), this._b.__getNativeTag()]\n };\n };\n\n return AnimatedDivision;\n}(AnimatedWithChildren);\n\nexport default AnimatedDivision;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nvar AnimatedModulo =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedModulo, _AnimatedWithChildren);\n\n function AnimatedModulo(a, modulus) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._a = a;\n _this._modulus = modulus;\n return _this;\n }\n\n var _proto = AnimatedModulo.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._a.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus;\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__attach = function __attach() {\n this._a.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._a.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n return {\n type: 'modulus',\n input: this._a.__getNativeTag(),\n modulus: this._modulus\n };\n };\n\n return AnimatedModulo;\n}(AnimatedWithChildren);\n\nexport default AnimatedModulo;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nvar AnimatedMultiplication =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedMultiplication, _AnimatedWithChildren);\n\n function AnimatedMultiplication(a, b) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n _this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n return _this;\n }\n\n var _proto = AnimatedMultiplication.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._a.__makeNative();\n\n this._b.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n return this._a.__getValue() * this._b.__getValue();\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__attach = function __attach() {\n this._a.__addChild(this);\n\n this._b.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._a.__removeChild(this);\n\n this._b.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n return {\n type: 'multiplication',\n input: [this._a.__getNativeTag(), this._b.__getNativeTag()]\n };\n };\n\n return AnimatedMultiplication;\n}(AnimatedWithChildren);\n\nexport default AnimatedMultiplication;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nvar AnimatedTransform =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedTransform, _AnimatedWithChildren);\n\n function AnimatedTransform(transforms) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._transforms = transforms;\n return _this;\n }\n\n var _proto = AnimatedTransform.prototype;\n\n _proto.__makeNative = function __makeNative() {\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n\n this._transforms.forEach(function (transform) {\n for (var key in transform) {\n var value = transform[key];\n\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n });\n };\n\n _proto.__getValue = function __getValue() {\n return this._transforms.map(function (transform) {\n var result = {};\n\n for (var key in transform) {\n var value = transform[key];\n\n if (value instanceof AnimatedNode) {\n result[key] = value.__getValue();\n } else {\n result[key] = value;\n }\n }\n\n return result;\n });\n };\n\n _proto.__getAnimatedValue = function __getAnimatedValue() {\n return this._transforms.map(function (transform) {\n var result = {};\n\n for (var key in transform) {\n var value = transform[key];\n\n if (value instanceof AnimatedNode) {\n result[key] = value.__getAnimatedValue();\n } else {\n // All transform components needed to recompose matrix\n result[key] = value;\n }\n }\n\n return result;\n });\n };\n\n _proto.__attach = function __attach() {\n var _this2 = this;\n\n this._transforms.forEach(function (transform) {\n for (var key in transform) {\n var value = transform[key];\n\n if (value instanceof AnimatedNode) {\n value.__addChild(_this2);\n }\n }\n });\n };\n\n _proto.__detach = function __detach() {\n var _this3 = this;\n\n this._transforms.forEach(function (transform) {\n for (var key in transform) {\n var value = transform[key];\n\n if (value instanceof AnimatedNode) {\n value.__removeChild(_this3);\n }\n }\n });\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n var transConfigs = [];\n\n this._transforms.forEach(function (transform) {\n for (var key in transform) {\n var value = transform[key];\n\n if (value instanceof AnimatedNode) {\n transConfigs.push({\n type: 'animated',\n property: key,\n nodeTag: value.__getNativeTag()\n });\n } else {\n transConfigs.push({\n type: 'static',\n property: key,\n value: value\n });\n }\n }\n });\n\n NativeAnimatedHelper.validateTransform(transConfigs);\n return {\n type: 'transform',\n transforms: transConfigs\n };\n };\n\n return AnimatedTransform;\n}(AnimatedWithChildren);\n\nexport default AnimatedTransform;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedTransform from './AnimatedTransform';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport StyleSheet from '../../../../exports/StyleSheet';\nvar flattenStyle = StyleSheet.flatten;\n\nvar AnimatedStyle =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedStyle, _AnimatedWithChildren);\n\n function AnimatedStyle(style) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n style = flattenStyle(style) || {};\n\n if (style.transform) {\n style = _objectSpread({}, style, {\n transform: new AnimatedTransform(style.transform)\n });\n }\n\n _this._style = style;\n return _this;\n } // Recursively get values for nested styles (like iOS's shadowOffset)\n\n\n var _proto = AnimatedStyle.prototype;\n\n _proto._walkStyleAndGetValues = function _walkStyleAndGetValues(style) {\n var updatedStyle = {};\n\n for (var key in style) {\n var value = style[key];\n\n if (value instanceof AnimatedNode) {\n if (!value.__isNative) {\n // We cannot use value of natively driven nodes this way as the value we have access from\n // JS may not be up to date.\n updatedStyle[key] = value.__getValue();\n }\n } else if (value && !Array.isArray(value) && typeof value === 'object') {\n // Support animating nested values (for example: shadowOffset.height)\n updatedStyle[key] = this._walkStyleAndGetValues(value);\n } else {\n updatedStyle[key] = value;\n }\n }\n\n return updatedStyle;\n };\n\n _proto.__getValue = function __getValue() {\n return this._walkStyleAndGetValues(this._style);\n } // Recursively get animated values for nested styles (like iOS's shadowOffset)\n ;\n\n _proto._walkStyleAndGetAnimatedValues = function _walkStyleAndGetAnimatedValues(style) {\n var updatedStyle = {};\n\n for (var key in style) {\n var value = style[key];\n\n if (value instanceof AnimatedNode) {\n updatedStyle[key] = value.__getAnimatedValue();\n } else if (value && !Array.isArray(value) && typeof value === 'object') {\n // Support animating nested values (for example: shadowOffset.height)\n updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);\n }\n }\n\n return updatedStyle;\n };\n\n _proto.__getAnimatedValue = function __getAnimatedValue() {\n return this._walkStyleAndGetAnimatedValues(this._style);\n };\n\n _proto.__attach = function __attach() {\n for (var key in this._style) {\n var value = this._style[key];\n\n if (value instanceof AnimatedNode) {\n value.__addChild(this);\n }\n }\n };\n\n _proto.__detach = function __detach() {\n for (var key in this._style) {\n var value = this._style[key];\n\n if (value instanceof AnimatedNode) {\n value.__removeChild(this);\n }\n }\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__makeNative = function __makeNative() {\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n\n for (var key in this._style) {\n var value = this._style[key];\n\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n var styleConfig = {};\n\n for (var styleKey in this._style) {\n if (this._style[styleKey] instanceof AnimatedNode) {\n styleConfig[styleKey] = this._style[styleKey].__getNativeTag();\n } // Non-animated styles are set using `setNativeProps`, no need\n // to pass those as a part of the node config\n\n }\n\n NativeAnimatedHelper.validateStyles(styleConfig);\n return {\n type: 'style',\n style: styleConfig\n };\n };\n\n return AnimatedStyle;\n}(AnimatedWithChildren);\n\nexport default AnimatedStyle;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport { AnimatedEvent } from '../AnimatedEvent';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedStyle from './AnimatedStyle';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport findNodeHandle from '../../../../exports/findNodeHandle';\nimport invariant from 'fbjs/lib/invariant';\n\nvar AnimatedProps =\n/*#__PURE__*/\nfunction (_AnimatedNode) {\n _inheritsLoose(AnimatedProps, _AnimatedNode);\n\n function AnimatedProps(props, callback) {\n var _this;\n\n _this = _AnimatedNode.call(this) || this;\n\n if (props.style) {\n props = _objectSpread({}, props, {\n style: new AnimatedStyle(props.style)\n });\n }\n\n _this._props = props;\n _this._callback = callback;\n\n _this.__attach();\n\n return _this;\n }\n\n var _proto = AnimatedProps.prototype;\n\n _proto.__getValue = function __getValue() {\n var props = {};\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n if (!value.__isNative || value instanceof AnimatedStyle) {\n // We cannot use value of natively driven nodes this way as the value we have access from\n // JS may not be up to date.\n props[key] = value.__getValue();\n }\n } else if (value instanceof AnimatedEvent) {\n props[key] = value.__getHandler();\n } else {\n props[key] = value;\n }\n }\n\n return props;\n };\n\n _proto.__getAnimatedValue = function __getAnimatedValue() {\n var props = {};\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n props[key] = value.__getAnimatedValue();\n }\n }\n\n return props;\n };\n\n _proto.__attach = function __attach() {\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n value.__addChild(this);\n }\n }\n };\n\n _proto.__detach = function __detach() {\n if (this.__isNative && this._animatedView) {\n this.__disconnectAnimatedView();\n }\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n value.__removeChild(this);\n }\n }\n\n _AnimatedNode.prototype.__detach.call(this);\n };\n\n _proto.update = function update() {\n this._callback();\n };\n\n _proto.__makeNative = function __makeNative() {\n if (!this.__isNative) {\n this.__isNative = true;\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n\n if (this._animatedView) {\n this.__connectAnimatedView();\n }\n }\n };\n\n _proto.setNativeView = function setNativeView(animatedView) {\n if (this._animatedView === animatedView) {\n return;\n }\n\n this._animatedView = animatedView;\n\n if (this.__isNative) {\n this.__connectAnimatedView();\n }\n };\n\n _proto.__connectAnimatedView = function __connectAnimatedView() {\n invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n var nativeViewTag = findNodeHandle(this._animatedView);\n invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');\n NativeAnimatedHelper.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);\n };\n\n _proto.__disconnectAnimatedView = function __disconnectAnimatedView() {\n invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n var nativeViewTag = findNodeHandle(this._animatedView);\n invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');\n NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n var propsConfig = {};\n\n for (var propKey in this._props) {\n var value = this._props[propKey];\n\n if (value instanceof AnimatedNode) {\n propsConfig[propKey] = value.__getNativeTag();\n }\n }\n\n return {\n type: 'props',\n props: propsConfig\n };\n };\n\n return AnimatedProps;\n}(AnimatedNode);\n\nexport default AnimatedProps;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedNode from './AnimatedNode';\nimport { generateNewAnimationId, shouldUseNativeDriver } from '../NativeAnimatedHelper';\n\nvar AnimatedTracking =\n/*#__PURE__*/\nfunction (_AnimatedNode) {\n _inheritsLoose(AnimatedTracking, _AnimatedNode);\n\n function AnimatedTracking(value, parent, animationClass, animationConfig, callback) {\n var _this;\n\n _this = _AnimatedNode.call(this) || this;\n _this._value = value;\n _this._parent = parent;\n _this._animationClass = animationClass;\n _this._animationConfig = animationConfig;\n _this._useNativeDriver = shouldUseNativeDriver(animationConfig);\n _this._callback = callback;\n\n _this.__attach();\n\n return _this;\n }\n\n var _proto = AnimatedTracking.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this.__isNative = true;\n\n this._parent.__makeNative();\n\n _AnimatedNode.prototype.__makeNative.call(this);\n\n this._value.__makeNative();\n };\n\n _proto.__getValue = function __getValue() {\n return this._parent.__getValue();\n };\n\n _proto.__attach = function __attach() {\n this._parent.__addChild(this);\n\n if (this._useNativeDriver) {\n // when the tracking starts we need to convert this node to a \"native node\"\n // so that the parent node will be made \"native\" too. This is necessary as\n // if we don't do this `update` method will get called. At that point it\n // may be too late as it would mean the JS driver has already started\n // updating node values\n this.__makeNative();\n }\n };\n\n _proto.__detach = function __detach() {\n this._parent.__removeChild(this);\n\n _AnimatedNode.prototype.__detach.call(this);\n };\n\n _proto.update = function update() {\n this._value.animate(new this._animationClass(_objectSpread({}, this._animationConfig, {\n toValue: this._animationConfig.toValue.__getValue()\n })), this._callback);\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n var animation = new this._animationClass(_objectSpread({}, this._animationConfig, {\n // remove toValue from the config as it's a ref to Animated.Value\n toValue: undefined\n }));\n\n var animationConfig = animation.__getNativeAnimationConfig();\n\n return {\n type: 'tracking',\n animationId: generateNewAnimationId(),\n animationConfig: animationConfig,\n toValue: this._parent.__getNativeTag(),\n value: this._value.__getNativeTag()\n };\n };\n\n return AnimatedTracking;\n}(AnimatedNode);\n\nexport default AnimatedTracking;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nimport { AnimatedEvent } from './AnimatedEvent';\nimport AnimatedProps from './nodes/AnimatedProps';\nimport React from 'react';\nimport ViewStylePropTypes from '../../../exports/View/ViewStylePropTypes';\nimport invariant from 'fbjs/lib/invariant';\n\nfunction createAnimatedComponent(Component) {\n invariant(typeof Component === 'string' || Component.prototype && Component.prototype.isReactComponent, '`createAnimatedComponent` does not support stateless functional components; ' + 'use a class component instead.');\n\n var AnimatedComponent =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(AnimatedComponent, _React$Component);\n\n function AnimatedComponent(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this._invokeAnimatedPropsCallbackOnMount = false;\n _this._eventDetachers = [];\n\n _this._animatedPropsCallback = function () {\n if (_this._component == null) {\n // AnimatedProps is created in will-mount because it's used in render.\n // But this callback may be invoked before mount in async mode,\n // In which case we should defer the setNativeProps() call.\n // React may throw away uncommitted work in async mode,\n // So a deferred call won't always be invoked.\n _this._invokeAnimatedPropsCallbackOnMount = true;\n } else if (AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY || typeof _this._component.setNativeProps !== 'function') {\n _this.forceUpdate();\n } else if (!_this._propsAnimated.__isNative) {\n _this._component.setNativeProps(_this._propsAnimated.__getAnimatedValue());\n } else {\n throw new Error('Attempting to run JS driven animation on animated ' + 'node that has been moved to \"native\" earlier by starting an ' + 'animation with `useNativeDriver: true`');\n }\n };\n\n _this._setComponentRef = _this._setComponentRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n var _proto = AnimatedComponent.prototype;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._propsAnimated && this._propsAnimated.__detach();\n\n this._detachNativeEvents();\n };\n\n _proto.setNativeProps = function setNativeProps(props) {\n this._component.setNativeProps(props);\n };\n\n _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() {\n this._attachProps(this.props);\n };\n\n _proto.componentDidMount = function componentDidMount() {\n if (this._invokeAnimatedPropsCallbackOnMount) {\n this._invokeAnimatedPropsCallbackOnMount = false;\n\n this._animatedPropsCallback();\n }\n\n this._propsAnimated.setNativeView(this._component);\n\n this._attachNativeEvents();\n };\n\n _proto._attachNativeEvents = function _attachNativeEvents() {\n var _this2 = this; // Make sure to get the scrollable node for components that implement\n // `ScrollResponder.Mixin`.\n\n\n var scrollableNode = this._component.getScrollableNode ? this._component.getScrollableNode() : this._component;\n\n var _loop = function _loop(key) {\n var prop = _this2.props[key];\n\n if (prop instanceof AnimatedEvent && prop.__isNative) {\n prop.__attach(scrollableNode, key);\n\n _this2._eventDetachers.push(function () {\n return prop.__detach(scrollableNode, key);\n });\n }\n };\n\n for (var key in this.props) {\n _loop(key);\n }\n };\n\n _proto._detachNativeEvents = function _detachNativeEvents() {\n this._eventDetachers.forEach(function (remove) {\n return remove();\n });\n\n this._eventDetachers = [];\n } // The system is best designed when setNativeProps is implemented. It is\n // able to avoid re-rendering and directly set the attributes that changed.\n // However, setNativeProps can only be implemented on leaf native\n // components. If you want to animate a composite component, you need to\n // re-render it. In this case, we have a fallback that uses forceUpdate.\n ;\n\n _proto._attachProps = function _attachProps(nextProps) {\n var oldPropsAnimated = this._propsAnimated;\n this._propsAnimated = new AnimatedProps(nextProps, this._animatedPropsCallback); // When you call detach, it removes the element from the parent list\n // of children. If it goes to 0, then the parent also detaches itself\n // and so on.\n // An optimization is to attach the new elements and THEN detach the old\n // ones instead of detaching and THEN attaching.\n // This way the intermediate state isn't to go to 0 and trigger\n // this expensive recursive detaching to then re-attach everything on\n // the very next operation.\n\n oldPropsAnimated && oldPropsAnimated.__detach();\n };\n\n _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(newProps) {\n this._attachProps(newProps);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n if (this._component !== this._prevComponent) {\n this._propsAnimated.setNativeView(this._component);\n }\n\n if (this._component !== this._prevComponent || prevProps !== this.props) {\n this._detachNativeEvents();\n\n this._attachNativeEvents();\n }\n };\n\n _proto.render = function render() {\n var props = this._propsAnimated.__getValue();\n\n return React.createElement(Component, _extends({}, props, {\n ref: this._setComponentRef // The native driver updates views directly through the UI thread so we\n // have to make sure the view doesn't get optimized away because it cannot\n // go through the NativeViewHierarchyManager since it operates on the shadow\n // thread.\n ,\n collapsable: this._propsAnimated.__isNative ? false : props.collapsable\n }));\n };\n\n _proto._setComponentRef = function _setComponentRef(c) {\n this._prevComponent = this._component;\n this._component = c;\n } // A third party library can use getNode()\n // to get the node reference of the decorated component\n ;\n\n _proto.getNode = function getNode() {\n return this._component;\n };\n\n return AnimatedComponent;\n }(React.Component);\n\n AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY = false;\n var propTypes = Component.propTypes;\n AnimatedComponent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n style: function style(props, propName, componentName) {\n if (!propTypes) {\n return;\n }\n\n for (var key in ViewStylePropTypes) {\n if (!propTypes[key] && props[key] !== undefined) {\n console.warn('You are setting the style `{ ' + key + ': ... }` as a prop. You ' + 'should nest it in a style object. ' + 'E.g. `{ style: { ' + key + ': ... } }`');\n }\n }\n }\n } : {};\n return AnimatedComponent;\n}\n\nexport default createAnimatedComponent;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n * @preventMunge\n */\n'use strict';\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { AnimatedEvent, attachNativeEvent } from './AnimatedEvent';\nimport AnimatedAddition from './nodes/AnimatedAddition';\nimport AnimatedDiffClamp from './nodes/AnimatedDiffClamp';\nimport AnimatedDivision from './nodes/AnimatedDivision';\nimport AnimatedInterpolation from './nodes/AnimatedInterpolation';\nimport AnimatedModulo from './nodes/AnimatedModulo';\nimport AnimatedMultiplication from './nodes/AnimatedMultiplication';\nimport AnimatedNode from './nodes/AnimatedNode';\nimport AnimatedProps from './nodes/AnimatedProps';\nimport AnimatedTracking from './nodes/AnimatedTracking';\nimport AnimatedValue from './nodes/AnimatedValue';\nimport AnimatedValueXY from './nodes/AnimatedValueXY';\nimport DecayAnimation from './animations/DecayAnimation';\nimport SpringAnimation from './animations/SpringAnimation';\nimport TimingAnimation from './animations/TimingAnimation';\nimport createAnimatedComponent from './createAnimatedComponent';\n\nvar add = function add(a, b) {\n return new AnimatedAddition(a, b);\n};\n\nvar divide = function divide(a, b) {\n return new AnimatedDivision(a, b);\n};\n\nvar multiply = function multiply(a, b) {\n return new AnimatedMultiplication(a, b);\n};\n\nvar modulo = function modulo(a, modulus) {\n return new AnimatedModulo(a, modulus);\n};\n\nvar diffClamp = function diffClamp(a, min, max) {\n return new AnimatedDiffClamp(a, min, max);\n};\n\nvar _combineCallbacks = function _combineCallbacks(callback, config) {\n if (callback && config.onComplete) {\n return function () {\n config.onComplete && config.onComplete.apply(config, arguments);\n callback && callback.apply(void 0, arguments);\n };\n } else {\n return callback || config.onComplete;\n }\n};\n\nvar maybeVectorAnim = function maybeVectorAnim(value, config, anim) {\n if (value instanceof AnimatedValueXY) {\n var configX = _objectSpread({}, config);\n\n var configY = _objectSpread({}, config);\n\n for (var key in config) {\n var _config$key = config[key],\n x = _config$key.x,\n y = _config$key.y;\n\n if (x !== undefined && y !== undefined) {\n configX[key] = x;\n configY[key] = y;\n }\n }\n\n var aX = anim(value.x, configX);\n var aY = anim(value.y, configY); // We use `stopTogether: false` here because otherwise tracking will break\n // because the second animation will get stopped before it can update.\n\n return parallel([aX, aY], {\n stopTogether: false\n });\n }\n\n return null;\n};\n\nvar spring = function spring(value, config) {\n var _start = function start(animatedValue, configuration, callback) {\n callback = _combineCallbacks(callback, configuration);\n var singleValue = animatedValue;\n var singleConfig = configuration;\n singleValue.stopTracking();\n\n if (configuration.toValue instanceof AnimatedNode) {\n singleValue.track(new AnimatedTracking(singleValue, configuration.toValue, SpringAnimation, singleConfig, callback));\n } else {\n singleValue.animate(new SpringAnimation(singleConfig), callback);\n }\n };\n\n return maybeVectorAnim(value, config, spring) || {\n start: function start(callback) {\n _start(value, config, callback);\n },\n stop: function stop() {\n value.stopAnimation();\n },\n reset: function reset() {\n value.resetAnimation();\n },\n _startNativeLoop: function _startNativeLoop(iterations) {\n var singleConfig = _objectSpread({}, config, {\n iterations: iterations\n });\n\n _start(value, singleConfig);\n },\n _isUsingNativeDriver: function _isUsingNativeDriver() {\n return config.useNativeDriver || false;\n }\n };\n};\n\nvar timing = function timing(value, config) {\n var _start2 = function start(animatedValue, configuration, callback) {\n callback = _combineCallbacks(callback, configuration);\n var singleValue = animatedValue;\n var singleConfig = configuration;\n singleValue.stopTracking();\n\n if (configuration.toValue instanceof AnimatedNode) {\n singleValue.track(new AnimatedTracking(singleValue, configuration.toValue, TimingAnimation, singleConfig, callback));\n } else {\n singleValue.animate(new TimingAnimation(singleConfig), callback);\n }\n };\n\n return maybeVectorAnim(value, config, timing) || {\n start: function start(callback) {\n _start2(value, config, callback);\n },\n stop: function stop() {\n value.stopAnimation();\n },\n reset: function reset() {\n value.resetAnimation();\n },\n _startNativeLoop: function _startNativeLoop(iterations) {\n var singleConfig = _objectSpread({}, config, {\n iterations: iterations\n });\n\n _start2(value, singleConfig);\n },\n _isUsingNativeDriver: function _isUsingNativeDriver() {\n return config.useNativeDriver || false;\n }\n };\n};\n\nvar decay = function decay(value, config) {\n var _start3 = function start(animatedValue, configuration, callback) {\n callback = _combineCallbacks(callback, configuration);\n var singleValue = animatedValue;\n var singleConfig = configuration;\n singleValue.stopTracking();\n singleValue.animate(new DecayAnimation(singleConfig), callback);\n };\n\n return maybeVectorAnim(value, config, decay) || {\n start: function start(callback) {\n _start3(value, config, callback);\n },\n stop: function stop() {\n value.stopAnimation();\n },\n reset: function reset() {\n value.resetAnimation();\n },\n _startNativeLoop: function _startNativeLoop(iterations) {\n var singleConfig = _objectSpread({}, config, {\n iterations: iterations\n });\n\n _start3(value, singleConfig);\n },\n _isUsingNativeDriver: function _isUsingNativeDriver() {\n return config.useNativeDriver || false;\n }\n };\n};\n\nvar sequence = function sequence(animations) {\n var current = 0;\n return {\n start: function start(callback) {\n var onComplete = function onComplete(result) {\n if (!result.finished) {\n callback && callback(result);\n return;\n }\n\n current++;\n\n if (current === animations.length) {\n callback && callback(result);\n return;\n }\n\n animations[current].start(onComplete);\n };\n\n if (animations.length === 0) {\n callback && callback({\n finished: true\n });\n } else {\n animations[current].start(onComplete);\n }\n },\n stop: function stop() {\n if (current < animations.length) {\n animations[current].stop();\n }\n },\n reset: function reset() {\n animations.forEach(function (animation, idx) {\n if (idx <= current) {\n animation.reset();\n }\n });\n current = 0;\n },\n _startNativeLoop: function _startNativeLoop() {\n throw new Error('Loops run using the native driver cannot contain Animated.sequence animations');\n },\n _isUsingNativeDriver: function _isUsingNativeDriver() {\n return false;\n }\n };\n};\n\nvar parallel = function parallel(animations, config) {\n var doneCount = 0; // Make sure we only call stop() at most once for each animation\n\n var hasEnded = {};\n var stopTogether = !(config && config.stopTogether === false);\n var result = {\n start: function start(callback) {\n if (doneCount === animations.length) {\n callback && callback({\n finished: true\n });\n return;\n }\n\n animations.forEach(function (animation, idx) {\n var cb = function cb(endResult) {\n hasEnded[idx] = true;\n doneCount++;\n\n if (doneCount === animations.length) {\n doneCount = 0;\n callback && callback(endResult);\n return;\n }\n\n if (!endResult.finished && stopTogether) {\n result.stop();\n }\n };\n\n if (!animation) {\n cb({\n finished: true\n });\n } else {\n animation.start(cb);\n }\n });\n },\n stop: function stop() {\n animations.forEach(function (animation, idx) {\n !hasEnded[idx] && animation.stop();\n hasEnded[idx] = true;\n });\n },\n reset: function reset() {\n animations.forEach(function (animation, idx) {\n animation.reset();\n hasEnded[idx] = false;\n doneCount = 0;\n });\n },\n _startNativeLoop: function _startNativeLoop() {\n throw new Error('Loops run using the native driver cannot contain Animated.parallel animations');\n },\n _isUsingNativeDriver: function _isUsingNativeDriver() {\n return false;\n }\n };\n return result;\n};\n\nvar delay = function delay(time) {\n // Would be nice to make a specialized implementation\n return timing(new AnimatedValue(0), {\n toValue: 0,\n delay: time,\n duration: 0\n });\n};\n\nvar stagger = function stagger(time, animations) {\n return parallel(animations.map(function (animation, i) {\n return sequence([delay(time * i), animation]);\n }));\n};\n\nvar loop = function loop(animation, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$iterations = _ref.iterations,\n iterations = _ref$iterations === void 0 ? -1 : _ref$iterations;\n\n var isFinished = false;\n var iterationsSoFar = 0;\n return {\n start: function start(callback) {\n var restart = function restart(result) {\n if (result === void 0) {\n result = {\n finished: true\n };\n }\n\n if (isFinished || iterationsSoFar === iterations || result.finished === false) {\n callback && callback(result);\n } else {\n iterationsSoFar++;\n animation.reset();\n animation.start(restart);\n }\n };\n\n if (!animation || iterations === 0) {\n callback && callback({\n finished: true\n });\n } else {\n if (animation._isUsingNativeDriver()) {\n animation._startNativeLoop(iterations);\n } else {\n restart(); // Start looping recursively on the js thread\n }\n }\n },\n stop: function stop() {\n isFinished = true;\n animation.stop();\n },\n reset: function reset() {\n iterationsSoFar = 0;\n isFinished = false;\n animation.reset();\n },\n _startNativeLoop: function _startNativeLoop() {\n throw new Error('Loops run using the native driver cannot contain Animated.loop animations');\n },\n _isUsingNativeDriver: function _isUsingNativeDriver() {\n return animation._isUsingNativeDriver();\n }\n };\n};\n\nfunction forkEvent(event, listener) {\n if (!event) {\n return listener;\n } else if (event instanceof AnimatedEvent) {\n event.__addListener(listener);\n\n return event;\n } else {\n return function () {\n typeof event === 'function' && event.apply(void 0, arguments);\n listener.apply(void 0, arguments);\n };\n }\n}\n\nfunction unforkEvent(event, listener) {\n if (event && event instanceof AnimatedEvent) {\n event.__removeListener(listener);\n }\n}\n\nvar event = function event(argMapping, config) {\n var animatedEvent = new AnimatedEvent(argMapping, config);\n\n if (animatedEvent.__isNative) {\n return animatedEvent;\n } else {\n return animatedEvent.__getHandler();\n }\n};\n/**\n * The `Animated` library is designed to make animations fluid, powerful, and\n * easy to build and maintain. `Animated` focuses on declarative relationships\n * between inputs and outputs, with configurable transforms in between, and\n * simple `start`/`stop` methods to control time-based animation execution.\n *\n * See http://facebook.github.io/react-native/docs/animated.html\n */\n\n\nvar AnimatedImplementation = {\n /**\n * Standard value class for driving animations. Typically initialized with\n * `new Animated.Value(0);`\n *\n * See http://facebook.github.io/react-native/docs/animated.html#value\n */\n Value: AnimatedValue,\n\n /**\n * 2D value class for driving 2D animations, such as pan gestures.\n *\n * See https://facebook.github.io/react-native/releases/next/docs/animatedvaluexy.html\n */\n ValueXY: AnimatedValueXY,\n\n /**\n * Exported to use the Interpolation type in flow.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#interpolation\n */\n Interpolation: AnimatedInterpolation,\n\n /**\n * Exported for ease of type checking. All animated values derive from this\n * class.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#node\n */\n Node: AnimatedNode,\n\n /**\n * Animates a value from an initial velocity to zero based on a decay\n * coefficient.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#decay\n */\n decay: decay,\n\n /**\n * Animates a value along a timed easing curve. The Easing module has tons of\n * predefined curves, or you can use your own function.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#timing\n */\n timing: timing,\n\n /**\n * Animates a value according to an analytical spring model based on\n * damped harmonic oscillation.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#spring\n */\n spring: spring,\n\n /**\n * Creates a new Animated value composed from two Animated values added\n * together.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#add\n */\n add: add,\n\n /**\n * Creates a new Animated value composed by dividing the first Animated value\n * by the second Animated value.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#divide\n */\n divide: divide,\n\n /**\n * Creates a new Animated value composed from two Animated values multiplied\n * together.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#multiply\n */\n multiply: multiply,\n\n /**\n * Creates a new Animated value that is the (non-negative) modulo of the\n * provided Animated value.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#modulo\n */\n modulo: modulo,\n\n /**\n * Create a new Animated value that is limited between 2 values. It uses the\n * difference between the last value so even if the value is far from the\n * bounds it will start changing when the value starts getting closer again.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#diffclamp\n */\n diffClamp: diffClamp,\n\n /**\n * Starts an animation after the given delay.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#delay\n */\n delay: delay,\n\n /**\n * Starts an array of animations in order, waiting for each to complete\n * before starting the next. If the current running animation is stopped, no\n * following animations will be started.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#sequence\n */\n sequence: sequence,\n\n /**\n * Starts an array of animations all at the same time. By default, if one\n * of the animations is stopped, they will all be stopped. You can override\n * this with the `stopTogether` flag.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#parallel\n */\n parallel: parallel,\n\n /**\n * Array of animations may run in parallel (overlap), but are started in\n * sequence with successive delays. Nice for doing trailing effects.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#stagger\n */\n stagger: stagger,\n\n /**\n * Loops a given animation continuously, so that each time it reaches the\n * end, it resets and begins again from the start.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#loop\n */\n loop: loop,\n\n /**\n * Takes an array of mappings and extracts values from each arg accordingly,\n * then calls `setValue` on the mapped outputs.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#event\n */\n event: event,\n\n /**\n * Make any React component Animatable. Used to create `Animated.View`, etc.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#createanimatedcomponent\n */\n createAnimatedComponent: createAnimatedComponent,\n\n /**\n * Imperative API to attach an animated value to an event on a view. Prefer\n * using `Animated.event` with `useNativeDrive: true` if possible.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#attachnativeevent\n */\n attachNativeEvent: attachNativeEvent,\n\n /**\n * Advanced imperative API for snooping on animated events that are passed in\n * through props. Use values directly where possible.\n *\n * See http://facebook.github.io/react-native/docs/animated.html#forkevent\n */\n forkEvent: forkEvent,\n unforkEvent: unforkEvent,\n __PropsOnlyForTests: AnimatedProps\n};\nexport default AnimatedImplementation;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport createDOMProps from '../createDOMProps';\nimport findNodeHandle from '../../exports/findNodeHandle';\nimport styleResolver from '../../exports/StyleSheet/styleResolver';\nimport UIManager from '../../exports/UIManager';\nvar NativeMethodsMixin = {\n /**\n * Removes focus from an input or view. This is the opposite of `focus()`.\n */\n blur: function blur() {\n UIManager.blur(findNodeHandle(this));\n },\n\n /**\n * Requests focus for the given input or view.\n * The exact behavior triggered will depend the type of view.\n */\n focus: function focus() {\n UIManager.focus(findNodeHandle(this));\n },\n\n /**\n * Determines the position and dimensions of the view\n */\n measure: function measure(callback) {\n UIManager.measure(findNodeHandle(this), callback);\n },\n\n /**\n * Determines the location of the given view in the window and returns the\n * values via an async callback. If the React root view is embedded in\n * another native view, this will give you the absolute coordinates. If\n * successful, the callback will be called be called with the following\n * arguments:\n *\n * - x\n * - y\n * - width\n * - height\n *\n * Note that these measurements are not available until after the rendering\n * has been completed.\n */\n measureInWindow: function measureInWindow(callback) {\n UIManager.measureInWindow(findNodeHandle(this), callback);\n },\n\n /**\n * Measures the view relative to another view (usually an ancestor)\n */\n measureLayout: function measureLayout(relativeToNativeNode, onSuccess, onFail) {\n UIManager.measureLayout(findNodeHandle(this), relativeToNativeNode, onFail, onSuccess);\n },\n\n /**\n * This function sends props straight to the underlying DOM node.\n * This works as if all styles were set as inline styles. Since a DOM node\n * may aleady be styled with class names and inline styles, we need to get\n * the initial styles from the DOM node and merge them with incoming props.\n */\n setNativeProps: function setNativeProps(nativeProps) {\n if (!nativeProps) {\n return;\n }\n\n var node = findNodeHandle(this);\n\n if (node) {\n // Next state is determined by comparison to existing state (in the DOM).\n // Existing state has already gone through i18n transform\n var domProps = createDOMProps(null, nativeProps, function (style) {\n return styleResolver.resolveWithNode(style, node);\n });\n UIManager.updateView(node, domProps, this);\n }\n }\n};\nexport default NativeMethodsMixin;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport NativeMethodsMixin from '../NativeMethodsMixin';\n\nvar applyNativeMethods = function applyNativeMethods(Component) {\n Object.keys(NativeMethodsMixin).forEach(function (method) {\n if (!Component.prototype[method]) {\n Component.prototype[method] = NativeMethodsMixin[method];\n }\n });\n return Component;\n};\n\nexport default applyNativeMethods;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar assets = [];\nexport function registerAsset(asset) {\n // `push` returns new array length, so the first asset will\n // get id 1 (not 0) to make the value truthy\n return assets.push(asset);\n}\nexport function getAssetByID(assetId) {\n return assets[assetId - 1];\n}","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar id = 0;\nvar requests = {};\nvar ImageLoader = {\n abort: function abort(requestId) {\n var image = requests[\"\" + requestId];\n\n if (image) {\n image.onerror = image.onload = image = null;\n delete requests[\"\" + requestId];\n }\n },\n getSize: function getSize(uri, success, failure) {\n var complete = false;\n var interval = setInterval(callback, 16);\n var requestId = ImageLoader.load(uri, callback, errorCallback);\n\n function callback() {\n var image = requests[\"\" + requestId];\n\n if (image) {\n var naturalHeight = image.naturalHeight,\n naturalWidth = image.naturalWidth;\n\n if (naturalHeight && naturalWidth) {\n success(naturalWidth, naturalHeight);\n complete = true;\n }\n }\n\n if (complete) {\n ImageLoader.abort(requestId);\n clearInterval(interval);\n }\n }\n\n function errorCallback() {\n if (typeof failure === 'function') {\n failure();\n }\n\n ImageLoader.abort(requestId);\n clearInterval(interval);\n }\n },\n load: function load(uri, onLoad, onError) {\n id += 1;\n var image = new window.Image();\n image.onerror = onError;\n\n image.onload = function (e) {\n // avoid blocking the main thread\n var onDecode = function onDecode() {\n return onLoad(e);\n };\n\n if (typeof image.decode === 'function') {\n // Safari currently throws exceptions when decoding svgs.\n // We want to catch that error and allow the load handler\n // to be forwarded to the onLoad handler in this case\n image.decode().then(onDecode, onDecode);\n } else {\n setTimeout(onDecode, 0);\n }\n };\n\n image.src = uri;\n requests[\"\" + id] = image;\n return id;\n },\n prefetch: function prefetch(uri) {\n return new Promise(function (resolve, reject) {\n ImageLoader.load(uri, resolve, reject);\n });\n }\n};\nexport default ImageLoader;","var ImageResizeMode = {\n center: 'center',\n contain: 'contain',\n cover: 'cover',\n none: 'none',\n repeat: 'repeat',\n stretch: 'stretch'\n};\nexport default ImageResizeMode;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar dataUriPattern = /^data:/;\n\nvar ImageUriCache =\n/*#__PURE__*/\nfunction () {\n function ImageUriCache() {}\n\n ImageUriCache.has = function has(uri) {\n var entries = ImageUriCache._entries;\n var isDataUri = dataUriPattern.test(uri);\n return isDataUri || Boolean(entries[uri]);\n };\n\n ImageUriCache.add = function add(uri) {\n var entries = ImageUriCache._entries;\n var lastUsedTimestamp = Date.now();\n\n if (entries[uri]) {\n entries[uri].lastUsedTimestamp = lastUsedTimestamp;\n entries[uri].refCount += 1;\n } else {\n entries[uri] = {\n lastUsedTimestamp: lastUsedTimestamp,\n refCount: 1\n };\n }\n };\n\n ImageUriCache.remove = function remove(uri) {\n var entries = ImageUriCache._entries;\n\n if (entries[uri]) {\n entries[uri].refCount -= 1;\n } // Free up entries when the cache is \"full\"\n\n\n ImageUriCache._cleanUpIfNeeded();\n };\n\n ImageUriCache._cleanUpIfNeeded = function _cleanUpIfNeeded() {\n var entries = ImageUriCache._entries;\n var imageUris = Object.keys(entries);\n\n if (imageUris.length + 1 > ImageUriCache._maximumEntries) {\n var leastRecentlyUsedKey;\n var leastRecentlyUsedEntry;\n imageUris.forEach(function (uri) {\n var entry = entries[uri];\n\n if ((!leastRecentlyUsedEntry || entry.lastUsedTimestamp < leastRecentlyUsedEntry.lastUsedTimestamp) && entry.refCount === 0) {\n leastRecentlyUsedKey = uri;\n leastRecentlyUsedEntry = entry;\n }\n });\n\n if (leastRecentlyUsedKey) {\n delete entries[leastRecentlyUsedKey];\n }\n }\n };\n\n return ImageUriCache;\n}();\n\nImageUriCache._maximumEntries = 256;\nImageUriCache._entries = {};\nexport { ImageUriCache as default };","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport debounce from 'debounce';\nimport findNodeHandle from '../../exports/findNodeHandle';\nvar emptyObject = {};\nvar registry = {};\nvar id = 1;\n\nvar guid = function guid() {\n return \"r-\" + id++;\n};\n\nvar resizeObserver;\n\nif (canUseDOM) {\n if (typeof window.ResizeObserver !== 'undefined') {\n resizeObserver = new window.ResizeObserver(function (entries) {\n entries.forEach(function (_ref) {\n var target = _ref.target;\n var instance = registry[target._layoutId];\n instance && instance._handleLayout();\n });\n });\n } else {\n if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {\n console.warn('onLayout relies on ResizeObserver which is not supported by your browser. ' + 'Please include a polyfill, e.g., https://github.com/que-etc/resize-observer-polyfill. ' + 'Falling back to window.onresize.');\n }\n\n var triggerAll = function triggerAll() {\n Object.keys(registry).forEach(function (key) {\n var instance = registry[key];\n\n instance._handleLayout();\n });\n };\n\n window.addEventListener('resize', debounce(triggerAll, 16), false);\n }\n}\n\nvar observe = function observe(instance) {\n var id = guid();\n registry[id] = instance;\n\n if (resizeObserver) {\n var node = findNodeHandle(instance);\n\n if (node) {\n node._layoutId = id;\n resizeObserver.observe(node);\n }\n } else {\n instance._layoutId = id;\n\n instance._handleLayout();\n }\n};\n\nvar unobserve = function unobserve(instance) {\n if (resizeObserver) {\n var node = findNodeHandle(instance);\n\n if (node) {\n delete registry[node._layoutId];\n delete node._layoutId;\n resizeObserver.unobserve(node);\n }\n } else {\n delete registry[instance._layoutId];\n delete instance._layoutId;\n }\n};\n\nvar safeOverride = function safeOverride(original, next) {\n if (original) {\n return function prototypeOverride() {\n /* eslint-disable prefer-rest-params */\n original.call(this, arguments);\n next.call(this, arguments);\n /* eslint-enable prefer-rest-params */\n };\n }\n\n return next;\n};\n\nvar applyLayout = function applyLayout(Component) {\n var componentDidMount = Component.prototype.componentDidMount;\n var componentDidUpdate = Component.prototype.componentDidUpdate;\n var componentWillUnmount = Component.prototype.componentWillUnmount;\n Component.prototype.componentDidMount = safeOverride(componentDidMount, function componentDidMount() {\n this._layoutState = emptyObject;\n this._isMounted = true;\n\n if (this.props.onLayout) {\n observe(this);\n }\n });\n Component.prototype.componentDidUpdate = safeOverride(componentDidUpdate, function componentDidUpdate(prevProps) {\n if (this.props.onLayout && !prevProps.onLayout) {\n observe(this);\n } else if (!this.props.onLayout && prevProps.onLayout) {\n unobserve(this);\n }\n });\n Component.prototype.componentWillUnmount = safeOverride(componentWillUnmount, function componentWillUnmount() {\n this._isMounted = false;\n\n if (this.props.onLayout) {\n unobserve(this);\n }\n });\n\n Component.prototype._handleLayout = function () {\n var _this = this;\n\n var layout = this._layoutState;\n var onLayout = this.props.onLayout;\n\n if (onLayout) {\n this.measure(function (x, y, width, height) {\n if (_this._isMounted) {\n if (layout.x !== x || layout.y !== y || layout.width !== width || layout.height !== height) {\n _this._layoutState = {\n x: x,\n y: y,\n width: width,\n height: height\n };\n var nativeEvent = {\n layout: _this._layoutState\n };\n Object.defineProperty(nativeEvent, 'target', {\n enumerable: true,\n get: function get() {\n return findNodeHandle(_this);\n }\n });\n onLayout({\n nativeEvent: nativeEvent,\n timeStamp: Date.now()\n });\n }\n }\n });\n }\n };\n\n return Component;\n};\n\nexport default applyLayout;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar supportedProps = {\n accessibilityComponentType: true,\n accessibilityLabel: true,\n accessibilityLiveRegion: true,\n accessibilityRole: true,\n accessibilityStates: true,\n accessibilityTraits: true,\n accessible: true,\n children: true,\n disabled: true,\n importantForAccessibility: true,\n nativeID: true,\n onBlur: true,\n onContextMenu: true,\n onFocus: true,\n onMoveShouldSetResponder: true,\n onMoveShouldSetResponderCapture: true,\n onResponderEnd: true,\n onResponderGrant: true,\n onResponderMove: true,\n onResponderReject: true,\n onResponderRelease: true,\n onResponderStart: true,\n onResponderTerminate: true,\n onResponderTerminationRequest: true,\n onScrollShouldSetResponder: true,\n onScrollShouldSetResponderCapture: true,\n onSelectionChangeShouldSetResponder: true,\n onSelectionChangeShouldSetResponderCapture: true,\n onStartShouldSetResponder: true,\n onStartShouldSetResponderCapture: true,\n onTouchCancel: true,\n onTouchCancelCapture: true,\n onTouchEnd: true,\n onTouchEndCapture: true,\n onTouchMove: true,\n onTouchMoveCapture: true,\n onTouchStart: true,\n onTouchStartCapture: true,\n pointerEvents: true,\n style: true,\n testID: true,\n\n /* @platform web */\n onScroll: true,\n onWheel: true,\n // keyboard events\n onKeyDown: true,\n onKeyPress: true,\n onKeyUp: true,\n // mouse events (e.g, hover effects)\n onMouseDown: true,\n onMouseEnter: true,\n onMouseLeave: true,\n onMouseMove: true,\n onMouseOver: true,\n onMouseOut: true,\n onMouseUp: true,\n // unstable escape-hatches for web\n className: true,\n href: true,\n itemID: true,\n itemRef: true,\n itemProp: true,\n itemScope: true,\n itemType: true,\n onClick: true,\n onClickCapture: true,\n rel: true,\n target: true\n};\n\nvar filterSupportedProps = function filterSupportedProps(props) {\n var safeProps = {};\n\n for (var prop in props) {\n if (props.hasOwnProperty(prop)) {\n if (supportedProps[prop] || prop.indexOf('aria-') === 0 || prop.indexOf('data-') === 0) {\n safeProps[prop] = props[prop];\n }\n }\n }\n\n return safeProps;\n};\n\nexport default filterSupportedProps;","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyLayout from '../../modules/applyLayout';\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport { bool } from 'prop-types';\nimport createElement from '../createElement';\nimport css from '../StyleSheet/css';\nimport filterSupportedProps from './filterSupportedProps';\nimport invariant from 'fbjs/lib/invariant';\nimport warning from 'fbjs/lib/warning';\nimport StyleSheet from '../StyleSheet';\nimport ViewPropTypes from './ViewPropTypes';\nimport React, { Component } from 'react';\n\nvar calculateHitSlopStyle = function calculateHitSlopStyle(hitSlop) {\n var hitStyle = {};\n\n for (var prop in hitSlop) {\n if (hitSlop.hasOwnProperty(prop)) {\n var value = hitSlop[prop];\n hitStyle[prop] = value > 0 ? -1 * value : 0;\n }\n }\n\n return hitStyle;\n};\n\nvar View =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(View, _Component);\n\n function View() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = View.prototype;\n\n _proto.render = function render() {\n var hitSlop = this.props.hitSlop;\n var supportedProps = filterSupportedProps(this.props);\n\n if (process.env.NODE_ENV !== 'production') {\n warning(this.props.className == null, 'Using the \"className\" prop on
is deprecated.');\n React.Children.toArray(this.props.children).forEach(function (item) {\n invariant(typeof item !== 'string', \"Unexpected text node: \" + item + \". A text node cannot be a child of a .\");\n });\n }\n\n var isInAParentText = this.context.isInAParentText;\n supportedProps.classList = [this.props.className, classes.view];\n supportedProps.style = StyleSheet.compose(isInAParentText && styles.inline, this.props.style);\n\n if (hitSlop) {\n var hitSlopStyle = calculateHitSlopStyle(hitSlop);\n var hitSlopChild = createElement('span', {\n classList: [classes.hitSlop],\n style: hitSlopStyle\n });\n supportedProps.children = React.Children.toArray([hitSlopChild, supportedProps.children]);\n }\n\n return createElement('div', supportedProps);\n };\n\n return View;\n}(Component);\n\nView.displayName = 'View';\nView.contextTypes = {\n isInAParentText: bool\n};\nView.propTypes = process.env.NODE_ENV !== \"production\" ? ViewPropTypes : {};\nvar classes = css.create({\n view: {\n alignItems: 'stretch',\n border: '0 solid black',\n boxSizing: 'border-box',\n display: 'flex',\n flexBasis: 'auto',\n flexDirection: 'column',\n flexShrink: 0,\n margin: 0,\n minHeight: 0,\n minWidth: 0,\n padding: 0,\n position: 'relative',\n zIndex: 0\n },\n // this zIndex-ordering positions the hitSlop above the View but behind\n // its children\n hitSlop: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: -1\n }\n});\nvar styles = StyleSheet.create({\n inline: {\n display: 'inline-flex'\n }\n});\nexport default applyLayout(applyNativeMethods(View));","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport createElement from '../createElement';\nimport css from '../StyleSheet/css';\nimport { getAssetByID } from '../../modules/AssetRegistry';\nimport resolveShadowValue from '../StyleSheet/resolveShadowValue';\nimport ImageLoader from '../../modules/ImageLoader';\nimport ImageResizeMode from './ImageResizeMode';\nimport ImageSourcePropType from './ImageSourcePropType';\nimport ImageStylePropTypes from './ImageStylePropTypes';\nimport ImageUriCache from './ImageUriCache';\nimport StyleSheet from '../StyleSheet';\nimport StyleSheetPropType from '../../modules/StyleSheetPropType';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport { bool, func, number, oneOf, shape } from 'prop-types';\nimport React, { Component } from 'react';\nvar emptyObject = {};\nvar STATUS_ERRORED = 'ERRORED';\nvar STATUS_LOADED = 'LOADED';\nvar STATUS_LOADING = 'LOADING';\nvar STATUS_PENDING = 'PENDING';\nvar STATUS_IDLE = 'IDLE';\n\nvar getImageState = function getImageState(uri, shouldDisplaySource) {\n return shouldDisplaySource ? STATUS_LOADED : uri ? STATUS_PENDING : STATUS_IDLE;\n};\n\nvar resolveAssetDimensions = function resolveAssetDimensions(source) {\n if (typeof source === 'number') {\n var _getAssetByID = getAssetByID(source),\n height = _getAssetByID.height,\n width = _getAssetByID.width;\n\n return {\n height: height,\n width: width\n };\n } else if (typeof source === 'object') {\n var _height = source.height,\n _width = source.width;\n return {\n height: _height,\n width: _width\n };\n }\n};\n\nvar svgDataUriPattern = /^(data:image\\/svg\\+xml;utf8,)(.*)/;\n\nvar resolveAssetUri = function resolveAssetUri(source) {\n var uri = '';\n\n if (typeof source === 'number') {\n // get the URI from the packager\n var asset = getAssetByID(source);\n var scale = asset.scales[0];\n var scaleSuffix = scale !== 1 ? \"@\" + scale + \"x\" : '';\n uri = asset ? asset.httpServerLocation + \"/\" + asset.name + scaleSuffix + \".\" + asset.type : '';\n } else if (typeof source === 'string') {\n uri = source;\n } else if (source && typeof source.uri === 'string') {\n uri = source.uri;\n }\n\n if (uri) {\n var match = uri.match(svgDataUriPattern); // inline SVG markup may contain characters (e.g., #, \") that need to be escaped\n\n if (match) {\n var prefix = match[1],\n svg = match[2];\n var encodedSvg = encodeURIComponent(svg);\n return \"\" + prefix + encodedSvg;\n }\n }\n\n return uri;\n};\n\nvar filterId = 0;\n\nvar createTintColorSVG = function createTintColorSVG(tintColor, id) {\n return tintColor && id != null ? React.createElement(\"svg\", {\n style: {\n position: 'absolute',\n height: 0,\n visibility: 'hidden',\n width: 0\n }\n }, React.createElement(\"defs\", null, React.createElement(\"filter\", {\n id: \"tint-\" + id\n }, React.createElement(\"feFlood\", {\n floodColor: \"\" + tintColor\n }), React.createElement(\"feComposite\", {\n in2: \"SourceAlpha\",\n operator: \"atop\"\n })))) : null;\n};\n\nvar Image =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Image, _Component);\n\n Image.getSize = function getSize(uri, success, failure) {\n ImageLoader.getSize(uri, success, failure);\n };\n\n Image.prefetch = function prefetch(uri) {\n return ImageLoader.prefetch(uri).then(function () {\n // Add the uri to the cache so it can be immediately displayed when used\n // but also immediately remove it to correctly reflect that it has no active references\n ImageUriCache.add(uri);\n ImageUriCache.remove(uri);\n });\n };\n\n Image.queryCache = function queryCache(uris) {\n var result = {};\n uris.forEach(function (u) {\n if (ImageUriCache.has(u)) {\n result[u] = 'disk/memory';\n }\n });\n return Promise.resolve(result);\n };\n\n function Image(props, context) {\n var _this;\n\n _this = _Component.call(this, props, context) || this; // If an image has been loaded before, render it immediately\n\n _this._filterId = 0;\n _this._imageRef = null;\n _this._imageRequestId = null;\n _this._imageState = null;\n _this._isMounted = false;\n\n _this._createLayoutHandler = function (resizeMode) {\n var onLayout = _this.props.onLayout;\n\n if (resizeMode === 'center' || resizeMode === 'repeat' || onLayout) {\n return function (e) {\n var layout = e.nativeEvent.layout;\n onLayout && onLayout(e);\n\n _this.setState(function () {\n return {\n layout: layout\n };\n });\n };\n }\n };\n\n _this._getBackgroundSize = function (resizeMode) {\n if (_this._imageRef && (resizeMode === 'center' || resizeMode === 'repeat')) {\n var _this$_imageRef = _this._imageRef,\n naturalHeight = _this$_imageRef.naturalHeight,\n naturalWidth = _this$_imageRef.naturalWidth;\n var _this$state$layout = _this.state.layout,\n height = _this$state$layout.height,\n width = _this$state$layout.width;\n\n if (naturalHeight && naturalWidth && height && width) {\n var scaleFactor = Math.min(1, width / naturalWidth, height / naturalHeight);\n var x = Math.ceil(scaleFactor * naturalWidth);\n var y = Math.ceil(scaleFactor * naturalHeight);\n return {\n backgroundSize: x + \"px \" + y + \"px\"\n };\n }\n }\n };\n\n _this._onError = function () {\n var _this$props = _this.props,\n onError = _this$props.onError,\n source = _this$props.source;\n\n _this._updateImageState(STATUS_ERRORED);\n\n if (onError) {\n onError({\n nativeEvent: {\n error: \"Failed to load resource \" + resolveAssetUri(source) + \" (404)\"\n }\n });\n }\n\n _this._onLoadEnd();\n };\n\n _this._onLoad = function (e) {\n var _this$props2 = _this.props,\n onLoad = _this$props2.onLoad,\n source = _this$props2.source;\n var event = {\n nativeEvent: e\n };\n ImageUriCache.add(resolveAssetUri(source));\n\n _this._updateImageState(STATUS_LOADED);\n\n if (onLoad) {\n onLoad(event);\n }\n\n _this._onLoadEnd();\n };\n\n _this._setImageRef = function (ref) {\n _this._imageRef = ref;\n };\n\n var uri = resolveAssetUri(props.source);\n var shouldDisplaySource = ImageUriCache.has(uri);\n _this.state = {\n layout: {},\n shouldDisplaySource: shouldDisplaySource\n };\n _this._imageState = getImageState(uri, shouldDisplaySource);\n _this._filterId = filterId;\n filterId++;\n return _this;\n }\n\n var _proto = Image.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n\n if (this._imageState === STATUS_PENDING) {\n this._createImageLoader();\n } else if (this._imageState === STATUS_LOADED) {\n this._onLoad({\n target: this._imageRef\n });\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var prevUri = resolveAssetUri(prevProps.source);\n var uri = resolveAssetUri(this.props.source);\n var hasDefaultSource = this.props.defaultSource != null;\n\n if (prevUri !== uri) {\n ImageUriCache.remove(prevUri);\n var isPreviouslyLoaded = ImageUriCache.has(uri);\n isPreviouslyLoaded && ImageUriCache.add(uri);\n\n this._updateImageState(getImageState(uri, isPreviouslyLoaded), hasDefaultSource);\n } else if (hasDefaultSource && prevProps.defaultSource !== this.props.defaultSource) {\n this._updateImageState(this._imageState, hasDefaultSource);\n }\n\n if (this._imageState === STATUS_PENDING) {\n this._createImageLoader();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n var uri = resolveAssetUri(this.props.source);\n ImageUriCache.remove(uri);\n\n this._destroyImageLoader();\n\n this._isMounted = false;\n };\n\n _proto.render = function render() {\n var shouldDisplaySource = this.state.shouldDisplaySource;\n\n var _this$props3 = this.props,\n accessibilityLabel = _this$props3.accessibilityLabel,\n accessible = _this$props3.accessible,\n blurRadius = _this$props3.blurRadius,\n defaultSource = _this$props3.defaultSource,\n draggable = _this$props3.draggable,\n source = _this$props3.source,\n testID = _this$props3.testID,\n capInsets = _this$props3.capInsets,\n onError = _this$props3.onError,\n onLayout = _this$props3.onLayout,\n onLoad = _this$props3.onLoad,\n onLoadEnd = _this$props3.onLoadEnd,\n onLoadStart = _this$props3.onLoadStart,\n resizeMethod = _this$props3.resizeMethod,\n resizeMode = _this$props3.resizeMode,\n other = _objectWithoutPropertiesLoose(_this$props3, [\"accessibilityLabel\", \"accessible\", \"blurRadius\", \"defaultSource\", \"draggable\", \"source\", \"testID\", \"capInsets\", \"onError\", \"onLayout\", \"onLoad\", \"onLoadEnd\", \"onLoadStart\", \"resizeMethod\", \"resizeMode\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (this.props.src) {\n console.warn('The component requires a `source` property rather than `src`.');\n }\n\n if (this.props.children) {\n throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using the component or absolute positioning.');\n }\n }\n\n var selectedSource = shouldDisplaySource ? source : defaultSource;\n var displayImageUri = resolveAssetUri(selectedSource);\n var imageSizeStyle = resolveAssetDimensions(selectedSource);\n var backgroundImage = displayImageUri ? \"url(\\\"\" + displayImageUri + \"\\\")\" : null;\n\n var flatStyle = _objectSpread({}, StyleSheet.flatten(this.props.style));\n\n var finalResizeMode = resizeMode || flatStyle.resizeMode || ImageResizeMode.cover; // CSS filters\n\n var filters = [];\n var tintColor = flatStyle.tintColor;\n\n if (flatStyle.filter) {\n filters.push(flatStyle.filter);\n }\n\n if (blurRadius) {\n filters.push(\"blur(\" + blurRadius + \"px)\");\n }\n\n if (flatStyle.shadowOffset) {\n var shadowString = resolveShadowValue(flatStyle);\n\n if (shadowString) {\n filters.push(\"drop-shadow(\" + shadowString + \")\");\n }\n }\n\n if (flatStyle.tintColor) {\n filters.push(\"url(#tint-\" + this._filterId + \")\");\n } // these styles were converted to filters\n\n\n delete flatStyle.shadowColor;\n delete flatStyle.shadowOpacity;\n delete flatStyle.shadowOffset;\n delete flatStyle.shadowRadius;\n delete flatStyle.tintColor; // these styles are not supported on View\n\n delete flatStyle.overlayColor;\n delete flatStyle.resizeMode; // Accessibility image allows users to trigger the browser's image context menu\n\n var hiddenImage = displayImageUri ? createElement('img', {\n alt: accessibilityLabel || '',\n classList: [classes.accessibilityImage],\n draggable: draggable || false,\n ref: this._setImageRef,\n src: displayImageUri\n }) : null;\n return React.createElement(View, _extends({}, other, {\n accessibilityLabel: accessibilityLabel,\n accessible: accessible,\n onLayout: this._createLayoutHandler(finalResizeMode),\n style: [styles.root, this.context.isInAParentText && styles.inline, imageSizeStyle, flatStyle],\n testID: testID\n }), React.createElement(View, {\n style: [styles.image, resizeModeStyles[finalResizeMode], this._getBackgroundSize(finalResizeMode), backgroundImage && {\n backgroundImage: backgroundImage\n }, filters.length > 0 && {\n filter: filters.join(' ')\n }]\n }), hiddenImage, createTintColorSVG(tintColor, this._filterId));\n };\n\n _proto._createImageLoader = function _createImageLoader() {\n var source = this.props.source;\n\n this._destroyImageLoader();\n\n var uri = resolveAssetUri(source);\n this._imageRequestId = ImageLoader.load(uri, this._onLoad, this._onError);\n\n this._onLoadStart();\n };\n\n _proto._destroyImageLoader = function _destroyImageLoader() {\n if (this._imageRequestId) {\n ImageLoader.abort(this._imageRequestId);\n this._imageRequestId = null;\n }\n };\n\n _proto._onLoadEnd = function _onLoadEnd() {\n var onLoadEnd = this.props.onLoadEnd;\n\n if (onLoadEnd) {\n onLoadEnd();\n }\n };\n\n _proto._onLoadStart = function _onLoadStart() {\n var _this$props4 = this.props,\n defaultSource = _this$props4.defaultSource,\n onLoadStart = _this$props4.onLoadStart;\n\n this._updateImageState(STATUS_LOADING, defaultSource != null);\n\n if (onLoadStart) {\n onLoadStart();\n }\n };\n\n _proto._updateImageState = function _updateImageState(status, hasDefaultSource) {\n if (hasDefaultSource === void 0) {\n hasDefaultSource = false;\n }\n\n this._imageState = status;\n var shouldDisplaySource = this._imageState === STATUS_LOADED || this._imageState === STATUS_LOADING && !hasDefaultSource; // only triggers a re-render when the image is loading and has no default image (to support PJPEG), loaded, or failed\n\n if (shouldDisplaySource !== this.state.shouldDisplaySource) {\n if (this._isMounted) {\n this.setState(function () {\n return {\n shouldDisplaySource: shouldDisplaySource\n };\n });\n }\n }\n };\n\n return Image;\n}(Component);\n\nImage.displayName = 'Image';\nImage.contextTypes = {\n isInAParentText: bool\n};\nImage.defaultProps = {\n style: emptyObject\n};\nImage.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n blurRadius: number,\n defaultSource: ImageSourcePropType,\n draggable: bool,\n onError: func,\n onLayout: func,\n onLoad: func,\n onLoadEnd: func,\n onLoadStart: func,\n resizeMode: oneOf(Object.keys(ImageResizeMode)),\n source: ImageSourcePropType,\n style: StyleSheetPropType(ImageStylePropTypes),\n // compatibility with React Native\n\n /* eslint-disable react/sort-prop-types */\n capInsets: shape({\n top: number,\n left: number,\n bottom: number,\n right: number\n }),\n resizeMethod: oneOf(['auto', 'resize', 'scale'])\n /* eslint-enable react/sort-prop-types */\n\n}) : {};\nvar classes = css.create({\n accessibilityImage: _objectSpread({}, StyleSheet.absoluteFillObject, {\n height: '100%',\n opacity: 0,\n width: '100%',\n zIndex: -1\n })\n});\nvar styles = StyleSheet.create({\n root: {\n flexBasis: 'auto',\n overflow: 'hidden',\n zIndex: 0\n },\n inline: {\n display: 'inline-flex'\n },\n image: _objectSpread({}, StyleSheet.absoluteFillObject, {\n backgroundColor: 'transparent',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'cover',\n height: '100%',\n width: '100%',\n zIndex: -1\n })\n});\nvar resizeModeStyles = StyleSheet.create({\n center: {\n backgroundSize: 'auto'\n },\n contain: {\n backgroundSize: 'contain'\n },\n cover: {\n backgroundSize: 'cover'\n },\n none: {\n backgroundPosition: '0 0',\n backgroundSize: 'auto'\n },\n repeat: {\n backgroundPosition: '0 0',\n backgroundRepeat: 'repeat',\n backgroundSize: 'auto'\n },\n stretch: {\n backgroundSize: '100% 100%'\n }\n});\nexport default applyNativeMethods(Image);","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport UIManager from '../../exports/UIManager';\n/**\n * This class is responsible for coordinating the \"focused\"\n * state for TextInputs. All calls relating to the keyboard\n * should be funneled through here\n */\n\nvar TextInputState = {\n /**\n * Internal state\n */\n _currentlyFocusedNode: null,\n\n /**\n * Returns the ID of the currently focused text field, if one exists\n * If no text field is focused it returns null\n */\n currentlyFocusedField: function currentlyFocusedField() {\n if (document.activeElement !== this._currentlyFocusedNode) {\n this._currentlyFocusedNode = null;\n }\n\n return this._currentlyFocusedNode;\n },\n\n /**\n * @param {Object} TextInputID id of the text field to focus\n * Focuses the specified text field\n * noop if the text field was already focused\n */\n focusTextInput: function focusTextInput(textFieldNode) {\n if (textFieldNode !== null) {\n this._currentlyFocusedNode = textFieldNode;\n\n if (document.activeElement !== textFieldNode) {\n UIManager.focus(textFieldNode);\n }\n }\n },\n\n /**\n * @param {Object} textFieldNode id of the text field to focus\n * Unfocuses the specified text field\n * noop if it wasn't focused\n */\n blurTextInput: function blurTextInput(textFieldNode) {\n if (textFieldNode !== null) {\n this._currentlyFocusedNode = null;\n\n if (document.activeElement === textFieldNode) {\n UIManager.blur(textFieldNode);\n }\n }\n }\n};\nexport default TextInputState;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport TextInputState from '../TextInputState';\n\nvar dismissKeyboard = function dismissKeyboard() {\n TextInputState.blurTextInput(TextInputState.currentlyFocusedField());\n};\n\nexport default dismissKeyboard;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport debounce from 'debounce';\nimport invariant from 'fbjs/lib/invariant';\nvar win = canUseDOM ? window : {\n devicePixelRatio: undefined,\n innerHeight: undefined,\n innerWidth: undefined,\n screen: {\n height: undefined,\n width: undefined\n }\n};\nvar dimensions = {};\nvar listeners = {};\n\nvar Dimensions =\n/*#__PURE__*/\nfunction () {\n function Dimensions() {}\n\n Dimensions.get = function get(dimension) {\n invariant(dimensions[dimension], \"No dimension set for key \" + dimension);\n return dimensions[dimension];\n };\n\n Dimensions.set = function set(initialDimensions) {\n if (initialDimensions) {\n if (canUseDOM) {\n invariant(false, 'Dimensions cannot be set in the browser');\n } else {\n dimensions.screen = initialDimensions.screen;\n dimensions.window = initialDimensions.window;\n }\n }\n };\n\n Dimensions._update = function _update() {\n dimensions.window = {\n fontScale: 1,\n height: win.innerHeight,\n scale: win.devicePixelRatio || 1,\n width: win.innerWidth\n };\n dimensions.screen = {\n fontScale: 1,\n height: win.screen.height,\n scale: win.devicePixelRatio || 1,\n width: win.screen.width\n };\n\n if (Array.isArray(listeners['change'])) {\n listeners['change'].forEach(function (handler) {\n return handler(dimensions);\n });\n }\n };\n\n Dimensions.addEventListener = function addEventListener(type, handler) {\n listeners[type] = listeners[type] || [];\n listeners[type].push(handler);\n };\n\n Dimensions.removeEventListener = function removeEventListener(type, handler) {\n if (Array.isArray(listeners[type])) {\n listeners[type] = listeners[type].filter(function (_handler) {\n return _handler !== handler;\n });\n }\n };\n\n return Dimensions;\n}();\n\nexport { Dimensions as default };\n\nDimensions._update();\n\nif (canUseDOM) {\n window.addEventListener('resize', debounce(Dimensions._update, 16), false);\n}","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar Platform = {\n OS: 'web',\n select: function select(obj) {\n return 'web' in obj ? obj.web : obj.default;\n }\n};\nexport default Platform;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport Dimensions from '../../exports/Dimensions';\nimport findNodeHandle from '../../exports/findNodeHandle';\nimport invariant from 'fbjs/lib/invariant';\nimport Platform from '../../exports/Platform';\nimport TextInputState from '../TextInputState';\nimport UIManager from '../../exports/UIManager';\nimport warning from 'fbjs/lib/warning';\n/**\n * Mixin that can be integrated in order to handle scrolling that plays well\n * with `ResponderEventPlugin`. Integrate with your platform specific scroll\n * views, or even your custom built (every-frame animating) scroll views so that\n * all of these systems play well with the `ResponderEventPlugin`.\n *\n * iOS scroll event timing nuances:\n * ===============================\n *\n *\n * Scrolling without bouncing, if you touch down:\n * -------------------------------\n *\n * 1. `onMomentumScrollBegin` (when animation begins after letting up)\n * ... physical touch starts ...\n * 2. `onTouchStartCapture` (when you press down to stop the scroll)\n * 3. `onTouchStart` (same, but bubble phase)\n * 4. `onResponderRelease` (when lifting up - you could pause forever before * lifting)\n * 5. `onMomentumScrollEnd`\n *\n *\n * Scrolling with bouncing, if you touch down:\n * -------------------------------\n *\n * 1. `onMomentumScrollBegin` (when animation begins after letting up)\n * ... bounce begins ...\n * ... some time elapses ...\n * ... physical touch during bounce ...\n * 2. `onMomentumScrollEnd` (Makes no sense why this occurs first during bounce)\n * 3. `onTouchStartCapture` (immediately after `onMomentumScrollEnd`)\n * 4. `onTouchStart` (same, but bubble phase)\n * 5. `onTouchEnd` (You could hold the touch start for a long time)\n * 6. `onMomentumScrollBegin` (When releasing the view starts bouncing back)\n *\n * So when we receive an `onTouchStart`, how can we tell if we are touching\n * *during* an animation (which then causes the animation to stop)? The only way\n * to tell is if the `touchStart` occurred immediately after the\n * `onMomentumScrollEnd`.\n *\n * This is abstracted out for you, so you can just call this.scrollResponderIsAnimating() if\n * necessary\n *\n * `ScrollResponder` also includes logic for blurring a currently focused input\n * if one is focused while scrolling. The `ScrollResponder` is a natural place\n * to put this logic since it can support not dismissing the keyboard while\n * scrolling, unless a recognized \"tap\"-like gesture has occurred.\n *\n * The public lifecycle API includes events for keyboard interaction, responder\n * interaction, and scrolling (among others). The keyboard callbacks\n * `onKeyboardWill/Did/*` are *global* events, but are invoked on scroll\n * responder's props so that you can guarantee that the scroll responder's\n * internal state has been updated accordingly (and deterministically) by\n * the time the props callbacks are invoke. Otherwise, you would always wonder\n * if the scroll responder is currently in a state where it recognizes new\n * keyboard positions etc. If coordinating scrolling with keyboard movement,\n * *always* use these hooks instead of listening to your own global keyboard\n * events.\n *\n * Public keyboard lifecycle API: (props callbacks)\n *\n * Standard Keyboard Appearance Sequence:\n *\n * this.props.onKeyboardWillShow\n * this.props.onKeyboardDidShow\n *\n * `onScrollResponderKeyboardDismissed` will be invoked if an appropriate\n * tap inside the scroll responder's scrollable region was responsible\n * for the dismissal of the keyboard. There are other reasons why the\n * keyboard could be dismissed.\n *\n * this.props.onScrollResponderKeyboardDismissed\n *\n * Standard Keyboard Hide Sequence:\n *\n * this.props.onKeyboardWillHide\n * this.props.onKeyboardDidHide\n */\n\nvar emptyObject = {};\nvar IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;\nvar ScrollResponderMixin = {\n // mixins: [Subscribable.Mixin],\n scrollResponderMixinGetInitialState: function scrollResponderMixinGetInitialState() {\n return {\n isTouching: false,\n lastMomentumScrollBeginTime: 0,\n lastMomentumScrollEndTime: 0,\n // Reset to false every time becomes responder. This is used to:\n // - Determine if the scroll view has been scrolled and therefore should\n // refuse to give up its responder lock.\n // - Determine if releasing should dismiss the keyboard when we are in\n // tap-to-dismiss mode (!this.props.keyboardShouldPersistTaps).\n observedScrollSinceBecomingResponder: false,\n becameResponderWhileAnimating: false\n };\n },\n\n /**\n * Invoke this from an `onScroll` event.\n */\n scrollResponderHandleScrollShouldSetResponder: function scrollResponderHandleScrollShouldSetResponder() {\n return this.state.isTouching;\n },\n\n /**\n * Merely touch starting is not sufficient for a scroll view to become the\n * responder. Being the \"responder\" means that the very next touch move/end\n * event will result in an action/movement.\n *\n * Invoke this from an `onStartShouldSetResponder` event.\n *\n * `onStartShouldSetResponder` is used when the next move/end will trigger\n * some UI movement/action, but when you want to yield priority to views\n * nested inside of the view.\n *\n * There may be some cases where scroll views actually should return `true`\n * from `onStartShouldSetResponder`: Any time we are detecting a standard tap\n * that gives priority to nested views.\n *\n * - If a single tap on the scroll view triggers an action such as\n * recentering a map style view yet wants to give priority to interaction\n * views inside (such as dropped pins or labels), then we would return true\n * from this method when there is a single touch.\n *\n * - Similar to the previous case, if a two finger \"tap\" should trigger a\n * zoom, we would check the `touches` count, and if `>= 2`, we would return\n * true.\n *\n */\n scrollResponderHandleStartShouldSetResponder: function scrollResponderHandleStartShouldSetResponder() {\n return false;\n },\n\n /**\n * There are times when the scroll view wants to become the responder\n * (meaning respond to the next immediate `touchStart/touchEnd`), in a way\n * that *doesn't* give priority to nested views (hence the capture phase):\n *\n * - Currently animating.\n * - Tapping anywhere that is not the focused input, while the keyboard is\n * up (which should dismiss the keyboard).\n *\n * Invoke this from an `onStartShouldSetResponderCapture` event.\n */\n scrollResponderHandleStartShouldSetResponderCapture: function scrollResponderHandleStartShouldSetResponderCapture(e) {\n // First see if we want to eat taps while the keyboard is up\n // var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();\n // if (!this.props.keyboardShouldPersistTaps &&\n // currentlyFocusedTextInput != null &&\n // e.target !== currentlyFocusedTextInput) {\n // return true;\n // }\n return this.scrollResponderIsAnimating();\n },\n\n /**\n * Invoke this from an `onResponderReject` event.\n *\n * Some other element is not yielding its role as responder. Normally, we'd\n * just disable the `UIScrollView`, but a touch has already began on it, the\n * `UIScrollView` will not accept being disabled after that. The easiest\n * solution for now is to accept the limitation of disallowing this\n * altogether. To improve this, find a way to disable the `UIScrollView` after\n * a touch has already started.\n */\n scrollResponderHandleResponderReject: function scrollResponderHandleResponderReject() {\n warning(false, \"ScrollView doesn't take rejection well - scrolls anyway\");\n },\n\n /**\n * We will allow the scroll view to give up its lock iff it acquired the lock\n * during an animation. This is a very useful default that happens to satisfy\n * many common user experiences.\n *\n * - Stop a scroll on the left edge, then turn that into an outer view's\n * backswipe.\n * - Stop a scroll mid-bounce at the top, continue pulling to have the outer\n * view dismiss.\n * - However, without catching the scroll view mid-bounce (while it is\n * motionless), if you drag far enough for the scroll view to become\n * responder (and therefore drag the scroll view a bit), any backswipe\n * navigation of a swipe gesture higher in the view hierarchy, should be\n * rejected.\n */\n scrollResponderHandleTerminationRequest: function scrollResponderHandleTerminationRequest() {\n return !this.state.observedScrollSinceBecomingResponder;\n },\n\n /**\n * Invoke this from an `onTouchEnd` event.\n *\n * @param {SyntheticEvent} e Event.\n */\n scrollResponderHandleTouchEnd: function scrollResponderHandleTouchEnd(e) {\n var nativeEvent = e.nativeEvent;\n this.state.isTouching = nativeEvent.touches.length !== 0;\n this.props.onTouchEnd && this.props.onTouchEnd(e);\n },\n\n /**\n * Invoke this from an `onResponderRelease` event.\n */\n scrollResponderHandleResponderRelease: function scrollResponderHandleResponderRelease(e) {\n this.props.onResponderRelease && this.props.onResponderRelease(e); // By default scroll views will unfocus a textField\n // if another touch occurs outside of it\n\n var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();\n\n if (!this.props.keyboardShouldPersistTaps && currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput && !this.state.observedScrollSinceBecomingResponder && !this.state.becameResponderWhileAnimating) {\n this.props.onScrollResponderKeyboardDismissed && this.props.onScrollResponderKeyboardDismissed(e);\n TextInputState.blurTextInput(currentlyFocusedTextInput);\n }\n },\n scrollResponderHandleScroll: function scrollResponderHandleScroll(e) {\n this.state.observedScrollSinceBecomingResponder = true;\n this.props.onScroll && this.props.onScroll(e);\n },\n\n /**\n * Invoke this from an `onResponderGrant` event.\n */\n scrollResponderHandleResponderGrant: function scrollResponderHandleResponderGrant(e) {\n this.state.observedScrollSinceBecomingResponder = false;\n this.props.onResponderGrant && this.props.onResponderGrant(e);\n this.state.becameResponderWhileAnimating = this.scrollResponderIsAnimating();\n },\n\n /**\n * Unfortunately, `onScrollBeginDrag` also fires when *stopping* the scroll\n * animation, and there's not an easy way to distinguish a drag vs. stopping\n * momentum.\n *\n * Invoke this from an `onScrollBeginDrag` event.\n */\n scrollResponderHandleScrollBeginDrag: function scrollResponderHandleScrollBeginDrag(e) {\n this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);\n },\n\n /**\n * Invoke this from an `onScrollEndDrag` event.\n */\n scrollResponderHandleScrollEndDrag: function scrollResponderHandleScrollEndDrag(e) {\n this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);\n },\n\n /**\n * Invoke this from an `onMomentumScrollBegin` event.\n */\n scrollResponderHandleMomentumScrollBegin: function scrollResponderHandleMomentumScrollBegin(e) {\n this.state.lastMomentumScrollBeginTime = Date.now();\n this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);\n },\n\n /**\n * Invoke this from an `onMomentumScrollEnd` event.\n */\n scrollResponderHandleMomentumScrollEnd: function scrollResponderHandleMomentumScrollEnd(e) {\n this.state.lastMomentumScrollEndTime = Date.now();\n this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);\n },\n\n /**\n * Invoke this from an `onTouchStart` event.\n *\n * Since we know that the `SimpleEventPlugin` occurs later in the plugin\n * order, after `ResponderEventPlugin`, we can detect that we were *not*\n * permitted to be the responder (presumably because a contained view became\n * responder). The `onResponderReject` won't fire in that case - it only\n * fires when a *current* responder rejects our request.\n *\n * @param {SyntheticEvent} e Touch Start event.\n */\n scrollResponderHandleTouchStart: function scrollResponderHandleTouchStart(e) {\n this.state.isTouching = true;\n this.props.onTouchStart && this.props.onTouchStart(e);\n },\n\n /**\n * Invoke this from an `onTouchMove` event.\n *\n * Since we know that the `SimpleEventPlugin` occurs later in the plugin\n * order, after `ResponderEventPlugin`, we can detect that we were *not*\n * permitted to be the responder (presumably because a contained view became\n * responder). The `onResponderReject` won't fire in that case - it only\n * fires when a *current* responder rejects our request.\n *\n * @param {SyntheticEvent} e Touch Start event.\n */\n scrollResponderHandleTouchMove: function scrollResponderHandleTouchMove(e) {\n this.props.onTouchMove && this.props.onTouchMove(e);\n },\n\n /**\n * A helper function for this class that lets us quickly determine if the\n * view is currently animating. This is particularly useful to know when\n * a touch has just started or ended.\n */\n scrollResponderIsAnimating: function scrollResponderIsAnimating() {\n var now = Date.now();\n var timeSinceLastMomentumScrollEnd = now - this.state.lastMomentumScrollEndTime;\n var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || this.state.lastMomentumScrollEndTime < this.state.lastMomentumScrollBeginTime;\n return isAnimating;\n },\n\n /**\n * Returns the node that represents native view that can be scrolled.\n * Components can pass what node to use by defining a `getScrollableNode`\n * function otherwise `this` is used.\n */\n scrollResponderGetScrollableNode: function scrollResponderGetScrollableNode() {\n return this.getScrollableNode ? this.getScrollableNode() : findNodeHandle(this);\n },\n\n /**\n * A helper function to scroll to a specific point in the scrollview.\n * This is currently used to help focus on child textviews, but can also\n * be used to quickly scroll to any element we want to focus. Syntax:\n *\n * scrollResponderScrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})\n *\n * Note: The weird argument signature is due to the fact that, for historical reasons,\n * the function also accepts separate arguments as as alternative to the options object.\n * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.\n */\n scrollResponderScrollTo: function scrollResponderScrollTo(x, y, animated) {\n if (typeof x === 'number') {\n console.warn('`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.');\n } else {\n var _ref = x || emptyObject;\n\n x = _ref.x;\n y = _ref.y;\n animated = _ref.animated;\n }\n\n var node = this.scrollResponderGetScrollableNode();\n var left = x || 0;\n var top = y || 0;\n\n if (typeof node.scroll === 'function') {\n node.scroll({\n top: top,\n left: left,\n behavior: !animated ? 'auto' : 'smooth'\n });\n } else {\n node.scrollLeft = left;\n node.scrollTop = top;\n }\n },\n\n /**\n * Deprecated, do not use.\n */\n scrollResponderScrollWithoutAnimationTo: function scrollResponderScrollWithoutAnimationTo(offsetX, offsetY) {\n console.warn('`scrollResponderScrollWithoutAnimationTo` is deprecated. Use `scrollResponderScrollTo` instead');\n this.scrollResponderScrollTo({\n x: offsetX,\n y: offsetY,\n animated: false\n });\n },\n\n /**\n * A helper function to zoom to a specific rect in the scrollview. The argument has the shape\n * {x: number; y: number; width: number; height: number; animated: boolean = true}\n *\n * @platform ios\n */\n scrollResponderZoomTo: function scrollResponderZoomTo(rect, animated // deprecated, put this inside the rect argument instead\n ) {\n if (Platform.OS !== 'ios') {\n invariant('zoomToRect is not implemented');\n }\n },\n\n /**\n * Displays the scroll indicators momentarily.\n */\n scrollResponderFlashScrollIndicators: function scrollResponderFlashScrollIndicators() {},\n\n /**\n * This method should be used as the callback to onFocus in a TextInputs'\n * parent view. Note that any module using this mixin needs to return\n * the parent view's ref in getScrollViewRef() in order to use this method.\n * @param {any} nodeHandle The TextInput node handle\n * @param {number} additionalOffset The scroll view's top \"contentInset\".\n * Default is 0.\n * @param {bool} preventNegativeScrolling Whether to allow pulling the content\n * down to make it meet the keyboard's top. Default is false.\n */\n scrollResponderScrollNativeHandleToKeyboard: function scrollResponderScrollNativeHandleToKeyboard(nodeHandle, additionalOffset, preventNegativeScrollOffset) {\n this.additionalScrollOffset = additionalOffset || 0;\n this.preventNegativeScrollOffset = !!preventNegativeScrollOffset;\n UIManager.measureLayout(nodeHandle, findNodeHandle(this.getInnerViewNode()), this.scrollResponderTextInputFocusError, this.scrollResponderInputMeasureAndScrollToKeyboard);\n },\n\n /**\n * The calculations performed here assume the scroll view takes up the entire\n * screen - even if has some content inset. We then measure the offsets of the\n * keyboard, and compensate both for the scroll view's \"contentInset\".\n *\n * @param {number} left Position of input w.r.t. table view.\n * @param {number} top Position of input w.r.t. table view.\n * @param {number} width Width of the text input.\n * @param {number} height Height of the text input.\n */\n scrollResponderInputMeasureAndScrollToKeyboard: function scrollResponderInputMeasureAndScrollToKeyboard(left, top, width, height) {\n var keyboardScreenY = Dimensions.get('window').height;\n\n if (this.keyboardWillOpenTo) {\n keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY;\n }\n\n var scrollOffsetY = top - keyboardScreenY + height + this.additionalScrollOffset; // By default, this can scroll with negative offset, pulling the content\n // down so that the target component's bottom meets the keyboard's top.\n // If requested otherwise, cap the offset at 0 minimum to avoid content\n // shifting down.\n\n if (this.preventNegativeScrollOffset) {\n scrollOffsetY = Math.max(0, scrollOffsetY);\n }\n\n this.scrollResponderScrollTo({\n x: 0,\n y: scrollOffsetY,\n animated: true\n });\n this.additionalOffset = 0;\n this.preventNegativeScrollOffset = false;\n },\n scrollResponderTextInputFocusError: function scrollResponderTextInputFocusError(e) {\n console.error('Error measuring text field: ', e);\n },\n\n /**\n * `componentWillMount` is the closest thing to a standard \"constructor\" for\n * React components.\n *\n * The `keyboardWillShow` is called before input focus.\n */\n componentWillMount: function componentWillMount() {\n this.keyboardWillOpenTo = null;\n this.additionalScrollOffset = 0; // this.addListenerOn(RCTDeviceEventEmitter, 'keyboardWillShow', this.scrollResponderKeyboardWillShow);\n // this.addListenerOn(RCTDeviceEventEmitter, 'keyboardWillHide', this.scrollResponderKeyboardWillHide);\n // this.addListenerOn(RCTDeviceEventEmitter, 'keyboardDidShow', this.scrollResponderKeyboardDidShow);\n // this.addListenerOn(RCTDeviceEventEmitter, 'keyboardDidHide', this.scrollResponderKeyboardDidHide);\n },\n\n /**\n * Warning, this may be called several times for a single keyboard opening.\n * It's best to store the information in this method and then take any action\n * at a later point (either in `keyboardDidShow` or other).\n *\n * Here's the order that events occur in:\n * - focus\n * - willShow {startCoordinates, endCoordinates} several times\n * - didShow several times\n * - blur\n * - willHide {startCoordinates, endCoordinates} several times\n * - didHide several times\n *\n * The `ScrollResponder` providesModule callbacks for each of these events.\n * Even though any user could have easily listened to keyboard events\n * themselves, using these `props` callbacks ensures that ordering of events\n * is consistent - and not dependent on the order that the keyboard events are\n * subscribed to. This matters when telling the scroll view to scroll to where\n * the keyboard is headed - the scroll responder better have been notified of\n * the keyboard destination before being instructed to scroll to where the\n * keyboard will be. Stick to the `ScrollResponder` callbacks, and everything\n * will work.\n *\n * WARNING: These callbacks will fire even if a keyboard is displayed in a\n * different navigation pane. Filter out the events to determine if they are\n * relevant to you. (For example, only if you receive these callbacks after\n * you had explicitly focused a node etc).\n */\n scrollResponderKeyboardWillShow: function scrollResponderKeyboardWillShow(e) {\n this.keyboardWillOpenTo = e;\n this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);\n },\n scrollResponderKeyboardWillHide: function scrollResponderKeyboardWillHide(e) {\n this.keyboardWillOpenTo = null;\n this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);\n },\n scrollResponderKeyboardDidShow: function scrollResponderKeyboardDidShow(e) {\n // TODO(7693961): The event for DidShow is not available on iOS yet.\n // Use the one from WillShow and do not assign.\n if (e) {\n this.keyboardWillOpenTo = e;\n }\n\n this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e);\n },\n scrollResponderKeyboardDidHide: function scrollResponderKeyboardDidHide(e) {\n this.keyboardWillOpenTo = null;\n this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);\n }\n};\nvar ScrollResponder = {\n Mixin: ScrollResponderMixin\n};\nexport default ScrollResponder;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport debounce from 'debounce';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React, { Component } from 'react';\nimport { bool, func, number } from 'prop-types';\n\nvar normalizeScrollEvent = function normalizeScrollEvent(e) {\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return e.target.scrollLeft;\n },\n\n get y() {\n return e.target.scrollTop;\n }\n\n },\n contentSize: {\n get height() {\n return e.target.scrollHeight;\n },\n\n get width() {\n return e.target.scrollWidth;\n }\n\n },\n layoutMeasurement: {\n get height() {\n return e.target.offsetHeight;\n },\n\n get width() {\n return e.target.offsetWidth;\n }\n\n }\n },\n timeStamp: Date.now()\n };\n};\n/**\n * Encapsulates the Web-specific scroll throttling and disabling logic\n */\n\n\nvar ScrollViewBase =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ScrollViewBase, _Component);\n\n function ScrollViewBase() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n _this._debouncedOnScrollEnd = debounce(_this._handleScrollEnd, 100);\n _this._state = {\n isScrolling: false,\n scrollLastTick: 0\n };\n\n _this._createPreventableScrollHandler = function (handler) {\n return function (e) {\n if (_this.props.scrollEnabled) {\n if (handler) {\n handler(e);\n }\n } else {\n // To disable scrolling in all browsers except Chrome\n e.preventDefault();\n }\n };\n };\n\n _this._handleScroll = function (e) {\n e.persist();\n e.stopPropagation();\n var scrollEventThrottle = _this.props.scrollEventThrottle; // A scroll happened, so the scroll bumps the debounce.\n\n _this._debouncedOnScrollEnd(e);\n\n if (_this._state.isScrolling) {\n // Scroll last tick may have changed, check if we need to notify\n if (_this._shouldEmitScrollEvent(_this._state.scrollLastTick, scrollEventThrottle)) {\n _this._handleScrollTick(e);\n }\n } else {\n // Weren't scrolling, so we must have just started\n _this._handleScrollStart(e);\n }\n };\n\n _this._setViewRef = function (element) {\n _this._viewRef = element;\n };\n\n return _this;\n }\n\n var _proto = ScrollViewBase.prototype;\n\n _proto.setNativeProps = function setNativeProps(props) {\n if (this._viewRef) {\n this._viewRef.setNativeProps(props);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n scrollEnabled = _this$props.scrollEnabled,\n style = _this$props.style,\n alwaysBounceHorizontal = _this$props.alwaysBounceHorizontal,\n alwaysBounceVertical = _this$props.alwaysBounceVertical,\n automaticallyAdjustContentInsets = _this$props.automaticallyAdjustContentInsets,\n bounces = _this$props.bounces,\n bouncesZoom = _this$props.bouncesZoom,\n canCancelContentTouches = _this$props.canCancelContentTouches,\n centerContent = _this$props.centerContent,\n contentInset = _this$props.contentInset,\n contentInsetAdjustmentBehavior = _this$props.contentInsetAdjustmentBehavior,\n contentOffset = _this$props.contentOffset,\n decelerationRate = _this$props.decelerationRate,\n directionalLockEnabled = _this$props.directionalLockEnabled,\n endFillColor = _this$props.endFillColor,\n indicatorStyle = _this$props.indicatorStyle,\n keyboardShouldPersistTaps = _this$props.keyboardShouldPersistTaps,\n maximumZoomScale = _this$props.maximumZoomScale,\n minimumZoomScale = _this$props.minimumZoomScale,\n onMomentumScrollBegin = _this$props.onMomentumScrollBegin,\n onMomentumScrollEnd = _this$props.onMomentumScrollEnd,\n onScrollBeginDrag = _this$props.onScrollBeginDrag,\n onScrollEndDrag = _this$props.onScrollEndDrag,\n overScrollMode = _this$props.overScrollMode,\n pinchGestureEnabled = _this$props.pinchGestureEnabled,\n removeClippedSubviews = _this$props.removeClippedSubviews,\n scrollEventThrottle = _this$props.scrollEventThrottle,\n scrollIndicatorInsets = _this$props.scrollIndicatorInsets,\n scrollPerfTag = _this$props.scrollPerfTag,\n scrollsToTop = _this$props.scrollsToTop,\n showsHorizontalScrollIndicator = _this$props.showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator = _this$props.showsVerticalScrollIndicator,\n snapToInterval = _this$props.snapToInterval,\n snapToAlignment = _this$props.snapToAlignment,\n zoomScale = _this$props.zoomScale,\n other = _objectWithoutPropertiesLoose(_this$props, [\"scrollEnabled\", \"style\", \"alwaysBounceHorizontal\", \"alwaysBounceVertical\", \"automaticallyAdjustContentInsets\", \"bounces\", \"bouncesZoom\", \"canCancelContentTouches\", \"centerContent\", \"contentInset\", \"contentInsetAdjustmentBehavior\", \"contentOffset\", \"decelerationRate\", \"directionalLockEnabled\", \"endFillColor\", \"indicatorStyle\", \"keyboardShouldPersistTaps\", \"maximumZoomScale\", \"minimumZoomScale\", \"onMomentumScrollBegin\", \"onMomentumScrollEnd\", \"onScrollBeginDrag\", \"onScrollEndDrag\", \"overScrollMode\", \"pinchGestureEnabled\", \"removeClippedSubviews\", \"scrollEventThrottle\", \"scrollIndicatorInsets\", \"scrollPerfTag\", \"scrollsToTop\", \"showsHorizontalScrollIndicator\", \"showsVerticalScrollIndicator\", \"snapToInterval\", \"snapToAlignment\", \"zoomScale\"]);\n\n var hideScrollbar = showsHorizontalScrollIndicator === false || showsVerticalScrollIndicator === false;\n return React.createElement(View, _extends({}, other, {\n onScroll: this._handleScroll,\n onTouchMove: this._createPreventableScrollHandler(this.props.onTouchMove),\n onWheel: this._createPreventableScrollHandler(this.props.onWheel),\n ref: this._setViewRef,\n style: [style, !scrollEnabled && styles.scrollDisabled, hideScrollbar && styles.hideScrollbar]\n }));\n };\n\n _proto._handleScrollStart = function _handleScrollStart(e) {\n this._state.isScrolling = true;\n this._state.scrollLastTick = Date.now();\n };\n\n _proto._handleScrollTick = function _handleScrollTick(e) {\n var onScroll = this.props.onScroll;\n this._state.scrollLastTick = Date.now();\n\n if (onScroll) {\n onScroll(normalizeScrollEvent(e));\n }\n };\n\n _proto._handleScrollEnd = function _handleScrollEnd(e) {\n var onScroll = this.props.onScroll;\n this._state.isScrolling = false;\n\n if (onScroll) {\n onScroll(normalizeScrollEvent(e));\n }\n };\n\n _proto._shouldEmitScrollEvent = function _shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n };\n\n return ScrollViewBase;\n}(Component); // Chrome doesn't support e.preventDefault in this case; touch-action must be\n// used to disable scrolling.\n// https://developers.google.com/web/updates/2017/01/scrolling-intervention\n\n\nScrollViewBase.defaultProps = {\n scrollEnabled: true,\n scrollEventThrottle: 0\n};\nexport { ScrollViewBase as default };\nScrollViewBase.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n onMomentumScrollBegin: func,\n onMomentumScrollEnd: func,\n onScroll: func,\n onScrollBeginDrag: func,\n onScrollEndDrag: func,\n onTouchMove: func,\n onWheel: func,\n removeClippedSubviews: bool,\n scrollEnabled: bool,\n scrollEventThrottle: number,\n showsHorizontalScrollIndicator: bool,\n showsVerticalScrollIndicator: bool\n}) : {};\nvar styles = StyleSheet.create({\n scrollDisabled: {\n touchAction: 'none'\n },\n hideScrollbar: {\n scrollbarWidth: 'none'\n }\n});","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport createReactClass from 'create-react-class';\nimport dismissKeyboard from '../../modules/dismissKeyboard';\nimport findNodeHandle from '../findNodeHandle';\nimport invariant from 'fbjs/lib/invariant';\nimport ScrollResponder from '../../modules/ScrollResponder';\nimport ScrollViewBase from './ScrollViewBase';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React from 'react';\nimport { arrayOf, bool, element, func, number, oneOf } from 'prop-types';\nvar emptyObject = {};\n/* eslint-disable react/prefer-es6-class, react/prop-types */\n\nvar ScrollView = createReactClass({\n displayName: \"ScrollView\",\n propTypes: _objectSpread({}, ViewPropTypes, {\n contentContainerStyle: ViewPropTypes.style,\n horizontal: bool,\n keyboardDismissMode: oneOf(['none', 'interactive', 'on-drag']),\n onContentSizeChange: func,\n onScroll: func,\n pagingEnabled: bool,\n refreshControl: element,\n scrollEnabled: bool,\n scrollEventThrottle: number,\n stickyHeaderIndices: arrayOf(number),\n style: ViewPropTypes.style\n }),\n mixins: [ScrollResponder.Mixin],\n getInitialState: function getInitialState() {\n return this.scrollResponderMixinGetInitialState();\n },\n flashScrollIndicators: function flashScrollIndicators() {\n this.scrollResponderFlashScrollIndicators();\n },\n setNativeProps: function setNativeProps(props) {\n if (this._scrollViewRef) {\n this._scrollViewRef.setNativeProps(props);\n }\n },\n\n /**\n * Returns a reference to the underlying scroll responder, which supports\n * operations like `scrollTo`. All ScrollView-like components should\n * implement this method so that they can be composed while providing access\n * to the underlying scroll responder's methods.\n */\n getScrollResponder: function getScrollResponder() {\n return this;\n },\n getScrollableNode: function getScrollableNode() {\n return findNodeHandle(this._scrollViewRef);\n },\n getInnerViewNode: function getInnerViewNode() {\n return findNodeHandle(this._innerViewRef);\n },\n\n /**\n * Scrolls to a given x, y offset, either immediately or with a smooth animation.\n * Syntax:\n *\n * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})\n *\n * Note: The weird argument signature is due to the fact that, for historical reasons,\n * the function also accepts separate arguments as as alternative to the options object.\n * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.\n */\n scrollTo: function scrollTo(y, x, animated) {\n if (typeof y === 'number') {\n console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.');\n } else {\n var _ref = y || emptyObject;\n\n x = _ref.x;\n y = _ref.y;\n animated = _ref.animated;\n }\n\n this.getScrollResponder().scrollResponderScrollTo({\n x: x || 0,\n y: y || 0,\n animated: animated !== false\n });\n },\n\n /**\n * If this is a vertical ScrollView scrolls to the bottom.\n * If this is a horizontal ScrollView scrolls to the right.\n *\n * Use `scrollToEnd({ animated: true })` for smooth animated scrolling,\n * `scrollToEnd({ animated: false })` for immediate scrolling.\n * If no options are passed, `animated` defaults to true.\n */\n scrollToEnd: function scrollToEnd(options) {\n // Default to true\n var animated = (options && options.animated) !== false;\n var horizontal = this.props.horizontal;\n var scrollResponder = this.getScrollResponder();\n var scrollResponderNode = scrollResponder.scrollResponderGetScrollableNode();\n var x = horizontal ? scrollResponderNode.scrollWidth : 0;\n var y = horizontal ? 0 : scrollResponderNode.scrollHeight;\n scrollResponder.scrollResponderScrollTo({\n x: x,\n y: y,\n animated: animated\n });\n },\n\n /**\n * Deprecated, do not use.\n */\n scrollWithoutAnimationTo: function scrollWithoutAnimationTo(y, x) {\n if (y === void 0) {\n y = 0;\n }\n\n if (x === void 0) {\n x = 0;\n }\n\n console.warn('`scrollWithoutAnimationTo` is deprecated. Use `scrollTo` instead');\n this.scrollTo({\n x: x,\n y: y,\n animated: false\n });\n },\n render: function render() {\n var _this$props = this.props,\n contentContainerStyle = _this$props.contentContainerStyle,\n horizontal = _this$props.horizontal,\n onContentSizeChange = _this$props.onContentSizeChange,\n refreshControl = _this$props.refreshControl,\n stickyHeaderIndices = _this$props.stickyHeaderIndices,\n pagingEnabled = _this$props.pagingEnabled,\n keyboardDismissMode = _this$props.keyboardDismissMode,\n onScroll = _this$props.onScroll,\n other = _objectWithoutPropertiesLoose(_this$props, [\"contentContainerStyle\", \"horizontal\", \"onContentSizeChange\", \"refreshControl\", \"stickyHeaderIndices\", \"pagingEnabled\", \"keyboardDismissMode\", \"onScroll\"]);\n\n if (process.env.NODE_ENV !== 'production' && this.props.style) {\n var style = StyleSheet.flatten(this.props.style);\n var childLayoutProps = ['alignItems', 'justifyContent'].filter(function (prop) {\n return style && style[prop] !== undefined;\n });\n invariant(childLayoutProps.length === 0, \"ScrollView child layout (\" + JSON.stringify(childLayoutProps) + \") \" + 'must be applied through the contentContainerStyle prop.');\n }\n\n var contentSizeChangeProps = {};\n\n if (onContentSizeChange) {\n contentSizeChangeProps = {\n onLayout: this._handleContentOnLayout\n };\n }\n\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var children = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(this.props.children, function (child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n\n if (child != null && (isSticky || pagingEnabled)) {\n return React.createElement(View, {\n style: StyleSheet.compose(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild)\n }, child);\n } else {\n return child;\n }\n }) : this.props.children;\n var contentContainer = React.createElement(View, _extends({}, contentSizeChangeProps, {\n children: children,\n collapsable: false,\n ref: this._setInnerViewRef,\n style: StyleSheet.compose(horizontal && styles.contentContainerHorizontal, contentContainerStyle)\n }));\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n\n var props = _objectSpread({}, other, {\n style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],\n onTouchStart: this.scrollResponderHandleTouchStart,\n onTouchMove: this.scrollResponderHandleTouchMove,\n onTouchEnd: this.scrollResponderHandleTouchEnd,\n onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,\n onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,\n onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,\n onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,\n onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder,\n onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture,\n onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder,\n onScroll: this._handleScroll,\n onResponderGrant: this.scrollResponderHandleResponderGrant,\n onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,\n onResponderTerminate: this.scrollResponderHandleTerminate,\n onResponderRelease: this.scrollResponderHandleResponderRelease,\n onResponderReject: this.scrollResponderHandleResponderReject\n });\n\n var ScrollViewClass = ScrollViewBase;\n invariant(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined');\n\n if (refreshControl) {\n return React.cloneElement(refreshControl, {\n style: props.style\n }, React.createElement(ScrollViewClass, _extends({}, props, {\n ref: this._setScrollViewRef,\n style: baseStyle\n }), contentContainer));\n }\n\n return React.createElement(ScrollViewClass, _extends({}, props, {\n ref: this._setScrollViewRef\n }), contentContainer);\n },\n _handleContentOnLayout: function _handleContentOnLayout(e) {\n var _e$nativeEvent$layout = e.nativeEvent.layout,\n width = _e$nativeEvent$layout.width,\n height = _e$nativeEvent$layout.height;\n this.props.onContentSizeChange(width, height);\n },\n _handleScroll: function _handleScroll(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (this.props.onScroll && !this.props.scrollEventThrottle) {\n console.log('You specified `onScroll` on a but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + \"cause frame drops, use a bigger number if you don't need as \" + 'much precision.');\n }\n }\n\n if (this.props.keyboardDismissMode === 'on-drag') {\n dismissKeyboard();\n }\n\n this.scrollResponderHandleScroll(e);\n },\n _setInnerViewRef: function _setInnerViewRef(component) {\n this._innerViewRef = component;\n },\n _setScrollViewRef: function _setScrollViewRef(component) {\n this._scrollViewRef = component;\n }\n});\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1,\n // Enable hardware compositing in modern browsers.\n // Creates a new layer with its own backing surface that can significantly\n // improve scroll performance.\n transform: [{\n translateZ: 0\n }],\n // iOS native scrolling\n WebkitOverflowScrolling: 'touch'\n};\nvar styles = StyleSheet.create({\n baseVertical: _objectSpread({}, commonStyle, {\n flexDirection: 'column',\n overflowX: 'hidden',\n overflowY: 'auto'\n }),\n baseHorizontal: _objectSpread({}, commonStyle, {\n flexDirection: 'row',\n overflowX: 'auto',\n overflowY: 'hidden'\n }),\n contentContainerHorizontal: {\n flexDirection: 'row'\n },\n stickyHeader: {\n position: 'sticky',\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: 'x mandatory'\n },\n pagingEnabledVertical: {\n scrollSnapType: 'y mandatory'\n },\n pagingEnabledChild: {\n scrollSnapAlign: 'start'\n }\n});\nexport default ScrollView;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyLayout from '../../modules/applyLayout';\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport { bool } from 'prop-types';\nimport { Component } from 'react';\nimport createElement from '../createElement';\nimport css from '../StyleSheet/css';\nimport warning from 'fbjs/lib/warning';\nimport StyleSheet from '../StyleSheet';\nimport TextPropTypes from './TextPropTypes';\n\nvar Text =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Text, _Component);\n\n function Text() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = Text.prototype;\n\n _proto.getChildContext = function getChildContext() {\n return {\n isInAParentText: true\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n dir = _this$props.dir,\n numberOfLines = _this$props.numberOfLines,\n onPress = _this$props.onPress,\n selectable = _this$props.selectable,\n style = _this$props.style,\n adjustsFontSizeToFit = _this$props.adjustsFontSizeToFit,\n allowFontScaling = _this$props.allowFontScaling,\n ellipsizeMode = _this$props.ellipsizeMode,\n lineBreakMode = _this$props.lineBreakMode,\n maxFontSizeMultiplier = _this$props.maxFontSizeMultiplier,\n minimumFontScale = _this$props.minimumFontScale,\n onLayout = _this$props.onLayout,\n onLongPress = _this$props.onLongPress,\n pressRetentionOffset = _this$props.pressRetentionOffset,\n selectionColor = _this$props.selectionColor,\n suppressHighlighting = _this$props.suppressHighlighting,\n textBreakStrategy = _this$props.textBreakStrategy,\n tvParallaxProperties = _this$props.tvParallaxProperties,\n otherProps = _objectWithoutPropertiesLoose(_this$props, [\"dir\", \"numberOfLines\", \"onPress\", \"selectable\", \"style\", \"adjustsFontSizeToFit\", \"allowFontScaling\", \"ellipsizeMode\", \"lineBreakMode\", \"maxFontSizeMultiplier\", \"minimumFontScale\", \"onLayout\", \"onLongPress\", \"pressRetentionOffset\", \"selectionColor\", \"suppressHighlighting\", \"textBreakStrategy\", \"tvParallaxProperties\"]);\n\n var isInAParentText = this.context.isInAParentText;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(this.props.className == null, 'Using the \"className\" prop on is deprecated.');\n }\n\n if (onPress) {\n otherProps.accessible = true;\n otherProps.onClick = this._createPressHandler(onPress);\n otherProps.onKeyDown = this._createEnterHandler(onPress);\n }\n\n otherProps.classList = [this.props.className, classes.text, this.context.isInAParentText === true && classes.textHasAncestor, numberOfLines === 1 && classes.textOneLine, numberOfLines > 1 && classes.textMultiLine]; // allow browsers to automatically infer the language writing direction\n\n otherProps.dir = dir !== undefined ? dir : 'auto';\n otherProps.style = [style, numberOfLines > 1 && {\n WebkitLineClamp: numberOfLines\n }, selectable === false && styles.notSelectable, onPress && styles.pressable];\n var component = isInAParentText ? 'span' : 'div';\n return createElement(component, otherProps);\n };\n\n _proto._createEnterHandler = function _createEnterHandler(fn) {\n return function (e) {\n if (e.keyCode === 13) {\n fn && fn(e);\n }\n };\n };\n\n _proto._createPressHandler = function _createPressHandler(fn) {\n return function (e) {\n e.stopPropagation();\n fn && fn(e);\n };\n };\n\n return Text;\n}(Component);\n\nText.displayName = 'Text';\nText.childContextTypes = {\n isInAParentText: bool\n};\nText.contextTypes = {\n isInAParentText: bool\n};\nText.propTypes = process.env.NODE_ENV !== \"production\" ? TextPropTypes : {};\nvar classes = css.create({\n text: {\n border: '0 solid black',\n boxSizing: 'border-box',\n color: 'black',\n display: 'inline',\n font: '14px System',\n margin: 0,\n padding: 0,\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word'\n },\n textHasAncestor: {\n color: 'inherit',\n font: 'inherit',\n whiteSpace: 'inherit'\n },\n textOneLine: {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n },\n // See #13\n textMultiLine: {\n display: '-webkit-box',\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n WebkitBoxOrient: 'vertical'\n }\n});\nvar styles = StyleSheet.create({\n notSelectable: {\n userSelect: 'none'\n },\n pressable: {\n cursor: 'pointer'\n }\n});\nexport default applyLayout(applyNativeMethods(Text));","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport AnimatedImplementation from '../../vendor/react-native/Animated/AnimatedImplementation';\nimport Image from '../Image';\nimport ScrollView from '../ScrollView';\nimport Text from '../Text';\nimport View from '../View';\n\nvar Animated = _objectSpread({}, AnimatedImplementation, {\n Image: AnimatedImplementation.createAnimatedComponent(Image),\n ScrollView: AnimatedImplementation.createAnimatedComponent(ScrollView),\n View: AnimatedImplementation.createAnimatedComponent(View),\n Text: AnimatedImplementation.createAnimatedComponent(Text)\n});\n\nexport default Animated;","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport { any, node } from 'prop-types';\nimport React, { Component } from 'react';\n\nvar AppContainer =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(AppContainer, _Component);\n\n function AppContainer() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n _this.state = {\n mainKey: 1\n };\n return _this;\n }\n\n var _proto = AppContainer.prototype;\n\n _proto.getChildContext = function getChildContext() {\n return {\n rootTag: this.props.rootTag\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n WrapperComponent = _this$props.WrapperComponent;\n var innerView = React.createElement(View, {\n children: children,\n key: this.state.mainKey,\n pointerEvents: \"box-none\",\n style: styles.appContainer\n });\n\n if (WrapperComponent) {\n innerView = React.createElement(WrapperComponent, null, innerView);\n }\n\n return React.createElement(View, {\n pointerEvents: \"box-none\",\n style: styles.appContainer\n }, innerView);\n };\n\n return AppContainer;\n}(Component);\n\nAppContainer.childContextTypes = {\n rootTag: any\n};\nexport { AppContainer as default };\nAppContainer.propTypes = process.env.NODE_ENV !== \"production\" ? {\n WrapperComponent: any,\n children: node,\n rootTag: any.isRequired\n} : {};\nvar styles = StyleSheet.create({\n appContainer: {\n flex: 1\n }\n});","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport AppContainer from './AppContainer';\nimport invariant from 'fbjs/lib/invariant';\nimport hydrate from '../../modules/hydrate';\nimport render from '../render';\nimport styleResolver from '../StyleSheet/styleResolver';\nimport React from 'react';\nvar renderFn = process.env.NODE_ENV !== 'production' ? render : hydrate;\nexport default function renderApplication(RootComponent, initialProps, rootTag, WrapperComponent, callback) {\n invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);\n renderFn(React.createElement(AppContainer, {\n WrapperComponent: WrapperComponent,\n rootTag: rootTag\n }, React.createElement(RootComponent, initialProps)), rootTag, callback);\n}\nexport function getApplication(RootComponent, initialProps, WrapperComponent) {\n var element = React.createElement(AppContainer, {\n WrapperComponent: WrapperComponent,\n rootTag: {}\n }, React.createElement(RootComponent, initialProps)); // Don't escape CSS text\n\n var getStyleElement = function getStyleElement(props) {\n var sheet = styleResolver.getStyleSheet();\n return React.createElement(\"style\", _extends({}, props, {\n dangerouslySetInnerHTML: {\n __html: sheet.textContent\n },\n id: sheet.id\n }));\n };\n\n return {\n element: element,\n getStyleElement: getStyleElement\n };\n}","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { hydrate } from 'react-dom';\nexport default hydrate;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from '../unmountComponentAtNode';\nimport renderApplication, { getApplication as _getApplication } from './renderApplication';\nvar emptyObject = {};\nvar runnables = {};\n\nvar componentProviderInstrumentationHook = function componentProviderInstrumentationHook(component) {\n return component();\n};\n\nvar wrapperComponentProvider;\n/**\n * `AppRegistry` is the JS entry point to running all React Native apps.\n */\n\nvar AppRegistry =\n/*#__PURE__*/\nfunction () {\n function AppRegistry() {}\n\n AppRegistry.getAppKeys = function getAppKeys() {\n return Object.keys(runnables);\n };\n\n AppRegistry.getApplication = function getApplication(appKey, appParameters) {\n invariant(runnables[appKey] && runnables[appKey].getApplication, \"Application \" + appKey + \" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].getApplication(appParameters);\n };\n\n AppRegistry.registerComponent = function registerComponent(appKey, componentProvider) {\n runnables[appKey] = {\n getApplication: function getApplication(appParameters) {\n return _getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters));\n },\n run: function run(appParameters) {\n return renderApplication(componentProviderInstrumentationHook(componentProvider), appParameters.initialProps || emptyObject, appParameters.rootTag, wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback);\n }\n };\n return appKey;\n };\n\n AppRegistry.registerConfig = function registerConfig(config) {\n config.forEach(function (_ref) {\n var appKey = _ref.appKey,\n component = _ref.component,\n run = _ref.run;\n\n if (run) {\n AppRegistry.registerRunnable(appKey, run);\n } else {\n invariant(component, 'No component provider passed in');\n AppRegistry.registerComponent(appKey, component);\n }\n });\n } // TODO: fix style sheet creation when using this method\n ;\n\n AppRegistry.registerRunnable = function registerRunnable(appKey, run) {\n runnables[appKey] = {\n run: run\n };\n return appKey;\n };\n\n AppRegistry.runApplication = function runApplication(appKey, appParameters) {\n var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n\n if (isDevelopment) {\n var params = _objectSpread({}, appParameters);\n\n params.rootTag = \"#\" + params.rootTag.id;\n console.log(\"Running application \\\"\" + appKey + \"\\\" with appParams: \" + JSON.stringify(params) + \".\\n\" + (\"Development-level warnings: \" + (isDevelopment ? 'ON' : 'OFF') + \".\\n\") + (\"Performance optimizations: \" + (isDevelopment ? 'OFF' : 'ON') + \".\"));\n }\n\n invariant(runnables[appKey] && runnables[appKey].run, \"Application \\\"\" + appKey + \"\\\" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n runnables[appKey].run(appParameters);\n };\n\n AppRegistry.setComponentProviderInstrumentationHook = function setComponentProviderInstrumentationHook(hook) {\n componentProviderInstrumentationHook = hook;\n };\n\n AppRegistry.setWrapperComponentProvider = function setWrapperComponentProvider(provider) {\n wrapperComponentProvider = provider;\n };\n\n AppRegistry.unmountApplicationComponentAtRootTag = function unmountApplicationComponentAtRootTag(rootTag) {\n unmountComponentAtNode(rootTag);\n };\n\n return AppRegistry;\n}();\n\nexport { AppRegistry as default };","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport findIndex from 'array-find-index';\nimport invariant from 'fbjs/lib/invariant'; // Android 4.4 browser\n\nvar isPrefixed = canUseDOM && !document.hasOwnProperty('hidden') && document.hasOwnProperty('webkitHidden');\nvar EVENT_TYPES = ['change', 'memoryWarning'];\nvar VISIBILITY_CHANGE_EVENT = isPrefixed ? 'webkitvisibilitychange' : 'visibilitychange';\nvar VISIBILITY_STATE_PROPERTY = isPrefixed ? 'webkitVisibilityState' : 'visibilityState';\nvar AppStates = {\n BACKGROUND: 'background',\n ACTIVE: 'active'\n};\nvar listeners = [];\n\nvar AppState =\n/*#__PURE__*/\nfunction () {\n function AppState() {}\n\n AppState.addEventListener = function addEventListener(type, handler) {\n if (AppState.isAvailable) {\n invariant(EVENT_TYPES.indexOf(type) !== -1, 'Trying to subscribe to unknown event: \"%s\"', type);\n\n if (type === 'change') {\n var callback = function callback() {\n return handler(AppState.currentState);\n };\n\n listeners.push([handler, callback]);\n document.addEventListener(VISIBILITY_CHANGE_EVENT, callback, false);\n }\n }\n };\n\n AppState.removeEventListener = function removeEventListener(type, handler) {\n if (AppState.isAvailable) {\n invariant(EVENT_TYPES.indexOf(type) !== -1, 'Trying to remove listener for unknown event: \"%s\"', type);\n\n if (type === 'change') {\n var listenerIndex = findIndex(listeners, function (pair) {\n return pair[0] === handler;\n });\n invariant(listenerIndex !== -1, 'Trying to remove AppState listener for unregistered handler');\n var callback = listeners[listenerIndex][1];\n document.removeEventListener(VISIBILITY_CHANGE_EVENT, callback, false);\n listeners.splice(listenerIndex, 1);\n }\n }\n };\n\n _createClass(AppState, null, [{\n key: \"currentState\",\n get: function get() {\n if (!AppState.isAvailable) {\n return AppStates.ACTIVE;\n }\n\n switch (document[VISIBILITY_STATE_PROPERTY]) {\n case 'hidden':\n case 'prerender':\n case 'unloaded':\n return AppStates.BACKGROUND;\n\n default:\n return AppStates.ACTIVE;\n }\n }\n }]);\n\n return AppState;\n}();\n\nAppState.isAvailable = canUseDOM && document[VISIBILITY_STATE_PROPERTY];\nexport { AppState as default };","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport merge from 'deep-assign';\n\nvar mergeLocalStorageItem = function mergeLocalStorageItem(key, value) {\n var oldValue = window.localStorage.getItem(key);\n var oldObject = JSON.parse(oldValue);\n var newObject = JSON.parse(value);\n var nextValue = JSON.stringify(merge({}, oldObject, newObject));\n window.localStorage.setItem(key, nextValue);\n};\n\nvar createPromise = function createPromise(getValue, callback) {\n return new Promise(function (resolve, reject) {\n try {\n var value = getValue();\n\n if (callback) {\n callback(null, value);\n }\n\n resolve(value);\n } catch (err) {\n if (callback) {\n callback(err);\n }\n\n reject(err);\n }\n });\n};\n\nvar createPromiseAll = function createPromiseAll(promises, callback, processResult) {\n return Promise.all(promises).then(function (result) {\n var value = processResult ? processResult(result) : null;\n callback && callback(null, value);\n return Promise.resolve(value);\n }, function (errors) {\n callback && callback(errors);\n return Promise.reject(errors);\n });\n};\n\nvar AsyncStorage =\n/*#__PURE__*/\nfunction () {\n function AsyncStorage() {}\n /**\n * Erases *all* AsyncStorage for the domain.\n */\n\n\n AsyncStorage.clear = function clear(callback) {\n return createPromise(function () {\n window.localStorage.clear();\n }, callback);\n }\n /**\n * (stub) Flushes any pending requests using a single batch call to get the data.\n */\n ;\n\n AsyncStorage.flushGetRequests = function flushGetRequests() {}\n /**\n * Gets *all* keys known to the app, for all callers, libraries, etc.\n */\n ;\n\n AsyncStorage.getAllKeys = function getAllKeys(callback) {\n return createPromise(function () {\n var numberOfKeys = window.localStorage.length;\n var keys = [];\n\n for (var i = 0; i < numberOfKeys; i += 1) {\n var key = window.localStorage.key(i);\n keys.push(key);\n }\n\n return keys;\n }, callback);\n }\n /**\n * Fetches `key` value.\n */\n ;\n\n AsyncStorage.getItem = function getItem(key, callback) {\n return createPromise(function () {\n return window.localStorage.getItem(key);\n }, callback);\n }\n /**\n * multiGet resolves to an array of key-value pair arrays that matches the\n * input format of multiSet.\n *\n * multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']]\n */\n ;\n\n AsyncStorage.multiGet = function multiGet(keys, callback) {\n var promises = keys.map(function (key) {\n return AsyncStorage.getItem(key);\n });\n\n var processResult = function processResult(result) {\n return result.map(function (value, i) {\n return [keys[i], value];\n });\n };\n\n return createPromiseAll(promises, callback, processResult);\n }\n /**\n * Sets `value` for `key`.\n */\n ;\n\n AsyncStorage.setItem = function setItem(key, value, callback) {\n return createPromise(function () {\n window.localStorage.setItem(key, value);\n }, callback);\n }\n /**\n * Takes an array of key-value array pairs.\n * multiSet([['k1', 'val1'], ['k2', 'val2']])\n */\n ;\n\n AsyncStorage.multiSet = function multiSet(keyValuePairs, callback) {\n var promises = keyValuePairs.map(function (item) {\n return AsyncStorage.setItem(item[0], item[1]);\n });\n return createPromiseAll(promises, callback);\n }\n /**\n * Merges existing value with input value, assuming they are stringified JSON.\n */\n ;\n\n AsyncStorage.mergeItem = function mergeItem(key, value, callback) {\n return createPromise(function () {\n mergeLocalStorageItem(key, value);\n }, callback);\n }\n /**\n * Takes an array of key-value array pairs and merges them with existing\n * values, assuming they are stringified JSON.\n *\n * multiMerge([['k1', 'val1'], ['k2', 'val2']])\n */\n ;\n\n AsyncStorage.multiMerge = function multiMerge(keyValuePairs, callback) {\n var promises = keyValuePairs.map(function (item) {\n return AsyncStorage.mergeItem(item[0], item[1]);\n });\n return createPromiseAll(promises, callback);\n }\n /**\n * Removes a `key`\n */\n ;\n\n AsyncStorage.removeItem = function removeItem(key, callback) {\n return createPromise(function () {\n return window.localStorage.removeItem(key);\n }, callback);\n }\n /**\n * Delete all the keys in the `keys` array.\n */\n ;\n\n AsyncStorage.multiRemove = function multiRemove(keys, callback) {\n var promises = keys.map(function (key) {\n return AsyncStorage.removeItem(key);\n });\n return createPromiseAll(promises, callback);\n };\n\n return AsyncStorage;\n}();\n\nexport { AsyncStorage as default };","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nfunction emptyFunction() {}\n\nvar BackHandler = {\n exitApp: emptyFunction,\n addEventListener: function addEventListener() {\n return {\n remove: emptyFunction\n };\n },\n removeEventListener: emptyFunction\n};\nexport default BackHandler;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar clipboardAvailable;\n\nvar Clipboard =\n/*#__PURE__*/\nfunction () {\n function Clipboard() {}\n\n Clipboard.isAvailable = function isAvailable() {\n if (clipboardAvailable === undefined) {\n clipboardAvailable = typeof document.queryCommandSupported === 'function' && document.queryCommandSupported('copy');\n }\n\n return clipboardAvailable;\n };\n\n Clipboard.getString = function getString() {\n return Promise.resolve('');\n };\n\n Clipboard.setString = function setString(text) {\n var success = false;\n var body = document.body;\n\n if (body) {\n // add the text to a hidden node\n var node = document.createElement('span');\n node.textContent = text;\n node.style.opacity = '0';\n node.style.position = 'absolute';\n node.style.whiteSpace = 'pre-wrap';\n body.appendChild(node); // select the text\n\n var selection = window.getSelection();\n selection.removeAllRanges();\n var range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range); // attempt to copy\n\n try {\n document.execCommand('copy');\n success = true;\n } catch (e) {} // remove selection and node\n\n\n selection.removeAllRanges();\n body.removeChild(node);\n }\n\n return success;\n };\n\n return Clipboard;\n}();\n\nexport { Clipboard as default };","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport Dimensions from '../Dimensions';\nvar DeviceInfo = {\n Dimensions: {\n get windowPhysicalPixels() {\n var _Dimensions$get = Dimensions.get('window'),\n width = _Dimensions$get.width,\n height = _Dimensions$get.height,\n fontScale = _Dimensions$get.fontScale,\n scale = _Dimensions$get.scale;\n\n return {\n width: width * scale,\n height: height * scale,\n scale: scale,\n fontScale: fontScale\n };\n },\n\n get screenPhysicalPixels() {\n var _Dimensions$get2 = Dimensions.get('screen'),\n width = _Dimensions$get2.width,\n height = _Dimensions$get2.height,\n fontScale = _Dimensions$get2.fontScale,\n scale = _Dimensions$get2.scale;\n\n return {\n width: width * scale,\n height: height * scale,\n scale: scale,\n fontScale: fontScale\n };\n }\n\n },\n\n get locale() {\n if (canUseDOM) {\n if (window.navigator.languages) {\n return window.navigator.languages[0];\n } else {\n return window.navigator.language;\n }\n }\n },\n\n get totalMemory() {\n return canUseDOM ? window.navigator.deviceMemory : undefined;\n },\n\n get userAgent() {\n return canUseDOM ? window.navigator.userAgent : '';\n }\n\n};\nexport default DeviceInfo;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport Easing from '../../vendor/react-native/Animated/Easing';\nexport default Easing;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport dismissKeyboard from '../../modules/dismissKeyboard';\nvar Keyboard = {\n addListener: function addListener() {\n return {\n remove: function remove() {}\n };\n },\n dismiss: function dismiss() {\n dismissKeyboard();\n },\n removeAllListeners: function removeAllListeners() {},\n removeListener: function removeListener() {}\n};\nexport default Keyboard;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\nimport PropTypes from 'prop-types';\nimport UIManager from '../../../exports/UIManager';\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar checkPropTypes = PropTypes.checkPropTypes;\nvar Types = {\n spring: 'spring',\n linear: 'linear',\n easeInEaseOut: 'easeInEaseOut',\n easeIn: 'easeIn',\n easeOut: 'easeOut',\n keyboard: 'keyboard'\n};\nvar Properties = {\n opacity: 'opacity',\n scaleX: 'scaleX',\n scaleY: 'scaleY',\n scaleXY: 'scaleXY'\n};\nvar animType = PropTypes.shape({\n duration: PropTypes.number,\n delay: PropTypes.number,\n springDamping: PropTypes.number,\n initialVelocity: PropTypes.number,\n type: PropTypes.oneOf(Object.keys(Types)).isRequired,\n property: PropTypes.oneOf( // Only applies to create/delete\n Object.keys(Properties))\n});\nvar configType = PropTypes.shape({\n duration: PropTypes.number.isRequired,\n create: animType,\n update: animType,\n delete: animType\n});\n\nfunction checkConfig(config, location, name) {\n checkPropTypes({\n config: configType\n }, {\n config: config\n }, location, name);\n}\n\nfunction configureNext(config, onAnimationDidEnd) {\n if (__DEV__) {\n checkConfig(config, 'config', 'LayoutAnimation.configureNext');\n }\n\n UIManager.configureNextLayoutAnimation(config, onAnimationDidEnd || function () {}, function () {\n /* unused */\n });\n}\n\nfunction create(duration, type, creationProp) {\n return {\n duration: duration,\n create: {\n type: type,\n property: creationProp\n },\n update: {\n type: type\n },\n delete: {\n type: type,\n property: creationProp\n }\n };\n}\n\nvar Presets = {\n easeInEaseOut: create(300, Types.easeInEaseOut, Properties.opacity),\n linear: create(500, Types.linear, Properties.opacity),\n spring: {\n duration: 700,\n create: {\n type: Types.linear,\n property: Properties.opacity\n },\n update: {\n type: Types.spring,\n springDamping: 0.4\n },\n delete: {\n type: Types.linear,\n property: Properties.opacity\n }\n }\n};\n/**\n * Automatically animates views to their new positions when the\n * next layout happens.\n *\n * A common way to use this API is to call it before calling `setState`.\n *\n * Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:\n *\n * UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);\n */\n\nvar LayoutAnimation = {\n /**\n * Schedules an animation to happen on the next layout.\n *\n * @param config Specifies animation properties:\n *\n * - `duration` in milliseconds\n * - `create`, config for animating in new views (see `Anim` type)\n * - `update`, config for animating views that have been updated\n * (see `Anim` type)\n *\n * @param onAnimationDidEnd Called when the animation finished.\n * Only supported on iOS.\n * @param onError Called on error. Only supported on iOS.\n */\n configureNext: configureNext,\n\n /**\n * Helper for creating a config for `configureNext`.\n */\n create: create,\n Types: Types,\n Properties: Properties,\n checkConfig: checkConfig,\n Presets: Presets,\n easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut),\n linear: configureNext.bind(null, Presets.linear),\n spring: configureNext.bind(null, Presets.spring)\n};\nexport default LayoutAnimation;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport LayoutAnimation from '../../vendor/react-native/LayoutAnimation';\nexport default LayoutAnimation;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport invariant from 'fbjs/lib/invariant';\nvar initialURL = canUseDOM ? window.location.href : '';\nvar Linking = {\n addEventListener: function addEventListener() {},\n removeEventListener: function removeEventListener() {},\n canOpenURL: function canOpenURL() {\n return Promise.resolve(true);\n },\n getInitialURL: function getInitialURL() {\n return Promise.resolve(initialURL);\n },\n openURL: function openURL(url) {\n try {\n open(url);\n return Promise.resolve();\n } catch (e) {\n return Promise.reject(e);\n }\n },\n _validateURL: function _validateURL(url) {\n invariant(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url);\n invariant(url, 'Invalid URL: cannot be empty');\n }\n};\n\nvar open = function open(url) {\n if (canUseDOM) {\n window.location = new URL(url, window.location).toString();\n }\n};\n\nexport default Linking;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport NativeEventEmitter from '../../vendor/react-native/NativeEventEmitter';\nexport default NativeEventEmitter;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';\nimport findIndex from 'array-find-index';\nimport invariant from 'fbjs/lib/invariant';\nvar connection = ExecutionEnvironment.canUseDOM && (window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection); // Prevent the underlying event handlers from leaking and include additional\n// properties available in browsers\n\nvar getConnectionInfoObject = function getConnectionInfoObject() {\n var result = {\n effectiveType: 'unknown',\n type: 'unknown'\n };\n\n if (!connection) {\n return result;\n }\n\n for (var prop in connection) {\n var value = connection[prop];\n\n if (typeof value !== 'function' && value != null) {\n result[prop] = value;\n }\n }\n\n return result;\n}; // Map React Native events to browser equivalents\n\n\nvar eventTypesMap = {\n change: 'change',\n connectionChange: 'change'\n};\nvar eventTypes = Object.keys(eventTypesMap);\nvar connectionListeners = [];\nvar netInfoListeners = [];\n/**\n * Navigator online: https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine\n * Network Connection API: https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation\n */\n\nvar NetInfo = {\n addEventListener: function addEventListener(type, handler) {\n invariant(eventTypes.indexOf(type) !== -1, 'Trying to subscribe to unknown event: \"%s\"', type);\n\n if (type === 'change') {\n console.warn('Listening to event `change` is deprecated. Use `connectionChange` instead.');\n }\n\n if (!connection) {\n console.error('Network Connection API is not supported. Not listening for connection type changes.');\n return {\n remove: function remove() {}\n };\n }\n\n var wrappedHandler = function wrappedHandler() {\n return handler(getConnectionInfoObject());\n };\n\n netInfoListeners.push([handler, wrappedHandler]);\n connection.addEventListener(eventTypesMap[type], wrappedHandler);\n return {\n remove: function remove() {\n return NetInfo.removeEventListener(eventTypesMap[type], handler);\n }\n };\n },\n removeEventListener: function removeEventListener(type, handler) {\n invariant(eventTypes.indexOf(type) !== -1, 'Trying to unsubscribe from unknown event: \"%s\"', type);\n\n if (type === 'change') {\n console.warn('Listening to event `change` is deprecated. Use `connectionChange` instead.');\n }\n\n var listenerIndex = findIndex(netInfoListeners, function (pair) {\n return pair[0] === handler;\n });\n invariant(listenerIndex !== -1, 'Trying to remove NetInfo listener for unregistered handler');\n var _netInfoListeners$lis = netInfoListeners[listenerIndex],\n wrappedHandler = _netInfoListeners$lis[1];\n connection.removeEventListener(eventTypesMap[type], wrappedHandler);\n netInfoListeners.splice(listenerIndex, 1);\n },\n fetch: function fetch() {\n console.warn('`fetch` is deprecated. Use `getConnectionInfo` instead.');\n return new Promise(function (resolve, reject) {\n try {\n resolve(connection.type);\n } catch (err) {\n resolve('unknown');\n }\n });\n },\n getConnectionInfo: function getConnectionInfo() {\n return new Promise(function (resolve, reject) {\n resolve(getConnectionInfoObject());\n });\n },\n isConnected: {\n addEventListener: function addEventListener(type, handler) {\n invariant(eventTypes.indexOf(type) !== -1, 'Trying to subscribe to unknown event: \"%s\"', type);\n\n if (type === 'change') {\n console.warn('Listening to event `change` is deprecated. Use `connectionChange` instead.');\n }\n\n var onlineCallback = function onlineCallback() {\n return handler(true);\n };\n\n var offlineCallback = function offlineCallback() {\n return handler(false);\n };\n\n connectionListeners.push([handler, onlineCallback, offlineCallback]);\n window.addEventListener('online', onlineCallback, false);\n window.addEventListener('offline', offlineCallback, false);\n return {\n remove: function remove() {\n return NetInfo.isConnected.removeEventListener(eventTypesMap[type], handler);\n }\n };\n },\n removeEventListener: function removeEventListener(type, handler) {\n invariant(eventTypes.indexOf(type) !== -1, 'Trying to subscribe to unknown event: \"%s\"', type);\n\n if (type === 'change') {\n console.warn('Listening to event `change` is deprecated. Use `connectionChange` instead.');\n }\n\n var listenerIndex = findIndex(connectionListeners, function (pair) {\n return pair[0] === handler;\n });\n invariant(listenerIndex !== -1, 'Trying to remove NetInfo connection listener for unregistered handler');\n var _connectionListeners$ = connectionListeners[listenerIndex],\n onlineCallback = _connectionListeners$[1],\n offlineCallback = _connectionListeners$[2];\n window.removeEventListener('online', onlineCallback, false);\n window.removeEventListener('offline', offlineCallback, false);\n connectionListeners.splice(listenerIndex, 1);\n },\n fetch: function fetch() {\n return new Promise(function (resolve, reject) {\n try {\n resolve(window.navigator.onLine);\n } catch (err) {\n resolve(true);\n }\n });\n }\n }\n};\nexport default NetInfo;","var TouchHistoryMath = {\n /**\n * This code is optimized and not intended to look beautiful. This allows\n * computing of touch centroids that have moved after `touchesChangedAfter`\n * timeStamp. You can compute the current centroid involving all touches\n * moves after `touchesChangedAfter`, or you can compute the previous\n * centroid of all touches that were moved after `touchesChangedAfter`.\n *\n * @param {TouchHistoryMath} touchHistory Standard Responder touch track\n * data.\n * @param {number} touchesChangedAfter timeStamp after which moved touches\n * are considered \"actively moving\" - not just \"active\".\n * @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.\n * @param {boolean} ofCurrent Compute current centroid for actively moving\n * touches vs. previous centroid of now actively moving touches.\n * @return {number} value of centroid in specified dimension.\n */\n centroidDimension: function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {\n var touchBank = touchHistory.touchBank;\n var total = 0;\n var count = 0;\n var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;\n\n if (oneTouchData !== null) {\n if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {\n total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;\n count = 1;\n }\n } else {\n for (var i = 0; i < touchBank.length; i++) {\n var touchTrack = touchBank[i];\n\n if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {\n var toAdd = void 0; // Yuck, program temporarily in invalid state.\n\n if (ofCurrent && isXAxis) {\n toAdd = touchTrack.currentPageX;\n } else if (ofCurrent && !isXAxis) {\n toAdd = touchTrack.currentPageY;\n } else if (!ofCurrent && isXAxis) {\n toAdd = touchTrack.previousPageX;\n } else {\n toAdd = touchTrack.previousPageY;\n }\n\n total += toAdd;\n count++;\n }\n }\n }\n\n return count > 0 ? total / count : TouchHistoryMath.noCentroid;\n },\n currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis\n true);\n },\n currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis\n true);\n },\n previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis\n false);\n },\n previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {\n return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis\n false);\n },\n currentCentroidX: function currentCentroidX(touchHistory) {\n return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter\n true, // isXAxis\n true);\n },\n currentCentroidY: function currentCentroidY(touchHistory) {\n return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter\n false, // isXAxis\n true);\n },\n noCentroid: -1\n};\nexport default TouchHistoryMath;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport InteractionManager from '../../../exports/InteractionManager';\nimport TouchHistoryMath from '../TouchHistoryMath';\nvar currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;\nvar currentCentroidYOfTouchesChangedAfter = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;\nvar previousCentroidXOfTouchesChangedAfter = TouchHistoryMath.previousCentroidXOfTouchesChangedAfter;\nvar previousCentroidYOfTouchesChangedAfter = TouchHistoryMath.previousCentroidYOfTouchesChangedAfter;\nvar currentCentroidX = TouchHistoryMath.currentCentroidX;\nvar currentCentroidY = TouchHistoryMath.currentCentroidY;\n/**\n * `PanResponder` reconciles several touches into a single gesture. It makes\n * single-touch gestures resilient to extra touches, and can be used to\n * recognize simple multi-touch gestures.\n *\n * By default, `PanResponder` holds an `InteractionManager` handle to block\n * long-running JS events from interrupting active gestures.\n *\n * It provides a predictable wrapper of the responder handlers provided by the\n * [gesture responder system](docs/gesture-responder-system.html).\n * For each handler, it provides a new `gestureState` object alongside the\n * native event object:\n *\n * ```\n * onPanResponderMove: (event, gestureState) => {}\n * ```\n *\n * A native event is a synthetic touch event with the following form:\n *\n * - `nativeEvent`\n * + `changedTouches` - Array of all touch events that have changed since the last event\n * + `identifier` - The ID of the touch\n * + `locationX` - The X position of the touch, relative to the element\n * + `locationY` - The Y position of the touch, relative to the element\n * + `pageX` - The X position of the touch, relative to the root element\n * + `pageY` - The Y position of the touch, relative to the root element\n * + `target` - The node id of the element receiving the touch event\n * + `timestamp` - A time identifier for the touch, useful for velocity calculation\n * + `touches` - Array of all current touches on the screen\n *\n * A `gestureState` object has the following:\n *\n * - `stateID` - ID of the gestureState- persisted as long as there at least\n * one touch on screen\n * - `moveX` - the latest screen coordinates of the recently-moved touch\n * - `moveY` - the latest screen coordinates of the recently-moved touch\n * - `x0` - the screen coordinates of the responder grant\n * - `y0` - the screen coordinates of the responder grant\n * - `dx` - accumulated distance of the gesture since the touch started\n * - `dy` - accumulated distance of the gesture since the touch started\n * - `vx` - current velocity of the gesture\n * - `vy` - current velocity of the gesture\n * - `numberActiveTouches` - Number of touches currently on screen\n *\n * ### Basic Usage\n *\n * ```\n * componentWillMount: function() {\n * this._panResponder = PanResponder.create({\n * // Ask to be the responder:\n * onStartShouldSetPanResponder: (evt, gestureState) => true,\n * onStartShouldSetPanResponderCapture: (evt, gestureState) => true,\n * onMoveShouldSetPanResponder: (evt, gestureState) => true,\n * onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,\n *\n * onPanResponderGrant: (evt, gestureState) => {\n * // The gesture has started. Show visual feedback so the user knows\n * // what is happening!\n *\n * // gestureState.d{x,y} will be set to zero now\n * },\n * onPanResponderMove: (evt, gestureState) => {\n * // The most recent move distance is gestureState.move{X,Y}\n *\n * // The accumulated gesture distance since becoming responder is\n * // gestureState.d{x,y}\n * },\n * onPanResponderTerminationRequest: (evt, gestureState) => true,\n * onPanResponderRelease: (evt, gestureState) => {\n * // The user has released all touches while this view is the\n * // responder. This typically means a gesture has succeeded\n * },\n * onPanResponderTerminate: (evt, gestureState) => {\n * // Another component has become the responder, so this gesture\n * // should be cancelled\n * },\n * onShouldBlockNativeResponder: (evt, gestureState) => {\n * // Returns whether this component should block native components from becoming the JS\n * // responder. Returns true by default. Is currently only supported on android.\n * return true;\n * },\n * });\n * },\n *\n * render: function() {\n * return (\n * \n * );\n * },\n *\n * ```\n *\n * ### Working Example\n *\n * To see it in action, try the\n * [PanResponder example in RNTester](https://github.com/facebook/react-native/blob/master/RNTester/js/PanResponderExample.js)\n */\n\nvar PanResponder = {\n /**\n *\n * A graphical explanation of the touch data flow:\n *\n * +----------------------------+ +--------------------------------+\n * | ResponderTouchHistoryStore | |TouchHistoryMath |\n * +----------------------------+ +----------+---------------------+\n * |Global store of touchHistory| |Allocation-less math util |\n * |including activeness, start | |on touch history (centroids |\n * |position, prev/cur position.| |and multitouch movement etc) |\n * | | | |\n * +----^-----------------------+ +----^---------------------------+\n * | |\n * | (records relevant history |\n * | of touches relevant for |\n * | implementing higher level |\n * | gestures) |\n * | |\n * +----+-----------------------+ +----|---------------------------+\n * | ResponderEventPlugin | | | Your App/Component |\n * +----------------------------+ +----|---------------------------+\n * |Negotiates which view gets | Low level | | High level |\n * |onResponderMove events. | events w/ | +-+-------+ events w/ |\n * |Also records history into | touchHistory| | Pan | multitouch + |\n * |ResponderTouchHistoryStore. +---------------->Responder+-----> accumulative|\n * +----------------------------+ attached to | | | distance and |\n * each event | +---------+ velocity. |\n * | |\n * | |\n * +--------------------------------+\n *\n *\n *\n * Gesture that calculates cumulative movement over time in a way that just\n * \"does the right thing\" for multiple touches. The \"right thing\" is very\n * nuanced. When moving two touches in opposite directions, the cumulative\n * distance is zero in each dimension. When two touches move in parallel five\n * pixels in the same direction, the cumulative distance is five, not ten. If\n * two touches start, one moves five in a direction, then stops and the other\n * touch moves fives in the same direction, the cumulative distance is ten.\n *\n * This logic requires a kind of processing of time \"clusters\" of touch events\n * so that two touch moves that essentially occur in parallel but move every\n * other frame respectively, are considered part of the same movement.\n *\n * Explanation of some of the non-obvious fields:\n *\n * - moveX/moveY: If no move event has been observed, then `(moveX, moveY)` is\n * invalid. If a move event has been observed, `(moveX, moveY)` is the\n * centroid of the most recently moved \"cluster\" of active touches.\n * (Currently all move have the same timeStamp, but later we should add some\n * threshold for what is considered to be \"moving\"). If a palm is\n * accidentally counted as a touch, but a finger is moving greatly, the palm\n * will move slightly, but we only want to count the single moving touch.\n * - x0/y0: Centroid location (non-cumulative) at the time of becoming\n * responder.\n * - dx/dy: Cumulative touch distance - not the same thing as sum of each touch\n * distance. Accounts for touch moves that are clustered together in time,\n * moving the same direction. Only valid when currently responder (otherwise,\n * it only represents the drag distance below the threshold).\n * - vx/vy: Velocity.\n */\n _initializeGestureState: function _initializeGestureState(gestureState) {\n gestureState.moveX = 0;\n gestureState.moveY = 0;\n gestureState.x0 = 0;\n gestureState.y0 = 0;\n gestureState.dx = 0;\n gestureState.dy = 0;\n gestureState.vx = 0;\n gestureState.vy = 0;\n gestureState.numberActiveTouches = 0; // All `gestureState` accounts for timeStamps up until:\n\n gestureState._accountsForMovesUpTo = 0;\n },\n\n /**\n * This is nuanced and is necessary. It is incorrect to continuously take all\n * active *and* recently moved touches, find the centroid, and track how that\n * result changes over time. Instead, we must take all recently moved\n * touches, and calculate how the centroid has changed just for those\n * recently moved touches, and append that change to an accumulator. This is\n * to (at least) handle the case where the user is moving three fingers, and\n * then one of the fingers stops but the other two continue.\n *\n * This is very different than taking all of the recently moved touches and\n * storing their centroid as `dx/dy`. For correctness, we must *accumulate\n * changes* in the centroid of recently moved touches.\n *\n * There is also some nuance with how we handle multiple moved touches in a\n * single event. With the way `ReactNativeEventEmitter` dispatches touches as\n * individual events, multiple touches generate two 'move' events, each of\n * them triggering `onResponderMove`. But with the way `PanResponder` works,\n * all of the gesture inference is performed on the first dispatch, since it\n * looks at all of the touches (even the ones for which there hasn't been a\n * native dispatch yet). Therefore, `PanResponder` does not call\n * `onResponderMove` passed the first dispatch. This diverges from the\n * typical responder callback pattern (without using `PanResponder`), but\n * avoids more dispatches than necessary.\n */\n _updateGestureStateOnMove: function _updateGestureStateOnMove(gestureState, touchHistory) {\n gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n gestureState.moveX = currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);\n gestureState.moveY = currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);\n var movedAfter = gestureState._accountsForMovesUpTo;\n var prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);\n var x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);\n var prevY = previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);\n var y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);\n var nextDX = gestureState.dx + (x - prevX);\n var nextDY = gestureState.dy + (y - prevY); // TODO: This must be filtered intelligently.\n\n var dt = touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;\n gestureState.vx = (nextDX - gestureState.dx) / dt;\n gestureState.vy = (nextDY - gestureState.dy) / dt;\n gestureState.dx = nextDX;\n gestureState.dy = nextDY;\n gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp;\n },\n\n /**\n * @param {object} config Enhanced versions of all of the responder callbacks\n * that provide not only the typical `ResponderSyntheticEvent`, but also the\n * `PanResponder` gesture state. Simply replace the word `Responder` with\n * `PanResponder` in each of the typical `onResponder*` callbacks. For\n * example, the `config` object would look like:\n *\n * - `onMoveShouldSetPanResponder: (e, gestureState) => {...}`\n * - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}`\n * - `onStartShouldSetPanResponder: (e, gestureState) => {...}`\n * - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}`\n * - `onPanResponderReject: (e, gestureState) => {...}`\n * - `onPanResponderGrant: (e, gestureState) => {...}`\n * - `onPanResponderStart: (e, gestureState) => {...}`\n * - `onPanResponderEnd: (e, gestureState) => {...}`\n * - `onPanResponderRelease: (e, gestureState) => {...}`\n * - `onPanResponderMove: (e, gestureState) => {...}`\n * - `onPanResponderTerminate: (e, gestureState) => {...}`\n * - `onPanResponderTerminationRequest: (e, gestureState) => {...}`\n * - `onShouldBlockNativeResponder: (e, gestureState) => {...}`\n *\n * In general, for events that have capture equivalents, we update the\n * gestureState once in the capture phase and can use it in the bubble phase\n * as well.\n *\n * Be careful with onStartShould* callbacks. They only reflect updated\n * `gestureState` for start/end events that bubble/capture to the Node.\n * Once the node is the responder, you can rely on every start/end event\n * being processed by the gesture and `gestureState` being updated\n * accordingly. (numberActiveTouches) may not be totally accurate unless you\n * are the responder.\n */\n create: function create(config) {\n var interactionState = {\n handle: null\n };\n var gestureState = {\n // Useful for debugging\n stateID: Math.random()\n };\n\n PanResponder._initializeGestureState(gestureState);\n\n var panHandlers = {\n onStartShouldSetResponder: function onStartShouldSetResponder(e) {\n return config.onStartShouldSetPanResponder === undefined ? false : config.onStartShouldSetPanResponder(e, gestureState);\n },\n onMoveShouldSetResponder: function onMoveShouldSetResponder(e) {\n return config.onMoveShouldSetPanResponder === undefined ? false : config.onMoveShouldSetPanResponder(e, gestureState);\n },\n onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture(e) {\n // TODO: Actually, we should reinitialize the state any time\n // touches.length increases from 0 active to > 0 active.\n if (e.nativeEvent.touches.length === 1) {\n PanResponder._initializeGestureState(gestureState);\n }\n\n gestureState.numberActiveTouches = e.touchHistory.numberActiveTouches;\n return config.onStartShouldSetPanResponderCapture !== undefined ? config.onStartShouldSetPanResponderCapture(e, gestureState) : false;\n },\n onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture(e) {\n var touchHistory = e.touchHistory; // Responder system incorrectly dispatches should* to current responder\n // Filter out any touch moves past the first one - we would have\n // already processed multi-touch geometry during the first event.\n\n if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {\n return false;\n }\n\n PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n\n return config.onMoveShouldSetPanResponderCapture ? config.onMoveShouldSetPanResponderCapture(e, gestureState) : false;\n },\n onResponderGrant: function onResponderGrant(e) {\n if (!interactionState.handle) {\n interactionState.handle = InteractionManager.createInteractionHandle();\n }\n\n gestureState.x0 = currentCentroidX(e.touchHistory);\n gestureState.y0 = currentCentroidY(e.touchHistory);\n gestureState.dx = 0;\n gestureState.dy = 0;\n\n if (config.onPanResponderGrant) {\n config.onPanResponderGrant(e, gestureState);\n } // TODO: t7467124 investigate if this can be removed\n\n\n return config.onShouldBlockNativeResponder === undefined ? true : config.onShouldBlockNativeResponder();\n },\n onResponderReject: function onResponderReject(e) {\n clearInteractionHandle(interactionState, config.onPanResponderReject, e, gestureState);\n },\n onResponderRelease: function onResponderRelease(e) {\n clearInteractionHandle(interactionState, config.onPanResponderRelease, e, gestureState);\n\n PanResponder._initializeGestureState(gestureState);\n },\n onResponderStart: function onResponderStart(e) {\n var touchHistory = e.touchHistory;\n gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n\n if (config.onPanResponderStart) {\n config.onPanResponderStart(e, gestureState);\n }\n },\n onResponderMove: function onResponderMove(e) {\n var touchHistory = e.touchHistory; // Guard against the dispatch of two touch moves when there are two\n // simultaneously changed touches.\n\n if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {\n return;\n } // Filter out any touch moves past the first one - we would have\n // already processed multi-touch geometry during the first event.\n\n\n PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n\n if (config.onPanResponderMove) {\n config.onPanResponderMove(e, gestureState);\n }\n },\n onResponderEnd: function onResponderEnd(e) {\n var touchHistory = e.touchHistory;\n gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n clearInteractionHandle(interactionState, config.onPanResponderEnd, e, gestureState);\n },\n onResponderTerminate: function onResponderTerminate(e) {\n clearInteractionHandle(interactionState, config.onPanResponderTerminate, e, gestureState);\n\n PanResponder._initializeGestureState(gestureState);\n },\n onResponderTerminationRequest: function onResponderTerminationRequest(e) {\n return config.onPanResponderTerminationRequest === undefined ? true : config.onPanResponderTerminationRequest(e, gestureState);\n }\n };\n return {\n panHandlers: panHandlers,\n getInteractionHandle: function getInteractionHandle() {\n return interactionState.handle;\n }\n };\n }\n};\n\nfunction clearInteractionHandle(interactionState, callback, event, gestureState) {\n if (interactionState.handle) {\n InteractionManager.clearInteractionHandle(interactionState.handle);\n interactionState.handle = null;\n }\n\n if (callback) {\n callback(event, gestureState);\n }\n}\n\nexport default PanResponder;","import PanResponder from '../../vendor/react-native/PanResponder';\nexport default PanResponder;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport Dimensions from '../Dimensions';\n/**\n * PixelRatio gives access to the device pixel density.\n */\n\nvar PixelRatio =\n/*#__PURE__*/\nfunction () {\n function PixelRatio() {}\n /**\n * Returns the device pixel density.\n */\n\n\n PixelRatio.get = function get() {\n return Dimensions.get('window').scale;\n }\n /**\n * No equivalent for Web\n */\n ;\n\n PixelRatio.getFontScale = function getFontScale() {\n return Dimensions.get('window').fontScale || PixelRatio.get();\n }\n /**\n * Converts a layout size (dp) to pixel size (px).\n * Guaranteed to return an integer number.\n */\n ;\n\n PixelRatio.getPixelSizeForLayoutSize = function getPixelSizeForLayoutSize(layoutSize) {\n return Math.round(layoutSize * PixelRatio.get());\n }\n /**\n * Rounds a layout size (dp) to the nearest layout size that corresponds to\n * an integer number of pixels. For example, on a device with a PixelRatio\n * of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to\n * exactly (8.33 * 3) = 25 pixels.\n */\n ;\n\n PixelRatio.roundToNearestPixel = function roundToNearestPixel(layoutSize) {\n var ratio = PixelRatio.get();\n return Math.round(layoutSize * ratio) / ratio;\n };\n\n return PixelRatio;\n}();\n\nexport { PixelRatio as default };","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport invariant from 'fbjs/lib/invariant';\n\nvar Share =\n/*#__PURE__*/\nfunction () {\n function Share() {}\n\n Share.share = function share(content, options) {\n if (options === void 0) {\n options = {};\n }\n\n invariant(typeof content === 'object' && content !== null, 'Content to share must be a valid object');\n invariant(typeof content.url === 'string' || typeof content.message === 'string', 'At least one of URL and message is required');\n invariant(typeof options === 'object' && options !== null, 'Options must be a valid object');\n invariant(!content.title || typeof content.title === 'string', 'Invalid title: title should be a string.');\n\n if (window.navigator.share !== undefined) {\n return window.navigator.share({\n title: content.title,\n text: content.message,\n url: content.url\n });\n } else {\n return Promise.reject(new Error('Share is not supported in this browser'));\n }\n }\n /**\n * The content was successfully shared.\n */\n ;\n\n _createClass(Share, null, [{\n key: \"sharedAction\",\n get: function get() {\n return 'sharedAction';\n }\n /**\n * The dialog has been dismissed.\n * @platform ios\n */\n\n }, {\n key: \"dismissedAction\",\n get: function get() {\n return 'dismissedAction';\n }\n }]);\n\n return Share;\n}();\n\nexport default Share;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar _vibrate = function vibrate(pattern) {\n if ('vibrate' in window.navigator) {\n window.navigator.vibrate(pattern);\n }\n};\n\nvar Vibration = {\n cancel: function cancel() {\n _vibrate(0);\n },\n vibrate: function vibrate(pattern) {\n if (pattern === void 0) {\n pattern = 400;\n }\n\n _vibrate(pattern);\n }\n};\nexport default Vibration;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport { bool, number, oneOf, oneOfType, string } from 'prop-types';\nimport React, { Component } from 'react';\n\nvar createSvgCircle = function createSvgCircle(style) {\n return React.createElement(\"circle\", {\n cx: \"16\",\n cy: \"16\",\n fill: \"none\",\n r: \"14\",\n strokeWidth: \"4\",\n style: style\n });\n};\n\nvar ActivityIndicator =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ActivityIndicator, _Component);\n\n function ActivityIndicator() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = ActivityIndicator.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n animating = _this$props.animating,\n color = _this$props.color,\n hidesWhenStopped = _this$props.hidesWhenStopped,\n size = _this$props.size,\n style = _this$props.style,\n other = _objectWithoutPropertiesLoose(_this$props, [\"animating\", \"color\", \"hidesWhenStopped\", \"size\", \"style\"]);\n\n var svg = React.createElement(\"svg\", {\n height: \"100%\",\n viewBox: \"0 0 32 32\",\n width: \"100%\"\n }, createSvgCircle({\n stroke: color,\n opacity: 0.2\n }), createSvgCircle({\n stroke: color,\n strokeDasharray: 80,\n strokeDashoffset: 60\n }));\n return React.createElement(View, _extends({}, other, {\n accessibilityRole: \"progressbar\",\n \"aria-valuemax\": \"1\",\n \"aria-valuemin\": \"0\",\n style: [styles.container, style]\n }), React.createElement(View, {\n children: svg,\n style: [typeof size === 'number' ? {\n height: size,\n width: size\n } : indicatorSizes[size], styles.animation, !animating && styles.animationPause, !animating && hidesWhenStopped && styles.hidesWhenStopped]\n }));\n };\n\n return ActivityIndicator;\n}(Component);\n\nActivityIndicator.displayName = 'ActivityIndicator';\nActivityIndicator.defaultProps = {\n animating: true,\n color: '#1976D2',\n hidesWhenStopped: true,\n size: 'small'\n};\nActivityIndicator.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n animating: bool,\n color: string,\n hidesWhenStopped: bool,\n size: oneOfType([oneOf(['small', 'large']), number])\n}) : {};\nvar styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center'\n },\n hidesWhenStopped: {\n visibility: 'hidden'\n },\n animation: {\n animationDuration: '0.75s',\n animationKeyframes: [{\n '0%': {\n transform: [{\n rotate: '0deg'\n }]\n },\n '100%': {\n transform: [{\n rotate: '360deg'\n }]\n }\n }],\n animationTimingFunction: 'linear',\n animationIterationCount: 'infinite'\n },\n animationPause: {\n animationPlayState: 'paused'\n }\n});\nvar indicatorSizes = StyleSheet.create({\n small: {\n width: 20,\n height: 20\n },\n large: {\n width: 36,\n height: 36\n }\n});\nexport default applyNativeMethods(ActivityIndicator);","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport invariant from 'fbjs/lib/invariant';\n\nvar ensurePositiveDelayProps = function ensurePositiveDelayProps(props) {\n invariant(!(props.delayPressIn < 0 || props.delayPressOut < 0 || props.delayLongPress < 0), 'Touchable components cannot have negative delay properties');\n};\n\nexport default ensurePositiveDelayProps;","/* eslint-disable */\n\n/**\n * Copyright 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.0.0\n */\nimport invariant from 'fbjs/lib/invariant';\n\nvar twoArgumentPooler = function twoArgumentPooler(a1, a2) {\n var Klass = this;\n\n if (Klass.instancePool.length) {\n var instance = Klass.instancePool.pop();\n Klass.call(instance, a1, a2);\n return instance;\n } else {\n return new Klass(a1, a2);\n }\n};\n\nvar standardReleaser = function standardReleaser(instance) {\n var Klass = this;\n instance.destructor();\n\n if (Klass.instancePool.length < Klass.poolSize) {\n Klass.instancePool.push(instance);\n }\n};\n\nvar DEFAULT_POOL_SIZE = 10;\nvar DEFAULT_POOLER = twoArgumentPooler;\n/**\n * Augments `CopyConstructor` to be a poolable class, augmenting only the class\n * itself (statically) not adding any prototypical fields. Any CopyConstructor\n * you give this may have a `poolSize` property, and will look for a\n * prototypical `destructor` on instances.\n *\n * @param {Function} CopyConstructor Constructor that can be used to reset.\n * @param {Function} pooler Customizable pooler.\n */\n\nvar addPoolingTo = function addPoolingTo(CopyConstructor, pooler) {\n // Casting as any so that flow ignores the actual implementation and trusts\n // it to match the type we declared\n var NewKlass = CopyConstructor;\n NewKlass.instancePool = [];\n NewKlass.getPooled = pooler || DEFAULT_POOLER;\n\n if (!NewKlass.poolSize) {\n NewKlass.poolSize = DEFAULT_POOL_SIZE;\n }\n\n NewKlass.release = standardReleaser;\n return NewKlass;\n};\n\nvar PooledClass = {\n addPoolingTo: addPoolingTo,\n twoArgumentPooler: twoArgumentPooler\n};\nexport default PooledClass;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport PooledClass from '../../vendor/react-native/PooledClass';\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\n/**\n * PooledClass representing the bounding rectangle of a region.\n */\n\nfunction BoundingDimensions(width, height) {\n this.width = width;\n this.height = height;\n}\n\nBoundingDimensions.prototype.destructor = function () {\n this.width = null;\n this.height = null;\n};\n\nBoundingDimensions.getPooledFromElement = function (element) {\n return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight);\n};\n\nPooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler);\nexport default BoundingDimensions;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport PooledClass from '../../vendor/react-native/PooledClass';\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\n\nfunction Position(left, top) {\n this.left = left;\n this.top = top;\n}\n\nPosition.prototype.destructor = function () {\n this.left = null;\n this.top = null;\n};\n\nPooledClass.addPoolingTo(Position, twoArgumentPooler);\nexport default Position;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/* eslint-disable react/prop-types */\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport AccessibilityUtil from '../../modules/AccessibilityUtil';\nimport BoundingDimensions from './BoundingDimensions';\nimport findNodeHandle from '../findNodeHandle';\nimport normalizeColor from 'normalize-css-color';\nimport Position from './Position';\nimport React from 'react';\nimport TouchEventUtils from 'fbjs/lib/TouchEventUtils';\nimport UIManager from '../UIManager';\nimport View from '../View';\n/**\n * `Touchable`: Taps done right.\n *\n * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable`\n * will measure time/geometry and tells you when to give feedback to the user.\n *\n * ====================== Touchable Tutorial ===============================\n * The `Touchable` mixin helps you handle the \"press\" interaction. It analyzes\n * the geometry of elements, and observes when another responder (scroll view\n * etc) has stolen the touch lock. It notifies your component when it should\n * give feedback to the user. (bouncing/highlighting/unhighlighting).\n *\n * - When a touch was activated (typically you highlight)\n * - When a touch was deactivated (typically you unhighlight)\n * - When a touch was \"pressed\" - a touch ended while still within the geometry\n * of the element, and no other element (like scroller) has \"stolen\" touch\n * lock (\"responder\") (Typically you bounce the element).\n *\n * A good tap interaction isn't as simple as you might think. There should be a\n * slight delay before showing a highlight when starting a touch. If a\n * subsequent touch move exceeds the boundary of the element, it should\n * unhighlight, but if that same touch is brought back within the boundary, it\n * should rehighlight again. A touch can move in and out of that boundary\n * several times, each time toggling highlighting, but a \"press\" is only\n * triggered if that touch ends while within the element's boundary and no\n * scroller (or anything else) has stolen the lock on touches.\n *\n * To create a new type of component that handles interaction using the\n * `Touchable` mixin, do the following:\n *\n * - Initialize the `Touchable` state.\n *\n * getInitialState: function() {\n * return merge(this.touchableGetInitialState(), yourComponentState);\n * }\n *\n * - Choose the rendered component who's touches should start the interactive\n * sequence. On that rendered node, forward all `Touchable` responder\n * handlers. You can choose any rendered node you like. Choose a node whose\n * hit target you'd like to instigate the interaction sequence:\n *\n * // In render function:\n * return (\n * \n * \n * Even though the hit detection/interactions are triggered by the\n * wrapping (typically larger) node, we usually end up implementing\n * custom logic that highlights this inner one.\n * \n * \n * );\n *\n * - You may set up your own handlers for each of these events, so long as you\n * also invoke the `touchable*` handlers inside of your custom handler.\n *\n * - Implement the handlers on your component class in order to provide\n * feedback to the user. See documentation for each of these class methods\n * that you should implement.\n *\n * touchableHandlePress: function() {\n * this.performBounceAnimation(); // or whatever you want to do.\n * },\n * touchableHandleActivePressIn: function() {\n * this.beginHighlighting(...); // Whatever you like to convey activation\n * },\n * touchableHandleActivePressOut: function() {\n * this.endHighlighting(...); // Whatever you like to convey deactivation\n * },\n *\n * - There are more advanced methods you can implement (see documentation below):\n * touchableGetHighlightDelayMS: function() {\n * return 20;\n * }\n * // In practice, *always* use a predeclared constant (conserve memory).\n * touchableGetPressRectOffset: function() {\n * return {top: 20, left: 20, right: 20, bottom: 100};\n * }\n */\n\n/**\n * Touchable states.\n */\n\nvar States = {\n NOT_RESPONDER: 'NOT_RESPONDER',\n // Not the responder\n RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN',\n // Responder, inactive, in the `PressRect`\n RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT',\n // Responder, inactive, out of `PressRect`\n RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN',\n // Responder, active, in the `PressRect`\n RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT',\n // Responder, active, out of `PressRect`\n RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n // Responder, active, in the `PressRect`, after long press threshold\n RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',\n // Responder, active, out of `PressRect`, after long press threshold\n ERROR: 'ERROR'\n};\n/**\n * Quick lookup map for states that are considered to be \"active\"\n */\n\nvar IsActive = {\n RESPONDER_ACTIVE_PRESS_OUT: true,\n RESPONDER_ACTIVE_PRESS_IN: true\n};\n/**\n * Quick lookup for states that are considered to be \"pressing\" and are\n * therefore eligible to result in a \"selection\" if the press stops.\n */\n\nvar IsPressingIn = {\n RESPONDER_INACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_LONG_PRESS_IN: true\n};\nvar IsLongPressingIn = {\n RESPONDER_ACTIVE_LONG_PRESS_IN: true\n};\n/**\n * Inputs to the state machine.\n */\n\nvar Signals = {\n DELAY: 'DELAY',\n RESPONDER_GRANT: 'RESPONDER_GRANT',\n RESPONDER_RELEASE: 'RESPONDER_RELEASE',\n RESPONDER_TERMINATED: 'RESPONDER_TERMINATED',\n ENTER_PRESS_RECT: 'ENTER_PRESS_RECT',\n LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT',\n LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED'\n};\n/**\n * Mapping from States x Signals => States\n */\n\nvar Transitions = {\n NOT_RESPONDER: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,\n RESPONDER_RELEASE: States.ERROR,\n RESPONDER_TERMINATED: States.ERROR,\n ENTER_PRESS_RECT: States.ERROR,\n LEAVE_PRESS_RECT: States.ERROR,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_INACTIVE_PRESS_IN: {\n DELAY: States.RESPONDER_ACTIVE_PRESS_IN,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_INACTIVE_PRESS_OUT: {\n DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_ACTIVE_PRESS_IN: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN\n },\n RESPONDER_ACTIVE_PRESS_OUT: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_ACTIVE_LONG_PRESS_IN: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,\n LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN\n },\n RESPONDER_ACTIVE_LONG_PRESS_OUT: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n error: {\n DELAY: States.NOT_RESPONDER,\n RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.NOT_RESPONDER,\n LEAVE_PRESS_RECT: States.NOT_RESPONDER,\n LONG_PRESS_DETECTED: States.NOT_RESPONDER\n }\n}; // ==== Typical Constants for integrating into UI components ====\n// var HIT_EXPAND_PX = 20;\n// var HIT_VERT_OFFSET_PX = 10;\n\nvar HIGHLIGHT_DELAY_MS = 130;\nvar PRESS_EXPAND_PX = 20;\nvar LONG_PRESS_THRESHOLD = 500;\nvar LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;\nvar LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount \"active\" region protrudes beyond box\n\n/**\n * By convention, methods prefixed with underscores are meant to be @private,\n * and not @protected. Mixers shouldn't access them - not even to provide them\n * as callback handlers.\n *\n *\n * ========== Geometry =========\n * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect`\n * is an abstract box that is extended beyond the `HitRect`.\n *\n * +--------------------------+\n * | | - \"Start\" events in `HitRect` cause `HitRect`\n * | +--------------------+ | to become the responder.\n * | | +--------------+ | | - `HitRect` is typically expanded around\n * | | | | | | the `VisualRect`, but shifted downward.\n * | | | VisualRect | | | - After pressing down, after some delay,\n * | | | | | | and before letting up, the Visual React\n * | | +--------------+ | | will become \"active\". This makes it eligible\n * | | HitRect | | for being highlighted (so long as the\n * | +--------------------+ | press remains in the `PressRect`).\n * | PressRect o |\n * +----------------------|---+\n * Out Region |\n * +-----+ This gap between the `HitRect` and\n * `PressRect` allows a touch to move far away\n * from the original hit rect, and remain\n * highlighted, and eligible for a \"Press\".\n * Customize this via\n * `touchableGetPressRectOffset()`.\n *\n *\n *\n * ======= State Machine =======\n *\n * +-------------+ <---+ RESPONDER_RELEASE\n * |NOT_RESPONDER|\n * +-------------+ <---+ RESPONDER_TERMINATED\n * +\n * | RESPONDER_GRANT (HitRect)\n * v\n * +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+\n * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN|\n * +---------------------------+ +-------------------------+ +------------------------------+\n * + ^ + ^ + ^\n * |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_\n * |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT\n * | | | | | |\n * v + v + v +\n * +----------------------------+ DELAY +--------------------------+ +-------------------------------+\n * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT|\n * +----------------------------+ +--------------------------+ +-------------------------------+\n *\n * T + DELAY => LONG_PRESS_DELAY_MS + DELAY\n *\n * Not drawn are the side effects of each transition. The most important side\n * effect is the `touchableHandlePress` abstract method invocation that occurs\n * when a responder is released while in either of the \"Press\" states.\n *\n * The other important side effects are the highlight abstract method\n * invocations (internal callbacks) to be implemented by the mixer.\n *\n *\n * @lends Touchable.prototype\n */\n\nvar TouchableMixin = {\n // HACK (part 1): basic support for touchable interactions using a keyboard\n componentDidMount: function componentDidMount() {\n var _this = this;\n\n this._touchableNode = findNodeHandle(this);\n\n if (this._touchableNode && this._touchableNode.addEventListener) {\n this._touchableBlurListener = function (e) {\n if (_this._isTouchableKeyboardActive) {\n if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) {\n _this.touchableHandleResponderTerminate({\n nativeEvent: e\n });\n }\n\n _this._isTouchableKeyboardActive = false;\n }\n };\n\n this._touchableNode.addEventListener('blur', this._touchableBlurListener);\n }\n },\n\n /**\n * Clear all timeouts on unmount\n */\n componentWillUnmount: function componentWillUnmount() {\n if (this._touchableNode && this._touchableNode.addEventListener) {\n this._touchableNode.removeEventListener('blur', this._touchableBlurListener);\n }\n\n this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\n },\n\n /**\n * It's prefer that mixins determine state in this way, having the class\n * explicitly mix the state in the one and only `getInitialState` method.\n *\n * @return {object} State object to be placed inside of\n * `this.state.touchable`.\n */\n touchableGetInitialState: function touchableGetInitialState() {\n return {\n touchable: {\n touchState: undefined,\n responderID: null\n }\n };\n },\n // ==== Hooks to Gesture Responder system ====\n\n /**\n * Must return true if embedded in a native platform scroll view.\n */\n touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() {\n return !this.props.rejectResponderTermination;\n },\n\n /**\n * Must return true to start the process of `Touchable`.\n */\n touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() {\n return !this.props.disabled;\n },\n\n /**\n * Return true to cancel press on long press.\n */\n touchableLongPressCancelsPress: function touchableLongPressCancelsPress() {\n return true;\n },\n\n /**\n * Place as callback for a DOM element's `onResponderGrant` event.\n */\n touchableHandleResponderGrant: function touchableHandleResponderGrant(e) {\n var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop\n // (as in setTimeout etc), we need to call e.persist() on the\n // event to make sure it doesn't get reused in the event object pool.\n\n e.persist();\n this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\n this.pressOutDelayTimeout = null;\n this.state.touchable.touchState = States.NOT_RESPONDER;\n this.state.touchable.responderID = dispatchID;\n\n this._receiveSignal(Signals.RESPONDER_GRANT, e);\n\n var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;\n delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;\n\n if (delayMS !== 0) {\n this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);\n } else {\n this.state.touchable.positionOnActivate = null;\n\n this._handleDelay(e);\n }\n\n var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;\n longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;\n this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);\n },\n\n /**\n * Place as callback for a DOM element's `onResponderRelease` event.\n */\n touchableHandleResponderRelease: function touchableHandleResponderRelease(e) {\n this._receiveSignal(Signals.RESPONDER_RELEASE, e);\n },\n\n /**\n * Place as callback for a DOM element's `onResponderTerminate` event.\n */\n touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) {\n this._receiveSignal(Signals.RESPONDER_TERMINATED, e);\n },\n\n /**\n * Place as callback for a DOM element's `onResponderMove` event.\n */\n touchableHandleResponderMove: function touchableHandleResponderMove(e) {\n // Not enough time elapsed yet, wait for highlight -\n // this is just a perf optimization.\n if (this.state.touchable.touchState === States.RESPONDER_INACTIVE_PRESS_IN) {\n return;\n } // Measurement may not have returned yet.\n\n\n if (!this.state.touchable.positionOnActivate) {\n return;\n }\n\n var positionOnActivate = this.state.touchable.positionOnActivate;\n var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;\n var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {\n left: PRESS_EXPAND_PX,\n right: PRESS_EXPAND_PX,\n top: PRESS_EXPAND_PX,\n bottom: PRESS_EXPAND_PX\n };\n var pressExpandLeft = pressRectOffset.left;\n var pressExpandTop = pressRectOffset.top;\n var pressExpandRight = pressRectOffset.right;\n var pressExpandBottom = pressRectOffset.bottom;\n var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;\n\n if (hitSlop) {\n pressExpandLeft += hitSlop.left;\n pressExpandTop += hitSlop.top;\n pressExpandRight += hitSlop.right;\n pressExpandBottom += hitSlop.bottom;\n }\n\n var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n var pageX = touch && touch.pageX;\n var pageY = touch && touch.pageY;\n\n if (this.pressInLocation) {\n var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);\n\n if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {\n this._cancelLongPressDelayTimeout();\n }\n }\n\n var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;\n\n if (isTouchWithinActive) {\n this._receiveSignal(Signals.ENTER_PRESS_RECT, e);\n\n var curState = this.state.touchable.touchState;\n\n if (curState === States.RESPONDER_INACTIVE_PRESS_IN) {\n // fix for t7967420\n this._cancelLongPressDelayTimeout();\n }\n } else {\n this._cancelLongPressDelayTimeout();\n\n this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);\n }\n },\n // ==== Abstract Application Callbacks ====\n\n /**\n * Invoked when the item should be highlighted. Mixers should implement this\n * to visually distinguish the `VisualRect` so that the user knows that\n * releasing a touch will result in a \"selection\" (analog to click).\n *\n * @abstract\n * touchableHandleActivePressIn: function,\n */\n\n /**\n * Invoked when the item is \"active\" (in that it is still eligible to become\n * a \"select\") but the touch has left the `PressRect`. Usually the mixer will\n * want to unhighlight the `VisualRect`. If the user (while pressing) moves\n * back into the `PressRect` `touchableHandleActivePressIn` will be invoked\n * again and the mixer should probably highlight the `VisualRect` again. This\n * event will not fire on an `touchEnd/mouseUp` event, only move events while\n * the user is depressing the mouse/touch.\n *\n * @abstract\n * touchableHandleActivePressOut: function\n */\n\n /**\n * Invoked when the item is \"selected\" - meaning the interaction ended by\n * letting up while the item was either in the state\n * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.\n *\n * @abstract\n * touchableHandlePress: function\n */\n\n /**\n * Invoked when the item is long pressed - meaning the interaction ended by\n * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If\n * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will\n * be called as it normally is. If `touchableHandleLongPress` is provided, by\n * default any `touchableHandlePress` callback will not be invoked. To\n * override this default behavior, override `touchableLongPressCancelsPress`\n * to return false. As a result, `touchableHandlePress` will be called when\n * lifting up, even if `touchableHandleLongPress` has also been called.\n *\n * @abstract\n * touchableHandleLongPress: function\n */\n\n /**\n * Returns the number of millis to wait before triggering a highlight.\n *\n * @abstract\n * touchableGetHighlightDelayMS: function\n */\n\n /**\n * Returns the amount to extend the `HitRect` into the `PressRect`. Positive\n * numbers mean the size expands outwards.\n *\n * @abstract\n * touchableGetPressRectOffset: function\n */\n // ==== Internal Logic ====\n\n /**\n * Measures the `HitRect` node on activation. The Bounding rectangle is with\n * respect to viewport - not page, so adding the `pageXOffset/pageYOffset`\n * should result in points that are in the same coordinate system as an\n * event's `globalX/globalY` data values.\n *\n * - Consider caching this for the lifetime of the component, or possibly\n * being able to share this cache between any `ScrollMap` view.\n *\n * @sideeffects\n * @private\n */\n _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() {\n var tag = this.state.touchable.responderID;\n\n if (tag == null) {\n return;\n }\n\n UIManager.measure(tag, this._handleQueryLayout);\n },\n _handleQueryLayout: function _handleQueryLayout(x, y, width, height, globalX, globalY) {\n // don't do anything if UIManager failed to measure node\n if (!x && !y && !width && !height && !globalX && !globalY) {\n return;\n }\n\n this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate);\n this.state.touchable.dimensionsOnActivate && // $FlowFixMe\n BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);\n this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe\n\n this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(width, height);\n },\n _handleDelay: function _handleDelay(e) {\n this.touchableDelayTimeout = null;\n\n this._receiveSignal(Signals.DELAY, e);\n },\n _handleLongDelay: function _handleLongDelay(e) {\n this.longPressDelayTimeout = null;\n var curState = this.state.touchable.touchState;\n\n if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {\n console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');\n } else {\n this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);\n }\n },\n\n /**\n * Receives a state machine signal, performs side effects of the transition\n * and stores the new state. Validates the transition as well.\n *\n * @param {Signals} signal State machine signal.\n * @throws Error if invalid state transition or unrecognized signal.\n * @sideeffects\n */\n _receiveSignal: function _receiveSignal(signal, e) {\n var responderID = this.state.touchable.responderID;\n var curState = this.state.touchable.touchState;\n var nextState = Transitions[curState] && Transitions[curState][signal];\n\n if (!responderID && signal === Signals.RESPONDER_RELEASE) {\n return;\n }\n\n if (!nextState) {\n throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`');\n }\n\n if (nextState === States.ERROR) {\n throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`');\n }\n\n if (curState !== nextState) {\n this._performSideEffectsForTransition(curState, nextState, signal, e);\n\n this.state.touchable.touchState = nextState;\n }\n },\n _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() {\n this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n this.longPressDelayTimeout = null;\n },\n _isHighlight: function _isHighlight(state) {\n return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;\n },\n _savePressInLocation: function _savePressInLocation(e) {\n var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n var pageX = touch && touch.pageX;\n var pageY = touch && touch.pageY;\n this.pressInLocation = {\n pageX: pageX,\n pageY: pageY,\n\n get locationX() {\n return touch && touch.locationX;\n },\n\n get locationY() {\n return touch && touch.locationY;\n }\n\n };\n },\n _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) {\n var deltaX = aX - bX;\n var deltaY = aY - bY;\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n },\n\n /**\n * Will perform a transition between touchable states, and identify any\n * highlighting or unhighlighting that must be performed for this particular\n * transition.\n *\n * @param {States} curState Current Touchable state.\n * @param {States} nextState Next Touchable state.\n * @param {Signal} signal Signal that triggered the transition.\n * @param {Event} e Native event.\n * @sideeffects\n */\n _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) {\n var curIsHighlight = this._isHighlight(curState);\n\n var newIsHighlight = this._isHighlight(nextState);\n\n var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;\n\n if (isFinalSignal) {\n this._cancelLongPressDelayTimeout();\n }\n\n if (!IsActive[curState] && IsActive[nextState]) {\n this._remeasureMetricsOnActivation();\n }\n\n if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {\n this.touchableHandleLongPress && this.touchableHandleLongPress(e);\n }\n\n if (newIsHighlight && !curIsHighlight) {\n this._startHighlight(e);\n } else if (!newIsHighlight && curIsHighlight) {\n this._endHighlight(e);\n }\n\n if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {\n var hasLongPressHandler = !!this.props.onLongPress;\n var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing..\n !hasLongPressHandler || // But either has no long handler\n !this.touchableLongPressCancelsPress()); // or we're told to ignore it.\n\n var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;\n\n if (shouldInvokePress && this.touchableHandlePress) {\n if (!newIsHighlight && !curIsHighlight) {\n // we never highlighted because of delay, but we should highlight now\n this._startHighlight(e);\n\n this._endHighlight(e);\n }\n\n this.touchableHandlePress(e);\n }\n }\n\n this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n this.touchableDelayTimeout = null;\n },\n _startHighlight: function _startHighlight(e) {\n this._savePressInLocation(e);\n\n this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);\n },\n _endHighlight: function _endHighlight(e) {\n var _this2 = this;\n\n if (this.touchableHandleActivePressOut) {\n if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {\n this.pressOutDelayTimeout = setTimeout(function () {\n _this2.touchableHandleActivePressOut(e);\n }, this.touchableGetPressOutDelayMS());\n } else {\n this.touchableHandleActivePressOut(e);\n }\n }\n },\n // HACK (part 2): basic support for touchable interactions using a keyboard (including\n // delays and longPress)\n touchableHandleKeyEvent: function touchableHandleKeyEvent(e) {\n var ENTER = 13;\n var SPACE = 32;\n var type = e.type,\n which = e.which;\n\n if (which === ENTER || which === SPACE) {\n if (type === 'keydown') {\n if (!this._isTouchableKeyboardActive) {\n if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {\n this.touchableHandleResponderGrant(e);\n this._isTouchableKeyboardActive = true;\n }\n }\n } else if (type === 'keyup') {\n if (this._isTouchableKeyboardActive) {\n if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {\n this.touchableHandleResponderRelease(e);\n this._isTouchableKeyboardActive = false;\n }\n }\n }\n\n e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link\n // and Enter is pressed\n\n if (!(which === ENTER && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) {\n e.preventDefault();\n }\n }\n }\n};\nvar Touchable = {\n Mixin: TouchableMixin,\n TOUCH_TARGET_DEBUG: false,\n // Highlights all touchable targets. Toggle with Inspector.\n\n /**\n * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).\n */\n renderDebugView: function renderDebugView(_ref) {\n var color = _ref.color,\n hitSlop = _ref.hitSlop;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Touchable.TOUCH_TARGET_DEBUG) {\n return null;\n }\n\n var debugHitSlopStyle = {};\n hitSlop = hitSlop || {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n\n for (var key in hitSlop) {\n debugHitSlopStyle[key] = -hitSlop[key];\n }\n\n var hexColor = '#' + ('00000000' + normalizeColor(color).toString(16)).substr(-8);\n return React.createElement(View, {\n pointerEvents: \"none\",\n style: _objectSpread({\n position: 'absolute',\n borderColor: hexColor.slice(0, -2) + '55',\n // More opaque\n borderWidth: 1,\n borderStyle: 'dashed',\n backgroundColor: hexColor.slice(0, -2) + '0F'\n }, debugHitSlopStyle)\n });\n }\n }\n};\nexport default Touchable;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n/**\n * Copyright (c) 2016-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport createReactClass from 'create-react-class';\nimport EdgeInsetsPropType from '../EdgeInsetsPropType';\nimport ensurePositiveDelayProps from '../Touchable/ensurePositiveDelayProps';\nimport React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport TimerMixin from 'react-timer-mixin';\nimport Touchable from '../Touchable';\nimport ViewPropTypes from '../ViewPropTypes';\nimport warning from 'fbjs/lib/warning';\nimport { any, bool, func, number, string } from 'prop-types';\nvar PRESS_RETENTION_OFFSET = {\n top: 20,\n left: 20,\n right: 20,\n bottom: 30\n};\n/**\n * Do not use unless you have a very good reason. All elements that\n * respond to press should have a visual feedback when touched.\n *\n * TouchableWithoutFeedback supports only one child.\n * If you wish to have several child components, wrap them in a View.\n */\n\n/* eslint-disable react/prefer-es6-class, react/prop-types */\n\nvar TouchableWithoutFeedback = createReactClass({\n displayName: 'TouchableWithoutFeedback',\n mixins: [TimerMixin, Touchable.Mixin],\n propTypes: {\n accessibilityComponentType: ViewPropTypes.accessibilityComponentType,\n accessibilityLabel: string,\n accessibilityRole: ViewPropTypes.accessibilityRole,\n accessibilityTraits: ViewPropTypes.accessibilityTraits,\n accessible: bool,\n children: any,\n\n /**\n * Delay in ms, from onPressIn, before onLongPress is called.\n */\n delayLongPress: number,\n\n /**\n * Delay in ms, from the start of the touch, before onPressIn is called.\n */\n delayPressIn: number,\n\n /**\n * Delay in ms, from the release of the touch, before onPressOut is called.\n */\n delayPressOut: number,\n\n /**\n * If true, disable all interactions for this component.\n */\n disabled: bool,\n\n /**\n * This defines how far your touch can start away from the button. This is\n * added to `pressRetentionOffset` when moving off of the button.\n */\n // $FlowFixMe(>=0.41.0)\n hitSlop: EdgeInsetsPropType,\n\n /**\n * Invoked on mount and layout changes with\n *\n * `{nativeEvent: {layout: {x, y, width, height}}}`\n */\n onLayout: func,\n onLongPress: func,\n\n /**\n * Called when the touch is released, but not if cancelled (e.g. by a scroll\n * that steals the responder lock).\n */\n onPress: func,\n onPressIn: func,\n onPressOut: func,\n\n /**\n * When the scroll view is disabled, this defines how far your touch may\n * move off of the button, before deactivating the button. Once deactivated,\n * try moving it back and you'll see that the button is once again\n * reactivated! Move it back and forth several times while the scroll view\n * is disabled. Ensure you pass in a constant to reduce memory allocations.\n */\n // $FlowFixMe\n pressRetentionOffset: EdgeInsetsPropType,\n testID: string\n },\n getInitialState: function getInitialState() {\n return this.touchableGetInitialState();\n },\n componentDidMount: function componentDidMount() {\n ensurePositiveDelayProps(this.props);\n },\n componentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n ensurePositiveDelayProps(nextProps);\n },\n\n /**\n * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n * defined on your component.\n */\n touchableHandlePress: function touchableHandlePress(e) {\n this.props.onPress && this.props.onPress(e);\n },\n touchableHandleActivePressIn: function touchableHandleActivePressIn(e) {\n this.props.onPressIn && this.props.onPressIn(e);\n },\n touchableHandleActivePressOut: function touchableHandleActivePressOut(e) {\n this.props.onPressOut && this.props.onPressOut(e);\n },\n touchableHandleLongPress: function touchableHandleLongPress(e) {\n this.props.onLongPress && this.props.onLongPress(e);\n },\n touchableGetPressRectOffset: function touchableGetPressRectOffset() {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n },\n touchableGetHitSlop: function touchableGetHitSlop() {\n return this.props.hitSlop;\n },\n touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() {\n return this.props.delayPressIn || 0;\n },\n touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() {\n return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;\n },\n touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() {\n return this.props.delayPressOut || 0;\n },\n render: function render() {\n var _this$props = this.props,\n delayLongPress = _this$props.delayLongPress,\n delayPressIn = _this$props.delayPressIn,\n delayPressOut = _this$props.delayPressOut,\n onLongPress = _this$props.onLongPress,\n onPress = _this$props.onPress,\n onPressIn = _this$props.onPressIn,\n onPressOut = _this$props.onPressOut,\n pressRetentionOffset = _this$props.pressRetentionOffset,\n other = _objectWithoutPropertiesLoose(_this$props, [\"delayLongPress\", \"delayPressIn\", \"delayPressOut\", \"onLongPress\", \"onPress\", \"onPressIn\", \"onPressOut\", \"pressRetentionOffset\"]); // Note(avik): remove dynamic typecast once Flow has been upgraded\n // $FlowFixMe\n\n\n var child = React.Children.only(this.props.children);\n var children = child.props.children;\n warning(!child.type || child.type.displayName !== 'Text', 'TouchableWithoutFeedback does not work well with Text children. Wrap children in a View instead. See ' + (child._owner && child._owner.getName && child._owner.getName() || ''));\n\n if (process.env.NODE_ENV !== 'production' && Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'View') {\n children = React.Children.toArray(children);\n children.push(Touchable.renderDebugView({\n color: 'red',\n hitSlop: this.props.hitSlop\n }));\n }\n\n var style = Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text' ? [!this.props.disabled && styles.actionable, child.props.style, {\n color: 'red'\n }] : [!this.props.disabled && styles.actionable, child.props.style];\n return React.cloneElement(child, _objectSpread({}, other, {\n accessible: this.props.accessible !== false,\n children: children,\n onKeyDown: this.touchableHandleKeyEvent,\n onKeyUp: this.touchableHandleKeyEvent,\n onResponderGrant: this.touchableHandleResponderGrant,\n onResponderMove: this.touchableHandleResponderMove,\n onResponderRelease: this.touchableHandleResponderRelease,\n onResponderTerminate: this.touchableHandleResponderTerminate,\n onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,\n onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,\n style: style\n }));\n }\n});\nvar styles = StyleSheet.create({\n actionable: {\n cursor: 'pointer',\n touchAction: 'manipulation'\n }\n});\nexport default TouchableWithoutFeedback;","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport createReactClass from 'create-react-class';\nimport ensurePositiveDelayProps from '../Touchable/ensurePositiveDelayProps';\nimport { number } from 'prop-types';\nimport React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport Touchable from '../Touchable';\nimport TouchableWithoutFeedback from '../TouchableWithoutFeedback';\nimport View from '../View';\nvar flattenStyle = StyleSheet.flatten;\nvar PRESS_RETENTION_OFFSET = {\n top: 20,\n left: 20,\n right: 20,\n bottom: 30\n};\n/**\n * A wrapper for making views respond properly to touches.\n * On press down, the opacity of the wrapped view is decreased, dimming it.\n *\n * Opacity is controlled by wrapping the children in a View, which is\n * added to the view hiearchy. Be aware that this can affect layout.\n *\n * Example:\n *\n * ```\n * renderButton: function() {\n * return (\n * \n * \n * \n * );\n * },\n * ```\n */\n\n/* eslint-disable react/prefer-es6-class */\n\nvar TouchableOpacity = createReactClass({\n displayName: 'TouchableOpacity',\n mixins: [Touchable.Mixin],\n propTypes: _objectSpread({}, TouchableWithoutFeedback.propTypes, {\n /**\n * Determines what the opacity of the wrapped view should be when touch is\n * active.\n */\n activeOpacity: number,\n focusedOpacity: number\n }),\n getDefaultProps: function getDefaultProps() {\n return {\n activeOpacity: 0.2,\n focusedOpacity: 0.7\n };\n },\n getInitialState: function getInitialState() {\n return this.touchableGetInitialState();\n },\n componentDidMount: function componentDidMount() {\n ensurePositiveDelayProps(this.props);\n },\n componentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n ensurePositiveDelayProps(nextProps);\n },\n\n /**\n * Animate the touchable to a new opacity.\n */\n setOpacityTo: function setOpacityTo(value, duration) {\n this.setNativeProps({\n style: {\n opacity: value,\n transitionDuration: duration ? duration / 1000 + \"s\" : '0s'\n }\n });\n },\n\n /**\n * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n * defined on your component.\n */\n touchableHandleActivePressIn: function touchableHandleActivePressIn(e) {\n if (e.dispatchConfig.registrationName === 'onResponderGrant') {\n this._opacityActive(0);\n } else {\n this._opacityActive(150);\n }\n\n this.props.onPressIn && this.props.onPressIn(e);\n },\n touchableHandleActivePressOut: function touchableHandleActivePressOut(e) {\n this._opacityInactive(250);\n\n this.props.onPressOut && this.props.onPressOut(e);\n },\n touchableHandlePress: function touchableHandlePress(e) {\n this.props.onPress && this.props.onPress(e);\n },\n touchableHandleLongPress: function touchableHandleLongPress(e) {\n this.props.onLongPress && this.props.onLongPress(e);\n },\n touchableGetPressRectOffset: function touchableGetPressRectOffset() {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n },\n touchableGetHitSlop: function touchableGetHitSlop() {\n return this.props.hitSlop;\n },\n touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() {\n return this.props.delayPressIn || 0;\n },\n touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() {\n return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;\n },\n touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() {\n return this.props.delayPressOut;\n },\n _opacityActive: function _opacityActive(duration) {\n this.setOpacityTo(this.props.activeOpacity, duration);\n },\n _opacityInactive: function _opacityInactive(duration) {\n this.setOpacityTo(this._getChildStyleOpacityWithDefault(), duration);\n },\n _opacityFocused: function _opacityFocused() {\n this.setOpacityTo(this.props.focusedOpacity);\n },\n _getChildStyleOpacityWithDefault: function _getChildStyleOpacityWithDefault() {\n var childStyle = flattenStyle(this.props.style) || {};\n return childStyle.opacity === undefined ? 1 : childStyle.opacity;\n },\n render: function render() {\n var _this$props = this.props,\n activeOpacity = _this$props.activeOpacity,\n focusedOpacity = _this$props.focusedOpacity,\n delayLongPress = _this$props.delayLongPress,\n delayPressIn = _this$props.delayPressIn,\n delayPressOut = _this$props.delayPressOut,\n onLongPress = _this$props.onLongPress,\n onPress = _this$props.onPress,\n onPressIn = _this$props.onPressIn,\n onPressOut = _this$props.onPressOut,\n pressRetentionOffset = _this$props.pressRetentionOffset,\n other = _objectWithoutPropertiesLoose(_this$props, [\"activeOpacity\", \"focusedOpacity\", \"delayLongPress\", \"delayPressIn\", \"delayPressOut\", \"onLongPress\", \"onPress\", \"onPressIn\", \"onPressOut\", \"pressRetentionOffset\"]);\n\n return React.createElement(View, _extends({}, other, {\n accessible: this.props.accessible !== false,\n onKeyDown: this.touchableHandleKeyEvent,\n onKeyUp: this.touchableHandleKeyEvent,\n onResponderGrant: this.touchableHandleResponderGrant,\n onResponderMove: this.touchableHandleResponderMove,\n onResponderRelease: this.touchableHandleResponderRelease,\n onResponderTerminate: this.touchableHandleResponderTerminate,\n onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,\n onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,\n style: [styles.root, !this.props.disabled && styles.actionable, this.props.style]\n }), this.props.children, Touchable.renderDebugView({\n color: 'blue',\n hitSlop: this.props.hitSlop\n }));\n }\n});\nvar styles = StyleSheet.create({\n root: {\n transitionProperty: 'opacity',\n transitionDuration: '0.15s',\n userSelect: 'none'\n },\n actionable: {\n cursor: 'pointer',\n touchAction: 'manipulation'\n }\n});\nexport default applyNativeMethods(TouchableOpacity);","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport ColorPropType from '../ColorPropType';\nimport StyleSheet from '../StyleSheet';\nimport TouchableOpacity from '../TouchableOpacity';\nimport Text from '../Text';\nimport { bool, func, string } from 'prop-types';\nimport React, { Component } from 'react';\n\nvar Button =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Button, _Component);\n\n function Button() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = Button.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n accessibilityLabel = _this$props.accessibilityLabel,\n color = _this$props.color,\n disabled = _this$props.disabled,\n onPress = _this$props.onPress,\n testID = _this$props.testID,\n title = _this$props.title;\n return React.createElement(TouchableOpacity, {\n accessibilityLabel: accessibilityLabel,\n accessibilityRole: \"button\",\n disabled: disabled,\n onPress: onPress,\n style: [styles.button, color && {\n backgroundColor: color\n }, disabled && styles.buttonDisabled],\n testID: testID\n }, React.createElement(Text, {\n style: [styles.text, disabled && styles.textDisabled]\n }, title));\n };\n\n return Button;\n}(Component);\n\nButton.propTypes = process.env.NODE_ENV !== \"production\" ? {\n accessibilityLabel: string,\n color: ColorPropType,\n disabled: bool,\n onPress: func.isRequired,\n testID: string,\n title: string.isRequired\n} : {};\nvar styles = StyleSheet.create({\n button: {\n backgroundColor: '#2196F3',\n borderRadius: 2\n },\n text: {\n color: '#fff',\n fontWeight: '500',\n padding: 8,\n textAlign: 'center',\n textTransform: 'uppercase'\n },\n buttonDisabled: {\n backgroundColor: '#dfdfdf'\n },\n textDisabled: {\n color: '#a1a1a1'\n }\n});\nexport default Button;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport ColorPropType from '../ColorPropType';\nimport createElement from '../createElement';\nimport StyleSheet from '../StyleSheet';\nimport UIManager from '../UIManager';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React, { Component } from 'react';\nimport { bool, func } from 'prop-types';\n\nvar CheckBox =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(CheckBox, _Component);\n\n function CheckBox() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this._handleChange = function (event) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n onValueChange = _this$props.onValueChange;\n var value = event.nativeEvent.target.checked;\n event.nativeEvent.value = value;\n onChange && onChange(event);\n onValueChange && onValueChange(value);\n };\n\n _this._setCheckboxRef = function (element) {\n _this._checkboxElement = element;\n };\n\n return _this;\n }\n\n var _proto = CheckBox.prototype;\n\n _proto.blur = function blur() {\n UIManager.blur(this._checkboxElement);\n };\n\n _proto.focus = function focus() {\n UIManager.focus(this._checkboxElement);\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n color = _this$props2.color,\n disabled = _this$props2.disabled,\n onChange = _this$props2.onChange,\n onValueChange = _this$props2.onValueChange,\n style = _this$props2.style,\n value = _this$props2.value,\n other = _objectWithoutPropertiesLoose(_this$props2, [\"color\", \"disabled\", \"onChange\", \"onValueChange\", \"style\", \"value\"]);\n\n var fakeControl = React.createElement(View, {\n style: [styles.fakeControl, value && styles.fakeControlChecked, // custom color\n value && color && {\n backgroundColor: color,\n borderColor: color\n }, disabled && styles.fakeControlDisabled, value && disabled && styles.fakeControlCheckedAndDisabled]\n });\n var nativeControl = createElement('input', {\n checked: value,\n disabled: disabled,\n onChange: this._handleChange,\n ref: this._setCheckboxRef,\n style: [styles.nativeControl, styles.cursorInherit],\n type: 'checkbox'\n });\n return React.createElement(View, _extends({}, other, {\n style: [styles.root, style, disabled && styles.cursorDefault]\n }), fakeControl, nativeControl);\n };\n\n return CheckBox;\n}(Component);\n\nCheckBox.displayName = 'CheckBox';\nCheckBox.defaultProps = {\n disabled: false,\n value: false\n};\nCheckBox.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n color: ColorPropType,\n disabled: bool,\n onChange: func,\n onValueChange: func,\n value: bool\n}) : {};\nvar styles = StyleSheet.create({\n root: {\n cursor: 'pointer',\n height: 16,\n userSelect: 'none',\n width: 16\n },\n cursorDefault: {\n cursor: 'default'\n },\n cursorInherit: {\n cursor: 'inherit'\n },\n fakeControl: {\n alignItems: 'center',\n backgroundColor: '#fff',\n borderColor: '#657786',\n borderRadius: 2,\n borderStyle: 'solid',\n borderWidth: 2,\n height: '100%',\n justifyContent: 'center',\n width: '100%'\n },\n fakeControlChecked: {\n backgroundColor: '#009688',\n backgroundImage: 'url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K\")',\n backgroundRepeat: 'no-repeat',\n borderColor: '#009688'\n },\n fakeControlDisabled: {\n borderColor: '#CCD6DD'\n },\n fakeControlCheckedAndDisabled: {\n backgroundColor: '#AAB8C2',\n borderColor: '#AAB8C2'\n },\n nativeControl: _objectSpread({}, StyleSheet.absoluteFillObject, {\n height: '100%',\n margin: 0,\n opacity: 0,\n padding: 0,\n width: '100%'\n })\n});\nexport default applyNativeMethods(CheckBox);","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport View from '../../exports/View';\nimport React, { Component } from 'react';\n/**\n * Common implementation for a simple stubbed view.\n */\n\n/* eslint-disable react/prop-types */\n\nvar UnimplementedView =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(UnimplementedView, _Component);\n\n function UnimplementedView() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = UnimplementedView.prototype;\n\n _proto.setNativeProps = function setNativeProps() {// Do nothing.\n // This method is required in order to use this view as a Touchable* child.\n // See ensureComponentIsNative.js for more info\n };\n\n _proto.render = function render() {\n return React.createElement(View, {\n style: [unimplementedViewStyles, this.props.style]\n }, this.props.children);\n };\n\n return UnimplementedView;\n}(Component);\n\nvar unimplementedViewStyles = process.env.NODE_ENV !== 'production' ? {\n alignSelf: 'flex-start',\n borderColor: 'red',\n borderWidth: 1\n} : {};\nexport default UnimplementedView;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport InteractionManager from '../../../exports/InteractionManager';\n/**\n * A simple class for batching up invocations of a low-pri callback. A timeout is set to run the\n * callback once after a delay, no matter how many times it's scheduled. Once the delay is reached,\n * InteractionManager.runAfterInteractions is used to invoke the callback after any hi-pri\n * interactions are done running.\n *\n * Make sure to cleanup with dispose(). Example:\n *\n * class Widget extends React.Component {\n * _batchedSave: new Batchinator(() => this._saveState, 1000);\n * _saveSate() {\n * // save this.state to disk\n * }\n * componentDidUpdate() {\n * this._batchedSave.schedule();\n * }\n * componentWillUnmount() {\n * this._batchedSave.dispose();\n * }\n * ...\n * }\n */\n\nvar Batchinator =\n/*#__PURE__*/\nfunction () {\n function Batchinator(callback, delayMS) {\n this._delay = delayMS;\n this._callback = callback;\n }\n /*\n * Cleanup any pending tasks.\n *\n * By default, if there is a pending task the callback is run immediately. Set the option abort to\n * true to not call the callback if it was pending.\n */\n\n\n var _proto = Batchinator.prototype;\n\n _proto.dispose = function dispose(options) {\n if (options === void 0) {\n options = {\n abort: false\n };\n }\n\n if (this._taskHandle) {\n this._taskHandle.cancel();\n\n if (!options.abort) {\n this._callback();\n }\n\n this._taskHandle = null;\n }\n };\n\n _proto.schedule = function schedule() {\n var _this = this;\n\n if (this._taskHandle) {\n return;\n }\n\n var timeoutHandle = setTimeout(function () {\n _this._taskHandle = InteractionManager.runAfterInteractions(function () {\n // Note that we clear the handle before invoking the callback so that if the callback calls\n // schedule again, it will actually schedule another task.\n _this._taskHandle = null;\n\n _this._callback();\n });\n }, this._delay);\n this._taskHandle = {\n cancel: function cancel() {\n return clearTimeout(timeoutHandle);\n }\n };\n };\n\n return Batchinator;\n}();\n\nexport default Batchinator;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n\nimport performanceNow from 'fbjs/lib/performanceNow';\nimport warning from 'fbjs/lib/warning';\n\nvar Info = function Info() {\n this.any_blank_count = 0;\n this.any_blank_ms = 0;\n this.any_blank_speed_sum = 0;\n this.mostly_blank_count = 0;\n this.mostly_blank_ms = 0;\n this.pixels_blank = 0;\n this.pixels_sampled = 0;\n this.pixels_scrolled = 0;\n this.total_time_spent = 0;\n this.sample_count = 0;\n};\n\nvar DEBUG = false;\nvar _listeners = [];\nvar _minSampleCount = 10;\n\nvar _sampleRate = DEBUG ? 1 : null;\n/**\n * A helper class for detecting when the maximem fill rate of `VirtualizedList` is exceeded.\n * By default the sampling rate is set to zero and this will do nothing. If you want to collect\n * samples (e.g. to log them), make sure to call `FillRateHelper.setSampleRate(0.0-1.0)`.\n *\n * Listeners and sample rate are global for all `VirtualizedList`s - typical usage will combine with\n * `SceneTracker.getActiveScene` to determine the context of the events.\n */\n\n\nvar FillRateHelper =\n/*#__PURE__*/\nfunction () {\n FillRateHelper.addListener = function addListener(callback) {\n warning(_sampleRate !== null, 'Call `FillRateHelper.setSampleRate` before `addListener`.');\n\n _listeners.push(callback);\n\n return {\n remove: function remove() {\n _listeners = _listeners.filter(function (listener) {\n return callback !== listener;\n });\n }\n };\n };\n\n FillRateHelper.setSampleRate = function setSampleRate(sampleRate) {\n _sampleRate = sampleRate;\n };\n\n FillRateHelper.setMinSampleCount = function setMinSampleCount(minSampleCount) {\n _minSampleCount = minSampleCount;\n };\n\n function FillRateHelper(getFrameMetrics) {\n this._anyBlankStartTime = null;\n this._enabled = false;\n this._info = new Info();\n this._mostlyBlankStartTime = null;\n this._samplesStartTime = null;\n this._getFrameMetrics = getFrameMetrics;\n this._enabled = (_sampleRate || 0) > Math.random();\n\n this._resetData();\n }\n\n var _proto = FillRateHelper.prototype;\n\n _proto.activate = function activate() {\n if (this._enabled && this._samplesStartTime == null) {\n DEBUG && console.debug('FillRateHelper: activate');\n this._samplesStartTime = performanceNow();\n }\n };\n\n _proto.deactivateAndFlush = function deactivateAndFlush() {\n if (!this._enabled) {\n return;\n }\n\n var start = this._samplesStartTime; // const for flow\n\n if (start == null) {\n DEBUG && console.debug('FillRateHelper: bail on deactivate with no start time');\n return;\n }\n\n if (this._info.sample_count < _minSampleCount) {\n // Don't bother with under-sampled events.\n this._resetData();\n\n return;\n }\n\n var total_time_spent = performanceNow() - start;\n\n var info = _objectSpread({}, this._info, {\n total_time_spent: total_time_spent\n });\n\n if (DEBUG) {\n var derived = {\n avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,\n avg_speed: this._info.pixels_scrolled / (total_time_spent / 1000),\n avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count,\n any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1000 / 60),\n any_blank_time_frac: this._info.any_blank_ms / total_time_spent,\n mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1000 / 60),\n mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent\n };\n\n for (var key in derived) {\n derived[key] = Math.round(1000 * derived[key]) / 1000;\n }\n\n console.debug('FillRateHelper deactivateAndFlush: ', {\n derived: derived,\n info: info\n });\n }\n\n _listeners.forEach(function (listener) {\n return listener(info);\n });\n\n this._resetData();\n };\n\n _proto.computeBlankness = function computeBlankness(props, state, scrollMetrics) {\n if (!this._enabled || props.getItemCount(props.data) === 0 || this._samplesStartTime == null) {\n return 0;\n }\n\n var dOffset = scrollMetrics.dOffset,\n offset = scrollMetrics.offset,\n velocity = scrollMetrics.velocity,\n visibleLength = scrollMetrics.visibleLength; // Denominator metrics that we track for all events - most of the time there is no blankness and\n // we want to capture that.\n\n this._info.sample_count++;\n this._info.pixels_sampled += Math.round(visibleLength);\n this._info.pixels_scrolled += Math.round(Math.abs(dOffset));\n var scrollSpeed = Math.round(Math.abs(velocity) * 1000); // px / sec\n // Whether blank now or not, record the elapsed time blank if we were blank last time.\n\n var now = performanceNow();\n\n if (this._anyBlankStartTime != null) {\n this._info.any_blank_ms += now - this._anyBlankStartTime;\n }\n\n this._anyBlankStartTime = null;\n\n if (this._mostlyBlankStartTime != null) {\n this._info.mostly_blank_ms += now - this._mostlyBlankStartTime;\n }\n\n this._mostlyBlankStartTime = null;\n var blankTop = 0;\n var first = state.first;\n\n var firstFrame = this._getFrameMetrics(first);\n\n while (first <= state.last && (!firstFrame || !firstFrame.inLayout)) {\n firstFrame = this._getFrameMetrics(first);\n first++;\n } // Only count blankTop if we aren't rendering the first item, otherwise we will count the header\n // as blank.\n\n\n if (firstFrame && first > 0) {\n blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset));\n }\n\n var blankBottom = 0;\n var last = state.last;\n\n var lastFrame = this._getFrameMetrics(last);\n\n while (last >= state.first && (!lastFrame || !lastFrame.inLayout)) {\n lastFrame = this._getFrameMetrics(last);\n last--;\n } // Only count blankBottom if we aren't rendering the last item, otherwise we will count the\n // footer as blank.\n\n\n if (lastFrame && last < props.getItemCount(props.data) - 1) {\n var bottomEdge = lastFrame.offset + lastFrame.length;\n blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge));\n }\n\n var pixels_blank = Math.round(blankTop + blankBottom);\n var blankness = pixels_blank / visibleLength;\n\n if (blankness > 0) {\n this._anyBlankStartTime = now;\n this._info.any_blank_speed_sum += scrollSpeed;\n this._info.any_blank_count++;\n this._info.pixels_blank += pixels_blank;\n\n if (blankness > 0.5) {\n this._mostlyBlankStartTime = now;\n this._info.mostly_blank_count++;\n }\n } else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) {\n this.deactivateAndFlush();\n }\n\n return blankness;\n };\n\n _proto.enabled = function enabled() {\n return this._enabled;\n };\n\n _proto._resetData = function _resetData() {\n this._anyBlankStartTime = null;\n this._info = new Info();\n this._mostlyBlankStartTime = null;\n this._samplesStartTime = null;\n };\n\n return FillRateHelper;\n}();\n\nexport default FillRateHelper;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport ColorPropType from '../ColorPropType';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport { arrayOf, bool, func, number, oneOf, string } from 'prop-types';\nimport React, { Component } from 'react';\n\nvar RefreshControl =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(RefreshControl, _Component);\n\n function RefreshControl() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = RefreshControl.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n colors = _this$props.colors,\n enabled = _this$props.enabled,\n onRefresh = _this$props.onRefresh,\n progressBackgroundColor = _this$props.progressBackgroundColor,\n progressViewOffset = _this$props.progressViewOffset,\n refreshing = _this$props.refreshing,\n size = _this$props.size,\n tintColor = _this$props.tintColor,\n title = _this$props.title,\n titleColor = _this$props.titleColor,\n rest = _objectWithoutPropertiesLoose(_this$props, [\"colors\", \"enabled\", \"onRefresh\", \"progressBackgroundColor\", \"progressViewOffset\", \"refreshing\", \"size\", \"tintColor\", \"title\", \"titleColor\"]);\n\n return React.createElement(View, rest);\n };\n\n return RefreshControl;\n}(Component);\n\nRefreshControl.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n colors: arrayOf(ColorPropType),\n enabled: bool,\n onRefresh: func,\n progressBackgroundColor: ColorPropType,\n progressViewOffset: number,\n refreshing: bool.isRequired,\n size: oneOf([0, 1]),\n tintColor: ColorPropType,\n title: string,\n titleColor: ColorPropType\n}) : {};\nexport default RefreshControl;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n\nimport invariant from 'fbjs/lib/invariant';\n/**\n * A Utility class for calculating viewable items based on current metrics like scroll position and\n * layout.\n *\n * An item is said to be in a \"viewable\" state when any of the following\n * is true for longer than `minimumViewTime` milliseconds (after an interaction if `waitForInteraction`\n * is true):\n *\n * - Occupying >= `viewAreaCoveragePercentThreshold` of the view area XOR fraction of the item\n * visible in the view area >= `itemVisiblePercentThreshold`.\n * - Entirely visible on screen\n */\n\nvar ViewabilityHelper =\n/*#__PURE__*/\nfunction () {\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an error\n * found when Flow v0.63 was deployed. To see the error delete this comment\n * and run Flow. */\n function ViewabilityHelper(config) {\n if (config === void 0) {\n config = {\n viewAreaCoveragePercentThreshold: 0\n };\n }\n\n this._hasInteracted = false;\n this._timers = new Set();\n this._viewableIndices = [];\n this._viewableItems = new Map();\n this._config = config;\n }\n /**\n * Cleanup, e.g. on unmount. Clears any pending timers.\n */\n\n\n var _proto = ViewabilityHelper.prototype;\n\n _proto.dispose = function dispose() {\n this._timers.forEach(clearTimeout);\n }\n /**\n * Determines which items are viewable based on the current metrics and config.\n */\n ;\n\n _proto.computeViewableItems = function computeViewableItems(itemCount, scrollOffset, viewportHeight, getFrameMetrics, renderRange) {\n var _this$_config = this._config,\n itemVisiblePercentThreshold = _this$_config.itemVisiblePercentThreshold,\n viewAreaCoveragePercentThreshold = _this$_config.viewAreaCoveragePercentThreshold;\n var viewAreaMode = viewAreaCoveragePercentThreshold != null;\n var viewablePercentThreshold = viewAreaMode ? viewAreaCoveragePercentThreshold : itemVisiblePercentThreshold;\n invariant(viewablePercentThreshold != null && itemVisiblePercentThreshold != null !== (viewAreaCoveragePercentThreshold != null), 'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold');\n var viewableIndices = [];\n\n if (itemCount === 0) {\n return viewableIndices;\n }\n\n var firstVisible = -1;\n\n var _ref = renderRange || {\n first: 0,\n last: itemCount - 1\n },\n first = _ref.first,\n last = _ref.last;\n\n invariant(last < itemCount, 'Invalid render range ' + JSON.stringify({\n renderRange: renderRange,\n itemCount: itemCount\n }));\n\n for (var idx = first; idx <= last; idx++) {\n var metrics = getFrameMetrics(idx);\n\n if (!metrics) {\n continue;\n }\n\n var top = metrics.offset - scrollOffset;\n var bottom = top + metrics.length;\n\n if (top < viewportHeight && bottom > 0) {\n firstVisible = idx;\n\n if (_isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, metrics.length)) {\n viewableIndices.push(idx);\n }\n } else if (firstVisible >= 0) {\n break;\n }\n }\n\n return viewableIndices;\n }\n /**\n * Figures out which items are viewable and how that has changed from before and calls\n * `onViewableItemsChanged` as appropriate.\n */\n ;\n\n _proto.onUpdate = function onUpdate(itemCount, scrollOffset, viewportHeight, getFrameMetrics, createViewToken, onViewableItemsChanged, renderRange) {\n var _this = this;\n\n if (this._config.waitForInteraction && !this._hasInteracted || itemCount === 0 || !getFrameMetrics(0)) {\n return;\n }\n\n var viewableIndices = [];\n\n if (itemCount) {\n viewableIndices = this.computeViewableItems(itemCount, scrollOffset, viewportHeight, getFrameMetrics, renderRange);\n }\n\n if (this._viewableIndices.length === viewableIndices.length && this._viewableIndices.every(function (v, ii) {\n return v === viewableIndices[ii];\n })) {\n // We might get a lot of scroll events where visibility doesn't change and we don't want to do\n // extra work in those cases.\n return;\n }\n\n this._viewableIndices = viewableIndices;\n\n if (this._config.minimumViewTime) {\n var handle = setTimeout(function () {\n _this._timers.delete(handle);\n\n _this._onUpdateSync(viewableIndices, onViewableItemsChanged, createViewToken);\n }, this._config.minimumViewTime);\n\n this._timers.add(handle);\n } else {\n this._onUpdateSync(viewableIndices, onViewableItemsChanged, createViewToken);\n }\n }\n /**\n * clean-up cached _viewableIndices to evaluate changed items on next update\n */\n ;\n\n _proto.resetViewableIndices = function resetViewableIndices() {\n this._viewableIndices = [];\n }\n /**\n * Records that an interaction has happened even if there has been no scroll.\n */\n ;\n\n _proto.recordInteraction = function recordInteraction() {\n this._hasInteracted = true;\n };\n\n _proto._onUpdateSync = function _onUpdateSync(viewableIndicesToCheck, onViewableItemsChanged, createViewToken) {\n var _this2 = this; // Filter out indices that have gone out of view since this call was scheduled.\n\n\n viewableIndicesToCheck = viewableIndicesToCheck.filter(function (ii) {\n return _this2._viewableIndices.includes(ii);\n });\n var prevItems = this._viewableItems;\n var nextItems = new Map(viewableIndicesToCheck.map(function (ii) {\n var viewable = createViewToken(ii, true);\n return [viewable.key, viewable];\n }));\n var changed = [];\n\n for (var _iterator = nextItems, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref2 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref2 = _i.value;\n }\n\n var _ref4 = _ref2,\n key = _ref4[0],\n viewable = _ref4[1];\n\n if (!prevItems.has(key)) {\n changed.push(viewable);\n }\n }\n\n for (var _iterator2 = prevItems, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref3;\n\n if (_isArray2) {\n if (_i2 >= _iterator2.length) break;\n _ref3 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) break;\n _ref3 = _i2.value;\n }\n\n var _ref5 = _ref3,\n key = _ref5[0],\n viewable = _ref5[1];\n\n if (!nextItems.has(key)) {\n changed.push(_objectSpread({}, viewable, {\n isViewable: false\n }));\n }\n }\n\n if (changed.length > 0) {\n this._viewableItems = nextItems;\n onViewableItemsChanged({\n viewableItems: Array.from(nextItems.values()),\n changed: changed,\n viewabilityConfig: this._config\n });\n }\n };\n\n return ViewabilityHelper;\n}();\n\nfunction _isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, itemLength) {\n if (_isEntirelyVisible(top, bottom, viewportHeight)) {\n return true;\n } else {\n var pixels = _getPixelsVisible(top, bottom, viewportHeight);\n\n var percent = 100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength);\n return percent >= viewablePercentThreshold;\n }\n}\n\nfunction _getPixelsVisible(top, bottom, viewportHeight) {\n var visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0);\n return Math.max(0, visibleHeight);\n}\n\nfunction _isEntirelyVisible(top, bottom, viewportHeight) {\n return top >= 0 && bottom <= viewportHeight && bottom > top;\n}\n\nexport default ViewabilityHelper;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\nimport invariant from 'fbjs/lib/invariant';\n/**\n * Used to find the indices of the frames that overlap the given offsets. Useful for finding the\n * items that bound different windows of content, such as the visible area or the buffered overscan\n * area.\n */\n\nfunction elementsThatOverlapOffsets(offsets, itemCount, getFrameMetrics) {\n var out = [];\n var outLength = 0;\n\n for (var ii = 0; ii < itemCount; ii++) {\n var frame = getFrameMetrics(ii);\n var trailingOffset = frame.offset + frame.length;\n\n for (var kk = 0; kk < offsets.length; kk++) {\n if (out[kk] == null && trailingOffset >= offsets[kk]) {\n out[kk] = ii;\n outLength++;\n\n if (kk === offsets.length - 1) {\n invariant(outLength === offsets.length, 'bad offsets input, should be in increasing order: %s', JSON.stringify(offsets));\n return out;\n }\n }\n }\n }\n\n return out;\n}\n/**\n * Computes the number of elements in the `next` range that are new compared to the `prev` range.\n * Handy for calculating how many new items will be rendered when the render window changes so we\n * can restrict the number of new items render at once so that content can appear on the screen\n * faster.\n */\n\n\nfunction newRangeCount(prev, next) {\n return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first));\n}\n/**\n * Custom logic for determining which items should be rendered given the current frame and scroll\n * metrics, as well as the previous render state. The algorithm may evolve over time, but generally\n * prioritizes the visible area first, then expands that with overscan regions ahead and behind,\n * biased in the direction of scroll.\n */\n\n\nfunction computeWindowedRenderLimits(props, prev, getFrameMetricsApprox, scrollMetrics) {\n var data = props.data,\n getItemCount = props.getItemCount,\n maxToRenderPerBatch = props.maxToRenderPerBatch,\n windowSize = props.windowSize;\n var itemCount = getItemCount(data);\n\n if (itemCount === 0) {\n return prev;\n }\n\n var offset = scrollMetrics.offset,\n velocity = scrollMetrics.velocity,\n visibleLength = scrollMetrics.visibleLength; // Start with visible area, then compute maximum overscan region by expanding from there, biased\n // in the direction of scroll. Total overscan area is capped, which should cap memory consumption\n // too.\n\n var visibleBegin = Math.max(0, offset);\n var visibleEnd = visibleBegin + visibleLength;\n var overscanLength = (windowSize - 1) * visibleLength; // Considering velocity seems to introduce more churn than it's worth.\n\n var leadFactor = 0.5; // Math.max(0, Math.min(1, velocity / 25 + 0.5));\n\n var fillPreference = velocity > 1 ? 'after' : velocity < -1 ? 'before' : 'none';\n var overscanBegin = Math.max(0, visibleBegin - (1 - leadFactor) * overscanLength);\n var overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength);\n var lastItemOffset = getFrameMetricsApprox(itemCount - 1).offset;\n\n if (lastItemOffset < overscanBegin) {\n // Entire list is before our overscan window\n return {\n first: Math.max(0, itemCount - 1 - maxToRenderPerBatch),\n last: itemCount - 1\n };\n } // Find the indices that correspond to the items at the render boundaries we're targeting.\n\n\n var _elementsThatOverlapO = elementsThatOverlapOffsets([overscanBegin, visibleBegin, visibleEnd, overscanEnd], props.getItemCount(props.data), getFrameMetricsApprox),\n overscanFirst = _elementsThatOverlapO[0],\n first = _elementsThatOverlapO[1],\n last = _elementsThatOverlapO[2],\n overscanLast = _elementsThatOverlapO[3];\n\n overscanFirst = overscanFirst == null ? 0 : overscanFirst;\n first = first == null ? Math.max(0, overscanFirst) : first;\n overscanLast = overscanLast == null ? itemCount - 1 : overscanLast;\n last = last == null ? Math.min(overscanLast, first + maxToRenderPerBatch - 1) : last;\n var visible = {\n first: first,\n last: last\n }; // We want to limit the number of new cells we're rendering per batch so that we can fill the\n // content on the screen quickly. If we rendered the entire overscan window at once, the user\n // could be staring at white space for a long time waiting for a bunch of offscreen content to\n // render.\n\n var newCellCount = newRangeCount(prev, visible);\n\n while (true) {\n if (first <= overscanFirst && last >= overscanLast) {\n // If we fill the entire overscan range, we're done.\n break;\n }\n\n var maxNewCells = newCellCount >= maxToRenderPerBatch;\n var firstWillAddMore = first <= prev.first || first > prev.last;\n var firstShouldIncrement = first > overscanFirst && (!maxNewCells || !firstWillAddMore);\n var lastWillAddMore = last >= prev.last || last < prev.first;\n var lastShouldIncrement = last < overscanLast && (!maxNewCells || !lastWillAddMore);\n\n if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) {\n // We only want to stop if we've hit maxNewCells AND we cannot increment first or last\n // without rendering new items. This let's us preserve as many already rendered items as\n // possible, reducing render churn and keeping the rendered overscan range as large as\n // possible.\n break;\n }\n\n if (firstShouldIncrement && !(fillPreference === 'after' && lastShouldIncrement && lastWillAddMore)) {\n if (firstWillAddMore) {\n newCellCount++;\n }\n\n first--;\n }\n\n if (lastShouldIncrement && !(fillPreference === 'before' && firstShouldIncrement && firstWillAddMore)) {\n if (lastWillAddMore) {\n newCellCount++;\n }\n\n last++;\n }\n }\n\n if (!(last >= first && first >= 0 && last < itemCount && first >= overscanFirst && last <= overscanLast && first <= visible.first && last >= visible.last)) {\n throw new Error('Bad window calculation ' + JSON.stringify({\n first: first,\n last: last,\n itemCount: itemCount,\n overscanFirst: overscanFirst,\n overscanLast: overscanLast,\n visible: visible\n }));\n }\n\n return {\n first: first,\n last: last\n };\n}\n\nexport { computeWindowedRenderLimits, elementsThatOverlapOffsets, newRangeCount };\nvar VirtualizeUtils = {\n computeWindowedRenderLimits: computeWindowedRenderLimits,\n elementsThatOverlapOffsets: elementsThatOverlapOffsets,\n newRangeCount: newRangeCount\n};\nexport default VirtualizeUtils;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n/**\n * Intentional info-level logging for clear separation from ad-hoc console debug logging.\n */\n\nfunction infoLog() {\n var _console;\n\n return (_console = console).log.apply(_console, arguments);\n}\n\nexport default infoLog;","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n\nimport Batchinator from '../Batchinator';\nimport FillRateHelper from '../FillRateHelper';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport RefreshControl from '../../../exports/RefreshControl';\nimport ScrollView from '../../../exports/ScrollView';\nimport StyleSheet from '../../../exports/StyleSheet';\nimport UIManager from '../../../exports/UIManager';\nimport View from '../../../exports/View';\nimport ViewabilityHelper from '../ViewabilityHelper';\nimport { computeWindowedRenderLimits } from '../VirtualizeUtils';\nimport findNodeHandle from '../../../exports/findNodeHandle';\nimport infoLog from '../infoLog';\nimport invariant from 'fbjs/lib/invariant';\nimport warning from 'fbjs/lib/warning';\nvar flattenStyle = StyleSheet.flatten;\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar _usedIndexForKey = false;\n/**\n * Base implementation for the more convenient [``](/react-native/docs/flatlist.html)\n * and [``](/react-native/docs/sectionlist.html) components, which are also better\n * documented. In general, this should only really be used if you need more flexibility than\n * `FlatList` provides, e.g. for use with immutable data instead of plain arrays.\n *\n * Virtualization massively improves memory consumption and performance of large lists by\n * maintaining a finite render window of active items and replacing all items outside of the render\n * window with appropriately sized blank space. The window adapts to scrolling behavior, and items\n * are rendered incrementally with low-pri (after any running interactions) if they are far from the\n * visible area, or with hi-pri otherwise to minimize the potential of seeing blank space.\n *\n * Some caveats:\n *\n * - Internal state is not preserved when content scrolls out of the render window. Make sure all\n * your data is captured in the item data or external stores like Flux, Redux, or Relay.\n * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-\n * equal. Make sure that everything your `renderItem` function depends on is passed as a prop\n * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on\n * changes. This includes the `data` prop and parent component state.\n * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously\n * offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see\n * blank content. This is a tradeoff that can be adjusted to suit the needs of each application,\n * and we are working on improving it behind the scenes.\n * - By default, the list looks for a `key` prop on each item and uses that for the React key.\n * Alternatively, you can provide a custom `keyExtractor` prop.\n *\n */\n\nvar VirtualizedList =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inheritsLoose(VirtualizedList, _React$PureComponent);\n\n var _proto = VirtualizedList.prototype; // scrollToEnd may be janky without getItemLayout prop\n\n _proto.scrollToEnd = function scrollToEnd(params) {\n var animated = params ? params.animated : true;\n var veryLast = this.props.getItemCount(this.props.data) - 1;\n\n var frame = this._getFrameMetricsApprox(veryLast);\n\n var offset = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength);\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\n\n this._scrollRef.scrollTo(\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n * comment suppresses an error when upgrading Flow's support for React.\n * To see the error delete this comment and run Flow. */\n this.props.horizontal ? {\n x: offset,\n animated: animated\n } : {\n y: offset,\n animated: animated\n });\n } // scrollToIndex may be janky without getItemLayout prop\n ;\n\n _proto.scrollToIndex = function scrollToIndex(params) {\n var _this$props = this.props,\n data = _this$props.data,\n horizontal = _this$props.horizontal,\n getItemCount = _this$props.getItemCount,\n getItemLayout = _this$props.getItemLayout,\n onScrollToIndexFailed = _this$props.onScrollToIndexFailed;\n var animated = params.animated,\n index = params.index,\n viewOffset = params.viewOffset,\n viewPosition = params.viewPosition;\n invariant(index >= 0 && index < getItemCount(data), \"scrollToIndex out of range: \" + index + \" vs \" + (getItemCount(data) - 1));\n\n if (!getItemLayout && index > this._highestMeasuredFrameIndex) {\n invariant(!!onScrollToIndexFailed, 'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' + 'otherwise there is no way to know the location of offscreen indices or handle failures.');\n onScrollToIndexFailed({\n averageItemLength: this._averageCellLength,\n highestMeasuredFrameIndex: this._highestMeasuredFrameIndex,\n index: index\n });\n return;\n }\n\n var frame = this._getFrameMetricsApprox(index);\n\n var offset = Math.max(0, frame.offset - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0);\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\n\n this._scrollRef.scrollTo(\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n * comment suppresses an error when upgrading Flow's support for React.\n * To see the error delete this comment and run Flow. */\n horizontal ? {\n x: offset,\n animated: animated\n } : {\n y: offset,\n animated: animated\n });\n } // scrollToItem may be janky without getItemLayout prop. Required linear scan through items -\n // use scrollToIndex instead if possible.\n ;\n\n _proto.scrollToItem = function scrollToItem(params) {\n var item = params.item;\n var _this$props2 = this.props,\n data = _this$props2.data,\n getItem = _this$props2.getItem,\n getItemCount = _this$props2.getItemCount;\n var itemCount = getItemCount(data);\n\n for (var _index = 0; _index < itemCount; _index++) {\n if (getItem(data, _index) === item) {\n this.scrollToIndex(_objectSpread({}, params, {\n index: _index\n }));\n break;\n }\n }\n }\n /**\n * Scroll to a specific content pixel offset in the list.\n *\n * Param `offset` expects the offset to scroll to.\n * In case of `horizontal` is true, the offset is the x-value,\n * in any other case the offset is the y-value.\n *\n * Param `animated` (`true` by default) defines whether the list\n * should do an animation while scrolling.\n */\n ;\n\n _proto.scrollToOffset = function scrollToOffset(params) {\n var animated = params.animated,\n offset = params.offset;\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\n\n this._scrollRef.scrollTo(\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n * comment suppresses an error when upgrading Flow's support for React.\n * To see the error delete this comment and run Flow. */\n this.props.horizontal ? {\n x: offset,\n animated: animated\n } : {\n y: offset,\n animated: animated\n });\n };\n\n _proto.recordInteraction = function recordInteraction() {\n this._nestedChildLists.forEach(function (childList) {\n childList.ref && childList.ref.recordInteraction();\n });\n\n this._viewabilityTuples.forEach(function (t) {\n t.viewabilityHelper.recordInteraction();\n });\n\n this._updateViewableItems(this.props.data);\n };\n\n _proto.flashScrollIndicators = function flashScrollIndicators() {\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\n this._scrollRef.flashScrollIndicators();\n }\n /**\n * Provides a handle to the underlying scroll responder.\n * Note that `this._scrollRef` might not be a `ScrollView`, so we\n * need to check that it responds to `getScrollResponder` before calling it.\n */\n ;\n\n _proto.getScrollResponder = function getScrollResponder() {\n if (this._scrollRef && this._scrollRef.getScrollResponder) {\n return this._scrollRef.getScrollResponder();\n }\n };\n\n _proto.getScrollableNode = function getScrollableNode() {\n if (this._scrollRef && this._scrollRef.getScrollableNode) {\n return this._scrollRef.getScrollableNode();\n } else {\n return findNodeHandle(this._scrollRef);\n }\n };\n\n _proto.setNativeProps = function setNativeProps(props) {\n if (this._scrollRef) {\n this._scrollRef.setNativeProps(props);\n }\n };\n\n _proto.getChildContext = function getChildContext() {\n return {\n virtualizedList: {\n getScrollMetrics: this._getScrollMetrics,\n horizontal: this.props.horizontal,\n getOutermostParentListRef: this._getOutermostParentListRef,\n getNestedChildState: this._getNestedChildState,\n registerAsNestedChild: this._registerAsNestedChild,\n unregisterAsNestedChild: this._unregisterAsNestedChild\n }\n };\n };\n\n _proto._getCellKey = function _getCellKey() {\n return this.context.virtualizedCell && this.context.virtualizedCell.cellKey || 'rootList';\n };\n\n _proto.hasMore = function hasMore() {\n return this._hasMore;\n };\n\n function VirtualizedList(_props, context) {\n var _this;\n\n _this = _React$PureComponent.call(this, _props, context) || this;\n\n _this._getScrollMetrics = function () {\n return _this._scrollMetrics;\n };\n\n _this._getOutermostParentListRef = function () {\n if (_this._isNestedWithSameOrientation()) {\n return _this.context.virtualizedList.getOutermostParentListRef();\n } else {\n return _assertThisInitialized(_assertThisInitialized(_this));\n }\n };\n\n _this._getNestedChildState = function (key) {\n var existingChildData = _this._nestedChildLists.get(key);\n\n return existingChildData && existingChildData.state;\n };\n\n _this._registerAsNestedChild = function (childList) {\n // Register the mapping between this child key and the cellKey for its cell\n var childListsInCell = _this._cellKeysToChildListKeys.get(childList.cellKey) || new Set();\n childListsInCell.add(childList.key);\n\n _this._cellKeysToChildListKeys.set(childList.cellKey, childListsInCell);\n\n var existingChildData = _this._nestedChildLists.get(childList.key);\n\n invariant(!(existingChildData && existingChildData.ref !== null), 'A VirtualizedList contains a cell which itself contains ' + 'more than one VirtualizedList of the same orientation as the parent ' + 'list. You must pass a unique listKey prop to each sibling list.');\n\n _this._nestedChildLists.set(childList.key, {\n ref: childList.ref,\n state: null\n });\n\n if (_this._hasInteracted) {\n childList.ref.recordInteraction();\n }\n };\n\n _this._unregisterAsNestedChild = function (childList) {\n _this._nestedChildLists.set(childList.key, {\n ref: null,\n state: childList.state\n });\n };\n\n _this._onUpdateSeparators = function (keys, newProps) {\n keys.forEach(function (key) {\n var ref = key != null && _this._cellRefs[key];\n ref && ref.updateSeparatorProps(newProps);\n });\n };\n\n _this._averageCellLength = 0;\n _this._cellKeysToChildListKeys = new Map();\n _this._cellRefs = {};\n _this._frames = {};\n _this._footerLength = 0;\n _this._hasDataChangedSinceEndReached = true;\n _this._hasInteracted = false;\n _this._hasMore = false;\n _this._hasWarned = {};\n _this._highestMeasuredFrameIndex = 0;\n _this._headerLength = 0;\n _this._indicesToKeys = new Map();\n _this._hasDoneInitialScroll = false;\n _this._nestedChildLists = new Map();\n _this._offsetFromParentVirtualizedList = 0;\n _this._prevParentOffset = 0;\n _this._scrollMetrics = {\n contentLength: 0,\n dOffset: 0,\n dt: 10,\n offset: 0,\n timestamp: 0,\n velocity: 0,\n visibleLength: 0\n };\n _this._scrollRef = null;\n _this._sentEndForContentLength = 0;\n _this._totalCellLength = 0;\n _this._totalCellsMeasured = 0;\n _this._viewabilityTuples = [];\n\n _this._captureScrollRef = function (ref) {\n _this._scrollRef = ref;\n };\n\n _this._defaultRenderScrollComponent = function (props) {\n if (_this._isNestedWithSameOrientation()) {\n return React.createElement(View, props);\n } else if (props.onRefresh) {\n invariant(typeof props.refreshing === 'boolean', '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' + JSON.stringify(props.refreshing) + '`');\n return React.createElement(ScrollView, _extends({}, props, {\n refreshControl:\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This\n * comment suppresses an error when upgrading Flow's support for\n * React. To see the error delete this comment and run Flow. */\n React.createElement(RefreshControl, {\n refreshing: props.refreshing,\n onRefresh: props.onRefresh,\n progressViewOffset: props.progressViewOffset\n })\n }));\n } else {\n return React.createElement(ScrollView, props);\n }\n };\n\n _this._onCellUnmount = function (cellKey) {\n var curr = _this._frames[cellKey];\n\n if (curr) {\n _this._frames[cellKey] = _objectSpread({}, curr, {\n inLayout: false\n });\n }\n };\n\n _this._onLayout = function (e) {\n if (_this._isNestedWithSameOrientation()) {\n // Need to adjust our scroll metrics to be relative to our containing\n // VirtualizedList before we can make claims about list item viewability\n _this._measureLayoutRelativeToContainingList();\n } else {\n _this._scrollMetrics.visibleLength = _this._selectLength(e.nativeEvent.layout);\n }\n\n _this.props.onLayout && _this.props.onLayout(e);\n\n _this._scheduleCellsToRenderUpdate();\n\n _this._maybeCallOnEndReached();\n };\n\n _this._onLayoutEmpty = function (e) {\n _this.props.onLayout && _this.props.onLayout(e);\n };\n\n _this._onLayoutFooter = function (e) {\n _this._footerLength = _this._selectLength(e.nativeEvent.layout);\n };\n\n _this._onLayoutHeader = function (e) {\n _this._headerLength = _this._selectLength(e.nativeEvent.layout);\n };\n\n _this._onContentSizeChange = function (width, height) {\n if (width > 0 && height > 0 && _this.props.initialScrollIndex != null && _this.props.initialScrollIndex > 0 && !_this._hasDoneInitialScroll) {\n _this.scrollToIndex({\n animated: false,\n index: _this.props.initialScrollIndex\n });\n\n _this._hasDoneInitialScroll = true;\n }\n\n if (_this.props.onContentSizeChange) {\n _this.props.onContentSizeChange(width, height);\n }\n\n _this._scrollMetrics.contentLength = _this._selectLength({\n height: height,\n width: width\n });\n\n _this._scheduleCellsToRenderUpdate();\n\n _this._maybeCallOnEndReached();\n };\n\n _this._convertParentScrollMetrics = function (metrics) {\n // Offset of the top of the nested list relative to the top of its parent's viewport\n var offset = metrics.offset - _this._offsetFromParentVirtualizedList; // Child's visible length is the same as its parent's\n\n var visibleLength = metrics.visibleLength;\n var dOffset = offset - _this._scrollMetrics.offset;\n var contentLength = _this._scrollMetrics.contentLength;\n return {\n visibleLength: visibleLength,\n contentLength: contentLength,\n offset: offset,\n dOffset: dOffset\n };\n };\n\n _this._onScroll = function (e) {\n _this._nestedChildLists.forEach(function (childList) {\n childList.ref && childList.ref._onScroll(e);\n });\n\n if (_this.props.onScroll) {\n _this.props.onScroll(e);\n }\n\n var timestamp = e.timeStamp;\n\n var visibleLength = _this._selectLength(e.nativeEvent.layoutMeasurement);\n\n var contentLength = _this._selectLength(e.nativeEvent.contentSize);\n\n var offset = _this._selectOffset(e.nativeEvent.contentOffset);\n\n var dOffset = offset - _this._scrollMetrics.offset;\n\n if (_this._isNestedWithSameOrientation()) {\n if (_this._scrollMetrics.contentLength === 0) {\n // Ignore scroll events until onLayout has been called and we\n // know our offset from our offset from our parent\n return;\n }\n\n var _this$_convertParentS = _this._convertParentScrollMetrics({\n visibleLength: visibleLength,\n offset: offset\n });\n\n visibleLength = _this$_convertParentS.visibleLength;\n contentLength = _this$_convertParentS.contentLength;\n offset = _this$_convertParentS.offset;\n dOffset = _this$_convertParentS.dOffset;\n }\n\n var dt = _this._scrollMetrics.timestamp ? Math.max(1, timestamp - _this._scrollMetrics.timestamp) : 1;\n var velocity = dOffset / dt;\n\n if (dt > 500 && _this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !_this._hasWarned.perf) {\n infoLog('VirtualizedList: You have a large list that is slow to update - make sure your ' + 'renderItem function renders components that follow React performance best practices ' + 'like PureComponent, shouldComponentUpdate, etc.', {\n dt: dt,\n prevDt: _this._scrollMetrics.dt,\n contentLength: contentLength\n });\n _this._hasWarned.perf = true;\n }\n\n _this._scrollMetrics = {\n contentLength: contentLength,\n dt: dt,\n dOffset: dOffset,\n offset: offset,\n timestamp: timestamp,\n velocity: velocity,\n visibleLength: visibleLength\n };\n\n _this._updateViewableItems(_this.props.data);\n\n if (!_this.props) {\n return;\n }\n\n _this._maybeCallOnEndReached();\n\n if (velocity !== 0) {\n _this._fillRateHelper.activate();\n }\n\n _this._computeBlankness();\n\n _this._scheduleCellsToRenderUpdate();\n };\n\n _this._onScrollBeginDrag = function (e) {\n _this._nestedChildLists.forEach(function (childList) {\n childList.ref && childList.ref._onScrollBeginDrag(e);\n });\n\n _this._viewabilityTuples.forEach(function (tuple) {\n tuple.viewabilityHelper.recordInteraction();\n });\n\n _this._hasInteracted = true;\n _this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e);\n };\n\n _this._onScrollEndDrag = function (e) {\n var velocity = e.nativeEvent.velocity;\n\n if (velocity) {\n _this._scrollMetrics.velocity = _this._selectOffset(velocity);\n }\n\n _this._computeBlankness();\n\n _this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e);\n };\n\n _this._onMomentumScrollEnd = function (e) {\n _this._scrollMetrics.velocity = 0;\n\n _this._computeBlankness();\n\n _this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e);\n };\n\n _this._updateCellsToRender = function () {\n var _this$props3 = _this.props,\n data = _this$props3.data,\n getItemCount = _this$props3.getItemCount,\n onEndReachedThreshold = _this$props3.onEndReachedThreshold;\n\n var isVirtualizationDisabled = _this._isVirtualizationDisabled();\n\n _this._updateViewableItems(data);\n\n if (!data) {\n return;\n }\n\n _this.setState(function (state) {\n var newState;\n\n if (!isVirtualizationDisabled) {\n // If we run this with bogus data, we'll force-render window {first: 0, last: 0},\n // and wipe out the initialNumToRender rendered elements.\n // So let's wait until the scroll view metrics have been set up. And until then,\n // we will trust the initialNumToRender suggestion\n if (_this._scrollMetrics.visibleLength) {\n // If we have a non-zero initialScrollIndex and run this before we've scrolled,\n // we'll wipe out the initialNumToRender rendered elements starting at initialScrollIndex.\n // So let's wait until we've scrolled the view to the right place. And until then,\n // we will trust the initialScrollIndex suggestion.\n if (!_this.props.initialScrollIndex || _this._scrollMetrics.offset) {\n newState = computeWindowedRenderLimits(_this.props, state, _this._getFrameMetricsApprox, _this._scrollMetrics);\n }\n }\n } else {\n var _this$_scrollMetrics = _this._scrollMetrics,\n contentLength = _this$_scrollMetrics.contentLength,\n offset = _this$_scrollMetrics.offset,\n visibleLength = _this$_scrollMetrics.visibleLength;\n var distanceFromEnd = contentLength - visibleLength - offset;\n var renderAhead =\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses\n * an error found when Flow v0.63 was deployed. To see the error\n * delete this comment and run Flow. */\n distanceFromEnd < onEndReachedThreshold * visibleLength ? _this.props.maxToRenderPerBatch : 0;\n newState = {\n first: 0,\n last: Math.min(state.last + renderAhead, getItemCount(data) - 1)\n };\n }\n\n if (newState && _this._nestedChildLists.size > 0) {\n var newFirst = newState.first;\n var newLast = newState.last; // If some cell in the new state has a child list in it, we should only render\n // up through that item, so that we give that list a chance to render.\n // Otherwise there's churn from multiple child lists mounting and un-mounting\n // their items.\n\n for (var ii = newFirst; ii <= newLast; ii++) {\n var cellKeyForIndex = _this._indicesToKeys.get(ii);\n\n var childListKeys = cellKeyForIndex && _this._cellKeysToChildListKeys.get(cellKeyForIndex);\n\n if (!childListKeys) {\n continue;\n }\n\n var someChildHasMore = false; // For each cell, need to check whether any child list in it has more elements to render\n\n for (var _iterator = childListKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var childKey = _ref;\n\n var childList = _this._nestedChildLists.get(childKey);\n\n if (childList && childList.ref && childList.ref.hasMore()) {\n someChildHasMore = true;\n break;\n }\n }\n\n if (someChildHasMore) {\n newState.last = ii;\n break;\n }\n }\n }\n\n return newState;\n });\n };\n\n _this._createViewToken = function (index, isViewable) {\n var _this$props4 = _this.props,\n data = _this$props4.data,\n getItem = _this$props4.getItem,\n keyExtractor = _this$props4.keyExtractor;\n var item = getItem(data, index);\n return {\n index: index,\n item: item,\n key: keyExtractor(item, index),\n isViewable: isViewable\n };\n };\n\n _this._getFrameMetricsApprox = function (index) {\n var frame = _this._getFrameMetrics(index);\n\n if (frame && frame.index === index) {\n // check for invalid frames due to row re-ordering\n return frame;\n } else {\n var getItemLayout = _this.props.getItemLayout;\n invariant(!getItemLayout, 'Should not have to estimate frames when a measurement metrics function is provided');\n return {\n length: _this._averageCellLength,\n offset: _this._averageCellLength * index\n };\n }\n };\n\n _this._getFrameMetrics = function (index) {\n var _this$props5 = _this.props,\n data = _this$props5.data,\n getItem = _this$props5.getItem,\n getItemCount = _this$props5.getItemCount,\n getItemLayout = _this$props5.getItemLayout,\n keyExtractor = _this$props5.keyExtractor;\n invariant(getItemCount(data) > index, 'Tried to get frame for out of range index ' + index);\n var item = getItem(data, index);\n\n var frame = item && _this._frames[keyExtractor(item, index)];\n\n if (!frame || frame.index !== index) {\n if (getItemLayout) {\n frame = getItemLayout(data, index);\n\n if (__DEV__) {\n var frameType = PropTypes.shape({\n length: PropTypes.number.isRequired,\n offset: PropTypes.number.isRequired,\n index: PropTypes.number.isRequired\n }).isRequired;\n PropTypes.checkPropTypes({\n frame: frameType\n }, {\n frame: frame\n }, 'frame', 'VirtualizedList.getItemLayout');\n }\n }\n }\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.63 was deployed. To see the error delete this\n * comment and run Flow. */\n\n\n return frame;\n };\n\n invariant(!_props.onScroll || !_props.onScroll.__isNative, 'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' + 'to support native onScroll events with useNativeDriver');\n invariant(_props.windowSize > 0, 'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.');\n _this._fillRateHelper = new FillRateHelper(_this._getFrameMetrics);\n _this._updateCellsToRenderBatcher = new Batchinator(_this._updateCellsToRender, _this.props.updateCellsBatchingPeriod);\n\n if (_this.props.viewabilityConfigCallbackPairs) {\n _this._viewabilityTuples = _this.props.viewabilityConfigCallbackPairs.map(function (pair) {\n return {\n viewabilityHelper: new ViewabilityHelper(pair.viewabilityConfig),\n onViewableItemsChanged: pair.onViewableItemsChanged\n };\n });\n } else if (_this.props.onViewableItemsChanged) {\n _this._viewabilityTuples.push({\n viewabilityHelper: new ViewabilityHelper(_this.props.viewabilityConfig),\n onViewableItemsChanged: _this.props.onViewableItemsChanged\n });\n }\n\n var initialState = {\n first: _this.props.initialScrollIndex || 0,\n last: Math.min(_this.props.getItemCount(_this.props.data), (_this.props.initialScrollIndex || 0) + _this.props.initialNumToRender) - 1\n };\n\n if (_this._isNestedWithSameOrientation()) {\n var storedState = _this.context.virtualizedList.getNestedChildState(_this.props.listKey || _this._getCellKey());\n\n if (storedState) {\n initialState = storedState;\n _this.state = storedState;\n _this._frames = storedState.frames;\n }\n }\n\n _this.state = initialState;\n return _this;\n }\n\n _proto.componentDidMount = function componentDidMount() {\n if (this._isNestedWithSameOrientation()) {\n this.context.virtualizedList.registerAsNestedChild({\n cellKey: this._getCellKey(),\n key: this.props.listKey || this._getCellKey(),\n ref: this\n });\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this._isNestedWithSameOrientation()) {\n this.context.virtualizedList.unregisterAsNestedChild({\n key: this.props.listKey || this._getCellKey(),\n state: {\n first: this.state.first,\n last: this.state.last,\n frames: this._frames\n }\n });\n }\n\n this._updateViewableItems(null);\n\n this._updateCellsToRenderBatcher.dispose({\n abort: true\n });\n\n this._viewabilityTuples.forEach(function (tuple) {\n tuple.viewabilityHelper.dispose();\n });\n\n this._fillRateHelper.deactivateAndFlush();\n };\n\n VirtualizedList.getDerivedStateFromProps = function getDerivedStateFromProps(newProps, prevState) {\n var data = newProps.data,\n extraData = newProps.extraData,\n getItemCount = newProps.getItemCount,\n maxToRenderPerBatch = newProps.maxToRenderPerBatch; // first and last could be stale (e.g. if a new, shorter items props is passed in), so we make\n // sure we're rendering a reasonable range here.\n\n return {\n first: Math.max(0, Math.min(prevState.first, getItemCount(data) - 1 - maxToRenderPerBatch)),\n last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1))\n };\n };\n\n _proto._pushCells = function _pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) {\n var _this2 = this;\n\n var _this$props6 = this.props,\n CellRendererComponent = _this$props6.CellRendererComponent,\n ItemSeparatorComponent = _this$props6.ItemSeparatorComponent,\n data = _this$props6.data,\n getItem = _this$props6.getItem,\n getItemCount = _this$props6.getItemCount,\n horizontal = _this$props6.horizontal,\n keyExtractor = _this$props6.keyExtractor;\n var stickyOffset = this.props.ListHeaderComponent ? 1 : 0;\n var end = getItemCount(data) - 1;\n var prevCellKey;\n last = Math.min(end, last);\n\n var _loop = function _loop(ii) {\n var item = getItem(data, ii);\n var key = keyExtractor(item, ii);\n\n _this2._indicesToKeys.set(ii, key);\n\n if (stickyIndicesFromProps.has(ii + stickyOffset)) {\n stickyHeaderIndices.push(cells.length);\n }\n\n cells.push(React.createElement(CellRenderer, {\n CellRendererComponent: CellRendererComponent,\n ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : undefined,\n cellKey: key,\n fillRateHelper: _this2._fillRateHelper,\n horizontal: horizontal,\n index: ii,\n inversionStyle: inversionStyle,\n item: item,\n key: key,\n prevCellKey: prevCellKey,\n onUpdateSeparators: _this2._onUpdateSeparators,\n onLayout: function onLayout(e) {\n return _this2._onCellLayout(e, key, ii);\n },\n onUnmount: _this2._onCellUnmount,\n parentProps: _this2.props,\n ref: function ref(_ref2) {\n _this2._cellRefs[key] = _ref2;\n }\n }));\n prevCellKey = key;\n };\n\n for (var ii = first; ii <= last; ii++) {\n _loop(ii);\n }\n };\n\n _proto._isVirtualizationDisabled = function _isVirtualizationDisabled() {\n return this.props.disableVirtualization;\n };\n\n _proto._isNestedWithSameOrientation = function _isNestedWithSameOrientation() {\n var nestedContext = this.context.virtualizedList;\n return !!(nestedContext && !!nestedContext.horizontal === !!this.props.horizontal);\n };\n\n _proto.render = function render() {\n if (__DEV__) {\n var flatStyles = flattenStyle(this.props.contentContainerStyle);\n warning(flatStyles == null || flatStyles.flexWrap !== 'wrap', '`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' + 'Consider using `numColumns` with `FlatList` instead.');\n }\n\n var _this$props7 = this.props,\n ListEmptyComponent = _this$props7.ListEmptyComponent,\n ListFooterComponent = _this$props7.ListFooterComponent,\n ListHeaderComponent = _this$props7.ListHeaderComponent;\n var _this$props8 = this.props,\n data = _this$props8.data,\n horizontal = _this$props8.horizontal;\n\n var isVirtualizationDisabled = this._isVirtualizationDisabled();\n\n var inversionStyle = this.props.inverted ? this.props.horizontal ? styles.horizontallyInverted : styles.verticallyInverted : null;\n var cells = [];\n var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);\n var stickyHeaderIndices = [];\n\n if (ListHeaderComponent) {\n if (stickyIndicesFromProps.has(0)) {\n stickyHeaderIndices.push(0);\n }\n\n var element = React.isValidElement(ListHeaderComponent) ? ListHeaderComponent : // $FlowFixMe\n React.createElement(ListHeaderComponent, null);\n cells.push(React.createElement(VirtualizedCellWrapper, {\n cellKey: this._getCellKey() + '-header',\n key: \"$header\"\n }, React.createElement(View, {\n onLayout: this._onLayoutHeader,\n style: inversionStyle\n }, element)));\n }\n\n var itemCount = this.props.getItemCount(data);\n\n if (itemCount > 0) {\n _usedIndexForKey = false;\n var spacerKey = !horizontal ? 'height' : 'width';\n var lastInitialIndex = this.props.initialScrollIndex ? -1 : this.props.initialNumToRender - 1;\n var _this$state = this.state,\n first = _this$state.first,\n last = _this$state.last;\n\n this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, 0, lastInitialIndex, inversionStyle);\n\n var firstAfterInitial = Math.max(lastInitialIndex + 1, first);\n\n if (!isVirtualizationDisabled && first > lastInitialIndex + 1) {\n var insertedStickySpacer = false;\n\n if (stickyIndicesFromProps.size > 0) {\n var stickyOffset = ListHeaderComponent ? 1 : 0; // See if there are any sticky headers in the virtualized space that we need to render.\n\n for (var ii = firstAfterInitial - 1; ii > lastInitialIndex; ii--) {\n if (stickyIndicesFromProps.has(ii + stickyOffset)) {\n var _ref3, _ref4;\n\n var initBlock = this._getFrameMetricsApprox(lastInitialIndex);\n\n var stickyBlock = this._getFrameMetricsApprox(ii);\n\n var leadSpace = stickyBlock.offset - (initBlock.offset + initBlock.length);\n cells.push(React.createElement(View, {\n key: \"$sticky_lead\",\n style: (_ref3 = {}, _ref3[spacerKey] = leadSpace, _ref3)\n }));\n\n this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, ii, ii, inversionStyle);\n\n var trailSpace = this._getFrameMetricsApprox(first).offset - (stickyBlock.offset + stickyBlock.length);\n cells.push(React.createElement(View, {\n key: \"$sticky_trail\",\n style: (_ref4 = {}, _ref4[spacerKey] = trailSpace, _ref4)\n }));\n insertedStickySpacer = true;\n break;\n }\n }\n }\n\n if (!insertedStickySpacer) {\n var _ref5;\n\n var _initBlock = this._getFrameMetricsApprox(lastInitialIndex);\n\n var firstSpace = this._getFrameMetricsApprox(first).offset - (_initBlock.offset + _initBlock.length);\n\n cells.push(React.createElement(View, {\n key: \"$lead_spacer\",\n style: (_ref5 = {}, _ref5[spacerKey] = firstSpace, _ref5)\n }));\n }\n }\n\n this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, firstAfterInitial, last, inversionStyle);\n\n if (!this._hasWarned.keys && _usedIndexForKey) {\n console.warn('VirtualizedList: missing keys for items, make sure to specify a key property on each ' + 'item or provide a custom keyExtractor.');\n this._hasWarned.keys = true;\n }\n\n if (!isVirtualizationDisabled && last < itemCount - 1) {\n var _ref6;\n\n var lastFrame = this._getFrameMetricsApprox(last); // Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to\n // prevent the user for hyperscrolling into un-measured area because otherwise content will\n // likely jump around as it renders in above the viewport.\n\n\n var end = this.props.getItemLayout ? itemCount - 1 : Math.min(itemCount - 1, this._highestMeasuredFrameIndex);\n\n var endFrame = this._getFrameMetricsApprox(end);\n\n var tailSpacerLength = endFrame.offset + endFrame.length - (lastFrame.offset + lastFrame.length);\n cells.push(React.createElement(View, {\n key: \"$tail_spacer\",\n style: (_ref6 = {}, _ref6[spacerKey] = tailSpacerLength, _ref6)\n }));\n }\n } else if (ListEmptyComponent) {\n var _element = React.isValidElement(ListEmptyComponent) ? ListEmptyComponent : // $FlowFixMe\n React.createElement(ListEmptyComponent, null);\n\n cells.push(React.createElement(View, {\n key: \"$empty\",\n onLayout: this._onLayoutEmpty,\n style: inversionStyle\n }, _element));\n }\n\n if (ListFooterComponent) {\n var _element2 = React.isValidElement(ListFooterComponent) ? ListFooterComponent : // $FlowFixMe\n React.createElement(ListFooterComponent, null);\n\n cells.push(React.createElement(VirtualizedCellWrapper, {\n cellKey: this._getCellKey() + '-footer',\n key: \"$footer\"\n }, React.createElement(View, {\n onLayout: this._onLayoutFooter,\n style: inversionStyle\n }, _element2)));\n }\n\n var scrollProps = _objectSpread({}, this.props, {\n onContentSizeChange: this._onContentSizeChange,\n onLayout: this._onLayout,\n onScroll: this._onScroll,\n onScrollBeginDrag: this._onScrollBeginDrag,\n onScrollEndDrag: this._onScrollEndDrag,\n onMomentumScrollEnd: this._onMomentumScrollEnd,\n scrollEventThrottle: this.props.scrollEventThrottle,\n // TODO: Android support\n invertStickyHeaders: this.props.invertStickyHeaders !== undefined ? this.props.invertStickyHeaders : this.props.inverted,\n stickyHeaderIndices: stickyHeaderIndices\n });\n\n if (inversionStyle) {\n scrollProps.style = [inversionStyle, this.props.style];\n }\n\n this._hasMore = this.state.last < this.props.getItemCount(this.props.data) - 1;\n var ret = React.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), {\n ref: this._captureScrollRef\n }, cells);\n\n if (this.props.debug) {\n return React.createElement(View, {\n style: {\n flex: 1\n }\n }, ret, this._renderDebugOverlay());\n } else {\n return ret;\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this$props9 = this.props,\n data = _this$props9.data,\n extraData = _this$props9.extraData;\n\n if (data !== prevProps.data || extraData !== prevProps.extraData) {\n this._hasDataChangedSinceEndReached = true; // clear the viewableIndices cache to also trigger\n // the onViewableItemsChanged callback with the new data\n\n this._viewabilityTuples.forEach(function (tuple) {\n tuple.viewabilityHelper.resetViewableIndices();\n });\n }\n\n this._scheduleCellsToRenderUpdate();\n };\n\n _proto._computeBlankness = function _computeBlankness() {\n this._fillRateHelper.computeBlankness(this.props, this.state, this._scrollMetrics);\n };\n\n _proto._onCellLayout = function _onCellLayout(e, cellKey, index) {\n var layout = e.nativeEvent.layout;\n var next = {\n offset: this._selectOffset(layout),\n length: this._selectLength(layout),\n index: index,\n inLayout: true\n };\n var curr = this._frames[cellKey];\n\n if (!curr || next.offset !== curr.offset || next.length !== curr.length || index !== curr.index) {\n this._totalCellLength += next.length - (curr ? curr.length : 0);\n this._totalCellsMeasured += curr ? 0 : 1;\n this._averageCellLength = this._totalCellLength / this._totalCellsMeasured;\n this._frames[cellKey] = next;\n this._highestMeasuredFrameIndex = Math.max(this._highestMeasuredFrameIndex, index);\n\n this._scheduleCellsToRenderUpdate();\n } else {\n this._frames[cellKey].inLayout = true;\n }\n\n this._computeBlankness();\n };\n\n _proto._measureLayoutRelativeToContainingList = function _measureLayoutRelativeToContainingList() {\n var _this3 = this;\n\n UIManager.measureLayout(findNodeHandle(this), findNodeHandle(this.context.virtualizedList.getOutermostParentListRef()), function (error) {\n console.warn(\"VirtualizedList: Encountered an error while measuring a list's\" + ' offset from its containing VirtualizedList.');\n }, function (x, y, width, height) {\n _this3._offsetFromParentVirtualizedList = _this3._selectOffset({\n x: x,\n y: y\n });\n _this3._scrollMetrics.contentLength = _this3._selectLength({\n width: width,\n height: height\n });\n\n var scrollMetrics = _this3._convertParentScrollMetrics(_this3.context.virtualizedList.getScrollMetrics());\n\n _this3._scrollMetrics.visibleLength = scrollMetrics.visibleLength;\n _this3._scrollMetrics.offset = scrollMetrics.offset;\n });\n };\n\n _proto._renderDebugOverlay = function _renderDebugOverlay() {\n var normalize = this._scrollMetrics.visibleLength / this._scrollMetrics.contentLength;\n var framesInLayout = [];\n var itemCount = this.props.getItemCount(this.props.data);\n\n for (var ii = 0; ii < itemCount; ii++) {\n var frame = this._getFrameMetricsApprox(ii);\n\n if (frame.inLayout) {\n framesInLayout.push(frame);\n }\n }\n\n var windowTop = this._getFrameMetricsApprox(this.state.first).offset;\n\n var frameLast = this._getFrameMetricsApprox(this.state.last);\n\n var windowLen = frameLast.offset + frameLast.length - windowTop;\n var visTop = this._scrollMetrics.offset;\n var visLen = this._scrollMetrics.visibleLength;\n var baseStyle = {\n position: 'absolute',\n top: 0,\n right: 0\n };\n return React.createElement(View, {\n style: _objectSpread({}, baseStyle, {\n bottom: 0,\n width: 20,\n borderColor: 'blue',\n borderWidth: 1\n })\n }, framesInLayout.map(function (f, ii) {\n return React.createElement(View, {\n key: 'f' + ii,\n style: _objectSpread({}, baseStyle, {\n left: 0,\n top: f.offset * normalize,\n height: f.length * normalize,\n backgroundColor: 'orange'\n })\n });\n }), React.createElement(View, {\n style: _objectSpread({}, baseStyle, {\n left: 0,\n top: windowTop * normalize,\n height: windowLen * normalize,\n borderColor: 'green',\n borderWidth: 2\n })\n }), React.createElement(View, {\n style: _objectSpread({}, baseStyle, {\n left: 0,\n top: visTop * normalize,\n height: visLen * normalize,\n borderColor: 'red',\n borderWidth: 2\n })\n }));\n };\n\n _proto._selectLength = function _selectLength(metrics) {\n return !this.props.horizontal ? metrics.height : metrics.width;\n };\n\n _proto._selectOffset = function _selectOffset(metrics) {\n return !this.props.horizontal ? metrics.y : metrics.x;\n };\n\n _proto._maybeCallOnEndReached = function _maybeCallOnEndReached() {\n var _this$props10 = this.props,\n data = _this$props10.data,\n getItemCount = _this$props10.getItemCount,\n onEndReached = _this$props10.onEndReached,\n onEndReachedThreshold = _this$props10.onEndReachedThreshold;\n var _this$_scrollMetrics2 = this._scrollMetrics,\n contentLength = _this$_scrollMetrics2.contentLength,\n visibleLength = _this$_scrollMetrics2.visibleLength,\n offset = _this$_scrollMetrics2.offset;\n var distanceFromEnd = contentLength - visibleLength - offset;\n\n if (onEndReached && this.state.last === getItemCount(data) - 1 &&\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.63 was deployed. To see the error delete this\n * comment and run Flow. */\n distanceFromEnd < onEndReachedThreshold * visibleLength && (this._hasDataChangedSinceEndReached || this._scrollMetrics.contentLength !== this._sentEndForContentLength)) {\n // Only call onEndReached once for a given dataset + content length.\n this._hasDataChangedSinceEndReached = false;\n this._sentEndForContentLength = this._scrollMetrics.contentLength;\n onEndReached({\n distanceFromEnd: distanceFromEnd\n });\n }\n };\n\n _proto._scheduleCellsToRenderUpdate = function _scheduleCellsToRenderUpdate() {\n var _this$state2 = this.state,\n first = _this$state2.first,\n last = _this$state2.last;\n var _this$_scrollMetrics3 = this._scrollMetrics,\n offset = _this$_scrollMetrics3.offset,\n visibleLength = _this$_scrollMetrics3.visibleLength,\n velocity = _this$_scrollMetrics3.velocity;\n var itemCount = this.props.getItemCount(this.props.data);\n var hiPri = false;\n\n if (first > 0 || last < itemCount - 1) {\n var distTop = offset - this._getFrameMetricsApprox(first).offset;\n\n var distBottom = this._getFrameMetricsApprox(last).offset - (offset + visibleLength);\n var scrollingThreshold =\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.63 was deployed. To see the error delete\n * this comment and run Flow. */\n this.props.onEndReachedThreshold * visibleLength / 2;\n hiPri = Math.min(distTop, distBottom) < 0 || velocity < -2 && distTop < scrollingThreshold || velocity > 2 && distBottom < scrollingThreshold;\n } // Only trigger high-priority updates if we've actually rendered cells,\n // and with that size estimate, accurately compute how many cells we should render.\n // Otherwise, it would just render as many cells as it can (of zero dimension),\n // each time through attempting to render more (limited by maxToRenderPerBatch),\n // starving the renderer from actually laying out the objects and computing _averageCellLength.\n\n\n if (hiPri && this._averageCellLength) {\n // Don't worry about interactions when scrolling quickly; focus on filling content as fast\n // as possible.\n this._updateCellsToRenderBatcher.dispose({\n abort: true\n });\n\n this._updateCellsToRender();\n\n return;\n } else {\n this._updateCellsToRenderBatcher.schedule();\n }\n };\n\n _proto._updateViewableItems = function _updateViewableItems(data) {\n var _this4 = this;\n\n var getItemCount = this.props.getItemCount;\n\n this._viewabilityTuples.forEach(function (tuple) {\n tuple.viewabilityHelper.onUpdate(getItemCount(data), _this4._scrollMetrics.offset, _this4._scrollMetrics.visibleLength, _this4._getFrameMetrics, _this4._createViewToken, tuple.onViewableItemsChanged, _this4.state);\n });\n };\n\n return VirtualizedList;\n}(React.PureComponent);\n\nVirtualizedList.defaultProps = {\n disableVirtualization: process.env.NODE_ENV === 'test',\n horizontal: false,\n initialNumToRender: 10,\n keyExtractor: function keyExtractor(item, index) {\n if (item.key != null) {\n return item.key;\n }\n\n _usedIndexForKey = true;\n return String(index);\n },\n maxToRenderPerBatch: 10,\n onEndReachedThreshold: 2,\n // multiples of length\n scrollEventThrottle: 50,\n updateCellsBatchingPeriod: 50,\n windowSize: 21 // multiples of length\n\n};\nVirtualizedList.contextTypes = {\n virtualizedCell: PropTypes.shape({\n cellKey: PropTypes.string\n }),\n virtualizedList: PropTypes.shape({\n getScrollMetrics: PropTypes.func,\n horizontal: PropTypes.bool,\n getOutermostParentListRef: PropTypes.func,\n getNestedChildState: PropTypes.func,\n registerAsNestedChild: PropTypes.func,\n unregisterAsNestedChild: PropTypes.func\n })\n};\nVirtualizedList.childContextTypes = {\n virtualizedList: PropTypes.shape({\n getScrollMetrics: PropTypes.func,\n horizontal: PropTypes.bool,\n getOutermostParentListRef: PropTypes.func,\n getNestedChildState: PropTypes.func,\n registerAsNestedChild: PropTypes.func,\n unregisterAsNestedChild: PropTypes.func\n })\n};\n\nvar CellRenderer =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(CellRenderer, _React$Component);\n\n function CellRenderer() {\n var _this5;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this5 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this5.state = {\n separatorProps: {\n highlighted: false,\n leadingItem: _this5.props.item\n }\n };\n _this5._separators = {\n highlight: function highlight() {\n var _this5$props = _this5.props,\n cellKey = _this5$props.cellKey,\n prevCellKey = _this5$props.prevCellKey;\n\n _this5.props.onUpdateSeparators([cellKey, prevCellKey], {\n highlighted: true\n });\n },\n unhighlight: function unhighlight() {\n var _this5$props2 = _this5.props,\n cellKey = _this5$props2.cellKey,\n prevCellKey = _this5$props2.prevCellKey;\n\n _this5.props.onUpdateSeparators([cellKey, prevCellKey], {\n highlighted: false\n });\n },\n updateProps: function updateProps(select, newProps) {\n var _this5$props3 = _this5.props,\n cellKey = _this5$props3.cellKey,\n prevCellKey = _this5$props3.prevCellKey;\n\n _this5.props.onUpdateSeparators([select === 'leading' ? prevCellKey : cellKey], newProps);\n }\n };\n return _this5;\n }\n\n var _proto2 = CellRenderer.prototype;\n\n _proto2.getChildContext = function getChildContext() {\n return {\n virtualizedCell: {\n cellKey: this.props.cellKey\n }\n };\n } // TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not\n // reused by SectionList and we can keep VirtualizedList simpler.\n ;\n\n _proto2.updateSeparatorProps = function updateSeparatorProps(newProps) {\n this.setState(function (state) {\n return {\n separatorProps: _objectSpread({}, state.separatorProps, newProps)\n };\n });\n };\n\n _proto2.componentWillUnmount = function componentWillUnmount() {\n this.props.onUnmount(this.props.cellKey);\n };\n\n _proto2.render = function render() {\n var _this$props11 = this.props,\n CellRendererComponent = _this$props11.CellRendererComponent,\n ItemSeparatorComponent = _this$props11.ItemSeparatorComponent,\n fillRateHelper = _this$props11.fillRateHelper,\n horizontal = _this$props11.horizontal,\n item = _this$props11.item,\n index = _this$props11.index,\n inversionStyle = _this$props11.inversionStyle,\n parentProps = _this$props11.parentProps;\n var renderItem = parentProps.renderItem,\n getItemLayout = parentProps.getItemLayout;\n invariant(renderItem, 'no renderItem!');\n var element = renderItem({\n item: item,\n index: index,\n separators: this._separators\n });\n var onLayout = getItemLayout && !parentProps.debug && !fillRateHelper.enabled() ? undefined : this.props.onLayout; // NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and\n // called explicitly by `ScrollViewStickyHeader`.\n\n var itemSeparator = ItemSeparatorComponent && React.createElement(ItemSeparatorComponent, this.state.separatorProps);\n var cellStyle = inversionStyle ? horizontal ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal ? [styles.row, inversionStyle] : inversionStyle;\n\n if (!CellRendererComponent) {\n return React.createElement(View, {\n style: cellStyle,\n onLayout: onLayout\n }, element, itemSeparator);\n }\n\n return React.createElement(CellRendererComponent, _extends({}, this.props, {\n style: cellStyle,\n onLayout: onLayout\n }), element, itemSeparator);\n };\n\n return CellRenderer;\n}(React.Component);\n\nCellRenderer.childContextTypes = {\n virtualizedCell: PropTypes.shape({\n cellKey: PropTypes.string\n })\n};\n\nvar VirtualizedCellWrapper =\n/*#__PURE__*/\nfunction (_React$Component2) {\n _inheritsLoose(VirtualizedCellWrapper, _React$Component2);\n\n function VirtualizedCellWrapper() {\n return _React$Component2.apply(this, arguments) || this;\n }\n\n var _proto3 = VirtualizedCellWrapper.prototype;\n\n _proto3.getChildContext = function getChildContext() {\n return {\n virtualizedCell: {\n cellKey: this.props.cellKey\n }\n };\n };\n\n _proto3.render = function render() {\n return this.props.children;\n };\n\n return VirtualizedCellWrapper;\n}(React.Component);\n\nVirtualizedCellWrapper.childContextTypes = {\n virtualizedCell: PropTypes.shape({\n cellKey: PropTypes.string\n })\n};\nvar styles = StyleSheet.create({\n verticallyInverted: {\n transform: [{\n scaleY: -1\n }]\n },\n horizontallyInverted: {\n transform: [{\n scaleX: -1\n }]\n },\n row: {\n flexDirection: 'row'\n },\n rowReverse: {\n flexDirection: 'row-reverse'\n },\n columnReverse: {\n flexDirection: 'column-reverse'\n }\n});\nexport default VirtualizedList;","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n\nimport UnimplementedView from '../../../modules/UnimplementedView';\nimport React from 'react';\nimport View from '../../../exports/View';\nimport VirtualizedList from '../VirtualizedList';\nimport invariant from 'fbjs/lib/invariant';\n\nvar defaultProps = _objectSpread({}, VirtualizedList.defaultProps, {\n numColumns: 1\n});\n/**\n * A performant interface for rendering simple, flat lists, supporting the most handy features:\n *\n * - Fully cross-platform.\n * - Optional horizontal mode.\n * - Configurable viewability callbacks.\n * - Header support.\n * - Footer support.\n * - Separator support.\n * - Pull to Refresh.\n * - Scroll loading.\n * - ScrollToIndex support.\n *\n * If you need section support, use [``](docs/sectionlist.html).\n *\n * Minimal Example:\n *\n * {item.key}}\n * />\n *\n * More complex, multi-select example demonstrating `PureComponent` usage for perf optimization and avoiding bugs.\n *\n * - By binding the `onPressItem` handler, the props will remain `===` and `PureComponent` will\n * prevent wasteful re-renders unless the actual `id`, `selected`, or `title` props change, even\n * if the components rendered in `MyListItem` did not have such optimizations.\n * - By passing `extraData={this.state}` to `FlatList` we make sure `FlatList` itself will re-render\n * when the `state.selected` changes. Without setting this prop, `FlatList` would not know it\n * needs to re-render any items because it is also a `PureComponent` and the prop comparison will\n * not show any changes.\n * - `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property.\n *\n *\n * class MyListItem extends React.PureComponent {\n * _onPress = () => {\n * this.props.onPressItem(this.props.id);\n * };\n *\n * render() {\n * const textColor = this.props.selected ? \"red\" : \"black\";\n * return (\n * \n * \n * \n * {this.props.title}\n * \n * \n * \n * );\n * }\n * }\n *\n * class MultiSelectList extends React.PureComponent {\n * state = {selected: (new Map(): Map)};\n *\n * _keyExtractor = (item, index) => item.id;\n *\n * _onPressItem = (id: string) => {\n * // updater functions are preferred for transactional updates\n * this.setState((state) => {\n * // copy the map rather than modifying state.\n * const selected = new Map(state.selected);\n * selected.set(id, !selected.get(id)); // toggle\n * return {selected};\n * });\n * };\n *\n * _renderItem = ({item}) => (\n * \n * );\n *\n * render() {\n * return (\n * \n * );\n * }\n * }\n *\n * This is a convenience wrapper around [``](docs/virtualizedlist.html),\n * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed\n * here, along with the following caveats:\n *\n * - Internal state is not preserved when content scrolls out of the render window. Make sure all\n * your data is captured in the item data or external stores like Flux, Redux, or Relay.\n * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-\n * equal. Make sure that everything your `renderItem` function depends on is passed as a prop\n * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on\n * changes. This includes the `data` prop and parent component state.\n * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously\n * offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see\n * blank content. This is a tradeoff that can be adjusted to suit the needs of each application,\n * and we are working on improving it behind the scenes.\n * - By default, the list looks for a `key` prop on each item and uses that for the React key.\n * Alternatively, you can provide a custom `keyExtractor` prop.\n *\n * Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.\n */\n\n\nvar FlatList =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inheritsLoose(FlatList, _React$PureComponent);\n\n var _proto = FlatList.prototype;\n /**\n * Scrolls to the end of the content. May be janky without `getItemLayout` prop.\n */\n\n _proto.scrollToEnd = function scrollToEnd(params) {\n if (this._listRef) {\n this._listRef.scrollToEnd(params);\n }\n }\n /**\n * Scrolls to the item at the specified index such that it is positioned in the viewable area\n * such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the\n * middle. `viewOffset` is a fixed number of pixels to offset the final target position.\n *\n * Note: cannot scroll to locations outside the render window without specifying the\n * `getItemLayout` prop.\n */\n ;\n\n _proto.scrollToIndex = function scrollToIndex(params) {\n if (this._listRef) {\n this._listRef.scrollToIndex(params);\n }\n }\n /**\n * Requires linear scan through data - use `scrollToIndex` instead if possible.\n *\n * Note: cannot scroll to locations outside the render window without specifying the\n * `getItemLayout` prop.\n */\n ;\n\n _proto.scrollToItem = function scrollToItem(params) {\n if (this._listRef) {\n this._listRef.scrollToItem(params);\n }\n }\n /**\n * Scroll to a specific content pixel offset in the list.\n *\n * Check out [scrollToOffset](docs/virtualizedlist.html#scrolltooffset) of VirtualizedList\n */\n ;\n\n _proto.scrollToOffset = function scrollToOffset(params) {\n if (this._listRef) {\n this._listRef.scrollToOffset(params);\n }\n }\n /**\n * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.\n * if `waitForInteractions` is true and the user has not scrolled. This is typically called by\n * taps on items or by navigation actions.\n */\n ;\n\n _proto.recordInteraction = function recordInteraction() {\n if (this._listRef) {\n this._listRef.recordInteraction();\n }\n }\n /**\n * Displays the scroll indicators momentarily.\n *\n * @platform ios\n */\n ;\n\n _proto.flashScrollIndicators = function flashScrollIndicators() {\n if (this._listRef) {\n this._listRef.flashScrollIndicators();\n }\n }\n /**\n * Provides a handle to the underlying scroll responder.\n */\n ;\n\n _proto.getScrollResponder = function getScrollResponder() {\n if (this._listRef) {\n return this._listRef.getScrollResponder();\n }\n };\n\n _proto.getScrollableNode = function getScrollableNode() {\n if (this._listRef) {\n return this._listRef.getScrollableNode();\n }\n };\n\n _proto.setNativeProps = function setNativeProps(props) {\n if (this._listRef) {\n this._listRef.setNativeProps(props);\n }\n };\n\n _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() {\n this._checkProps(this.props);\n };\n\n _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n invariant(nextProps.numColumns === this.props.numColumns, 'Changing numColumns on the fly is not supported. Change the key prop on FlatList when ' + 'changing the number of columns to force a fresh render of the component.');\n invariant(nextProps.onViewableItemsChanged === this.props.onViewableItemsChanged, 'Changing onViewableItemsChanged on the fly is not supported');\n invariant(nextProps.viewabilityConfig === this.props.viewabilityConfig, 'Changing viewabilityConfig on the fly is not supported');\n invariant(nextProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, 'Changing viewabilityConfigCallbackPairs on the fly is not supported');\n\n this._checkProps(nextProps);\n };\n\n function FlatList(props) {\n var _this;\n\n _this = _React$PureComponent.call(this, props) || this;\n _this._hasWarnedLegacy = false;\n _this._virtualizedListPairs = [];\n\n _this._captureRef = function (ref) {\n _this._listRef = ref;\n };\n\n _this._getItem = function (data, index) {\n var numColumns = _this.props.numColumns;\n\n if (numColumns > 1) {\n var ret = [];\n\n for (var kk = 0; kk < numColumns; kk++) {\n var _item = data[index * numColumns + kk];\n _item && ret.push(_item);\n }\n\n return ret;\n } else {\n return data[index];\n }\n };\n\n _this._getItemCount = function (data) {\n return data ? Math.ceil(data.length / _this.props.numColumns) : 0;\n };\n\n _this._keyExtractor = function (items, index) {\n var _this$props = _this.props,\n keyExtractor = _this$props.keyExtractor,\n numColumns = _this$props.numColumns;\n\n if (numColumns > 1) {\n invariant(Array.isArray(items), 'FlatList: Encountered internal consistency error, expected each item to consist of an ' + 'array with 1-%s columns; instead, received a single item.', numColumns);\n return items.map(function (it, kk) {\n return keyExtractor(it, index * numColumns + kk);\n }).join(':');\n } else {\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.63 was deployed. To see the error delete this\n * comment and run Flow. */\n return keyExtractor(items, index);\n }\n };\n\n _this._renderItem = function (info) {\n var _this$props2 = _this.props,\n renderItem = _this$props2.renderItem,\n numColumns = _this$props2.numColumns,\n columnWrapperStyle = _this$props2.columnWrapperStyle;\n\n if (numColumns > 1) {\n var _item2 = info.item,\n _index = info.index;\n invariant(Array.isArray(_item2), 'Expected array of items with numColumns > 1');\n return React.createElement(View, {\n style: [{\n flexDirection: 'row'\n }, columnWrapperStyle]\n }, _item2.map(function (it, kk) {\n var element = renderItem({\n item: it,\n index: _index * numColumns + kk,\n separators: info.separators\n });\n return element && React.cloneElement(element, {\n key: kk\n });\n }));\n } else {\n return renderItem(info);\n }\n };\n\n if (_this.props.viewabilityConfigCallbackPairs) {\n _this._virtualizedListPairs = _this.props.viewabilityConfigCallbackPairs.map(function (pair) {\n return {\n viewabilityConfig: pair.viewabilityConfig,\n onViewableItemsChanged: _this._createOnViewableItemsChanged(pair.onViewableItemsChanged)\n };\n });\n } else if (_this.props.onViewableItemsChanged) {\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.63 was deployed. To see the error delete this\n * comment and run Flow. */\n _this._virtualizedListPairs.push({\n viewabilityConfig: _this.props.viewabilityConfig,\n onViewableItemsChanged: _this._createOnViewableItemsChanged(_this.props.onViewableItemsChanged)\n });\n }\n\n return _this;\n }\n\n _proto._checkProps = function _checkProps(props) {\n var getItem = props.getItem,\n getItemCount = props.getItemCount,\n horizontal = props.horizontal,\n legacyImplementation = props.legacyImplementation,\n numColumns = props.numColumns,\n columnWrapperStyle = props.columnWrapperStyle,\n onViewableItemsChanged = props.onViewableItemsChanged,\n viewabilityConfigCallbackPairs = props.viewabilityConfigCallbackPairs;\n invariant(!getItem && !getItemCount, 'FlatList does not support custom data formats.');\n\n if (numColumns > 1) {\n invariant(!horizontal, 'numColumns does not support horizontal.');\n } else {\n invariant(!columnWrapperStyle, 'columnWrapperStyle not supported for single column lists');\n }\n\n if (legacyImplementation) {\n invariant(numColumns === 1, 'Legacy list does not support multiple columns.'); // Warning: may not have full feature parity and is meant more for debugging and performance\n // comparison.\n\n if (!this._hasWarnedLegacy) {\n console.warn('FlatList: Using legacyImplementation - some features not supported and performance ' + 'may suffer');\n this._hasWarnedLegacy = true;\n }\n }\n\n invariant(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), 'FlatList does not support setting both onViewableItemsChanged and ' + 'viewabilityConfigCallbackPairs.');\n };\n\n _proto._pushMultiColumnViewable = function _pushMultiColumnViewable(arr, v) {\n var _this$props3 = this.props,\n numColumns = _this$props3.numColumns,\n keyExtractor = _this$props3.keyExtractor;\n v.item.forEach(function (item, ii) {\n invariant(v.index != null, 'Missing index!');\n var index = v.index * numColumns + ii;\n arr.push(_objectSpread({}, v, {\n item: item,\n key: keyExtractor(item, index),\n index: index\n }));\n });\n };\n\n _proto._createOnViewableItemsChanged = function _createOnViewableItemsChanged(onViewableItemsChanged) {\n var _this2 = this;\n\n return function (info) {\n var numColumns = _this2.props.numColumns;\n\n if (onViewableItemsChanged) {\n if (numColumns > 1) {\n var changed = [];\n var viewableItems = [];\n info.viewableItems.forEach(function (v) {\n return _this2._pushMultiColumnViewable(viewableItems, v);\n });\n info.changed.forEach(function (v) {\n return _this2._pushMultiColumnViewable(changed, v);\n });\n onViewableItemsChanged({\n viewableItems: viewableItems,\n changed: changed\n });\n } else {\n onViewableItemsChanged(info);\n }\n }\n };\n };\n\n _proto.render = function render() {\n if (this.props.legacyImplementation) {\n return (\n /* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.66 was deployed. To see the error delete\n * this comment and run Flow. */\n React.createElement(UnimplementedView, _extends({}, this.props, {\n /* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses\n * an error found when Flow v0.66 was deployed. To see the error\n * delete this comment and run Flow. */\n items: this.props.data,\n ref: this._captureRef\n }))\n );\n } else {\n return React.createElement(VirtualizedList, _extends({}, this.props, {\n renderItem: this._renderItem,\n getItem: this._getItem,\n getItemCount: this._getItemCount,\n keyExtractor: this._keyExtractor,\n ref: this._captureRef,\n viewabilityConfigCallbackPairs: this._virtualizedListPairs\n }));\n }\n };\n\n return FlatList;\n}(React.PureComponent);\n\nFlatList.defaultProps = defaultProps;\nexport default FlatList;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport FlatList from '../../vendor/react-native/FlatList';\nexport default FlatList;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport invariant from 'fbjs/lib/invariant';\n\nvar ensureComponentIsNative = function ensureComponentIsNative(component) {\n invariant(component && typeof component.setNativeProps === 'function', 'Touchable child must either be native or forward setNativeProps to a native component');\n};\n\nexport default ensureComponentIsNative;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport ensureComponentIsNative from '../../modules/ensureComponentIsNative';\nimport Image from '../Image';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React, { Component } from 'react';\nvar emptyObject = {};\n/**\n * Very simple drop-in replacement for which supports nesting views.\n */\n\nvar ImageBackground =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ImageBackground, _Component);\n\n function ImageBackground() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n _this._viewRef = null;\n\n _this._captureRef = function (ref) {\n _this._viewRef = ref;\n };\n\n return _this;\n }\n\n var _proto = ImageBackground.prototype;\n\n _proto.setNativeProps = function setNativeProps(props) {\n // Work-around flow\n var viewRef = this._viewRef;\n\n if (viewRef) {\n ensureComponentIsNative(viewRef);\n viewRef.setNativeProps(props);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n style = _this$props.style,\n imageStyle = _this$props.imageStyle,\n imageRef = _this$props.imageRef,\n props = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"style\", \"imageStyle\", \"imageRef\"]);\n\n return React.createElement(View, {\n ref: this._captureRef,\n style: style\n }, React.createElement(Image, _extends({}, props, {\n ref: imageRef,\n style: [StyleSheet.absoluteFill, {\n // Temporary Workaround:\n // Current (imperfect yet) implementation of overwrites width and height styles\n // (which is not quite correct), and these styles conflict with explicitly set styles\n // of and with our internal layout model here.\n // So, we have to proxy/reapply these styles explicitly for actual component.\n // This workaround should be removed after implementing proper support of\n // intrinsic content size of the .\n width: style.width,\n height: style.height,\n zIndex: -1\n }, imageStyle]\n })), children);\n };\n\n return ImageBackground;\n}(Component);\n\nImageBackground.defaultProps = {\n style: emptyObject\n};\nImageBackground.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, Image.propTypes, {\n imageStyle: Image.propTypes.style,\n style: ViewPropTypes.style\n}) : {};\nexport default ImageBackground;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport View from '../View';\nimport { number, oneOf } from 'prop-types';\nimport React, { Component } from 'react';\nimport ViewPropTypes from '../ViewPropTypes';\n\nvar KeyboardAvoidingView =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(KeyboardAvoidingView, _Component);\n\n function KeyboardAvoidingView() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n _this.frame = null;\n\n _this.onLayout = function (event) {\n _this.frame = event.nativeEvent.layout;\n };\n\n return _this;\n }\n\n var _proto = KeyboardAvoidingView.prototype;\n\n _proto.relativeKeyboardHeight = function relativeKeyboardHeight(keyboardFrame) {\n var frame = this.frame;\n\n if (!frame || !keyboardFrame) {\n return 0;\n }\n\n var keyboardY = keyboardFrame.screenY - this.props.keyboardVerticalOffset;\n return Math.max(frame.y + frame.height - keyboardY, 0);\n };\n\n _proto.onKeyboardChange = function onKeyboardChange(event) {};\n\n _proto.render = function render() {\n var _this$props = this.props,\n behavior = _this$props.behavior,\n contentContainerStyle = _this$props.contentContainerStyle,\n keyboardVerticalOffset = _this$props.keyboardVerticalOffset,\n rest = _objectWithoutPropertiesLoose(_this$props, [\"behavior\", \"contentContainerStyle\", \"keyboardVerticalOffset\"]);\n\n return React.createElement(View, _extends({\n onLayout: this.onLayout\n }, rest));\n };\n\n return KeyboardAvoidingView;\n}(Component);\n\nKeyboardAvoidingView.defaultProps = {\n keyboardVerticalOffset: 0\n};\nKeyboardAvoidingView.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n behavior: oneOf(['height', 'padding', 'position']),\n contentContainerStyle: ViewPropTypes.style,\n keyboardVerticalOffset: number.isRequired\n}) : {};\nexport default KeyboardAvoidingView;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule isEmpty\n */\n'use strict';\n/**\n * Mimics empty from PHP.\n */\n\nfunction isEmpty(obj) {\n if (Array.isArray(obj)) {\n return obj.length === 0;\n } else if (typeof obj === 'object') {\n for (var i in obj) {\n return false;\n }\n\n return true;\n } else {\n return !obj;\n }\n}\n\nexport default isEmpty;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ListViewDataSource\n * \n * @format\n */\n'use strict';\n\nimport invariant from 'fbjs/lib/invariant';\nimport isEmpty from '../isEmpty';\nimport warning from 'fbjs/lib/warning';\n\nfunction defaultGetRowData(dataBlob, sectionID, rowID) {\n return dataBlob[sectionID][rowID];\n}\n\nfunction defaultGetSectionHeaderData(dataBlob, sectionID) {\n return dataBlob[sectionID];\n}\n/**\n * Provides efficient data processing and access to the\n * `ListView` component. A `ListViewDataSource` is created with functions for\n * extracting data from the input blob, and comparing elements (with default\n * implementations for convenience). The input blob can be as simple as an\n * array of strings, or an object with rows nested inside section objects.\n *\n * To update the data in the datasource, use `cloneWithRows` (or\n * `cloneWithRowsAndSections` if you care about sections). The data in the\n * data source is immutable, so you can't modify it directly. The clone methods\n * suck in the new data and compute a diff for each row so ListView knows\n * whether to re-render it or not.\n *\n * In this example, a component receives data in chunks, handled by\n * `_onDataArrived`, which concats the new data onto the old data and updates the\n * data source. We use `concat` to create a new array - mutating `this._data`,\n * e.g. with `this._data.push(newRowData)`, would be an error. `_rowHasChanged`\n * understands the shape of the row data and knows how to efficiently compare\n * it.\n *\n * ```\n * getInitialState: function() {\n * var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged});\n * return {ds};\n * },\n * _onDataArrived(newData) {\n * this._data = this._data.concat(newData);\n * this.setState({\n * ds: this.state.ds.cloneWithRows(this._data)\n * });\n * }\n * ```\n */\n\n\nvar ListViewDataSource =\n/*#__PURE__*/\nfunction () {\n /**\n * You can provide custom extraction and `hasChanged` functions for section\n * headers and rows. If absent, data will be extracted with the\n * `defaultGetRowData` and `defaultGetSectionHeaderData` functions.\n *\n * The default extractor expects data of one of the following forms:\n *\n * { sectionID_1: { rowID_1: , ... }, ... }\n *\n * or\n *\n * { sectionID_1: [ , , ... ], ... }\n *\n * or\n *\n * [ [ , , ... ], ... ]\n *\n * The constructor takes in a params argument that can contain any of the\n * following:\n *\n * - getRowData(dataBlob, sectionID, rowID);\n * - getSectionHeaderData(dataBlob, sectionID);\n * - rowHasChanged(prevRowData, nextRowData);\n * - sectionHeaderHasChanged(prevSectionData, nextSectionData);\n */\n function ListViewDataSource(params) {\n invariant(params && typeof params.rowHasChanged === 'function', 'Must provide a rowHasChanged function.');\n this._rowHasChanged = params.rowHasChanged;\n this._getRowData = params.getRowData || defaultGetRowData;\n this._sectionHeaderHasChanged = params.sectionHeaderHasChanged;\n this._getSectionHeaderData = params.getSectionHeaderData || defaultGetSectionHeaderData;\n this._dataBlob = null;\n this._dirtyRows = [];\n this._dirtySections = [];\n this._cachedRowCount = 0; // These two private variables are accessed by outsiders because ListView\n // uses them to iterate over the data in this class.\n\n this.rowIdentities = [];\n this.sectionIdentities = [];\n }\n /**\n * Clones this `ListViewDataSource` with the specified `dataBlob` and\n * `rowIdentities`. The `dataBlob` is just an arbitrary blob of data. At\n * construction an extractor to get the interesting information was defined\n * (or the default was used).\n *\n * The `rowIdentities` is a 2D array of identifiers for rows.\n * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...]. If not provided, it's\n * assumed that the keys of the section data are the row identities.\n *\n * Note: This function does NOT clone the data in this data source. It simply\n * passes the functions defined at construction to a new data source with\n * the data specified. If you wish to maintain the existing data you must\n * handle merging of old and new data separately and then pass that into\n * this function as the `dataBlob`.\n */\n\n\n var _proto = ListViewDataSource.prototype;\n\n _proto.cloneWithRows = function cloneWithRows(dataBlob, rowIdentities) {\n var rowIds = rowIdentities ? [[].concat(rowIdentities)] : null;\n\n if (!this._sectionHeaderHasChanged) {\n this._sectionHeaderHasChanged = function () {\n return false;\n };\n }\n\n return this.cloneWithRowsAndSections({\n s1: dataBlob\n }, ['s1'], rowIds);\n }\n /**\n * This performs the same function as the `cloneWithRows` function but here\n * you also specify what your `sectionIdentities` are. If you don't care\n * about sections you should safely be able to use `cloneWithRows`.\n *\n * `sectionIdentities` is an array of identifiers for sections.\n * ie. ['s1', 's2', ...]. The identifiers should correspond to the keys or array indexes\n * of the data you wish to include. If not provided, it's assumed that the\n * keys of dataBlob are the section identities.\n *\n * Note: this returns a new object!\n *\n * ```\n * const dataSource = ds.cloneWithRowsAndSections({\n * addresses: ['row 1', 'row 2'],\n * phone_numbers: ['data 1', 'data 2'],\n * }, ['phone_numbers']);\n * ```\n */\n ;\n\n _proto.cloneWithRowsAndSections = function cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) {\n invariant(typeof this._sectionHeaderHasChanged === 'function', 'Must provide a sectionHeaderHasChanged function with section data.');\n invariant(!sectionIdentities || !rowIdentities || sectionIdentities.length === rowIdentities.length, 'row and section ids lengths must be the same');\n var newSource = new ListViewDataSource({\n getRowData: this._getRowData,\n getSectionHeaderData: this._getSectionHeaderData,\n rowHasChanged: this._rowHasChanged,\n sectionHeaderHasChanged: this._sectionHeaderHasChanged\n });\n newSource._dataBlob = dataBlob;\n\n if (sectionIdentities) {\n newSource.sectionIdentities = sectionIdentities;\n } else {\n newSource.sectionIdentities = Object.keys(dataBlob);\n }\n\n if (rowIdentities) {\n newSource.rowIdentities = rowIdentities;\n } else {\n newSource.rowIdentities = [];\n newSource.sectionIdentities.forEach(function (sectionID) {\n newSource.rowIdentities.push(Object.keys(dataBlob[sectionID]));\n });\n }\n\n newSource._cachedRowCount = countRows(newSource.rowIdentities);\n\n newSource._calculateDirtyArrays(this._dataBlob, this.sectionIdentities, this.rowIdentities);\n\n return newSource;\n }\n /**\n * Returns the total number of rows in the data source.\n *\n * If you are specifying the rowIdentities or sectionIdentities, then `getRowCount` will return the number of rows in the filtered data source.\n */\n ;\n\n _proto.getRowCount = function getRowCount() {\n return this._cachedRowCount;\n }\n /**\n * Returns the total number of rows in the data source (see `getRowCount` for how this is calculated) plus the number of sections in the data.\n *\n * If you are specifying the rowIdentities or sectionIdentities, then `getRowAndSectionCount` will return the number of rows & sections in the filtered data source.\n */\n ;\n\n _proto.getRowAndSectionCount = function getRowAndSectionCount() {\n return this._cachedRowCount + this.sectionIdentities.length;\n }\n /**\n * Returns if the row is dirtied and needs to be rerendered\n */\n ;\n\n _proto.rowShouldUpdate = function rowShouldUpdate(sectionIndex, rowIndex) {\n var needsUpdate = this._dirtyRows[sectionIndex][rowIndex];\n warning(needsUpdate !== undefined, 'missing dirtyBit for section, row: ' + sectionIndex + ', ' + rowIndex);\n return needsUpdate;\n }\n /**\n * Gets the data required to render the row.\n */\n ;\n\n _proto.getRowData = function getRowData(sectionIndex, rowIndex) {\n var sectionID = this.sectionIdentities[sectionIndex];\n var rowID = this.rowIdentities[sectionIndex][rowIndex];\n warning(sectionID !== undefined && rowID !== undefined, 'rendering invalid section, row: ' + sectionIndex + ', ' + rowIndex);\n return this._getRowData(this._dataBlob, sectionID, rowID);\n }\n /**\n * Gets the rowID at index provided if the dataSource arrays were flattened,\n * or null of out of range indexes.\n */\n ;\n\n _proto.getRowIDForFlatIndex = function getRowIDForFlatIndex(index) {\n var accessIndex = index;\n\n for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n if (accessIndex >= this.rowIdentities[ii].length) {\n accessIndex -= this.rowIdentities[ii].length;\n } else {\n return this.rowIdentities[ii][accessIndex];\n }\n }\n\n return null;\n }\n /**\n * Gets the sectionID at index provided if the dataSource arrays were flattened,\n * or null for out of range indexes.\n */\n ;\n\n _proto.getSectionIDForFlatIndex = function getSectionIDForFlatIndex(index) {\n var accessIndex = index;\n\n for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n if (accessIndex >= this.rowIdentities[ii].length) {\n accessIndex -= this.rowIdentities[ii].length;\n } else {\n return this.sectionIdentities[ii];\n }\n }\n\n return null;\n }\n /**\n * Returns an array containing the number of rows in each section\n */\n ;\n\n _proto.getSectionLengths = function getSectionLengths() {\n var results = [];\n\n for (var ii = 0; ii < this.sectionIdentities.length; ii++) {\n results.push(this.rowIdentities[ii].length);\n }\n\n return results;\n }\n /**\n * Returns if the section header is dirtied and needs to be rerendered\n */\n ;\n\n _proto.sectionHeaderShouldUpdate = function sectionHeaderShouldUpdate(sectionIndex) {\n var needsUpdate = this._dirtySections[sectionIndex];\n warning(needsUpdate !== undefined, 'missing dirtyBit for section: ' + sectionIndex);\n return needsUpdate;\n }\n /**\n * Gets the data required to render the section header\n */\n ;\n\n _proto.getSectionHeaderData = function getSectionHeaderData(sectionIndex) {\n if (!this._getSectionHeaderData) {\n return null;\n }\n\n var sectionID = this.sectionIdentities[sectionIndex];\n warning(sectionID !== undefined, 'renderSection called on invalid section: ' + sectionIndex);\n return this._getSectionHeaderData(this._dataBlob, sectionID);\n }\n /**\n * Private members and methods.\n */\n ;\n\n _proto._calculateDirtyArrays = function _calculateDirtyArrays(prevDataBlob, prevSectionIDs, prevRowIDs) {\n // construct a hashmap of the existing (old) id arrays\n var prevSectionsHash = keyedDictionaryFromArray(prevSectionIDs);\n var prevRowsHash = {};\n\n for (var ii = 0; ii < prevRowIDs.length; ii++) {\n var sectionID = prevSectionIDs[ii];\n warning(!prevRowsHash[sectionID], 'SectionID appears more than once: ' + sectionID);\n prevRowsHash[sectionID] = keyedDictionaryFromArray(prevRowIDs[ii]);\n } // compare the 2 identity array and get the dirtied rows\n\n\n this._dirtySections = [];\n this._dirtyRows = [];\n var dirty;\n\n for (var sIndex = 0; sIndex < this.sectionIdentities.length; sIndex++) {\n var sectionID = this.sectionIdentities[sIndex]; // dirty if the sectionHeader is new or _sectionHasChanged is true\n\n dirty = !prevSectionsHash[sectionID];\n var sectionHeaderHasChanged = this._sectionHeaderHasChanged;\n\n if (!dirty && sectionHeaderHasChanged) {\n dirty = sectionHeaderHasChanged(this._getSectionHeaderData(prevDataBlob, sectionID), this._getSectionHeaderData(this._dataBlob, sectionID));\n }\n\n this._dirtySections.push(!!dirty);\n\n this._dirtyRows[sIndex] = [];\n\n for (var rIndex = 0; rIndex < this.rowIdentities[sIndex].length; rIndex++) {\n var rowID = this.rowIdentities[sIndex][rIndex]; // dirty if the section is new, row is new or _rowHasChanged is true\n\n dirty = !prevSectionsHash[sectionID] || !prevRowsHash[sectionID][rowID] || this._rowHasChanged(this._getRowData(prevDataBlob, sectionID, rowID), this._getRowData(this._dataBlob, sectionID, rowID));\n\n this._dirtyRows[sIndex].push(!!dirty);\n }\n }\n };\n\n return ListViewDataSource;\n}();\n\nfunction countRows(allRowIDs) {\n var totalRows = 0;\n\n for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n var rowIDs = allRowIDs[sectionIdx];\n totalRows += rowIDs.length;\n }\n\n return totalRows;\n}\n\nfunction keyedDictionaryFromArray(arr) {\n if (isEmpty(arr)) {\n return {};\n }\n\n var result = {};\n\n for (var ii = 0; ii < arr.length; ii++) {\n var key = arr[ii];\n warning(!result[key], 'Value appears more than once in array: ' + key);\n result[key] = true;\n }\n\n return result;\n}\n\nexport default ListViewDataSource;","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) 2015-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport { Component } from 'react';\nimport { bool, func } from 'prop-types';\n/**\n * Renders static content efficiently by allowing React to short-circuit the\n * reconciliation process. This component should be used when you know that a\n * subtree of components will never need to be updated.\n *\n * const someValue = ...; // We know for certain this value will never change.\n * return (\n * } />\n * );\n *\n * Typically, you will not need to use this component and should opt for normal\n * React reconciliation.\n */\n\nvar StaticRenderer =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(StaticRenderer, _Component);\n\n function StaticRenderer() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = StaticRenderer.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n return nextProps.shouldUpdate;\n };\n\n _proto.render = function render() {\n return this.props.render();\n };\n\n return StaticRenderer;\n}(Component);\n\nexport { StaticRenderer as default };\nStaticRenderer.propTypes = process.env.NODE_ENV !== \"production\" ? {\n render: func.isRequired,\n shouldUpdate: bool.isRequired\n} : {};","'use strict';\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport React from 'react';\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nfunction cloneReferencedElement(element, config) {\n var cloneRef = config.ref;\n var originalRef = element.ref;\n\n for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n children[_key - 2] = arguments[_key];\n }\n\n if (originalRef == null || cloneRef == null) {\n return React.cloneElement.apply(React, [element, config].concat(children));\n }\n\n if (typeof originalRef !== 'function') {\n if (__DEV__) {\n console.warn('Cloning an element with a ref that will be overwritten because it ' + 'is not a function. Use a composable callback-style ref instead. ' + 'Ignoring ref: ' + originalRef);\n }\n\n return React.cloneElement.apply(React, [element, config].concat(children));\n }\n\n return React.cloneElement.apply(React, [element, _objectSpread({}, config, {\n ref: function ref(component) {\n cloneRef(component);\n originalRef(component);\n }\n })].concat(children));\n}\n\nexport default cloneReferencedElement;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule ListView\n * \n * @format\n */\n'use strict';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport ListViewDataSource from './ListViewDataSource';\nimport Platform from '../../../exports/Platform';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport findNodeHandle from '../../../exports/findNodeHandle';\nimport NativeModules from '../../../exports/NativeModules';\nimport ScrollView from '../../../exports/ScrollView';\nimport ScrollResponder from '../../../modules/ScrollResponder';\nimport StaticRenderer from '../StaticRenderer';\nimport TimerMixin from 'react-timer-mixin';\nimport View from '../../../exports/View';\nimport cloneReferencedElement from './cloneReferencedElement';\nimport createReactClass from 'create-react-class';\nimport isEmpty from '../isEmpty';\n\nvar merge = function merge() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return Object.assign.apply(Object, [{}].concat(args));\n};\n\nvar RCTScrollViewManager = NativeModules.ScrollViewManager;\nvar DEFAULT_PAGE_SIZE = 1;\nvar DEFAULT_INITIAL_ROWS = 10;\nvar DEFAULT_SCROLL_RENDER_AHEAD = 1000;\nvar DEFAULT_END_REACHED_THRESHOLD = 1000;\nvar DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;\n/**\n * DEPRECATED - use one of the new list components, such as [`FlatList`](docs/flatlist.html)\n * or [`SectionList`](docs/sectionlist.html) for bounded memory use, fewer bugs,\n * better performance, an easier to use API, and more features. Check out this\n * [blog post](https://facebook.github.io/react-native/blog/2017/03/13/better-list-views.html)\n * for more details.\n *\n * ListView - A core component designed for efficient display of vertically\n * scrolling lists of changing data. The minimal API is to create a\n * [`ListView.DataSource`](docs/listviewdatasource.html), populate it with a simple\n * array of data blobs, and instantiate a `ListView` component with that data\n * source and a `renderRow` callback which takes a blob from the data array and\n * returns a renderable component.\n *\n * Minimal example:\n *\n * ```\n * class MyComponent extends Component {\n * constructor() {\n * super();\n * const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});\n * this.state = {\n * dataSource: ds.cloneWithRows(['row 1', 'row 2']),\n * };\n * }\n *\n * render() {\n * return (\n * {rowData}}\n * />\n * );\n * }\n * }\n * ```\n *\n * ListView also supports more advanced features, including sections with sticky\n * section headers, header and footer support, callbacks on reaching the end of\n * the available data (`onEndReached`) and on the set of rows that are visible\n * in the device viewport change (`onChangeVisibleRows`), and several\n * performance optimizations.\n *\n * There are a few performance operations designed to make ListView scroll\n * smoothly while dynamically loading potentially very large (or conceptually\n * infinite) data sets:\n *\n * * Only re-render changed rows - the rowHasChanged function provided to the\n * data source tells the ListView if it needs to re-render a row because the\n * source data has changed - see ListViewDataSource for more details.\n *\n * * Rate-limited row rendering - By default, only one row is rendered per\n * event-loop (customizable with the `pageSize` prop). This breaks up the\n * work into smaller chunks to reduce the chance of dropping frames while\n * rendering rows.\n */\n\nvar ListView = createReactClass({\n displayName: 'ListView',\n _childFrames: [],\n _sentEndForContentLength: null,\n _scrollComponent: null,\n _prevRenderedRowsCount: 0,\n _visibleRows: {},\n scrollProperties: {},\n mixins: [ScrollResponder.Mixin, TimerMixin],\n statics: {\n DataSource: ListViewDataSource\n },\n\n /**\n * You must provide a renderRow function. If you omit any of the other render\n * functions, ListView will simply skip rendering them.\n *\n * - renderRow(rowData, sectionID, rowID, highlightRow);\n * - renderSectionHeader(sectionData, sectionID);\n */\n propTypes: _objectSpread({}, ScrollView.propTypes, {\n /**\n * An instance of [ListView.DataSource](docs/listviewdatasource.html) to use\n */\n dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired,\n\n /**\n * (sectionID, rowID, adjacentRowHighlighted) => renderable\n *\n * If provided, a renderable component to be rendered as the separator\n * below each row but not the last row if there is a section header below.\n * Take a sectionID and rowID of the row above and whether its adjacent row\n * is highlighted.\n */\n renderSeparator: PropTypes.func,\n\n /**\n * (rowData, sectionID, rowID, highlightRow) => renderable\n *\n * Takes a data entry from the data source and its ids and should return\n * a renderable component to be rendered as the row. By default the data\n * is exactly what was put into the data source, but it's also possible to\n * provide custom extractors. ListView can be notified when a row is\n * being highlighted by calling `highlightRow(sectionID, rowID)`. This\n * sets a boolean value of adjacentRowHighlighted in renderSeparator, allowing you\n * to control the separators above and below the highlighted row. The highlighted\n * state of a row can be reset by calling highlightRow(null).\n */\n renderRow: PropTypes.func.isRequired,\n\n /**\n * How many rows to render on initial component mount. Use this to make\n * it so that the first screen worth of data appears at one time instead of\n * over the course of multiple frames.\n */\n initialListSize: PropTypes.number.isRequired,\n\n /**\n * Called when all rows have been rendered and the list has been scrolled\n * to within onEndReachedThreshold of the bottom. The native scroll\n * event is provided.\n */\n onEndReached: PropTypes.func,\n\n /**\n * Threshold in pixels (virtual, not physical) for calling onEndReached.\n */\n onEndReachedThreshold: PropTypes.number.isRequired,\n\n /**\n * Number of rows to render per event loop. Note: if your 'rows' are actually\n * cells, i.e. they don't span the full width of your view (as in the\n * ListViewGridLayoutExample), you should set the pageSize to be a multiple\n * of the number of cells per row, otherwise you're likely to see gaps at\n * the edge of the ListView as new pages are loaded.\n */\n pageSize: PropTypes.number.isRequired,\n\n /**\n * () => renderable\n *\n * The header and footer are always rendered (if these props are provided)\n * on every render pass. If they are expensive to re-render, wrap them\n * in StaticContainer or other mechanism as appropriate. Footer is always\n * at the bottom of the list, and header at the top, on every render pass.\n * In a horizontal ListView, the header is rendered on the left and the\n * footer on the right.\n */\n renderFooter: PropTypes.func,\n renderHeader: PropTypes.func,\n\n /**\n * (sectionData, sectionID) => renderable\n *\n * If provided, a header is rendered for this section.\n */\n renderSectionHeader: PropTypes.func,\n\n /**\n * (props) => renderable\n *\n * A function that returns the scrollable component in which the list rows\n * are rendered. Defaults to returning a ScrollView with the given props.\n */\n renderScrollComponent: PropTypes.func.isRequired,\n\n /**\n * How early to start rendering rows before they come on screen, in\n * pixels.\n */\n scrollRenderAheadDistance: PropTypes.number.isRequired,\n\n /**\n * (visibleRows, changedRows) => void\n *\n * Called when the set of visible rows changes. `visibleRows` maps\n * { sectionID: { rowID: true }} for all the visible rows, and\n * `changedRows` maps { sectionID: { rowID: true | false }} for the rows\n * that have changed their visibility, with true indicating visible, and\n * false indicating the view has moved out of view.\n */\n onChangeVisibleRows: PropTypes.func,\n\n /**\n * A performance optimization for improving scroll perf of\n * large lists, used in conjunction with overflow: 'hidden' on the row\n * containers. This is enabled by default.\n */\n removeClippedSubviews: PropTypes.bool,\n\n /**\n * Makes the sections headers sticky. The sticky behavior means that it\n * will scroll with the content at the top of the section until it reaches\n * the top of the screen, at which point it will stick to the top until it\n * is pushed off the screen by the next section header. This property is\n * not supported in conjunction with `horizontal={true}`. Only enabled by\n * default on iOS because of typical platform standards.\n */\n stickySectionHeadersEnabled: PropTypes.bool,\n\n /**\n * An array of child indices determining which children get docked to the\n * top of the screen when scrolling. For example, passing\n * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the\n * top of the scroll view. This property is not supported in conjunction\n * with `horizontal={true}`.\n */\n stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number).isRequired,\n\n /**\n * Flag indicating whether empty section headers should be rendered. In the future release\n * empty section headers will be rendered by default, and the flag will be deprecated.\n * If empty sections are not desired to be rendered their indices should be excluded from sectionID object.\n */\n enableEmptySections: PropTypes.bool\n }),\n\n /**\n * Exports some data, e.g. for perf investigations or analytics.\n */\n getMetrics: function getMetrics() {\n return {\n contentLength: this.scrollProperties.contentLength,\n totalRows: this.props.enableEmptySections ? this.props.dataSource.getRowAndSectionCount() : this.props.dataSource.getRowCount(),\n renderedRows: this.state.curRenderedRowsCount,\n visibleRows: Object.keys(this._visibleRows).length\n };\n },\n\n /**\n * Provides a handle to the underlying scroll responder.\n * Note that `this._scrollComponent` might not be a `ScrollView`, so we\n * need to check that it responds to `getScrollResponder` before calling it.\n */\n getScrollResponder: function getScrollResponder() {\n if (this._scrollComponent && this._scrollComponent.getScrollResponder) {\n return this._scrollComponent.getScrollResponder();\n }\n },\n getScrollableNode: function getScrollableNode() {\n if (this._scrollComponent && this._scrollComponent.getScrollableNode) {\n return this._scrollComponent.getScrollableNode();\n } else {\n return findNodeHandle(this._scrollComponent);\n }\n },\n\n /**\n * Scrolls to a given x, y offset, either immediately or with a smooth animation.\n *\n * See `ScrollView#scrollTo`.\n */\n scrollTo: function scrollTo() {\n if (this._scrollComponent && this._scrollComponent.scrollTo) {\n var _this$_scrollComponen;\n\n (_this$_scrollComponen = this._scrollComponent).scrollTo.apply(_this$_scrollComponen, arguments);\n }\n },\n\n /**\n * If this is a vertical ListView scrolls to the bottom.\n * If this is a horizontal ListView scrolls to the right.\n *\n * Use `scrollToEnd({animated: true})` for smooth animated scrolling,\n * `scrollToEnd({animated: false})` for immediate scrolling.\n * If no options are passed, `animated` defaults to true.\n *\n * See `ScrollView#scrollToEnd`.\n */\n scrollToEnd: function scrollToEnd(options) {\n if (this._scrollComponent) {\n if (this._scrollComponent.scrollToEnd) {\n this._scrollComponent.scrollToEnd(options);\n } else {\n console.warn('The scroll component used by the ListView does not support ' + 'scrollToEnd. Check the renderScrollComponent prop of your ListView.');\n }\n }\n },\n\n /**\n * Displays the scroll indicators momentarily.\n *\n * @platform ios\n */\n flashScrollIndicators: function flashScrollIndicators() {\n if (this._scrollComponent && this._scrollComponent.flashScrollIndicators) {\n this._scrollComponent.flashScrollIndicators();\n }\n },\n setNativeProps: function setNativeProps(props) {\n if (this._scrollComponent) {\n this._scrollComponent.setNativeProps(props);\n }\n },\n\n /**\n * React life cycle hooks.\n */\n getDefaultProps: function getDefaultProps() {\n return {\n initialListSize: DEFAULT_INITIAL_ROWS,\n pageSize: DEFAULT_PAGE_SIZE,\n renderScrollComponent: function renderScrollComponent(props) {\n return React.createElement(ScrollView, props);\n },\n scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD,\n onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD,\n stickySectionHeadersEnabled: Platform.OS === 'ios' || Platform.OS === 'web',\n stickyHeaderIndices: []\n };\n },\n getInitialState: function getInitialState() {\n return {\n curRenderedRowsCount: this.props.initialListSize,\n highlightedRow: {}\n };\n },\n getInnerViewNode: function getInnerViewNode() {\n return this._scrollComponent.getInnerViewNode();\n },\n UNSAFE_componentWillMount: function UNSAFE_componentWillMount() {\n // this data should never trigger a render pass, so don't put in state\n this.scrollProperties = {\n visibleLength: null,\n contentLength: null,\n offset: 0\n };\n this._childFrames = [];\n this._visibleRows = {};\n this._prevRenderedRowsCount = 0;\n this._sentEndForContentLength = null;\n },\n componentDidMount: function componentDidMount() {\n var _this = this; // do this in animation frame until componentDidMount actually runs after\n // the component is laid out\n\n\n this.requestAnimationFrame(function () {\n _this._measureAndUpdateScrollProps();\n });\n },\n UNSAFE_componentWillReceiveProps: function UNSAFE_componentWillReceiveProps(nextProps) {\n var _this2 = this;\n\n if (this.props.dataSource !== nextProps.dataSource || this.props.initialListSize !== nextProps.initialListSize) {\n this.setState(function (state, props) {\n _this2._prevRenderedRowsCount = 0;\n return {\n curRenderedRowsCount: Math.min(Math.max(state.curRenderedRowsCount, props.initialListSize), props.enableEmptySections ? props.dataSource.getRowAndSectionCount() : props.dataSource.getRowCount())\n };\n }, function () {\n return _this2._renderMoreRowsIfNeeded();\n });\n }\n },\n componentDidUpdate: function componentDidUpdate() {\n var _this3 = this;\n\n this.requestAnimationFrame(function () {\n _this3._measureAndUpdateScrollProps();\n });\n },\n _onRowHighlighted: function _onRowHighlighted(sectionID, rowID) {\n this.setState({\n highlightedRow: {\n sectionID: sectionID,\n rowID: rowID\n }\n });\n },\n render: function render() {\n var bodyComponents = [];\n var dataSource = this.props.dataSource;\n var allRowIDs = dataSource.rowIdentities;\n var rowCount = 0;\n var stickySectionHeaderIndices = [];\n var renderSectionHeader = this.props.renderSectionHeader;\n var header = this.props.renderHeader && this.props.renderHeader();\n var footer = this.props.renderFooter && this.props.renderFooter();\n var totalIndex = header ? 1 : 0;\n\n for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n var sectionID = dataSource.sectionIdentities[sectionIdx];\n var rowIDs = allRowIDs[sectionIdx];\n\n if (rowIDs.length === 0) {\n if (this.props.enableEmptySections === undefined) {\n /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses\n * an error found when Flow v0.54 was deployed. To see the error\n * delete this comment and run Flow. */\n var warning = require('fbjs/lib/warning');\n\n warning(false, 'In next release empty section headers will be rendered.' + \" In this release you can use 'enableEmptySections' flag to render empty section headers.\");\n continue;\n } else {\n var invariant = require('fbjs/lib/invariant');\n\n invariant(this.props.enableEmptySections, \"In next release 'enableEmptySections' flag will be deprecated, empty section headers will always be rendered.\" + ' If empty section headers are not desirable their indices should be excluded from sectionIDs object.' + \" In this release 'enableEmptySections' may only have value 'true' to allow empty section headers rendering.\");\n }\n }\n\n if (renderSectionHeader) {\n var element = renderSectionHeader(dataSource.getSectionHeaderData(sectionIdx), sectionID);\n\n if (element) {\n bodyComponents.push(React.cloneElement(element, {\n key: 's_' + sectionID\n }));\n\n if (this.props.stickySectionHeadersEnabled) {\n stickySectionHeaderIndices.push(totalIndex);\n }\n\n totalIndex++;\n }\n }\n\n for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {\n var rowID = rowIDs[rowIdx];\n var comboID = sectionID + '_' + rowID;\n var shouldUpdateRow = rowCount >= this._prevRenderedRowsCount && dataSource.rowShouldUpdate(sectionIdx, rowIdx);\n var row = React.createElement(StaticRenderer, {\n key: 'r_' + comboID,\n shouldUpdate: !!shouldUpdateRow,\n render: this.props.renderRow.bind(null, dataSource.getRowData(sectionIdx, rowIdx), sectionID, rowID, this._onRowHighlighted)\n });\n bodyComponents.push(row);\n totalIndex++;\n\n if (this.props.renderSeparator && (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) {\n var adjacentRowHighlighted = this.state.highlightedRow.sectionID === sectionID && (this.state.highlightedRow.rowID === rowID || this.state.highlightedRow.rowID === rowIDs[rowIdx + 1]);\n var separator = this.props.renderSeparator(sectionID, rowID, adjacentRowHighlighted);\n\n if (separator) {\n bodyComponents.push(React.createElement(View, {\n key: 's_' + comboID\n }, separator));\n totalIndex++;\n }\n }\n\n if (++rowCount === this.state.curRenderedRowsCount) {\n break;\n }\n }\n\n if (rowCount >= this.state.curRenderedRowsCount) {\n break;\n }\n }\n\n var _this$props = this.props,\n renderScrollComponent = _this$props.renderScrollComponent,\n props = _objectWithoutPropertiesLoose(_this$props, [\"renderScrollComponent\"]);\n\n if (!props.scrollEventThrottle) {\n props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE;\n }\n\n if (props.removeClippedSubviews === undefined) {\n props.removeClippedSubviews = true;\n }\n\n Object.assign(props, {\n onScroll: this._onScroll,\n stickyHeaderIndices: this.props.stickyHeaderIndices.concat(stickySectionHeaderIndices),\n // Do not pass these events downstream to ScrollView since they will be\n // registered in ListView's own ScrollResponder.Mixin\n onKeyboardWillShow: undefined,\n onKeyboardWillHide: undefined,\n onKeyboardDidShow: undefined,\n onKeyboardDidHide: undefined\n });\n return cloneReferencedElement(renderScrollComponent(props), {\n ref: this._setScrollComponentRef,\n onContentSizeChange: this._onContentSizeChange,\n onLayout: this._onLayout,\n DEPRECATED_sendUpdatedChildFrames: typeof props.onChangeVisibleRows !== undefined\n }, header, bodyComponents, footer);\n },\n\n /**\n * Private methods\n */\n _measureAndUpdateScrollProps: function _measureAndUpdateScrollProps() {\n var scrollComponent = this.getScrollResponder();\n\n if (!scrollComponent || !scrollComponent.getInnerViewNode) {\n return;\n } // RCTScrollViewManager.calculateChildFrames is not available on\n // every platform\n\n\n RCTScrollViewManager && RCTScrollViewManager.calculateChildFrames && RCTScrollViewManager.calculateChildFrames(findNodeHandle(scrollComponent), this._updateVisibleRows);\n },\n _setScrollComponentRef: function _setScrollComponentRef(scrollComponent) {\n this._scrollComponent = scrollComponent;\n },\n _onContentSizeChange: function _onContentSizeChange(width, height) {\n var contentLength = !this.props.horizontal ? height : width;\n\n if (contentLength !== this.scrollProperties.contentLength) {\n this.scrollProperties.contentLength = contentLength;\n\n this._updateVisibleRows();\n\n this._renderMoreRowsIfNeeded();\n }\n\n this.props.onContentSizeChange && this.props.onContentSizeChange(width, height);\n },\n _onLayout: function _onLayout(event) {\n var _event$nativeEvent$la = event.nativeEvent.layout,\n width = _event$nativeEvent$la.width,\n height = _event$nativeEvent$la.height;\n var visibleLength = !this.props.horizontal ? height : width;\n\n if (visibleLength !== this.scrollProperties.visibleLength) {\n this.scrollProperties.visibleLength = visibleLength;\n\n this._updateVisibleRows();\n\n this._renderMoreRowsIfNeeded();\n }\n\n this.props.onLayout && this.props.onLayout(event);\n },\n _maybeCallOnEndReached: function _maybeCallOnEndReached(event) {\n if (this.props.onEndReached && this.scrollProperties.contentLength !== this._sentEndForContentLength && this._getDistanceFromEnd(this.scrollProperties) < this.props.onEndReachedThreshold && this.state.curRenderedRowsCount === (this.props.enableEmptySections ? this.props.dataSource.getRowAndSectionCount() : this.props.dataSource.getRowCount())) {\n this._sentEndForContentLength = this.scrollProperties.contentLength;\n this.props.onEndReached(event);\n return true;\n }\n\n return false;\n },\n _renderMoreRowsIfNeeded: function _renderMoreRowsIfNeeded() {\n if (this.scrollProperties.contentLength === null || this.scrollProperties.visibleLength === null || this.state.curRenderedRowsCount === (this.props.enableEmptySections ? this.props.dataSource.getRowAndSectionCount() : this.props.dataSource.getRowCount())) {\n this._maybeCallOnEndReached();\n\n return;\n }\n\n var distanceFromEnd = this._getDistanceFromEnd(this.scrollProperties);\n\n if (distanceFromEnd < this.props.scrollRenderAheadDistance) {\n this._pageInNewRows();\n }\n },\n _pageInNewRows: function _pageInNewRows() {\n var _this4 = this;\n\n this.setState(function (state, props) {\n var rowsToRender = Math.min(state.curRenderedRowsCount + props.pageSize, props.enableEmptySections ? props.dataSource.getRowAndSectionCount() : props.dataSource.getRowCount());\n _this4._prevRenderedRowsCount = state.curRenderedRowsCount;\n return {\n curRenderedRowsCount: rowsToRender\n };\n }, function () {\n _this4._measureAndUpdateScrollProps();\n\n _this4._prevRenderedRowsCount = _this4.state.curRenderedRowsCount;\n });\n },\n _getDistanceFromEnd: function _getDistanceFromEnd(scrollProperties) {\n return scrollProperties.contentLength - scrollProperties.visibleLength - scrollProperties.offset;\n },\n _updateVisibleRows: function _updateVisibleRows(updatedFrames) {\n var _this5 = this;\n\n if (!this.props.onChangeVisibleRows) {\n return; // No need to compute visible rows if there is no callback\n }\n\n if (updatedFrames) {\n updatedFrames.forEach(function (newFrame) {\n _this5._childFrames[newFrame.index] = merge(newFrame);\n });\n }\n\n var isVertical = !this.props.horizontal;\n var dataSource = this.props.dataSource;\n var visibleMin = this.scrollProperties.offset;\n var visibleMax = visibleMin + this.scrollProperties.visibleLength;\n var allRowIDs = dataSource.rowIdentities;\n var header = this.props.renderHeader && this.props.renderHeader();\n var totalIndex = header ? 1 : 0;\n var visibilityChanged = false;\n var changedRows = {};\n\n for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {\n var rowIDs = allRowIDs[sectionIdx];\n\n if (rowIDs.length === 0) {\n continue;\n }\n\n var sectionID = dataSource.sectionIdentities[sectionIdx];\n\n if (this.props.renderSectionHeader) {\n totalIndex++;\n }\n\n var visibleSection = this._visibleRows[sectionID];\n\n if (!visibleSection) {\n visibleSection = {};\n }\n\n for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {\n var rowID = rowIDs[rowIdx];\n var frame = this._childFrames[totalIndex];\n totalIndex++;\n\n if (this.props.renderSeparator && (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) {\n totalIndex++;\n }\n\n if (!frame) {\n break;\n }\n\n var rowVisible = visibleSection[rowID];\n var min = isVertical ? frame.y : frame.x;\n var max = min + (isVertical ? frame.height : frame.width);\n\n if (!min && !max || min === max) {\n break;\n }\n\n if (min > visibleMax || max < visibleMin) {\n if (rowVisible) {\n visibilityChanged = true;\n delete visibleSection[rowID];\n\n if (!changedRows[sectionID]) {\n changedRows[sectionID] = {};\n }\n\n changedRows[sectionID][rowID] = false;\n }\n } else if (!rowVisible) {\n visibilityChanged = true;\n visibleSection[rowID] = true;\n\n if (!changedRows[sectionID]) {\n changedRows[sectionID] = {};\n }\n\n changedRows[sectionID][rowID] = true;\n }\n }\n\n if (!isEmpty(visibleSection)) {\n this._visibleRows[sectionID] = visibleSection;\n } else if (this._visibleRows[sectionID]) {\n delete this._visibleRows[sectionID];\n }\n }\n\n visibilityChanged && this.props.onChangeVisibleRows(this._visibleRows, changedRows);\n },\n _onScroll: function _onScroll(e) {\n var isVertical = !this.props.horizontal;\n this.scrollProperties.visibleLength = e.nativeEvent.layoutMeasurement[isVertical ? 'height' : 'width'];\n this.scrollProperties.contentLength = e.nativeEvent.contentSize[isVertical ? 'height' : 'width'];\n this.scrollProperties.offset = e.nativeEvent.contentOffset[isVertical ? 'y' : 'x'];\n\n this._updateVisibleRows(e.nativeEvent.updatedChildFrames);\n\n if (!this._maybeCallOnEndReached(e)) {\n this._renderMoreRowsIfNeeded();\n }\n\n if (this.props.onEndReached && this._getDistanceFromEnd(this.scrollProperties) > this.props.onEndReachedThreshold) {\n // Scrolled out of the end zone, so it should be able to trigger again.\n this._sentEndForContentLength = null;\n }\n\n this.props.onScroll && this.props.onScroll(e);\n }\n});\nexport default ListView;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport ListView from '../../vendor/react-native/ListView';\nexport default ListView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport ColorPropType from '../ColorPropType';\nimport { Component } from 'react';\nimport createElement from '../createElement';\nimport { number, oneOfType, string } from 'prop-types';\n\nvar PickerItem =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(PickerItem, _Component);\n\n function PickerItem() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = PickerItem.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n color = _this$props.color,\n label = _this$props.label,\n testID = _this$props.testID,\n value = _this$props.value;\n var style = {\n color: color\n };\n return createElement('option', {\n style: style,\n testID: testID,\n value: value\n }, label);\n };\n\n return PickerItem;\n}(Component);\n\nexport { PickerItem as default };\nPickerItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n color: ColorPropType,\n label: string.isRequired,\n testID: string,\n value: oneOfType([number, string])\n} : {};","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport { Component } from 'react';\nimport createElement from '../createElement';\nimport PickerItem from './PickerItem';\nimport PickerItemPropType from './PickerItemPropType';\nimport PickerStylePropTypes from './PickerStylePropTypes';\nimport StyleSheetPropType from '../../modules/StyleSheetPropType';\nimport StyleSheet from '../StyleSheet';\nimport { arrayOf, bool, func, number, oneOfType, string } from 'prop-types';\nimport ViewPropTypes from '../ViewPropTypes';\nvar pickerStyleType = process.env.NODE_ENV !== \"production\" ? StyleSheetPropType(PickerStylePropTypes) : {};\n\nvar Picker =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Picker, _Component);\n\n function Picker() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this._handleChange = function (e) {\n var onValueChange = _this.props.onValueChange;\n var _e$target = e.target,\n selectedIndex = _e$target.selectedIndex,\n value = _e$target.value;\n\n if (onValueChange) {\n onValueChange(value, selectedIndex);\n }\n };\n\n return _this;\n }\n\n var _proto = Picker.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n enabled = _this$props.enabled,\n selectedValue = _this$props.selectedValue,\n style = _this$props.style,\n testID = _this$props.testID,\n itemStyle = _this$props.itemStyle,\n mode = _this$props.mode,\n prompt = _this$props.prompt,\n onValueChange = _this$props.onValueChange,\n otherProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"enabled\", \"selectedValue\", \"style\", \"testID\", \"itemStyle\", \"mode\", \"prompt\", \"onValueChange\"]);\n\n return createElement('select', _objectSpread({\n children: children,\n disabled: enabled === false ? true : undefined,\n onChange: this._handleChange,\n style: [styles.initial, style],\n testID: testID,\n value: selectedValue\n }, otherProps));\n };\n\n return Picker;\n}(Component);\n\nPicker.Item = PickerItem;\nPicker.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n children: oneOfType([PickerItemPropType, arrayOf(PickerItemPropType)]),\n enabled: bool,\n onValueChange: func,\n selectedValue: oneOfType([number, string]),\n style: pickerStyleType,\n testID: string\n}) : {};\nvar styles = StyleSheet.create({\n initial: {\n fontFamily: 'System',\n fontSize: 'inherit',\n margin: 0\n }\n});\nexport default applyNativeMethods(Picker);","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport ColorPropType from '../ColorPropType';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React, { Component } from 'react';\nimport { bool, number } from 'prop-types';\n\nvar ProgressBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ProgressBar, _Component);\n\n function ProgressBar() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this._setProgressRef = function (element) {\n _this._progressElement = element;\n };\n\n _this._updateProgressWidth = function () {\n var _this$props = _this.props,\n indeterminate = _this$props.indeterminate,\n progress = _this$props.progress;\n var percentageProgress = indeterminate ? 50 : progress * 100;\n var width = indeterminate ? '25%' : percentageProgress + \"%\";\n\n if (_this._progressElement) {\n _this._progressElement.setNativeProps({\n style: {\n width: width\n }\n });\n }\n };\n\n return _this;\n }\n\n var _proto = ProgressBar.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this._updateProgressWidth();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this._updateProgressWidth();\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n color = _this$props2.color,\n indeterminate = _this$props2.indeterminate,\n progress = _this$props2.progress,\n trackColor = _this$props2.trackColor,\n style = _this$props2.style,\n other = _objectWithoutPropertiesLoose(_this$props2, [\"color\", \"indeterminate\", \"progress\", \"trackColor\", \"style\"]);\n\n var percentageProgress = progress * 100;\n return React.createElement(View, _extends({}, other, {\n accessibilityRole: \"progressbar\",\n \"aria-valuemax\": \"100\",\n \"aria-valuemin\": \"0\",\n \"aria-valuenow\": indeterminate ? null : percentageProgress,\n style: [styles.track, style, {\n backgroundColor: trackColor\n }]\n }), React.createElement(View, {\n ref: this._setProgressRef,\n style: [styles.progress, indeterminate && styles.animation, {\n backgroundColor: color\n }]\n }));\n };\n\n return ProgressBar;\n}(Component);\n\nProgressBar.displayName = 'ProgressBar';\nProgressBar.defaultProps = {\n color: '#1976D2',\n indeterminate: false,\n progress: 0,\n trackColor: 'transparent'\n};\nProgressBar.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n color: ColorPropType,\n indeterminate: bool,\n progress: number,\n trackColor: ColorPropType\n}) : {};\nvar styles = StyleSheet.create({\n track: {\n height: 5,\n overflow: 'hidden',\n userSelect: 'none',\n zIndex: 0\n },\n progress: {\n height: '100%',\n zIndex: -1\n },\n animation: {\n animationDuration: '1s',\n animationKeyframes: [{\n '0%': {\n transform: [{\n translateX: '-100%'\n }]\n },\n '100%': {\n transform: [{\n translateX: '400%'\n }]\n }\n }],\n animationTimingFunction: 'linear',\n animationIterationCount: 'infinite'\n }\n});\nexport default applyNativeMethods(ProgressBar);","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\n\nvar SafeAreaView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SafeAreaView, _React$Component);\n\n function SafeAreaView() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = SafeAreaView.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n style = _this$props.style,\n rest = _objectWithoutPropertiesLoose(_this$props, [\"style\"]);\n\n return React.createElement(View, _extends({}, rest, {\n style: StyleSheet.compose(styles.root, style)\n }));\n };\n\n return SafeAreaView;\n}(React.Component);\n\nSafeAreaView.displayName = 'SafeAreaView';\nSafeAreaView.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes) : {};\nvar styles = StyleSheet.create({\n root: {\n paddingTop: 'env(safe-area-inset-top)',\n paddingRight: 'env(safe-area-inset-right)',\n paddingBottom: 'env(safe-area-inset-bottom)',\n paddingLeft: 'env(safe-area-inset-left)'\n }\n});\nexport default SafeAreaView;","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n\nimport React from 'react';\nimport View from '../../../exports/View';\nimport VirtualizedList from '../VirtualizedList';\nimport invariant from 'fbjs/lib/invariant';\n/**\n * Right now this just flattens everything into one list and uses VirtualizedList under the\n * hood. The only operation that might not scale well is concatting the data arrays of all the\n * sections when new props are received, which should be plenty fast for up to ~10,000 items.\n */\n\nvar VirtualizedSectionList =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inheritsLoose(VirtualizedSectionList, _React$PureComponent);\n\n var _proto = VirtualizedSectionList.prototype;\n\n _proto.scrollToLocation = function scrollToLocation(params) {\n var index = params.itemIndex + 1;\n\n for (var ii = 0; ii < params.sectionIndex; ii++) {\n index += this.props.sections[ii].data.length + 2;\n }\n\n var toIndexParams = _objectSpread({}, params, {\n index: index\n });\n\n this._listRef.scrollToIndex(toIndexParams);\n };\n\n _proto.getListRef = function getListRef() {\n return this._listRef;\n };\n\n _proto._subExtractor = function _subExtractor(index) {\n var itemIndex = index;\n var defaultKeyExtractor = this.props.keyExtractor;\n\n for (var ii = 0; ii < this.props.sections.length; ii++) {\n var section = this.props.sections[ii];\n var key = section.key || String(ii);\n itemIndex -= 1; // The section adds an item for the header\n\n if (itemIndex >= section.data.length + 1) {\n itemIndex -= section.data.length + 1; // The section adds an item for the footer.\n } else if (itemIndex === -1) {\n return {\n section: section,\n key: key + ':header',\n index: null,\n header: true,\n trailingSection: this.props.sections[ii + 1]\n };\n } else if (itemIndex === section.data.length) {\n return {\n section: section,\n key: key + ':footer',\n index: null,\n header: false,\n trailingSection: this.props.sections[ii + 1]\n };\n } else {\n var keyExtractor = section.keyExtractor || defaultKeyExtractor;\n return {\n section: section,\n key: key + ':' + keyExtractor(section.data[itemIndex], itemIndex),\n index: itemIndex,\n leadingItem: section.data[itemIndex - 1],\n leadingSection: this.props.sections[ii - 1],\n trailingItem: section.data[itemIndex + 1],\n trailingSection: this.props.sections[ii + 1]\n };\n }\n }\n };\n\n _proto._getSeparatorComponent = function _getSeparatorComponent(index, info) {\n info = info || this._subExtractor(index);\n\n if (!info) {\n return null;\n }\n\n var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent;\n var SectionSeparatorComponent = this.props.SectionSeparatorComponent;\n var isLastItemInList = index === this.state.childProps.getItemCount() - 1;\n var isLastItemInSection = info.index === info.section.data.length - 1;\n\n if (SectionSeparatorComponent && isLastItemInSection) {\n return SectionSeparatorComponent;\n }\n\n if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {\n return ItemSeparatorComponent;\n }\n\n return null;\n };\n\n _proto._computeState = function _computeState(props) {\n var offset = props.ListHeaderComponent ? 1 : 0;\n var stickyHeaderIndices = [];\n var itemCount = props.sections.reduce(function (v, section) {\n stickyHeaderIndices.push(v + offset);\n return v + section.data.length + 2; // Add two for the section header and footer.\n }, 0);\n return {\n childProps: _objectSpread({}, props, {\n renderItem: this._renderItem,\n ItemSeparatorComponent: undefined,\n // Rendered with renderItem\n data: props.sections,\n getItemCount: function getItemCount() {\n return itemCount;\n },\n getItem: getItem,\n keyExtractor: this._keyExtractor,\n onViewableItemsChanged: props.onViewableItemsChanged ? this._onViewableItemsChanged : undefined,\n stickyHeaderIndices: props.stickySectionHeadersEnabled ? stickyHeaderIndices : undefined\n })\n };\n };\n\n function VirtualizedSectionList(props, context) {\n var _this;\n\n _this = _React$PureComponent.call(this, props, context) || this;\n\n _this._keyExtractor = function (item, index) {\n var info = _this._subExtractor(index);\n\n return info && info.key || String(index);\n };\n\n _this._convertViewable = function (viewable) {\n invariant(viewable.index != null, 'Received a broken ViewToken');\n\n var info = _this._subExtractor(viewable.index);\n\n if (!info) {\n return null;\n }\n\n var keyExtractor = info.section.keyExtractor || _this.props.keyExtractor;\n return _objectSpread({}, viewable, {\n index: info.index,\n\n /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.63 was deployed. To see the error delete this\n * comment and run Flow. */\n key: keyExtractor(viewable.item, info.index),\n section: info.section\n });\n };\n\n _this._onViewableItemsChanged = function (_ref) {\n var viewableItems = _ref.viewableItems,\n changed = _ref.changed;\n\n if (_this.props.onViewableItemsChanged) {\n _this.props.onViewableItemsChanged({\n viewableItems: viewableItems.map(_this._convertViewable, _assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean),\n changed: changed.map(_this._convertViewable, _assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean)\n });\n }\n };\n\n _this._renderItem = function (_ref2) {\n var item = _ref2.item,\n index = _ref2.index;\n\n var info = _this._subExtractor(index);\n\n if (!info) {\n return null;\n }\n\n var infoIndex = info.index;\n\n if (infoIndex == null) {\n var section = info.section;\n\n if (info.header === true) {\n var renderSectionHeader = _this.props.renderSectionHeader;\n return renderSectionHeader ? renderSectionHeader({\n section: section\n }) : null;\n } else {\n var renderSectionFooter = _this.props.renderSectionFooter;\n return renderSectionFooter ? renderSectionFooter({\n section: section\n }) : null;\n }\n } else {\n var renderItem = info.section.renderItem || _this.props.renderItem;\n\n var SeparatorComponent = _this._getSeparatorComponent(index, info);\n\n invariant(renderItem, 'no renderItem!');\n return React.createElement(ItemWithSeparator, {\n SeparatorComponent: SeparatorComponent,\n LeadingSeparatorComponent: infoIndex === 0 ? _this.props.SectionSeparatorComponent : undefined,\n cellKey: info.key,\n index: infoIndex,\n item: item,\n leadingItem: info.leadingItem,\n leadingSection: info.leadingSection,\n onUpdateSeparator: _this._onUpdateSeparator,\n prevCellKey: (_this._subExtractor(index - 1) || {}).key,\n ref: function ref(_ref3) {\n _this._cellRefs[info.key] = _ref3;\n },\n renderItem: renderItem,\n section: info.section,\n trailingItem: info.trailingItem,\n trailingSection: info.trailingSection\n });\n }\n };\n\n _this._onUpdateSeparator = function (key, newProps) {\n var ref = _this._cellRefs[key];\n ref && ref.updateSeparatorProps(newProps);\n };\n\n _this._cellRefs = {};\n\n _this._captureRef = function (ref) {\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\n _this._listRef = ref;\n };\n\n _this.state = _this._computeState(props);\n return _this;\n }\n\n _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n this.setState(this._computeState(nextProps));\n };\n\n _proto.render = function render() {\n return React.createElement(VirtualizedList, _extends({}, this.state.childProps, {\n ref: this._captureRef\n }));\n };\n\n return VirtualizedSectionList;\n}(React.PureComponent);\n\nVirtualizedSectionList.defaultProps = _objectSpread({}, VirtualizedList.defaultProps, {\n data: []\n});\n\nvar ItemWithSeparator =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(ItemWithSeparator, _React$Component);\n\n function ItemWithSeparator() {\n var _this2;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this2 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this2.state = {\n separatorProps: {\n highlighted: false,\n leadingItem: _this2.props.item,\n leadingSection: _this2.props.leadingSection,\n section: _this2.props.section,\n trailingItem: _this2.props.trailingItem,\n trailingSection: _this2.props.trailingSection\n },\n leadingSeparatorProps: {\n highlighted: false,\n leadingItem: _this2.props.leadingItem,\n leadingSection: _this2.props.leadingSection,\n section: _this2.props.section,\n trailingItem: _this2.props.item,\n trailingSection: _this2.props.trailingSection\n }\n };\n _this2._separators = {\n highlight: function highlight() {\n ['leading', 'trailing'].forEach(function (s) {\n return _this2._separators.updateProps(s, {\n highlighted: true\n });\n });\n },\n unhighlight: function unhighlight() {\n ['leading', 'trailing'].forEach(function (s) {\n return _this2._separators.updateProps(s, {\n highlighted: false\n });\n });\n },\n updateProps: function updateProps(select, newProps) {\n var _this2$props = _this2.props,\n LeadingSeparatorComponent = _this2$props.LeadingSeparatorComponent,\n cellKey = _this2$props.cellKey,\n prevCellKey = _this2$props.prevCellKey;\n\n if (select === 'leading' && LeadingSeparatorComponent) {\n _this2.setState(function (state) {\n return {\n leadingSeparatorProps: _objectSpread({}, state.leadingSeparatorProps, newProps)\n };\n });\n } else {\n _this2.props.onUpdateSeparator(select === 'leading' && prevCellKey || cellKey, newProps);\n }\n }\n };\n return _this2;\n }\n\n var _proto2 = ItemWithSeparator.prototype;\n\n _proto2.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) {\n var _this3 = this;\n\n this.setState(function (state) {\n return {\n separatorProps: _objectSpread({}, _this3.state.separatorProps, {\n leadingItem: props.item,\n leadingSection: props.leadingSection,\n section: props.section,\n trailingItem: props.trailingItem,\n trailingSection: props.trailingSection\n }),\n leadingSeparatorProps: _objectSpread({}, _this3.state.leadingSeparatorProps, {\n leadingItem: props.leadingItem,\n leadingSection: props.leadingSection,\n section: props.section,\n trailingItem: props.item,\n trailingSection: props.trailingSection\n })\n };\n });\n };\n\n _proto2.updateSeparatorProps = function updateSeparatorProps(newProps) {\n this.setState(function (state) {\n return {\n separatorProps: _objectSpread({}, state.separatorProps, newProps)\n };\n });\n };\n\n _proto2.render = function render() {\n var _this$props = this.props,\n LeadingSeparatorComponent = _this$props.LeadingSeparatorComponent,\n SeparatorComponent = _this$props.SeparatorComponent,\n item = _this$props.item,\n index = _this$props.index,\n section = _this$props.section;\n var element = this.props.renderItem({\n item: item,\n index: index,\n section: section,\n separators: this._separators\n });\n var leadingSeparator = LeadingSeparatorComponent && React.createElement(LeadingSeparatorComponent, this.state.leadingSeparatorProps);\n var separator = SeparatorComponent && React.createElement(SeparatorComponent, this.state.separatorProps);\n return leadingSeparator || separator ? React.createElement(View, null, leadingSeparator, element, separator) : element;\n };\n\n return ItemWithSeparator;\n}(React.Component);\n\nfunction getItem(sections, index) {\n if (!sections) {\n return null;\n }\n\n var itemIdx = index - 1;\n\n for (var ii = 0; ii < sections.length; ii++) {\n if (itemIdx === -1 || itemIdx === sections[ii].data.length) {\n // We intend for there to be overflow by one on both ends of the list.\n // This will be for headers and footers. When returning a header or footer\n // item the section itself is the item.\n return sections[ii];\n } else if (itemIdx < sections[ii].data.length) {\n // If we are in the bounds of the list's data then return the item.\n return sections[ii].data[itemIdx];\n } else {\n itemIdx -= sections[ii].data.length + 2; // Add two for the header and footer\n }\n }\n\n return null;\n}\n\nexport default VirtualizedSectionList;","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n\nimport UnimplementedView from '../../../modules/UnimplementedView';\nimport Platform from '../../../exports/Platform';\nimport React from 'react';\nimport ScrollView from '../../../exports/ScrollView';\nimport VirtualizedSectionList from '../VirtualizedSectionList';\n\nvar defaultProps = _objectSpread({}, VirtualizedSectionList.defaultProps, {\n stickySectionHeadersEnabled: Platform.OS === 'ios'\n});\n/**\n * A performant interface for rendering sectioned lists, supporting the most handy features:\n *\n * - Fully cross-platform.\n * - Configurable viewability callbacks.\n * - List header support.\n * - List footer support.\n * - Item separator support.\n * - Section header support.\n * - Section separator support.\n * - Heterogeneous data and item rendering support.\n * - Pull to Refresh.\n * - Scroll loading.\n *\n * If you don't need section support and want a simpler interface, use\n * [``](/react-native/docs/flatlist.html).\n *\n * Simple Examples:\n *\n * }\n * renderSectionHeader={({section}) => }\n * sections={[ // homogeneous rendering between sections\n * {data: [...], title: ...},\n * {data: [...], title: ...},\n * {data: [...], title: ...},\n * ]}\n * />\n *\n * \n *\n * This is a convenience wrapper around [``](docs/virtualizedlist.html),\n * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed\n * here, along with the following caveats:\n *\n * - Internal state is not preserved when content scrolls out of the render window. Make sure all\n * your data is captured in the item data or external stores like Flux, Redux, or Relay.\n * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-\n * equal. Make sure that everything your `renderItem` function depends on is passed as a prop\n * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on\n * changes. This includes the `data` prop and parent component state.\n * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously\n * offscreen. This means it's possible to scroll faster than the fill rate and momentarily see\n * blank content. This is a tradeoff that can be adjusted to suit the needs of each application,\n * and we are working on improving it behind the scenes.\n * - By default, the list looks for a `key` prop on each item and uses that for the React key.\n * Alternatively, you can provide a custom `keyExtractor` prop.\n *\n */\n\n\nvar SectionList =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inheritsLoose(SectionList, _React$PureComponent);\n\n function SectionList() {\n var _this;\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 = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;\n\n _this._captureRef = function (ref) {\n /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n * suppresses an error when upgrading Flow's support for React. To see the\n * error delete this comment and run Flow. */\n _this._wrapperListRef = ref;\n };\n\n return _this;\n }\n\n var _proto = SectionList.prototype;\n /**\n * Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section)\n * positioned in the viewable area such that `viewPosition` 0 places it at the top (and may be\n * covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. `viewOffset` is a\n * fixed number of pixels to offset the final target position, e.g. to compensate for sticky\n * headers.\n *\n * Note: cannot scroll to locations outside the render window without specifying the\n * `getItemLayout` prop.\n */\n\n _proto.scrollToLocation = function scrollToLocation(params) {\n this._wrapperListRef.scrollToLocation(params);\n }\n /**\n * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.\n * if `waitForInteractions` is true and the user has not scrolled. This is typically called by\n * taps on items or by navigation actions.\n */\n ;\n\n _proto.recordInteraction = function recordInteraction() {\n var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n\n listRef && listRef.recordInteraction();\n }\n /**\n * Displays the scroll indicators momentarily.\n *\n * @platform ios\n */\n ;\n\n _proto.flashScrollIndicators = function flashScrollIndicators() {\n var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n\n listRef && listRef.flashScrollIndicators();\n }\n /**\n * Provides a handle to the underlying scroll responder.\n */\n ;\n\n _proto.getScrollResponder = function getScrollResponder() {\n var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n\n if (listRef) {\n return listRef.getScrollResponder();\n }\n };\n\n _proto.getScrollableNode = function getScrollableNode() {\n var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n\n if (listRef) {\n return listRef.getScrollableNode();\n }\n };\n\n _proto.setNativeProps = function setNativeProps(props) {\n var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n\n if (listRef) {\n listRef.setNativeProps(props);\n }\n };\n\n _proto.render = function render() {\n var List = this.props.legacyImplementation ? UnimplementedView : VirtualizedSectionList;\n /* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an\n * error found when Flow v0.66 was deployed. To see the error delete this\n * comment and run Flow. */\n\n return React.createElement(List, _extends({}, this.props, {\n ref: this._captureRef\n }));\n };\n\n return SectionList;\n}(React.PureComponent);\n\nSectionList.defaultProps = defaultProps;\nexport default SectionList;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport SectionList from '../../vendor/react-native/SectionList';\nexport default SectionList;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport { Component } from 'react';\n\nvar StatusBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(StatusBar, _Component);\n\n function StatusBar() {\n return _Component.apply(this, arguments) || this;\n }\n\n StatusBar.setBackgroundColor = function setBackgroundColor() {};\n\n StatusBar.setBarStyle = function setBarStyle() {};\n\n StatusBar.setHidden = function setHidden() {};\n\n StatusBar.setNetworkActivityIndicatorVisible = function setNetworkActivityIndicatorVisible() {};\n\n StatusBar.setTranslucent = function setTranslucent() {};\n\n var _proto = StatusBar.prototype;\n\n _proto.render = function render() {\n return null;\n };\n\n return StatusBar;\n}(Component);\n\nexport { StatusBar as default };","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule SwipeableRow\n * \n */\n'use strict';\n\nimport Animated from '../../../exports/Animated';\nimport I18nManager from '../../../exports/I18nManager';\nimport PanResponder from '../../../exports/PanResponder';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport StyleSheet from '../../../exports/StyleSheet';\n/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error\n * found when Flow v0.54 was deployed. To see the error delete this comment and\n * run Flow. */\n\nimport TimerMixin from 'react-timer-mixin';\nimport View from '../../../exports/View';\nimport createReactClass from 'create-react-class';\nimport emptyFunction from 'fbjs/lib/emptyFunction';\n\nvar isRTL = function isRTL() {\n return I18nManager.isRTL;\n}; // NOTE: Eventually convert these consts to an input object of configurations\n// Position of the left of the swipable item when closed\n\n\nvar CLOSED_LEFT_POSITION = 0; // Minimum swipe distance before we recognize it as such\n\nvar HORIZONTAL_SWIPE_DISTANCE_THRESHOLD = 10; // Minimum swipe speed before we fully animate the user's action (open/close)\n\nvar HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD = 0.3; // Factor to divide by to get slow speed; i.e. 4 means 1/4 of full speed\n\nvar SLOW_SPEED_SWIPE_FACTOR = 4; // Time, in milliseconds, of how long the animated swipe should be\n\nvar SWIPE_DURATION = 300;\n/**\n * On SwipeableListView mount, the 1st item will bounce to show users it's\n * possible to swipe\n */\n\nvar ON_MOUNT_BOUNCE_DELAY = 700;\nvar ON_MOUNT_BOUNCE_DURATION = 400; // Distance left of closed position to bounce back when right-swiping from closed\n\nvar RIGHT_SWIPE_BOUNCE_BACK_DISTANCE = 30;\nvar RIGHT_SWIPE_BOUNCE_BACK_DURATION = 300;\n/**\n * Max distance of right swipe to allow (right swipes do functionally nothing).\n * Must be multiplied by SLOW_SPEED_SWIPE_FACTOR because gestureState.dx tracks\n * how far the finger swipes, and not the actual animation distance.\n*/\n\nvar RIGHT_SWIPE_THRESHOLD = 30 * SLOW_SPEED_SWIPE_FACTOR;\n/**\n * Creates a swipable row that allows taps on the main item and a custom View\n * on the item hidden behind the row. Typically this should be used in\n * conjunction with SwipeableListView for additional functionality, but can be\n * used in a normal ListView. See the renderRow for SwipeableListView to see how\n * to use this component separately.\n */\n\nvar SwipeableRow = createReactClass({\n displayName: 'SwipeableRow',\n _panResponder: {},\n _previousLeft: CLOSED_LEFT_POSITION,\n mixins: [TimerMixin],\n propTypes: {\n children: PropTypes.any,\n isOpen: PropTypes.bool,\n preventSwipeRight: PropTypes.bool,\n maxSwipeDistance: PropTypes.number.isRequired,\n onOpen: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n onSwipeEnd: PropTypes.func.isRequired,\n onSwipeStart: PropTypes.func.isRequired,\n // Should bounce the row on mount\n shouldBounceOnMount: PropTypes.bool,\n\n /**\n * A ReactElement that is unveiled when the user swipes\n */\n slideoutView: PropTypes.node.isRequired,\n\n /**\n * The minimum swipe distance required before fully animating the swipe. If\n * the user swipes less than this distance, the item will return to its\n * previous (open/close) position.\n */\n swipeThreshold: PropTypes.number.isRequired\n },\n getInitialState: function getInitialState() {\n return {\n currentLeft: new Animated.Value(this._previousLeft),\n\n /**\n * In order to render component A beneath component B, A must be rendered\n * before B. However, this will cause \"flickering\", aka we see A briefly\n * then B. To counter this, _isSwipeableViewRendered flag is used to set\n * component A to be transparent until component B is loaded.\n */\n isSwipeableViewRendered: false,\n rowHeight: null\n };\n },\n getDefaultProps: function getDefaultProps() {\n return {\n isOpen: false,\n preventSwipeRight: false,\n maxSwipeDistance: 0,\n onOpen: emptyFunction,\n onClose: emptyFunction,\n onSwipeEnd: emptyFunction,\n onSwipeStart: emptyFunction,\n swipeThreshold: 30\n };\n },\n UNSAFE_componentWillMount: function UNSAFE_componentWillMount() {\n this._panResponder = PanResponder.create({\n onMoveShouldSetPanResponderCapture: this._handleMoveShouldSetPanResponderCapture,\n onPanResponderGrant: this._handlePanResponderGrant,\n onPanResponderMove: this._handlePanResponderMove,\n onPanResponderRelease: this._handlePanResponderEnd,\n onPanResponderTerminationRequest: this._onPanResponderTerminationRequest,\n onPanResponderTerminate: this._handlePanResponderEnd,\n onShouldBlockNativeResponder: function onShouldBlockNativeResponder(event, gestureState) {\n return false;\n }\n });\n },\n componentDidMount: function componentDidMount() {\n var _this = this;\n\n if (this.props.shouldBounceOnMount) {\n /**\n * Do the on mount bounce after a delay because if we animate when other\n * components are loading, the animation will be laggy\n */\n this.setTimeout(function () {\n _this._animateBounceBack(ON_MOUNT_BOUNCE_DURATION);\n }, ON_MOUNT_BOUNCE_DELAY);\n }\n },\n UNSAFE_componentWillReceiveProps: function UNSAFE_componentWillReceiveProps(nextProps) {\n /**\n * We do not need an \"animateOpen(noCallback)\" because this animation is\n * handled internally by this component.\n */\n if (this.props.isOpen && !nextProps.isOpen) {\n this._animateToClosedPosition();\n }\n },\n render: function render() {\n // The view hidden behind the main view\n var slideOutView;\n\n if (this.state.isSwipeableViewRendered && this.state.rowHeight) {\n slideOutView = React.createElement(View, {\n style: [styles.slideOutContainer, {\n height: this.state.rowHeight\n }]\n }, this.props.slideoutView);\n } // The swipeable item\n\n\n var swipeableView = React.createElement(Animated.View, {\n onLayout: this._onSwipeableViewLayout,\n style: {\n transform: [{\n translateX: this.state.currentLeft\n }]\n }\n }, this.props.children);\n return React.createElement(View, this._panResponder.panHandlers, slideOutView, swipeableView);\n },\n close: function close() {\n this.props.onClose();\n\n this._animateToClosedPosition();\n },\n _onSwipeableViewLayout: function _onSwipeableViewLayout(event) {\n this.setState({\n isSwipeableViewRendered: true,\n rowHeight: event.nativeEvent.layout.height\n });\n },\n _handleMoveShouldSetPanResponderCapture: function _handleMoveShouldSetPanResponderCapture(event, gestureState) {\n // Decides whether a swipe is responded to by this component or its child\n return gestureState.dy < 10 && this._isValidSwipe(gestureState);\n },\n _handlePanResponderGrant: function _handlePanResponderGrant(event, gestureState) {},\n _handlePanResponderMove: function _handlePanResponderMove(event, gestureState) {\n if (this._isSwipingExcessivelyRightFromClosedPosition(gestureState)) {\n return;\n }\n\n this.props.onSwipeStart();\n\n if (this._isSwipingRightFromClosed(gestureState)) {\n this._swipeSlowSpeed(gestureState);\n } else {\n this._swipeFullSpeed(gestureState);\n }\n },\n _isSwipingRightFromClosed: function _isSwipingRightFromClosed(gestureState) {\n var gestureStateDx = isRTL() ? -gestureState.dx : gestureState.dx;\n return this._previousLeft === CLOSED_LEFT_POSITION && gestureStateDx > 0;\n },\n _swipeFullSpeed: function _swipeFullSpeed(gestureState) {\n this.state.currentLeft.setValue(this._previousLeft + gestureState.dx);\n },\n _swipeSlowSpeed: function _swipeSlowSpeed(gestureState) {\n this.state.currentLeft.setValue(this._previousLeft + gestureState.dx / SLOW_SPEED_SWIPE_FACTOR);\n },\n _isSwipingExcessivelyRightFromClosedPosition: function _isSwipingExcessivelyRightFromClosedPosition(gestureState) {\n /**\n * We want to allow a BIT of right swipe, to allow users to know that\n * swiping is available, but swiping right does not do anything\n * functionally.\n */\n var gestureStateDx = isRTL() ? -gestureState.dx : gestureState.dx;\n return this._isSwipingRightFromClosed(gestureState) && gestureStateDx > RIGHT_SWIPE_THRESHOLD;\n },\n _onPanResponderTerminationRequest: function _onPanResponderTerminationRequest(event, gestureState) {\n return false;\n },\n _animateTo: function _animateTo(toValue, duration, callback) {\n var _this2 = this;\n\n if (duration === void 0) {\n duration = SWIPE_DURATION;\n }\n\n if (callback === void 0) {\n callback = emptyFunction;\n }\n\n Animated.timing(this.state.currentLeft, {\n duration: duration,\n toValue: toValue,\n useNativeDriver: true\n }).start(function () {\n _this2._previousLeft = toValue;\n callback();\n });\n },\n _animateToOpenPosition: function _animateToOpenPosition() {\n var maxSwipeDistance = isRTL() ? -this.props.maxSwipeDistance : this.props.maxSwipeDistance;\n\n this._animateTo(-maxSwipeDistance);\n },\n _animateToOpenPositionWith: function _animateToOpenPositionWith(speed, distMoved) {\n /**\n * Ensure the speed is at least the set speed threshold to prevent a slow\n * swiping animation\n */\n speed = speed > HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD ? speed : HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD;\n /**\n * Calculate the duration the row should take to swipe the remaining distance\n * at the same speed the user swiped (or the speed threshold)\n */\n\n var duration = Math.abs((this.props.maxSwipeDistance - Math.abs(distMoved)) / speed);\n var maxSwipeDistance = isRTL() ? -this.props.maxSwipeDistance : this.props.maxSwipeDistance;\n\n this._animateTo(-maxSwipeDistance, duration);\n },\n _animateToClosedPosition: function _animateToClosedPosition(duration) {\n if (duration === void 0) {\n duration = SWIPE_DURATION;\n }\n\n this._animateTo(CLOSED_LEFT_POSITION, duration);\n },\n _animateToClosedPositionDuringBounce: function _animateToClosedPositionDuringBounce() {\n this._animateToClosedPosition(RIGHT_SWIPE_BOUNCE_BACK_DURATION);\n },\n _animateBounceBack: function _animateBounceBack(duration) {\n /**\n * When swiping right, we want to bounce back past closed position on release\n * so users know they should swipe right to get content.\n */\n var swipeBounceBackDistance = isRTL() ? -RIGHT_SWIPE_BOUNCE_BACK_DISTANCE : RIGHT_SWIPE_BOUNCE_BACK_DISTANCE;\n\n this._animateTo(-swipeBounceBackDistance, duration, this._animateToClosedPositionDuringBounce);\n },\n // Ignore swipes due to user's finger moving slightly when tapping\n _isValidSwipe: function _isValidSwipe(gestureState) {\n if (this.props.preventSwipeRight && this._previousLeft === CLOSED_LEFT_POSITION && gestureState.dx > 0) {\n return false;\n }\n\n return Math.abs(gestureState.dx) > HORIZONTAL_SWIPE_DISTANCE_THRESHOLD;\n },\n _shouldAnimateRemainder: function _shouldAnimateRemainder(gestureState) {\n /**\n * If user has swiped past a certain distance, animate the rest of the way\n * if they let go\n */\n return Math.abs(gestureState.dx) > this.props.swipeThreshold || gestureState.vx > HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD;\n },\n _handlePanResponderEnd: function _handlePanResponderEnd(event, gestureState) {\n var horizontalDistance = isRTL() ? -gestureState.dx : gestureState.dx;\n\n if (this._isSwipingRightFromClosed(gestureState)) {\n this.props.onOpen();\n\n this._animateBounceBack(RIGHT_SWIPE_BOUNCE_BACK_DURATION);\n } else if (this._shouldAnimateRemainder(gestureState)) {\n if (horizontalDistance < 0) {\n // Swiped left\n this.props.onOpen();\n\n this._animateToOpenPositionWith(gestureState.vx, horizontalDistance);\n } else {\n // Swiped right\n this.props.onClose();\n\n this._animateToClosedPosition();\n }\n } else {\n if (this._previousLeft === CLOSED_LEFT_POSITION) {\n this._animateToClosedPosition();\n } else {\n this._animateToOpenPosition();\n }\n }\n\n this.props.onSwipeEnd();\n }\n});\nvar styles = StyleSheet.create({\n slideOutContainer: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0\n }\n});\nexport default SwipeableRow;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule SwipeableFlatList\n * \n * @format\n */\n'use strict';\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport SwipeableRow from '../SwipeableRow';\nimport FlatList from '../FlatList';\n/**\n * A container component that renders multiple SwipeableRow's in a FlatList\n * implementation. This is designed to be a drop-in replacement for the\n * standard React Native `FlatList`, so use it as if it were a FlatList, but\n * with extra props, i.e.\n *\n * \n *\n * SwipeableRow can be used independently of this component, but the main\n * benefit of using this component is\n *\n * - It ensures that at most 1 row is swiped open (auto closes others)\n * - It can bounce the 1st row of the list so users know it's swipeable\n * - Increase performance on iOS by locking list swiping when row swiping is occurring\n * - More to come\n */\n\nvar SwipeableFlatList =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SwipeableFlatList, _React$Component);\n\n function SwipeableFlatList(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n _this._flatListRef = null;\n _this._shouldBounceFirstRowOnMount = false;\n\n _this._onScroll = function (e) {\n // Close any opens rows on ListView scroll\n if (_this.state.openRowKey) {\n _this.setState({\n openRowKey: null\n });\n }\n\n _this.props.onScroll && _this.props.onScroll(e);\n };\n\n _this._renderItem = function (info) {\n var slideoutView = _this.props.renderQuickActions(info);\n\n var key = _this.props.keyExtractor(info.item, info.index); // If renderQuickActions is unspecified or returns falsey, don't allow swipe\n\n\n if (!slideoutView) {\n return _this.props.renderItem(info);\n }\n\n var shouldBounceOnMount = false;\n\n if (_this._shouldBounceFirstRowOnMount) {\n _this._shouldBounceFirstRowOnMount = false;\n shouldBounceOnMount = true;\n }\n\n return React.createElement(SwipeableRow, {\n slideoutView: slideoutView,\n isOpen: key === _this.state.openRowKey,\n maxSwipeDistance: _this._getMaxSwipeDistance(info),\n onOpen: function onOpen() {\n return _this._onOpen(key);\n },\n onClose: function onClose() {\n return _this._onClose(key);\n },\n shouldBounceOnMount: shouldBounceOnMount,\n onSwipeEnd: _this._setListViewScrollable,\n onSwipeStart: _this._setListViewNotScrollable\n }, _this.props.renderItem(info));\n };\n\n _this._setListViewScrollable = function () {\n _this._setListViewScrollableTo(true);\n };\n\n _this._setListViewNotScrollable = function () {\n _this._setListViewScrollableTo(false);\n };\n\n _this.state = {\n openRowKey: null\n };\n _this._shouldBounceFirstRowOnMount = _this.props.bounceFirstRowOnMount;\n return _this;\n }\n\n var _proto = SwipeableFlatList.prototype;\n\n _proto.render = function render() {\n var _this2 = this;\n\n return React.createElement(FlatList, _extends({}, this.props, {\n ref: function ref(_ref) {\n _this2._flatListRef = _ref;\n },\n onScroll: this._onScroll,\n renderItem: this._renderItem\n }));\n }; // This enables rows having variable width slideoutView.\n\n\n _proto._getMaxSwipeDistance = function _getMaxSwipeDistance(info) {\n if (typeof this.props.maxSwipeDistance === 'function') {\n return this.props.maxSwipeDistance(info);\n }\n\n return this.props.maxSwipeDistance;\n };\n\n _proto._setListViewScrollableTo = function _setListViewScrollableTo(value) {\n if (this._flatListRef) {\n this._flatListRef.setNativeProps({\n scrollEnabled: value\n });\n }\n };\n\n _proto._onOpen = function _onOpen(key) {\n this.setState({\n openRowKey: key\n });\n };\n\n _proto._onClose = function _onClose(key) {\n this.setState({\n openRowKey: null\n });\n };\n\n return SwipeableFlatList;\n}(React.Component);\n\nSwipeableFlatList.defaultProps = _objectSpread({}, FlatList.defaultProps, {\n bounceFirstRowOnMount: true,\n renderQuickActions: function renderQuickActions() {\n return null;\n }\n});\nSwipeableFlatList.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, FlatList.propTypes, {\n /**\n * To alert the user that swiping is possible, the first row can bounce\n * on component mount.\n */\n bounceFirstRowOnMount: PropTypes.bool.isRequired,\n // Maximum distance to open to after a swipe\n maxSwipeDistance: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).isRequired,\n // Callback method to render the view that will be unveiled on swipe\n renderQuickActions: PropTypes.func.isRequired\n}) : {};\nexport default SwipeableFlatList;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport SwipeableFlatList from '../../vendor/react-native/SwipeableFlatList';\nexport default SwipeableFlatList;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule SwipeableListViewDataSource\n */\n'use strict';\n\nimport ListViewDataSource from '../ListView/ListViewDataSource';\n/**\n * Data source wrapper around ListViewDataSource to allow for tracking of\n * which row is swiped open and close opened row(s) when another row is swiped\n * open.\n *\n * See https://github.com/facebook/react-native/pull/5602 for why\n * ListViewDataSource is not subclassed.\n */\n\nvar SwipeableListViewDataSource =\n/*#__PURE__*/\nfunction () {\n function SwipeableListViewDataSource(params) {\n var _this = this;\n\n this._dataSource = new ListViewDataSource({\n getRowData: params.getRowData,\n getSectionHeaderData: params.getSectionHeaderData,\n rowHasChanged: function rowHasChanged(row1, row2) {\n /**\n * Row needs to be re-rendered if its swiped open/close status is\n * changed, or its data blob changed.\n */\n return row1.id !== _this._previousOpenRowID && row2.id === _this._openRowID || row1.id === _this._previousOpenRowID && row2.id !== _this._openRowID || params.rowHasChanged(row1, row2);\n },\n sectionHeaderHasChanged: params.sectionHeaderHasChanged\n });\n }\n\n var _proto = SwipeableListViewDataSource.prototype;\n\n _proto.cloneWithRowsAndSections = function cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) {\n this._dataSource = this._dataSource.cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities);\n this._dataBlob = dataBlob;\n this.rowIdentities = this._dataSource.rowIdentities;\n this.sectionIdentities = this._dataSource.sectionIdentities;\n return this;\n } // For the actual ListView to use\n ;\n\n _proto.getDataSource = function getDataSource() {\n return this._dataSource;\n };\n\n _proto.getOpenRowID = function getOpenRowID() {\n return this._openRowID;\n };\n\n _proto.getFirstRowID = function getFirstRowID() {\n /**\n * If rowIdentities is specified, find the first data row from there since\n * we don't want to attempt to bounce section headers. If unspecified, find\n * the first data row from _dataBlob.\n */\n if (this.rowIdentities) {\n return this.rowIdentities[0] && this.rowIdentities[0][0];\n }\n\n return Object.keys(this._dataBlob)[0];\n };\n\n _proto.getLastRowID = function getLastRowID() {\n if (this.rowIdentities && this.rowIdentities.length) {\n var lastSection = this.rowIdentities[this.rowIdentities.length - 1];\n\n if (lastSection && lastSection.length) {\n return lastSection[lastSection.length - 1];\n }\n }\n\n return Object.keys(this._dataBlob)[this._dataBlob.length - 1];\n };\n\n _proto.setOpenRowID = function setOpenRowID(rowID) {\n this._previousOpenRowID = this._openRowID;\n this._openRowID = rowID;\n this._dataSource = this._dataSource.cloneWithRowsAndSections(this._dataBlob, this.sectionIdentities, this.rowIdentities);\n return this;\n };\n\n return SwipeableListViewDataSource;\n}();\n\nexport default SwipeableListViewDataSource;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule SwipeableListView\n * \n */\n'use strict';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport ListView from '../ListView';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport SwipeableListViewDataSource from './SwipeableListViewDataSource';\nimport SwipeableRow from '../SwipeableRow';\n/**\n * A container component that renders multiple SwipeableRow's in a ListView\n * implementation. This is designed to be a drop-in replacement for the\n * standard React Native `ListView`, so use it as if it were a ListView, but\n * with extra props, i.e.\n *\n * let ds = SwipeableListView.getNewDataSource();\n * ds.cloneWithRowsAndSections(dataBlob, ?sectionIDs, ?rowIDs);\n * // ..\n * \n *\n * SwipeableRow can be used independently of this component, but the main\n * benefit of using this component is\n *\n * - It ensures that at most 1 row is swiped open (auto closes others)\n * - It can bounce the 1st row of the list so users know it's swipeable\n * - More to come\n */\n\nvar SwipeableListView =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SwipeableListView, _React$Component);\n\n SwipeableListView.getNewDataSource = function getNewDataSource() {\n return new SwipeableListViewDataSource({\n getRowData: function getRowData(data, sectionID, rowID) {\n return data[sectionID][rowID];\n },\n getSectionHeaderData: function getSectionHeaderData(data, sectionID) {\n return data[sectionID];\n },\n rowHasChanged: function rowHasChanged(row1, row2) {\n return row1 !== row2;\n },\n sectionHeaderHasChanged: function sectionHeaderHasChanged(s1, s2) {\n return s1 !== s2;\n }\n });\n };\n\n function SwipeableListView(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n _this._listViewRef = null;\n _this._shouldBounceFirstRowOnMount = false;\n\n _this._onScroll = function (e) {\n // Close any opens rows on ListView scroll\n if (_this.props.dataSource.getOpenRowID()) {\n _this.setState({\n dataSource: _this.state.dataSource.setOpenRowID(null)\n });\n }\n\n _this.props.onScroll && _this.props.onScroll(e);\n };\n\n _this._renderRow = function (rowData, sectionID, rowID) {\n var slideoutView = _this.props.renderQuickActions(rowData, sectionID, rowID); // If renderQuickActions is unspecified or returns falsey, don't allow swipe\n\n\n if (!slideoutView) {\n return _this.props.renderRow(rowData, sectionID, rowID);\n }\n\n var shouldBounceOnMount = false;\n\n if (_this._shouldBounceFirstRowOnMount) {\n _this._shouldBounceFirstRowOnMount = false;\n shouldBounceOnMount = rowID === _this.props.dataSource.getFirstRowID();\n }\n\n return React.createElement(SwipeableRow, {\n slideoutView: slideoutView,\n isOpen: rowData.id === _this.props.dataSource.getOpenRowID(),\n maxSwipeDistance: _this._getMaxSwipeDistance(rowData, sectionID, rowID),\n key: rowID,\n onOpen: function onOpen() {\n return _this._onOpen(rowData.id);\n },\n onClose: function onClose() {\n return _this._onClose(rowData.id);\n },\n onSwipeEnd: function onSwipeEnd() {\n return _this._setListViewScrollable(true);\n },\n onSwipeStart: function onSwipeStart() {\n return _this._setListViewScrollable(false);\n },\n shouldBounceOnMount: shouldBounceOnMount\n }, _this.props.renderRow(rowData, sectionID, rowID));\n };\n\n _this._shouldBounceFirstRowOnMount = _this.props.bounceFirstRowOnMount;\n _this.state = {\n dataSource: _this.props.dataSource\n };\n return _this;\n }\n\n var _proto = SwipeableListView.prototype;\n\n _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n if (this.state.dataSource.getDataSource() !== nextProps.dataSource.getDataSource()) {\n this.setState({\n dataSource: nextProps.dataSource\n });\n }\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n return React.createElement(ListView, _extends({}, this.props, {\n ref: function ref(_ref) {\n _this2._listViewRef = _ref;\n },\n dataSource: this.state.dataSource.getDataSource(),\n onScroll: this._onScroll,\n renderRow: this._renderRow\n }));\n };\n /**\n * This is a work-around to lock vertical `ListView` scrolling on iOS and\n * mimic Android behaviour. Locking vertical scrolling when horizontal\n * scrolling is active allows us to significantly improve framerates\n * (from high 20s to almost consistently 60 fps)\n */\n\n\n _proto._setListViewScrollable = function _setListViewScrollable(value) {\n if (this._listViewRef && typeof this._listViewRef.setNativeProps === 'function') {\n this._listViewRef.setNativeProps({\n scrollEnabled: value\n });\n }\n } // Passing through ListView's getScrollResponder() function\n ;\n\n _proto.getScrollResponder = function getScrollResponder() {\n if (this._listViewRef && typeof this._listViewRef.getScrollResponder === 'function') {\n return this._listViewRef.getScrollResponder();\n }\n } // This enables rows having variable width slideoutView.\n ;\n\n _proto._getMaxSwipeDistance = function _getMaxSwipeDistance(rowData, sectionID, rowID) {\n if (typeof this.props.maxSwipeDistance === 'function') {\n return this.props.maxSwipeDistance(rowData, sectionID, rowID);\n }\n\n return this.props.maxSwipeDistance;\n };\n\n _proto._onOpen = function _onOpen(rowID) {\n this.setState({\n dataSource: this.state.dataSource.setOpenRowID(rowID)\n });\n };\n\n _proto._onClose = function _onClose(rowID) {\n this.setState({\n dataSource: this.state.dataSource.setOpenRowID(null)\n });\n };\n\n return SwipeableListView;\n}(React.Component);\n\nSwipeableListView.defaultProps = {\n bounceFirstRowOnMount: false,\n renderQuickActions: function renderQuickActions() {\n return null;\n }\n};\nSwipeableListView.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * To alert the user that swiping is possible, the first row can bounce\n * on component mount.\n */\n bounceFirstRowOnMount: PropTypes.bool.isRequired,\n\n /**\n * Use `SwipeableListView.getNewDataSource()` to get a data source to use,\n * then use it just like you would a normal ListView data source\n */\n dataSource: PropTypes.instanceOf(SwipeableListViewDataSource).isRequired,\n // Maximum distance to open to after a swipe\n maxSwipeDistance: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).isRequired,\n // Callback method to render the swipeable view\n renderRow: PropTypes.func.isRequired,\n // Callback method to render the view that will be unveiled on swipe\n renderQuickActions: PropTypes.func.isRequired\n} : {};\nexport default SwipeableListView;","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport SwipeableListView from '../../vendor/react-native/SwipeableListView';\nexport default SwipeableListView;","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport ColorPropType from '../ColorPropType';\nimport createElement from '../createElement';\nimport multiplyStyleLengthValue from '../../modules/multiplyStyleLengthValue';\nimport StyleSheet from '../StyleSheet';\nimport UIManager from '../UIManager';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React, { Component } from 'react';\nimport { bool, func } from 'prop-types';\nvar emptyObject = {};\nvar thumbDefaultBoxShadow = '0px 1px 3px rgba(0,0,0,0.5)';\nvar thumbFocusedBoxShadow = thumbDefaultBoxShadow + \", 0 0 0 10px rgba(0,0,0,0.1)\";\n\nvar Switch =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Switch, _Component);\n\n function Switch() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this._handleChange = function (event) {\n var onValueChange = _this.props.onValueChange;\n onValueChange && onValueChange(event.nativeEvent.target.checked);\n };\n\n _this._handleFocusState = function (event) {\n var isFocused = event.nativeEvent.type === 'focus';\n var boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;\n\n if (_this._thumbElement) {\n _this._thumbElement.setNativeProps({\n style: {\n boxShadow: boxShadow\n }\n });\n }\n };\n\n _this._setCheckboxRef = function (element) {\n _this._checkboxElement = element;\n };\n\n _this._setThumbRef = function (element) {\n _this._thumbElement = element;\n };\n\n return _this;\n }\n\n var _proto = Switch.prototype;\n\n _proto.blur = function blur() {\n UIManager.blur(this._checkboxElement);\n };\n\n _proto.focus = function focus() {\n UIManager.focus(this._checkboxElement);\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n accessibilityLabel = _this$props.accessibilityLabel,\n activeThumbColor = _this$props.activeThumbColor,\n activeTrackColor = _this$props.activeTrackColor,\n disabled = _this$props.disabled,\n onValueChange = _this$props.onValueChange,\n style = _this$props.style,\n thumbColor = _this$props.thumbColor,\n trackColor = _this$props.trackColor,\n value = _this$props.value,\n onTintColor = _this$props.onTintColor,\n thumbTintColor = _this$props.thumbTintColor,\n tintColor = _this$props.tintColor,\n other = _objectWithoutPropertiesLoose(_this$props, [\"accessibilityLabel\", \"activeThumbColor\", \"activeTrackColor\", \"disabled\", \"onValueChange\", \"style\", \"thumbColor\", \"trackColor\", \"value\", \"onTintColor\", \"thumbTintColor\", \"tintColor\"]);\n\n var _StyleSheet$flatten = StyleSheet.flatten(style),\n styleHeight = _StyleSheet$flatten.height,\n styleWidth = _StyleSheet$flatten.width;\n\n var height = styleHeight || 20;\n var minWidth = multiplyStyleLengthValue(height, 2);\n var width = styleWidth > minWidth ? styleWidth : minWidth;\n var trackBorderRadius = multiplyStyleLengthValue(height, 0.5);\n var trackCurrentColor = value ? onTintColor || activeTrackColor : tintColor || trackColor;\n var thumbCurrentColor = value ? activeThumbColor : thumbTintColor || thumbColor;\n var thumbHeight = height;\n var thumbWidth = thumbHeight;\n var rootStyle = [styles.root, style, {\n height: height,\n width: width\n }, disabled && styles.cursorDefault];\n var trackStyle = [styles.track, {\n backgroundColor: trackCurrentColor,\n borderRadius: trackBorderRadius\n }, disabled && styles.disabledTrack];\n var thumbStyle = [styles.thumb, {\n backgroundColor: thumbCurrentColor,\n height: thumbHeight,\n width: thumbWidth\n }, disabled && styles.disabledThumb];\n var nativeControl = createElement('input', {\n accessibilityLabel: accessibilityLabel,\n checked: value,\n disabled: disabled,\n onBlur: this._handleFocusState,\n onChange: this._handleChange,\n onFocus: this._handleFocusState,\n ref: this._setCheckboxRef,\n style: [styles.nativeControl, styles.cursorInherit],\n type: 'checkbox'\n });\n return React.createElement(View, _extends({}, other, {\n style: rootStyle\n }), React.createElement(View, {\n style: trackStyle\n }), React.createElement(View, {\n ref: this._setThumbRef,\n style: [thumbStyle, value && styles.thumbOn, {\n marginStart: value ? multiplyStyleLengthValue(thumbWidth, -1) : 0\n }]\n }), nativeControl);\n };\n\n return Switch;\n}(Component);\n\nSwitch.displayName = 'Switch';\nSwitch.defaultProps = {\n activeThumbColor: '#009688',\n activeTrackColor: '#A3D3CF',\n disabled: false,\n style: emptyObject,\n thumbColor: '#FAFAFA',\n trackColor: '#939393',\n value: false\n};\nSwitch.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n activeThumbColor: ColorPropType,\n activeTrackColor: ColorPropType,\n disabled: bool,\n onValueChange: func,\n thumbColor: ColorPropType,\n trackColor: ColorPropType,\n value: bool,\n\n /* eslint-disable react/sort-prop-types */\n // Equivalent of 'activeTrackColor'\n onTintColor: ColorPropType,\n // Equivalent of 'thumbColor'\n thumbTintColor: ColorPropType,\n // Equivalent of 'trackColor'\n tintColor: ColorPropType\n}) : {};\nvar styles = StyleSheet.create({\n root: {\n cursor: 'pointer',\n userSelect: 'none'\n },\n cursorDefault: {\n cursor: 'default'\n },\n cursorInherit: {\n cursor: 'inherit'\n },\n track: _objectSpread({}, StyleSheet.absoluteFillObject, {\n height: '70%',\n margin: 'auto',\n transitionDuration: '0.1s',\n width: '100%'\n }),\n disabledTrack: {\n backgroundColor: '#D5D5D5'\n },\n thumb: {\n alignSelf: 'flex-start',\n borderRadius: '100%',\n boxShadow: thumbDefaultBoxShadow,\n start: '0%',\n transform: [{\n translateZ: 0\n }],\n transitionDuration: '0.1s'\n },\n thumbOn: {\n start: '100%'\n },\n disabledThumb: {\n backgroundColor: '#BDBDBD'\n },\n nativeControl: _objectSpread({}, StyleSheet.absoluteFillObject, {\n height: '100%',\n margin: 0,\n opacity: 0,\n padding: 0,\n width: '100%'\n })\n});\nexport default applyNativeMethods(Switch);","function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyLayout from '../../modules/applyLayout';\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport { Component } from 'react';\nimport ColorPropType from '../ColorPropType';\nimport createElement from '../createElement';\nimport css from '../StyleSheet/css';\nimport findNodeHandle from '../findNodeHandle';\nimport StyleSheetPropType from '../../modules/StyleSheetPropType';\nimport TextInputStylePropTypes from './TextInputStylePropTypes';\nimport TextInputState from '../../modules/TextInputState';\nimport ViewPropTypes from '../ViewPropTypes';\nimport { any, bool, func, number, oneOf, shape, string } from 'prop-types';\nvar isAndroid = canUseDOM && /Android/i.test(navigator && navigator.userAgent);\nvar emptyObject = {};\n/**\n * React Native events differ from W3C events.\n */\n\nvar normalizeEventHandler = function normalizeEventHandler(handler) {\n return function (e) {\n if (handler) {\n e.nativeEvent.text = e.target.value;\n return handler(e);\n }\n };\n};\n/**\n * Determines whether a 'selection' prop differs from a node's existing\n * selection state.\n */\n\n\nvar isSelectionStale = function isSelectionStale(node, selection) {\n if (node && selection) {\n var selectionEnd = node.selectionEnd,\n selectionStart = node.selectionStart;\n var start = selection.start,\n end = selection.end;\n return start !== selectionStart || end !== selectionEnd;\n }\n\n return false;\n};\n/**\n * Certain input types do no support 'selectSelectionRange' and will throw an\n * error.\n */\n\n\nvar setSelection = function setSelection(node, selection) {\n try {\n if (isSelectionStale(node, selection)) {\n var start = selection.start,\n end = selection.end; // workaround for Blink on Android: see https://github.com/text-mask/text-mask/issues/300\n\n if (isAndroid) {\n setTimeout(function () {\n return node.setSelectionRange(start, end || start);\n }, 10);\n } else {\n node.setSelectionRange(start, end || start);\n }\n }\n } catch (e) {}\n};\n\nvar TextInput =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TextInput, _Component);\n\n function TextInput() {\n var _this;\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 = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this._handleBlur = function (e) {\n var onBlur = _this.props.onBlur;\n TextInputState._currentlyFocusedNode = null;\n\n if (onBlur) {\n onBlur(e);\n }\n };\n\n _this._handleContentSizeChange = function () {\n var _this$props = _this.props,\n onContentSizeChange = _this$props.onContentSizeChange,\n multiline = _this$props.multiline;\n\n if (multiline && onContentSizeChange) {\n var newHeight = _this._node.scrollHeight;\n var newWidth = _this._node.scrollWidth;\n\n if (newHeight !== _this._nodeHeight || newWidth !== _this._nodeWidth) {\n _this._nodeHeight = newHeight;\n _this._nodeWidth = newWidth;\n onContentSizeChange({\n nativeEvent: {\n contentSize: {\n height: _this._nodeHeight,\n width: _this._nodeWidth\n }\n }\n });\n }\n }\n };\n\n _this._handleChange = function (e) {\n var _this$props2 = _this.props,\n onChange = _this$props2.onChange,\n onChangeText = _this$props2.onChangeText;\n var text = e.nativeEvent.text;\n\n _this._handleContentSizeChange();\n\n if (onChange) {\n onChange(e);\n }\n\n if (onChangeText) {\n onChangeText(text);\n }\n\n _this._handleSelectionChange(e);\n };\n\n _this._handleFocus = function (e) {\n var _this$props3 = _this.props,\n clearTextOnFocus = _this$props3.clearTextOnFocus,\n onFocus = _this$props3.onFocus,\n selectTextOnFocus = _this$props3.selectTextOnFocus;\n var node = _this._node;\n TextInputState._currentlyFocusedNode = _this._node;\n\n if (onFocus) {\n onFocus(e);\n }\n\n if (clearTextOnFocus) {\n _this.clear();\n }\n\n if (selectTextOnFocus) {\n node && node.select();\n }\n };\n\n _this._handleKeyDown = function (e) {\n // Prevent key events bubbling (see #612)\n e.stopPropagation(); // Backspace, Escape, Tab, Cmd+Enter, and Arrow keys only fire 'keydown'\n // DOM events\n\n if (e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'ArrowRight' || e.key === 'ArrowDown' || e.key === 'Backspace' || e.key === 'Escape' || e.key === 'Enter' && e.metaKey || e.key === 'Tab') {\n _this._handleKeyPress(e);\n }\n };\n\n _this._handleKeyPress = function (e) {\n var _this$props4 = _this.props,\n blurOnSubmit = _this$props4.blurOnSubmit,\n multiline = _this$props4.multiline,\n onKeyPress = _this$props4.onKeyPress,\n onSubmitEditing = _this$props4.onSubmitEditing;\n var blurOnSubmitDefault = !multiline;\n var shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit;\n\n if (onKeyPress) {\n var keyValue = e.key;\n\n if (keyValue) {\n e.nativeEvent = {\n altKey: e.altKey,\n ctrlKey: e.ctrlKey,\n key: keyValue,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n target: e.target\n };\n onKeyPress(e);\n }\n }\n\n if (!e.isDefaultPrevented() && e.key === 'Enter' && !e.shiftKey) {\n if ((blurOnSubmit || !multiline) && onSubmitEditing) {\n // prevent \"Enter\" from inserting a newline\n e.preventDefault();\n e.nativeEvent = {\n target: e.target,\n text: e.target.value\n };\n onSubmitEditing(e);\n }\n\n if (shouldBlurOnSubmit) {\n // $FlowFixMe\n _this.blur();\n }\n }\n };\n\n _this._handleSelectionChange = function (e) {\n var _this$props5 = _this.props,\n onSelectionChange = _this$props5.onSelectionChange,\n _this$props5$selectio = _this$props5.selection,\n selection = _this$props5$selectio === void 0 ? emptyObject : _this$props5$selectio;\n\n if (onSelectionChange) {\n try {\n var node = e.target;\n\n if (isSelectionStale(node, selection)) {\n var selectionStart = node.selectionStart,\n selectionEnd = node.selectionEnd;\n e.nativeEvent.selection = {\n start: selectionStart,\n end: selectionEnd\n };\n onSelectionChange(e);\n }\n } catch (e) {}\n }\n };\n\n _this._setNode = function (component) {\n _this._node = findNodeHandle(component);\n\n if (_this._node) {\n _this._handleContentSizeChange();\n }\n };\n\n return _this;\n }\n\n var _proto = TextInput.prototype;\n\n _proto.clear = function clear() {\n this._node.value = '';\n };\n\n _proto.isFocused = function isFocused() {\n return TextInputState.currentlyFocusedField() === this._node;\n };\n\n _proto.componentDidMount = function componentDidMount() {\n setSelection(this._node, this.props.selection);\n\n if (document.activeElement === this._node) {\n TextInputState._currentlyFocusedNode = this._node;\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n setSelection(this._node, this.props.selection);\n };\n\n _proto.render = function render() {\n var _this$props6 = this.props,\n autoComplete = _this$props6.autoComplete,\n autoCorrect = _this$props6.autoCorrect,\n editable = _this$props6.editable,\n keyboardType = _this$props6.keyboardType,\n multiline = _this$props6.multiline,\n numberOfLines = _this$props6.numberOfLines,\n secureTextEntry = _this$props6.secureTextEntry,\n blurOnSubmit = _this$props6.blurOnSubmit,\n clearTextOnFocus = _this$props6.clearTextOnFocus,\n onChangeText = _this$props6.onChangeText,\n onLayout = _this$props6.onLayout,\n onSelectionChange = _this$props6.onSelectionChange,\n onSubmitEditing = _this$props6.onSubmitEditing,\n selection = _this$props6.selection,\n selectTextOnFocus = _this$props6.selectTextOnFocus,\n spellCheck = _this$props6.spellCheck,\n accessibilityViewIsModal = _this$props6.accessibilityViewIsModal,\n allowFontScaling = _this$props6.allowFontScaling,\n caretHidden = _this$props6.caretHidden,\n clearButtonMode = _this$props6.clearButtonMode,\n dataDetectorTypes = _this$props6.dataDetectorTypes,\n disableFullscreenUI = _this$props6.disableFullscreenUI,\n enablesReturnKeyAutomatically = _this$props6.enablesReturnKeyAutomatically,\n hitSlop = _this$props6.hitSlop,\n inlineImageLeft = _this$props6.inlineImageLeft,\n inlineImagePadding = _this$props6.inlineImagePadding,\n inputAccessoryViewID = _this$props6.inputAccessoryViewID,\n keyboardAppearance = _this$props6.keyboardAppearance,\n maxFontSizeMultiplier = _this$props6.maxFontSizeMultiplier,\n needsOffscreenAlphaCompositing = _this$props6.needsOffscreenAlphaCompositing,\n onAccessibilityTap = _this$props6.onAccessibilityTap,\n onContentSizeChange = _this$props6.onContentSizeChange,\n onEndEditing = _this$props6.onEndEditing,\n onMagicTap = _this$props6.onMagicTap,\n onScroll = _this$props6.onScroll,\n removeClippedSubviews = _this$props6.removeClippedSubviews,\n renderToHardwareTextureAndroid = _this$props6.renderToHardwareTextureAndroid,\n returnKeyLabel = _this$props6.returnKeyLabel,\n returnKeyType = _this$props6.returnKeyType,\n scrollEnabled = _this$props6.scrollEnabled,\n selectionColor = _this$props6.selectionColor,\n selectionState = _this$props6.selectionState,\n shouldRasterizeIOS = _this$props6.shouldRasterizeIOS,\n textBreakStrategy = _this$props6.textBreakStrategy,\n textContentType = _this$props6.textContentType,\n underlineColorAndroid = _this$props6.underlineColorAndroid,\n otherProps = _objectWithoutPropertiesLoose(_this$props6, [\"autoComplete\", \"autoCorrect\", \"editable\", \"keyboardType\", \"multiline\", \"numberOfLines\", \"secureTextEntry\", \"blurOnSubmit\", \"clearTextOnFocus\", \"onChangeText\", \"onLayout\", \"onSelectionChange\", \"onSubmitEditing\", \"selection\", \"selectTextOnFocus\", \"spellCheck\", \"accessibilityViewIsModal\", \"allowFontScaling\", \"caretHidden\", \"clearButtonMode\", \"dataDetectorTypes\", \"disableFullscreenUI\", \"enablesReturnKeyAutomatically\", \"hitSlop\", \"inlineImageLeft\", \"inlineImagePadding\", \"inputAccessoryViewID\", \"keyboardAppearance\", \"maxFontSizeMultiplier\", \"needsOffscreenAlphaCompositing\", \"onAccessibilityTap\", \"onContentSizeChange\", \"onEndEditing\", \"onMagicTap\", \"onScroll\", \"removeClippedSubviews\", \"renderToHardwareTextureAndroid\", \"returnKeyLabel\", \"returnKeyType\", \"scrollEnabled\", \"selectionColor\", \"selectionState\", \"shouldRasterizeIOS\", \"textBreakStrategy\", \"textContentType\", \"underlineColorAndroid\"]);\n\n var type;\n\n switch (keyboardType) {\n case 'email-address':\n type = 'email';\n break;\n\n case 'number-pad':\n case 'numeric':\n type = 'number';\n break;\n\n case 'phone-pad':\n type = 'tel';\n break;\n\n case 'search':\n case 'web-search':\n type = 'search';\n break;\n\n case 'url':\n type = 'url';\n break;\n\n default:\n type = 'text';\n }\n\n if (secureTextEntry) {\n type = 'password';\n }\n\n var component = multiline ? 'textarea' : 'input';\n Object.assign(otherProps, {\n // Browser's treat autocomplete \"off\" as \"on\"\n // https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164\n autoComplete: autoComplete === 'off' ? 'noop' : autoComplete,\n autoCorrect: autoCorrect ? 'on' : 'off',\n classList: [classes.textinput],\n dir: 'auto',\n onBlur: normalizeEventHandler(this._handleBlur),\n onChange: normalizeEventHandler(this._handleChange),\n onFocus: normalizeEventHandler(this._handleFocus),\n onKeyDown: this._handleKeyDown,\n onKeyPress: this._handleKeyPress,\n onSelect: normalizeEventHandler(this._handleSelectionChange),\n readOnly: !editable,\n ref: this._setNode,\n spellCheck: spellCheck != null ? spellCheck : autoCorrect\n });\n\n if (multiline) {\n otherProps.rows = numberOfLines;\n } else {\n otherProps.type = type;\n }\n\n return createElement(component, otherProps);\n };\n\n return TextInput;\n}(Component);\n\nTextInput.displayName = 'TextInput';\nTextInput.defaultProps = {\n autoCapitalize: 'sentences',\n autoComplete: 'on',\n autoCorrect: true,\n editable: true,\n keyboardType: 'default',\n multiline: false,\n numberOfLines: 1,\n secureTextEntry: false\n};\nTextInput.State = TextInputState;\nTextInput.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n autoCapitalize: oneOf(['characters', 'none', 'sentences', 'words']),\n autoComplete: string,\n autoCorrect: bool,\n autoFocus: bool,\n blurOnSubmit: bool,\n clearTextOnFocus: bool,\n defaultValue: string,\n editable: bool,\n inputAccessoryViewID: string,\n keyboardType: oneOf(['default', 'email-address', 'number-pad', 'numbers-and-punctuation', 'numeric', 'phone-pad', 'search', 'url', 'web-search']),\n maxFontSizeMultiplier: number,\n maxLength: number,\n multiline: bool,\n numberOfLines: number,\n onBlur: func,\n onChange: func,\n onChangeText: func,\n onFocus: func,\n onKeyPress: func,\n onSelectionChange: func,\n onSubmitEditing: func,\n placeholder: string,\n placeholderTextColor: ColorPropType,\n secureTextEntry: bool,\n selectTextOnFocus: bool,\n selection: shape({\n start: number.isRequired,\n end: number\n }),\n spellCheck: bool,\n style: StyleSheetPropType(TextInputStylePropTypes),\n value: string,\n\n /* react-native compat */\n\n /* eslint-disable */\n caretHidden: bool,\n clearButtonMode: string,\n dataDetectorTypes: string,\n disableFullscreenUI: bool,\n enablesReturnKeyAutomatically: bool,\n keyboardAppearance: string,\n inlineImageLeft: string,\n inlineImagePadding: number,\n onContentSizeChange: func,\n onEndEditing: func,\n onScroll: func,\n returnKeyLabel: string,\n returnKeyType: string,\n selectionColor: ColorPropType,\n selectionState: any,\n textBreakStrategy: string,\n underlineColorAndroid: ColorPropType\n /* eslint-enable */\n\n}) : {};\nvar classes = css.create({\n textinput: {\n MozAppearance: 'textfield',\n WebkitAppearance: 'none',\n backgroundColor: 'transparent',\n border: '0 solid black',\n borderRadius: 0,\n boxSizing: 'border-box',\n font: '14px System',\n padding: 0,\n resize: 'none'\n }\n});\nexport default applyLayout(applyNativeMethods(TextInput));","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport ColorPropType from '../ColorPropType';\nimport createReactClass from 'create-react-class';\nimport ensureComponentIsNative from '../../modules/ensureComponentIsNative';\nimport ensurePositiveDelayProps from '../Touchable/ensurePositiveDelayProps';\nimport React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport TimerMixin from 'react-timer-mixin';\nimport Touchable from '../Touchable';\nimport TouchableWithoutFeedback from '../TouchableWithoutFeedback';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport { func, number } from 'prop-types';\nvar DEFAULT_PROPS = {\n activeOpacity: 0.85,\n underlayColor: 'black'\n};\nvar PRESS_RETENTION_OFFSET = {\n top: 20,\n left: 20,\n right: 20,\n bottom: 30\n};\n/**\n * A wrapper for making views respond properly to touches.\n * On press down, the opacity of the wrapped view is decreased, which allows\n * the underlay color to show through, darkening or tinting the view.\n *\n * The underlay comes from wrapping the child in a new View, which can affect\n * layout, and sometimes cause unwanted visual artifacts if not used correctly,\n * for example if the backgroundColor of the wrapped view isn't explicitly set\n * to an opaque color.\n *\n * TouchableHighlight must have one child (not zero or more than one).\n * If you wish to have several child components, wrap them in a View.\n *\n * Example:\n *\n * ```\n * renderButton: function() {\n * return (\n * \n * \n * \n * );\n * },\n * ```\n */\n\n/* eslint-disable react/prefer-es6-class */\n\nvar TouchableHighlight = createReactClass({\n displayName: 'TouchableHighlight',\n propTypes: _objectSpread({}, TouchableWithoutFeedback.propTypes, {\n /**\n * Determines what the opacity of the wrapped view should be when touch is\n * active.\n */\n activeOpacity: number,\n\n /**\n * Called immediately after the underlay is hidden\n */\n onHideUnderlay: func,\n\n /**\n * Called immediately after the underlay is shown\n */\n onShowUnderlay: func,\n style: ViewPropTypes.style,\n\n /**\n * The color of the underlay that will show through when the touch is\n * active.\n */\n underlayColor: ColorPropType\n }),\n mixins: [TimerMixin, Touchable.Mixin],\n getDefaultProps: function getDefaultProps() {\n return DEFAULT_PROPS;\n },\n // Performance optimization to avoid constantly re-generating these objects.\n _computeSyntheticState: function _computeSyntheticState(props) {\n return {\n activeProps: {\n style: {\n opacity: props.activeOpacity\n }\n },\n activeUnderlayProps: {\n style: {\n backgroundColor: props.underlayColor\n }\n },\n underlayStyle: [INACTIVE_UNDERLAY_PROPS.style, props.style]\n };\n },\n getInitialState: function getInitialState() {\n this._isMounted = false;\n return _objectSpread({}, this.touchableGetInitialState(), this._computeSyntheticState(this.props));\n },\n componentDidMount: function componentDidMount() {\n this._isMounted = true;\n ensurePositiveDelayProps(this.props);\n ensureComponentIsNative(this._childRef);\n },\n componentWillUnmount: function componentWillUnmount() {\n this._isMounted = false;\n },\n componentDidUpdate: function componentDidUpdate() {\n ensureComponentIsNative(this._childRef);\n },\n componentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n ensurePositiveDelayProps(nextProps);\n\n if (nextProps.activeOpacity !== this.props.activeOpacity || nextProps.underlayColor !== this.props.underlayColor || nextProps.style !== this.props.style) {\n this.setState(this._computeSyntheticState(nextProps));\n }\n },\n\n /**\n * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are\n * defined on your component.\n */\n touchableHandleActivePressIn: function touchableHandleActivePressIn(e) {\n this.clearTimeout(this._hideTimeout);\n this._hideTimeout = null;\n\n this._showUnderlay();\n\n this.props.onPressIn && this.props.onPressIn(e);\n },\n touchableHandleActivePressOut: function touchableHandleActivePressOut(e) {\n if (!this._hideTimeout) {\n this._hideUnderlay();\n }\n\n this.props.onPressOut && this.props.onPressOut(e);\n },\n touchableHandlePress: function touchableHandlePress(e) {\n this.clearTimeout(this._hideTimeout);\n\n this._showUnderlay();\n\n this._hideTimeout = this.setTimeout(this._hideUnderlay, this.props.delayPressOut || 100);\n this.props.onPress && this.props.onPress(e);\n },\n touchableHandleLongPress: function touchableHandleLongPress(e) {\n this.props.onLongPress && this.props.onLongPress(e);\n },\n touchableGetPressRectOffset: function touchableGetPressRectOffset() {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n },\n touchableGetHitSlop: function touchableGetHitSlop() {\n return this.props.hitSlop;\n },\n touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() {\n return this.props.delayPressIn;\n },\n touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() {\n return this.props.delayLongPress;\n },\n touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() {\n return this.props.delayPressOut;\n },\n _showUnderlay: function _showUnderlay() {\n if (!this._isMounted || !this._hasPressHandler()) {\n return;\n }\n\n this._underlayRef.setNativeProps(this.state.activeUnderlayProps);\n\n this._childRef.setNativeProps(this.state.activeProps);\n\n this.props.onShowUnderlay && this.props.onShowUnderlay();\n },\n _hideUnderlay: function _hideUnderlay() {\n this.clearTimeout(this._hideTimeout);\n this._hideTimeout = null;\n\n if (this._hasPressHandler() && this._underlayRef) {\n this._childRef.setNativeProps(INACTIVE_CHILD_PROPS);\n\n this._underlayRef.setNativeProps(_objectSpread({}, INACTIVE_UNDERLAY_PROPS, {\n style: this.state.underlayStyle\n }));\n\n this.props.onHideUnderlay && this.props.onHideUnderlay();\n }\n },\n _hasPressHandler: function _hasPressHandler() {\n return !!(this.props.onPress || this.props.onPressIn || this.props.onPressOut || this.props.onLongPress);\n },\n _setChildRef: function _setChildRef(node) {\n this._childRef = node;\n },\n _setUnderlayRef: function _setUnderlayRef(node) {\n this._underlayRef = node;\n },\n render: function render() {\n var _this$props = this.props,\n activeOpacity = _this$props.activeOpacity,\n onHideUnderlay = _this$props.onHideUnderlay,\n onShowUnderlay = _this$props.onShowUnderlay,\n underlayColor = _this$props.underlayColor,\n delayLongPress = _this$props.delayLongPress,\n delayPressIn = _this$props.delayPressIn,\n delayPressOut = _this$props.delayPressOut,\n onLongPress = _this$props.onLongPress,\n onPress = _this$props.onPress,\n onPressIn = _this$props.onPressIn,\n onPressOut = _this$props.onPressOut,\n pressRetentionOffset = _this$props.pressRetentionOffset,\n other = _objectWithoutPropertiesLoose(_this$props, [\"activeOpacity\", \"onHideUnderlay\", \"onShowUnderlay\", \"underlayColor\", \"delayLongPress\", \"delayPressIn\", \"delayPressOut\", \"onLongPress\", \"onPress\", \"onPressIn\", \"onPressOut\", \"pressRetentionOffset\"]);\n\n return React.createElement(View, _extends({}, other, {\n accessible: this.props.accessible !== false,\n onKeyDown: this.touchableHandleKeyEvent,\n onKeyUp: this.touchableHandleKeyEvent,\n onResponderGrant: this.touchableHandleResponderGrant,\n onResponderMove: this.touchableHandleResponderMove,\n onResponderRelease: this.touchableHandleResponderRelease,\n onResponderTerminate: this.touchableHandleResponderTerminate,\n onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,\n onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,\n ref: this._setUnderlayRef,\n style: [styles.root, !this.props.disabled && styles.actionable, this.state.underlayStyle]\n }), React.cloneElement(React.Children.only(this.props.children), {\n ref: this._setChildRef\n }), Touchable.renderDebugView({\n color: 'green',\n hitSlop: this.props.hitSlop\n }));\n }\n});\nvar INACTIVE_CHILD_PROPS = {\n style: StyleSheet.create({\n x: {\n opacity: 1.0\n }\n }).x\n};\nvar INACTIVE_UNDERLAY_PROPS = {\n style: StyleSheet.create({\n x: {\n backgroundColor: 'transparent'\n }\n }).x\n};\nvar styles = StyleSheet.create({\n root: {\n userSelect: 'none'\n },\n actionable: {\n cursor: 'pointer',\n touchAction: 'manipulation'\n }\n});\nexport default applyNativeMethods(TouchableHighlight);","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport VirtualizedList from '../../vendor/react-native/VirtualizedList';\nexport default VirtualizedList;","function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nimport React from 'react';\nimport UnimplementedView from '../../modules/UnimplementedView';\n\nvar YellowBox =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(YellowBox, _React$Component);\n\n function YellowBox() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n YellowBox.ignoreWarnings = function ignoreWarnings() {};\n\n var _proto = YellowBox.prototype;\n\n _proto.render = function render() {\n return React.createElement(UnimplementedView, this.props);\n };\n\n return YellowBox;\n}(React.Component);\n\nexport default YellowBox;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport createStrictShapeTypeChecker from '../../modules/createStrictShapeTypeChecker';\nimport { number } from 'prop-types';\nvar PointPropType = createStrictShapeTypeChecker({\n x: number,\n y: number\n});\nexport default PointPropType;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","export default {};","import createElement from './exports/createElement';\nimport findNodeHandle from './exports/findNodeHandle';\nimport processColor from './exports/processColor';\nimport render from './exports/render';\nimport unmountComponentAtNode from './exports/unmountComponentAtNode';\nimport NativeModules from './exports/NativeModules';\nimport TextPropTypes from './exports/TextPropTypes';\nimport ViewPropTypes from './exports/ViewPropTypes'; // APIs\n\nimport AccessibilityInfo from './exports/AccessibilityInfo';\nimport Alert from './exports/Alert';\nimport Animated from './exports/Animated';\nimport AppRegistry from './exports/AppRegistry';\nimport AppState from './exports/AppState';\nimport AsyncStorage from './exports/AsyncStorage';\nimport BackHandler from './exports/BackHandler';\nimport Clipboard from './exports/Clipboard';\nimport DeviceInfo from './exports/DeviceInfo';\nimport Dimensions from './exports/Dimensions';\nimport Easing from './exports/Easing';\nimport I18nManager from './exports/I18nManager';\nimport Keyboard from './exports/Keyboard';\nimport InteractionManager from './exports/InteractionManager';\nimport LayoutAnimation from './exports/LayoutAnimation';\nimport Linking from './exports/Linking';\nimport NativeEventEmitter from './exports/NativeEventEmitter';\nimport NetInfo from './exports/NetInfo';\nimport PanResponder from './exports/PanResponder';\nimport PixelRatio from './exports/PixelRatio';\nimport Platform from './exports/Platform';\nimport Share from './exports/Share';\nimport StyleSheet from './exports/StyleSheet';\nimport UIManager from './exports/UIManager';\nimport Vibration from './exports/Vibration'; // components\n\nimport ActivityIndicator from './exports/ActivityIndicator';\nimport Button from './exports/Button';\nimport CheckBox from './exports/CheckBox';\nimport FlatList from './exports/FlatList';\nimport Image from './exports/Image';\nimport ImageBackground from './exports/ImageBackground';\nimport KeyboardAvoidingView from './exports/KeyboardAvoidingView';\nimport ListView from './exports/ListView';\nimport Modal from './exports/Modal';\nimport Picker from './exports/Picker';\nimport ProgressBar from './exports/ProgressBar';\nimport RefreshControl from './exports/RefreshControl';\nimport SafeAreaView from './exports/SafeAreaView';\nimport ScrollView from './exports/ScrollView';\nimport SectionList from './exports/SectionList';\nimport Slider from './exports/Slider';\nimport StatusBar from './exports/StatusBar';\nimport SwipeableFlatList from './exports/SwipeableFlatList';\nimport SwipeableListView from './exports/SwipeableListView';\nimport Switch from './exports/Switch';\nimport Text from './exports/Text';\nimport TextInput from './exports/TextInput';\nimport Touchable from './exports/Touchable';\nimport TouchableHighlight from './exports/TouchableHighlight';\nimport TouchableNativeFeedback from './exports/TouchableNativeFeedback';\nimport TouchableOpacity from './exports/TouchableOpacity';\nimport TouchableWithoutFeedback from './exports/TouchableWithoutFeedback';\nimport View from './exports/View';\nimport VirtualizedList from './exports/VirtualizedList';\nimport YellowBox from './exports/YellowBox'; // propTypes\n\nimport ColorPropType from './exports/ColorPropType';\nimport EdgeInsetsPropType from './exports/EdgeInsetsPropType';\nimport PointPropType from './exports/PointPropType'; // compat (components)\n\nimport DatePickerIOS from './exports/DatePickerIOS';\nimport DrawerLayoutAndroid from './exports/DrawerLayoutAndroid';\nimport ImageEditor from './exports/ImageEditor';\nimport ImageStore from './exports/ImageStore';\nimport InputAccessoryView from './exports/InputAccessoryView';\nimport MaskedViewIOS from './exports/MaskedViewIOS';\nimport NavigatorIOS from './exports/NavigatorIOS';\nimport PickerIOS from './exports/PickerIOS';\nimport ProgressBarAndroid from './exports/ProgressBarAndroid';\nimport ProgressViewIOS from './exports/ProgressViewIOS';\nimport SegmentedControlIOS from './exports/SegmentedControlIOS';\nimport SnapshotViewIOS from './exports/SnapshotViewIOS';\nimport TabBarIOS from './exports/TabBarIOS';\nimport ToastAndroid from './exports/ToastAndroid';\nimport ToolbarAndroid from './exports/ToolbarAndroid';\nimport ViewPagerAndroid from './exports/ViewPagerAndroid';\nimport WebView from './exports/WebView'; // compat (apis)\n\nimport ActionSheetIOS from './exports/ActionSheetIOS';\nimport AlertIOS from './exports/AlertIOS';\nimport CameraRoll from './exports/CameraRoll';\nimport DatePickerAndroid from './exports/DatePickerAndroid';\nimport ImagePickerIOS from './exports/ImagePickerIOS';\nimport PermissionsAndroid from './exports/PermissionsAndroid';\nimport PushNotificationIOS from './exports/PushNotificationIOS';\nimport Settings from './exports/Settings';\nimport StatusBarIOS from './exports/StatusBarIOS';\nimport Systrace from './exports/Systrace';\nimport TimePickerAndroid from './exports/TimePickerAndroid';\nimport TVEventHandler from './exports/TVEventHandler';\nimport VibrationIOS from './exports/VibrationIOS';\nexport { // top-level API\ncreateElement, findNodeHandle, render, unmountComponentAtNode, // modules\nprocessColor, NativeModules, TextPropTypes, ViewPropTypes, // APIs\nAccessibilityInfo, Alert, Animated, AppRegistry, AppState, AsyncStorage, BackHandler, Clipboard, DeviceInfo, Dimensions, Easing, I18nManager, InteractionManager, Keyboard, LayoutAnimation, Linking, NativeEventEmitter, NetInfo, PanResponder, PixelRatio, Platform, Share, StyleSheet, UIManager, Vibration, // components\nActivityIndicator, Button, CheckBox, FlatList, Image, ImageBackground, KeyboardAvoidingView, ListView, Modal, Picker, ProgressBar, RefreshControl, SafeAreaView, ScrollView, SectionList, Slider, StatusBar, SwipeableFlatList, SwipeableListView, Switch, Text, TextInput, Touchable, TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, View, VirtualizedList, YellowBox, // propTypes\nColorPropType, EdgeInsetsPropType, PointPropType, // compat (components)\nDatePickerIOS, DrawerLayoutAndroid, ImageEditor, ImageStore, InputAccessoryView, MaskedViewIOS, NavigatorIOS, PickerIOS, ProgressBarAndroid, ProgressViewIOS, SegmentedControlIOS, SnapshotViewIOS, TabBarIOS, ToastAndroid, ToolbarAndroid, ViewPagerAndroid, WebView, // compat (apis)\nActionSheetIOS, AlertIOS, CameraRoll, DatePickerAndroid, ImagePickerIOS, PermissionsAndroid, PushNotificationIOS, Settings, StatusBarIOS, Systrace, TimePickerAndroid, TVEventHandler, VibrationIOS };","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nimport invariant from 'fbjs/lib/invariant';\nimport NativeModules from '../../../exports/NativeModules';\nimport NativeEventEmitter from '../NativeEventEmitter';\nvar NativeAnimatedModule = NativeModules.NativeAnimatedModule;\nvar __nativeAnimatedNodeTagCount = 1;\n/* used for animated nodes */\n\nvar __nativeAnimationIdCount = 1;\n/* used for started animations */\n\nvar nativeEventEmitter;\n/**\n * Simple wrappers around NativeAnimatedModule to provide flow and autocmplete support for\n * the native module methods\n */\n\nvar API = {\n createAnimatedNode: function createAnimatedNode(tag, config) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.createAnimatedNode(tag, config);\n },\n startListeningToAnimatedNodeValue: function startListeningToAnimatedNodeValue(tag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.startListeningToAnimatedNodeValue(tag);\n },\n stopListeningToAnimatedNodeValue: function stopListeningToAnimatedNodeValue(tag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag);\n },\n connectAnimatedNodes: function connectAnimatedNodes(parentTag, childTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag);\n },\n disconnectAnimatedNodes: function disconnectAnimatedNodes(parentTag, childTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag);\n },\n startAnimatingNode: function startAnimatingNode(animationId, nodeTag, config, endCallback) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.startAnimatingNode(animationId, nodeTag, config, endCallback);\n },\n stopAnimation: function stopAnimation(animationId) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.stopAnimation(animationId);\n },\n setAnimatedNodeValue: function setAnimatedNodeValue(nodeTag, value) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value);\n },\n setAnimatedNodeOffset: function setAnimatedNodeOffset(nodeTag, offset) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset);\n },\n flattenAnimatedNodeOffset: function flattenAnimatedNodeOffset(nodeTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag);\n },\n extractAnimatedNodeOffset: function extractAnimatedNodeOffset(nodeTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag);\n },\n connectAnimatedNodeToView: function connectAnimatedNodeToView(nodeTag, viewTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag);\n },\n disconnectAnimatedNodeFromView: function disconnectAnimatedNodeFromView(nodeTag, viewTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag);\n },\n dropAnimatedNode: function dropAnimatedNode(tag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.dropAnimatedNode(tag);\n },\n addAnimatedEventToView: function addAnimatedEventToView(viewTag, eventName, eventMapping) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.addAnimatedEventToView(viewTag, eventName, eventMapping);\n },\n removeAnimatedEventFromView: function removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag) {\n assertNativeAnimatedModule();\n NativeAnimatedModule.removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag);\n }\n};\n/**\n * Styles allowed by the native animated implementation.\n *\n * In general native animated implementation should support any numeric property that doesn't need\n * to be updated through the shadow view hierarchy (all non-layout properties).\n */\n\nvar STYLES_WHITELIST = {\n opacity: true,\n transform: true,\n\n /* ios styles */\n shadowOpacity: true,\n shadowRadius: true,\n\n /* legacy android transform properties */\n scaleX: true,\n scaleY: true,\n translateX: true,\n translateY: true\n};\nvar TRANSFORM_WHITELIST = {\n translateX: true,\n translateY: true,\n scale: true,\n scaleX: true,\n scaleY: true,\n rotate: true,\n rotateX: true,\n rotateY: true,\n perspective: true\n};\nvar SUPPORTED_INTERPOLATION_PARAMS = {\n inputRange: true,\n outputRange: true,\n extrapolate: true,\n extrapolateRight: true,\n extrapolateLeft: true\n};\n\nfunction addWhitelistedStyleProp(prop) {\n STYLES_WHITELIST[prop] = true;\n}\n\nfunction addWhitelistedTransformProp(prop) {\n TRANSFORM_WHITELIST[prop] = true;\n}\n\nfunction addWhitelistedInterpolationParam(param) {\n SUPPORTED_INTERPOLATION_PARAMS[param] = true;\n}\n\nfunction validateTransform(configs) {\n configs.forEach(function (config) {\n if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) {\n throw new Error(\"Property '\" + config.property + \"' is not supported by native animated module\");\n }\n });\n}\n\nfunction validateStyles(styles) {\n for (var key in styles) {\n if (!STYLES_WHITELIST.hasOwnProperty(key)) {\n throw new Error(\"Style property '\" + key + \"' is not supported by native animated module\");\n }\n }\n}\n\nfunction validateInterpolation(config) {\n for (var key in config) {\n if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(key)) {\n throw new Error(\"Interpolation property '\" + key + \"' is not supported by native animated module\");\n }\n }\n}\n\nfunction generateNewNodeTag() {\n return __nativeAnimatedNodeTagCount++;\n}\n\nfunction generateNewAnimationId() {\n return __nativeAnimationIdCount++;\n}\n\nfunction assertNativeAnimatedModule() {\n invariant(NativeAnimatedModule, 'Native animated module is not available');\n}\n\nvar _warnedMissingNativeAnimated = false;\n\nfunction shouldUseNativeDriver(config) {\n if (config.useNativeDriver && !NativeAnimatedModule) {\n if (!_warnedMissingNativeAnimated) {\n console.warn('Animated: `useNativeDriver` is not supported because the native ' + 'animated module is missing. Falling back to JS-based animation. To ' + 'resolve this, add `RCTAnimation` module to this app, or remove ' + '`useNativeDriver`. ' + 'More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420');\n _warnedMissingNativeAnimated = true;\n }\n\n return false;\n }\n\n return config.useNativeDriver || false;\n}\n\nvar NativeAnimatedHelper = {\n API: API,\n addWhitelistedStyleProp: addWhitelistedStyleProp,\n addWhitelistedTransformProp: addWhitelistedTransformProp,\n addWhitelistedInterpolationParam: addWhitelistedInterpolationParam,\n validateStyles: validateStyles,\n validateTransform: validateTransform,\n validateInterpolation: validateInterpolation,\n generateNewNodeTag: generateNewNodeTag,\n generateNewAnimationId: generateNewAnimationId,\n assertNativeAnimatedModule: assertNativeAnimatedModule,\n shouldUseNativeDriver: shouldUseNativeDriver,\n\n get nativeEventEmitter() {\n if (!nativeEventEmitter) {\n nativeEventEmitter = new NativeEventEmitter(NativeAnimatedModule);\n }\n\n return nativeEventEmitter;\n }\n\n};\nexport { API, addWhitelistedStyleProp, addWhitelistedTransformProp, addWhitelistedInterpolationParam, validateStyles, validateTransform, validateInterpolation, generateNewNodeTag, generateNewAnimationId, assertNativeAnimatedModule, shouldUseNativeDriver };\nexport default NativeAnimatedHelper;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport invariant from 'fbjs/lib/invariant'; // Note(vjeux): this would be better as an interface but flow doesn't\n// support them yet\n\nvar AnimatedNode =\n/*#__PURE__*/\nfunction () {\n function AnimatedNode() {}\n\n var _proto = AnimatedNode.prototype;\n\n _proto.__attach = function __attach() {};\n\n _proto.__detach = function __detach() {\n if (this.__isNative && this.__nativeTag != null) {\n NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);\n this.__nativeTag = undefined;\n }\n };\n\n _proto.__getValue = function __getValue() {};\n\n _proto.__getAnimatedValue = function __getAnimatedValue() {\n return this.__getValue();\n };\n\n _proto.__addChild = function __addChild(child) {};\n\n _proto.__removeChild = function __removeChild(child) {};\n\n _proto.__getChildren = function __getChildren() {\n return [];\n }\n /* Methods and props used by native Animated impl */\n ;\n\n _proto.__makeNative = function __makeNative() {\n if (!this.__isNative) {\n throw new Error('This node cannot be made a \"native\" animated node');\n }\n };\n\n _proto.__getNativeTag = function __getNativeTag() {\n NativeAnimatedHelper.assertNativeAnimatedModule();\n invariant(this.__isNative, 'Attempt to get native tag from node not marked as \"native\"');\n\n if (this.__nativeTag == null) {\n var nativeTag = NativeAnimatedHelper.generateNewNodeTag();\n NativeAnimatedHelper.API.createAnimatedNode(nativeTag, this.__getNativeConfig());\n this.__nativeTag = nativeTag;\n }\n\n return this.__nativeTag;\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n throw new Error('This JS animated node type cannot be used as native animated node');\n };\n\n _proto.toJSON = function toJSON() {\n return this.__getValue();\n };\n\n return AnimatedNode;\n}();\n\nexport default AnimatedNode;","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n'use strict';\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\n\nvar ExecutionEnvironment = {\n canUseDOM: canUseDOM,\n canUseWorkers: typeof Worker !== 'undefined',\n canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),\n canUseViewport: canUseDOM && !!window.screen,\n isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\nmodule.exports = ExecutionEnvironment;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\ntslib_1.__exportStar(require(\"./client-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./invite-client-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./invite-server-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./non-invite-client-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./non-invite-server-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./invite-client-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./server-transaction\"), exports);\n\ntslib_1.__exportStar(require(\"./transaction-state\"), exports);\n\ntslib_1.__exportStar(require(\"./transaction\"), exports);","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","/* eslint-disable */\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.0.0\n * \n */\nimport isUnitlessNumber from '../../../modules/unitlessNumbers';\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n return ('' + value).trim();\n}\n\nexport default dangerousStyleValue;","/* eslint-disable */\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.3.0\n * \n */\nimport dangerousStyleValue from '../dangerousStyleValue';\nimport hyphenateStyleName from 'hyphenate-style-name';\nimport warnValidStyle from '../warnValidStyle';\n/**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\n\nfunction setValueForStyles(node, styles, getStack) {\n var style = node.style;\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var isCustomProperty = styleName.indexOf('--') === 0;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!isCustomProperty) {\n warnValidStyle(styleName, styles[styleName], getStack);\n }\n }\n\n var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n\n if (isCustomProperty) {\n var name = isCustomProperty ? styleName : hyphenateStyleName(styleName);\n style.setProperty(name, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\n\nexport default setValueForStyles;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport getBoundingClientRect from '../../modules/getBoundingClientRect';\nimport setValueForStyles from '../../vendor/react-dom/setValueForStyles';\n\nvar getRect = function getRect(node) {\n // Unlike the DOM's getBoundingClientRect, React Native layout measurements\n // for \"height\" and \"width\" ignore scale transforms.\n // https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements\n var _getBoundingClientRec = getBoundingClientRect(node),\n x = _getBoundingClientRec.x,\n y = _getBoundingClientRec.y,\n top = _getBoundingClientRec.top,\n left = _getBoundingClientRec.left;\n\n var width = node.offsetWidth;\n var height = node.offsetHeight;\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n top: top,\n left: left\n };\n};\n\nvar _measureLayout = function measureLayout(node, relativeToNativeNode, callback) {\n var relativeNode = relativeToNativeNode || node && node.parentNode;\n\n if (node && relativeNode) {\n setTimeout(function () {\n var relativeRect = getBoundingClientRect(relativeNode);\n\n var _getRect = getRect(node),\n height = _getRect.height,\n left = _getRect.left,\n top = _getRect.top,\n width = _getRect.width;\n\n var x = left - relativeRect.left;\n var y = top - relativeRect.top;\n callback(x, y, width, height, left, top);\n }, 0);\n }\n};\n\nvar focusableElements = {\n A: true,\n INPUT: true,\n SELECT: true,\n TEXTAREA: true\n};\nvar UIManager = {\n blur: function blur(node) {\n try {\n node.blur();\n } catch (err) {}\n },\n focus: function focus(node) {\n try {\n var name = node.nodeName; // A tabIndex of -1 allows element to be programmatically focused but\n // prevents keyboard focus, so we don't want to set the value on elements\n // that support keyboard focus by default.\n\n if (node.getAttribute('tabIndex') == null && focusableElements[name] == null) {\n node.setAttribute('tabIndex', '-1');\n }\n\n node.focus();\n } catch (err) {}\n },\n measure: function measure(node, callback) {\n _measureLayout(node, null, callback);\n },\n measureInWindow: function measureInWindow(node, callback) {\n if (node) {\n setTimeout(function () {\n var _getRect2 = getRect(node),\n height = _getRect2.height,\n left = _getRect2.left,\n top = _getRect2.top,\n width = _getRect2.width;\n\n callback(left, top, width, height);\n }, 0);\n }\n },\n measureLayout: function measureLayout(node, relativeToNativeNode, onFail, onSuccess) {\n _measureLayout(node, relativeToNativeNode, onSuccess);\n },\n updateView: function updateView(node, props, component\n /* only needed to surpress React errors in development */\n ) {\n for (var prop in props) {\n if (!Object.prototype.hasOwnProperty.call(props, prop)) {\n continue;\n }\n\n var value = props[prop];\n\n switch (prop) {\n case 'style':\n {\n setValueForStyles(node, value, component._reactInternalInstance);\n break;\n }\n\n case 'class':\n case 'className':\n {\n node.setAttribute('class', value);\n break;\n }\n\n case 'text':\n case 'value':\n // native platforms use `text` prop to replace text input value\n node.value = value;\n break;\n\n default:\n node.setAttribute(prop, value);\n }\n }\n },\n configureNextLayoutAnimation: function configureNextLayoutAnimation(config, onAnimationDidEnd) {\n onAnimationDidEnd();\n },\n // mocks\n setLayoutAnimationEnabledExperimental: function setLayoutAnimationEnabledExperimental() {}\n};\nexport default UIManager;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _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\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var defineProperty = require(\"./defineProperty\");\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nmodule.exports = _objectSpread;","import { Text } from 'react-native';\nimport { getStatusBarHeight } from 'react-native-status-bar-height';\n\nimport BackgroundImage from './BackgroundImage';\nimport colors from './colors';\nimport ViewPropTypes from './ViewPropTypes';\nimport fonts from './fonts';\nimport ThemeProvider, { ThemeConsumer } from './ThemeProvider';\nimport withTheme from './withTheme';\n\nconst TextPropTypes = Text.propTypes;\n\nexport {\n BackgroundImage,\n colors,\n getStatusBarHeight,\n ViewPropTypes,\n TextPropTypes,\n fonts,\n ThemeProvider,\n ThemeConsumer,\n withTheme,\n};\n","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport InteractionManager from '../../../../exports/InteractionManager';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\nvar _uniqueId = 1;\n/**\n * Animated works by building a directed acyclic graph of dependencies\n * transparently when you render your Animated components.\n *\n * new Animated.Value(0)\n * .interpolate() .interpolate() new Animated.Value(1)\n * opacity translateY scale\n * style transform\n * View#234 style\n * View#123\n *\n * A) Top Down phase\n * When an Animated.Value is updated, we recursively go down through this\n * graph in order to find leaf nodes: the views that we flag as needing\n * an update.\n *\n * B) Bottom Up phase\n * When a view is flagged as needing an update, we recursively go back up\n * in order to build the new value that it needs. The reason why we need\n * this two-phases process is to deal with composite props such as\n * transform which can receive values from multiple parents.\n */\n\nfunction _flush(rootNode) {\n var animatedStyles = new Set();\n\n function findAnimatedStyles(node) {\n if (typeof node.update === 'function') {\n animatedStyles.add(node);\n } else {\n node.__getChildren().forEach(findAnimatedStyles);\n }\n }\n\n findAnimatedStyles(rootNode);\n animatedStyles.forEach(function (animatedStyle) {\n return animatedStyle.update();\n });\n}\n/**\n * Standard value for driving animations. One `Animated.Value` can drive\n * multiple properties in a synchronized fashion, but can only be driven by one\n * mechanism at a time. Using a new mechanism (e.g. starting a new animation,\n * or calling `setValue`) will stop any previous ones.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html\n */\n\n\nvar AnimatedValue =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedValue, _AnimatedWithChildren);\n\n function AnimatedValue(value) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._startingValue = _this._value = value;\n _this._offset = 0;\n _this._animation = null;\n _this._listeners = {};\n return _this;\n }\n\n var _proto = AnimatedValue.prototype;\n\n _proto.__detach = function __detach() {\n this.stopAnimation();\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n return this._value + this._offset;\n };\n\n _proto.__makeNative = function __makeNative() {\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n\n if (Object.keys(this._listeners).length) {\n this._startListeningToNativeValueUpdates();\n }\n }\n /**\n * Directly set the value. This will stop any animations running on the value\n * and update all the bound properties.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#setvalue\n */\n ;\n\n _proto.setValue = function setValue(value) {\n if (this._animation) {\n this._animation.stop();\n\n this._animation = null;\n }\n\n this._updateValue(value, !this.__isNative\n /* don't perform a flush for natively driven values */\n );\n\n if (this.__isNative) {\n NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value);\n }\n }\n /**\n * Sets an offset that is applied on top of whatever value is set, whether via\n * `setValue`, an animation, or `Animated.event`. Useful for compensating\n * things like the start of a pan gesture.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#setoffset\n */\n ;\n\n _proto.setOffset = function setOffset(offset) {\n this._offset = offset;\n\n if (this.__isNative) {\n NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset);\n }\n }\n /**\n * Merges the offset value into the base value and resets the offset to zero.\n * The final output of the value is unchanged.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#flattenoffset\n */\n ;\n\n _proto.flattenOffset = function flattenOffset() {\n this._value += this._offset;\n this._offset = 0;\n\n if (this.__isNative) {\n NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());\n }\n }\n /**\n * Sets the offset value to the base value, and resets the base value to zero.\n * The final output of the value is unchanged.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#extractoffset\n */\n ;\n\n _proto.extractOffset = function extractOffset() {\n this._offset += this._value;\n this._value = 0;\n\n if (this.__isNative) {\n NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag());\n }\n }\n /**\n * Adds an asynchronous listener to the value so you can observe updates from\n * animations. This is useful because there is no way to\n * synchronously read the value because it might be driven natively.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#addlistener\n */\n ;\n\n _proto.addListener = function addListener(callback) {\n var id = String(_uniqueId++);\n this._listeners[id] = callback;\n\n if (this.__isNative) {\n this._startListeningToNativeValueUpdates();\n }\n\n return id;\n }\n /**\n * Unregister a listener. The `id` param shall match the identifier\n * previously returned by `addListener()`.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#removelistener\n */\n ;\n\n _proto.removeListener = function removeListener(id) {\n delete this._listeners[id];\n\n if (this.__isNative && Object.keys(this._listeners).length === 0) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n /**\n * Remove all registered listeners.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#removealllisteners\n */\n ;\n\n _proto.removeAllListeners = function removeAllListeners() {\n this._listeners = {};\n\n if (this.__isNative) {\n this._stopListeningForNativeValueUpdates();\n }\n };\n\n _proto._startListeningToNativeValueUpdates = function _startListeningToNativeValueUpdates() {\n var _this2 = this;\n\n if (this.__nativeAnimatedValueListener) {\n return;\n }\n\n NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener('onAnimatedValueUpdate', function (data) {\n if (data.tag !== _this2.__getNativeTag()) {\n return;\n }\n\n _this2._updateValue(data.value, false\n /* flush */\n );\n });\n };\n\n _proto._stopListeningForNativeValueUpdates = function _stopListeningForNativeValueUpdates() {\n if (!this.__nativeAnimatedValueListener) {\n return;\n }\n\n this.__nativeAnimatedValueListener.remove();\n\n this.__nativeAnimatedValueListener = null;\n NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());\n }\n /**\n * Stops any running animation or tracking. `callback` is invoked with the\n * final value after stopping the animation, which is useful for updating\n * state to match the animation position with layout.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#stopanimation\n */\n ;\n\n _proto.stopAnimation = function stopAnimation(callback) {\n this.stopTracking();\n this._animation && this._animation.stop();\n this._animation = null;\n callback && callback(this.__getValue());\n }\n /**\n * Stops any animation and resets the value to its original.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#resetanimation\n */\n ;\n\n _proto.resetAnimation = function resetAnimation(callback) {\n this.stopAnimation(callback);\n this._value = this._startingValue;\n }\n /**\n * Interpolates the value before updating the property, e.g. mapping 0-1 to\n * 0-10.\n */\n ;\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n }\n /**\n * Typically only used internally, but could be used by a custom Animation\n * class.\n *\n * See http://facebook.github.io/react-native/docs/animatedvalue.html#animate\n */\n ;\n\n _proto.animate = function animate(animation, callback) {\n var _this3 = this;\n\n var handle = null;\n\n if (animation.__isInteraction) {\n handle = InteractionManager.createInteractionHandle();\n }\n\n var previousAnimation = this._animation;\n this._animation && this._animation.stop();\n this._animation = animation;\n animation.start(this._value, function (value) {\n // Natively driven animations will never call into that callback, therefore we can always\n // pass flush = true to allow the updated value to propagate to native with setNativeProps\n _this3._updateValue(value, true\n /* flush */\n );\n }, function (result) {\n _this3._animation = null;\n\n if (handle !== null) {\n InteractionManager.clearInteractionHandle(handle);\n }\n\n callback && callback(result);\n }, previousAnimation, this);\n }\n /**\n * Typically only used internally.\n */\n ;\n\n _proto.stopTracking = function stopTracking() {\n this._tracking && this._tracking.__detach();\n this._tracking = null;\n }\n /**\n * Typically only used internally.\n */\n ;\n\n _proto.track = function track(tracking) {\n this.stopTracking();\n this._tracking = tracking;\n };\n\n _proto._updateValue = function _updateValue(value, flush) {\n this._value = value;\n\n if (flush) {\n _flush(this);\n }\n\n for (var _key in this._listeners) {\n this._listeners[_key]({\n value: this.__getValue()\n });\n }\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n return {\n type: 'value',\n value: this._value,\n offset: this._offset\n };\n };\n\n return AnimatedValue;\n}(AnimatedWithChildren);\n\nexport default AnimatedValue;","function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\n\n if (desc.get || desc.set) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n}\n\nmodule.exports = _interopRequireWildcard;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedNode from './AnimatedNode';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nvar AnimatedWithChildren =\n/*#__PURE__*/\nfunction (_AnimatedNode) {\n _inheritsLoose(AnimatedWithChildren, _AnimatedNode);\n\n function AnimatedWithChildren() {\n var _this;\n\n _this = _AnimatedNode.call(this) || this;\n _this._children = [];\n return _this;\n }\n\n var _proto = AnimatedWithChildren.prototype;\n\n _proto.__makeNative = function __makeNative() {\n if (!this.__isNative) {\n this.__isNative = true;\n\n for (var _iterator = this._children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var child = _ref;\n\n child.__makeNative();\n\n NativeAnimatedHelper.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());\n }\n }\n };\n\n _proto.__addChild = function __addChild(child) {\n if (this._children.length === 0) {\n this.__attach();\n }\n\n this._children.push(child);\n\n if (this.__isNative) {\n // Only accept \"native\" animated nodes as children\n child.__makeNative();\n\n NativeAnimatedHelper.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());\n }\n };\n\n _proto.__removeChild = function __removeChild(child) {\n var index = this._children.indexOf(child);\n\n if (index === -1) {\n console.warn(\"Trying to remove a child that doesn't exist\");\n return;\n }\n\n if (this.__isNative && child.__isNative) {\n NativeAnimatedHelper.API.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());\n }\n\n this._children.splice(index, 1);\n\n if (this._children.length === 0) {\n this.__detach();\n }\n };\n\n _proto.__getChildren = function __getChildren() {\n return this._children;\n };\n\n return AnimatedWithChildren;\n}(AnimatedNode);\n\nexport default AnimatedWithChildren;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n'use strict';\n\nvar emptyFunction = require(\"./emptyFunction\");\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\n\nfunction printWarning(format) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n}\n\nvar warning = process.env.NODE_ENV !== \"production\" ? function (condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(void 0, [format].concat(args));\n }\n} : emptyFunction;\nmodule.exports = warning;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\"); // Directories\n\n\ntslib_1.__exportStar(require(\"./methods\"), exports); // Files\n\n\ntslib_1.__exportStar(require(\"./body\"), exports);\n\ntslib_1.__exportStar(require(\"./digest-authentication\"), exports);\n\ntslib_1.__exportStar(require(\"./grammar\"), exports);\n\ntslib_1.__exportStar(require(\"./incoming-message\"), exports);\n\ntslib_1.__exportStar(require(\"./incoming-request-message\"), exports);\n\ntslib_1.__exportStar(require(\"./incoming-response-message\"), exports);\n\ntslib_1.__exportStar(require(\"./name-addr-header\"), exports);\n\ntslib_1.__exportStar(require(\"./outgoing-request-message\"), exports);\n\ntslib_1.__exportStar(require(\"./outgoing-response\"), exports);\n\ntslib_1.__exportStar(require(\"./parameters\"), exports);\n\ntslib_1.__exportStar(require(\"./uri\"), exports);","import { Platform, Dimensions } from 'react-native';\nimport color from 'color';\nimport renderNode from './renderNode';\nimport getIconType from './getIconType';\nimport normalizeText from './normalizeText';\nimport nodeType from './nodeType';\n\nconst Screen = Dimensions.get('window');\nconst ScreenWidth = Screen.width;\nconst ScreenHeight = Screen.height;\nconst isIOS = Platform.OS === 'ios';\n\nconst conditionalStyle = (condition, style) => (condition ? style : {});\n\nexport {\n renderNode,\n getIconType,\n normalizeText,\n nodeType,\n ScreenWidth,\n ScreenHeight,\n isIOS,\n conditionalStyle,\n color,\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n/*\n * User Agent Client (UAC): A user agent client is a logical entity\n * that creates a new request, and then uses the client\n * transaction state machinery to send it. The role of UAC lasts\n * only for the duration of that transaction. In other words, if\n * a piece of software initiates a request, it acts as a UAC for\n * the duration of that transaction. If it receives a request\n * later, it assumes the role of a user agent server for the\n * processing of that transaction.\n * https://tools.ietf.org/html/rfc3261#section-6\n */\n\n\nvar UserAgentClient =\n/** @class */\nfunction () {\n function UserAgentClient(transactionConstructor, core, message, delegate) {\n this.transactionConstructor = transactionConstructor;\n this.core = core;\n this.message = message;\n this.delegate = delegate;\n this.challenged = false;\n this.stale = false;\n this.logger = this.loggerFactory.getLogger(\"sip.user-agent-client\");\n this.init();\n }\n\n UserAgentClient.prototype.dispose = function () {\n this.transaction.dispose();\n };\n\n Object.defineProperty(UserAgentClient.prototype, \"loggerFactory\", {\n get: function get() {\n return this.core.loggerFactory;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserAgentClient.prototype, \"transaction\", {\n /** The transaction associated with this request. */\n get: function get() {\n if (!this._transaction) {\n throw new Error(\"Transaction undefined.\");\n }\n\n return this._transaction;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Since requests other than INVITE are responded to immediately, sending a\n * CANCEL for a non-INVITE request would always create a race condition.\n * A CANCEL request SHOULD NOT be sent to cancel a request other than INVITE.\n * https://tools.ietf.org/html/rfc3261#section-9.1\n * @param options Cancel options bucket.\n */\n\n UserAgentClient.prototype.cancel = function (reason, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (!this.transaction) {\n throw new Error(\"Transaction undefined.\");\n }\n\n if (!this.message.to) {\n throw new Error(\"To undefined.\");\n }\n\n if (!this.message.from) {\n throw new Error(\"From undefined.\");\n } // The following procedures are used to construct a CANCEL request. The\n // Request-URI, Call-ID, To, the numeric part of CSeq, and From header\n // fields in the CANCEL request MUST be identical to those in the\n // request being cancelled, including tags. A CANCEL constructed by a\n // client MUST have only a single Via header field value matching the\n // top Via value in the request being cancelled. Using the same values\n // for these header fields allows the CANCEL to be matched with the\n // request it cancels (Section 9.2 indicates how such matching occurs).\n // However, the method part of the CSeq header field MUST have a value\n // of CANCEL. This allows it to be identified and processed as a\n // transaction in its own right (See Section 17).\n // https://tools.ietf.org/html/rfc3261#section-9.1\n\n\n var message = this.core.makeOutgoingRequestMessage(messages_1.C.CANCEL, this.message.ruri, this.message.from.uri, this.message.to.uri, {\n toTag: this.message.toTag,\n fromTag: this.message.fromTag,\n callId: this.message.callId,\n cseq: this.message.cseq\n }, options.extraHeaders); // TODO: Revisit this.\n // The CANCEL needs to use the same branch parameter so that\n // it matches the INVITE transaction, but this is a hacky way to do this.\n // Or at the very least not well documented. If the the branch parameter\n // is set on the outgoing request, the transaction will use it.\n // Otherwise the transaction will make a new one.\n\n message.branch = this.message.branch;\n\n if (this.message.headers.Route) {\n message.headers.Route = this.message.headers.Route;\n }\n\n if (reason) {\n message.setHeader(\"Reason\", reason);\n } // If no provisional response has been received, the CANCEL request MUST\n // NOT be sent; rather, the client MUST wait for the arrival of a\n // provisional response before sending the request. If the original\n // request has generated a final response, the CANCEL SHOULD NOT be\n // sent, as it is an effective no-op, since CANCEL has no effect on\n // requests that have already generated a final response.\n // https://tools.ietf.org/html/rfc3261#section-9.1\n\n\n if (this.transaction.state === transactions_1.TransactionState.Proceeding) {\n var uac = new UserAgentClient(transactions_1.NonInviteClientTransaction, this.core, message);\n } else {\n this.transaction.once(\"stateChanged\", function () {\n if (_this.transaction && _this.transaction.state === transactions_1.TransactionState.Proceeding) {\n var uac = new UserAgentClient(transactions_1.NonInviteClientTransaction, _this.core, message);\n }\n });\n }\n\n return message;\n };\n /**\n * If a 401 (Unauthorized) or 407 (Proxy Authentication Required)\n * response is received, the UAC SHOULD follow the authorization\n * procedures of Section 22.2 and Section 22.3 to retry the request with\n * credentials.\n * https://tools.ietf.org/html/rfc3261#section-8.1.3.5\n * 22 Usage of HTTP Authentication\n * https://tools.ietf.org/html/rfc3261#section-22\n * 22.1 Framework\n * https://tools.ietf.org/html/rfc3261#section-22.1\n * 22.2 User-to-User Authentication\n * https://tools.ietf.org/html/rfc3261#section-22.2\n * 22.3 Proxy-to-User Authentication\n * https://tools.ietf.org/html/rfc3261#section-22.3\n *\n * FIXME: This \"guard for and retry the request with credentials\"\n * implementation is not complete and at best minimally passable.\n * @param response The incoming response to guard.\n * @returns True if the program execution is to continue in the branch in question.\n * Otherwise the request is retried with credentials and current request processing must stop.\n */\n\n\n UserAgentClient.prototype.authenticationGuard = function (message) {\n var statusCode = message.statusCode;\n\n if (!statusCode) {\n throw new Error(\"Response status code undefined.\");\n } // If a 401 (Unauthorized) or 407 (Proxy Authentication Required)\n // response is received, the UAC SHOULD follow the authorization\n // procedures of Section 22.2 and Section 22.3 to retry the request with\n // credentials.\n // https://tools.ietf.org/html/rfc3261#section-8.1.3.5\n\n\n if (statusCode !== 401 && statusCode !== 407) {\n return true;\n } // Get and parse the appropriate WWW-Authenticate or Proxy-Authenticate header.\n\n\n var challenge;\n var authorizationHeaderName;\n\n if (statusCode === 401) {\n challenge = message.parseHeader(\"www-authenticate\");\n authorizationHeaderName = \"authorization\";\n } else {\n challenge = message.parseHeader(\"proxy-authenticate\");\n authorizationHeaderName = \"proxy-authorization\";\n } // Verify it seems a valid challenge.\n\n\n if (!challenge) {\n this.logger.warn(statusCode + \" with wrong or missing challenge, cannot authenticate\");\n return true;\n } // Avoid infinite authentications.\n\n\n if (this.challenged && (this.stale || challenge.stale !== true)) {\n this.logger.warn(statusCode + \" apparently in authentication loop, cannot authenticate\");\n return true;\n } // Get credentials.\n\n\n if (!this.credentials) {\n this.credentials = this.core.configuration.authenticationFactory();\n\n if (!this.credentials) {\n this.logger.warn(\"Unable to obtain credentials, cannot authenticate\");\n return true;\n }\n } // Verify that the challenge is really valid.\n\n\n if (!this.credentials.authenticate(this.message, challenge)) {\n return true;\n }\n\n this.challenged = true;\n\n if (challenge.stale) {\n this.stale = true;\n }\n\n var cseq = this.message.cseq += 1;\n this.message.setHeader(\"cseq\", cseq + \" \" + this.message.method);\n this.message.setHeader(authorizationHeaderName, this.credentials.toString()); // Calling init (again) will swap out our existing client transaction with a new one.\n // FIXME: HACK: An assumption is being made here that there is nothing that needs to\n // be cleaned up beyond the client transaction which is being replaced. For example,\n // it is assumed that no early dialogs have been created.\n\n this.init();\n return false;\n };\n /**\n * Receive a response from the transaction layer.\n * @param message Incoming response message.\n */\n\n\n UserAgentClient.prototype.receiveResponse = function (message) {\n if (!this.authenticationGuard(message)) {\n return;\n }\n\n var statusCode = message.statusCode ? message.statusCode.toString() : \"\";\n\n if (!statusCode) {\n throw new Error(\"Response status code undefined.\");\n }\n\n switch (true) {\n case /^100$/.test(statusCode):\n if (this.delegate && this.delegate.onTrying) {\n this.delegate.onTrying({\n message: message\n });\n }\n\n break;\n\n case /^1[0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onProgress) {\n this.delegate.onProgress({\n message: message\n });\n }\n\n break;\n\n case /^2[0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onAccept) {\n this.delegate.onAccept({\n message: message\n });\n }\n\n break;\n\n case /^3[0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onRedirect) {\n this.delegate.onRedirect({\n message: message\n });\n }\n\n break;\n\n case /^[4-6][0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onReject) {\n this.delegate.onReject({\n message: message\n });\n }\n\n break;\n\n default:\n throw new Error(\"Invalid status code \" + statusCode);\n }\n };\n\n UserAgentClient.prototype.init = function () {\n var _this = this; // We are the transaction user.\n\n\n var user = {\n loggerFactory: this.loggerFactory,\n onRequestTimeout: function onRequestTimeout() {\n return _this.onRequestTimeout();\n },\n onStateChange: function onStateChange(newState) {\n if (newState === transactions_1.TransactionState.Terminated) {\n // Remove the terminated transaction from the core.\n _this.core.userAgentClients.delete(userAgentClientId); // FIXME: HACK: Our transaction may have been swapped out with a new one\n // post authentication (see above), so make sure to only to dispose of\n // ourselves if this terminating transaction is our current transaction.\n\n\n if (transaction === _this._transaction) {\n _this.dispose();\n }\n }\n },\n onTransportError: function onTransportError(error) {\n return _this.onTransportError(error);\n },\n receiveResponse: function receiveResponse(message) {\n return _this.receiveResponse(message);\n }\n }; // Create a new transaction with us as the user.\n\n var transaction = new this.transactionConstructor(this.message, this.core.transport, user);\n this._transaction = transaction; // Add the new transaction to the core.\n\n var userAgentClientId = transaction.id + transaction.request.method;\n this.core.userAgentClients.set(userAgentClientId, this);\n };\n /**\n * 8.1.3.1 Transaction Layer Errors\n * In some cases, the response returned by the transaction layer will\n * not be a SIP message, but rather a transaction layer error. When a\n * timeout error is received from the transaction layer, it MUST be\n * treated as if a 408 (Request Timeout) status code has been received.\n * If a fatal transport error is reported by the transport layer\n * (generally, due to fatal ICMP errors in UDP or connection failures in\n * TCP), the condition MUST be treated as a 503 (Service Unavailable)\n * status code.\n * https://tools.ietf.org/html/rfc3261#section-8.1.3.1\n */\n\n\n UserAgentClient.prototype.onRequestTimeout = function () {\n this.logger.warn(\"User agent client request timed out. Generating internal 408 Request Timeout.\");\n var message = new messages_1.IncomingResponseMessage();\n message.statusCode = 408;\n message.reasonPhrase = \"Request Timeout\";\n this.receiveResponse(message);\n return;\n };\n /**\n * 8.1.3.1 Transaction Layer Errors\n * In some cases, the response returned by the transaction layer will\n * not be a SIP message, but rather a transaction layer error. When a\n * timeout error is received from the transaction layer, it MUST be\n * treated as if a 408 (Request Timeout) status code has been received.\n * If a fatal transport error is reported by the transport layer\n * (generally, due to fatal ICMP errors in UDP or connection failures in\n * TCP), the condition MUST be treated as a 503 (Service Unavailable)\n * status code.\n * https://tools.ietf.org/html/rfc3261#section-8.1.3.1\n */\n\n\n UserAgentClient.prototype.onTransportError = function (error) {\n this.logger.error(error.message);\n this.logger.error(\"User agent client request transport error. Generating internal 503 Service Unavailable.\");\n var message = new messages_1.IncomingResponseMessage();\n message.statusCode = 503;\n message.reasonPhrase = \"Service Unavailable\";\n this.receiveResponse(message);\n };\n\n return UserAgentClient;\n}();\n\nexports.UserAgentClient = UserAgentClient;","\"use strict\"; // enums can't really be declared, so they are set here.\n// pulled out of individual files to avoid circular dependencies\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar DialogStatus;\n\n(function (DialogStatus) {\n DialogStatus[DialogStatus[\"STATUS_EARLY\"] = 1] = \"STATUS_EARLY\";\n DialogStatus[DialogStatus[\"STATUS_CONFIRMED\"] = 2] = \"STATUS_CONFIRMED\";\n})(DialogStatus = exports.DialogStatus || (exports.DialogStatus = {}));\n\nvar SessionStatus;\n\n(function (SessionStatus) {\n // Session states\n SessionStatus[SessionStatus[\"STATUS_NULL\"] = 0] = \"STATUS_NULL\";\n SessionStatus[SessionStatus[\"STATUS_INVITE_SENT\"] = 1] = \"STATUS_INVITE_SENT\";\n SessionStatus[SessionStatus[\"STATUS_1XX_RECEIVED\"] = 2] = \"STATUS_1XX_RECEIVED\";\n SessionStatus[SessionStatus[\"STATUS_INVITE_RECEIVED\"] = 3] = \"STATUS_INVITE_RECEIVED\";\n SessionStatus[SessionStatus[\"STATUS_WAITING_FOR_ANSWER\"] = 4] = \"STATUS_WAITING_FOR_ANSWER\";\n SessionStatus[SessionStatus[\"STATUS_ANSWERED\"] = 5] = \"STATUS_ANSWERED\";\n SessionStatus[SessionStatus[\"STATUS_WAITING_FOR_PRACK\"] = 6] = \"STATUS_WAITING_FOR_PRACK\";\n SessionStatus[SessionStatus[\"STATUS_WAITING_FOR_ACK\"] = 7] = \"STATUS_WAITING_FOR_ACK\";\n SessionStatus[SessionStatus[\"STATUS_CANCELED\"] = 8] = \"STATUS_CANCELED\";\n SessionStatus[SessionStatus[\"STATUS_TERMINATED\"] = 9] = \"STATUS_TERMINATED\";\n SessionStatus[SessionStatus[\"STATUS_ANSWERED_WAITING_FOR_PRACK\"] = 10] = \"STATUS_ANSWERED_WAITING_FOR_PRACK\";\n SessionStatus[SessionStatus[\"STATUS_EARLY_MEDIA\"] = 11] = \"STATUS_EARLY_MEDIA\";\n SessionStatus[SessionStatus[\"STATUS_CONFIRMED\"] = 12] = \"STATUS_CONFIRMED\";\n})(SessionStatus = exports.SessionStatus || (exports.SessionStatus = {}));\n\nvar TypeStrings;\n\n(function (TypeStrings) {\n TypeStrings[TypeStrings[\"ClientContext\"] = 0] = \"ClientContext\";\n TypeStrings[TypeStrings[\"ConfigurationError\"] = 1] = \"ConfigurationError\";\n TypeStrings[TypeStrings[\"Dialog\"] = 2] = \"Dialog\";\n TypeStrings[TypeStrings[\"DigestAuthentication\"] = 3] = \"DigestAuthentication\";\n TypeStrings[TypeStrings[\"DTMF\"] = 4] = \"DTMF\";\n TypeStrings[TypeStrings[\"IncomingMessage\"] = 5] = \"IncomingMessage\";\n TypeStrings[TypeStrings[\"IncomingRequest\"] = 6] = \"IncomingRequest\";\n TypeStrings[TypeStrings[\"IncomingResponse\"] = 7] = \"IncomingResponse\";\n TypeStrings[TypeStrings[\"InvalidStateError\"] = 8] = \"InvalidStateError\";\n TypeStrings[TypeStrings[\"InviteClientContext\"] = 9] = \"InviteClientContext\";\n TypeStrings[TypeStrings[\"InviteServerContext\"] = 10] = \"InviteServerContext\";\n TypeStrings[TypeStrings[\"Logger\"] = 11] = \"Logger\";\n TypeStrings[TypeStrings[\"LoggerFactory\"] = 12] = \"LoggerFactory\";\n TypeStrings[TypeStrings[\"MethodParameterError\"] = 13] = \"MethodParameterError\";\n TypeStrings[TypeStrings[\"NameAddrHeader\"] = 14] = \"NameAddrHeader\";\n TypeStrings[TypeStrings[\"NotSupportedError\"] = 15] = \"NotSupportedError\";\n TypeStrings[TypeStrings[\"OutgoingRequest\"] = 16] = \"OutgoingRequest\";\n TypeStrings[TypeStrings[\"Parameters\"] = 17] = \"Parameters\";\n TypeStrings[TypeStrings[\"PublishContext\"] = 18] = \"PublishContext\";\n TypeStrings[TypeStrings[\"ReferClientContext\"] = 19] = \"ReferClientContext\";\n TypeStrings[TypeStrings[\"ReferServerContext\"] = 20] = \"ReferServerContext\";\n TypeStrings[TypeStrings[\"RegisterContext\"] = 21] = \"RegisterContext\";\n TypeStrings[TypeStrings[\"RenegotiationError\"] = 22] = \"RenegotiationError\";\n TypeStrings[TypeStrings[\"RequestSender\"] = 23] = \"RequestSender\";\n TypeStrings[TypeStrings[\"ServerContext\"] = 24] = \"ServerContext\";\n TypeStrings[TypeStrings[\"Session\"] = 25] = \"Session\";\n TypeStrings[TypeStrings[\"SessionDescriptionHandler\"] = 26] = \"SessionDescriptionHandler\";\n TypeStrings[TypeStrings[\"SessionDescriptionHandlerError\"] = 27] = \"SessionDescriptionHandlerError\";\n TypeStrings[TypeStrings[\"SessionDescriptionHandlerObserver\"] = 28] = \"SessionDescriptionHandlerObserver\";\n TypeStrings[TypeStrings[\"Subscription\"] = 29] = \"Subscription\";\n TypeStrings[TypeStrings[\"Transport\"] = 30] = \"Transport\";\n TypeStrings[TypeStrings[\"UA\"] = 31] = \"UA\";\n TypeStrings[TypeStrings[\"URI\"] = 32] = \"URI\";\n})(TypeStrings = exports.TypeStrings || (exports.TypeStrings = {})); // UA status codes\n\n\nvar UAStatus;\n\n(function (UAStatus) {\n UAStatus[UAStatus[\"STATUS_INIT\"] = 0] = \"STATUS_INIT\";\n UAStatus[UAStatus[\"STATUS_STARTING\"] = 1] = \"STATUS_STARTING\";\n UAStatus[UAStatus[\"STATUS_READY\"] = 2] = \"STATUS_READY\";\n UAStatus[UAStatus[\"STATUS_USER_CLOSED\"] = 3] = \"STATUS_USER_CLOSED\";\n UAStatus[UAStatus[\"STATUS_NOT_READY\"] = 4] = \"STATUS_NOT_READY\";\n})(UAStatus = exports.UAStatus || (exports.UAStatus = {}));","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n/* eslint no-bitwise: 0 */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport invariant from 'fbjs/lib/invariant';\nimport normalizeColor from 'normalize-css-color';\n\nvar linear = function linear(t) {\n return t;\n};\n/**\n * Very handy helper to map input ranges to output ranges with an easing\n * function and custom behavior outside of the ranges.\n */\n\n\nfunction createInterpolation(config) {\n if (config.outputRange && typeof config.outputRange[0] === 'string') {\n return createInterpolationFromStringOutputRange(config);\n }\n\n var outputRange = config.outputRange;\n checkInfiniteRange('outputRange', outputRange);\n var inputRange = config.inputRange;\n checkInfiniteRange('inputRange', inputRange);\n checkValidInputRange(inputRange);\n invariant(inputRange.length === outputRange.length, 'inputRange (' + inputRange.length + ') and outputRange (' + outputRange.length + ') must have the same length');\n var easing = config.easing || linear;\n var extrapolateLeft = 'extend';\n\n if (config.extrapolateLeft !== undefined) {\n extrapolateLeft = config.extrapolateLeft;\n } else if (config.extrapolate !== undefined) {\n extrapolateLeft = config.extrapolate;\n }\n\n var extrapolateRight = 'extend';\n\n if (config.extrapolateRight !== undefined) {\n extrapolateRight = config.extrapolateRight;\n } else if (config.extrapolate !== undefined) {\n extrapolateRight = config.extrapolate;\n }\n\n return function (input) {\n invariant(typeof input === 'number', 'Cannot interpolation an input which is not a number');\n var range = findRange(input, inputRange);\n return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight);\n };\n}\n\nfunction interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) {\n var result = input; // Extrapolate\n\n if (result < inputMin) {\n if (extrapolateLeft === 'identity') {\n return result;\n } else if (extrapolateLeft === 'clamp') {\n result = inputMin;\n } else if (extrapolateLeft === 'extend') {// noop\n }\n }\n\n if (result > inputMax) {\n if (extrapolateRight === 'identity') {\n return result;\n } else if (extrapolateRight === 'clamp') {\n result = inputMax;\n } else if (extrapolateRight === 'extend') {// noop\n }\n }\n\n if (outputMin === outputMax) {\n return outputMin;\n }\n\n if (inputMin === inputMax) {\n if (input <= inputMin) {\n return outputMin;\n }\n\n return outputMax;\n } // Input Range\n\n\n if (inputMin === -Infinity) {\n result = -result;\n } else if (inputMax === Infinity) {\n result = result - inputMin;\n } else {\n result = (result - inputMin) / (inputMax - inputMin);\n } // Easing\n\n\n result = easing(result); // Output Range\n\n if (outputMin === -Infinity) {\n result = -result;\n } else if (outputMax === Infinity) {\n result = result + outputMin;\n } else {\n result = result * (outputMax - outputMin) + outputMin;\n }\n\n return result;\n}\n\nfunction colorToRgba(input) {\n var int32Color = normalizeColor(input);\n\n if (int32Color === null) {\n return input;\n }\n\n int32Color = int32Color || 0;\n var r = (int32Color & 0xff000000) >>> 24;\n var g = (int32Color & 0x00ff0000) >>> 16;\n var b = (int32Color & 0x0000ff00) >>> 8;\n var a = (int32Color & 0x000000ff) / 255;\n return \"rgba(\" + r + \", \" + g + \", \" + b + \", \" + a + \")\";\n}\n\nvar stringShapeRegex = /[0-9\\.-]+/g;\n/**\n * Supports string shapes by extracting numbers so new values can be computed,\n * and recombines those values into new strings of the same shape. Supports\n * things like:\n *\n * rgba(123, 42, 99, 0.36) // colors\n * -45deg // values with units\n */\n\nfunction createInterpolationFromStringOutputRange(config) {\n var outputRange = config.outputRange;\n invariant(outputRange.length >= 2, 'Bad output range');\n outputRange = outputRange.map(colorToRgba);\n checkPattern(outputRange); // ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.5)']\n // ->\n // [\n // [0, 50],\n // [100, 150],\n // [200, 250],\n // [0, 0.5],\n // ]\n\n /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to\n * guard against this possibility.\n */\n\n var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {\n return [];\n });\n outputRange.forEach(function (value) {\n /* $FlowFixMe(>=0.18.0): `value.match()` can return `null`. Need to guard\n * against this possibility.\n */\n value.match(stringShapeRegex).forEach(function (number, i) {\n outputRanges[i].push(+number);\n });\n });\n /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to\n * guard against this possibility.\n */\n\n var interpolations = outputRange[0].match(stringShapeRegex).map(function (value, i) {\n return createInterpolation(_objectSpread({}, config, {\n outputRange: outputRanges[i]\n }));\n }); // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to\n // round the opacity (4th column).\n\n var shouldRound = isRgbOrRgba(outputRange[0]);\n return function (input) {\n var i = 0; // 'rgba(0, 100, 200, 0)'\n // ->\n // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'\n\n return outputRange[0].replace(stringShapeRegex, function () {\n var val = +interpolations[i++](input);\n var rounded = shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000;\n return String(rounded);\n });\n };\n}\n\nfunction isRgbOrRgba(range) {\n return typeof range === 'string' && range.startsWith('rgb');\n}\n\nfunction checkPattern(arr) {\n var pattern = arr[0].replace(stringShapeRegex, '');\n\n for (var i = 1; i < arr.length; ++i) {\n invariant(pattern === arr[i].replace(stringShapeRegex, ''), 'invalid pattern ' + arr[0] + ' and ' + arr[i]);\n }\n}\n\nfunction findRange(input, inputRange) {\n var i;\n\n for (i = 1; i < inputRange.length - 1; ++i) {\n if (inputRange[i] >= input) {\n break;\n }\n }\n\n return i - 1;\n}\n\nfunction checkValidInputRange(arr) {\n invariant(arr.length >= 2, 'inputRange must have at least 2 elements');\n\n for (var i = 1; i < arr.length; ++i) {\n invariant(arr[i] >= arr[i - 1],\n /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment,\n * one or both of the operands may be something that doesn't cleanly\n * convert to a string, like undefined, null, and object, etc. If you really\n * mean this implicit string conversion, you can do something like\n * String(myThing)\n */\n 'inputRange must be monotonically increasing ' + arr);\n }\n}\n\nfunction checkInfiniteRange(name, arr) {\n invariant(arr.length >= 2, name + ' must have at least 2 elements');\n invariant(arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity,\n /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment,\n * one or both of the operands may be something that doesn't cleanly convert\n * to a string, like undefined, null, and object, etc. If you really mean\n * this implicit string conversion, you can do something like\n * String(myThing)\n */\n name + 'cannot be ]-infinity;+infinity[ ' + arr);\n}\n\nvar AnimatedInterpolation =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedInterpolation, _AnimatedWithChildren); // Export for testing.\n\n\n function AnimatedInterpolation(parent, config) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._parent = parent;\n _this._config = config;\n _this._interpolation = createInterpolation(config);\n return _this;\n }\n\n var _proto = AnimatedInterpolation.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._parent.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n var parentValue = this._parent.__getValue();\n\n invariant(typeof parentValue === 'number', 'Cannot interpolate an input which is not a number.');\n return this._interpolation(parentValue);\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__attach = function __attach() {\n this._parent.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._parent.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__transformDataType = function __transformDataType(range) {\n // Change the string array type to number array\n // So we can reuse the same logic in iOS and Android platform\n return range.map(function (value) {\n if (typeof value !== 'string') {\n return value;\n }\n\n if (/deg$/.test(value)) {\n var degrees = parseFloat(value) || 0;\n var radians = degrees * Math.PI / 180.0;\n return radians;\n } else {\n // Assume radians\n return parseFloat(value) || 0;\n }\n });\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n if (process.env.NODE_ENV !== 'production') {\n NativeAnimatedHelper.validateInterpolation(this._config);\n }\n\n return {\n inputRange: this._config.inputRange,\n // Only the `outputRange` can contain strings so we don't need to transform `inputRange` here\n outputRange: this.__transformDataType(this._config.outputRange),\n extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend',\n extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend',\n type: 'interpolation'\n };\n };\n\n return AnimatedInterpolation;\n}(AnimatedWithChildren);\n\nAnimatedInterpolation.__createInterpolation = createInterpolation;\nexport default AnimatedInterpolation;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\"); // Directories\n\n\ntslib_1.__exportStar(require(\"./dialogs\"), exports);\n\ntslib_1.__exportStar(require(\"./exceptions\"), exports);\n\ntslib_1.__exportStar(require(\"./log\"), exports);\n\ntslib_1.__exportStar(require(\"./messages\"), exports);\n\ntslib_1.__exportStar(require(\"./session\"), exports);\n\ntslib_1.__exportStar(require(\"./subscription\"), exports);\n\ntslib_1.__exportStar(require(\"./transactions\"), exports);\n\ntslib_1.__exportStar(require(\"./user-agent-core\"), exports);\n\ntslib_1.__exportStar(require(\"./user-agents\"), exports); // Files\n\n\ntslib_1.__exportStar(require(\"./timers\"), exports);\n\ntslib_1.__exportStar(require(\"./transport\"), exports);","'use strict';\n\nvar bind = require('./helpers/bind');\n\nvar isBuffer = require('is-buffer');\n/*global toString:true*/\n// utils is a library of generic helper functions non-specific to axios\n\n\nvar toString = Object.prototype.toString;\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\n\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\n\n\nfunction isFormData(val) {\n return typeof FormData !== 'undefined' && val instanceof FormData;\n}\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBufferView(val) {\n var result;\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && val.buffer instanceof ArrayBuffer;\n }\n\n return result;\n}\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\n\n\nfunction isString(val) {\n return typeof val === 'string';\n}\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\n\n\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\n\n\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\n\n\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\n\n\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\n\n\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\n\n\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\n\n\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\n\n\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\n\n\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\n\n\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\n\n\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\n\n\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n } // Force an array if not already something iterable\n\n\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction merge()\n/* obj1, obj2, obj3, ... */\n{\n var result = {};\n\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction deepMerge()\n/* obj1, obj2, obj3, ... */\n{\n var result = {};\n\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\n\n\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};","import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NativeModules,\n Platform,\n PixelRatio,\n processColor,\n Text,\n} from './react-native';\n\nimport ensureNativeModuleAvailable from './ensure-native-module-available';\nimport createIconButtonComponent from './icon-button';\nimport createTabBarItemIOSComponent from './tab-bar-item-ios';\nimport createToolbarAndroidComponent from './toolbar-android';\n\nexport const NativeIconAPI =\n NativeModules.RNVectorIconsManager || NativeModules.RNVectorIconsModule;\n\nexport const DEFAULT_ICON_SIZE = 12;\nexport const DEFAULT_ICON_COLOR = 'black';\n\nexport default function createIconSet(\n glyphMap,\n fontFamily,\n fontFile,\n fontStyle\n) {\n // Android doesn't care about actual fontFamily name, it will only look in fonts folder.\n const fontBasename = fontFile\n ? fontFile.replace(/\\.(otf|ttf)$/, '')\n : fontFamily;\n\n const fontReference = Platform.select({\n windows: `Assets/${fontFile}#${fontFamily}`,\n android: fontBasename,\n web: fontBasename,\n default: fontFamily,\n });\n\n const IconNamePropType = PropTypes.oneOf(Object.keys(glyphMap));\n\n class Icon extends PureComponent {\n static propTypes = {\n allowFontScaling: PropTypes.bool,\n name: IconNamePropType,\n size: PropTypes.number,\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n children: PropTypes.node,\n style: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n };\n\n static defaultProps = {\n size: DEFAULT_ICON_SIZE,\n allowFontScaling: false,\n };\n\n root = null;\n\n setNativeProps(nativeProps) {\n if (this.root) {\n this.root.setNativeProps(nativeProps);\n }\n }\n\n handleRef = ref => {\n this.root = ref;\n };\n\n render() {\n const { name, size, color, style, children, ...props } = this.props;\n\n let glyph = name ? glyphMap[name] || '?' : '';\n if (typeof glyph === 'number') {\n glyph = String.fromCharCode(glyph);\n }\n\n const styleDefaults = {\n fontSize: size,\n color,\n };\n\n const styleOverrides = {\n fontFamily: fontReference,\n fontWeight: 'normal',\n fontStyle: 'normal',\n };\n\n props.style = [styleDefaults, style, styleOverrides, fontStyle || {}];\n props.ref = this.handleRef;\n\n return (\n \n {glyph}\n {children}\n \n );\n }\n }\n\n const imageSourceCache = {};\n\n function getImageSource(\n name,\n size = DEFAULT_ICON_SIZE,\n color = DEFAULT_ICON_COLOR\n ) {\n ensureNativeModuleAvailable();\n\n let glyph = glyphMap[name] || '?';\n if (typeof glyph === 'number') {\n glyph = String.fromCharCode(glyph);\n }\n\n const processedColor = processColor(color);\n const cacheKey = `${glyph}:${size}:${processedColor}`;\n const scale = PixelRatio.get();\n\n return new Promise((resolve, reject) => {\n const cached = imageSourceCache[cacheKey];\n if (typeof cached !== 'undefined') {\n if (!cached || cached instanceof Error) {\n reject(cached);\n } else {\n resolve({ uri: cached, scale });\n }\n } else {\n NativeIconAPI.getImageForFont(\n fontReference,\n glyph,\n size,\n processedColor,\n (err, image) => {\n const error = typeof err === 'string' ? new Error(err) : err;\n imageSourceCache[cacheKey] = image || error || false;\n if (!error && image) {\n resolve({ uri: image, scale });\n } else {\n reject(error);\n }\n }\n );\n }\n });\n }\n\n function loadFont(file = fontFile) {\n if (Platform.OS === 'ios') {\n ensureNativeModuleAvailable();\n if (!file) {\n return Promise.reject(\n new Error('Unable to load font, because no file was specified. ')\n );\n }\n return NativeIconAPI.loadFontWithFileName(...file.split('.'));\n }\n return Promise.resolve();\n }\n\n function hasIcon(name) {\n return Object.prototype.hasOwnProperty.call(glyphMap, name);\n }\n\n function getRawGlyphMap() {\n return glyphMap;\n }\n\n function getFontFamily() {\n return fontReference;\n }\n\n Icon.Button = createIconButtonComponent(Icon);\n Icon.TabBarItem = createTabBarItemIOSComponent(\n IconNamePropType,\n getImageSource\n );\n Icon.TabBarItemIOS = Icon.TabBarItem;\n Icon.ToolbarAndroid = createToolbarAndroidComponent(\n IconNamePropType,\n getImageSource\n );\n Icon.getImageSource = getImageSource;\n Icon.loadFont = loadFont;\n Icon.hasIcon = hasIcon;\n Icon.getRawGlyphMap = getRawGlyphMap;\n Icon.getFontFamily = getFontFamily;\n\n return Icon;\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Platform,\n TouchableHighlight,\n View,\n StyleSheet,\n Text as NativeText,\n} from 'react-native';\n\nimport getIconType from '../helpers/getIconType';\nimport { ViewPropTypes, withTheme } from '../config';\n\nconst Icon = props => {\n const {\n type,\n name,\n size,\n color,\n iconStyle,\n underlayColor,\n reverse,\n raised,\n containerStyle,\n reverseColor,\n disabled,\n disabledStyle,\n onPress,\n Component = onPress ? TouchableHighlight : View,\n ...attributes\n } = props;\n\n const IconComponent = getIconType(type);\n const getBackgroundColor = () => {\n if (reverse) {\n return color;\n }\n\n return raised ? 'white' : 'transparent';\n };\n\n return (\n \n \n \n \n \n );\n};\n\nIcon.propTypes = {\n type: PropTypes.string,\n name: PropTypes.string,\n size: PropTypes.number,\n color: PropTypes.string,\n Component: PropTypes.func,\n underlayColor: PropTypes.string,\n reverse: PropTypes.bool,\n raised: PropTypes.bool,\n containerStyle: ViewPropTypes.style,\n iconStyle: NativeText.propTypes.style,\n onPress: PropTypes.func,\n reverseColor: PropTypes.string,\n disabled: PropTypes.bool,\n disabledStyle: ViewPropTypes.style,\n};\n\nIcon.defaultProps = {\n underlayColor: 'white',\n reverse: false,\n raised: false,\n size: 24,\n color: 'black',\n reverseColor: 'white',\n disabled: false,\n type: 'material',\n};\n\nconst styles = StyleSheet.create({\n button: {\n margin: 7,\n },\n raised: {\n ...Platform.select({\n android: {\n elevation: 2,\n },\n default: {\n shadowColor: 'rgba(0,0,0, .4)',\n shadowOffset: { height: 1, width: 1 },\n shadowOpacity: 1,\n shadowRadius: 1,\n },\n }),\n },\n disabled: {\n backgroundColor: '#D1D5D8',\n },\n});\n\nexport { Icon };\nexport default withTheme(Icon, 'Icon');\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n'use strict';\n\nvar React = require('react');\n\nvar factory = require('./factory');\n\nif (typeof React === 'undefined') {\n throw Error('create-react-class could not find the React object. If you are using script tags, ' + 'make sure that React is being loaded before create-react-class.');\n} // Hack to grab NoopUpdateQueue from isomorphic React\n\n\nvar ReactNoopUpdateQueue = new React.Component().updater;\nmodule.exports = factory(React.Component, React.isValidElement, ReactNoopUpdateQueue);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar exceptions_1 = require(\"../exceptions\");\n\nvar messages_1 = require(\"../messages\");\n\nvar utils_1 = require(\"../messages/utils\");\n\nvar transactions_1 = require(\"../transactions\");\n/**\n * User Agent Server (UAS): A user agent server is a logical entity\n * that generates a response to a SIP request. The response\n * accepts, rejects, or redirects the request. This role lasts\n * only for the duration of that transaction. In other words, if\n * a piece of software responds to a request, it acts as a UAS for\n * the duration of that transaction. If it generates a request\n * later, it assumes the role of a user agent client for the\n * processing of that transaction.\n * https://tools.ietf.org/html/rfc3261#section-6\n */\n\n\nvar UserAgentServer =\n/** @class */\nfunction () {\n function UserAgentServer(transactionConstructor, core, message, delegate) {\n this.transactionConstructor = transactionConstructor;\n this.core = core;\n this.message = message;\n this.delegate = delegate;\n this.logger = this.loggerFactory.getLogger(\"sip.user-agent-server\");\n this.toTag = message.toTag ? message.toTag : utils_1.newTag();\n this.init();\n }\n\n UserAgentServer.prototype.dispose = function () {\n this.transaction.dispose();\n };\n\n Object.defineProperty(UserAgentServer.prototype, \"loggerFactory\", {\n get: function get() {\n return this.core.loggerFactory;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserAgentServer.prototype, \"transaction\", {\n /** The transaction associated with this request. */\n get: function get() {\n if (!this._transaction) {\n throw new Error(\"Transaction undefined.\");\n }\n\n return this._transaction;\n },\n enumerable: true,\n configurable: true\n });\n\n UserAgentServer.prototype.accept = function (options) {\n if (options === void 0) {\n options = {\n statusCode: 200\n };\n }\n\n if (!this.acceptable) {\n throw new exceptions_1.TransactionStateError(this.message.method + \" not acceptable in state \" + this.transaction.state + \".\");\n }\n\n var statusCode = options.statusCode;\n\n if (statusCode < 200 || statusCode > 299) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n var response = this.reply(options);\n return response;\n };\n\n UserAgentServer.prototype.progress = function (options) {\n if (options === void 0) {\n options = {\n statusCode: 180\n };\n }\n\n if (!this.progressable) {\n throw new exceptions_1.TransactionStateError(this.message.method + \" not progressable in state \" + this.transaction.state + \".\");\n }\n\n var statusCode = options.statusCode;\n\n if (statusCode < 101 || statusCode > 199) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n var response = this.reply(options);\n return response;\n };\n\n UserAgentServer.prototype.redirect = function (contacts, options) {\n if (options === void 0) {\n options = {\n statusCode: 302\n };\n }\n\n if (!this.redirectable) {\n throw new exceptions_1.TransactionStateError(this.message.method + \" not redirectable in state \" + this.transaction.state + \".\");\n }\n\n var statusCode = options.statusCode;\n\n if (statusCode < 300 || statusCode > 399) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n var contactHeaders = new Array();\n contacts.forEach(function (contact) {\n return contactHeaders.push(\"Contact: \" + contact.toString());\n });\n options.extraHeaders = (options.extraHeaders || []).concat(contactHeaders);\n var response = this.reply(options);\n return response;\n };\n\n UserAgentServer.prototype.reject = function (options) {\n if (options === void 0) {\n options = {\n statusCode: 480\n };\n }\n\n if (!this.rejectable) {\n throw new exceptions_1.TransactionStateError(this.message.method + \" not rejectable in state \" + this.transaction.state + \".\");\n }\n\n var statusCode = options.statusCode;\n\n if (statusCode < 400 || statusCode > 699) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n var response = this.reply(options);\n return response;\n };\n\n UserAgentServer.prototype.trying = function (options) {\n if (!this.tryingable) {\n throw new exceptions_1.TransactionStateError(this.message.method + \" not tryingable in state \" + this.transaction.state + \".\");\n }\n\n var response = this.reply({\n statusCode: 100\n });\n return response;\n };\n /**\n * If the UAS did not find a matching transaction for the CANCEL\n * according to the procedure above, it SHOULD respond to the CANCEL\n * with a 481 (Call Leg/Transaction Does Not Exist). If the transaction\n * for the original request still exists, the behavior of the UAS on\n * receiving a CANCEL request depends on whether it has already sent a\n * final response for the original request. If it has, the CANCEL\n * request has no effect on the processing of the original request, no\n * effect on any session state, and no effect on the responses generated\n * for the original request. If the UAS has not issued a final response\n * for the original request, its behavior depends on the method of the\n * original request. If the original request was an INVITE, the UAS\n * SHOULD immediately respond to the INVITE with a 487 (Request\n * Terminated). A CANCEL request has no impact on the processing of\n * transactions with any other method defined in this specification.\n * https://tools.ietf.org/html/rfc3261#section-9.2\n * @param request Incoming CANCEL request.\n */\n\n\n UserAgentServer.prototype.receiveCancel = function (message) {\n // Note: Currently CANCEL is being handled as a special case.\n // No UAS is created to handle the CANCEL and the response to\n // it CANCEL is being handled statelessly by the user agent core.\n // As such, there is currently no way to externally impact the\n // response to the a CANCEL request.\n if (this.delegate && this.delegate.onCancel) {\n this.delegate.onCancel(message);\n }\n };\n\n Object.defineProperty(UserAgentServer.prototype, \"acceptable\", {\n get: function get() {\n if (this.transaction instanceof transactions_1.InviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Proceeding || this.transaction.state === transactions_1.TransactionState.Accepted;\n }\n\n if (this.transaction instanceof transactions_1.NonInviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Trying || this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n throw new Error(\"Unknown transaction type.\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserAgentServer.prototype, \"progressable\", {\n get: function get() {\n if (this.transaction instanceof transactions_1.InviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n if (this.transaction instanceof transactions_1.NonInviteServerTransaction) {\n return false; // https://tools.ietf.org/html/rfc4320#section-4.1\n }\n\n throw new Error(\"Unknown transaction type.\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserAgentServer.prototype, \"redirectable\", {\n get: function get() {\n if (this.transaction instanceof transactions_1.InviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n if (this.transaction instanceof transactions_1.NonInviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Trying || this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n throw new Error(\"Unknown transaction type.\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserAgentServer.prototype, \"rejectable\", {\n get: function get() {\n if (this.transaction instanceof transactions_1.InviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n if (this.transaction instanceof transactions_1.NonInviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Trying || this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n throw new Error(\"Unknown transaction type.\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserAgentServer.prototype, \"tryingable\", {\n get: function get() {\n if (this.transaction instanceof transactions_1.InviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Proceeding;\n }\n\n if (this.transaction instanceof transactions_1.NonInviteServerTransaction) {\n return this.transaction.state === transactions_1.TransactionState.Trying;\n }\n\n throw new Error(\"Unknown transaction type.\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * When a UAS wishes to construct a response to a request, it follows\n * the general procedures detailed in the following subsections.\n * Additional behaviors specific to the response code in question, which\n * are not detailed in this section, may also be required.\n *\n * Once all procedures associated with the creation of a response have\n * been completed, the UAS hands the response back to the server\n * transaction from which it received the request.\n * https://tools.ietf.org/html/rfc3261#section-8.2.6\n * @param statusCode Status code to reply with.\n * @param options Reply options bucket.\n */\n\n UserAgentServer.prototype.reply = function (options) {\n if (!options.toTag && options.statusCode !== 100) {\n options.toTag = this.toTag;\n }\n\n options.userAgent = options.userAgent || this.core.configuration.userAgentHeaderFieldValue;\n options.supported = options.supported || this.core.configuration.supportedOptionTagsResponse;\n var response = messages_1.constructOutgoingResponse(this.message, options);\n this.transaction.receiveResponse(options.statusCode, response.message);\n return response;\n };\n\n UserAgentServer.prototype.init = function () {\n var _this = this; // We are the transaction user.\n\n\n var user = {\n loggerFactory: this.loggerFactory,\n onStateChange: function onStateChange(newState) {\n if (newState === transactions_1.TransactionState.Terminated) {\n // Remove the terminated transaction from the core.\n _this.core.userAgentServers.delete(userAgentServerId);\n\n _this.dispose();\n }\n },\n onTransportError: function onTransportError(error) {\n _this.logger.error(error.message);\n\n if (_this.delegate && _this.delegate.onTransportError) {\n _this.delegate.onTransportError(error);\n } else {\n _this.logger.error(\"User agent server response transport error.\");\n }\n }\n }; // Create a new transaction with us as the user.\n\n var transaction = new this.transactionConstructor(this.message, this.core.transport, user);\n this._transaction = transaction; // Add the new transaction to the core.\n\n var userAgentServerId = transaction.id;\n this.core.userAgentServers.set(transaction.id, this);\n };\n\n return UserAgentServer;\n}();\n\nexports.UserAgentServer = UserAgentServer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n}); // tslint:disable-next-line:no-var-requires\n\nvar pkg = require(\"../package.json\");\n\nvar C;\n\n(function (C) {\n C.USER_AGENT = pkg.title + \"/\" + pkg.version; // SIP scheme\n\n C.SIP = \"sip\";\n C.SIPS = \"sips\"; // End and Failure causes\n\n var causes;\n\n (function (causes) {\n // Generic error causes\n causes[\"CONNECTION_ERROR\"] = \"Connection Error\";\n causes[\"INTERNAL_ERROR\"] = \"Internal Error\";\n causes[\"REQUEST_TIMEOUT\"] = \"Request Timeout\";\n causes[\"SIP_FAILURE_CODE\"] = \"SIP Failure Code\"; // SIP error causes\n\n causes[\"ADDRESS_INCOMPLETE\"] = \"Address Incomplete\";\n causes[\"AUTHENTICATION_ERROR\"] = \"Authentication Error\";\n causes[\"BUSY\"] = \"Busy\";\n causes[\"DIALOG_ERROR\"] = \"Dialog Error\";\n causes[\"INCOMPATIBLE_SDP\"] = \"Incompatible SDP\";\n causes[\"NOT_FOUND\"] = \"Not Found\";\n causes[\"REDIRECTED\"] = \"Redirected\";\n causes[\"REJECTED\"] = \"Rejected\";\n causes[\"UNAVAILABLE\"] = \"Unavailable\"; // Session error causes\n\n causes[\"BAD_MEDIA_DESCRIPTION\"] = \"Bad Media Description\";\n causes[\"CANCELED\"] = \"Canceled\";\n causes[\"EXPIRES\"] = \"Expires\";\n causes[\"NO_ACK\"] = \"No ACK\";\n causes[\"NO_ANSWER\"] = \"No Answer\";\n causes[\"NO_PRACK\"] = \"No PRACK\";\n causes[\"RTP_TIMEOUT\"] = \"RTP Timeout\";\n causes[\"USER_DENIED_MEDIA_ACCESS\"] = \"User Denied Media Access\";\n causes[\"WEBRTC_ERROR\"] = \"WebRTC Error\";\n causes[\"WEBRTC_NOT_SUPPORTED\"] = \"WebRTC Not Supported\";\n })(causes = C.causes || (C.causes = {}));\n\n var supported;\n\n (function (supported) {\n supported[\"REQUIRED\"] = \"required\";\n supported[\"SUPPORTED\"] = \"supported\";\n supported[\"UNSUPPORTED\"] = \"none\";\n })(supported = C.supported || (C.supported = {}));\n\n C.SIP_ERROR_CAUSES = {\n ADDRESS_INCOMPLETE: [484],\n AUTHENTICATION_ERROR: [401, 407],\n BUSY: [486, 600],\n INCOMPATIBLE_SDP: [488, 606],\n NOT_FOUND: [404, 604],\n REDIRECTED: [300, 301, 302, 305, 380],\n REJECTED: [403, 603],\n UNAVAILABLE: [480, 410, 408, 430]\n }; // SIP Methods\n\n C.ACK = \"ACK\";\n C.BYE = \"BYE\";\n C.CANCEL = \"CANCEL\";\n C.INFO = \"INFO\";\n C.INVITE = \"INVITE\";\n C.MESSAGE = \"MESSAGE\";\n C.NOTIFY = \"NOTIFY\";\n C.OPTIONS = \"OPTIONS\";\n C.REGISTER = \"REGISTER\";\n C.UPDATE = \"UPDATE\";\n C.SUBSCRIBE = \"SUBSCRIBE\";\n C.PUBLISH = \"PUBLISH\";\n C.REFER = \"REFER\";\n C.PRACK = \"PRACK\";\n /* SIP Response Reasons\n * DOC: http://www.iana.org/assignments/sip-parameters\n * Copied from https://github.com/versatica/OverSIP/blob/master/lib/oversip/sip/constants.rb#L7\n */\n\n C.REASON_PHRASE = {\n 100: \"Trying\",\n 180: \"Ringing\",\n 181: \"Call Is Being Forwarded\",\n 182: \"Queued\",\n 183: \"Session Progress\",\n 199: \"Early Dialog Terminated\",\n 200: \"OK\",\n 202: \"Accepted\",\n 204: \"No Notification\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Moved Temporarily\",\n 305: \"Use Proxy\",\n 380: \"Alternative Service\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 410: \"Gone\",\n 412: \"Conditional Request Failed\",\n 413: \"Request Entity Too Large\",\n 414: \"Request-URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Unsupported URI Scheme\",\n 417: \"Unknown Resource-Priority\",\n 420: \"Bad Extension\",\n 421: \"Extension Required\",\n 422: \"Session Interval Too Small\",\n 423: \"Interval Too Brief\",\n 428: \"Use Identity Header\",\n 429: \"Provide Referrer Identity\",\n 430: \"Flow Failed\",\n 433: \"Anonymity Disallowed\",\n 436: \"Bad Identity-Info\",\n 437: \"Unsupported Certificate\",\n 438: \"Invalid Identity Header\",\n 439: \"First Hop Lacks Outbound Support\",\n 440: \"Max-Breadth Exceeded\",\n 469: \"Bad Info Package\",\n 470: \"Consent Needed\",\n 478: \"Unresolvable Destination\",\n 480: \"Temporarily Unavailable\",\n 481: \"Call/Transaction Does Not Exist\",\n 482: \"Loop Detected\",\n 483: \"Too Many Hops\",\n 484: \"Address Incomplete\",\n 485: \"Ambiguous\",\n 486: \"Busy Here\",\n 487: \"Request Terminated\",\n 488: \"Not Acceptable Here\",\n 489: \"Bad Event\",\n 491: \"Request Pending\",\n 493: \"Undecipherable\",\n 494: \"Security Agreement Required\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Server Time-out\",\n 505: \"Version Not Supported\",\n 513: \"Message Too Large\",\n 580: \"Precondition Failure\",\n 600: \"Busy Everywhere\",\n 603: \"Decline\",\n 604: \"Does Not Exist Anywhere\",\n 606: \"Not Acceptable\"\n };\n /* SIP Option Tags\n * DOC: http://www.iana.org/assignments/sip-parameters/sip-parameters.xhtml#sip-parameters-4\n */\n\n C.OPTION_TAGS = {\n \"100rel\": true,\n \"199\": true,\n \"answermode\": true,\n \"early-session\": true,\n \"eventlist\": true,\n \"explicitsub\": true,\n \"from-change\": true,\n \"geolocation-http\": true,\n \"geolocation-sip\": true,\n \"gin\": true,\n \"gruu\": true,\n \"histinfo\": true,\n \"ice\": true,\n \"join\": true,\n \"multiple-refer\": true,\n \"norefersub\": true,\n \"nosub\": true,\n \"outbound\": true,\n \"path\": true,\n \"policy\": true,\n \"precondition\": true,\n \"pref\": true,\n \"privacy\": true,\n \"recipient-list-invite\": true,\n \"recipient-list-message\": true,\n \"recipient-list-subscribe\": true,\n \"replaces\": true,\n \"resource-priority\": true,\n \"sdp-anat\": true,\n \"sec-agree\": true,\n \"tdialog\": true,\n \"timer\": true,\n \"uui\": true // RFC 7433\n\n };\n var dtmfType;\n\n (function (dtmfType) {\n dtmfType[\"INFO\"] = \"info\";\n dtmfType[\"RTP\"] = \"rtp\";\n })(dtmfType = C.dtmfType || (C.dtmfType = {}));\n})(C = exports.C || (exports.C = {}));","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar Constants_1 = require(\"./Constants\");\n\nvar grammar_1 = require(\"./core/messages/grammar\");\n\nvar uri_1 = require(\"./core/messages/uri\");\n\nvar Utils;\n\n(function (Utils) {\n function defer() {\n var deferred = {};\n deferred.promise = new Promise(function (resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n return deferred;\n }\n\n Utils.defer = defer;\n\n function reducePromises(arr, val) {\n return arr.reduce(function (acc, fn) {\n acc = acc.then(fn);\n return acc;\n }, Promise.resolve(val));\n }\n\n Utils.reducePromises = reducePromises;\n\n function str_utf8_length(str) {\n return encodeURIComponent(str).replace(/%[A-F\\d]{2}/g, \"U\").length;\n }\n\n Utils.str_utf8_length = str_utf8_length;\n\n function generateFakeSDP(body) {\n if (!body) {\n return;\n }\n\n var start = body.indexOf(\"o=\");\n var end = body.indexOf(\"\\r\\n\", start);\n return \"v=0\\r\\n\" + body.slice(start, end) + \"\\r\\ns=-\\r\\nt=0 0\\r\\nc=IN IP4 0.0.0.0\";\n }\n\n Utils.generateFakeSDP = generateFakeSDP;\n\n function isDecimal(num) {\n var numAsNum = parseInt(num, 10);\n return !isNaN(numAsNum) && parseFloat(num) === numAsNum;\n }\n\n Utils.isDecimal = isDecimal;\n\n function createRandomToken(size, base) {\n if (base === void 0) {\n base = 32;\n }\n\n var token = \"\";\n\n for (var i = 0; i < size; i++) {\n var r = Math.floor(Math.random() * base);\n token += r.toString(base);\n }\n\n return token;\n }\n\n Utils.createRandomToken = createRandomToken;\n\n function newTag() {\n // used to use the constant in UA\n return Utils.createRandomToken(10);\n }\n\n Utils.newTag = newTag; // http://stackoverflow.com/users/109538/broofa\n\n function newUUID() {\n var UUID = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = Math.floor(Math.random() * 16);\n var v = c === \"x\" ? r : r % 4 + 8;\n return v.toString(16);\n });\n return UUID;\n }\n\n Utils.newUUID = newUUID;\n /*\n * Normalize SIP URI.\n * NOTE: It does not allow a SIP URI without username.\n * Accepts 'sip', 'sips' and 'tel' URIs and convert them into 'sip'.\n * Detects the domain part (if given) and properly hex-escapes the user portion.\n * If the user portion has only 'tel' number symbols the user portion is clean of 'tel' visual separators.\n * @private\n * @param {String} target\n * @param {String} [domain]\n */\n\n function normalizeTarget(target, domain) {\n // If no target is given then raise an error.\n if (!target) {\n return; // If a SIP.URI instance is given then return it.\n } else if (target instanceof uri_1.URI) {\n return target; // If a string is given split it by '@':\n // - Last fragment is the desired domain.\n // - Otherwise append the given domain argument.\n } else if (typeof target === \"string\") {\n var targetArray = target.split(\"@\");\n var targetUser = void 0;\n var targetDomain = void 0;\n\n switch (targetArray.length) {\n case 1:\n if (!domain) {\n return;\n }\n\n targetUser = target;\n targetDomain = domain;\n break;\n\n case 2:\n targetUser = targetArray[0];\n targetDomain = targetArray[1];\n break;\n\n default:\n targetUser = targetArray.slice(0, targetArray.length - 1).join(\"@\");\n targetDomain = targetArray[targetArray.length - 1];\n } // Remove the URI scheme (if present).\n\n\n targetUser = targetUser.replace(/^(sips?|tel):/i, \"\"); // Remove 'tel' visual separators if the user portion just contains 'tel' number symbols.\n\n if (/^[\\-\\.\\(\\)]*\\+?[0-9\\-\\.\\(\\)]+$/.test(targetUser)) {\n targetUser = targetUser.replace(/[\\-\\.\\(\\)]/g, \"\");\n } // Build the complete SIP URI.\n\n\n target = Constants_1.C.SIP + \":\" + Utils.escapeUser(targetUser) + \"@\" + targetDomain; // Finally parse the resulting URI.\n\n return grammar_1.Grammar.URIParse(target);\n } else {\n return;\n }\n }\n\n Utils.normalizeTarget = normalizeTarget;\n /*\n * Hex-escape a SIP URI user.\n * @private\n * @param {String} user\n */\n\n function escapeUser(user) {\n // Don't hex-escape ':' (%3A), '+' (%2B), '?' (%3F\"), '/' (%2F).\n return encodeURIComponent(decodeURIComponent(user)).replace(/%3A/ig, \":\").replace(/%2B/ig, \"+\").replace(/%3F/ig, \"?\").replace(/%2F/ig, \"/\");\n }\n\n Utils.escapeUser = escapeUser;\n\n function headerize(str) {\n var exceptions = {\n \"Call-Id\": \"Call-ID\",\n \"Cseq\": \"CSeq\",\n \"Min-Se\": \"Min-SE\",\n \"Rack\": \"RAck\",\n \"Rseq\": \"RSeq\",\n \"Www-Authenticate\": \"WWW-Authenticate\"\n };\n var name = str.toLowerCase().replace(/_/g, \"-\").split(\"-\");\n var parts = name.length;\n var hname = \"\";\n\n for (var part = 0; part < parts; part++) {\n if (part !== 0) {\n hname += \"-\";\n }\n\n hname += name[part].charAt(0).toUpperCase() + name[part].substring(1);\n }\n\n if (exceptions[hname]) {\n hname = exceptions[hname];\n }\n\n return hname;\n }\n\n Utils.headerize = headerize;\n\n function sipErrorCause(statusCode) {\n for (var cause in Constants_1.C.SIP_ERROR_CAUSES) {\n if (Constants_1.C.SIP_ERROR_CAUSES[cause].indexOf(statusCode) !== -1) {\n return Constants_1.C.causes[cause];\n }\n }\n\n return Constants_1.C.causes.SIP_FAILURE_CODE;\n }\n\n Utils.sipErrorCause = sipErrorCause;\n\n function getReasonPhrase(code, specific) {\n return specific || Constants_1.C.REASON_PHRASE[code] || \"\";\n }\n\n Utils.getReasonPhrase = getReasonPhrase;\n\n function getReasonHeaderValue(code, reason) {\n reason = Utils.getReasonPhrase(code, reason);\n return \"SIP;cause=\" + code + ';text=\"' + reason + '\"';\n }\n\n Utils.getReasonHeaderValue = getReasonHeaderValue;\n\n function getCancelReason(code, reason) {\n if (code && code < 200 || code > 699) {\n throw new TypeError(\"Invalid statusCode: \" + code);\n } else if (code) {\n return Utils.getReasonHeaderValue(code, reason);\n }\n }\n\n Utils.getCancelReason = getCancelReason;\n\n function buildStatusLine(code, reason) {\n // Validate code and reason values\n if (!code || code < 100 || code > 699) {\n throw new TypeError(\"Invalid statusCode: \" + code);\n } else if (reason && typeof reason !== \"string\" && !(reason instanceof String)) {\n throw new TypeError(\"Invalid reason: \" + reason);\n }\n\n reason = Utils.getReasonPhrase(code, reason);\n return \"SIP/2.0 \" + code + \" \" + reason + \"\\r\\n\";\n }\n\n Utils.buildStatusLine = buildStatusLine;\n /**\n * Create a Body given a BodyObj.\n * @param bodyObj Body Object\n */\n\n function fromBodyObj(bodyObj) {\n var content = bodyObj.body;\n var contentType = bodyObj.contentType;\n var contentDisposition = contentTypeToContentDisposition(contentType);\n var body = {\n contentDisposition: contentDisposition,\n contentType: contentType,\n content: content\n };\n return body;\n }\n\n Utils.fromBodyObj = fromBodyObj;\n /**\n * Create a BodyObj given a Body.\n * @param bodyObj Body Object\n */\n\n function toBodyObj(body) {\n var bodyObj = {\n body: body.content,\n contentType: body.contentType\n };\n return bodyObj;\n }\n\n Utils.toBodyObj = toBodyObj; // If the Content-Disposition header field is missing, bodies of\n // Content-Type application/sdp imply the disposition \"session\", while\n // other content types imply \"render\".\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n\n function contentTypeToContentDisposition(contentType) {\n if (contentType === \"application/sdp\") {\n return \"session\";\n } else {\n return \"render\";\n }\n }\n})(Utils = exports.Utils || (exports.Utils = {}));","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function') {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}","var g; // This works in non-strict mode\n\ng = function () {\n return this;\n}();\n\ntry {\n // This works if eval is allowed (see CSP)\n g = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n // This works if the window reference is available\n if (typeof window === \"object\") g = window;\n} // g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\n\nmodule.exports = g;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null;\nvar ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n};\nvar ReflectOwnKeys;\n\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys;\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n};\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\n\nmodule.exports = EventEmitter; // Backwards-compat with node 0.10.x\n\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\n\nvar defaultMaxListeners = 10;\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function get() {\n return defaultMaxListeners;\n },\n set: function set(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function () {\n if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n}; // Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\n\n\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n\n this._maxListeners = n;\n return this;\n};\n\nfunction $getMaxListeners(that) {\n if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return $getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n\n for (var i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var doError = type === 'error';\n var events = this._events;\n if (events !== undefined) doError = doError && events.error === undefined;else if (!doError) return false; // If there is no 'error' event listener then throw.\n\n if (doError) {\n var er;\n if (args.length > 0) er = args[0];\n\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n } // At least give some kind of context to the user\n\n\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n if (handler === undefined) return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n\n for (var i = 0; i < len; ++i) {\n ReflectApply(listeners[i], this, args);\n }\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = target._events;\n\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type, listener.listener ? listener.listener : listener); // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n\n events = target._events;\n }\n\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] = prepend ? [listener, existing] : [existing, listener]; // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n } // Check for listener leak\n\n\n m = $getMaxListeners(target);\n\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true; // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n\n var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener = function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n};\n\nfunction onceWrapper() {\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n ReflectApply(this.listener, this.target, args);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = {\n fired: false,\n wrapFn: undefined,\n target: target,\n type: type,\n listener: listener\n };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n}; // Emits a 'removeListener' event if and only if the listener was removed.\n\n\nEventEmitter.prototype.removeListener = function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = this._events;\n if (events === undefined) return this;\n list = events[type];\n if (list === undefined) return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else {\n delete events[type];\n if (events.removeListener) this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0) return this;\n if (position === 0) list.shift();else {\n spliceOne(list, position);\n }\n if (list.length === 1) events[type] = list[0];\n if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {\n var listeners, events, i;\n events = this._events;\n if (events === undefined) return this; // not listening for removeListener, no need to emit\n\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type];\n }\n\n return this;\n } // emit removeListener for all listeners on all events\n\n\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n};\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n if (events === undefined) return [];\n var evlistener = events[type];\n if (evlistener === undefined) return [];\n if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function (emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\n\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n\n for (var i = 0; i < n; ++i) {\n copy[i] = arr[i];\n }\n\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++) {\n list[index] = list[index + 1];\n }\n\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n\n return ret;\n}","var freeGlobal = require('./_freeGlobal');\n/** Detect free variable `self`. */\n\n\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n/** Used as a reference to the global object. */\n\nvar root = freeGlobal || freeSelf || Function('return this')();\nmodule.exports = root;","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\nmodule.exports = isArray;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Text, StyleSheet, Platform } from 'react-native';\n\nimport { fonts, withTheme } from '../config';\nimport normalize from '../helpers/normalizeText';\n\nconst TextElement = props => {\n const {\n style,\n children,\n h1,\n h2,\n h3,\n h4,\n h1Style,\n h2Style,\n h3Style,\n h4Style,\n ...rest\n } = props;\n\n return (\n \n {children}\n \n );\n};\n\nTextElement.propTypes = {\n style: Text.propTypes.style,\n h1: PropTypes.bool,\n h2: PropTypes.bool,\n h3: PropTypes.bool,\n h4: PropTypes.bool,\n h1Style: Text.propTypes.style,\n h2Style: Text.propTypes.style,\n h3Style: Text.propTypes.style,\n h4Style: Text.propTypes.style,\n children: PropTypes.node,\n};\n\nTextElement.defaultProps = {\n h1: false,\n h2: false,\n h3: false,\n h4: false,\n style: {},\n h1Style: {},\n h2Style: {},\n h3Style: {},\n h4Style: {},\n children: '',\n};\n\nconst styles = StyleSheet.create({\n text: {\n ...Platform.select({\n android: {\n ...fonts.android.regular,\n },\n }),\n },\n bold: {\n ...Platform.select({\n android: {\n ...fonts.android.bold,\n },\n }),\n },\n});\n\nexport { TextElement };\nexport default withTheme(TextElement, 'Text');\n","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\n\nvar _requestIdleCallback = function _requestIdleCallback(cb, options) {\n return setTimeout(function () {\n var start = Date.now();\n cb({\n didTimeout: false,\n timeRemaining: function timeRemaining() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n}; // $FlowFixMe (TimeoutID type is not recognized by eslint)\n\n\nvar _cancelIdleCallback = function _cancelIdleCallback(id) {\n clearTimeout(id);\n};\n\nvar isSupported = canUseDOM && typeof window.requestIdleCallback !== 'undefined';\nvar requestIdleCallback = isSupported ? window.requestIdleCallback : _requestIdleCallback;\nvar cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;\nexport default requestIdleCallback;\nexport { cancelIdleCallback };","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport invariant from 'fbjs/lib/invariant';\nimport requestIdleCallback, { cancelIdleCallback } from '../../modules/requestIdleCallback';\nvar InteractionManager = {\n Events: {\n interactionStart: 'interactionStart',\n interactionComplete: 'interactionComplete'\n },\n\n /**\n * Schedule a function to run after all interactions have completed.\n */\n runAfterInteractions: function runAfterInteractions(task) {\n var handle;\n var promise = new Promise(function (resolve) {\n handle = requestIdleCallback(function () {\n if (task) {\n resolve(task());\n }\n });\n });\n return {\n then: promise.then.bind(promise),\n done: promise.then.bind(promise),\n cancel: function cancel() {\n cancelIdleCallback(handle);\n }\n };\n },\n\n /**\n * Notify manager that an interaction has started.\n */\n createInteractionHandle: function createInteractionHandle() {\n return 1;\n },\n\n /**\n * Notify manager that an interaction has completed.\n */\n clearInteractionHandle: function clearInteractionHandle(handle) {\n invariant(!!handle, 'Must provide a handle to clear.');\n },\n addListener: function addListener() {}\n};\nexport default InteractionManager;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\"); // tslint:disable:max-classes-per-file\n\n\nvar Exceptions;\n\n(function (Exceptions) {\n /**\n * Indicates the session description handler has closed.\n * Occurs when getDescription() or setDescription() are called after close() has been called.\n * Occurs when close() is called while getDescription() or setDescription() are in progress.\n */\n var ClosedSessionDescriptionHandlerError =\n /** @class */\n function (_super) {\n tslib_1.__extends(ClosedSessionDescriptionHandlerError, _super);\n\n function ClosedSessionDescriptionHandlerError() {\n return _super.call(this, \"The session description handler has closed.\") || this;\n }\n\n return ClosedSessionDescriptionHandlerError;\n }(core_1.Exception);\n\n Exceptions.ClosedSessionDescriptionHandlerError = ClosedSessionDescriptionHandlerError;\n /**\n * Indicates the session terminated before the action completed.\n */\n\n var TerminatedSessionError =\n /** @class */\n function (_super) {\n tslib_1.__extends(TerminatedSessionError, _super);\n\n function TerminatedSessionError() {\n return _super.call(this, \"The session has terminated.\") || this;\n }\n\n return TerminatedSessionError;\n }(core_1.Exception);\n\n Exceptions.TerminatedSessionError = TerminatedSessionError;\n /**\n * Unsupported session description content type.\n */\n\n var UnsupportedSessionDescriptionContentTypeError =\n /** @class */\n function (_super) {\n tslib_1.__extends(UnsupportedSessionDescriptionContentTypeError, _super);\n\n function UnsupportedSessionDescriptionContentTypeError(message) {\n return _super.call(this, message ? message : \"Unsupported session description content type.\") || this;\n }\n\n return UnsupportedSessionDescriptionContentTypeError;\n }(core_1.Exception);\n\n Exceptions.UnsupportedSessionDescriptionContentTypeError = UnsupportedSessionDescriptionContentTypeError;\n})(Exceptions = exports.Exceptions || (exports.Exceptions = {}));\n/**\n * DEPRECATED: The original implementation of exceptions in this library attempted to\n * deal with the lack of type checking in JavaScript by adding a \"type\" attribute\n * to objects and using that to discriminate. On top of that it layered allcoated\n * \"code\" numbers and constant \"name\" strings. All of that is unnecessary when using\n * TypeScript, inheriting from Error and properly setting up the prototype chain...\n */\n\n\nvar LegacyException =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(LegacyException, _super);\n\n function LegacyException(code, name, message) {\n var _this = _super.call(this, message) || this;\n\n _this.code = code;\n _this.name = name;\n _this.message = message;\n return _this;\n }\n\n return LegacyException;\n}(core_1.Exception);\n\n(function (Exceptions) {\n var ConfigurationError =\n /** @class */\n function (_super) {\n tslib_1.__extends(ConfigurationError, _super);\n\n function ConfigurationError(parameter, value) {\n var _this = _super.call(this, 1, \"CONFIGURATION_ERROR\", !value ? \"Missing parameter: \" + parameter : \"Invalid value \" + JSON.stringify(value) + \" for parameter '\" + parameter + \"'\") || this;\n\n _this.type = Enums_1.TypeStrings.ConfigurationError;\n _this.parameter = parameter;\n _this.value = value;\n return _this;\n }\n\n return ConfigurationError;\n }(LegacyException);\n\n Exceptions.ConfigurationError = ConfigurationError;\n\n var InvalidStateError =\n /** @class */\n function (_super) {\n tslib_1.__extends(InvalidStateError, _super);\n\n function InvalidStateError(status) {\n var _this = _super.call(this, 2, \"INVALID_STATE_ERROR\", \"Invalid status: \" + status) || this;\n\n _this.type = Enums_1.TypeStrings.InvalidStateError;\n _this.status = status;\n return _this;\n }\n\n return InvalidStateError;\n }(LegacyException);\n\n Exceptions.InvalidStateError = InvalidStateError;\n\n var NotSupportedError =\n /** @class */\n function (_super) {\n tslib_1.__extends(NotSupportedError, _super);\n\n function NotSupportedError(message) {\n var _this = _super.call(this, 3, \"NOT_SUPPORTED_ERROR\", message) || this;\n\n _this.type = Enums_1.TypeStrings.NotSupportedError;\n return _this;\n }\n\n return NotSupportedError;\n }(LegacyException);\n\n Exceptions.NotSupportedError = NotSupportedError; // 4 was GetDescriptionError, which was deprecated and now removed\n\n var RenegotiationError =\n /** @class */\n function (_super) {\n tslib_1.__extends(RenegotiationError, _super);\n\n function RenegotiationError(message) {\n var _this = _super.call(this, 5, \"RENEGOTIATION_ERROR\", message) || this;\n\n _this.type = Enums_1.TypeStrings.RenegotiationError;\n return _this;\n }\n\n return RenegotiationError;\n }(LegacyException);\n\n Exceptions.RenegotiationError = RenegotiationError;\n\n var MethodParameterError =\n /** @class */\n function (_super) {\n tslib_1.__extends(MethodParameterError, _super);\n\n function MethodParameterError(method, parameter, value) {\n var _this = _super.call(this, 6, \"METHOD_PARAMETER_ERROR\", !value ? \"Missing parameter: \" + parameter : \"Invalid value \" + JSON.stringify(value) + \" for parameter '\" + parameter + \"'\") || this;\n\n _this.type = Enums_1.TypeStrings.MethodParameterError;\n _this.method = method;\n _this.parameter = parameter;\n _this.value = value;\n return _this;\n }\n\n return MethodParameterError;\n }(LegacyException);\n\n Exceptions.MethodParameterError = MethodParameterError; // 7 was TransportError, which was replaced\n\n var SessionDescriptionHandlerError =\n /** @class */\n function (_super) {\n tslib_1.__extends(SessionDescriptionHandlerError, _super);\n\n function SessionDescriptionHandlerError(method, error, message) {\n var _this = _super.call(this, 8, \"SESSION_DESCRIPTION_HANDLER_ERROR\", message || \"Error with Session Description Handler\") || this;\n\n _this.type = Enums_1.TypeStrings.SessionDescriptionHandlerError;\n _this.method = method;\n _this.error = error;\n return _this;\n }\n\n return SessionDescriptionHandlerError;\n }(LegacyException);\n\n Exceptions.SessionDescriptionHandlerError = SessionDescriptionHandlerError;\n})(Exceptions = exports.Exceptions || (exports.Exceptions = {}));","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;","\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\n\n\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\n\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\n\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar T1 = 500;\nvar T2 = 4000;\nvar T4 = 5000;\nexports.Timers = {\n T1: T1,\n T2: T2,\n T4: T4,\n TIMER_B: 64 * T1,\n TIMER_D: 0 * T1,\n TIMER_F: 64 * T1,\n TIMER_H: 64 * T1,\n TIMER_I: 0 * T4,\n TIMER_J: 0 * T1,\n TIMER_K: 0 * T4,\n TIMER_L: 64 * T1,\n TIMER_M: 64 * T1,\n TIMER_N: 64 * T1,\n PROVISIONAL_RESPONSE_INTERVAL: 60000 // See RFC 3261 Section 13.3.1.1\n\n};","/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n'use strict';\n\nvar GLOBAL = typeof window === 'undefined' ? global : window;\n\nvar setter = function setter(_setter, _clearer, array) {\n return function (callback, delta) {\n var id = _setter(function () {\n _clearer.call(this, id);\n\n callback.apply(this, arguments);\n }.bind(this), delta);\n\n if (!this[array]) {\n this[array] = [id];\n } else {\n this[array].push(id);\n }\n\n return id;\n };\n};\n\nvar clearer = function clearer(_clearer, array) {\n return function (id) {\n if (this[array]) {\n var index = this[array].indexOf(id);\n\n if (index !== -1) {\n this[array].splice(index, 1);\n }\n }\n\n _clearer(id);\n };\n};\n\nvar _timeouts = 'TimerMixin_timeouts';\n\nvar _clearTimeout = clearer(GLOBAL.clearTimeout, _timeouts);\n\nvar _setTimeout = setter(GLOBAL.setTimeout, _clearTimeout, _timeouts);\n\nvar _intervals = 'TimerMixin_intervals';\n\nvar _clearInterval = clearer(GLOBAL.clearInterval, _intervals);\n\nvar _setInterval = setter(GLOBAL.setInterval, function () {\n /* noop */\n}, _intervals);\n\nvar _immediates = 'TimerMixin_immediates';\n\nvar _clearImmediate = clearer(GLOBAL.clearImmediate, _immediates);\n\nvar _setImmediate = setter(GLOBAL.setImmediate, _clearImmediate, _immediates);\n\nvar _rafs = 'TimerMixin_rafs';\n\nvar _cancelAnimationFrame = clearer(GLOBAL.cancelAnimationFrame, _rafs);\n\nvar _requestAnimationFrame = setter(GLOBAL.requestAnimationFrame, _cancelAnimationFrame, _rafs);\n\nvar TimerMixin = {\n componentWillUnmount: function componentWillUnmount() {\n this[_timeouts] && this[_timeouts].forEach(function (id) {\n GLOBAL.clearTimeout(id);\n });\n this[_timeouts] = null;\n this[_intervals] && this[_intervals].forEach(function (id) {\n GLOBAL.clearInterval(id);\n });\n this[_intervals] = null;\n this[_immediates] && this[_immediates].forEach(function (id) {\n GLOBAL.clearImmediate(id);\n });\n this[_immediates] = null;\n this[_rafs] && this[_rafs].forEach(function (id) {\n GLOBAL.cancelAnimationFrame(id);\n });\n this[_rafs] = null;\n },\n setTimeout: _setTimeout,\n clearTimeout: _clearTimeout,\n setInterval: _setInterval,\n clearInterval: _clearInterval,\n setImmediate: _setImmediate,\n clearImmediate: _clearImmediate,\n requestAnimationFrame: _requestAnimationFrame,\n cancelAnimationFrame: _cancelAnimationFrame\n};\nmodule.exports = TimerMixin;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/* global HTMLElement */\nvar getBoundingClientRect = function getBoundingClientRect(node) {\n if (node) {\n var isElement = node.nodeType === 1;\n /* Node.ELEMENT_NODE */\n\n if (isElement && typeof node.getBoundingClientRect === 'function') {\n return node.getBoundingClientRect();\n }\n }\n};\n\nexport default getBoundingClientRect;","module.exports = require(\"regenerator-runtime\");\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n/** `Object#toString` result references. */\n\n\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n/** Built-in value references. */\n\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n\n return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);\n}\n\nmodule.exports = baseGetTag;","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n\n\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Utils_1 = require(\"./Utils\");\n\nvar ClientContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ClientContext, _super);\n\n function ClientContext(ua, method, target, options) {\n var _this = _super.call(this) || this;\n\n _this.data = {};\n ClientContext.initializer(_this, ua, method, target, options);\n return _this;\n }\n\n ClientContext.initializer = function (objToConstruct, ua, method, originalTarget, options) {\n objToConstruct.type = Enums_1.TypeStrings.ClientContext; // Validate arguments\n\n if (originalTarget === undefined) {\n throw new TypeError(\"Not enough arguments\");\n }\n\n objToConstruct.ua = ua;\n objToConstruct.logger = ua.getLogger(\"sip.clientcontext\");\n objToConstruct.method = method;\n var target = ua.normalizeTarget(originalTarget);\n\n if (!target) {\n throw new TypeError(\"Invalid target: \" + originalTarget);\n }\n\n var fromURI = ua.userAgentCore.configuration.aor;\n\n if (options && options.params && options.params.fromUri) {\n fromURI = typeof options.params.fromUri === \"string\" ? core_1.Grammar.URIParse(options.params.fromUri) : options.params.fromUri;\n\n if (!fromURI) {\n throw new TypeError(\"Invalid from URI: \" + options.params.fromUri);\n }\n }\n\n var toURI = target;\n\n if (options && options.params && options.params.toUri) {\n toURI = typeof options.params.toUri === \"string\" ? core_1.Grammar.URIParse(options.params.toUri) : options.params.toUri;\n\n if (!toURI) {\n throw new TypeError(\"Invalid to URI: \" + options.params.toUri);\n }\n }\n /* Options\n * - extraHeaders\n * - params\n * - contentType\n * - body\n */\n\n\n options = Object.create(options || Object.prototype);\n options = options || {};\n var extraHeaders = (options.extraHeaders || []).slice();\n var params = options.params || {};\n var bodyObj;\n\n if (options.body) {\n bodyObj = {\n body: options.body,\n contentType: options.contentType ? options.contentType : \"application/sdp\"\n };\n objToConstruct.body = bodyObj;\n }\n\n var body;\n\n if (bodyObj) {\n body = Utils_1.Utils.fromBodyObj(bodyObj);\n } // Build the request\n\n\n objToConstruct.request = ua.userAgentCore.makeOutgoingRequestMessage(method, target, fromURI, toURI, params, extraHeaders, body);\n /* Set other properties from the request */\n\n if (objToConstruct.request.from) {\n objToConstruct.localIdentity = objToConstruct.request.from;\n }\n\n if (objToConstruct.request.to) {\n objToConstruct.remoteIdentity = objToConstruct.request.to;\n }\n };\n\n ClientContext.prototype.send = function () {\n var _this = this;\n\n this.ua.userAgentCore.request(this.request, {\n onAccept: function onAccept(response) {\n return _this.receiveResponse(response.message);\n },\n onProgress: function onProgress(response) {\n return _this.receiveResponse(response.message);\n },\n onRedirect: function onRedirect(response) {\n return _this.receiveResponse(response.message);\n },\n onReject: function onReject(response) {\n return _this.receiveResponse(response.message);\n },\n onTrying: function onTrying(response) {\n return _this.receiveResponse(response.message);\n }\n });\n return this;\n };\n\n ClientContext.prototype.receiveResponse = function (response) {\n var statusCode = response.statusCode || 0;\n var cause = Utils_1.Utils.getReasonPhrase(statusCode);\n\n switch (true) {\n case /^1[0-9]{2}$/.test(statusCode.toString()):\n this.emit(\"progress\", response, cause);\n break;\n\n case /^2[0-9]{2}$/.test(statusCode.toString()):\n if (this.ua.applicants[this.toString()]) {\n delete this.ua.applicants[this.toString()];\n }\n\n this.emit(\"accepted\", response, cause);\n break;\n\n default:\n if (this.ua.applicants[this.toString()]) {\n delete this.ua.applicants[this.toString()];\n }\n\n this.emit(\"rejected\", response, cause);\n this.emit(\"failed\", response, cause);\n break;\n }\n };\n\n ClientContext.prototype.onRequestTimeout = function () {\n this.emit(\"failed\", undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n };\n\n ClientContext.prototype.onTransportError = function () {\n this.emit(\"failed\", undefined, Constants_1.C.causes.CONNECTION_ERROR);\n };\n\n return ClientContext;\n}(events_1.EventEmitter);\n\nexports.ClientContext = ClientContext;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","var root = require('./_root');\n/** Built-in value references. */\n\n\nvar Symbol = root.Symbol;\nmodule.exports = Symbol;","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n\n\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;","var basePick = require('./_basePick'),\n flatRest = require('./_flatRest');\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n\n\nvar pick = flatRest(function (object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\nmodule.exports = pick;","/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport UIManager from '../UIManager'; // NativeModules shim\n\nvar NativeModules = {\n UIManager: UIManager\n};\nexport default NativeModules;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nimport NativeAnimatedHelper from '../NativeAnimatedHelper'; // Important note: start() and stop() will only be called at most once.\n// Once an animation has been stopped or finished its course, it will\n// not be reused.\n\nvar Animation =\n/*#__PURE__*/\nfunction () {\n function Animation() {}\n\n var _proto = Animation.prototype;\n\n _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {};\n\n _proto.stop = function stop() {\n if (this.__nativeId) {\n NativeAnimatedHelper.API.stopAnimation(this.__nativeId);\n }\n };\n\n _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n // Subclasses that have corresponding animation implementation done in native\n // should override this method\n throw new Error('This animation type cannot be offloaded to native');\n } // Helper function for subclasses to make sure onEnd is only called once.\n ;\n\n _proto.__debouncedOnEnd = function __debouncedOnEnd(result) {\n var onEnd = this.__onEnd;\n this.__onEnd = null;\n onEnd && onEnd(result);\n };\n\n _proto.__startNativeAnimation = function __startNativeAnimation(animatedValue) {\n animatedValue.__makeNative();\n\n this.__nativeId = NativeAnimatedHelper.generateNewAnimationId();\n NativeAnimatedHelper.API.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), this.__getNativeAnimationConfig(), this.__debouncedOnEnd.bind(this));\n };\n\n return Animation;\n}();\n\nexport default Animation;","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n}\n\n; // Adds compatibility for ES modules\n\ndebounce.debounce = debounce;\nmodule.exports = debounce;","module.exports = function (module) {\n if (!module.webpackPolyfill) {\n module.deprecate = function () {};\n\n module.paths = []; // module.parent = undefined by default\n\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isPrefixedValue;\nvar regex = /-webkit-|-moz-|-ms-/;\n\nfunction isPrefixedValue(value) {\n return typeof value === 'string' && regex.test(value);\n}\n\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @param size -\n * @param base -\n * @internal\n */\n\nfunction createRandomToken(size, base) {\n if (base === void 0) {\n base = 32;\n }\n\n var token = \"\";\n\n for (var i = 0; i < size; i++) {\n var r = Math.floor(Math.random() * base);\n token += r.toString(base);\n }\n\n return token;\n}\n\nexports.createRandomToken = createRandomToken;\n/**\n * @internal\n */\n\nfunction getReasonPhrase(code) {\n return REASON_PHRASE[code] || \"\";\n}\n\nexports.getReasonPhrase = getReasonPhrase;\n/**\n * @internal\n */\n\nfunction newTag() {\n return createRandomToken(10);\n}\n\nexports.newTag = newTag;\n/**\n * @param str -\n * @internal\n */\n\nfunction headerize(str) {\n var exceptions = {\n \"Call-Id\": \"Call-ID\",\n \"Cseq\": \"CSeq\",\n \"Min-Se\": \"Min-SE\",\n \"Rack\": \"RAck\",\n \"Rseq\": \"RSeq\",\n \"Www-Authenticate\": \"WWW-Authenticate\"\n };\n var name = str.toLowerCase().replace(/_/g, \"-\").split(\"-\");\n var parts = name.length;\n var hname = \"\";\n\n for (var part = 0; part < parts; part++) {\n if (part !== 0) {\n hname += \"-\";\n }\n\n hname += name[part].charAt(0).toUpperCase() + name[part].substring(1);\n }\n\n if (exceptions[hname]) {\n hname = exceptions[hname];\n }\n\n return hname;\n}\n\nexports.headerize = headerize;\n/**\n * @param str -\n * @internal\n */\n\nfunction str_utf8_length(str) {\n return encodeURIComponent(str).replace(/%[A-F\\d]{2}/g, \"U\").length;\n}\n\nexports.str_utf8_length = str_utf8_length;\n/**\n * SIP Response Reasons\n * DOC: http://www.iana.org/assignments/sip-parameters\n * @internal\n */\n\nvar REASON_PHRASE = {\n 100: \"Trying\",\n 180: \"Ringing\",\n 181: \"Call Is Being Forwarded\",\n 182: \"Queued\",\n 183: \"Session Progress\",\n 199: \"Early Dialog Terminated\",\n 200: \"OK\",\n 202: \"Accepted\",\n 204: \"No Notification\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Moved Temporarily\",\n 305: \"Use Proxy\",\n 380: \"Alternative Service\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 410: \"Gone\",\n 412: \"Conditional Request Failed\",\n 413: \"Request Entity Too Large\",\n 414: \"Request-URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Unsupported URI Scheme\",\n 417: \"Unknown Resource-Priority\",\n 420: \"Bad Extension\",\n 421: \"Extension Required\",\n 422: \"Session Interval Too Small\",\n 423: \"Interval Too Brief\",\n 428: \"Use Identity Header\",\n 429: \"Provide Referrer Identity\",\n 430: \"Flow Failed\",\n 433: \"Anonymity Disallowed\",\n 436: \"Bad Identity-Info\",\n 437: \"Unsupported Certificate\",\n 438: \"Invalid Identity Header\",\n 439: \"First Hop Lacks Outbound Support\",\n 440: \"Max-Breadth Exceeded\",\n 469: \"Bad Info Package\",\n 470: \"Consent Needed\",\n 478: \"Unresolvable Destination\",\n 480: \"Temporarily Unavailable\",\n 481: \"Call/Transaction Does Not Exist\",\n 482: \"Loop Detected\",\n 483: \"Too Many Hops\",\n 484: \"Address Incomplete\",\n 485: \"Ambiguous\",\n 486: \"Busy Here\",\n 487: \"Request Terminated\",\n 488: \"Not Acceptable Here\",\n 489: \"Bad Event\",\n 491: \"Request Pending\",\n 493: \"Undecipherable\",\n 494: \"Security Agreement Required\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Server Time-out\",\n 505: \"Version Not Supported\",\n 513: \"Message Too Large\",\n 580: \"Precondition Failure\",\n 600: \"Busy Everywhere\",\n 603: \"Decline\",\n 604: \"Does Not Exist Anywhere\",\n 606: \"Not Acceptable\"\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/** Transaction state. */\n\nvar TransactionState;\n\n(function (TransactionState) {\n TransactionState[\"Accepted\"] = \"Accepted\";\n TransactionState[\"Calling\"] = \"Calling\";\n TransactionState[\"Completed\"] = \"Completed\";\n TransactionState[\"Confirmed\"] = \"Confirmed\";\n TransactionState[\"Proceeding\"] = \"Proceeding\";\n TransactionState[\"Terminated\"] = \"Terminated\";\n TransactionState[\"Trying\"] = \"Trying\";\n})(TransactionState = exports.TransactionState || (exports.TransactionState = {}));","Object.defineProperty(exports,\"__esModule\",{value:true});var _reactNative=require(\"react-native\");Object.keys(_reactNative).forEach(function(key){if(key===\"default\"||key===\"__esModule\")return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _reactNative[key];}});});","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n\n return object;\n}\n\nmodule.exports = copyObject;","export * from 'react-native';\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Text,\n View,\n TextInput,\n Animated,\n Easing,\n Platform,\n StyleSheet,\n} from 'react-native';\n\nimport { nodeType, renderNode } from '../helpers';\nimport { fonts, withTheme, ViewPropTypes, TextPropTypes } from '../config';\n\nimport Icon from '../icons/Icon';\n\nconst renderText = (content, defaultProps, style) =>\n renderNode(Text, content, {\n ...defaultProps,\n style: StyleSheet.flatten([style, defaultProps && defaultProps.style]),\n });\n\nclass Input extends React.Component {\n shakeAnimationValue = new Animated.Value(0);\n\n focus() {\n this.input.focus();\n }\n\n blur() {\n this.input.blur();\n }\n\n clear() {\n this.input.clear();\n }\n\n isFocused() {\n return this.input.isFocused();\n }\n\n setNativeProps(nativeProps) {\n this.input.setNativeProps(nativeProps);\n }\n\n shake = () => {\n const { shakeAnimationValue } = this;\n\n shakeAnimationValue.setValue(0);\n // Animation duration based on Material Design\n // https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n Animated.timing(shakeAnimationValue, {\n duration: 375,\n toValue: 3,\n ease: Easing.bounce,\n }).start();\n };\n\n render() {\n const {\n containerStyle,\n inputContainerStyle,\n leftIcon,\n leftIconContainerStyle,\n rightIcon,\n rightIconContainerStyle,\n inputComponent: InputComponent = TextInput,\n inputStyle,\n errorProps,\n errorStyle,\n errorMessage,\n label,\n labelStyle,\n labelProps,\n theme,\n ...attributes\n } = this.props;\n\n const translateX = this.shakeAnimationValue.interpolate({\n inputRange: [0, 0.5, 1, 1.5, 2, 2.5, 3],\n outputRange: [0, -15, 0, 15, 0, -15, 0],\n });\n\n return (\n \n {renderText(\n label,\n { style: labelStyle, ...labelProps },\n styles.label(theme)\n )}\n\n \n {leftIcon && (\n \n {renderNode(Icon, leftIcon)}\n \n )}\n\n {\n this.input = ref;\n }}\n style={StyleSheet.flatten([styles.input, inputStyle])}\n />\n\n {rightIcon && (\n \n {renderNode(Icon, rightIcon)}\n \n )}\n \n\n {!!errorMessage && (\n \n {errorMessage}\n \n )}\n \n );\n }\n}\n\nInput.propTypes = {\n containerStyle: ViewPropTypes.style,\n inputContainerStyle: ViewPropTypes.style,\n leftIcon: nodeType,\n leftIconContainerStyle: ViewPropTypes.style,\n rightIcon: nodeType,\n rightIconContainerStyle: ViewPropTypes.style,\n inputStyle: TextPropTypes.style,\n inputComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),\n // eslint-disable-next-line react/forbid-prop-types\n shake: PropTypes.any,\n errorProps: PropTypes.object,\n errorStyle: TextPropTypes.style,\n errorMessage: PropTypes.string,\n label: PropTypes.node,\n labelStyle: TextPropTypes.style,\n labelProps: PropTypes.object,\n theme: PropTypes.object,\n};\n\nconst styles = {\n container: {\n width: '100%',\n paddingHorizontal: 10,\n },\n inputContainer: theme => ({\n flexDirection: 'row',\n borderBottomWidth: 1,\n alignItems: 'center',\n borderColor: theme.colors.grey3,\n }),\n iconContainer: {\n height: 40,\n justifyContent: 'center',\n alignItems: 'center',\n marginLeft: 15,\n },\n input: {\n alignSelf: 'center',\n color: 'black',\n fontSize: 18,\n flex: 1,\n minHeight: 40,\n },\n error: theme => ({\n margin: 5,\n fontSize: 12,\n color: theme.colors.error,\n }),\n label: theme => ({\n fontSize: 16,\n color: theme.colors.grey3,\n ...Platform.select({\n android: {\n ...fonts.android.bold,\n },\n default: {\n fontWeight: 'bold',\n },\n }),\n }),\n};\n\nexport { Input };\nexport default withTheme(Input, 'Input');\n","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g;\nvar msPattern = /^ms-/;\nvar cache = {};\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase();\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name];\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower);\n return cache[name] = msPattern.test(hName) ? '-' + hName : hName;\n}\n\nexport default hyphenateStyleName;","/*\n * Copyright (c) 2015-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 root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\nfunction normalizeColor(color) {\n var match;\n\n if (typeof color === 'number') {\n if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) {\n return color;\n }\n\n return null;\n } // Ordered based on occurrences on Facebook codebase\n\n\n if (match = matchers.hex6.exec(color)) {\n return parseInt(match[1] + 'ff', 16) >>> 0;\n }\n\n if (names.hasOwnProperty(color)) {\n return names[color];\n }\n\n if (match = matchers.rgb.exec(color)) {\n return (parse255(match[1]) << 24 | // r\n parse255(match[2]) << 16 | // g\n parse255(match[3]) << 8 | // b\n 0x000000ff // a\n ) >>> 0;\n }\n\n if (match = matchers.rgba.exec(color)) {\n return (parse255(match[1]) << 24 | // r\n parse255(match[2]) << 16 | // g\n parse255(match[3]) << 8 | // b\n parse1(match[4]) // a\n ) >>> 0;\n }\n\n if (match = matchers.hex3.exec(color)) {\n return parseInt(match[1] + match[1] + // r\n match[2] + match[2] + // g\n match[3] + match[3] + // b\n 'ff', // a\n 16) >>> 0;\n } // https://drafts.csswg.org/css-color-4/#hex-notation\n\n\n if (match = matchers.hex8.exec(color)) {\n return parseInt(match[1], 16) >>> 0;\n }\n\n if (match = matchers.hex4.exec(color)) {\n return parseInt(match[1] + match[1] + // r\n match[2] + match[2] + // g\n match[3] + match[3] + // b\n match[4] + match[4], // a\n 16) >>> 0;\n }\n\n if (match = matchers.hsl.exec(color)) {\n return (hslToRgb(parse360(match[1]), // h\n parsePercentage(match[2]), // s\n parsePercentage(match[3]) // l\n ) | 0x000000ff // a\n ) >>> 0;\n }\n\n if (match = matchers.hsla.exec(color)) {\n return (hslToRgb(parse360(match[1]), // h\n parsePercentage(match[2]), // s\n parsePercentage(match[3]) // l\n ) | parse1(match[4]) // a\n ) >>> 0;\n }\n\n return null;\n}\n\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n\n if (t > 1) {\n t -= 1;\n }\n\n if (t < 1 / 6) {\n return p + (q - p) * 6 * t;\n }\n\n if (t < 1 / 2) {\n return q;\n }\n\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n\n return p;\n}\n\nfunction hslToRgb(h, s, l) {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n var r = hue2rgb(p, q, h + 1 / 3);\n var g = hue2rgb(p, q, h);\n var b = hue2rgb(p, q, h - 1 / 3);\n return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;\n} // var INTEGER = '[-+]?\\\\d+';\n\n\nvar NUMBER = '[-+]?\\\\d*\\\\.?\\\\d+';\nvar PERCENTAGE = NUMBER + '%';\n\nfunction toArray(arrayLike) {\n return Array.prototype.slice.call(arrayLike, 0);\n}\n\nfunction call() {\n return '\\\\(\\\\s*(' + toArray(arguments).join(')\\\\s*,\\\\s*(') + ')\\\\s*\\\\)';\n}\n\nvar matchers = {\n rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)),\n rgba: new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)),\n hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)),\n hsla: new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)),\n hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#([0-9a-fA-F]{6})$/,\n hex8: /^#([0-9a-fA-F]{8})$/\n};\n\nfunction parse255(str) {\n var int = parseInt(str, 10);\n\n if (int < 0) {\n return 0;\n }\n\n if (int > 255) {\n return 255;\n }\n\n return int;\n}\n\nfunction parse360(str) {\n var int = parseFloat(str);\n return (int % 360 + 360) % 360 / 360;\n}\n\nfunction parse1(str) {\n var num = parseFloat(str);\n\n if (num < 0) {\n return 0;\n }\n\n if (num > 1) {\n return 255;\n }\n\n return Math.round(num * 255);\n}\n\nfunction parsePercentage(str) {\n // parseFloat conveniently ignores the final %\n var int = parseFloat(str, 10);\n\n if (int < 0) {\n return 0;\n }\n\n if (int > 100) {\n return 1;\n }\n\n return int / 100;\n}\n\nvar names = {\n transparent: 0x00000000,\n // http://www.w3.org/TR/css3-color/#svg-color\n aliceblue: 0xf0f8ffff,\n antiquewhite: 0xfaebd7ff,\n aqua: 0x00ffffff,\n aquamarine: 0x7fffd4ff,\n azure: 0xf0ffffff,\n beige: 0xf5f5dcff,\n bisque: 0xffe4c4ff,\n black: 0x000000ff,\n blanchedalmond: 0xffebcdff,\n blue: 0x0000ffff,\n blueviolet: 0x8a2be2ff,\n brown: 0xa52a2aff,\n burlywood: 0xdeb887ff,\n burntsienna: 0xea7e5dff,\n cadetblue: 0x5f9ea0ff,\n chartreuse: 0x7fff00ff,\n chocolate: 0xd2691eff,\n coral: 0xff7f50ff,\n cornflowerblue: 0x6495edff,\n cornsilk: 0xfff8dcff,\n crimson: 0xdc143cff,\n cyan: 0x00ffffff,\n darkblue: 0x00008bff,\n darkcyan: 0x008b8bff,\n darkgoldenrod: 0xb8860bff,\n darkgray: 0xa9a9a9ff,\n darkgreen: 0x006400ff,\n darkgrey: 0xa9a9a9ff,\n darkkhaki: 0xbdb76bff,\n darkmagenta: 0x8b008bff,\n darkolivegreen: 0x556b2fff,\n darkorange: 0xff8c00ff,\n darkorchid: 0x9932ccff,\n darkred: 0x8b0000ff,\n darksalmon: 0xe9967aff,\n darkseagreen: 0x8fbc8fff,\n darkslateblue: 0x483d8bff,\n darkslategray: 0x2f4f4fff,\n darkslategrey: 0x2f4f4fff,\n darkturquoise: 0x00ced1ff,\n darkviolet: 0x9400d3ff,\n deeppink: 0xff1493ff,\n deepskyblue: 0x00bfffff,\n dimgray: 0x696969ff,\n dimgrey: 0x696969ff,\n dodgerblue: 0x1e90ffff,\n firebrick: 0xb22222ff,\n floralwhite: 0xfffaf0ff,\n forestgreen: 0x228b22ff,\n fuchsia: 0xff00ffff,\n gainsboro: 0xdcdcdcff,\n ghostwhite: 0xf8f8ffff,\n gold: 0xffd700ff,\n goldenrod: 0xdaa520ff,\n gray: 0x808080ff,\n green: 0x008000ff,\n greenyellow: 0xadff2fff,\n grey: 0x808080ff,\n honeydew: 0xf0fff0ff,\n hotpink: 0xff69b4ff,\n indianred: 0xcd5c5cff,\n indigo: 0x4b0082ff,\n ivory: 0xfffff0ff,\n khaki: 0xf0e68cff,\n lavender: 0xe6e6faff,\n lavenderblush: 0xfff0f5ff,\n lawngreen: 0x7cfc00ff,\n lemonchiffon: 0xfffacdff,\n lightblue: 0xadd8e6ff,\n lightcoral: 0xf08080ff,\n lightcyan: 0xe0ffffff,\n lightgoldenrodyellow: 0xfafad2ff,\n lightgray: 0xd3d3d3ff,\n lightgreen: 0x90ee90ff,\n lightgrey: 0xd3d3d3ff,\n lightpink: 0xffb6c1ff,\n lightsalmon: 0xffa07aff,\n lightseagreen: 0x20b2aaff,\n lightskyblue: 0x87cefaff,\n lightslategray: 0x778899ff,\n lightslategrey: 0x778899ff,\n lightsteelblue: 0xb0c4deff,\n lightyellow: 0xffffe0ff,\n lime: 0x00ff00ff,\n limegreen: 0x32cd32ff,\n linen: 0xfaf0e6ff,\n magenta: 0xff00ffff,\n maroon: 0x800000ff,\n mediumaquamarine: 0x66cdaaff,\n mediumblue: 0x0000cdff,\n mediumorchid: 0xba55d3ff,\n mediumpurple: 0x9370dbff,\n mediumseagreen: 0x3cb371ff,\n mediumslateblue: 0x7b68eeff,\n mediumspringgreen: 0x00fa9aff,\n mediumturquoise: 0x48d1ccff,\n mediumvioletred: 0xc71585ff,\n midnightblue: 0x191970ff,\n mintcream: 0xf5fffaff,\n mistyrose: 0xffe4e1ff,\n moccasin: 0xffe4b5ff,\n navajowhite: 0xffdeadff,\n navy: 0x000080ff,\n oldlace: 0xfdf5e6ff,\n olive: 0x808000ff,\n olivedrab: 0x6b8e23ff,\n orange: 0xffa500ff,\n orangered: 0xff4500ff,\n orchid: 0xda70d6ff,\n palegoldenrod: 0xeee8aaff,\n palegreen: 0x98fb98ff,\n paleturquoise: 0xafeeeeff,\n palevioletred: 0xdb7093ff,\n papayawhip: 0xffefd5ff,\n peachpuff: 0xffdab9ff,\n peru: 0xcd853fff,\n pink: 0xffc0cbff,\n plum: 0xdda0ddff,\n powderblue: 0xb0e0e6ff,\n purple: 0x800080ff,\n rebeccapurple: 0x663399ff,\n red: 0xff0000ff,\n rosybrown: 0xbc8f8fff,\n royalblue: 0x4169e1ff,\n saddlebrown: 0x8b4513ff,\n salmon: 0xfa8072ff,\n sandybrown: 0xf4a460ff,\n seagreen: 0x2e8b57ff,\n seashell: 0xfff5eeff,\n sienna: 0xa0522dff,\n silver: 0xc0c0c0ff,\n skyblue: 0x87ceebff,\n slateblue: 0x6a5acdff,\n slategray: 0x708090ff,\n slategrey: 0x708090ff,\n snow: 0xfffafaff,\n springgreen: 0x00ff7fff,\n steelblue: 0x4682b4ff,\n tan: 0xd2b48cff,\n teal: 0x008080ff,\n thistle: 0xd8bfd8ff,\n tomato: 0xff6347ff,\n turquoise: 0x40e0d0ff,\n violet: 0xee82eeff,\n wheat: 0xf5deb3ff,\n white: 0xffffffff,\n whitesmoke: 0xf5f5f5ff,\n yellow: 0xffff00ff,\n yellowgreen: 0x9acd32ff\n};\n\nfunction rgba(colorInt) {\n var r = Math.round((colorInt & 0xff000000) >>> 24);\n var g = Math.round((colorInt & 0x00ff0000) >>> 16);\n var b = Math.round((colorInt & 0x0000ff00) >>> 8);\n var a = ((colorInt & 0x000000ff) >>> 0) / 255;\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\n\n;\nnormalizeColor.rgba = rgba;\nmodule.exports = normalizeColor;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1;\n/**\n * 2D Value for driving 2D animations, such as pan gestures. Almost identical\n * API to normal `Animated.Value`, but multiplexed.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html\n */\n\nvar AnimatedValueXY =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedValueXY, _AnimatedWithChildren);\n\n function AnimatedValueXY(valueIn) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n var value = valueIn || {\n x: 0,\n y: 0\n }; // fixme: shouldn't need `: any`\n\n if (typeof value.x === 'number' && typeof value.y === 'number') {\n _this.x = new AnimatedValue(value.x);\n _this.y = new AnimatedValue(value.y);\n } else {\n invariant(value.x instanceof AnimatedValue && value.y instanceof AnimatedValue, 'AnimatedValueXY must be initialized with an object of numbers or ' + 'AnimatedValues.');\n _this.x = value.x;\n _this.y = value.y;\n }\n\n _this._listeners = {};\n return _this;\n }\n /**\n * Directly set the value. This will stop any animations running on the value\n * and update all the bound properties.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setvalue\n */\n\n\n var _proto = AnimatedValueXY.prototype;\n\n _proto.setValue = function setValue(value) {\n this.x.setValue(value.x);\n this.y.setValue(value.y);\n }\n /**\n * Sets an offset that is applied on top of whatever value is set, whether\n * via `setValue`, an animation, or `Animated.event`. Useful for compensating\n * things like the start of a pan gesture.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setoffset\n */\n ;\n\n _proto.setOffset = function setOffset(offset) {\n this.x.setOffset(offset.x);\n this.y.setOffset(offset.y);\n }\n /**\n * Merges the offset value into the base value and resets the offset to zero.\n * The final output of the value is unchanged.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#flattenoffset\n */\n ;\n\n _proto.flattenOffset = function flattenOffset() {\n this.x.flattenOffset();\n this.y.flattenOffset();\n }\n /**\n * Sets the offset value to the base value, and resets the base value to\n * zero. The final output of the value is unchanged.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#extractoffset\n */\n ;\n\n _proto.extractOffset = function extractOffset() {\n this.x.extractOffset();\n this.y.extractOffset();\n };\n\n _proto.__getValue = function __getValue() {\n return {\n x: this.x.__getValue(),\n y: this.y.__getValue()\n };\n }\n /**\n * Stops any animation and resets the value to its original.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#resetanimation\n */\n ;\n\n _proto.resetAnimation = function resetAnimation(callback) {\n this.x.resetAnimation();\n this.y.resetAnimation();\n callback && callback(this.__getValue());\n }\n /**\n * Stops any running animation or tracking. `callback` is invoked with the\n * final value after stopping the animation, which is useful for updating\n * state to match the animation position with layout.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#stopanimation\n */\n ;\n\n _proto.stopAnimation = function stopAnimation(callback) {\n this.x.stopAnimation();\n this.y.stopAnimation();\n callback && callback(this.__getValue());\n }\n /**\n * Adds an asynchronous listener to the value so you can observe updates from\n * animations. This is useful because there is no way to synchronously read\n * the value because it might be driven natively.\n *\n * Returns a string that serves as an identifier for the listener.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#addlistener\n */\n ;\n\n _proto.addListener = function addListener(callback) {\n var _this2 = this;\n\n var id = String(_uniqueId++);\n\n var jointCallback = function jointCallback(_ref) {\n var number = _ref.value;\n callback(_this2.__getValue());\n };\n\n this._listeners[id] = {\n x: this.x.addListener(jointCallback),\n y: this.y.addListener(jointCallback)\n };\n return id;\n }\n /**\n * Unregister a listener. The `id` param shall match the identifier\n * previously returned by `addListener()`.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removelistener\n */\n ;\n\n _proto.removeListener = function removeListener(id) {\n this.x.removeListener(this._listeners[id].x);\n this.y.removeListener(this._listeners[id].y);\n delete this._listeners[id];\n }\n /**\n * Remove all registered listeners.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removealllisteners\n */\n ;\n\n _proto.removeAllListeners = function removeAllListeners() {\n this.x.removeAllListeners();\n this.y.removeAllListeners();\n this._listeners = {};\n }\n /**\n * Converts `{x, y}` into `{left, top}` for use in style.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#getlayout\n */\n ;\n\n _proto.getLayout = function getLayout() {\n return {\n left: this.x,\n top: this.y\n };\n }\n /**\n * Converts `{x, y}` into a useable translation transform.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#gettranslatetransform\n */\n ;\n\n _proto.getTranslateTransform = function getTranslateTransform() {\n return [{\n translateX: this.x\n }, {\n translateY: this.y\n }];\n };\n\n return AnimatedValueXY;\n}(AnimatedWithChildren);\n\nexport default AnimatedValueXY;","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-dom-unstable-native-dependencies.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom-unstable-native-dependencies.development.js');\n}","/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nvar unitlessNumbers = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexOrder: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n gridRow: true,\n gridColumn: true,\n lineClamp: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true,\n // transform types\n scale: true,\n scaleX: true,\n scaleY: true,\n scaleZ: true,\n // RN properties\n shadowOpacity: true\n};\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\n\nvar prefixes = ['ms', 'Moz', 'O', 'Webkit'];\n\nvar prefixKey = function prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n};\n\nObject.keys(unitlessNumbers).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];\n });\n});\nexport default unitlessNumbers;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n'use strict';\n\nimport _bezier from './bezier';\n\nvar _ease;\n/**\n * The `Easing` module implements common easing functions. This module is used\n * by [Animate.timing()](docs/animate.html#timing) to convey physically\n * believable motion in animations.\n *\n * You can find a visualization of some common easing functions at\n * http://easings.net/\n *\n * ### Predefined animations\n *\n * The `Easing` module provides several predefined animations through the\n * following methods:\n *\n * - [`back`](docs/easing.html#back) provides a simple animation where the\n * object goes slightly back before moving forward\n * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation\n * - [`ease`](docs/easing.html#ease) provides a simple inertial animation\n * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction\n *\n * ### Standard functions\n *\n * Three standard easing functions are provided:\n *\n * - [`linear`](docs/easing.html#linear)\n * - [`quad`](docs/easing.html#quad)\n * - [`cubic`](docs/easing.html#cubic)\n *\n * The [`poly`](docs/easing.html#poly) function can be used to implement\n * quartic, quintic, and other higher power functions.\n *\n * ### Additional functions\n *\n * Additional mathematical functions are provided by the following methods:\n *\n * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve\n * - [`circle`](docs/easing.html#circle) provides a circular function\n * - [`sin`](docs/easing.html#sin) provides a sinusoidal function\n * - [`exp`](docs/easing.html#exp) provides an exponential function\n *\n * The following helpers are used to modify other easing functions.\n *\n * - [`in`](docs/easing.html#in) runs an easing function forwards\n * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical\n * - [`out`](docs/easing.html#out) runs an easing function backwards\n */\n\n\nvar Easing =\n/*#__PURE__*/\nfunction () {\n function Easing() {}\n /**\n * A stepping function, returns 1 for any positive value of `n`.\n */\n\n\n Easing.step0 = function step0(n) {\n return n > 0 ? 1 : 0;\n }\n /**\n * A stepping function, returns 1 if `n` is greater than or equal to 1.\n */\n ;\n\n Easing.step1 = function step1(n) {\n return n >= 1 ? 1 : 0;\n }\n /**\n * A linear function, `f(t) = t`. Position correlates to elapsed time one to\n * one.\n *\n * http://cubic-bezier.com/#0,0,1,1\n */\n ;\n\n Easing.linear = function linear(t) {\n return t;\n }\n /**\n * A simple inertial interaction, similar to an object slowly accelerating to\n * speed.\n *\n * http://cubic-bezier.com/#.42,0,1,1\n */\n ;\n\n Easing.ease = function ease(t) {\n if (!_ease) {\n _ease = Easing.bezier(0.42, 0, 1, 1);\n }\n\n return _ease(t);\n }\n /**\n * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed\n * time.\n *\n * http://easings.net/#easeInQuad\n */\n ;\n\n Easing.quad = function quad(t) {\n return t * t;\n }\n /**\n * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed\n * time.\n *\n * http://easings.net/#easeInCubic\n */\n ;\n\n Easing.cubic = function cubic(t) {\n return t * t * t;\n }\n /**\n * A power function. Position is equal to the Nth power of elapsed time.\n *\n * n = 4: http://easings.net/#easeInQuart\n * n = 5: http://easings.net/#easeInQuint\n */\n ;\n\n Easing.poly = function poly(n) {\n return function (t) {\n return Math.pow(t, n);\n };\n }\n /**\n * A sinusoidal function.\n *\n * http://easings.net/#easeInSine\n */\n ;\n\n Easing.sin = function sin(t) {\n return 1 - Math.cos(t * Math.PI / 2);\n }\n /**\n * A circular function.\n *\n * http://easings.net/#easeInCirc\n */\n ;\n\n Easing.circle = function circle(t) {\n return 1 - Math.sqrt(1 - t * t);\n }\n /**\n * An exponential function.\n *\n * http://easings.net/#easeInExpo\n */\n ;\n\n Easing.exp = function exp(t) {\n return Math.pow(2, 10 * (t - 1));\n }\n /**\n * A simple elastic interaction, similar to a spring oscillating back and\n * forth.\n *\n * Default bounciness is 1, which overshoots a little bit once. 0 bounciness\n * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N\n * times.\n *\n * http://easings.net/#easeInElastic\n */\n ;\n\n Easing.elastic = function elastic(bounciness) {\n if (bounciness === void 0) {\n bounciness = 1;\n }\n\n var p = bounciness * Math.PI;\n return function (t) {\n return 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);\n };\n }\n /**\n * Use with `Animated.parallel()` to create a simple effect where the object\n * animates back slightly as the animation starts.\n *\n * Wolfram Plot:\n *\n * - http://tiny.cc/back_default (s = 1.70158, default)\n */\n ;\n\n Easing.back = function back(s) {\n if (s === undefined) {\n s = 1.70158;\n }\n\n return function (t) {\n return t * t * ((s + 1) * t - s);\n };\n }\n /**\n * Provides a simple bouncing effect.\n *\n * http://easings.net/#easeInBounce\n */\n ;\n\n Easing.bounce = function bounce(t) {\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n }\n\n if (t < 2 / 2.75) {\n t -= 1.5 / 2.75;\n return 7.5625 * t * t + 0.75;\n }\n\n if (t < 2.5 / 2.75) {\n t -= 2.25 / 2.75;\n return 7.5625 * t * t + 0.9375;\n }\n\n t -= 2.625 / 2.75;\n return 7.5625 * t * t + 0.984375;\n }\n /**\n * Provides a cubic bezier curve, equivalent to CSS Transitions'\n * `transition-timing-function`.\n *\n * A useful tool to visualize cubic bezier curves can be found at\n * http://cubic-bezier.com/\n */\n ;\n\n Easing.bezier = function bezier(x1, y1, x2, y2) {\n return _bezier(x1, y1, x2, y2);\n }\n /**\n * Runs an easing function forwards.\n */\n ;\n\n Easing.in = function _in(easing) {\n return easing;\n }\n /**\n * Runs an easing function backwards.\n */\n ;\n\n Easing.out = function out(easing) {\n return function (t) {\n return 1 - easing(1 - t);\n };\n }\n /**\n * Makes any easing function symmetrical. The easing function will run\n * forwards for half of the duration, then backwards for the rest of the\n * duration.\n */\n ;\n\n Easing.inOut = function inOut(easing) {\n return function (t) {\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n\n return 1 - easing((1 - t) * 2) / 2;\n };\n };\n\n return Easing;\n}();\n\nexport default Easing;","'use strict';\n\nmodule.exports = function (arr, predicate, ctx) {\n if (typeof Array.prototype.findIndex === 'function') {\n return arr.findIndex(predicate, ctx);\n }\n\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n\n var list = Object(arr);\n var len = list.length;\n\n if (len === 0) {\n return -1;\n }\n\n for (var i = 0; i < len; i++) {\n if (predicate.call(ctx, list[i], i, list)) {\n return i;\n }\n }\n\n return -1;\n};","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n'use strict';\n/* eslint-disable no-unused-vars */\n\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined');\n }\n\n return Object(val);\n}\n\nfunction shouldUseNative() {\n try {\n if (!Object.assign) {\n return false;\n } // Detect buggy property enumeration order in older V8 versions.\n // https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\n\n var test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\n test1[5] = 'de';\n\n if (Object.getOwnPropertyNames(test1)[0] === '5') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test2 = {};\n\n for (var i = 0; i < 10; i++) {\n test2['_' + String.fromCharCode(i)] = i;\n }\n\n var order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n return test2[n];\n });\n\n if (order2.join('') !== '0123456789') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test3 = {};\n 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n test3[letter] = letter;\n });\n\n if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {\n return false;\n }\n\n return true;\n } catch (err) {\n // We don't expect any of the above to throw, but better to be safe.\n return false;\n }\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n var from;\n var to = toObject(target);\n var symbols;\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s]);\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from);\n\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]];\n }\n }\n }\n }\n\n return to;\n};","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\ntslib_1.__exportStar(require(\"./session\"), exports);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\ntslib_1.__exportStar(require(\"./exception\"), exports);\n\ntslib_1.__exportStar(require(\"./transaction-state-error\"), exports);\n\ntslib_1.__exportStar(require(\"./transport-error\"), exports);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar messages_1 = require(\"../messages\");\n/**\n * FIXME: TODO: Should be configurable/variable.\n */\n\n\nexports.AllowedMethods = [messages_1.C.ACK, messages_1.C.BYE, messages_1.C.CANCEL, messages_1.C.INFO, messages_1.C.INVITE, messages_1.C.MESSAGE, messages_1.C.NOTIFY, messages_1.C.OPTIONS, messages_1.C.PRACK, messages_1.C.REFER, messages_1.C.SUBSCRIBE];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Utils_1 = require(\"./Utils\");\n\nvar ServerContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ServerContext, _super);\n\n function ServerContext(ua, incomingRequest) {\n var _this = _super.call(this) || this;\n\n _this.incomingRequest = incomingRequest;\n _this.data = {};\n ServerContext.initializer(_this, ua, incomingRequest);\n return _this;\n } // hack to get around our multiple inheritance issues\n\n\n ServerContext.initializer = function (objectToConstruct, ua, incomingRequest) {\n var request = incomingRequest.message;\n objectToConstruct.type = Enums_1.TypeStrings.ServerContext;\n objectToConstruct.ua = ua;\n objectToConstruct.logger = ua.getLogger(\"sip.servercontext\");\n objectToConstruct.request = request;\n\n if (request.body) {\n objectToConstruct.body = request.body;\n }\n\n if (request.hasHeader(\"Content-Type\")) {\n objectToConstruct.contentType = request.getHeader(\"Content-Type\");\n }\n\n objectToConstruct.method = request.method;\n objectToConstruct.localIdentity = request.to;\n objectToConstruct.remoteIdentity = request.from;\n var hasAssertedIdentity = request.hasHeader(\"P-Asserted-Identity\");\n\n if (hasAssertedIdentity) {\n var assertedIdentity = request.getHeader(\"P-Asserted-Identity\");\n\n if (assertedIdentity) {\n objectToConstruct.assertedIdentity = core_1.Grammar.nameAddrHeaderParse(assertedIdentity);\n }\n }\n };\n\n ServerContext.prototype.progress = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n options.statusCode = options.statusCode || 180;\n options.minCode = 100;\n options.maxCode = 199;\n options.events = [\"progress\"];\n return this.reply(options);\n };\n\n ServerContext.prototype.accept = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n options.statusCode = options.statusCode || 200;\n options.minCode = 200;\n options.maxCode = 299;\n options.events = [\"accepted\"];\n return this.reply(options);\n };\n\n ServerContext.prototype.reject = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n options.statusCode = options.statusCode || 480;\n options.minCode = 300;\n options.maxCode = 699;\n options.events = [\"rejected\", \"failed\"];\n return this.reply(options);\n };\n\n ServerContext.prototype.reply = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var statusCode = options.statusCode || 100;\n var minCode = options.minCode || 100;\n var maxCode = options.maxCode || 699;\n var reasonPhrase = Utils_1.Utils.getReasonPhrase(statusCode, options.reasonPhrase);\n var extraHeaders = options.extraHeaders || [];\n var body = options.body ? core_1.fromBodyLegacy(options.body) : undefined;\n var events = options.events || [];\n\n if (statusCode < minCode || statusCode > maxCode) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n var responseOptions = {\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n };\n var response;\n var statusCodeString = statusCode.toString();\n\n switch (true) {\n case /^100$/.test(statusCodeString):\n response = this.incomingRequest.trying(responseOptions).message;\n break;\n\n case /^1[0-9]{2}$/.test(statusCodeString):\n response = this.incomingRequest.progress(responseOptions).message;\n break;\n\n case /^2[0-9]{2}$/.test(statusCodeString):\n response = this.incomingRequest.accept(responseOptions).message;\n break;\n\n case /^3[0-9]{2}$/.test(statusCodeString):\n response = this.incomingRequest.redirect([], responseOptions).message;\n break;\n\n case /^[4-6][0-9]{2}$/.test(statusCodeString):\n response = this.incomingRequest.reject(responseOptions).message;\n break;\n\n default:\n throw new Error(\"Invalid status code \" + statusCode);\n }\n\n events.forEach(function (event) {\n _this.emit(event, response, reasonPhrase);\n });\n return this;\n };\n\n ServerContext.prototype.onRequestTimeout = function () {\n this.emit(\"failed\", undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n };\n\n ServerContext.prototype.onTransportError = function () {\n this.emit(\"failed\", undefined, Constants_1.C.causes.CONNECTION_ERROR);\n };\n\n return ServerContext;\n}(events_1.EventEmitter);\n\nexports.ServerContext = ServerContext;","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\n\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `ListCache`.\n\n\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\nmodule.exports = ListCache;","var eq = require('./eq');\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\n\nfunction assocIndexOf(array, key) {\n var length = array.length;\n\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n\n return -1;\n}\n\nmodule.exports = assocIndexOf;","var getNative = require('./_getNative');\n/* Built-in method references that are verified to be native. */\n\n\nvar nativeCreate = getNative(Object, 'create');\nmodule.exports = nativeCreate;","var isKeyable = require('./_isKeyable');\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n\n\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;\n}\n\nmodule.exports = getMapData;","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n/** `Object#toString` result references. */\n\n\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\nvar dataViewTag = '[object DataView]';\n/** Used to detect maps, sets, and weakmaps. */\n\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n\nvar getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n\nif (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {\n getTag = function getTag(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString:\n return dataViewTag;\n\n case mapCtorString:\n return mapTag;\n\n case promiseCtorString:\n return promiseTag;\n\n case setCtorString:\n return setTag;\n\n case weakMapCtorString:\n return weakMapTag;\n }\n }\n\n return result;\n };\n}\n\nmodule.exports = getTag;","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar symbolTag = '[object Symbol]';\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n\nfunction isSymbol(value) {\n return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;\n}\n\nmodule.exports = isSymbol;","var isSymbol = require('./isSymbol');\n/** Used as references for various `Number` constants. */\n\n\nvar INFINITY = 1 / 0;\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\n\nmodule.exports = toKey;","var baseIsEqual = require('./_baseIsEqual');\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n\n\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;","import ZocialIcon from 'react-native-vector-icons/Zocial';\nimport OcticonIcon from 'react-native-vector-icons/Octicons';\nimport MaterialIcon from 'react-native-vector-icons/MaterialIcons';\nimport MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';\nimport Ionicon from 'react-native-vector-icons/Ionicons';\nimport FoundationIcon from 'react-native-vector-icons/Foundation';\nimport EvilIcon from 'react-native-vector-icons/EvilIcons';\nimport EntypoIcon from 'react-native-vector-icons/Entypo';\nimport FAIcon from 'react-native-vector-icons/FontAwesome';\nimport SimpleLineIcon from 'react-native-vector-icons/SimpleLineIcons';\nimport FeatherIcon from 'react-native-vector-icons/Feather';\nimport AntIcon from 'react-native-vector-icons/AntDesign';\n\nconst customIcons = {};\n\nexport const registerCustomIconType = (id, customIcon) => {\n customIcons[id] = customIcon;\n};\n\nexport default type => {\n switch (type) {\n case 'zocial':\n return ZocialIcon;\n case 'octicon':\n return OcticonIcon;\n case 'material':\n return MaterialIcon;\n case 'material-community':\n return MaterialCommunityIcon;\n case 'ionicon':\n return Ionicon;\n case 'foundation':\n return FoundationIcon;\n case 'evilicon':\n return EvilIcon;\n case 'entypo':\n return EntypoIcon;\n case 'font-awesome':\n return FAIcon;\n case 'simple-line-icon':\n return SimpleLineIcon;\n case 'feather':\n return FeatherIcon;\n case 'antdesign':\n return AntIcon;\n default:\n if (Object.prototype.hasOwnProperty.call(customIcons, type)) {\n return customIcons[type];\n }\n return MaterialIcon;\n }\n};\n","//\n// Method to normalize size of fonts across devices\n//\n// Some code taken from https://jsfiddle.net/97ty7yjk/ &\n// https://stackoverflow.com/questions/34837342/font-size-on-iphone-6s-plus\n//\n// author: @xiaoneng\n// date: 14/10/2016\n// version: 03\n//\n\nimport { PixelRatio, Dimensions } from 'react-native';\n\nconst pixelRatio = PixelRatio.get();\nconst deviceHeight = Dimensions.get('window').height;\nconst deviceWidth = Dimensions.get('window').width;\n\n// -- Testing Only --\n// const fontScale = PixelRatio.getFontScale();\n// const layoutSize = PixelRatio.getPixelSizeForLayoutSize(14);\n// console.log('normalizeText getPR ->', pixelRatio);\n// console.log('normalizeText getFS ->', fontScale);\n// console.log('normalizeText getDH ->', deviceHeight);\n// console.log('normalizeText getDW ->', deviceWidth);\n// console.log('normalizeText getPSFLS ->', layoutSize);\n\nconst normalize = size => {\n if (pixelRatio >= 2 && pixelRatio < 3) {\n // iphone 5s and older Androids\n if (deviceWidth < 360) {\n return size * 0.95;\n }\n\n // iphone 5\n if (deviceHeight < 667) {\n return size;\n // iphone 6-6s\n }\n\n if (deviceHeight >= 667 && deviceHeight <= 735) {\n return size * 1.15;\n }\n // older phablets\n return size * 1.25;\n }\n\n if (pixelRatio >= 3 && pixelRatio < 3.5) {\n // catch Android font scaling on small machines\n // where pixel ratio / font scale ratio => 3:3\n if (deviceWidth <= 360) {\n return size;\n }\n\n // Catch other weird android width sizings\n if (deviceHeight < 667) {\n return size * 1.15;\n // catch in-between size Androids and scale font up\n // a tad but not too much\n }\n\n if (deviceHeight >= 667 && deviceHeight <= 735) {\n return size * 1.2;\n }\n\n // catch larger devices\n // ie iphone 6s plus / 7 plus / mi note 等等\n return size * 1.27;\n }\n\n if (pixelRatio >= 3.5) {\n // catch Android font scaling on small machines\n // where pixel ratio / font scale ratio => 3:3\n if (deviceWidth <= 360) {\n return size;\n // Catch other smaller android height sizings\n }\n\n if (deviceHeight < 667) {\n return size * 1.2;\n // catch in-between size Androids and scale font up\n // a tad but not too much\n }\n\n if (deviceHeight >= 667 && deviceHeight <= 735) {\n return size * 1.25;\n }\n\n // catch larger phablet devices\n return size * 1.4;\n }\n\n return size;\n};\n\nexport default normalize; // eslint-disable-line no-undef\n","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule EmitterSubscription\n * \n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport EventSubscription from './EventSubscription';\n/**\n * EmitterSubscription represents a subscription with listener and context data.\n */\n\nvar EmitterSubscription =\n/*#__PURE__*/\nfunction (_EventSubscription) {\n _inheritsLoose(EmitterSubscription, _EventSubscription);\n /**\n * @param {EventEmitter} emitter - The event emitter that registered this\n * subscription\n * @param {EventSubscriptionVendor} subscriber - The subscriber that controls\n * this subscription\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n * @param {*} context - Optional context object to use when invoking the\n * listener\n */\n\n\n function EmitterSubscription(emitter, subscriber, listener, context) {\n var _this;\n\n _this = _EventSubscription.call(this, subscriber) || this;\n _this.emitter = emitter;\n _this.listener = listener;\n _this.context = context;\n return _this;\n }\n /**\n * Removes this subscription from the emitter that registered it.\n * Note: we're overriding the `remove()` method of EventSubscription here\n * but deliberately not calling `super.remove()` as the responsibility\n * for removing the subscription lies with the EventEmitter.\n */\n\n\n var _proto = EmitterSubscription.prototype;\n\n _proto.remove = function remove() {\n this.emitter.removeSubscription(this);\n };\n\n return EmitterSubscription;\n}(EventSubscription);\n\nexport default EmitterSubscription;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule EventSubscription\n * \n */\n'use strict';\n/**\n * EventSubscription represents a subscription to a particular event. It can\n * remove its own subscription.\n */\n\nvar EventSubscription =\n/*#__PURE__*/\nfunction () {\n /**\n * @param {EventSubscriptionVendor} subscriber the subscriber that controls\n * this subscription.\n */\n function EventSubscription(subscriber) {\n this.subscriber = subscriber;\n }\n /**\n * Removes this subscription from the subscriber that controls it.\n */\n\n\n var _proto = EventSubscription.prototype;\n\n _proto.remove = function remove() {\n this.subscriber.removeSubscription(this);\n };\n\n return EventSubscription;\n}();\n\nexport default EventSubscription;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule EventSubscriptionVendor\n * \n */\n'use strict';\n\nimport invariant from 'fbjs/lib/invariant';\n/**\n * EventSubscriptionVendor stores a set of EventSubscriptions that are\n * subscribed to a particular event type.\n */\n\nvar EventSubscriptionVendor =\n/*#__PURE__*/\nfunction () {\n function EventSubscriptionVendor() {\n this._subscriptionsForType = {};\n this._currentSubscription = null;\n }\n /**\n * Adds a subscription keyed by an event type.\n *\n * @param {string} eventType\n * @param {EventSubscription} subscription\n */\n\n\n var _proto = EventSubscriptionVendor.prototype;\n\n _proto.addSubscription = function addSubscription(eventType, subscription) {\n invariant(subscription.subscriber === this, 'The subscriber of the subscription is incorrectly set.');\n\n if (!this._subscriptionsForType[eventType]) {\n this._subscriptionsForType[eventType] = [];\n }\n\n var key = this._subscriptionsForType[eventType].length;\n\n this._subscriptionsForType[eventType].push(subscription);\n\n subscription.eventType = eventType;\n subscription.key = key;\n return subscription;\n }\n /**\n * Removes a bulk set of the subscriptions.\n *\n * @param {?string} eventType - Optional name of the event type whose\n * registered supscriptions to remove, if null remove all subscriptions.\n */\n ;\n\n _proto.removeAllSubscriptions = function removeAllSubscriptions(eventType) {\n if (eventType === undefined) {\n this._subscriptionsForType = {};\n } else {\n delete this._subscriptionsForType[eventType];\n }\n }\n /**\n * Removes a specific subscription. Instead of calling this function, call\n * `subscription.remove()` directly.\n *\n * @param {object} subscription\n */\n ;\n\n _proto.removeSubscription = function removeSubscription(subscription) {\n var eventType = subscription.eventType;\n var key = subscription.key;\n var subscriptionsForType = this._subscriptionsForType[eventType];\n\n if (subscriptionsForType) {\n delete subscriptionsForType[key];\n }\n }\n /**\n * Returns the array of subscriptions that are currently registered for the\n * given event type.\n *\n * Note: This array can be potentially sparse as subscriptions are deleted\n * from it when they are removed.\n *\n * TODO: This returns a nullable array. wat?\n *\n * @param {string} eventType\n * @returns {?array}\n */\n ;\n\n _proto.getSubscriptionsForType = function getSubscriptionsForType(eventType) {\n return this._subscriptionsForType[eventType];\n };\n\n return EventSubscriptionVendor;\n}();\n\nexport default EventSubscriptionVendor;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule EventEmitter\n * \n * @typecheck\n */\n'use strict';\n\nimport EmitterSubscription from './EmitterSubscription';\nimport EventSubscriptionVendor from './EventSubscriptionVendor';\nimport emptyFunction from 'fbjs/lib/emptyFunction';\nimport invariant from 'fbjs/lib/invariant';\n/**\n * @class EventEmitter\n * @description\n * An EventEmitter is responsible for managing a set of listeners and publishing\n * events to them when it is told that such events happened. In addition to the\n * data for the given event it also sends a event control object which allows\n * the listeners/handlers to prevent the default behavior of the given event.\n *\n * The emitter is designed to be generic enough to support all the different\n * contexts in which one might want to emit events. It is a simple multicast\n * mechanism on top of which extra functionality can be composed. For example, a\n * more advanced emitter may use an EventHolder and EventFactory.\n */\n\nvar EventEmitter =\n/*#__PURE__*/\nfunction () {\n /**\n * @constructor\n *\n * @param {EventSubscriptionVendor} subscriber - Optional subscriber instance\n * to use. If omitted, a new subscriber will be created for the emitter.\n */\n function EventEmitter(subscriber) {\n this._subscriber = subscriber || new EventSubscriptionVendor();\n }\n /**\n * Adds a listener to be invoked when events of the specified type are\n * emitted. An optional calling context may be provided. The data arguments\n * emitted will be passed to the listener function.\n *\n * TODO: Annotate the listener arg's type. This is tricky because listeners\n * can be invoked with varargs.\n *\n * @param {string} eventType - Name of the event to listen to\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n * @param {*} context - Optional context object to use when invoking the\n * listener\n */\n\n\n var _proto = EventEmitter.prototype;\n\n _proto.addListener = function addListener(eventType, listener, context) {\n return this._subscriber.addSubscription(eventType, new EmitterSubscription(this, this._subscriber, listener, context));\n }\n /**\n * Similar to addListener, except that the listener is removed after it is\n * invoked once.\n *\n * @param {string} eventType - Name of the event to listen to\n * @param {function} listener - Function to invoke only once when the\n * specified event is emitted\n * @param {*} context - Optional context object to use when invoking the\n * listener\n */\n ;\n\n _proto.once = function once(eventType, listener, context) {\n var _this = this;\n\n return this.addListener(eventType, function () {\n _this.removeCurrentListener();\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listener.apply(context, args);\n });\n }\n /**\n * Removes all of the registered listeners, including those registered as\n * listener maps.\n *\n * @param {?string} eventType - Optional name of the event whose registered\n * listeners to remove\n */\n ;\n\n _proto.removeAllListeners = function removeAllListeners(eventType) {\n this._subscriber.removeAllSubscriptions(eventType);\n }\n /**\n * Provides an API that can be called during an eventing cycle to remove the\n * last listener that was invoked. This allows a developer to provide an event\n * object that can remove the listener (or listener map) during the\n * invocation.\n *\n * If it is called when not inside of an emitting cycle it will throw.\n *\n * @throws {Error} When called not during an eventing cycle\n *\n * @example\n * var subscription = emitter.addListenerMap({\n * someEvent: function(data, event) {\n * console.log(data);\n * emitter.removeCurrentListener();\n * }\n * });\n *\n * emitter.emit('someEvent', 'abc'); // logs 'abc'\n * emitter.emit('someEvent', 'def'); // does not log anything\n */\n ;\n\n _proto.removeCurrentListener = function removeCurrentListener() {\n invariant(!!this._currentSubscription, 'Not in an emitting cycle; there is no current subscription');\n this.removeSubscription(this._currentSubscription);\n }\n /**\n * Removes a specific subscription. Called by the `remove()` method of the\n * subscription itself to ensure any necessary cleanup is performed.\n */\n ;\n\n _proto.removeSubscription = function removeSubscription(subscription) {\n invariant(subscription.emitter === this, 'Subscription does not belong to this emitter.');\n\n this._subscriber.removeSubscription(subscription);\n }\n /**\n * Returns an array of listeners that are currently registered for the given\n * event.\n *\n * @param {string} eventType - Name of the event to query\n * @returns {array}\n */\n ;\n\n _proto.listeners = function listeners(eventType) {\n var subscriptions = this._subscriber.getSubscriptionsForType(eventType);\n\n return subscriptions ? subscriptions.filter(emptyFunction.thatReturnsTrue).map(function (subscription) {\n return subscription.listener;\n }) : [];\n }\n /**\n * Emits an event of the given type with the given data. All handlers of that\n * particular type will be notified.\n *\n * @param {string} eventType - Name of the event to emit\n * @param {...*} Arbitrary arguments to be passed to each registered listener\n *\n * @example\n * emitter.addListener('someEvent', function(message) {\n * console.log(message);\n * });\n *\n * emitter.emit('someEvent', 'abc'); // logs 'abc'\n */\n ;\n\n _proto.emit = function emit(eventType) {\n var subscriptions = this._subscriber.getSubscriptionsForType(eventType);\n\n if (subscriptions) {\n for (var i = 0, l = subscriptions.length; i < l; i++) {\n var subscription = subscriptions[i]; // The subscription may have been removed during this event loop.\n\n if (subscription) {\n this._currentSubscription = subscription;\n subscription.listener.apply(subscription.context, Array.prototype.slice.call(arguments, 1));\n }\n }\n\n this._currentSubscription = null;\n }\n }\n /**\n * Removes the given listener for event of specific type.\n *\n * @param {string} eventType - Name of the event to emit\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n *\n * @example\n * emitter.removeListener('someEvent', function(message) {\n * console.log(message);\n * }); // removes the listener if already registered\n *\n */\n ;\n\n _proto.removeListener = function removeListener(eventType, listener) {\n var subscriptions = this._subscriber.getSubscriptionsForType(eventType);\n\n if (subscriptions) {\n for (var i = 0, l = subscriptions.length; i < l; i++) {\n var subscription = subscriptions[i]; // The subscription may have been removed during this event loop.\n // its listener matches the listener in method parameters\n\n if (subscription && subscription.listener === listener) {\n subscription.remove();\n }\n }\n }\n };\n\n return EventEmitter;\n}();\n\nexport default EventEmitter;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * \n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport EventEmitter from '../emitter/EventEmitter';\nimport EventSubscriptionVendor from '../emitter/EventSubscriptionVendor';\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nfunction checkNativeEventModule(eventType) {\n if (eventType) {\n if (eventType === 'appStateDidChange' || eventType === 'memoryWarning') {\n throw new Error('`' + eventType + '` event should be registered via the AppState module');\n }\n }\n}\n/**\n * Deprecated - subclass NativeEventEmitter to create granular event modules instead of\n * adding all event listeners directly to RCTDeviceEventEmitter.\n */\n\n\nvar RCTDeviceEventEmitter =\n/*#__PURE__*/\nfunction (_EventEmitter) {\n _inheritsLoose(RCTDeviceEventEmitter, _EventEmitter);\n\n function RCTDeviceEventEmitter() {\n var _this;\n\n var sharedSubscriber = new EventSubscriptionVendor();\n _this = _EventEmitter.call(this, sharedSubscriber) || this;\n _this.sharedSubscriber = sharedSubscriber;\n return _this;\n }\n\n var _proto = RCTDeviceEventEmitter.prototype;\n\n _proto.addListener = function addListener(eventType, listener, context) {\n if (__DEV__) {\n checkNativeEventModule(eventType);\n }\n\n return _EventEmitter.prototype.addListener.call(this, eventType, listener, context);\n };\n\n _proto.removeAllListeners = function removeAllListeners(eventType) {\n if (__DEV__) {\n checkNativeEventModule(eventType);\n }\n\n _EventEmitter.prototype.removeAllListeners.call(this, eventType);\n };\n\n _proto.removeSubscription = function removeSubscription(subscription) {\n if (subscription.emitter !== this) {\n subscription.emitter.removeSubscription(subscription);\n } else {\n _EventEmitter.prototype.removeSubscription.call(this, subscription);\n }\n };\n\n return RCTDeviceEventEmitter;\n}(EventEmitter);\n\nexport default new RCTDeviceEventEmitter();","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @providesModule NativeEventEmitter\n * \n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport invariant from 'fbjs/lib/invariant';\nimport EventEmitter from '../emitter/EventEmitter';\nimport RCTDeviceEventEmitter from './RCTDeviceEventEmitter';\n/**\n * Abstract base class for implementing event-emitting modules. This implements\n * a subset of the standard EventEmitter node module API.\n */\n\nvar NativeEventEmitter =\n/*#__PURE__*/\nfunction (_EventEmitter) {\n _inheritsLoose(NativeEventEmitter, _EventEmitter);\n\n function NativeEventEmitter(nativeModule) {\n return _EventEmitter.call(this, RCTDeviceEventEmitter.sharedSubscriber) || this;\n }\n\n var _proto = NativeEventEmitter.prototype;\n\n _proto.addListener = function addListener(eventType, listener, context) {\n if (this._nativeModule != null) {\n this._nativeModule.addListener(eventType);\n }\n\n return _EventEmitter.prototype.addListener.call(this, eventType, listener, context);\n };\n\n _proto.removeAllListeners = function removeAllListeners(eventType) {\n invariant(eventType, 'eventType argument is required.');\n var count = this.listeners(eventType).length;\n\n if (this._nativeModule != null) {\n this._nativeModule.removeListeners(count);\n }\n\n _EventEmitter.prototype.removeAllListeners.call(this, eventType);\n };\n\n _proto.removeSubscription = function removeSubscription(subscription) {\n if (this._nativeModule != null) {\n this._nativeModule.removeListeners(1);\n }\n\n _EventEmitter.prototype.removeSubscription.call(this, subscription);\n };\n\n return NativeEventEmitter;\n}(EventEmitter);\n\nexport default NativeEventEmitter;","\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar performance = require(\"./performance\");\n\nvar performanceNow;\n/**\n * Detect if we can use `window.performance.now()` and gracefully fallback to\n * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now\n * because of Facebook's testing infrastructure.\n */\n\nif (performance.now) {\n performanceNow = function performanceNow() {\n return performance.now();\n };\n} else {\n performanceNow = function performanceNow() {\n return Date.now();\n };\n}\n\nmodule.exports = performanceNow;","// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\ntslib_1.__exportStar(require(\"./dialog\"), exports);\n\ntslib_1.__exportStar(require(\"./session-dialog\"), exports);\n\ntslib_1.__exportStar(require(\"./subscription-dialog\"), exports);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar messages_1 = require(\"../messages\");\n/**\n * A key concept for a user agent is that of a dialog. A dialog\n * represents a peer-to-peer SIP relationship between two user agents\n * that persists for some time. The dialog facilitates sequencing of\n * messages between the user agents and proper routing of requests\n * between both of them. The dialog represents a context in which to\n * interpret SIP messages.\n * https://tools.ietf.org/html/rfc3261#section-12\n */\n\n\nvar Dialog =\n/** @class */\nfunction () {\n /**\n * Dialog constructor.\n * @param core User agent core.\n * @param dialogState Initial dialog state.\n */\n function Dialog(core, dialogState) {\n this.core = core;\n this.dialogState = dialogState;\n this.core.dialogs.set(this.id, this);\n }\n /**\n * When a UAC receives a response that establishes a dialog, it\n * constructs the state of the dialog. This state MUST be maintained\n * for the duration of the dialog.\n * https://tools.ietf.org/html/rfc3261#section-12.1.2\n * @param outgoingRequestMessage Outgoing request message for dialog.\n * @param incomingResponseMessage Incoming response message creating dialog.\n */\n\n\n Dialog.initialDialogStateForUserAgentClient = function (outgoingRequestMessage, incomingResponseMessage) {\n // If the request was sent over TLS, and the Request-URI contained a\n // SIPS URI, the \"secure\" flag is set to TRUE.\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n var secure = false; // FIXME: Currently no support for TLS.\n // The route set MUST be set to the list of URIs in the Record-Route\n // header field from the response, taken in reverse order and preserving\n // all URI parameters. If no Record-Route header field is present in\n // the response, the route set MUST be set to the empty set. This route\n // set, even if empty, overrides any pre-existing route set for future\n // requests in this dialog. The remote target MUST be set to the URI\n // from the Contact header field of the response.\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n\n var routeSet = incomingResponseMessage.getHeaders(\"record-route\").reverse();\n var contact = incomingResponseMessage.parseHeader(\"contact\");\n\n if (!contact) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"Contact undefined.\");\n }\n\n if (!(contact instanceof messages_1.NameAddrHeader)) {\n throw new Error(\"Contact not instance of NameAddrHeader.\");\n }\n\n var remoteTarget = contact.uri; // The local sequence number MUST be set to the value of the sequence\n // number in the CSeq header field of the request. The remote sequence\n // number MUST be empty (it is established when the remote UA sends a\n // request within the dialog). The call identifier component of the\n // dialog ID MUST be set to the value of the Call-ID in the request.\n // The local tag component of the dialog ID MUST be set to the tag in\n // the From field in the request, and the remote tag component of the\n // dialog ID MUST be set to the tag in the To field of the response. A\n // UAC MUST be prepared to receive a response without a tag in the To\n // field, in which case the tag is considered to have a value of null.\n //\n // This is to maintain backwards compatibility with RFC 2543, which\n // did not mandate To tags.\n //\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n\n var localSequenceNumber = outgoingRequestMessage.cseq;\n var remoteSequenceNumber = undefined;\n var callId = outgoingRequestMessage.callId;\n var localTag = outgoingRequestMessage.fromTag;\n var remoteTag = incomingResponseMessage.toTag;\n\n if (!callId) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"Call id undefined.\");\n }\n\n if (!localTag) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"From tag undefined.\");\n }\n\n if (!remoteTag) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"To tag undefined.\"); // FIXME: No backwards compatibility with RFC 2543\n } // The remote URI MUST be set to the URI in the To field, and the local\n // URI MUST be set to the URI in the From field.\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n\n\n if (!outgoingRequestMessage.from) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"From undefined.\");\n }\n\n if (!outgoingRequestMessage.to) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"To undefined.\");\n }\n\n var localURI = outgoingRequestMessage.from.uri;\n var remoteURI = outgoingRequestMessage.to.uri; // A dialog can also be in the \"early\" state, which occurs when it is\n // created with a provisional response, and then transition to the\n // \"confirmed\" state when a 2xx final response arrives.\n // https://tools.ietf.org/html/rfc3261#section-12\n\n if (!incomingResponseMessage.statusCode) {\n throw new Error(\"Incoming response status code undefined.\");\n }\n\n var early = incomingResponseMessage.statusCode < 200 ? true : false;\n var dialogState = {\n id: callId + localTag + remoteTag,\n early: early,\n callId: callId,\n localTag: localTag,\n remoteTag: remoteTag,\n localSequenceNumber: localSequenceNumber,\n remoteSequenceNumber: remoteSequenceNumber,\n localURI: localURI,\n remoteURI: remoteURI,\n remoteTarget: remoteTarget,\n routeSet: routeSet,\n secure: secure\n };\n return dialogState;\n };\n /**\n * The UAS then constructs the state of the dialog. This state MUST be\n * maintained for the duration of the dialog.\n * https://tools.ietf.org/html/rfc3261#section-12.1.1\n * @param incomingRequestMessage Incoming request message creating dialog.\n * @param toTag Tag in the To field in the response to the incoming request.\n */\n\n\n Dialog.initialDialogStateForUserAgentServer = function (incomingRequestMessage, toTag, early) {\n if (early === void 0) {\n early = false;\n } // If the request arrived over TLS, and the Request-URI contained a SIPS\n // URI, the \"secure\" flag is set to TRUE.\n // https://tools.ietf.org/html/rfc3261#section-12.1.1\n\n\n var secure = false; // FIXME: Currently no support for TLS.\n // The route set MUST be set to the list of URIs in the Record-Route\n // header field from the request, taken in order and preserving all URI\n // parameters. If no Record-Route header field is present in the\n // request, the route set MUST be set to the empty set. This route set,\n // even if empty, overrides any pre-existing route set for future\n // requests in this dialog. The remote target MUST be set to the URI\n // from the Contact header field of the request.\n // https://tools.ietf.org/html/rfc3261#section-12.1.1\n\n var routeSet = incomingRequestMessage.getHeaders(\"record-route\");\n var contact = incomingRequestMessage.parseHeader(\"contact\");\n\n if (!contact) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"Contact undefined.\");\n }\n\n if (!(contact instanceof messages_1.NameAddrHeader)) {\n throw new Error(\"Contact not instance of NameAddrHeader.\");\n }\n\n var remoteTarget = contact.uri; // The remote sequence number MUST be set to the value of the sequence\n // number in the CSeq header field of the request. The local sequence\n // number MUST be empty. The call identifier component of the dialog ID\n // MUST be set to the value of the Call-ID in the request. The local\n // tag component of the dialog ID MUST be set to the tag in the To field\n // in the response to the request (which always includes a tag), and the\n // remote tag component of the dialog ID MUST be set to the tag from the\n // From field in the request. A UAS MUST be prepared to receive a\n // request without a tag in the From field, in which case the tag is\n // considered to have a value of null.\n //\n // This is to maintain backwards compatibility with RFC 2543, which\n // did not mandate From tags.\n //\n // https://tools.ietf.org/html/rfc3261#section-12.1.1\n\n var remoteSequenceNumber = incomingRequestMessage.cseq;\n var localSequenceNumber = undefined;\n var callId = incomingRequestMessage.callId;\n var localTag = toTag;\n var remoteTag = incomingRequestMessage.fromTag; // The remote URI MUST be set to the URI in the From field, and the\n // local URI MUST be set to the URI in the To field.\n // https://tools.ietf.org/html/rfc3261#section-12.1.1\n\n var remoteURI = incomingRequestMessage.from.uri;\n var localURI = incomingRequestMessage.to.uri;\n var dialogState = {\n id: callId + localTag + remoteTag,\n early: early,\n callId: callId,\n localTag: localTag,\n remoteTag: remoteTag,\n localSequenceNumber: localSequenceNumber,\n remoteSequenceNumber: remoteSequenceNumber,\n localURI: localURI,\n remoteURI: remoteURI,\n remoteTarget: remoteTarget,\n routeSet: routeSet,\n secure: secure\n };\n return dialogState;\n };\n /** Destructor. */\n\n\n Dialog.prototype.dispose = function () {\n this.core.dialogs.delete(this.id);\n };\n\n Object.defineProperty(Dialog.prototype, \"id\", {\n /**\n * A dialog is identified at each UA with a dialog ID, which consists of\n * a Call-ID value, a local tag and a remote tag. The dialog ID at each\n * UA involved in the dialog is not the same. Specifically, the local\n * tag at one UA is identical to the remote tag at the peer UA. The\n * tags are opaque tokens that facilitate the generation of unique\n * dialog IDs.\n * https://tools.ietf.org/html/rfc3261#section-12\n */\n get: function get() {\n return this.dialogState.id;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"early\", {\n /**\n * A dialog can also be in the \"early\" state, which occurs when it is\n * created with a provisional response, and then it transition to the\n * \"confirmed\" state when a 2xx final response received or is sent.\n *\n * Note: RFC 3261 is concise on when a dialog is \"confirmed\", but it\n * can be a point of confusion if an INVITE dialog is \"confirmed\" after\n * a 2xx is sent or after receiving the ACK for the 2xx response.\n * With careful reading it can be inferred a dialog is always is\n * \"confirmed\" when the 2xx is sent (regardless of type of dialog).\n * However a INVITE dialog does have additional considerations\n * when it is confirmed but an ACK has not yet been received (in\n * particular with regard to a callee sending BYE requests).\n */\n get: function get() {\n return this.dialogState.early;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"callId\", {\n /** Call identifier component of the dialog id. */\n get: function get() {\n return this.dialogState.callId;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"localTag\", {\n /** Local tag component of the dialog id. */\n get: function get() {\n return this.dialogState.localTag;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"remoteTag\", {\n /** Remote tag component of the dialog id. */\n get: function get() {\n return this.dialogState.remoteTag;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"localSequenceNumber\", {\n /** Local sequence number (used to order requests from the UA to its peer). */\n get: function get() {\n return this.dialogState.localSequenceNumber;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"remoteSequenceNumber\", {\n /** Remote sequence number (used to order requests from its peer to the UA). */\n get: function get() {\n return this.dialogState.remoteSequenceNumber;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"localURI\", {\n /** Local URI. */\n get: function get() {\n return this.dialogState.localURI;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"remoteURI\", {\n /** Remote URI. */\n get: function get() {\n return this.dialogState.remoteURI;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"remoteTarget\", {\n /** Remote target. */\n get: function get() {\n return this.dialogState.remoteTarget;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"routeSet\", {\n /**\n * Route set, which is an ordered list of URIs. The route set is the\n * list of servers that need to be traversed to send a request to the peer.\n */\n get: function get() {\n return this.dialogState.routeSet;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"secure\", {\n /**\n * If the request was sent over TLS, and the Request-URI contained\n * a SIPS URI, the \"secure\" flag is set to true. *NOT IMPLEMENTED*\n */\n get: function get() {\n return this.dialogState.secure;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dialog.prototype, \"userAgentCore\", {\n /** The user agent core servicing this dialog. */\n get: function get() {\n return this.core;\n },\n enumerable: true,\n configurable: true\n });\n /** Confirm the dialog. Only matters if dialog is currently early. */\n\n Dialog.prototype.confirm = function () {\n this.dialogState.early = false;\n };\n /**\n * Requests sent within a dialog, as any other requests, are atomic. If\n * a particular request is accepted by the UAS, all the state changes\n * associated with it are performed. If the request is rejected, none\n * of the state changes are performed.\n *\n * Note that some requests, such as INVITEs, affect several pieces of\n * state.\n *\n * https://tools.ietf.org/html/rfc3261#section-12.2.2\n * @param message Incoming request message within this dialog.\n */\n\n\n Dialog.prototype.receiveRequest = function (message) {\n // ACK guard.\n // By convention, the handling of ACKs is the responsibility\n // the particular dialog implementation. For example, see SessionDialog.\n // Furthermore, ACKs have same sequence number as the associated INVITE.\n if (message.method === messages_1.C.ACK) {\n return;\n } // If the remote sequence number was not empty, but the sequence number\n // of the request is lower than the remote sequence number, the request\n // is out of order and MUST be rejected with a 500 (Server Internal\n // Error) response. If the remote sequence number was not empty, and\n // the sequence number of the request is greater than the remote\n // sequence number, the request is in order. It is possible for the\n // CSeq sequence number to be higher than the remote sequence number by\n // more than one. This is not an error condition, and a UAS SHOULD be\n // prepared to receive and process requests with CSeq values more than\n // one higher than the previous received request. The UAS MUST then set\n // the remote sequence number to the value of the sequence number in the\n // CSeq header field value in the request.\n //\n // If a proxy challenges a request generated by the UAC, the UAC has\n // to resubmit the request with credentials. The resubmitted request\n // will have a new CSeq number. The UAS will never see the first\n // request, and thus, it will notice a gap in the CSeq number space.\n // Such a gap does not represent any error condition.\n //\n // https://tools.ietf.org/html/rfc3261#section-12.2.2\n\n\n if (this.remoteSequenceNumber) {\n if (message.cseq <= this.remoteSequenceNumber) {\n throw new Error(\"Out of sequence in dialog request. Did you forget to call sequenceGuard()?\");\n }\n\n this.dialogState.remoteSequenceNumber = message.cseq;\n } // If the remote sequence number is empty, it MUST be set to the value\n // of the sequence number in the CSeq header field value in the request.\n // https://tools.ietf.org/html/rfc3261#section-12.2.2\n\n\n if (!this.remoteSequenceNumber) {\n this.dialogState.remoteSequenceNumber = message.cseq;\n } // When a UAS receives a target refresh request, it MUST replace the\n // dialog's remote target URI with the URI from the Contact header field\n // in that request, if present.\n // https://tools.ietf.org/html/rfc3261#section-12.2.2\n // Note: \"target refresh request\" processing delegated to sub-class.\n\n };\n /**\n * If the dialog identifier in the 2xx response matches the dialog\n * identifier of an existing dialog, the dialog MUST be transitioned to\n * the \"confirmed\" state, and the route set for the dialog MUST be\n * recomputed based on the 2xx response using the procedures of Section\n * 12.2.1.2. Otherwise, a new dialog in the \"confirmed\" state MUST be\n * constructed using the procedures of Section 12.1.2.\n *\n * Note that the only piece of state that is recomputed is the route\n * set. Other pieces of state such as the highest sequence numbers\n * (remote and local) sent within the dialog are not recomputed. The\n * route set only is recomputed for backwards compatibility. RFC\n * 2543 did not mandate mirroring of the Record-Route header field in\n * a 1xx, only 2xx. However, we cannot update the entire state of\n * the dialog, since mid-dialog requests may have been sent within\n * the early dialog, modifying the sequence numbers, for example.\n *\n * https://tools.ietf.org/html/rfc3261#section-13.2.2.4\n */\n\n\n Dialog.prototype.recomputeRouteSet = function (message) {\n this.dialogState.routeSet = message.getHeaders(\"record-route\").reverse();\n };\n /**\n * A request within a dialog is constructed by using many of the\n * components of the state stored as part of the dialog.\n * https://tools.ietf.org/html/rfc3261#section-12.2.1.1\n * @param method Outgoing request method.\n */\n\n\n Dialog.prototype.createOutgoingRequestMessage = function (method, options) {\n // The URI in the To field of the request MUST be set to the remote URI\n // from the dialog state. The tag in the To header field of the request\n // MUST be set to the remote tag of the dialog ID. The From URI of the\n // request MUST be set to the local URI from the dialog state. The tag\n // in the From header field of the request MUST be set to the local tag\n // of the dialog ID. If the value of the remote or local tags is null,\n // the tag parameter MUST be omitted from the To or From header fields,\n // respectively.\n //\n // Usage of the URI from the To and From fields in the original\n // request within subsequent requests is done for backwards\n // compatibility with RFC 2543, which used the URI for dialog\n // identification. In this specification, only the tags are used for\n // dialog identification. It is expected that mandatory reflection\n // of the original To and From URI in mid-dialog requests will be\n // deprecated in a subsequent revision of this specification.\n // https://tools.ietf.org/html/rfc3261#section-12.2.1.1\n var toUri = this.remoteURI;\n var toTag = this.remoteTag;\n var fromUri = this.localURI;\n var fromTag = this.localTag; // The Call-ID of the request MUST be set to the Call-ID of the dialog.\n // Requests within a dialog MUST contain strictly monotonically\n // increasing and contiguous CSeq sequence numbers (increasing-by-one)\n // in each direction (excepting ACK and CANCEL of course, whose numbers\n // equal the requests being acknowledged or cancelled). Therefore, if\n // the local sequence number is not empty, the value of the local\n // sequence number MUST be incremented by one, and this value MUST be\n // placed into the CSeq header field. If the local sequence number is\n // empty, an initial value MUST be chosen using the guidelines of\n // Section 8.1.1.5. The method field in the CSeq header field value\n // MUST match the method of the request.\n // https://tools.ietf.org/html/rfc3261#section-12.2.1.1\n\n var callId = this.callId;\n var cseq;\n\n if (options && options.cseq) {\n cseq = options.cseq;\n } else if (!this.dialogState.localSequenceNumber) {\n cseq = this.dialogState.localSequenceNumber = 1; // https://tools.ietf.org/html/rfc3261#section-8.1.1.5\n } else {\n cseq = this.dialogState.localSequenceNumber += 1;\n } // The UAC uses the remote target and route set to build the Request-URI\n // and Route header field of the request.\n //\n // If the route set is empty, the UAC MUST place the remote target URI\n // into the Request-URI. The UAC MUST NOT add a Route header field to\n // the request.\n //\n // If the route set is not empty, and the first URI in the route set\n // contains the lr parameter (see Section 19.1.1), the UAC MUST place\n // the remote target URI into the Request-URI and MUST include a Route\n // header field containing the route set values in order, including all\n // parameters.\n //\n // If the route set is not empty, and its first URI does not contain the\n // lr parameter, the UAC MUST place the first URI from the route set\n // into the Request-URI, stripping any parameters that are not allowed\n // in a Request-URI. The UAC MUST add a Route header field containing\n // the remainder of the route set values in order, including all\n // parameters. The UAC MUST then place the remote target URI into the\n // Route header field as the last value.\n // https://tools.ietf.org/html/rfc3261#section-12.2.1.1\n // The lr parameter, when present, indicates that the element\n // responsible for this resource implements the routing mechanisms\n // specified in this document. This parameter will be used in the\n // URIs proxies place into Record-Route header field values, and\n // may appear in the URIs in a pre-existing route set.\n //\n // This parameter is used to achieve backwards compatibility with\n // systems implementing the strict-routing mechanisms of RFC 2543\n // and the rfc2543bis drafts up to bis-05. An element preparing\n // to send a request based on a URI not containing this parameter\n // can assume the receiving element implements strict-routing and\n // reformat the message to preserve the information in the\n // Request-URI.\n // https://tools.ietf.org/html/rfc3261#section-19.1.1\n // NOTE: Not backwards compatible with RFC 2543 (no support for strict-routing).\n\n\n var ruri = this.remoteTarget;\n var routeSet = this.routeSet;\n var extraHeaders = options && options.extraHeaders;\n var body = options && options.body; // The relative order of header fields with different field names is not\n // significant. However, it is RECOMMENDED that header fields which are\n // needed for proxy processing (Via, Route, Record-Route, Proxy-Require,\n // Max-Forwards, and Proxy-Authorization, for example) appear towards\n // the top of the message to facilitate rapid parsing.\n // https://tools.ietf.org/html/rfc3261#section-7.3.1\n\n var message = this.userAgentCore.makeOutgoingRequestMessage(method, ruri, fromUri, toUri, {\n callId: callId,\n cseq: cseq,\n fromTag: fromTag,\n toTag: toTag,\n routeSet: routeSet\n }, extraHeaders, body);\n return message;\n };\n /**\n * If the remote sequence number was not empty, but the sequence number\n * of the request is lower than the remote sequence number, the request\n * is out of order and MUST be rejected with a 500 (Server Internal\n * Error) response.\n * https://tools.ietf.org/html/rfc3261#section-12.2.2\n * @param request Incoming request to guard.\n * @returns True if the program execution is to continue in the branch in question.\n * Otherwise a 500 Server Internal Error was stateless sent and request processing must stop.\n */\n\n\n Dialog.prototype.sequenceGuard = function (message) {\n // ACK guard.\n // By convention, handling of unexpected ACKs is responsibility\n // the particular dialog implementation. For example, see SessionDialog.\n // Furthermore, we cannot reply to an \"out of sequence\" ACK.\n if (message.method === messages_1.C.ACK) {\n return true;\n } // Note: We are rejecting on \"less than or equal to\" the remote\n // sequence number (excepting ACK whose numbers equal the requests\n // being acknowledged or cancelled), which is the correct thing to\n // do in our case. The only time a request with the same sequence number\n // will show up here if is a) it is a very late retransmission of a\n // request we already handled or b) it is a different request with the\n // same sequence number which would be violation of the standard.\n // Request retransmissions are absorbed by the transaction layer,\n // so any request with a duplicate sequence number getting here\n // would have to be a retransmission after the transaction terminated\n // or a broken request (with unique via branch value).\n // Requests within a dialog MUST contain strictly monotonically\n // increasing and contiguous CSeq sequence numbers (increasing-by-one)\n // in each direction (excepting ACK and CANCEL of course, whose numbers\n // equal the requests being acknowledged or cancelled). Therefore, if\n // the local sequence number is not empty, the value of the local\n // sequence number MUST be incremented by one, and this value MUST be\n // placed into the CSeq header field.\n // https://tools.ietf.org/html/rfc3261#section-12.2.1.1\n\n\n if (this.remoteSequenceNumber && message.cseq <= this.remoteSequenceNumber) {\n this.core.replyStateless(message, {\n statusCode: 500\n });\n return false;\n }\n\n return true;\n };\n\n return Dialog;\n}();\n\nexports.Dialog = Dialog;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar grammar_1 = require(\"./grammar\");\n\nvar utils_1 = require(\"./utils\");\n/**\n * Incoming SIP message.\n * @public\n */\n\n\nvar IncomingMessage =\n/** @class */\nfunction () {\n function IncomingMessage() {\n this.headers = {};\n }\n /**\n * Insert a header of the given name and value into the last position of the\n * header array.\n * @param name - header name\n * @param value - header value\n */\n\n\n IncomingMessage.prototype.addHeader = function (name, value) {\n var header = {\n raw: value\n };\n name = utils_1.headerize(name);\n\n if (this.headers[name]) {\n this.headers[name].push(header);\n } else {\n this.headers[name] = [header];\n }\n };\n /**\n * Get the value of the given header name at the given position.\n * @param name - header name\n * @returns Returns the specified header, undefined if header doesn't exist.\n */\n\n\n IncomingMessage.prototype.getHeader = function (name) {\n var header = this.headers[utils_1.headerize(name)];\n\n if (header) {\n if (header[0]) {\n return header[0].raw;\n }\n } else {\n return;\n }\n };\n /**\n * Get the header/s of the given name.\n * @param name - header name\n * @returns Array - with all the headers of the specified name.\n */\n\n\n IncomingMessage.prototype.getHeaders = function (name) {\n var header = this.headers[utils_1.headerize(name)];\n var result = [];\n\n if (!header) {\n return [];\n }\n\n for (var _i = 0, header_1 = header; _i < header_1.length; _i++) {\n var headerPart = header_1[_i];\n result.push(headerPart.raw);\n }\n\n return result;\n };\n /**\n * Verify the existence of the given header.\n * @param name - header name\n * @returns true if header with given name exists, false otherwise\n */\n\n\n IncomingMessage.prototype.hasHeader = function (name) {\n return !!this.headers[utils_1.headerize(name)];\n };\n /**\n * Parse the given header on the given index.\n * @param name - header name\n * @param idx - header index\n * @returns Parsed header object, undefined if the\n * header is not present or in case of a parsing error.\n */\n\n\n IncomingMessage.prototype.parseHeader = function (name, idx) {\n if (idx === void 0) {\n idx = 0;\n }\n\n name = utils_1.headerize(name);\n\n if (!this.headers[name]) {\n // this.logger.log(\"header '\" + name + \"' not present\");\n return;\n } else if (idx >= this.headers[name].length) {\n // this.logger.log(\"not so many '\" + name + \"' headers present\");\n return;\n }\n\n var header = this.headers[name][idx];\n var value = header.raw;\n\n if (header.parsed) {\n return header.parsed;\n } // substitute '-' by '_' for grammar rule matching.\n\n\n var parsed = grammar_1.Grammar.parse(value, name.replace(/-/g, \"_\"));\n\n if (parsed === -1) {\n this.headers[name].splice(idx, 1); // delete from headers\n // this.logger.warn('error parsing \"' + name + '\" header field with value \"' + value + '\"');\n\n return;\n } else {\n header.parsed = parsed;\n return parsed;\n }\n };\n /**\n * Message Header attribute selector. Alias of parseHeader.\n * @param name - header name\n * @param idx - header index\n * @returns Parsed header object, undefined if the\n * header is not present or in case of a parsing error.\n *\n * @example\n * message.s('via',3).port\n */\n\n\n IncomingMessage.prototype.s = function (name, idx) {\n if (idx === void 0) {\n idx = 0;\n }\n\n return this.parseHeader(name, idx);\n };\n /**\n * Replace the value of the given header by the value.\n * @param name - header name\n * @param value - header value\n */\n\n\n IncomingMessage.prototype.setHeader = function (name, value) {\n this.headers[utils_1.headerize(name)] = [{\n raw: value\n }];\n };\n\n IncomingMessage.prototype.toString = function () {\n return this.data;\n };\n\n return IncomingMessage;\n}();\n\nexports.IncomingMessage = IncomingMessage;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar pegGrammar = tslib_1.__importStar(require(\"../../grammar/dist/grammar\"));\n/**\n * Grammar.\n * @internal\n */\n\n\nvar Grammar;\n\n(function (Grammar) {\n /**\n * Parse.\n * @param input -\n * @param startRule -\n */\n function parse(input, startRule) {\n var options = {\n startRule: startRule\n };\n\n try {\n pegGrammar.parse(input, options);\n } catch (e) {\n options.data = -1;\n }\n\n return options.data;\n }\n\n Grammar.parse = parse;\n /**\n * Parse the given string and returns a SIP.NameAddrHeader instance or undefined if\n * it is an invalid NameAddrHeader.\n * @param name_addr_header -\n */\n\n function nameAddrHeaderParse(nameAddrHeader) {\n var parsedNameAddrHeader = Grammar.parse(nameAddrHeader, \"Name_Addr_Header\");\n return parsedNameAddrHeader !== -1 ? parsedNameAddrHeader : undefined;\n }\n\n Grammar.nameAddrHeaderParse = nameAddrHeaderParse;\n /**\n * Parse the given string and returns a SIP.URI instance or undefined if\n * it is an invalid URI.\n * @param uri -\n */\n\n function URIParse(uri) {\n var parsedUri = Grammar.parse(uri, \"SIP_URI\");\n return parsedUri !== -1 ? parsedUri : undefined;\n }\n\n Grammar.URIParse = URIParse;\n})(Grammar = exports.Grammar || (exports.Grammar = {}));","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar parameters_1 = require(\"./parameters\");\n/**\n * Name Address SIP header.\n * @public\n */\n\n\nvar NameAddrHeader =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(NameAddrHeader, _super);\n /**\n * Constructor\n * @param uri\n * @param displayName\n * @param parameters\n */\n\n\n function NameAddrHeader(uri, displayName, parameters) {\n var _this = _super.call(this, parameters) || this;\n\n _this.uri = uri;\n _this._displayName = displayName;\n return _this;\n }\n\n Object.defineProperty(NameAddrHeader.prototype, \"friendlyName\", {\n get: function get() {\n return this.displayName || this.uri.aor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NameAddrHeader.prototype, \"displayName\", {\n get: function get() {\n return this._displayName;\n },\n set: function set(value) {\n this._displayName = value;\n },\n enumerable: true,\n configurable: true\n });\n\n NameAddrHeader.prototype.clone = function () {\n return new NameAddrHeader(this.uri.clone(), this._displayName, JSON.parse(JSON.stringify(this.parameters)));\n };\n\n NameAddrHeader.prototype.toString = function () {\n var body = this.displayName || this.displayName === \"0\" ? '\"' + this.displayName + '\" ' : \"\";\n body += \"<\" + this.uri.toString() + \">\";\n\n for (var parameter in this.parameters) {\n if (this.parameters.hasOwnProperty(parameter)) {\n body += \";\" + parameter;\n\n if (this.parameters[parameter] !== null) {\n body += \"=\" + this.parameters[parameter];\n }\n }\n }\n\n return body;\n };\n\n return NameAddrHeader;\n}(parameters_1.Parameters);\n\nexports.NameAddrHeader = NameAddrHeader;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @internal\n */\n\nvar Parameters =\n/** @class */\nfunction () {\n function Parameters(parameters) {\n this.parameters = {};\n\n for (var param in parameters) {\n if (parameters.hasOwnProperty(param)) {\n this.setParam(param, parameters[param]);\n }\n }\n }\n\n Parameters.prototype.setParam = function (key, value) {\n if (key) {\n this.parameters[key.toLowerCase()] = typeof value === \"undefined\" || value === null ? null : value.toString();\n }\n };\n\n Parameters.prototype.getParam = function (key) {\n if (key) {\n return this.parameters[key.toLowerCase()];\n }\n };\n\n Parameters.prototype.hasParam = function (key) {\n if (key) {\n return !!this.parameters.hasOwnProperty(key.toLowerCase());\n }\n\n return false;\n };\n\n Parameters.prototype.deleteParam = function (parameter) {\n parameter = parameter.toLowerCase();\n\n if (this.parameters.hasOwnProperty(parameter)) {\n var value = this.parameters[parameter];\n delete this.parameters[parameter];\n return value;\n }\n };\n\n Parameters.prototype.clearParams = function () {\n this.parameters = {};\n };\n\n return Parameters;\n}();\n\nexports.Parameters = Parameters;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar parameters_1 = require(\"./parameters\");\n/**\n * URI.\n * @public\n */\n\n\nvar URI =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(URI, _super);\n /**\n * Constructor\n * @param scheme\n * @param user\n * @param host\n * @param port\n * @param parameters\n * @param headers\n */\n\n\n function URI(scheme, user, host, port, parameters, headers) {\n var _this = _super.call(this, parameters) || this;\n\n _this.headers = {}; // Checks\n\n if (!host) {\n throw new TypeError('missing or invalid \"host\" parameter');\n } // Initialize parameters\n\n\n scheme = scheme || \"sip\";\n\n for (var header in headers) {\n if (headers.hasOwnProperty(header)) {\n _this.setHeader(header, headers[header]);\n }\n } // Raw URI\n\n\n _this.raw = {\n scheme: scheme,\n user: user,\n host: host,\n port: port\n }; // Normalized URI\n\n _this.normal = {\n scheme: scheme.toLowerCase(),\n user: user,\n host: host.toLowerCase(),\n port: port\n };\n return _this;\n }\n\n Object.defineProperty(URI.prototype, \"scheme\", {\n get: function get() {\n return this.normal.scheme;\n },\n set: function set(value) {\n this.raw.scheme = value;\n this.normal.scheme = value.toLowerCase();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"user\", {\n get: function get() {\n return this.normal.user;\n },\n set: function set(value) {\n this.normal.user = this.raw.user = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"host\", {\n get: function get() {\n return this.normal.host;\n },\n set: function set(value) {\n this.raw.host = value;\n this.normal.host = value.toLowerCase();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"aor\", {\n get: function get() {\n return this.normal.user + \"@\" + this.normal.host;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"port\", {\n get: function get() {\n return this.normal.port;\n },\n set: function set(value) {\n this.normal.port = this.raw.port = value === 0 ? value : value;\n },\n enumerable: true,\n configurable: true\n });\n\n URI.prototype.setHeader = function (name, value) {\n this.headers[this.headerize(name)] = value instanceof Array ? value : [value];\n };\n\n URI.prototype.getHeader = function (name) {\n if (name) {\n return this.headers[this.headerize(name)];\n }\n };\n\n URI.prototype.hasHeader = function (name) {\n return !!name && !!this.headers.hasOwnProperty(this.headerize(name));\n };\n\n URI.prototype.deleteHeader = function (header) {\n header = this.headerize(header);\n\n if (this.headers.hasOwnProperty(header)) {\n var value = this.headers[header];\n delete this.headers[header];\n return value;\n }\n };\n\n URI.prototype.clearHeaders = function () {\n this.headers = {};\n };\n\n URI.prototype.clone = function () {\n return new URI(this._raw.scheme, this._raw.user || \"\", this._raw.host, this._raw.port, JSON.parse(JSON.stringify(this.parameters)), JSON.parse(JSON.stringify(this.headers)));\n };\n\n URI.prototype.toRaw = function () {\n return this._toString(this._raw);\n };\n\n URI.prototype.toString = function () {\n return this._toString(this._normal);\n };\n\n Object.defineProperty(URI.prototype, \"_normal\", {\n get: function get() {\n return this.normal;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"_raw\", {\n get: function get() {\n return this.raw;\n },\n enumerable: true,\n configurable: true\n });\n\n URI.prototype._toString = function (uri) {\n var uriString = uri.scheme + \":\"; // add slashes if it's not a sip(s) URI\n\n if (!uri.scheme.toLowerCase().match(\"^sips?$\")) {\n uriString += \"//\";\n }\n\n if (uri.user) {\n uriString += this.escapeUser(uri.user) + \"@\";\n }\n\n uriString += uri.host;\n\n if (uri.port || uri.port === 0) {\n uriString += \":\" + uri.port;\n }\n\n for (var parameter in this.parameters) {\n if (this.parameters.hasOwnProperty(parameter)) {\n uriString += \";\" + parameter;\n\n if (this.parameters[parameter] !== null) {\n uriString += \"=\" + this.parameters[parameter];\n }\n }\n }\n\n var headers = [];\n\n for (var header in this.headers) {\n if (this.headers.hasOwnProperty(header)) {\n for (var idx in this.headers[header]) {\n if (this.headers[header].hasOwnProperty(idx)) {\n headers.push(header + \"=\" + this.headers[header][idx]);\n }\n }\n }\n }\n\n if (headers.length > 0) {\n uriString += \"?\" + headers.join(\"&\");\n }\n\n return uriString;\n }; // The following two functions were copied from Utils to break a circular dependency\n\n /*\n * Hex-escape a SIP URI user.\n * @private\n * @param {String} user\n */\n\n\n URI.prototype.escapeUser = function (user) {\n // Don't hex-escape ':' (%3A), '+' (%2B), '?' (%3F\"), '/' (%2F).\n return encodeURIComponent(decodeURIComponent(user)).replace(/%3A/ig, \":\").replace(/%2B/ig, \"+\").replace(/%3F/ig, \"?\").replace(/%2F/ig, \"/\");\n };\n\n URI.prototype.headerize = function (str) {\n var exceptions = {\n \"Call-Id\": \"Call-ID\",\n \"Cseq\": \"CSeq\",\n \"Min-Se\": \"Min-SE\",\n \"Rack\": \"RAck\",\n \"Rseq\": \"RSeq\",\n \"Www-Authenticate\": \"WWW-Authenticate\"\n };\n var name = str.toLowerCase().replace(/_/g, \"-\").split(\"-\");\n var parts = name.length;\n var hname = \"\";\n\n for (var part = 0; part < parts; part++) {\n if (part !== 0) {\n hname += \"-\";\n }\n\n hname += name[part].charAt(0).toUpperCase() + name[part].substring(1);\n }\n\n if (exceptions[hname]) {\n hname = exceptions[hname];\n }\n\n return hname;\n };\n\n return URI;\n}(parameters_1.Parameters);\n\nexports.URI = URI;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transaction_1 = require(\"./transaction\");\n/**\n * Client Transaction\n *\n * The client transaction provides its functionality through the\n * maintenance of a state machine.\n *\n * The TU communicates with the client transaction through a simple\n * interface. When the TU wishes to initiate a new transaction, it\n * creates a client transaction and passes it the SIP request to send\n * and an IP address, port, and transport to which to send it. The\n * client transaction begins execution of its state machine. Valid\n * responses are passed up to the TU from the client transaction.\n * https://tools.ietf.org/html/rfc3261#section-17.1\n */\n\n\nvar ClientTransaction =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ClientTransaction, _super);\n\n function ClientTransaction(_request, transport, user, state, loggerCategory) {\n var _this = _super.call(this, transport, user, ClientTransaction.makeId(_request), state, loggerCategory) || this;\n\n _this._request = _request;\n _this.user = user; // The Via header field indicates the transport used for the transaction\n // and identifies the location where the response is to be sent. A Via\n // header field value is added only after the transport that will be\n // used to reach the next hop has been selected (which may involve the\n // usage of the procedures in [4]).\n // https://tools.ietf.org/html/rfc3261#section-8.1.1.7\n // FIXME: Transport's server property is not typed (as of writing this).\n\n var scheme = transport.server && transport.server.scheme ? transport.server.scheme : undefined;\n\n _request.setViaHeader(_this.id, scheme);\n\n return _this;\n }\n\n ClientTransaction.makeId = function (request) {\n if (request.method === \"CANCEL\") {\n if (!request.branch) {\n throw new Error(\"Outgoing CANCEL request without a branch.\");\n }\n\n return request.branch;\n } else {\n return \"z9hG4bK\" + Math.floor(Math.random() * 10000000);\n }\n };\n\n Object.defineProperty(ClientTransaction.prototype, \"request\", {\n /** The outgoing request the transaction handling. */\n get: function get() {\n return this._request;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * A 408 to non-INVITE will always arrive too late to be useful ([3]),\n * The client already has full knowledge of the timeout. The only\n * information this message would convey is whether or not the server\n * believed the transaction timed out. However, with the current design\n * of the NIT, a client cannot do anything with this knowledge. Thus,\n * the 408 is simply wasting network resources and contributes to the\n * response bombardment illustrated in [3].\n * https://tools.ietf.org/html/rfc4320#section-4.1\n */\n\n ClientTransaction.prototype.onRequestTimeout = function () {\n if (this.user.onRequestTimeout) {\n this.user.onRequestTimeout();\n }\n };\n\n return ClientTransaction;\n}(transaction_1.Transaction);\n\nexports.ClientTransaction = ClientTransaction;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar exceptions_1 = require(\"../exceptions\");\n/**\n * Transaction\n *\n * SIP is a transactional protocol: interactions between components take\n * place in a series of independent message exchanges. Specifically, a\n * SIP transaction consists of a single request and any responses to\n * that request, which include zero or more provisional responses and\n * one or more final responses. In the case of a transaction where the\n * request was an INVITE (known as an INVITE transaction), the\n * transaction also includes the ACK only if the final response was not\n * a 2xx response. If the response was a 2xx, the ACK is not considered\n * part of the transaction.\n * https://tools.ietf.org/html/rfc3261#section-17\n */\n\n\nvar Transaction =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(Transaction, _super);\n\n function Transaction(_transport, _user, _id, _state, loggerCategory) {\n var _this = _super.call(this) || this;\n\n _this._transport = _transport;\n _this._user = _user;\n _this._id = _id;\n _this._state = _state;\n _this.logger = _user.loggerFactory.getLogger(loggerCategory, _id);\n\n _this.logger.debug(\"Constructing \" + _this.typeToString() + \" with id \" + _this.id + \".\");\n\n return _this;\n }\n /**\n * Destructor.\n * Once the transaction is in the \"terminated\" state, it is destroyed\n * immediately and there is no need to call `dispose`. However, if a\n * transaction needs to be ended prematurely, the transaction user may\n * do so by calling this method (for example, perhaps the UA is shutting down).\n * No state transition will occur upon calling this method, all outstanding\n * transmission timers will be cancelled, and use of the transaction after\n * calling `dispose` is undefined.\n */\n\n\n Transaction.prototype.dispose = function () {\n this.logger.debug(\"Destroyed \" + this.typeToString() + \" with id \" + this.id + \".\");\n };\n\n Object.defineProperty(Transaction.prototype, \"id\", {\n /** Transaction id. */\n get: function get() {\n return this._id;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Transaction.prototype, \"kind\", {\n /** Transaction kind. Deprecated. */\n get: function get() {\n throw new Error(\"Invalid kind.\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Transaction.prototype, \"state\", {\n /** Transaction state. */\n get: function get() {\n return this._state;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Transaction.prototype, \"transport\", {\n /** Transaction transport. */\n get: function get() {\n return this._transport;\n },\n enumerable: true,\n configurable: true\n });\n\n Transaction.prototype.on = function (name, callback) {\n return _super.prototype.on.call(this, name, callback);\n };\n\n Transaction.prototype.logTransportError = function (error, message) {\n this.logger.error(error.message);\n this.logger.error(\"Transport error occurred in \" + this.typeToString() + \" with id \" + this.id + \".\");\n this.logger.error(message);\n };\n /**\n * Pass message to transport for transmission. If transport fails,\n * the transaction user is notified by callback to onTransportError().\n * @throws {TransportError} If transport fails.\n */\n\n\n Transaction.prototype.send = function (message) {\n var _this = this;\n\n return this.transport.send(message).catch(function (error) {\n // FIXME: Transport is not, yet, typed and it is not clear\n // yet what send() may or may not send our way. So for now,\n // make sure we convert it to a TransportError if need be.\n if (error instanceof exceptions_1.TransportError) {\n _this.onTransportError(error);\n\n return;\n }\n\n var transportError;\n\n if (error && typeof error.message === \"string\") {\n transportError = new exceptions_1.TransportError(error.message);\n } else {\n transportError = new exceptions_1.TransportError();\n }\n\n _this.onTransportError(transportError);\n\n throw transportError;\n });\n };\n\n Transaction.prototype.setState = function (state) {\n this.logger.debug(\"State change to \\\"\" + state + \"\\\" on \" + this.typeToString() + \" with id \" + this.id + \".\");\n this._state = state;\n\n if (this._user.onStateChange) {\n this._user.onStateChange(state);\n }\n\n this.emit(\"stateChanged\");\n };\n\n Transaction.prototype.typeToString = function () {\n return \"UnknownType\";\n };\n\n return Transaction;\n}(events_1.EventEmitter);\n\nexports.Transaction = Transaction;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n/**\n * An Exception is considered a condition that a reasonable application may wish to catch.\n * An Error indicates serious problems that a reasonable application should not try to catch.\n * @public\n */\n\n\nvar Exception =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(Exception, _super);\n\n function Exception(message) {\n var _newTarget = this.constructor;\n\n var _this = _super.call(this, message) || this;\n\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain\n\n return _this;\n }\n\n return Exception;\n}(Error);\n\nexports.Exception = Exception;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transaction_1 = require(\"./transaction\");\n/**\n * Server Transaction\n * The server transaction is responsible for the delivery of requests to\n * the TU and the reliable transmission of responses. It accomplishes\n * this through a state machine. Server transactions are created by the\n * core when a request is received, and transaction handling is desired\n * for that request (this is not always the case).\n * https://tools.ietf.org/html/rfc3261#section-17.2\n */\n\n\nvar ServerTransaction =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ServerTransaction, _super);\n\n function ServerTransaction(_request, transport, user, state, loggerCategory) {\n var _this = _super.call(this, transport, user, _request.viaBranch, state, loggerCategory) || this;\n\n _this._request = _request;\n _this.user = user;\n return _this;\n }\n\n Object.defineProperty(ServerTransaction.prototype, \"request\", {\n /** The incoming request the transaction handling. */\n get: function get() {\n return this._request;\n },\n enumerable: true,\n configurable: true\n });\n return ServerTransaction;\n}(transaction_1.Transaction);\n\nexports.ServerTransaction = ServerTransaction;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_server_1 = require(\"./user-agent-server\");\n\nvar NotifyUserAgentServer =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(NotifyUserAgentServer, _super);\n /**\n * NOTIFY UAS constructor.\n * @param dialogOrCore Dialog for in dialog NOTIFY, UserAgentCore for out of dialog NOTIFY (deprecated).\n * @param message Incoming NOTIFY request message.\n */\n\n\n function NotifyUserAgentServer(dialogOrCore, message, delegate) {\n var _this = this;\n\n var userAgentCore = instanceOfDialog(dialogOrCore) ? dialogOrCore.userAgentCore : dialogOrCore;\n _this = _super.call(this, transactions_1.NonInviteServerTransaction, userAgentCore, message, delegate) || this;\n return _this;\n }\n\n return NotifyUserAgentServer;\n}(user_agent_server_1.UserAgentServer);\n\nexports.NotifyUserAgentServer = NotifyUserAgentServer;\n\nfunction instanceOfDialog(object) {\n return object.userAgentCore !== undefined;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\ntslib_1.__exportStar(require(\"./subscription\"), exports);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Log levels.\n * @public\n */\n\nvar Levels;\n\n(function (Levels) {\n Levels[Levels[\"error\"] = 0] = \"error\";\n Levels[Levels[\"warn\"] = 1] = \"warn\";\n Levels[Levels[\"log\"] = 2] = \"log\";\n Levels[Levels[\"debug\"] = 3] = \"debug\";\n})(Levels = exports.Levels || (exports.Levels = {}));","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar ClientContext_1 = require(\"./ClientContext\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Exceptions_1 = require(\"./Exceptions\");\n\nvar ServerContext_1 = require(\"./ServerContext\"); // tslint:disable-next-line:max-classes-per-file\n\n\nvar ReferClientContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReferClientContext, _super);\n\n function ReferClientContext(ua, applicant, target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = this;\n\n if (ua === undefined || applicant === undefined || target === undefined) {\n throw new TypeError(\"Not enough arguments\");\n }\n\n _this = _super.call(this, ua, Constants_1.C.REFER, applicant.remoteIdentity.uri.toString(), options) || this;\n _this.type = Enums_1.TypeStrings.ReferClientContext;\n _this.options = options;\n _this.extraHeaders = (_this.options.extraHeaders || []).slice();\n _this.applicant = applicant;\n _this.target = _this.initReferTo(target);\n\n if (_this.ua) {\n _this.extraHeaders.push(\"Referred-By: <\" + _this.ua.configuration.uri + \">\");\n } // TODO: Check that this is correct isc/icc\n\n\n _this.extraHeaders.push(\"Contact: \" + applicant.contact); // this is UA.C.ALLOWED_METHODS, removed to get around circular dependency\n\n\n _this.extraHeaders.push(\"Allow: \" + [\"ACK\", \"CANCEL\", \"INVITE\", \"MESSAGE\", \"BYE\", \"OPTIONS\", \"INFO\", \"NOTIFY\", \"REFER\"].toString());\n\n _this.extraHeaders.push(\"Refer-To: \" + _this.target);\n\n _this.errorListener = _this.onTransportError.bind(_this);\n\n if (ua.transport) {\n ua.transport.on(\"transportError\", _this.errorListener);\n }\n\n return _this;\n }\n\n ReferClientContext.prototype.refer = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var extraHeaders = (this.extraHeaders || []).slice();\n\n if (options.extraHeaders) {\n extraHeaders.concat(options.extraHeaders);\n }\n\n this.applicant.sendRequest(Constants_1.C.REFER, {\n extraHeaders: this.extraHeaders,\n receiveResponse: function receiveResponse(response) {\n var statusCode = response && response.statusCode ? response.statusCode.toString() : \"\";\n\n if (/^1[0-9]{2}$/.test(statusCode)) {\n _this.emit(\"referRequestProgress\", _this);\n } else if (/^2[0-9]{2}$/.test(statusCode)) {\n _this.emit(\"referRequestAccepted\", _this);\n } else if (/^[4-6][0-9]{2}$/.test(statusCode)) {\n _this.emit(\"referRequestRejected\", _this);\n }\n\n if (options.receiveResponse) {\n options.receiveResponse(response);\n }\n }\n });\n return this;\n };\n\n ReferClientContext.prototype.receiveNotify = function (request) {\n // If we can correctly handle this, then we need to send a 200 OK!\n var contentType = request.message.hasHeader(\"Content-Type\") ? request.message.getHeader(\"Content-Type\") : undefined;\n\n if (contentType && contentType.search(/^message\\/sipfrag/) !== -1) {\n var messageBody = core_1.Grammar.parse(request.message.body, \"sipfrag\");\n\n if (messageBody === -1) {\n request.reject({\n statusCode: 489,\n reasonPhrase: \"Bad Event\"\n });\n return;\n }\n\n switch (true) {\n case /^1[0-9]{2}$/.test(messageBody.status_code):\n this.emit(\"referProgress\", this);\n break;\n\n case /^2[0-9]{2}$/.test(messageBody.status_code):\n this.emit(\"referAccepted\", this);\n\n if (!this.options.activeAfterTransfer && this.applicant.terminate) {\n this.applicant.terminate();\n }\n\n break;\n\n default:\n this.emit(\"referRejected\", this);\n break;\n }\n\n request.accept();\n this.emit(\"notify\", request.message);\n return;\n }\n\n request.reject({\n statusCode: 489,\n reasonPhrase: \"Bad Event\"\n });\n };\n\n ReferClientContext.prototype.initReferTo = function (target) {\n var stringOrURI;\n\n if (typeof target === \"string\") {\n // REFER without Replaces (Blind Transfer)\n var targetString = core_1.Grammar.parse(target, \"Refer_To\");\n stringOrURI = targetString && targetString.uri ? targetString.uri : target; // Check target validity\n\n var targetUri = this.ua.normalizeTarget(target);\n\n if (!targetUri) {\n throw new TypeError(\"Invalid target: \" + target);\n }\n\n stringOrURI = targetUri;\n } else {\n // REFER with Replaces (Attended Transfer)\n if (!target.session) {\n throw new Error(\"Session undefined.\");\n }\n\n var displayName = target.remoteIdentity.friendlyName;\n var remoteTarget = target.session.remoteTarget.toString();\n var callId = target.session.callId;\n var remoteTag = target.session.remoteTag;\n var localTag = target.session.localTag;\n var replaces = encodeURIComponent(callId + \";to-tag=\" + remoteTag + \";from-tag=\" + localTag);\n stringOrURI = \"\\\"\" + displayName + \"\\\" <\" + remoteTarget + \"?Replaces=\" + replaces + \">\";\n }\n\n return stringOrURI;\n };\n\n return ReferClientContext;\n}(ClientContext_1.ClientContext);\n\nexports.ReferClientContext = ReferClientContext; // tslint:disable-next-line:max-classes-per-file\n\nvar ReferServerContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReferServerContext, _super);\n\n function ReferServerContext(ua, incomingRequest, session) {\n var _this = _super.call(this, ua, incomingRequest) || this;\n\n _this.session = session;\n _this.type = Enums_1.TypeStrings.ReferServerContext;\n _this.ua = ua;\n _this.status = Enums_1.SessionStatus.STATUS_INVITE_RECEIVED;\n _this.fromTag = _this.request.fromTag;\n _this.id = _this.request.callId + _this.fromTag;\n _this.contact = _this.ua.contact.toString();\n _this.logger = ua.getLogger(\"sip.referservercontext\", _this.id); // Needed to send the NOTIFY's\n\n _this.cseq = Math.floor(Math.random() * 10000);\n _this.callId = _this.request.callId;\n _this.fromUri = _this.request.to.uri;\n _this.fromTag = _this.request.to.parameters.tag;\n _this.remoteTarget = _this.request.headers.Contact[0].parsed.uri;\n _this.toUri = _this.request.from.uri;\n _this.toTag = _this.request.fromTag;\n _this.routeSet = _this.request.getHeaders(\"record-route\"); // RFC 3515 2.4.1\n\n if (!_this.request.hasHeader(\"refer-to\")) {\n _this.logger.warn(\"Invalid REFER packet. A refer-to header is required. Rejecting refer.\");\n\n _this.reject();\n\n return _this;\n }\n\n _this.referTo = _this.request.parseHeader(\"refer-to\"); // TODO: Must set expiration timer and send 202 if there is no response by then\n\n _this.referredSession = _this.ua.findSession(_this.request);\n\n if (_this.request.hasHeader(\"referred-by\")) {\n _this.referredBy = _this.request.getHeader(\"referred-by\");\n }\n\n if (_this.referTo.uri.hasHeader(\"replaces\")) {\n _this.replaces = _this.referTo.uri.getHeader(\"replaces\");\n }\n\n _this.errorListener = _this.onTransportError.bind(_this);\n\n if (ua.transport) {\n ua.transport.on(\"transportError\", _this.errorListener);\n }\n\n _this.status = Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER;\n return _this;\n }\n\n ReferServerContext.prototype.progress = function () {\n if (this.status !== Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n this.incomingRequest.trying();\n };\n\n ReferServerContext.prototype.reject = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n this.logger.log(\"Rejecting refer\");\n this.status = Enums_1.SessionStatus.STATUS_TERMINATED;\n\n _super.prototype.reject.call(this, options);\n\n this.emit(\"referRequestRejected\", this);\n };\n\n ReferServerContext.prototype.accept = function (options, modifiers) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER) {\n this.status = Enums_1.SessionStatus.STATUS_ANSWERED;\n } else {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n this.incomingRequest.accept({\n statusCode: 202,\n reasonPhrase: \"Accepted\"\n });\n this.emit(\"referRequestAccepted\", this);\n\n if (options.followRefer) {\n this.logger.log(\"Accepted refer, attempting to automatically follow it\");\n var target = this.referTo.uri;\n\n if (!target.scheme || !target.scheme.match(\"^sips?$\")) {\n this.logger.error(\"SIP.js can only automatically follow SIP refer target\");\n this.reject();\n return;\n }\n\n var inviteOptions = options.inviteOptions || {};\n var extraHeaders = (inviteOptions.extraHeaders || []).slice();\n\n if (this.replaces) {\n // decodeURIComponent is a holdover from 2c086eb4. Not sure that it is actually necessary\n extraHeaders.push(\"Replaces: \" + decodeURIComponent(this.replaces));\n }\n\n if (this.referredBy) {\n extraHeaders.push(\"Referred-By: \" + this.referredBy);\n }\n\n inviteOptions.extraHeaders = extraHeaders;\n target.clearHeaders();\n this.targetSession = this.ua.invite(target.toString(), inviteOptions, modifiers);\n this.emit(\"referInviteSent\", this);\n\n if (this.targetSession) {\n this.targetSession.once(\"progress\", function (response) {\n var statusCode = response.statusCode || 100;\n var reasonPhrase = response.reasonPhrase;\n\n _this.sendNotify((\"SIP/2.0 \" + statusCode + \" \" + reasonPhrase).trim());\n\n _this.emit(\"referProgress\", _this);\n\n if (_this.referredSession) {\n _this.referredSession.emit(\"referProgress\", _this);\n }\n });\n this.targetSession.once(\"accepted\", function () {\n _this.logger.log(\"Successfully followed the refer\");\n\n _this.sendNotify(\"SIP/2.0 200 OK\");\n\n _this.emit(\"referAccepted\", _this);\n\n if (_this.referredSession) {\n _this.referredSession.emit(\"referAccepted\", _this);\n }\n });\n\n var referFailed = function referFailed(response) {\n if (_this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return; // No throw here because it is possible this gets called multiple times\n }\n\n _this.logger.log(\"Refer was not successful. Resuming session\");\n\n if (response && response.statusCode === 429) {\n _this.logger.log(\"Alerting referrer that identity is required.\");\n\n _this.sendNotify(\"SIP/2.0 429 Provide Referrer Identity\");\n\n return;\n }\n\n _this.sendNotify(\"SIP/2.0 603 Declined\"); // Must change the status after sending the final Notify or it will not send due to check\n\n\n _this.status = Enums_1.SessionStatus.STATUS_TERMINATED;\n\n _this.emit(\"referRejected\", _this);\n\n if (_this.referredSession) {\n _this.referredSession.emit(\"referRejected\");\n }\n };\n\n this.targetSession.once(\"rejected\", referFailed);\n this.targetSession.once(\"failed\", referFailed);\n }\n } else {\n this.logger.log(\"Accepted refer, but did not automatically follow it\");\n this.sendNotify(\"SIP/2.0 200 OK\");\n this.emit(\"referAccepted\", this);\n\n if (this.referredSession) {\n this.referredSession.emit(\"referAccepted\", this);\n }\n }\n };\n\n ReferServerContext.prototype.sendNotify = function (bodyStr) {\n // FIXME: Ported this. Clean it up. Session knows its state.\n if (this.status !== Enums_1.SessionStatus.STATUS_ANSWERED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n if (core_1.Grammar.parse(bodyStr, \"sipfrag\") === -1) {\n throw new Error(\"sipfrag body is required to send notify for refer\");\n }\n\n var body = {\n contentDisposition: \"render\",\n contentType: \"message/sipfrag\",\n content: bodyStr\n }; // NOTIFY requests sent in same dialog as in dialog REFER.\n\n if (this.session) {\n this.session.notify(undefined, {\n extraHeaders: [\"Event: refer\", \"Subscription-State: terminated\"],\n body: body\n });\n return;\n } // The implicit subscription created by a REFER is the same as a\n // subscription created with a SUBSCRIBE request. The agent issuing the\n // REFER can terminate this subscription prematurely by unsubscribing\n // using the mechanisms described in [2]. Terminating a subscription,\n // either by explicitly unsubscribing or rejecting NOTIFY, is not an\n // indication that the referenced request should be withdrawn or\n // abandoned.\n // https://tools.ietf.org/html/rfc3515#section-2.4.4\n // NOTIFY requests sent in new dialog for out of dialog REFER.\n // FIXME: TODO: This should be done in a subscribe dialog to satisfy the above.\n\n\n var request = this.ua.userAgentCore.makeOutgoingRequestMessage(Constants_1.C.NOTIFY, this.remoteTarget, this.fromUri, this.toUri, {\n cseq: this.cseq += 1,\n callId: this.callId,\n fromTag: this.fromTag,\n toTag: this.toTag,\n routeSet: this.routeSet\n }, [\"Event: refer\", \"Subscription-State: terminated\", \"Content-Type: message/sipfrag\"], body);\n var transport = this.ua.transport;\n\n if (!transport) {\n throw new Error(\"Transport undefined.\");\n }\n\n var user = {\n loggerFactory: this.ua.getLoggerFactory()\n };\n var nic = new core_1.NonInviteClientTransaction(request, transport, user);\n };\n\n ReferServerContext.prototype.on = function (name, callback) {\n return _super.prototype.on.call(this, name, callback);\n };\n\n return ReferServerContext;\n}(ServerContext_1.ServerContext);\n\nexports.ReferServerContext = ReferServerContext;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar stripPayload = function stripPayload(sdp, payload) {\n var mediaDescs = [];\n var lines = sdp.split(/\\r\\n/);\n var currentMediaDesc;\n\n for (var i = 0; i < lines.length;) {\n var line = lines[i];\n\n if (/^m=(?:audio|video)/.test(line)) {\n currentMediaDesc = {\n index: i,\n stripped: []\n };\n mediaDescs.push(currentMediaDesc);\n } else if (currentMediaDesc) {\n var rtpmap = /^a=rtpmap:(\\d+) ([^/]+)\\//.exec(line);\n\n if (rtpmap && payload === rtpmap[2]) {\n lines.splice(i, 1);\n currentMediaDesc.stripped.push(rtpmap[1]);\n continue; // Don't increment 'i'\n }\n }\n\n i++;\n }\n\n for (var _i = 0, mediaDescs_1 = mediaDescs; _i < mediaDescs_1.length; _i++) {\n var mediaDesc = mediaDescs_1[_i];\n var mline = lines[mediaDesc.index].split(\" \"); // Ignore the first 3 parameters of the mline. The codec information is after that\n\n for (var j = 3; j < mline.length;) {\n if (mediaDesc.stripped.indexOf(mline[j]) !== -1) {\n mline.splice(j, 1);\n continue;\n }\n\n j++;\n }\n\n lines[mediaDesc.index] = mline.join(\" \");\n }\n\n return lines.join(\"\\r\\n\");\n};\n\nvar stripMediaDescription = function stripMediaDescription(sdp, description) {\n var descriptionRegExp = new RegExp(\"m=\" + description + \".*$\", \"gm\");\n var groupRegExp = new RegExp(\"^a=group:.*$\", \"gm\");\n\n if (descriptionRegExp.test(sdp)) {\n var midLineToRemove_1;\n sdp = sdp.split(/^m=/gm).filter(function (section) {\n if (section.substr(0, description.length) === description) {\n midLineToRemove_1 = section.match(/^a=mid:.*$/gm);\n\n if (midLineToRemove_1) {\n var step = midLineToRemove_1[0].match(/:.+$/g);\n\n if (step) {\n midLineToRemove_1 = step[0].substr(1);\n }\n }\n\n return false;\n }\n\n return true;\n }).join(\"m=\");\n var groupLine = sdp.match(groupRegExp);\n\n if (groupLine && groupLine.length === 1) {\n var groupLinePortion = groupLine[0];\n var groupRegExpReplace = new RegExp(\"\\ *\" + midLineToRemove_1 + \"[^\\ ]*\", \"g\");\n groupLinePortion = groupLinePortion.replace(groupRegExpReplace, \"\");\n sdp = sdp.split(groupRegExp).join(groupLinePortion);\n }\n }\n\n return sdp;\n};\n\nfunction stripTcpCandidates(description) {\n description.sdp = (description.sdp || \"\").replace(/^a=candidate:\\d+ \\d+ tcp .*?\\r\\n/img, \"\");\n return Promise.resolve(description);\n}\n\nexports.stripTcpCandidates = stripTcpCandidates;\n\nfunction stripTelephoneEvent(description) {\n description.sdp = stripPayload(description.sdp || \"\", \"telephone-event\");\n return Promise.resolve(description);\n}\n\nexports.stripTelephoneEvent = stripTelephoneEvent;\n\nfunction cleanJitsiSdpImageattr(description) {\n description.sdp = (description.sdp || \"\").replace(/^(a=imageattr:.*?)(x|y)=\\[0-/gm, \"$1$2=[1:\");\n return Promise.resolve(description);\n}\n\nexports.cleanJitsiSdpImageattr = cleanJitsiSdpImageattr;\n\nfunction stripG722(description) {\n description.sdp = stripPayload(description.sdp || \"\", \"G722\");\n return Promise.resolve(description);\n}\n\nexports.stripG722 = stripG722;\n\nfunction stripRtpPayload(payload) {\n return function (description) {\n description.sdp = stripPayload(description.sdp || \"\", payload);\n return Promise.resolve(description);\n };\n}\n\nexports.stripRtpPayload = stripRtpPayload;\n\nfunction stripVideo(description) {\n description.sdp = stripMediaDescription(description.sdp || \"\", \"video\");\n return Promise.resolve(description);\n}\n\nexports.stripVideo = stripVideo;\n\nfunction addMidLines(description) {\n var sdp = description.sdp || \"\";\n\n if (sdp.search(/^a=mid.*$/gm) === -1) {\n var mlines_1 = sdp.match(/^m=.*$/gm);\n var sdpArray_1 = sdp.split(/^m=.*$/gm);\n\n if (mlines_1) {\n mlines_1.forEach(function (elem, idx) {\n mlines_1[idx] = elem + \"\\na=mid:\" + idx;\n });\n }\n\n sdpArray_1.forEach(function (elem, idx) {\n if (mlines_1 && mlines_1[idx]) {\n sdpArray_1[idx] = elem + mlines_1[idx];\n }\n });\n sdp = sdpArray_1.join(\"\");\n description.sdp = sdp;\n }\n\n return Promise.resolve(description);\n}\n\nexports.addMidLines = addMidLines;","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || value !== value && other !== other;\n}\n\nmodule.exports = eq;","var getNative = require('./_getNative'),\n root = require('./_root');\n/* Built-in method references that are verified to be native. */\n\n\nvar Map = getNative(root, 'Map');\nmodule.exports = Map;","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\n\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n this.clear();\n\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n} // Add methods to `MapCache`.\n\n\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\nmodule.exports = MapCache;","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n\n\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/** Built-in value references. */\n\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n\nvar isArguments = baseIsArguments(function () {\n return arguments;\n}()) ? baseIsArguments : function (value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n};\nmodule.exports = isArguments;","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n/** Detect free variable `exports`. */\n\n\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n/** Detect free variable `module`. */\n\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n/** Detect the popular CommonJS extension `module.exports`. */\n\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n/** Built-in value references. */\n\nvar Buffer = moduleExports ? root.Buffer : undefined;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n\nvar isBuffer = nativeIsBuffer || stubFalse;\nmodule.exports = isBuffer;","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/** Used to detect unsigned integer values. */\n\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function (value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;","var freeGlobal = require('./_freeGlobal');\n/** Detect free variable `exports`. */\n\n\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n/** Detect free variable `module`. */\n\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n/** Detect the popular CommonJS extension `module.exports`. */\n\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n/** Detect free variable `process` from Node.js. */\n\nvar freeProcess = moduleExports && freeGlobal.process;\n/** Used to access faster Node.js helpers. */\n\nvar nodeUtil = function () {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n } // Legacy `process.binding('util')` for Node.js < 10.\n\n\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}();\n\nmodule.exports = nodeUtil;","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;\n return value === proto;\n}\n\nmodule.exports = isPrototype;","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Built-in value references. */\n\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n\nvar getSymbols = !nativeGetSymbols ? stubArray : function (object) {\n if (object == null) {\n return [];\n }\n\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function (symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\nmodule.exports = getSymbols;","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n\n return array;\n}\n\nmodule.exports = arrayPush;","var overArg = require('./_overArg');\n/** Built-in value references. */\n\n\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\nmodule.exports = getPrototype;","var Uint8Array = require('./_Uint8Array');\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n\n\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;","/* eslint-disable import/order */\n\n// UI references\n// https://ionicframework.com/docs/components/#buttons\n// https://material.io/guidelines/components/buttons.html#buttons-raised-buttons\n// https://material.angularjs.org/latest/demo/button\n\n// Core\nimport Button from './buttons/Button';\nimport Input from './input/Input';\n\nimport Icon from './icons/Icon';\nimport ListItem from './list/ListItem';\nimport SocialIcon from './social/SocialIcon';\nimport Overlay from './overlay/Overlay';\n\n// Utilities\nimport SearchBar from './searchbar/SearchBar';\nimport Badge from './badge/Badge';\nimport withBadge from './badge/withBadge';\nimport CheckBox from './checkbox/CheckBox';\nimport Divider from './divider/Divider';\nimport Slider from './slider/Slider';\nimport ButtonGroup from './buttons/ButtonGroup';\nimport Image from './image/Image';\n\n// Productivity\nimport Card from './card/Card';\nimport Tile from './tile/Tile';\nimport Avatar from './avatar/Avatar';\nimport Header from './header/Header';\nimport PricingCard from './pricing/PricingCard';\nimport Tooltip from './tooltip/Tooltip';\nimport {\n AirbnbRating as BaseAirbnbRating,\n Rating as BaseRating,\n} from 'react-native-ratings';\n\n// helpers\nimport Text from './text/Text';\nimport { colors, ThemeProvider, ThemeConsumer, withTheme } from './config';\nimport getIconType, { registerCustomIconType } from './helpers/getIconType';\nimport normalize from './helpers/normalizeText';\n\nconst AirbnbRating = withTheme(BaseAirbnbRating, 'AirbnbRating');\nconst Rating = withTheme(BaseRating, 'Rating');\n\nexport {\n Badge,\n Button,\n ButtonGroup,\n Card,\n Input,\n ListItem,\n PricingCard,\n Tooltip,\n SocialIcon,\n Text,\n Divider,\n CheckBox,\n SearchBar,\n Icon,\n colors,\n getIconType,\n registerCustomIconType,\n normalize,\n Tile,\n Slider,\n Avatar,\n Rating,\n AirbnbRating,\n Header,\n Overlay,\n ThemeProvider,\n ThemeConsumer,\n withBadge,\n withTheme,\n Image,\n};\n","import { StyleSheet } from 'react-native';\n\nexport default {\n primary: '#2089dc',\n secondary: '#8F0CE8',\n grey0: '#393e42',\n grey1: '#43484d',\n grey2: '#5e6977',\n grey3: '#86939e',\n grey4: '#bdc6cf',\n grey5: '#e1e8ee',\n greyOutline: '#bbb',\n searchBg: '#303337',\n success: '#52c41a',\n error: '#ff190c',\n warning: '#faad14',\n disabled: 'hsl(208, 8%, 90%)',\n // Darker color if hairlineWidth is not thin enough\n divider: StyleSheet.hairlineWidth < 1 ? '#bcbbc1' : 'rgba(0, 0, 0, 0.12)',\n platform: {\n ios: {\n primary: '#007aff',\n secondary: '#5856d6',\n success: '#4cd964',\n error: '#ff3b30',\n warning: '#ffcc00',\n },\n android: {\n primary: '#2196f3',\n secondary: '#9C27B0',\n success: '#4caf50',\n error: '#f44336',\n warning: '#ffeb3b',\n },\n },\n};\n","import { View, ViewPropTypes as RNViewPropTypes } from 'react-native';\n\nconst ViewPropTypes = RNViewPropTypes || View.propTypes;\n\nexport default ViewPropTypes;\n","/**\n * FontAwesome icon set component.\n * Usage: \n */\n\nimport createIconSet from './lib/create-icon-set';\nimport glyphMap from './glyphmaps/FontAwesome.json';\n\nconst iconSet = createIconSet(glyphMap, 'FontAwesome', 'FontAwesome.ttf');\n\nexport default iconSet;\n\nexport const Button = iconSet.Button;\nexport const TabBarItem = iconSet.TabBarItem;\nexport const TabBarItemIOS = iconSet.TabBarItemIOS;\nexport const ToolbarAndroid = iconSet.ToolbarAndroid;\nexport const getImageSource = iconSet.getImageSource;\n\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { StyleSheet, Text, View, TouchableOpacity } from 'react-native';\n\nimport { ViewPropTypes, withTheme } from '../config';\nimport { renderNode } from '../helpers';\n\nconst Badge = props => {\n const {\n containerStyle,\n textStyle,\n badgeStyle,\n onPress,\n Component = onPress ? TouchableOpacity : View,\n value,\n theme,\n status,\n ...attributes\n } = props;\n\n const element = renderNode(Text, value, {\n style: StyleSheet.flatten([styles.text, textStyle && textStyle]),\n });\n\n return (\n \n \n {element}\n \n \n );\n};\n\nBadge.propTypes = {\n containerStyle: ViewPropTypes.style,\n badgeStyle: ViewPropTypes.style,\n textStyle: Text.propTypes.style,\n value: PropTypes.node,\n onPress: PropTypes.func,\n Component: PropTypes.func,\n theme: PropTypes.object,\n status: PropTypes.oneOf(['primary', 'success', 'warning', 'error']),\n};\n\nBadge.defaultProps = {\n status: 'primary',\n};\n\nconst size = 18;\nconst miniSize = 8;\n\nconst styles = {\n badge: (theme, status) => ({\n alignSelf: 'center',\n minWidth: size,\n height: size,\n borderRadius: size / 2,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors[status],\n borderWidth: StyleSheet.hairlineWidth,\n borderColor: '#fff',\n }),\n miniBadge: {\n paddingHorizontal: 0,\n paddingVertical: 0,\n minWidth: miniSize,\n height: miniSize,\n borderRadius: miniSize / 2,\n },\n text: {\n fontSize: 12,\n color: 'white',\n paddingHorizontal: 4,\n },\n};\n\nexport { Badge };\nexport default withTheme(Badge, 'Badge');\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABf5JREFUaAXNWU1sG0UUfmM7zm933UB/1KaGFsKPIFGlUKlKAkScaNoDlSgStL1CBIciDlQ9EYRUxIWeqiAQEodSUBEnGg5cKLVTIiUobdqqoo3aJiQNCcX1bn6d2B7m23iMnXrjWXtXypOsnZ1573vv25k383bNuBDyUGYvv2ih1+2OeOiFyOclejJ2ntJzV60f2l6Kp0SWps5mY89tZztdbHhGhCdGKRn7ORsq2ujzSjwjImcgsOlAZ6B+/34QkH1ekGFeJfvMYDPxpbFbWmv8aQRuXgr9yYLhxg0vDHvBw5tkR2LzxBhRsOEIY4zjR5Xbj6LPq6T3ZGllltB9rffQoHz82vk3BkT7vmfLC0vLTUkv3uVGVOdmJHRQkpBX9GEMOm6L6zMin/jU1qP/b1kZJrJP6kiCrlzdfjLmQBM3o9rndsFhDDpui6szIpM8EAyfsiOCMS+S3lUiiXtfIP471XuujdsRyYzdcXt5uUYEp3bKiBIj9j5jZFuIYgw6bp/0rhFJ3OuxJmHD9td+sZsN2S91pI3sL+fqGpGlqe8wDV+znd8sFgsIOtCFjVuyZomSMqNZP+nFMUrjtM5IavYq8ZRh3fGkYZXqVN3QqLdcH5E6a12NP557khbGb/lqm4gFdEuV+XXy1zVlzXyVYfJVhbP3fq09217dYMv//sQzSUoI1iotVmup3U9rbfGtVjmioC+2X2b2hf4WqpsV1B9SYTkkK7d1UQC7B5I0R0YZ0dk0owsstPe26I+ZhrbQkPhnmX7rSNNH3aJ2sktmYakoGcJbCqmLd1ZGH3czevmCb7xyU4Wmm9VCr57H+3f5OHWIZfmWeOCPpTIrZMmvEfHkAz4z1GaVFbFL4QOFgNdjH2JFuYPYwYHkCTt/s8u2RlpvRGTNhpilZImgIzFx2iJj9IU+6e7udm1Hc+tBICbEhplArLmSRwQDSH7j9x0g1MsHWyrcCqJcHMSCmBAbYlwtDxGBQmr2CjcHngeZkdhgy8reWG4kZdjHBnfpiAUxIbZCUpCIpZjZBMyovmj0NzSWEUdZpvCNGGRSFyKBPnsiGQu5CRhRbV9ZEZVgDJ9iJnhuUpdMBIaLoyetTeBBJPSBtceXEJQTE/iAL5CAbxUpOiMSZGnqzMomENFP825vPlqALLAN4QNJDZ+qokwEgEg0OBBr9kd+jvxOnrKKLjCBDR92SW1HzBERC0RsAtg94hH9nEpwTnSACWyc1E7F+aHnD4lqVfwYpZ0EqaILTGCT8OFUnBNJxa2S3UfM9RkBJr7ek/DhVBwTSWYq5aVgMz64uSoSU/pwAl4ykfq5VyadOFLRlZilEHGc7DND7eJM0S6qBFaKDrDhw6k4m5FMfojXni9LCVLJhtFXpeSJIyJyytM1rXmvlEoBKioF61utPxulL0UzZye0BA/tPjih4iAW3Rg2+/Qf8ENbxabqmRVs6UvFBjoOZ6RP1BB0g7F3ltdyEI+EN+Jw81N6NNhw/HX80EYfxtaytbCFj6QhfDkR5aQSpy2KuHif/qEdPueH/EYkdAx6s8OdeX8f4K8E9GEMOtC1w4EP6Dk54ZV3LevNUYCbQ/vaCgUQu9TQJIq9yWLFXk7xOQmbQljm5VfbQaTQm6Ddg1deWnLNBh5tu5vrnF/vqBNOv/enZ4Yrtry5VdszTBWbD+eq5LUxZukIXdgYffpZYOQqBR5pv4N76TN3zLZtx3B1/8r5ofPp6V8tp5y/XRGP6l14cij0kvGLq02K3sMGtsAAFjARKHygz8l5suYn0yx7cX6Y/Y9btzVPffvS/Mh7zYzHT4kXoIrKHcepMnwiq+q4IbATEz2U+OszFKLLaZ92rPaJnmvzNw9fBJa2965SEalEBH/gzN84khejX2uj6l2fkq+2Oa+/1Jv03DAt3D5BKTN/t6p59gwF6ot/N1TKkby1Kj5PVu08SbVNva6RAHk8EGACm/AJNCN5vmVngasSEXxthwTqO61EDW57twCUO13AxmYAXxDpuxi60tICCKberWVULCg57sSnMhEJvl6vSktrvQafG9d/GVVRLAprwWoAAAAASUVORK5CYII=\"","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = undefined;\n\nvar _exenv = require(\"exenv\");\n\nvar _exenv2 = _interopRequireDefault(_exenv);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar EE = _exenv2.default;\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\nexports.default = SafeHTMLElement;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedValue from '../nodes/AnimatedValue';\nimport AnimatedValueXY from '../nodes/AnimatedValueXY';\nimport Animation from './Animation';\nimport SpringConfig from '../SpringConfig';\nimport invariant from 'fbjs/lib/invariant';\nimport { shouldUseNativeDriver } from '../NativeAnimatedHelper';\n\nfunction withDefault(value, defaultValue) {\n if (value === undefined || value === null) {\n return defaultValue;\n }\n\n return value;\n}\n\nvar SpringAnimation =\n/*#__PURE__*/\nfunction (_Animation) {\n _inheritsLoose(SpringAnimation, _Animation);\n\n function SpringAnimation(config) {\n var _this;\n\n _this = _Animation.call(this) || this;\n _this._overshootClamping = withDefault(config.overshootClamping, false);\n _this._restDisplacementThreshold = withDefault(config.restDisplacementThreshold, 0.001);\n _this._restSpeedThreshold = withDefault(config.restSpeedThreshold, 0.001);\n _this._initialVelocity = withDefault(config.velocity, 0);\n _this._lastVelocity = withDefault(config.velocity, 0);\n _this._toValue = config.toValue;\n _this._delay = withDefault(config.delay, 0);\n _this._useNativeDriver = shouldUseNativeDriver(config);\n _this.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true;\n _this.__iterations = config.iterations !== undefined ? config.iterations : 1;\n\n if (config.stiffness !== undefined || config.damping !== undefined || config.mass !== undefined) {\n invariant(config.bounciness === undefined && config.speed === undefined && config.tension === undefined && config.friction === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');\n _this._stiffness = withDefault(config.stiffness, 100);\n _this._damping = withDefault(config.damping, 10);\n _this._mass = withDefault(config.mass, 1);\n } else if (config.bounciness !== undefined || config.speed !== undefined) {\n // Convert the origami bounciness/speed values to stiffness/damping\n // We assume mass is 1.\n invariant(config.tension === undefined && config.friction === undefined && config.stiffness === undefined && config.damping === undefined && config.mass === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');\n var springConfig = SpringConfig.fromBouncinessAndSpeed(withDefault(config.bounciness, 8), withDefault(config.speed, 12));\n _this._stiffness = springConfig.stiffness;\n _this._damping = springConfig.damping;\n _this._mass = 1;\n } else {\n // Convert the origami tension/friction values to stiffness/damping\n // We assume mass is 1.\n var _springConfig = SpringConfig.fromOrigamiTensionAndFriction(withDefault(config.tension, 40), withDefault(config.friction, 7));\n\n _this._stiffness = _springConfig.stiffness;\n _this._damping = _springConfig.damping;\n _this._mass = 1;\n }\n\n invariant(_this._stiffness > 0, 'Stiffness value must be greater than 0');\n invariant(_this._damping > 0, 'Damping value must be greater than 0');\n invariant(_this._mass > 0, 'Mass value must be greater than 0');\n return _this;\n }\n\n var _proto = SpringAnimation.prototype;\n\n _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n return {\n type: 'spring',\n overshootClamping: this._overshootClamping,\n restDisplacementThreshold: this._restDisplacementThreshold,\n restSpeedThreshold: this._restSpeedThreshold,\n stiffness: this._stiffness,\n damping: this._damping,\n mass: this._mass,\n initialVelocity: withDefault(this._initialVelocity, this._lastVelocity),\n toValue: this._toValue,\n iterations: this.__iterations\n };\n };\n\n _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n var _this2 = this;\n\n this.__active = true;\n this._startPosition = fromValue;\n this._lastPosition = this._startPosition;\n this._onUpdate = onUpdate;\n this.__onEnd = onEnd;\n this._lastTime = Date.now();\n this._frameTime = 0.0;\n\n if (previousAnimation instanceof SpringAnimation) {\n var internalState = previousAnimation.getInternalState();\n this._lastPosition = internalState.lastPosition;\n this._lastVelocity = internalState.lastVelocity; // Set the initial velocity to the last velocity\n\n this._initialVelocity = this._lastVelocity;\n this._lastTime = internalState.lastTime;\n }\n\n var start = function start() {\n if (_this2._useNativeDriver) {\n _this2.__startNativeAnimation(animatedValue);\n } else {\n _this2.onUpdate();\n }\n }; // If this._delay is more than 0, we start after the timeout.\n\n\n if (this._delay) {\n this._timeout = setTimeout(start, this._delay);\n } else {\n start();\n }\n };\n\n _proto.getInternalState = function getInternalState() {\n return {\n lastPosition: this._lastPosition,\n lastVelocity: this._lastVelocity,\n lastTime: this._lastTime\n };\n }\n /**\n * This spring model is based off of a damped harmonic oscillator\n * (https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator).\n *\n * We use the closed form of the second order differential equation:\n *\n * x'' + (2ζ⍵_0)x' + ⍵^2x = 0\n *\n * where\n * ⍵_0 = √(k / m) (undamped angular frequency of the oscillator),\n * ζ = c / 2√mk (damping ratio),\n * c = damping constant\n * k = stiffness\n * m = mass\n *\n * The derivation of the closed form is described in detail here:\n * http://planetmath.org/sites/default/files/texpdf/39745.pdf\n *\n * This algorithm happens to match the algorithm used by CASpringAnimation,\n * a QuartzCore (iOS) API that creates spring animations.\n */\n ;\n\n _proto.onUpdate = function onUpdate() {\n // If for some reason we lost a lot of frames (e.g. process large payload or\n // stopped in the debugger), we only advance by 4 frames worth of\n // computation and will continue on the next frame. It's better to have it\n // running at faster speed than jumping to the end.\n var MAX_STEPS = 64;\n var now = Date.now();\n\n if (now > this._lastTime + MAX_STEPS) {\n now = this._lastTime + MAX_STEPS;\n }\n\n var deltaTime = (now - this._lastTime) / 1000;\n this._frameTime += deltaTime;\n var c = this._damping;\n var m = this._mass;\n var k = this._stiffness;\n var v0 = -this._initialVelocity;\n var zeta = c / (2 * Math.sqrt(k * m)); // damping ratio\n\n var omega0 = Math.sqrt(k / m); // undamped angular frequency of the oscillator (rad/ms)\n\n var omega1 = omega0 * Math.sqrt(1.0 - zeta * zeta); // exponential decay\n\n var x0 = this._toValue - this._startPosition; // calculate the oscillation from x0 = 1 to x = 0\n\n var position = 0.0;\n var velocity = 0.0;\n var t = this._frameTime;\n\n if (zeta < 1) {\n // Under damped\n var envelope = Math.exp(-zeta * omega0 * t);\n position = this._toValue - envelope * ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t)); // This looks crazy -- it's actually just the derivative of the\n // oscillation function\n\n velocity = zeta * omega0 * envelope * (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t));\n } else {\n // Critically damped\n var _envelope = Math.exp(-omega0 * t);\n\n position = this._toValue - _envelope * (x0 + (v0 + omega0 * x0) * t);\n velocity = _envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0));\n }\n\n this._lastTime = now;\n this._lastPosition = position;\n this._lastVelocity = velocity;\n\n this._onUpdate(position);\n\n if (!this.__active) {\n // a listener might have stopped us in _onUpdate\n return;\n } // Conditions for stopping the spring animation\n\n\n var isOvershooting = false;\n\n if (this._overshootClamping && this._stiffness !== 0) {\n if (this._startPosition < this._toValue) {\n isOvershooting = position > this._toValue;\n } else {\n isOvershooting = position < this._toValue;\n }\n }\n\n var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold;\n\n var isDisplacement = true;\n\n if (this._stiffness !== 0) {\n isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold;\n }\n\n if (isOvershooting || isVelocity && isDisplacement) {\n if (this._stiffness !== 0) {\n // Ensure that we end up with a round value\n this._lastPosition = this._toValue;\n this._lastVelocity = 0;\n\n this._onUpdate(this._toValue);\n }\n\n this.__debouncedOnEnd({\n finished: true\n });\n\n return;\n }\n\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n };\n\n _proto.stop = function stop() {\n _Animation.prototype.stop.call(this);\n\n this.__active = false;\n clearTimeout(this._timeout);\n global.cancelAnimationFrame(this._animationFrame);\n\n this.__debouncedOnEnd({\n finished: false\n });\n };\n\n return SpringAnimation;\n}(Animation);\n\nexport default SpringAnimation;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n'use strict';\n\nfunction stiffnessFromOrigamiValue(oValue) {\n return (oValue - 30) * 3.62 + 194;\n}\n\nfunction dampingFromOrigamiValue(oValue) {\n return (oValue - 8) * 3 + 25;\n}\n\nfunction fromOrigamiTensionAndFriction(tension, friction) {\n return {\n stiffness: stiffnessFromOrigamiValue(tension),\n damping: dampingFromOrigamiValue(friction)\n };\n}\n\nfunction fromBouncinessAndSpeed(bounciness, speed) {\n function normalize(value, startValue, endValue) {\n return (value - startValue) / (endValue - startValue);\n }\n\n function projectNormal(n, start, end) {\n return start + n * (end - start);\n }\n\n function linearInterpolation(t, start, end) {\n return t * end + (1 - t) * start;\n }\n\n function quadraticOutInterpolation(t, start, end) {\n return linearInterpolation(2 * t - t * t, start, end);\n }\n\n function b3Friction1(x) {\n return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;\n }\n\n function b3Friction2(x) {\n return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2;\n }\n\n function b3Friction3(x) {\n return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84;\n }\n\n function b3Nobounce(tension) {\n if (tension <= 18) {\n return b3Friction1(tension);\n } else if (tension > 18 && tension <= 44) {\n return b3Friction2(tension);\n } else {\n return b3Friction3(tension);\n }\n }\n\n var b = normalize(bounciness / 1.7, 0, 20);\n b = projectNormal(b, 0, 0.8);\n var s = normalize(speed / 1.7, 0, 20);\n var bouncyTension = projectNormal(s, 0.5, 200);\n var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01);\n return {\n stiffness: stiffnessFromOrigamiValue(bouncyTension),\n damping: dampingFromOrigamiValue(bouncyFriction)\n };\n}\n\nexport { fromOrigamiTensionAndFriction, fromBouncinessAndSpeed };\nexport default {\n fromOrigamiTensionAndFriction: fromOrigamiTensionAndFriction,\n fromBouncinessAndSpeed: fromBouncinessAndSpeed\n};","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport AnimatedValue from '../nodes/AnimatedValue';\nimport AnimatedValueXY from '../nodes/AnimatedValueXY';\nimport Animation from './Animation';\nimport Easing from '../Easing';\nimport { shouldUseNativeDriver } from '../NativeAnimatedHelper';\n\nvar _easeInOut;\n\nfunction easeInOut() {\n if (!_easeInOut) {\n _easeInOut = Easing.inOut(Easing.ease);\n }\n\n return _easeInOut;\n}\n\nvar TimingAnimation =\n/*#__PURE__*/\nfunction (_Animation) {\n _inheritsLoose(TimingAnimation, _Animation);\n\n function TimingAnimation(config) {\n var _this;\n\n _this = _Animation.call(this) || this;\n _this._toValue = config.toValue;\n _this._easing = config.easing !== undefined ? config.easing : easeInOut();\n _this._duration = config.duration !== undefined ? config.duration : 500;\n _this._delay = config.delay !== undefined ? config.delay : 0;\n _this.__iterations = config.iterations !== undefined ? config.iterations : 1;\n _this.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true;\n _this._useNativeDriver = shouldUseNativeDriver(config);\n return _this;\n }\n\n var _proto = TimingAnimation.prototype;\n\n _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n var frameDuration = 1000.0 / 60.0;\n var frames = [];\n\n for (var dt = 0.0; dt < this._duration; dt += frameDuration) {\n frames.push(this._easing(dt / this._duration));\n }\n\n frames.push(this._easing(1));\n return {\n type: 'frames',\n frames: frames,\n toValue: this._toValue,\n iterations: this.__iterations\n };\n };\n\n _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n var _this2 = this;\n\n this.__active = true;\n this._fromValue = fromValue;\n this._onUpdate = onUpdate;\n this.__onEnd = onEnd;\n\n var start = function start() {\n // Animations that sometimes have 0 duration and sometimes do not\n // still need to use the native driver when duration is 0 so as to\n // not cause intermixed JS and native animations.\n if (_this2._duration === 0 && !_this2._useNativeDriver) {\n _this2._onUpdate(_this2._toValue);\n\n _this2.__debouncedOnEnd({\n finished: true\n });\n } else {\n _this2._startTime = Date.now();\n\n if (_this2._useNativeDriver) {\n _this2.__startNativeAnimation(animatedValue);\n } else {\n _this2._animationFrame = requestAnimationFrame(_this2.onUpdate.bind(_this2));\n }\n }\n };\n\n if (this._delay) {\n this._timeout = setTimeout(start, this._delay);\n } else {\n start();\n }\n };\n\n _proto.onUpdate = function onUpdate() {\n var now = Date.now();\n\n if (now >= this._startTime + this._duration) {\n if (this._duration === 0) {\n this._onUpdate(this._toValue);\n } else {\n this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));\n }\n\n this.__debouncedOnEnd({\n finished: true\n });\n\n return;\n }\n\n this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));\n\n if (this.__active) {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n };\n\n _proto.stop = function stop() {\n _Animation.prototype.stop.call(this);\n\n this.__active = false;\n clearTimeout(this._timeout);\n global.cancelAnimationFrame(this._animationFrame);\n\n this.__debouncedOnEnd({\n finished: false\n });\n };\n\n return TimingAnimation;\n}(Animation);\n\nexport default TimingAnimation;","\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nvar TouchEventUtils = {\n /**\n * Utility function for common case of extracting out the primary touch from a\n * touch event.\n * - `touchEnd` events usually do not have the `touches` property.\n * http://stackoverflow.com/questions/3666929/\n * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed\n *\n * @param {Event} nativeEvent Native event that may or may not be a touch.\n * @return {TouchesObject?} an object with pageX and pageY or null.\n */\n extractSingleTouch: function extractSingleTouch(nativeEvent) {\n var touches = nativeEvent.touches;\n var changedTouches = nativeEvent.changedTouches;\n var hasTouches = touches && touches.length > 0;\n var hasChangedTouches = changedTouches && changedTouches.length > 0;\n return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;\n }\n};\nmodule.exports = TouchEventUtils;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = capitalizeString;\n\nfunction capitalizeString(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n\n return descriptors;\n};\n\nvar formatRegExp = /%[sdj%]/g;\n\nexports.format = function (f) {\n if (!isString(f)) {\n var objects = [];\n\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function (x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n\n switch (x) {\n case '%s':\n return String(args[i++]);\n\n case '%d':\n return Number(args[i++]);\n\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n\n default:\n return x;\n }\n });\n\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n\n return str;\n}; // Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\n\n\nexports.deprecate = function (fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n } // Allow for deprecating things in the process of starting up.\n\n\n if (typeof process === 'undefined') {\n return function () {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n\n warned = true;\n }\n\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\nvar debugs = {};\nvar debugEnviron;\n\nexports.debuglog = function (set) {\n if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n\n debugs[set] = function () {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function () {};\n }\n }\n\n return debugs[set];\n};\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n\n/* legacy: obj, showHidden, depth, colors*/\n\n\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n }; // legacy...\n\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n } // set default options\n\n\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\nexports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n\ninspect.colors = {\n 'bold': [1, 22],\n 'italic': [3, 23],\n 'underline': [4, 24],\n 'inverse': [7, 27],\n 'white': [37, 39],\n 'grey': [90, 39],\n 'black': [30, 39],\n 'blue': [34, 39],\n 'cyan': [36, 39],\n 'green': [32, 39],\n 'magenta': [35, 39],\n 'red': [31, 39],\n 'yellow': [33, 39]\n}; // Don't use 'blue' not visible on cmd.exe\n\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return \"\\x1B[\" + inspect.colors[style][0] + 'm' + str + \"\\x1B[\" + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\nfunction arrayToHash(array) {\n var hash = {};\n array.forEach(function (val, idx) {\n hash[val] = true;\n });\n return hash;\n}\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n\n return ret;\n } // Primitive types cannot have properties\n\n\n var primitive = formatPrimitive(ctx, value);\n\n if (primitive) {\n return primitive;\n } // Look up the keys of the object.\n\n\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n } // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n\n\n if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n } // Some type of object without properties can be shortcutted.\n\n\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '',\n array = false,\n braces = ['{', '}']; // Make Array say that they are Array\n\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n } // Make functions say that they are functions\n\n\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n } // Make RegExps say that they are RegExps\n\n\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n } // Make dates with properties first say the date\n\n\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n } // Make error with message first say the error\n\n\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n var output;\n\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function (key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n return reduceToSingleString(output, base, braces);\n}\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');\n\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '').replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n\n if (isNumber(value)) return ctx.stylize('' + value, 'number');\n if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is \"object\", so special case here.\n\n if (isNull(value)) return ctx.stylize('null', 'null');\n}\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));\n } else {\n output.push('');\n }\n }\n\n keys.forEach(function (key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));\n }\n });\n return output;\n}\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n };\n\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function (line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function (line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n\n name = JSON.stringify('' + key);\n\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function (prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] + (base === '' ? '' : base + '\\n ') + ' ' + output.join(',\\n ') + ' ' + braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n} // NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\n\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\n\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\n\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexports.isPrimitive = isPrimitive;\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34\n\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n} // log is just a thin wrapper to console.log that prepends a timestamp\n\n\nexports.log = function () {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\n\n\nexports.inherits = require('inherits');\n\nexports._extend = function (origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n var keys = Object.keys(add);\n var i = keys.length;\n\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function') throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: false,\n writable: false,\n configurable: true\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\n\nexports.promisify.custom = kCustomPromisifiedSymbol;\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n } // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n\n\n function callbackified() {\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n\n var self = this;\n\n var cb = function cb() {\n return maybeCb.apply(self, arguments);\n }; // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n\n\n original.apply(this, args).then(function (ret) {\n process.nextTick(cb, null, ret);\n }, function (rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified, getOwnPropertyDescriptors(original));\n return callbackified;\n}\n\nexports.callbackify = callbackify;","function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n/**\n * Return a descriptor removing the value and returning a getter\n * The getter will return a .bind version of the function\n * and memoize the result against a symbol on the instance\n */\n\n\nexport function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new TypeError(\"@boundMethod decorator can only be applied to methods not: \".concat(_typeof(fn)));\n } // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n\n\n var definingProperty = false;\n return {\n configurable: true,\n get: function get() {\n // eslint-disable-next-line no-prototype-builtins\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}\n/**\n * Use boundMethod to bind all methods on the target.prototype\n */\n\nexport function boundClass(target) {\n // (Using reflect to get all keys including symbols)\n var keys; // Use Reflect if exists\n\n if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {\n keys = Reflect.ownKeys(target.prototype);\n } else {\n keys = Object.getOwnPropertyNames(target.prototype); // Use symbols if support is provided\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n keys = keys.concat(Object.getOwnPropertySymbols(target.prototype));\n }\n }\n\n keys.forEach(function (key) {\n // Ignore special case target method\n if (key === 'constructor') {\n return;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(target.prototype, key); // Only methods need binding\n\n if (typeof descriptor.value === 'function') {\n Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor));\n }\n });\n return target;\n}\nexport default function autobind() {\n if (arguments.length === 1) {\n return boundClass.apply(void 0, arguments);\n }\n\n return boundMethod.apply(void 0, arguments);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar incoming_message_1 = require(\"./incoming-message\");\n/**\n * Incoming SIP request message.\n */\n\n\nvar IncomingRequestMessage =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(IncomingRequestMessage, _super);\n\n function IncomingRequestMessage() {\n return _super.call(this) || this;\n }\n\n return IncomingRequestMessage;\n}(incoming_message_1.IncomingMessage);\n\nexports.IncomingRequestMessage = IncomingRequestMessage;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar incoming_message_1 = require(\"./incoming-message\");\n/**\n * Incoming SIP response message.\n */\n\n\nvar IncomingResponseMessage =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(IncomingResponseMessage, _super);\n\n function IncomingResponseMessage() {\n var _this = _super.call(this) || this;\n\n _this.headers = {};\n return _this;\n }\n\n return IncomingResponseMessage;\n}(incoming_message_1.IncomingMessage);\n\nexports.IncomingResponseMessage = IncomingResponseMessage;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar name_addr_header_1 = require(\"./name-addr-header\");\n\nvar utils_1 = require(\"./utils\");\n/**\n * Outgoing SIP request message.\n * @public\n */\n\n\nvar OutgoingRequestMessage =\n/** @class */\nfunction () {\n function OutgoingRequestMessage(method, ruri, fromURI, toURI, options, extraHeaders, body) {\n this.headers = {};\n this.extraHeaders = [];\n this.options = OutgoingRequestMessage.getDefaultOptions(); // Options - merge a deep copy\n\n if (options) {\n this.options = tslib_1.__assign({}, this.options, options);\n\n if (this.options.optionTags && this.options.optionTags.length) {\n this.options.optionTags = this.options.optionTags.slice();\n }\n\n if (this.options.routeSet && this.options.routeSet.length) {\n this.options.routeSet = this.options.routeSet.slice();\n }\n } // Extra headers - deep copy\n\n\n if (extraHeaders && extraHeaders.length) {\n this.extraHeaders = extraHeaders.slice();\n } // Body - deep copy\n\n\n if (body) {\n // TODO: internal representation should be Body\n // this.body = { ...body };\n this.body = {\n body: body.content,\n contentType: body.contentType\n };\n } // Method\n\n\n this.method = method; // RURI\n\n this.ruri = ruri.clone(); // From\n\n this.fromURI = fromURI.clone();\n this.fromTag = this.options.fromTag ? this.options.fromTag : utils_1.newTag();\n this.from = OutgoingRequestMessage.makeNameAddrHeader(this.fromURI, this.options.fromDisplayName, this.fromTag); // To\n\n this.toURI = toURI.clone();\n this.toTag = this.options.toTag;\n this.to = OutgoingRequestMessage.makeNameAddrHeader(this.toURI, this.options.toDisplayName, this.toTag); // Call-ID\n\n this.callId = this.options.callId ? this.options.callId : this.options.callIdPrefix + utils_1.createRandomToken(15); // CSeq\n\n this.cseq = this.options.cseq; // The relative order of header fields with different field names is not\n // significant. However, it is RECOMMENDED that header fields which are\n // needed for proxy processing (Via, Route, Record-Route, Proxy-Require,\n // Max-Forwards, and Proxy-Authorization, for example) appear towards\n // the top of the message to facilitate rapid parsing.\n // https://tools.ietf.org/html/rfc3261#section-7.3.1\n\n this.setHeader(\"route\", this.options.routeSet);\n this.setHeader(\"via\", \"\");\n this.setHeader(\"to\", this.to.toString());\n this.setHeader(\"from\", this.from.toString());\n this.setHeader(\"cseq\", this.cseq + \" \" + this.method);\n this.setHeader(\"call-id\", this.callId);\n this.setHeader(\"max-forwards\", \"70\");\n }\n /** Get a copy of the default options. */\n\n\n OutgoingRequestMessage.getDefaultOptions = function () {\n return {\n callId: \"\",\n callIdPrefix: \"\",\n cseq: 1,\n toDisplayName: \"\",\n toTag: \"\",\n fromDisplayName: \"\",\n fromTag: \"\",\n forceRport: false,\n hackViaTcp: false,\n optionTags: [\"outbound\"],\n routeSet: [],\n userAgentString: \"sip.js\",\n viaHost: \"\"\n };\n };\n\n OutgoingRequestMessage.makeNameAddrHeader = function (uri, displayName, tag) {\n var parameters = {};\n\n if (tag) {\n parameters.tag = tag;\n }\n\n return new name_addr_header_1.NameAddrHeader(uri, displayName, parameters);\n };\n /**\n * Get the value of the given header name at the given position.\n * @param name - header name\n * @returns Returns the specified header, undefined if header doesn't exist.\n */\n\n\n OutgoingRequestMessage.prototype.getHeader = function (name) {\n var header = this.headers[utils_1.headerize(name)];\n\n if (header) {\n if (header[0]) {\n return header[0];\n }\n } else {\n var regexp = new RegExp(\"^\\\\s*\" + name + \"\\\\s*:\", \"i\");\n\n for (var _i = 0, _a = this.extraHeaders; _i < _a.length; _i++) {\n var exHeader = _a[_i];\n\n if (regexp.test(exHeader)) {\n return exHeader.substring(exHeader.indexOf(\":\") + 1).trim();\n }\n }\n }\n\n return;\n };\n /**\n * Get the header/s of the given name.\n * @param name - header name\n * @returns Array with all the headers of the specified name.\n */\n\n\n OutgoingRequestMessage.prototype.getHeaders = function (name) {\n var result = [];\n var headerArray = this.headers[utils_1.headerize(name)];\n\n if (headerArray) {\n for (var _i = 0, headerArray_1 = headerArray; _i < headerArray_1.length; _i++) {\n var headerPart = headerArray_1[_i];\n result.push(headerPart);\n }\n } else {\n var regexp = new RegExp(\"^\\\\s*\" + name + \"\\\\s*:\", \"i\");\n\n for (var _a = 0, _b = this.extraHeaders; _a < _b.length; _a++) {\n var exHeader = _b[_a];\n\n if (regexp.test(exHeader)) {\n result.push(exHeader.substring(exHeader.indexOf(\":\") + 1).trim());\n }\n }\n }\n\n return result;\n };\n /**\n * Verify the existence of the given header.\n * @param name - header name\n * @returns true if header with given name exists, false otherwise\n */\n\n\n OutgoingRequestMessage.prototype.hasHeader = function (name) {\n if (this.headers[utils_1.headerize(name)]) {\n return true;\n } else {\n var regexp = new RegExp(\"^\\\\s*\" + name + \"\\\\s*:\", \"i\");\n\n for (var _i = 0, _a = this.extraHeaders; _i < _a.length; _i++) {\n var extraHeader = _a[_i];\n\n if (regexp.test(extraHeader)) {\n return true;\n }\n }\n }\n\n return false;\n };\n /**\n * Replace the the given header by the given value.\n * @param name - header name\n * @param value - header value\n */\n\n\n OutgoingRequestMessage.prototype.setHeader = function (name, value) {\n this.headers[utils_1.headerize(name)] = value instanceof Array ? value : [value];\n };\n /**\n * The Via header field indicates the transport used for the transaction\n * and identifies the location where the response is to be sent. A Via\n * header field value is added only after the transport that will be\n * used to reach the next hop has been selected (which may involve the\n * usage of the procedures in [4]).\n *\n * When the UAC creates a request, it MUST insert a Via into that\n * request. The protocol name and protocol version in the header field\n * MUST be SIP and 2.0, respectively. The Via header field value MUST\n * contain a branch parameter. This parameter is used to identify the\n * transaction created by that request. This parameter is used by both\n * the client and the server.\n * https://tools.ietf.org/html/rfc3261#section-8.1.1.7\n * @param branchParameter - The branch parameter.\n * @param scheme - The scheme.\n */\n\n\n OutgoingRequestMessage.prototype.setViaHeader = function (branch, scheme) {\n if (scheme === void 0) {\n scheme = \"WSS\";\n } // FIXME: Hack\n\n\n if (this.options.hackViaTcp) {\n scheme = \"TCP\";\n }\n\n var via = \"SIP/2.0/\" + scheme;\n via += \" \" + this.options.viaHost + \";branch=\" + branch;\n\n if (this.options.forceRport) {\n via += \";rport\";\n }\n\n this.setHeader(\"via\", via);\n this.branch = branch;\n };\n\n OutgoingRequestMessage.prototype.toString = function () {\n var msg = \"\";\n msg += this.method + \" \" + this.ruri.toRaw() + \" SIP/2.0\\r\\n\";\n\n for (var header in this.headers) {\n if (this.headers[header]) {\n for (var _i = 0, _a = this.headers[header]; _i < _a.length; _i++) {\n var headerPart = _a[_i];\n msg += header + \": \" + headerPart + \"\\r\\n\";\n }\n }\n }\n\n for (var _b = 0, _c = this.extraHeaders; _b < _c.length; _b++) {\n var header = _c[_b];\n msg += header.trim() + \"\\r\\n\";\n }\n\n msg += \"Supported: \" + this.options.optionTags.join(\", \") + \"\\r\\n\";\n msg += \"User-Agent: \" + this.options.userAgentString + \"\\r\\n\";\n\n if (this.body) {\n if (typeof this.body === \"string\") {\n msg += \"Content-Length: \" + utils_1.str_utf8_length(this.body) + \"\\r\\n\\r\\n\";\n msg += this.body;\n } else {\n if (this.body.body && this.body.contentType) {\n msg += \"Content-Type: \" + this.body.contentType + \"\\r\\n\";\n msg += \"Content-Length: \" + utils_1.str_utf8_length(this.body.body) + \"\\r\\n\\r\\n\";\n msg += this.body.body;\n } else {\n msg += \"Content-Length: \" + 0 + \"\\r\\n\\r\\n\";\n }\n }\n } else {\n msg += \"Content-Length: \" + 0 + \"\\r\\n\\r\\n\";\n }\n\n return msg;\n };\n\n return OutgoingRequestMessage;\n}();\n\nexports.OutgoingRequestMessage = OutgoingRequestMessage;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar timers_1 = require(\"../timers\");\n\nvar client_transaction_1 = require(\"./client-transaction\");\n\nvar transaction_state_1 = require(\"./transaction-state\");\n/**\n * INVITE Client Transaction\n *\n * The INVITE transaction consists of a three-way handshake. The client\n * transaction sends an INVITE, the server transaction sends responses,\n * and the client transaction sends an ACK.\n * https://tools.ietf.org/html/rfc3261#section-17.1.1\n */\n\n\nvar InviteClientTransaction =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(InviteClientTransaction, _super);\n /**\n * Constructor.\n * Upon construction, the outgoing request's Via header is updated by calling `setViaHeader`.\n * Then `toString` is called on the outgoing request and the message is sent via the transport.\n * After construction the transaction will be in the \"calling\" state and the transaction id\n * will equal the branch parameter set in the Via header of the outgoing request.\n * https://tools.ietf.org/html/rfc3261#section-17.1.1\n * @param request The outgoing INVITE request.\n * @param transport The transport.\n * @param user The transaction user.\n */\n\n\n function InviteClientTransaction(request, transport, user) {\n var _this = _super.call(this, request, transport, user, transaction_state_1.TransactionState.Calling, \"sip.transaction.ict\") || this;\n /**\n * Map of 2xx to-tag => ACK.\n * If value is not undefined, value is the ACK which was sent.\n * If key exists but value is undefined, a 2xx was received but the ACK not yet sent.\n * Otherwise, a 2xx was not (yet) received for this transaction.\n */\n\n\n _this.ackRetransmissionCache = new Map(); // FIXME: Timer A for unreliable transport not implemented\n //\n // If an unreliable transport is being used, the client transaction\n // MUST start timer A with a value of T1. If a reliable transport is being used,\n // the client transaction SHOULD NOT start timer A (Timer A controls request retransmissions).\n // For any transport, the client transaction MUST start timer B with a value\n // of 64*T1 seconds (Timer B controls transaction timeouts).\n // https://tools.ietf.org/html/rfc3261#section-17.1.1.2\n //\n // While not spelled out in the RFC, Timer B is the maximum amount of time that a sender\n // will wait for an INVITE message to be acknowledged (a SIP response message is received).\n // So Timer B should be cleared when the transaction state proceeds from \"Calling\".\n\n _this.B = setTimeout(function () {\n return _this.timer_B();\n }, timers_1.Timers.TIMER_B);\n\n _this.send(request.toString()).catch(function (error) {\n _this.logTransportError(error, \"Failed to send initial outgoing request.\");\n });\n\n return _this;\n }\n /**\n * Destructor.\n */\n\n\n InviteClientTransaction.prototype.dispose = function () {\n if (this.B) {\n clearTimeout(this.B);\n this.B = undefined;\n }\n\n if (this.D) {\n clearTimeout(this.D);\n this.D = undefined;\n }\n\n if (this.M) {\n clearTimeout(this.M);\n this.M = undefined;\n }\n\n _super.prototype.dispose.call(this);\n };\n\n Object.defineProperty(InviteClientTransaction.prototype, \"kind\", {\n /** Transaction kind. Deprecated. */\n get: function get() {\n return \"ict\";\n },\n enumerable: true,\n configurable: true\n });\n /**\n * ACK a 2xx final response.\n *\n * The transaction includes the ACK only if the final response was not a 2xx response (the\n * transaction will generate and send the ACK to the transport automagically). If the\n * final response was a 2xx, the ACK is not considered part of the transaction (the\n * transaction user needs to generate and send the ACK).\n *\n * This library is not strictly RFC compliant with regard to ACK handling for 2xx final\n * responses. Specifically, retransmissions of ACKs to a 2xx final responses is handled\n * by the transaction layer (instead of the UAC core). The \"standard\" approach is for\n * the UAC core to receive all 2xx responses and manage sending ACK retransmissions to\n * the transport directly. Herein the transaction layer manages sending ACKs to 2xx responses\n * and any retransmissions of those ACKs as needed.\n *\n * @param ack The outgoing ACK request.\n */\n\n InviteClientTransaction.prototype.ackResponse = function (ack) {\n var _this = this;\n\n var toTag = ack.toTag;\n\n if (!toTag) {\n throw new Error(\"To tag undefined.\");\n }\n\n var id = \"z9hG4bK\" + Math.floor(Math.random() * 10000000); // FIXME: Transport's server property is not typed (as of writing this).\n\n var scheme = this.transport.server && this.transport.server.scheme ? this.transport.server.scheme : undefined;\n ack.setViaHeader(id, scheme);\n this.ackRetransmissionCache.set(toTag, ack); // Add to ACK retransmission cache\n\n this.send(ack.toString()).catch(function (error) {\n _this.logTransportError(error, \"Failed to send ACK to 2xx response.\");\n });\n };\n /**\n * Handler for incoming responses from the transport which match this transaction.\n * @param response The incoming response.\n */\n\n\n InviteClientTransaction.prototype.receiveResponse = function (response) {\n var _this = this;\n\n var statusCode = response.statusCode;\n\n if (!statusCode || statusCode < 100 || statusCode > 699) {\n throw new Error(\"Invalid status code \" + statusCode);\n }\n\n switch (this.state) {\n case transaction_state_1.TransactionState.Calling:\n // If the client transaction receives a provisional response while in\n // the \"Calling\" state, it transitions to the \"Proceeding\" state. In the\n // \"Proceeding\" state, the client transaction SHOULD NOT retransmit the\n // request any longer. Furthermore, the provisional response MUST be\n // passed to the TU. Any further provisional responses MUST be passed\n // up to the TU while in the \"Proceeding\" state.\n // https://tools.ietf.org/html/rfc3261#section-17.1.1.2\n if (statusCode >= 100 && statusCode <= 199) {\n this.stateTransition(transaction_state_1.TransactionState.Proceeding);\n\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n } // When a 2xx response is received while in either the \"Calling\" or\n // \"Proceeding\" states, the client transaction MUST transition to\n // the \"Accepted\" state... The 2xx response MUST be passed up to the TU.\n // The client transaction MUST NOT generate an ACK to the 2xx response -- its\n // handling is delegated to the TU. A UAC core will send an ACK to\n // the 2xx response using a new transaction.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n\n\n if (statusCode >= 200 && statusCode <= 299) {\n this.ackRetransmissionCache.set(response.toTag, undefined); // Prime the ACK cache\n\n this.stateTransition(transaction_state_1.TransactionState.Accepted);\n\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n } // When in either the \"Calling\" or \"Proceeding\" states, reception of\n // a response with status code from 300-699 MUST cause the client\n // transaction to transition to \"Completed\". The client transaction\n // MUST pass the received response up to the TU, and the client\n // transaction MUST generate an ACK request, even if the transport is\n // reliable (guidelines for constructing the ACK from the response\n // are given in Section 17.1.1.3), and then pass the ACK to the\n // transport layer for transmission. The ACK MUST be sent to the\n // same address, port, and transport to which the original request was sent.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n\n\n if (statusCode >= 300 && statusCode <= 699) {\n this.stateTransition(transaction_state_1.TransactionState.Completed);\n this.ack(response);\n\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n }\n\n break;\n\n case transaction_state_1.TransactionState.Proceeding:\n // In the \"Proceeding\" state, the client transaction SHOULD NOT retransmit the\n // request any longer. Furthermore, the provisional response MUST be\n // passed to the TU. Any further provisional responses MUST be passed\n // up to the TU while in the \"Proceeding\" state.\n // https://tools.ietf.org/html/rfc3261#section-17.1.1.2\n if (statusCode >= 100 && statusCode <= 199) {\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n } // When a 2xx response is received while in either the \"Calling\" or \"Proceeding\" states,\n // the client transaction MUST transition to the \"Accepted\" state...\n // The 2xx response MUST be passed up to the TU. The client\n // transaction MUST NOT generate an ACK to the 2xx response -- its\n // handling is delegated to the TU. A UAC core will send an ACK to\n // the 2xx response using a new transaction.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n\n\n if (statusCode >= 200 && statusCode <= 299) {\n this.ackRetransmissionCache.set(response.toTag, undefined); // Prime the ACK cache\n\n this.stateTransition(transaction_state_1.TransactionState.Accepted);\n\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n } // When in either the \"Calling\" or \"Proceeding\" states, reception of\n // a response with status code from 300-699 MUST cause the client\n // transaction to transition to \"Completed\". The client transaction\n // MUST pass the received response up to the TU, and the client\n // transaction MUST generate an ACK request, even if the transport is\n // reliable (guidelines for constructing the ACK from the response\n // are given in Section 17.1.1.3), and then pass the ACK to the\n // transport layer for transmission. The ACK MUST be sent to the\n // same address, port, and transport to which the original request was sent.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n\n\n if (statusCode >= 300 && statusCode <= 699) {\n this.stateTransition(transaction_state_1.TransactionState.Completed);\n this.ack(response);\n\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n }\n\n break;\n\n case transaction_state_1.TransactionState.Accepted:\n // The purpose of the \"Accepted\" state is to allow the client\n // transaction to continue to exist to receive, and pass to the TU,\n // any retransmissions of the 2xx response and any additional 2xx\n // responses from other branches of the INVITE if it forked\n // downstream. Timer M reflects the amount of time that the\n // transaction user will wait for such messages.\n //\n // Any 2xx responses that match this client transaction and that are\n // received while in the \"Accepted\" state MUST be passed up to the\n // TU. The client transaction MUST NOT generate an ACK to the 2xx\n // response. The client transaction takes no further action.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n if (statusCode >= 200 && statusCode <= 299) {\n // NOTE: This implementation herein is intentionally not RFC compliant.\n // While the first 2xx response for a given branch is passed up to the TU,\n // retransmissions of 2xx responses are absorbed and the ACK associated\n // with the original response is resent. This approach is taken because\n // our current transaction users are not currently in a good position to\n // deal with 2xx retransmission. This SHOULD NOT cause any compliance issues - ;)\n //\n // If we don't have a cache hit, pass the response to the TU.\n if (!this.ackRetransmissionCache.has(response.toTag)) {\n this.ackRetransmissionCache.set(response.toTag, undefined); // Prime the ACK cache\n\n if (this.user.receiveResponse) {\n this.user.receiveResponse(response);\n }\n\n return;\n } // If we have a cache hit, try pulling the ACK from cache and retransmitting it.\n\n\n var ack = this.ackRetransmissionCache.get(response.toTag);\n\n if (ack) {\n this.send(ack.toString()).catch(function (error) {\n _this.logTransportError(error, \"Failed to send retransmission of ACK to 2xx response.\");\n });\n return;\n } // If an ACK was not found in cache then we have received a retransmitted 2xx\n // response before the TU responded to the original response (we don't have an ACK yet).\n // So discard this response under the assumption that the TU will eventually\n // get us a ACK for the original response.\n\n\n return;\n }\n\n break;\n\n case transaction_state_1.TransactionState.Completed:\n // Any retransmissions of a response with status code 300-699 that\n // are received while in the \"Completed\" state MUST cause the ACK to\n // be re-passed to the transport layer for retransmission, but the\n // newly received response MUST NOT be passed up to the TU.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n if (statusCode >= 300 && statusCode <= 699) {\n this.ack(response);\n return;\n }\n\n break;\n\n case transaction_state_1.TransactionState.Terminated:\n break;\n\n default:\n throw new Error(\"Invalid state \" + this.state);\n } // Any response received that does not match an existing client\n // transaction state machine is simply dropped. (Implementations are,\n // of course, free to log or do other implementation-specific things\n // with such responses, but the implementer should be sure to consider\n // the impact of large numbers of malicious stray responses.)\n // https://tools.ietf.org/html/rfc6026#section-7.2\n\n\n var message = \"Received unexpected \" + statusCode + \" response while in state \" + this.state + \".\";\n this.logger.warn(message);\n return;\n };\n /**\n * The client transaction SHOULD inform the TU that a transport failure\n * has occurred, and the client transaction SHOULD transition directly\n * to the \"Terminated\" state. The TU will handle the failover\n * mechanisms described in [4].\n * https://tools.ietf.org/html/rfc3261#section-17.1.4\n * @param error The error.\n */\n\n\n InviteClientTransaction.prototype.onTransportError = function (error) {\n if (this.user.onTransportError) {\n this.user.onTransportError(error);\n }\n\n this.stateTransition(transaction_state_1.TransactionState.Terminated, true);\n };\n /** For logging. */\n\n\n InviteClientTransaction.prototype.typeToString = function () {\n return \"INVITE client transaction\";\n };\n\n InviteClientTransaction.prototype.ack = function (response) {\n var _this = this; // The ACK request constructed by the client transaction MUST contain\n // values for the Call-ID, From, and Request-URI that are equal to the\n // values of those header fields in the request passed to the transport\n // by the client transaction (call this the \"original request\"). The To\n // header field in the ACK MUST equal the To header field in the\n // response being acknowledged, and therefore will usually differ from\n // the To header field in the original request by the addition of the\n // tag parameter. The ACK MUST contain a single Via header field, and\n // this MUST be equal to the top Via header field of the original\n // request. The CSeq header field in the ACK MUST contain the same\n // value for the sequence number as was present in the original request,\n // but the method parameter MUST be equal to \"ACK\".\n //\n // If the INVITE request whose response is being acknowledged had Route\n // header fields, those header fields MUST appear in the ACK. This is\n // to ensure that the ACK can be routed properly through any downstream\n // stateless proxies.\n // https://tools.ietf.org/html/rfc3261#section-17.1.1.3\n\n\n var ruri = this.request.ruri;\n var callId = this.request.callId;\n var cseq = this.request.cseq;\n var from = this.request.getHeader(\"from\");\n var to = response.getHeader(\"to\");\n var via = this.request.getHeader(\"via\");\n var route = this.request.getHeader(\"route\");\n\n if (!from) {\n throw new Error(\"From undefined.\");\n }\n\n if (!to) {\n throw new Error(\"To undefined.\");\n }\n\n if (!via) {\n throw new Error(\"Via undefined.\");\n }\n\n var ack = \"ACK \" + ruri + \" SIP/2.0\\r\\n\";\n\n if (route) {\n ack += \"Route: \" + route + \"\\r\\n\";\n }\n\n ack += \"Via: \" + via + \"\\r\\n\";\n ack += \"To: \" + to + \"\\r\\n\";\n ack += \"From: \" + from + \"\\r\\n\";\n ack += \"Call-ID: \" + callId + \"\\r\\n\";\n ack += \"CSeq: \" + cseq + \" ACK\\r\\n\";\n ack += \"Max-Forwards: 70\\r\\n\";\n ack += \"Content-Length: 0\\r\\n\\r\\n\"; // TOOO: \"User-Agent\" header\n\n this.send(ack).catch(function (error) {\n _this.logTransportError(error, \"Failed to send ACK to non-2xx response.\");\n });\n return;\n };\n /**\n * Execute a state transition.\n * @param newState New state.\n */\n\n\n InviteClientTransaction.prototype.stateTransition = function (newState, dueToTransportError) {\n var _this = this;\n\n if (dueToTransportError === void 0) {\n dueToTransportError = false;\n } // Assert valid state transitions.\n\n\n var invalidStateTransition = function invalidStateTransition() {\n throw new Error(\"Invalid state transition from \" + _this.state + \" to \" + newState);\n };\n\n switch (newState) {\n case transaction_state_1.TransactionState.Calling:\n invalidStateTransition();\n break;\n\n case transaction_state_1.TransactionState.Proceeding:\n if (this.state !== transaction_state_1.TransactionState.Calling) {\n invalidStateTransition();\n }\n\n break;\n\n case transaction_state_1.TransactionState.Accepted:\n case transaction_state_1.TransactionState.Completed:\n if (this.state !== transaction_state_1.TransactionState.Calling && this.state !== transaction_state_1.TransactionState.Proceeding) {\n invalidStateTransition();\n }\n\n break;\n\n case transaction_state_1.TransactionState.Terminated:\n if (this.state !== transaction_state_1.TransactionState.Calling && this.state !== transaction_state_1.TransactionState.Accepted && this.state !== transaction_state_1.TransactionState.Completed) {\n if (!dueToTransportError) {\n invalidStateTransition();\n }\n }\n\n break;\n\n default:\n invalidStateTransition();\n } // While not spelled out in the RFC, Timer B is the maximum amount of time that a sender\n // will wait for an INVITE message to be acknowledged (a SIP response message is received).\n // So Timer B should be cleared when the transaction state proceeds from \"Calling\".\n\n\n if (this.B) {\n clearTimeout(this.B);\n this.B = undefined;\n }\n\n if (newState === transaction_state_1.TransactionState.Proceeding) {} // Timers have no effect on \"Proceeding\" state.\n // In the \"Proceeding\" state, the client transaction\n // SHOULD NOT retransmit the request any longer.\n // https://tools.ietf.org/html/rfc3261#section-17.1.1.2\n // The client transaction MUST start Timer D when it enters the \"Completed\" state\n // for any reason, with a value of at least 32 seconds for unreliable transports,\n // and a value of zero seconds for reliable transports.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n\n\n if (newState === transaction_state_1.TransactionState.Completed) {\n this.D = setTimeout(function () {\n return _this.timer_D();\n }, timers_1.Timers.TIMER_D);\n } // The client transaction MUST transition to the \"Accepted\" state,\n // and Timer M MUST be started with a value of 64*T1.\n // https://tools.ietf.org/html/rfc6026#section-8.4\n\n\n if (newState === transaction_state_1.TransactionState.Accepted) {\n this.M = setTimeout(function () {\n return _this.timer_M();\n }, timers_1.Timers.TIMER_M);\n } // Once the transaction is in the \"Terminated\" state, it MUST be destroyed immediately.\n // https://tools.ietf.org/html/rfc6026#section-8.7\n\n\n if (newState === transaction_state_1.TransactionState.Terminated) {\n this.dispose();\n } // Update state.\n\n\n this.setState(newState);\n };\n /**\n * When timer A fires, the client transaction MUST retransmit the\n * request by passing it to the transport layer, and MUST reset the\n * timer with a value of 2*T1.\n * When timer A fires 2*T1 seconds later, the request MUST be\n * retransmitted again (assuming the client transaction is still in this\n * state). This process MUST continue so that the request is\n * retransmitted with intervals that double after each transmission.\n * These retransmissions SHOULD only be done while the client\n * transaction is in the \"Calling\" state.\n * https://tools.ietf.org/html/rfc3261#section-17.1.1.2\n */\n\n\n InviteClientTransaction.prototype.timer_A = function () {// TODO\n };\n /**\n * If the client transaction is still in the \"Calling\" state when timer\n * B fires, the client transaction SHOULD inform the TU that a timeout\n * has occurred. The client transaction MUST NOT generate an ACK.\n * https://tools.ietf.org/html/rfc3261#section-17.1.1.2\n */\n\n\n InviteClientTransaction.prototype.timer_B = function () {\n this.logger.debug(\"Timer B expired for INVITE client transaction \" + this.id + \".\");\n\n if (this.state === transaction_state_1.TransactionState.Calling) {\n this.onRequestTimeout();\n this.stateTransition(transaction_state_1.TransactionState.Terminated);\n }\n };\n /**\n * If Timer D fires while the client transaction is in the \"Completed\" state,\n * the client transaction MUST move to the \"Terminated\" state.\n * https://tools.ietf.org/html/rfc6026#section-8.4\n */\n\n\n InviteClientTransaction.prototype.timer_D = function () {\n this.logger.debug(\"Timer D expired for INVITE client transaction \" + this.id + \".\");\n\n if (this.state === transaction_state_1.TransactionState.Completed) {\n this.stateTransition(transaction_state_1.TransactionState.Terminated);\n }\n };\n /**\n * If Timer M fires while the client transaction is in the \"Accepted\"\n * state, the client transaction MUST move to the \"Terminated\" state.\n * https://tools.ietf.org/html/rfc6026#section-8.4\n */\n\n\n InviteClientTransaction.prototype.timer_M = function () {\n this.logger.debug(\"Timer M expired for INVITE client transaction \" + this.id + \".\");\n\n if (this.state === transaction_state_1.TransactionState.Accepted) {\n this.stateTransition(transaction_state_1.TransactionState.Terminated);\n }\n };\n\n return InviteClientTransaction;\n}(client_transaction_1.ClientTransaction);\n\nexports.InviteClientTransaction = InviteClientTransaction;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_client_1 = require(\"./user-agent-client\");\n\nvar ByeUserAgentClient =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ByeUserAgentClient, _super);\n\n function ByeUserAgentClient(dialog, delegate, options) {\n var _this = this;\n\n var message = dialog.createOutgoingRequestMessage(messages_1.C.BYE, options);\n _this = _super.call(this, transactions_1.NonInviteClientTransaction, dialog.userAgentCore, message, delegate) || this;\n dialog.dispose();\n return _this;\n }\n\n return ByeUserAgentClient;\n}(user_agent_client_1.UserAgentClient);\n\nexports.ByeUserAgentClient = ByeUserAgentClient;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_server_1 = require(\"./user-agent-server\");\n\nvar ByeUserAgentServer =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ByeUserAgentServer, _super);\n\n function ByeUserAgentServer(dialog, message, delegate) {\n return _super.call(this, transactions_1.NonInviteServerTransaction, dialog.userAgentCore, message, delegate) || this;\n }\n\n return ByeUserAgentServer;\n}(user_agent_server_1.UserAgentServer);\n\nexports.ByeUserAgentServer = ByeUserAgentServer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_server_1 = require(\"./user-agent-server\");\n\nvar InfoUserAgentServer =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(InfoUserAgentServer, _super);\n\n function InfoUserAgentServer(dialog, message, delegate) {\n return _super.call(this, transactions_1.NonInviteServerTransaction, dialog.userAgentCore, message, delegate) || this;\n }\n\n return InfoUserAgentServer;\n}(user_agent_server_1.UserAgentServer);\n\nexports.InfoUserAgentServer = InfoUserAgentServer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_client_1 = require(\"./user-agent-client\");\n\nvar NotifyUserAgentClient =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(NotifyUserAgentClient, _super);\n\n function NotifyUserAgentClient(dialog, delegate, options) {\n var _this = this;\n\n var message = dialog.createOutgoingRequestMessage(messages_1.C.NOTIFY, options);\n _this = _super.call(this, transactions_1.NonInviteClientTransaction, dialog.userAgentCore, message, delegate) || this;\n return _this;\n }\n\n return NotifyUserAgentClient;\n}(user_agent_client_1.UserAgentClient);\n\nexports.NotifyUserAgentClient = NotifyUserAgentClient;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_client_1 = require(\"./user-agent-client\");\n\nvar PrackUserAgentClient =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(PrackUserAgentClient, _super);\n\n function PrackUserAgentClient(dialog, delegate, options) {\n var _this = this;\n\n var message = dialog.createOutgoingRequestMessage(messages_1.C.PRACK, options);\n _this = _super.call(this, transactions_1.NonInviteClientTransaction, dialog.userAgentCore, message, delegate) || this;\n dialog.signalingStateTransition(message);\n return _this;\n }\n\n return PrackUserAgentClient;\n}(user_agent_client_1.UserAgentClient);\n\nexports.PrackUserAgentClient = PrackUserAgentClient;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_server_1 = require(\"./user-agent-server\");\n\nvar PrackUserAgentServer =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(PrackUserAgentServer, _super);\n\n function PrackUserAgentServer(dialog, message, delegate) {\n var _this = _super.call(this, transactions_1.NonInviteServerTransaction, dialog.userAgentCore, message, delegate) || this; // Update dialog signaling state with offer/answer in body\n\n\n dialog.signalingStateTransition(message);\n _this.dialog = dialog;\n return _this;\n }\n /**\n * Update the dialog signaling state on a 2xx response.\n * @param options Options bucket.\n */\n\n\n PrackUserAgentServer.prototype.accept = function (options) {\n if (options === void 0) {\n options = {\n statusCode: 200\n };\n }\n\n if (options.body) {\n // Update dialog signaling state with offer/answer in body\n this.dialog.signalingStateTransition(options.body);\n }\n\n return _super.prototype.accept.call(this, options);\n };\n\n return PrackUserAgentServer;\n}(user_agent_server_1.UserAgentServer);\n\nexports.PrackUserAgentServer = PrackUserAgentServer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_client_1 = require(\"./user-agent-client\");\n/**\n * 14 Modifying an Existing Session\n * https://tools.ietf.org/html/rfc3261#section-14\n * 14.1 UAC Behavior\n * https://tools.ietf.org/html/rfc3261#section-14.1\n */\n\n\nvar ReInviteUserAgentClient =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReInviteUserAgentClient, _super);\n\n function ReInviteUserAgentClient(dialog, delegate, options) {\n var _this = this;\n\n var message = dialog.createOutgoingRequestMessage(messages_1.C.INVITE, options);\n _this = _super.call(this, transactions_1.InviteClientTransaction, dialog.userAgentCore, message, delegate) || this;\n _this.delegate = delegate;\n dialog.signalingStateTransition(message); // FIXME: TODO: next line obviously needs to be improved...\n\n dialog.reinviteUserAgentClient = _this; // let the dialog know re-invite request sent\n\n _this.dialog = dialog;\n return _this;\n }\n\n ReInviteUserAgentClient.prototype.receiveResponse = function (message) {\n var _this = this;\n\n var statusCode = message.statusCode ? message.statusCode.toString() : \"\";\n\n if (!statusCode) {\n throw new Error(\"Response status code undefined.\");\n }\n\n switch (true) {\n case /^100$/.test(statusCode):\n if (this.delegate && this.delegate.onTrying) {\n this.delegate.onTrying({\n message: message\n });\n }\n\n break;\n\n case /^1[0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onProgress) {\n this.delegate.onProgress({\n message: message,\n session: this.dialog,\n prack: function prack(options) {\n throw new Error(\"Unimplemented.\");\n }\n });\n }\n\n break;\n\n case /^2[0-9]{2}$/.test(statusCode):\n // Update dialog signaling state with offer/answer in body\n this.dialog.signalingStateTransition(message);\n\n if (this.delegate && this.delegate.onAccept) {\n this.delegate.onAccept({\n message: message,\n session: this.dialog,\n ack: function ack(options) {\n var outgoingAckRequest = _this.dialog.ack(options);\n\n return outgoingAckRequest;\n }\n });\n }\n\n break;\n\n case /^3[0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onRedirect) {\n this.delegate.onRedirect({\n message: message\n });\n }\n\n break;\n\n case /^[4-6][0-9]{2}$/.test(statusCode):\n if (this.delegate && this.delegate.onReject) {\n this.delegate.onReject({\n message: message\n });\n } else {// If a UA receives a non-2xx final response to a re-INVITE, the session\n // parameters MUST remain unchanged, as if no re-INVITE had been issued.\n // Note that, as stated in Section 12.2.1.2, if the non-2xx final\n // response is a 481 (Call/Transaction Does Not Exist), or a 408\n // (Request Timeout), or no response at all is received for the re-\n // INVITE (that is, a timeout is returned by the INVITE client\n // transaction), the UAC will terminate the dialog.\n //\n // If a UAC receives a 491 response to a re-INVITE, it SHOULD start a\n // timer with a value T chosen as follows:\n //\n // 1. If the UAC is the owner of the Call-ID of the dialog ID\n // (meaning it generated the value), T has a randomly chosen value\n // between 2.1 and 4 seconds in units of 10 ms.\n //\n // 2. If the UAC is not the owner of the Call-ID of the dialog ID, T\n // has a randomly chosen value of between 0 and 2 seconds in units\n // of 10 ms.\n //\n // When the timer fires, the UAC SHOULD attempt the re-INVITE once more,\n // if it still desires for that session modification to take place. For\n // example, if the call was already hung up with a BYE, the re-INVITE\n // would not take place.\n // https://tools.ietf.org/html/rfc3261#section-14.1\n // FIXME: TODO: The above.\n }\n\n break;\n\n default:\n throw new Error(\"Invalid status code \" + statusCode);\n }\n };\n\n return ReInviteUserAgentClient;\n}(user_agent_client_1.UserAgentClient);\n\nexports.ReInviteUserAgentClient = ReInviteUserAgentClient;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_server_1 = require(\"./user-agent-server\");\n/**\n * 14 Modifying an Existing Session\n * https://tools.ietf.org/html/rfc3261#section-14\n * 14.2 UAS Behavior\n * https://tools.ietf.org/html/rfc3261#section-14.2\n */\n\n\nvar ReInviteUserAgentServer =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReInviteUserAgentServer, _super);\n\n function ReInviteUserAgentServer(dialog, message, delegate) {\n var _this = _super.call(this, transactions_1.InviteServerTransaction, dialog.userAgentCore, message, delegate) || this;\n\n dialog.reinviteUserAgentServer = _this;\n _this.dialog = dialog;\n return _this;\n }\n /**\n * Update the dialog signaling state on a 2xx response.\n * @param options Options bucket.\n */\n\n\n ReInviteUserAgentServer.prototype.accept = function (options) {\n if (options === void 0) {\n options = {\n statusCode: 200\n };\n } // FIXME: The next two lines SHOULD go away, but I suppose it's technically harmless...\n // These are here because some versions of SIP.js prior to 0.13.8 set the route set\n // of all in dialog ACKs based on the Record-Route headers in the associated 2xx\n // response. While this worked for dialog forming 2xx responses, it was technically\n // broken for re-INVITE ACKS as it only worked if the UAS populated the Record-Route\n // headers in the re-INVITE 2xx response (which is not required and a waste of bandwidth\n // as the should be ignored if present in re-INVITE ACKS) and the UAS populated\n // the Record-Route headers with the correct values (would be weird not too, but...).\n // Anyway, for now the technically useless Record-Route headers are being added\n // to maintain \"backwards compatibility\" with the older broken versions of SIP.js.\n\n\n options.extraHeaders = options.extraHeaders || [];\n options.extraHeaders = options.extraHeaders.concat(this.dialog.routeSet.map(function (route) {\n return \"Record-Route: \" + route;\n })); // Send and return the response\n\n var response = _super.prototype.accept.call(this, options);\n\n var session = this.dialog;\n\n var result = tslib_1.__assign({}, response, {\n session: session\n });\n\n if (options.body) {\n // Update dialog signaling state with offer/answer in body\n this.dialog.signalingStateTransition(options.body);\n } // Update dialog\n\n\n this.dialog.reConfirm();\n return result;\n };\n /**\n * Update the dialog signaling state on a 1xx response.\n * @param options Progress options bucket.\n */\n\n\n ReInviteUserAgentServer.prototype.progress = function (options) {\n if (options === void 0) {\n options = {\n statusCode: 180\n };\n } // Send and return the response\n\n\n var response = _super.prototype.progress.call(this, options);\n\n var session = this.dialog;\n\n var result = tslib_1.__assign({}, response, {\n session: session\n }); // Update dialog signaling state\n\n\n if (options.body) {\n this.dialog.signalingStateTransition(options.body);\n }\n\n return result;\n };\n\n return ReInviteUserAgentServer;\n}(user_agent_server_1.UserAgentServer);\n\nexports.ReInviteUserAgentServer = ReInviteUserAgentServer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_client_1 = require(\"./user-agent-client\");\n\nvar ReferUserAgentClient =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReferUserAgentClient, _super);\n\n function ReferUserAgentClient(dialog, delegate, options) {\n var _this = this;\n\n var message = dialog.createOutgoingRequestMessage(messages_1.C.REFER, options);\n _this = _super.call(this, transactions_1.NonInviteClientTransaction, dialog.userAgentCore, message, delegate) || this;\n return _this;\n }\n\n return ReferUserAgentClient;\n}(user_agent_client_1.UserAgentClient);\n\nexports.ReferUserAgentClient = ReferUserAgentClient;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_server_1 = require(\"./user-agent-server\");\n\nvar ReferUserAgentServer =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReferUserAgentServer, _super);\n /**\n * REFER UAS constructor.\n * @param dialogOrCore Dialog for in dialog REFER, UserAgentCore for out of dialog REFER.\n * @param message Incoming REFER request message.\n */\n\n\n function ReferUserAgentServer(dialogOrCore, message, delegate) {\n var _this = this;\n\n var userAgentCore = instanceOfSessionDialog(dialogOrCore) ? dialogOrCore.userAgentCore : dialogOrCore;\n _this = _super.call(this, transactions_1.NonInviteServerTransaction, userAgentCore, message, delegate) || this;\n return _this;\n }\n\n return ReferUserAgentServer;\n}(user_agent_server_1.UserAgentServer);\n\nexports.ReferUserAgentServer = ReferUserAgentServer;\n\nfunction instanceOfSessionDialog(object) {\n return object.userAgentCore !== undefined;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar subscription_1 = require(\"../subscription\");\n\nvar timers_1 = require(\"../timers\");\n\nvar allowed_methods_1 = require(\"../user-agent-core/allowed-methods\");\n\nvar notify_user_agent_server_1 = require(\"../user-agents/notify-user-agent-server\");\n\nvar re_subscribe_user_agent_client_1 = require(\"../user-agents/re-subscribe-user-agent-client\");\n\nvar dialog_1 = require(\"./dialog\");\n/**\n * SIP-Specific Event Notification\n *\n * Abstract\n *\n * This document describes an extension to the Session Initiation\n * Protocol (SIP) defined by RFC 3261. The purpose of this extension is\n * to provide an extensible framework by which SIP nodes can request\n * notification from remote nodes indicating that certain events have\n * occurred.\n *\n * Note that the event notification mechanisms defined herein are NOT\n * intended to be a general-purpose infrastructure for all classes of\n * event subscription and notification.\n *\n * This document represents a backwards-compatible improvement on the\n * original mechanism described by RFC 3265, taking into account several\n * years of implementation experience. Accordingly, this document\n * obsoletes RFC 3265. This document also updates RFC 4660 slightly to\n * accommodate some small changes to the mechanism that were discussed\n * in that document.\n *\n * https://tools.ietf.org/html/rfc6665\n */\n\n\nvar SubscriptionDialog =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(SubscriptionDialog, _super);\n\n function SubscriptionDialog(subscriptionEvent, subscriptionExpires, subscriptionState, core, state, delegate) {\n var _this = _super.call(this, core, state) || this;\n\n _this.delegate = delegate;\n _this._autoRefresh = false;\n _this._subscriptionEvent = subscriptionEvent;\n _this._subscriptionExpires = subscriptionExpires;\n _this._subscriptionExpiresInitial = subscriptionExpires;\n _this._subscriptionExpiresLastSet = Math.floor(Date.now() / 1000);\n _this._subscriptionRefresh = undefined;\n _this._subscriptionRefreshLastSet = undefined;\n _this._subscriptionState = subscriptionState;\n _this.logger = core.loggerFactory.getLogger(\"sip.subscribe-dialog\");\n\n _this.logger.log(\"SUBSCRIBE dialog \" + _this.id + \" constructed\");\n\n return _this;\n }\n /**\n * When a UAC receives a response that establishes a dialog, it\n * constructs the state of the dialog. This state MUST be maintained\n * for the duration of the dialog.\n * https://tools.ietf.org/html/rfc3261#section-12.1.2\n * @param outgoingRequestMessage Outgoing request message for dialog.\n * @param incomingResponseMessage Incoming response message creating dialog.\n */\n\n\n SubscriptionDialog.initialDialogStateForSubscription = function (outgoingSubscribeRequestMessage, incomingNotifyRequestMessage) {\n // If the request was sent over TLS, and the Request-URI contained a\n // SIPS URI, the \"secure\" flag is set to TRUE.\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n var secure = false; // FIXME: Currently no support for TLS.\n // The route set MUST be set to the list of URIs in the Record-Route\n // header field from the response, taken in reverse order and preserving\n // all URI parameters. If no Record-Route header field is present in\n // the response, the route set MUST be set to the empty set. This route\n // set, even if empty, overrides any pre-existing route set for future\n // requests in this dialog. The remote target MUST be set to the URI\n // from the Contact header field of the response.\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n\n var routeSet = incomingNotifyRequestMessage.getHeaders(\"record-route\");\n var contact = incomingNotifyRequestMessage.parseHeader(\"contact\");\n\n if (!contact) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"Contact undefined.\");\n }\n\n if (!(contact instanceof messages_1.NameAddrHeader)) {\n throw new Error(\"Contact not instance of NameAddrHeader.\");\n }\n\n var remoteTarget = contact.uri; // The local sequence number MUST be set to the value of the sequence\n // number in the CSeq header field of the request. The remote sequence\n // number MUST be empty (it is established when the remote UA sends a\n // request within the dialog). The call identifier component of the\n // dialog ID MUST be set to the value of the Call-ID in the request.\n // The local tag component of the dialog ID MUST be set to the tag in\n // the From field in the request, and the remote tag component of the\n // dialog ID MUST be set to the tag in the To field of the response. A\n // UAC MUST be prepared to receive a response without a tag in the To\n // field, in which case the tag is considered to have a value of null.\n //\n // This is to maintain backwards compatibility with RFC 2543, which\n // did not mandate To tags.\n //\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n\n var localSequenceNumber = outgoingSubscribeRequestMessage.cseq;\n var remoteSequenceNumber = undefined;\n var callId = outgoingSubscribeRequestMessage.callId;\n var localTag = outgoingSubscribeRequestMessage.fromTag;\n var remoteTag = incomingNotifyRequestMessage.fromTag;\n\n if (!callId) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"Call id undefined.\");\n }\n\n if (!localTag) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"From tag undefined.\");\n }\n\n if (!remoteTag) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"To tag undefined.\"); // FIXME: No backwards compatibility with RFC 2543\n } // The remote URI MUST be set to the URI in the To field, and the local\n // URI MUST be set to the URI in the From field.\n // https://tools.ietf.org/html/rfc3261#section-12.1.2\n\n\n if (!outgoingSubscribeRequestMessage.from) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"From undefined.\");\n }\n\n if (!outgoingSubscribeRequestMessage.to) {\n // TODO: Review to make sure this will never happen\n throw new Error(\"To undefined.\");\n }\n\n var localURI = outgoingSubscribeRequestMessage.from.uri;\n var remoteURI = outgoingSubscribeRequestMessage.to.uri; // A dialog can also be in the \"early\" state, which occurs when it is\n // created with a provisional response, and then transition to the\n // \"confirmed\" state when a 2xx final response arrives.\n // https://tools.ietf.org/html/rfc3261#section-12\n\n var early = false;\n var dialogState = {\n id: callId + localTag + remoteTag,\n early: early,\n callId: callId,\n localTag: localTag,\n remoteTag: remoteTag,\n localSequenceNumber: localSequenceNumber,\n remoteSequenceNumber: remoteSequenceNumber,\n localURI: localURI,\n remoteURI: remoteURI,\n remoteTarget: remoteTarget,\n routeSet: routeSet,\n secure: secure\n };\n return dialogState;\n };\n\n SubscriptionDialog.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n\n if (this.N) {\n clearTimeout(this.N);\n this.N = undefined;\n }\n\n this.refreshTimerClear();\n this.logger.log(\"SUBSCRIBE dialog \" + this.id + \" destroyed\");\n };\n\n Object.defineProperty(SubscriptionDialog.prototype, \"autoRefresh\", {\n get: function get() {\n return this._autoRefresh;\n },\n set: function set(autoRefresh) {\n this._autoRefresh = true;\n this.refreshTimerSet();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SubscriptionDialog.prototype, \"subscriptionEvent\", {\n get: function get() {\n return this._subscriptionEvent;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SubscriptionDialog.prototype, \"subscriptionExpires\", {\n /** Number of seconds until subscription expires. */\n get: function get() {\n var secondsSinceLastSet = Math.floor(Date.now() / 1000) - this._subscriptionExpiresLastSet;\n\n var secondsUntilExpires = this._subscriptionExpires - secondsSinceLastSet;\n return Math.max(secondsUntilExpires, 0);\n },\n set: function set(expires) {\n if (expires < 0) {\n throw new Error(\"Expires must be greater than or equal to zero.\");\n }\n\n this._subscriptionExpires = expires;\n this._subscriptionExpiresLastSet = Math.floor(Date.now() / 1000);\n\n if (this.autoRefresh) {\n var refresh = this.subscriptionRefresh;\n\n if (refresh === undefined || refresh >= expires) {\n this.refreshTimerSet();\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SubscriptionDialog.prototype, \"subscriptionExpiresInitial\", {\n get: function get() {\n return this._subscriptionExpiresInitial;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SubscriptionDialog.prototype, \"subscriptionRefresh\", {\n /** Number of seconds until subscription auto refresh. */\n get: function get() {\n if (this._subscriptionRefresh === undefined || this._subscriptionRefreshLastSet === undefined) {\n return undefined;\n }\n\n var secondsSinceLastSet = Math.floor(Date.now() / 1000) - this._subscriptionRefreshLastSet;\n\n var secondsUntilExpires = this._subscriptionRefresh - secondsSinceLastSet;\n return Math.max(secondsUntilExpires, 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SubscriptionDialog.prototype, \"subscriptionState\", {\n get: function get() {\n return this._subscriptionState;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Receive in dialog request message from transport.\n * @param message The incoming request message.\n */\n\n SubscriptionDialog.prototype.receiveRequest = function (message) {\n this.logger.log(\"SUBSCRIBE dialog \" + this.id + \" received \" + message.method + \" request\"); // Request within a dialog out of sequence guard.\n // https://tools.ietf.org/html/rfc3261#section-12.2.2\n\n if (!this.sequenceGuard(message)) {\n this.logger.log(\"SUBSCRIBE dialog \" + this.id + \" rejected out of order \" + message.method + \" request.\");\n return;\n } // Request within a dialog common processing.\n // https://tools.ietf.org/html/rfc3261#section-12.2.2\n\n\n _super.prototype.receiveRequest.call(this, message); // Switch on method and then delegate.\n\n\n switch (message.method) {\n case messages_1.C.NOTIFY:\n this.onNotify(message);\n break;\n\n default:\n this.logger.log(\"SUBSCRIBE dialog \" + this.id + \" received unimplemented \" + message.method + \" request\");\n this.core.replyStateless(message, {\n statusCode: 501\n });\n break;\n }\n };\n /**\n * 4.1.2.2. Refreshing of Subscriptions\n * https://tools.ietf.org/html/rfc6665#section-4.1.2.2\n */\n\n\n SubscriptionDialog.prototype.refresh = function () {\n var allowHeader = \"Allow: \" + allowed_methods_1.AllowedMethods.toString();\n var options = {};\n options.extraHeaders = (options.extraHeaders || []).slice();\n options.extraHeaders.push(allowHeader);\n options.extraHeaders.push(\"Event: \" + this.subscriptionEvent);\n options.extraHeaders.push(\"Expires: \" + this.subscriptionExpiresInitial);\n options.extraHeaders.push(\"Contact: \" + this.core.configuration.contact.toString());\n return this.subscribe(undefined, options);\n };\n /**\n * 4.1.2.2. Refreshing of Subscriptions\n * https://tools.ietf.org/html/rfc6665#section-4.1.2.2\n * @param delegate Delegate to handle responses.\n * @param options Options bucket.\n */\n\n\n SubscriptionDialog.prototype.subscribe = function (delegate, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (this.subscriptionState !== subscription_1.SubscriptionState.Pending && this.subscriptionState !== subscription_1.SubscriptionState.Active) {\n // FIXME: This needs to be a proper exception\n throw new Error(\"Invalid state \" + this.subscriptionState + \". May only re-subscribe while in state \\\"pending\\\" or \\\"active\\\".\");\n }\n\n this.logger.log(\"SUBSCRIBE dialog \" + this.id + \" sending SUBSCRIBE request\");\n var uac = new re_subscribe_user_agent_client_1.ReSubscribeUserAgentClient(this, delegate, options); // When refreshing a subscription, a subscriber starts Timer N, set to\n // 64*T1, when it sends the SUBSCRIBE request.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.2\n\n this.N = setTimeout(function () {\n return _this.timer_N();\n }, timers_1.Timers.TIMER_N);\n return uac;\n };\n /**\n * 4.4.1. Dialog Creation and Termination\n * A subscription is destroyed after a notifier sends a NOTIFY request\n * with a \"Subscription-State\" of \"terminated\", or in certain error\n * situations described elsewhere in this document.\n * https://tools.ietf.org/html/rfc6665#section-4.4.1\n */\n\n\n SubscriptionDialog.prototype.terminate = function () {\n this.stateTransition(subscription_1.SubscriptionState.Terminated);\n this.onTerminated();\n };\n /**\n * 4.1.2.3. Unsubscribing\n * https://tools.ietf.org/html/rfc6665#section-4.1.2.3\n */\n\n\n SubscriptionDialog.prototype.unsubscribe = function () {\n var allowHeader = \"Allow: \" + allowed_methods_1.AllowedMethods.toString();\n var options = {};\n options.extraHeaders = (options.extraHeaders || []).slice();\n options.extraHeaders.push(allowHeader);\n options.extraHeaders.push(\"Event: \" + this.subscriptionEvent);\n options.extraHeaders.push(\"Expires: 0\");\n options.extraHeaders.push(\"Contact: \" + this.core.configuration.contact.toString());\n return this.subscribe(undefined, options);\n };\n /**\n * Handle in dialog NOTIFY requests.\n * This does not include the first NOTIFY which created the dialog.\n * @param message The incoming NOTIFY request message.\n */\n\n\n SubscriptionDialog.prototype.onNotify = function (message) {\n // If, for some reason, the event package designated in the \"Event\"\n // header field of the NOTIFY request is not supported, the subscriber\n // will respond with a 489 (Bad Event) response.\n // https://tools.ietf.org/html/rfc6665#section-4.1.3\n var event = message.parseHeader(\"Event\").event;\n\n if (!event || event !== this.subscriptionEvent) {\n this.core.replyStateless(message, {\n statusCode: 489\n });\n return;\n } // In the state diagram, \"Re-subscription times out\" means that an\n // attempt to refresh or update the subscription using a new SUBSCRIBE\n // request does not result in a NOTIFY request before the corresponding\n // Timer N expires.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2\n\n\n if (this.N) {\n clearTimeout(this.N);\n this.N = undefined;\n } // NOTIFY requests MUST contain \"Subscription-State\" header fields that\n // indicate the status of the subscription.\n // https://tools.ietf.org/html/rfc6665#section-4.1.3\n\n\n var subscriptionState = message.parseHeader(\"Subscription-State\");\n\n if (!subscriptionState || !subscriptionState.state) {\n this.core.replyStateless(message, {\n statusCode: 489\n });\n return;\n }\n\n var state = subscriptionState.state;\n var expires = subscriptionState.expires ? Math.max(subscriptionState.expires, 0) : undefined; // Update our state and expiration.\n\n switch (state) {\n case \"pending\":\n this.stateTransition(subscription_1.SubscriptionState.Pending, expires);\n break;\n\n case \"active\":\n this.stateTransition(subscription_1.SubscriptionState.Active, expires);\n break;\n\n case \"terminated\":\n this.stateTransition(subscription_1.SubscriptionState.Terminated, expires);\n break;\n\n default:\n this.logger.warn(\"Unrecognized subscription state.\");\n break;\n } // Delegate remainder of NOTIFY handling.\n\n\n var uas = new notify_user_agent_server_1.NotifyUserAgentServer(this, message);\n\n if (this.delegate && this.delegate.onNotify) {\n this.delegate.onNotify(uas);\n } else {\n uas.accept();\n }\n };\n\n SubscriptionDialog.prototype.onRefresh = function (request) {\n if (this.delegate && this.delegate.onRefresh) {\n this.delegate.onRefresh(request);\n }\n };\n\n SubscriptionDialog.prototype.onTerminated = function () {\n if (this.delegate && this.delegate.onTerminated) {\n this.delegate.onTerminated();\n }\n };\n\n SubscriptionDialog.prototype.refreshTimerClear = function () {\n if (this.refreshTimer) {\n clearTimeout(this.refreshTimer);\n this.refreshTimer = undefined;\n }\n };\n\n SubscriptionDialog.prototype.refreshTimerSet = function () {\n var _this = this;\n\n this.refreshTimerClear();\n\n if (this.autoRefresh && this.subscriptionExpires > 0) {\n var refresh = this.subscriptionExpires * 900;\n this._subscriptionRefresh = Math.floor(refresh / 1000);\n this._subscriptionRefreshLastSet = Math.floor(Date.now() / 1000);\n this.refreshTimer = setTimeout(function () {\n _this.refreshTimer = undefined;\n _this._subscriptionRefresh = undefined;\n _this._subscriptionRefreshLastSet = undefined;\n\n _this.onRefresh(_this.refresh());\n }, refresh);\n }\n };\n\n SubscriptionDialog.prototype.stateTransition = function (newState, newExpires) {\n var _this = this; // Assert valid state transitions.\n\n\n var invalidStateTransition = function invalidStateTransition() {\n _this.logger.warn(\"Invalid subscription state transition from \" + _this.subscriptionState + \" to \" + newState);\n };\n\n switch (newState) {\n case subscription_1.SubscriptionState.Initial:\n invalidStateTransition();\n return;\n\n case subscription_1.SubscriptionState.NotifyWait:\n invalidStateTransition();\n return;\n\n case subscription_1.SubscriptionState.Pending:\n if (this.subscriptionState !== subscription_1.SubscriptionState.NotifyWait && this.subscriptionState !== subscription_1.SubscriptionState.Pending) {\n invalidStateTransition();\n return;\n }\n\n break;\n\n case subscription_1.SubscriptionState.Active:\n if (this.subscriptionState !== subscription_1.SubscriptionState.NotifyWait && this.subscriptionState !== subscription_1.SubscriptionState.Pending && this.subscriptionState !== subscription_1.SubscriptionState.Active) {\n invalidStateTransition();\n return;\n }\n\n break;\n\n case subscription_1.SubscriptionState.Terminated:\n if (this.subscriptionState !== subscription_1.SubscriptionState.NotifyWait && this.subscriptionState !== subscription_1.SubscriptionState.Pending && this.subscriptionState !== subscription_1.SubscriptionState.Active) {\n invalidStateTransition();\n return;\n }\n\n break;\n\n default:\n invalidStateTransition();\n return;\n } // If the \"Subscription-State\" value is \"pending\", the subscription has\n // been received by the notifier, but there is insufficient policy\n // information to grant or deny the subscription yet. If the header\n // field also contains an \"expires\" parameter, the subscriber SHOULD\n // take it as the authoritative subscription duration and adjust\n // accordingly. No further action is necessary on the part of the\n // subscriber. The \"retry-after\" and \"reason\" parameters have no\n // semantics for \"pending\".\n // https://tools.ietf.org/html/rfc6665#section-4.1.3\n\n\n if (newState === subscription_1.SubscriptionState.Pending) {\n if (newExpires) {\n this.subscriptionExpires = newExpires;\n }\n } // If the \"Subscription-State\" header field value is \"active\", it means\n // that the subscription has been accepted and (in general) has been\n // authorized. If the header field also contains an \"expires\"\n // parameter, the subscriber SHOULD take it as the authoritative\n // subscription duration and adjust accordingly. The \"retry-after\" and\n // \"reason\" parameters have no semantics for \"active\".\n // https://tools.ietf.org/html/rfc6665#section-4.1.3\n\n\n if (newState === subscription_1.SubscriptionState.Active) {\n if (newExpires) {\n this.subscriptionExpires = newExpires;\n }\n } // If the \"Subscription-State\" value is \"terminated\", the subscriber\n // MUST consider the subscription terminated. The \"expires\" parameter\n // has no semantics for \"terminated\" -- notifiers SHOULD NOT include an\n // \"expires\" parameter on a \"Subscription-State\" header field with a\n // value of \"terminated\", and subscribers MUST ignore any such\n // parameter, if present.\n\n\n if (newState === subscription_1.SubscriptionState.Terminated) {\n this.dispose();\n }\n\n this._subscriptionState = newState;\n };\n /**\n * When refreshing a subscription, a subscriber starts Timer N, set to\n * 64*T1, when it sends the SUBSCRIBE request. If this Timer N expires\n * prior to the receipt of a NOTIFY request, the subscriber considers\n * the subscription terminated. If the subscriber receives a success\n * response to the SUBSCRIBE request that indicates that no NOTIFY\n * request will be generated -- such as the 204 response defined for use\n * with the optional extension described in [RFC5839] -- then it MUST\n * cancel Timer N.\n * https://tools.ietf.org/html/rfc6665#section-4.1.2.2\n */\n\n\n SubscriptionDialog.prototype.timer_N = function () {\n if (this.subscriptionState !== subscription_1.SubscriptionState.Terminated) {\n this.stateTransition(subscription_1.SubscriptionState.Terminated);\n this.onTerminated();\n }\n };\n\n return SubscriptionDialog;\n}(dialog_1.Dialog);\n\nexports.SubscriptionDialog = SubscriptionDialog;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar messages_1 = require(\"../messages\");\n\nvar transactions_1 = require(\"../transactions\");\n\nvar user_agent_client_1 = require(\"./user-agent-client\");\n\nvar ReSubscribeUserAgentClient =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(ReSubscribeUserAgentClient, _super);\n\n function ReSubscribeUserAgentClient(dialog, delegate, options) {\n var _this = this;\n\n var message = dialog.createOutgoingRequestMessage(messages_1.C.SUBSCRIBE, options);\n _this = _super.call(this, transactions_1.NonInviteClientTransaction, dialog.userAgentCore, message, delegate) || this;\n _this.dialog = dialog;\n return _this;\n }\n\n ReSubscribeUserAgentClient.prototype.waitNotifyStop = function () {\n // TODO: Placeholder. Not utilized currently.\n return;\n };\n /**\n * Receive a response from the transaction layer.\n * @param message Incoming response message.\n */\n\n\n ReSubscribeUserAgentClient.prototype.receiveResponse = function (message) {\n if (message.statusCode && message.statusCode >= 200 && message.statusCode < 300) {\n // The \"Expires\" header field in a 200-class response to SUBSCRIBE\n // request indicates the actual duration for which the subscription will\n // remain active (unless refreshed). The received value might be\n // smaller than the value indicated in the SUBSCRIBE request but cannot\n // be larger; see Section 4.2.1 for details.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.1\n var expires = message.getHeader(\"Expires\");\n\n if (!expires) {\n this.logger.warn(\"Expires header missing in a 200-class response to SUBSCRIBE\");\n } else {\n var subscriptionExpiresReceived = Number(expires);\n\n if (this.dialog.subscriptionExpires > subscriptionExpiresReceived) {\n this.dialog.subscriptionExpires = subscriptionExpiresReceived;\n }\n }\n }\n\n if (message.statusCode && message.statusCode >= 400 && message.statusCode < 700) {\n // If a SUBSCRIBE request to refresh a subscription receives a 404, 405,\n // 410, 416, 480-485, 489, 501, or 604 response, the subscriber MUST\n // consider the subscription terminated. (See [RFC5057] for further\n // details and notes about the effect of error codes on dialogs and\n // usages within dialog, such as subscriptions). If the subscriber\n // wishes to re-subscribe to the state, he does so by composing an\n // unrelated initial SUBSCRIBE request with a freshly generated Call-ID\n // and a new, unique \"From\" tag (see Section 4.1.2.1).\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.2\n var errorCodes = [404, 405, 410, 416, 480, 481, 482, 483, 484, 485, 489, 501, 604];\n\n if (errorCodes.includes(message.statusCode)) {\n this.dialog.terminate();\n } // If a SUBSCRIBE request to refresh a subscription fails with any error\n // code other than those listed above, the original subscription is\n // still considered valid for the duration of the most recently known\n // \"Expires\" value as negotiated by the most recent successful SUBSCRIBE\n // transaction, or as communicated by a NOTIFY request in its\n // \"Subscription-State\" header field \"expires\" parameter.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.2\n\n }\n\n _super.prototype.receiveResponse.call(this, message);\n };\n\n return ReSubscribeUserAgentClient;\n}(user_agent_client_1.UserAgentClient);\n\nexports.ReSubscribeUserAgentClient = ReSubscribeUserAgentClient;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar levels_1 = require(\"./levels\");\n/**\n * Logger.\n * @public\n */\n\n\nvar Logger =\n/** @class */\nfunction () {\n function Logger(logger, category, label) {\n this.logger = logger;\n this.category = category;\n this.label = label;\n }\n\n Logger.prototype.error = function (content) {\n this.genericLog(levels_1.Levels.error, content);\n };\n\n Logger.prototype.warn = function (content) {\n this.genericLog(levels_1.Levels.warn, content);\n };\n\n Logger.prototype.log = function (content) {\n this.genericLog(levels_1.Levels.log, content);\n };\n\n Logger.prototype.debug = function (content) {\n this.genericLog(levels_1.Levels.debug, content);\n };\n\n Logger.prototype.genericLog = function (level, content) {\n this.logger.genericLog(level, this.category, this.label, content);\n };\n\n return Logger;\n}();\n\nexports.Logger = Logger;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\ntslib_1.__exportStar(require(\"./bye-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./bye-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./cancel-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./info-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./invite-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./invite-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./message-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./message-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./notify-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./notify-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./publish-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./prack-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./prack-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./re-invite-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./re-invite-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./re-subscribe-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./re-subscribe-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./refer-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./refer-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./register-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./subscribe-user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./subscribe-user-agent-server\"), exports);\n\ntslib_1.__exportStar(require(\"./user-agent-client\"), exports);\n\ntslib_1.__exportStar(require(\"./user-agent-server\"), exports);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar core_1 = require(\"./core\");\n/**\n * Extract and parse every header of a SIP message.\n * @namespace\n */\n\n\nvar Parser;\n\n(function (Parser) {\n function getHeader(data, headerStart) {\n // 'start' position of the header.\n var start = headerStart; // 'end' position of the header.\n\n var end = 0; // 'partial end' position of the header.\n\n var partialEnd = 0; // End of message.\n\n if (data.substring(start, start + 2).match(/(^\\r\\n)/)) {\n return -2;\n }\n\n while (end === 0) {\n // Partial End of Header.\n partialEnd = data.indexOf(\"\\r\\n\", start); // 'indexOf' returns -1 if the value to be found never occurs.\n\n if (partialEnd === -1) {\n return partialEnd;\n }\n\n if (!data.substring(partialEnd + 2, partialEnd + 4).match(/(^\\r\\n)/) && data.charAt(partialEnd + 2).match(/(^\\s+)/)) {\n // Not the end of the message. Continue from the next position.\n start = partialEnd + 2;\n } else {\n end = partialEnd;\n }\n }\n\n return end;\n }\n\n Parser.getHeader = getHeader;\n\n function parseHeader(message, data, headerStart, headerEnd) {\n var hcolonIndex = data.indexOf(\":\", headerStart);\n var headerName = data.substring(headerStart, hcolonIndex).trim();\n var headerValue = data.substring(hcolonIndex + 1, headerEnd).trim();\n var parsed; // If header-field is well-known, parse it.\n\n switch (headerName.toLowerCase()) {\n case \"via\":\n case \"v\":\n message.addHeader(\"via\", headerValue);\n\n if (message.getHeaders(\"via\").length === 1) {\n parsed = message.parseHeader(\"Via\");\n\n if (parsed) {\n message.via = parsed;\n message.viaBranch = parsed.branch;\n }\n } else {\n parsed = 0;\n }\n\n break;\n\n case \"from\":\n case \"f\":\n message.setHeader(\"from\", headerValue);\n parsed = message.parseHeader(\"from\");\n\n if (parsed) {\n message.from = parsed;\n message.fromTag = parsed.getParam(\"tag\");\n }\n\n break;\n\n case \"to\":\n case \"t\":\n message.setHeader(\"to\", headerValue);\n parsed = message.parseHeader(\"to\");\n\n if (parsed) {\n message.to = parsed;\n message.toTag = parsed.getParam(\"tag\");\n }\n\n break;\n\n case \"record-route\":\n parsed = core_1.Grammar.parse(headerValue, \"Record_Route\");\n\n if (parsed === -1) {\n parsed = undefined;\n break;\n }\n\n for (var header in parsed) {\n if (parsed[header]) {\n message.addHeader(\"record-route\", headerValue.substring(parsed[header].position, parsed[header].offset));\n message.headers[\"Record-Route\"][message.getHeaders(\"record-route\").length - 1].parsed = parsed[header].parsed;\n }\n }\n\n break;\n\n case \"call-id\":\n case \"i\":\n message.setHeader(\"call-id\", headerValue);\n parsed = message.parseHeader(\"call-id\");\n\n if (parsed) {\n message.callId = headerValue;\n }\n\n break;\n\n case \"contact\":\n case \"m\":\n parsed = core_1.Grammar.parse(headerValue, \"Contact\");\n\n if (parsed === -1) {\n parsed = undefined;\n break;\n }\n\n if (!(parsed instanceof Array)) {\n parsed = undefined;\n break;\n }\n\n parsed.forEach(function (header) {\n message.addHeader(\"contact\", headerValue.substring(header.position, header.offset));\n message.headers.Contact[message.getHeaders(\"contact\").length - 1].parsed = header.parsed;\n });\n break;\n\n case \"content-length\":\n case \"l\":\n message.setHeader(\"content-length\", headerValue);\n parsed = message.parseHeader(\"content-length\");\n break;\n\n case \"content-type\":\n case \"c\":\n message.setHeader(\"content-type\", headerValue);\n parsed = message.parseHeader(\"content-type\");\n break;\n\n case \"cseq\":\n message.setHeader(\"cseq\", headerValue);\n parsed = message.parseHeader(\"cseq\");\n\n if (parsed) {\n message.cseq = parsed.value;\n }\n\n if (message instanceof core_1.IncomingResponseMessage) {\n message.method = parsed.method;\n }\n\n break;\n\n case \"max-forwards\":\n message.setHeader(\"max-forwards\", headerValue);\n parsed = message.parseHeader(\"max-forwards\");\n break;\n\n case \"www-authenticate\":\n message.setHeader(\"www-authenticate\", headerValue);\n parsed = message.parseHeader(\"www-authenticate\");\n break;\n\n case \"proxy-authenticate\":\n message.setHeader(\"proxy-authenticate\", headerValue);\n parsed = message.parseHeader(\"proxy-authenticate\");\n break;\n\n case \"refer-to\":\n case \"r\":\n message.setHeader(\"refer-to\", headerValue);\n parsed = message.parseHeader(\"refer-to\");\n\n if (parsed) {\n message.referTo = parsed;\n }\n\n break;\n\n default:\n // Do not parse this header.\n message.setHeader(headerName, headerValue);\n parsed = 0;\n }\n\n if (parsed === undefined) {\n return {\n error: \"error parsing header '\" + headerName + \"'\"\n };\n } else {\n return true;\n }\n }\n\n Parser.parseHeader = parseHeader;\n /** Parse SIP Message\n * @function\n * @param {String} message SIP message.\n * @param {Object} logger object.\n * @returns {SIP.IncomingRequest|SIP.IncomingResponse|undefined}\n */\n\n function parseMessage(data, logger) {\n var headerStart = 0;\n var headerEnd = data.indexOf(\"\\r\\n\");\n\n if (headerEnd === -1) {\n logger.warn(\"no CRLF found, not a SIP message, discarded\");\n return;\n } // Parse first line. Check if it is a Request or a Reply.\n\n\n var firstLine = data.substring(0, headerEnd);\n var parsed = core_1.Grammar.parse(firstLine, \"Request_Response\");\n var message;\n\n if (parsed === -1) {\n logger.warn('error parsing first line of SIP message: \"' + firstLine + '\"');\n return;\n } else if (!parsed.status_code) {\n message = new core_1.IncomingRequestMessage();\n message.method = parsed.method;\n message.ruri = parsed.uri;\n } else {\n message = new core_1.IncomingResponseMessage();\n message.statusCode = parsed.status_code;\n message.reasonPhrase = parsed.reason_phrase;\n }\n\n message.data = data;\n headerStart = headerEnd + 2;\n /* Loop over every line in data. Detect the end of each header and parse\n * it or simply add to the headers collection.\n */\n\n var bodyStart;\n\n while (true) {\n headerEnd = getHeader(data, headerStart); // The SIP message has normally finished.\n\n if (headerEnd === -2) {\n bodyStart = headerStart + 2;\n break;\n } else if (headerEnd === -1) {\n // data.indexOf returned -1 due to a malformed message.\n logger.error(\"malformed message\");\n return;\n }\n\n var parsedHeader = parseHeader(message, data, headerStart, headerEnd);\n\n if (parsedHeader !== true) {\n logger.error(parsed.error);\n return;\n }\n\n headerStart = headerEnd + 2;\n }\n /* RFC3261 18.3.\n * If there are additional bytes in the transport packet\n * beyond the end of the body, they MUST be discarded.\n */\n\n\n if (message.hasHeader(\"content-length\")) {\n message.body = data.substr(bodyStart, Number(message.getHeader(\"content-length\")));\n } else {\n message.body = data.substring(bodyStart);\n }\n\n return message;\n }\n\n Parser.parseMessage = parseMessage;\n})(Parser = exports.Parser || (exports.Parser = {}));","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar ClientContext_1 = require(\"./ClientContext\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Exceptions_1 = require(\"./Exceptions\");\n\nvar Utils_1 = require(\"./Utils\");\n/**\n * SIP Publish (SIP Extension for Event State Publication RFC3903)\n * @class Class creating a SIP PublishContext.\n */\n\n\nvar PublishContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(PublishContext, _super);\n\n function PublishContext(ua, target, event, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = this;\n\n options.extraHeaders = (options.extraHeaders || []).slice();\n options.contentType = options.contentType || \"text/plain\";\n\n if (typeof options.expires !== \"number\" || options.expires % 1 !== 0) {\n options.expires = 3600;\n } else {\n options.expires = Number(options.expires);\n }\n\n if (typeof options.unpublishOnClose !== \"boolean\") {\n options.unpublishOnClose = true;\n }\n\n if (target === undefined || target === null || target === \"\") {\n throw new Exceptions_1.Exceptions.MethodParameterError(\"Publish\", \"Target\", target);\n } else {\n target = ua.normalizeTarget(target);\n\n if (target === undefined) {\n throw new Exceptions_1.Exceptions.MethodParameterError(\"Publish\", \"Target\", target);\n }\n }\n\n _this = _super.call(this, ua, Constants_1.C.PUBLISH, target, options) || this;\n _this.type = Enums_1.TypeStrings.PublishContext;\n _this.options = options;\n _this.target = target;\n\n if (event === undefined || event === null || event === \"\") {\n throw new Exceptions_1.Exceptions.MethodParameterError(\"Publish\", \"Event\", event);\n } else {\n _this.event = event;\n }\n\n _this.logger = ua.getLogger(\"sip.publish\");\n _this.pubRequestExpires = _this.options.expires;\n return _this;\n }\n /**\n * Publish\n * @param {string} Event body to publish, optional\n */\n\n\n PublishContext.prototype.publish = function (body) {\n // Clean up before the run\n if (this.publishRefreshTimer) {\n clearTimeout(this.publishRefreshTimer);\n this.publishRefreshTimer = undefined;\n } // is Inital or Modify request\n\n\n this.options.body = body;\n this.pubRequestBody = this.options.body;\n\n if (this.pubRequestExpires === 0) {\n // This is Initial request after unpublish\n this.pubRequestExpires = this.options.expires;\n this.pubRequestEtag = undefined;\n }\n\n if (!this.ua.publishers[this.target.toString() + \":\" + this.event]) {\n this.ua.publishers[this.target.toString() + \":\" + this.event] = this;\n }\n\n this.sendPublishRequest();\n };\n /**\n * Unpublish\n */\n\n\n PublishContext.prototype.unpublish = function () {\n // Clean up before the run\n if (this.publishRefreshTimer) {\n clearTimeout(this.publishRefreshTimer);\n this.publishRefreshTimer = undefined;\n }\n\n this.pubRequestBody = undefined;\n this.pubRequestExpires = 0;\n\n if (this.pubRequestEtag !== undefined) {\n this.sendPublishRequest();\n }\n };\n /**\n * Close\n */\n\n\n PublishContext.prototype.close = function () {\n // Send unpublish, if requested\n if (this.options.unpublishOnClose) {\n this.unpublish();\n } else {\n if (this.publishRefreshTimer) {\n clearTimeout(this.publishRefreshTimer);\n this.publishRefreshTimer = undefined;\n }\n\n this.pubRequestBody = undefined;\n this.pubRequestExpires = 0;\n this.pubRequestEtag = undefined;\n }\n\n if (this.ua.publishers[this.target.toString() + \":\" + this.event]) {\n delete this.ua.publishers[this.target.toString() + \":\" + this.event];\n }\n };\n\n PublishContext.prototype.onRequestTimeout = function () {\n _super.prototype.onRequestTimeout.call(this);\n\n this.emit(\"unpublished\", undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n };\n\n PublishContext.prototype.onTransportError = function () {\n _super.prototype.onTransportError.call(this);\n\n this.emit(\"unpublished\", undefined, Constants_1.C.causes.CONNECTION_ERROR);\n };\n\n PublishContext.prototype.receiveResponse = function (response) {\n var _this = this;\n\n var statusCode = response.statusCode || 0;\n var cause = Utils_1.Utils.getReasonPhrase(statusCode);\n\n switch (true) {\n case /^1[0-9]{2}$/.test(statusCode.toString()):\n this.emit(\"progress\", response, cause);\n break;\n\n case /^2[0-9]{2}$/.test(statusCode.toString()):\n // Set SIP-Etag\n if (response.hasHeader(\"SIP-ETag\")) {\n this.pubRequestEtag = response.getHeader(\"SIP-ETag\");\n } else {\n this.logger.warn(\"SIP-ETag header missing in a 200-class response to PUBLISH\");\n } // Update Expire\n\n\n if (response.hasHeader(\"Expires\")) {\n var expires = Number(response.getHeader(\"Expires\"));\n\n if (typeof expires === \"number\" && expires >= 0 && expires <= this.pubRequestExpires) {\n this.pubRequestExpires = expires;\n } else {\n this.logger.warn(\"Bad Expires header in a 200-class response to PUBLISH\");\n }\n } else {\n this.logger.warn(\"Expires header missing in a 200-class response to PUBLISH\");\n }\n\n if (this.pubRequestExpires !== 0) {\n // Schedule refresh\n this.publishRefreshTimer = setTimeout(function () {\n return _this.refreshRequest();\n }, this.pubRequestExpires * 900);\n this.emit(\"published\", response, cause);\n } else {\n this.emit(\"unpublished\", response, cause);\n }\n\n break;\n\n case /^412$/.test(statusCode.toString()):\n // 412 code means no matching ETag - possibly the PUBLISH expired\n // Resubmit as new request, if the current request is not a \"remove\"\n if (this.pubRequestEtag !== undefined && this.pubRequestExpires !== 0) {\n this.logger.warn(\"412 response to PUBLISH, recovering\");\n this.pubRequestEtag = undefined;\n this.emit(\"progress\", response, cause);\n this.publish(this.options.body);\n } else {\n this.logger.warn(\"412 response to PUBLISH, recovery failed\");\n this.pubRequestExpires = 0;\n this.emit(\"failed\", response, cause);\n this.emit(\"unpublished\", response, cause);\n }\n\n break;\n\n case /^423$/.test(statusCode.toString()):\n // 423 code means we need to adjust the Expires interval up\n if (this.pubRequestExpires !== 0 && response.hasHeader(\"Min-Expires\")) {\n var minExpires = Number(response.getHeader(\"Min-Expires\"));\n\n if (typeof minExpires === \"number\" || minExpires > this.pubRequestExpires) {\n this.logger.warn(\"423 code in response to PUBLISH, adjusting the Expires value and trying to recover\");\n this.pubRequestExpires = minExpires;\n this.emit(\"progress\", response, cause);\n this.publish(this.options.body);\n } else {\n this.logger.warn(\"Bad 423 response Min-Expires header received for PUBLISH\");\n this.pubRequestExpires = 0;\n this.emit(\"failed\", response, cause);\n this.emit(\"unpublished\", response, cause);\n }\n } else {\n this.logger.warn(\"423 response to PUBLISH, recovery failed\");\n this.pubRequestExpires = 0;\n this.emit(\"failed\", response, cause);\n this.emit(\"unpublished\", response, cause);\n }\n\n break;\n\n default:\n this.pubRequestExpires = 0;\n this.emit(\"failed\", response, cause);\n this.emit(\"unpublished\", response, cause);\n break;\n } // Do the cleanup\n\n\n if (this.pubRequestExpires === 0) {\n if (this.publishRefreshTimer) {\n clearTimeout(this.publishRefreshTimer);\n this.publishRefreshTimer = undefined;\n }\n\n this.pubRequestBody = undefined;\n this.pubRequestEtag = undefined;\n }\n };\n\n PublishContext.prototype.send = function () {\n var _this = this;\n\n this.ua.userAgentCore.publish(this.request, {\n onAccept: function onAccept(response) {\n return _this.receiveResponse(response.message);\n },\n onProgress: function onProgress(response) {\n return _this.receiveResponse(response.message);\n },\n onRedirect: function onRedirect(response) {\n return _this.receiveResponse(response.message);\n },\n onReject: function onReject(response) {\n return _this.receiveResponse(response.message);\n },\n onTrying: function onTrying(response) {\n return _this.receiveResponse(response.message);\n }\n });\n return this;\n };\n\n PublishContext.prototype.refreshRequest = function () {\n // Clean up before the run\n if (this.publishRefreshTimer) {\n clearTimeout(this.publishRefreshTimer);\n this.publishRefreshTimer = undefined;\n } // This is Refresh request\n\n\n this.pubRequestBody = undefined;\n\n if (this.pubRequestEtag === undefined) {\n // Request not valid\n throw new Exceptions_1.Exceptions.MethodParameterError(\"Publish\", \"Body\", undefined);\n }\n\n if (this.pubRequestExpires === 0) {\n // Request not valid\n throw new Exceptions_1.Exceptions.MethodParameterError(\"Publish\", \"Expire\", this.pubRequestExpires);\n }\n\n this.sendPublishRequest();\n };\n\n PublishContext.prototype.sendPublishRequest = function () {\n var reqOptions = Object.create(this.options || Object.prototype);\n reqOptions.extraHeaders = (this.options.extraHeaders || []).slice();\n reqOptions.extraHeaders.push(\"Event: \" + this.event);\n reqOptions.extraHeaders.push(\"Expires: \" + this.pubRequestExpires);\n\n if (this.pubRequestEtag !== undefined) {\n reqOptions.extraHeaders.push(\"SIP-If-Match: \" + this.pubRequestEtag);\n }\n\n var ruri = this.target instanceof core_1.URI ? this.target : this.ua.normalizeTarget(this.target);\n\n if (!ruri) {\n throw new Error(\"ruri undefined.\");\n }\n\n var params = this.options.params || {};\n var bodyObj;\n\n if (this.pubRequestBody !== undefined) {\n bodyObj = {\n body: this.pubRequestBody,\n contentType: this.options.contentType\n };\n }\n\n var body;\n\n if (bodyObj) {\n body = Utils_1.Utils.fromBodyObj(bodyObj);\n }\n\n this.request = this.ua.userAgentCore.makeOutgoingRequestMessage(Constants_1.C.PUBLISH, ruri, params.fromUri ? params.fromUri : this.ua.userAgentCore.configuration.aor, params.toUri ? params.toUri : this.target, params, reqOptions.extraHeaders, body);\n this.send();\n };\n\n return PublishContext;\n}(ClientContext_1.ClientContext);\n\nexports.PublishContext = PublishContext;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar ClientContext_1 = require(\"./ClientContext\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Exceptions_1 = require(\"./Exceptions\");\n\nvar Utils_1 = require(\"./Utils\");\n/**\n * Configuration load.\n * @private\n * returns {any}\n */\n\n\nfunction loadConfig(configuration) {\n var settings = {\n expires: 600,\n extraContactHeaderParams: [],\n instanceId: undefined,\n params: {},\n regId: undefined,\n registrar: undefined\n };\n var configCheck = getConfigurationCheck(); // Check Mandatory parameters\n\n for (var parameter in configCheck.mandatory) {\n if (!configuration.hasOwnProperty(parameter)) {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter);\n } else {\n var value = configuration[parameter];\n var checkedValue = configCheck.mandatory[parameter](value);\n\n if (checkedValue !== undefined) {\n settings[parameter] = checkedValue;\n } else {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter, value);\n }\n }\n } // Check Optional parameters\n\n\n for (var parameter in configCheck.optional) {\n if (configuration.hasOwnProperty(parameter)) {\n var value = configuration[parameter]; // If the parameter value is an empty array, but shouldn't be, apply its default value.\n\n if (value instanceof Array && value.length === 0) {\n continue;\n } // If the parameter value is null, empty string, or undefined then apply its default value.\n // If it's a number with NaN value then also apply its default value.\n // NOTE: JS does not allow \"value === NaN\", the following does the work:\n\n\n if (value === null || value === \"\" || value === undefined || typeof value === \"number\" && isNaN(value)) {\n continue;\n }\n\n var checkedValue = configCheck.optional[parameter](value);\n\n if (checkedValue !== undefined) {\n settings[parameter] = checkedValue;\n } else {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter, value);\n }\n }\n }\n\n return settings;\n}\n\nfunction getConfigurationCheck() {\n return {\n mandatory: {},\n optional: {\n expires: function expires(_expires) {\n if (Utils_1.Utils.isDecimal(_expires)) {\n var value = Number(_expires);\n\n if (value >= 0) {\n return value;\n }\n }\n },\n extraContactHeaderParams: function extraContactHeaderParams(_extraContactHeaderParams) {\n if (_extraContactHeaderParams instanceof Array) {\n return _extraContactHeaderParams.filter(function (contactHeaderParam) {\n return typeof contactHeaderParam === \"string\";\n });\n }\n },\n instanceId: function instanceId(_instanceId) {\n if (typeof _instanceId !== \"string\") {\n return;\n }\n\n if (/^uuid:/i.test(_instanceId)) {\n _instanceId = _instanceId.substr(5);\n }\n\n if (core_1.Grammar.parse(_instanceId, \"uuid\") === -1) {\n return;\n } else {\n return _instanceId;\n }\n },\n params: function params(_params) {\n if (typeof _params === \"object\") {\n return _params;\n }\n },\n regId: function regId(_regId) {\n if (Utils_1.Utils.isDecimal(_regId)) {\n var value = Number(_regId);\n\n if (value >= 0) {\n return value;\n }\n }\n },\n registrar: function registrar(_registrar) {\n if (typeof _registrar !== \"string\") {\n return;\n }\n\n if (!/^sip:/i.test(_registrar)) {\n _registrar = Constants_1.C.SIP + \":\" + _registrar;\n }\n\n var parsed = core_1.Grammar.URIParse(_registrar);\n\n if (!parsed) {\n return;\n } else if (parsed.user) {\n return;\n } else {\n return parsed;\n }\n }\n }\n };\n}\n\nvar RegisterContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(RegisterContext, _super);\n\n function RegisterContext(ua, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = this;\n\n var settings = loadConfig(options);\n\n if (settings.regId && !settings.instanceId) {\n settings.instanceId = Utils_1.Utils.newUUID();\n } else if (!settings.regId && settings.instanceId) {\n settings.regId = 1;\n }\n\n settings.params.toUri = settings.params.toUri || ua.configuration.uri;\n settings.params.toDisplayName = settings.params.toDisplayName || ua.configuration.displayName;\n settings.params.callId = settings.params.callId || Utils_1.Utils.createRandomToken(22);\n settings.params.cseq = settings.params.cseq || Math.floor(Math.random() * 10000);\n /* If no 'registrarServer' is set use the 'uri' value without user portion. */\n\n if (!settings.registrar) {\n var registrarServer = {};\n\n if (typeof ua.configuration.uri === \"object\") {\n registrarServer = ua.configuration.uri.clone();\n registrarServer.user = undefined;\n } else {\n registrarServer = ua.configuration.uri;\n }\n\n settings.registrar = registrarServer;\n }\n\n _this = _super.call(this, ua, Constants_1.C.REGISTER, settings.registrar, settings) || this;\n _this.type = Enums_1.TypeStrings.RegisterContext;\n _this.options = settings;\n _this.logger = ua.getLogger(\"sip.registercontext\");\n\n _this.logger.log(\"configuration parameters for RegisterContext after validation:\");\n\n for (var parameter in settings) {\n if (settings.hasOwnProperty(parameter)) {\n _this.logger.log(\"· \" + parameter + \": \" + JSON.stringify(settings[parameter]));\n }\n } // Registration expires\n\n\n _this.expires = settings.expires; // Contact header\n\n _this.contact = ua.contact.toString(); // Set status\n\n _this.registered = false;\n ua.transport.on(\"disconnected\", function () {\n return _this.onTransportDisconnected();\n });\n return _this;\n }\n\n RegisterContext.prototype.register = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // Handle Options\n\n\n this.options = tslib_1.__assign({}, this.options, options);\n var extraHeaders = (this.options.extraHeaders || []).slice();\n extraHeaders.push(\"Contact: \" + this.generateContactHeader(this.expires)); // this is UA.C.ALLOWED_METHODS, removed to get around circular dependency\n\n extraHeaders.push(\"Allow: \" + [\"ACK\", \"CANCEL\", \"INVITE\", \"MESSAGE\", \"BYE\", \"OPTIONS\", \"INFO\", \"NOTIFY\", \"REFER\"].toString()); // Save original extraHeaders to be used in .close\n\n this.closeHeaders = this.options.closeWithHeaders ? (this.options.extraHeaders || []).slice() : [];\n\n this.receiveResponse = function (response) {\n // Discard responses to older REGISTER/un-REGISTER requests.\n if (response.cseq !== _this.request.cseq) {\n return;\n } // Clear registration timer\n\n\n if (_this.registrationTimer !== undefined) {\n clearTimeout(_this.registrationTimer);\n _this.registrationTimer = undefined;\n }\n\n var statusCode = (response.statusCode || 0).toString();\n\n switch (true) {\n case /^1[0-9]{2}$/.test(statusCode):\n _this.emit(\"progress\", response);\n\n break;\n\n case /^2[0-9]{2}$/.test(statusCode):\n _this.emit(\"accepted\", response);\n\n var expires = void 0;\n\n if (response.hasHeader(\"expires\")) {\n expires = Number(response.getHeader(\"expires\"));\n }\n\n if (_this.registrationExpiredTimer !== undefined) {\n clearTimeout(_this.registrationExpiredTimer);\n _this.registrationExpiredTimer = undefined;\n } // Search the Contact pointing to us and update the expires value accordingly.\n\n\n var contacts = response.getHeaders(\"contact\").length;\n\n if (!contacts) {\n _this.logger.warn(\"no Contact header in response to REGISTER, response ignored\");\n\n break;\n }\n\n var contact = void 0;\n\n while (contacts--) {\n contact = response.parseHeader(\"contact\", contacts);\n\n if (contact.uri.user === _this.ua.contact.uri.user) {\n expires = contact.getParam(\"expires\");\n break;\n } else {\n contact = undefined;\n }\n }\n\n if (!contact) {\n _this.logger.warn(\"no Contact header pointing to us, response ignored\");\n\n break;\n }\n\n if (expires === undefined) {\n expires = _this.expires;\n } // Re-Register before the expiration interval has elapsed.\n // For that, decrease the expires value. ie: 3 seconds\n\n\n _this.registrationTimer = setTimeout(function () {\n _this.registrationTimer = undefined;\n\n _this.register(_this.options);\n }, expires * 1000 - 3000);\n _this.registrationExpiredTimer = setTimeout(function () {\n _this.logger.warn(\"registration expired\");\n\n if (_this.registered) {\n _this.unregistered(undefined, Constants_1.C.causes.EXPIRES);\n }\n }, expires * 1000); // Save gruu values\n\n if (contact.hasParam(\"temp-gruu\")) {\n _this.ua.contact.tempGruu = core_1.Grammar.URIParse(contact.getParam(\"temp-gruu\").replace(/\"/g, \"\"));\n }\n\n if (contact.hasParam(\"pub-gruu\")) {\n _this.ua.contact.pubGruu = core_1.Grammar.URIParse(contact.getParam(\"pub-gruu\").replace(/\"/g, \"\"));\n }\n\n _this.registered = true;\n\n _this.emit(\"registered\", response || undefined);\n\n break;\n // Interval too brief RFC3261 10.2.8\n\n case /^423$/.test(statusCode):\n if (response.hasHeader(\"min-expires\")) {\n // Increase our registration interval to the suggested minimum\n _this.expires = Number(response.getHeader(\"min-expires\")); // Attempt the registration again immediately\n\n _this.register(_this.options);\n } else {\n // This response MUST contain a Min-Expires header field\n _this.logger.warn(\"423 response received for REGISTER without Min-Expires\");\n\n _this.registrationFailure(response, Constants_1.C.causes.SIP_FAILURE_CODE);\n }\n\n break;\n\n default:\n _this.registrationFailure(response, Utils_1.Utils.sipErrorCause(response.statusCode || 0));\n\n }\n };\n\n this.onRequestTimeout = function () {\n _this.registrationFailure(undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n };\n\n this.onTransportError = function () {\n _this.registrationFailure(undefined, Constants_1.C.causes.CONNECTION_ERROR);\n };\n\n this.request.cseq++;\n this.request.setHeader(\"cseq\", this.request.cseq + \" REGISTER\");\n this.request.extraHeaders = extraHeaders;\n this.send();\n };\n\n RegisterContext.prototype.close = function () {\n var options = {\n all: false,\n extraHeaders: this.closeHeaders\n };\n this.registeredBefore = this.registered;\n\n if (this.registered) {\n this.unregister(options);\n }\n };\n\n RegisterContext.prototype.unregister = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (!this.registered && !options.all) {\n this.logger.warn(\"Already unregistered, but sending an unregister anyways.\");\n }\n\n var extraHeaders = (options.extraHeaders || []).slice();\n this.registered = false; // Clear the registration timer.\n\n if (this.registrationTimer !== undefined) {\n clearTimeout(this.registrationTimer);\n this.registrationTimer = undefined;\n }\n\n if (options.all) {\n extraHeaders.push(\"Contact: *\");\n extraHeaders.push(\"Expires: 0\");\n } else {\n extraHeaders.push(\"Contact: \" + this.generateContactHeader(0));\n }\n\n this.receiveResponse = function (response) {\n var statusCode = response && response.statusCode ? response.statusCode.toString() : \"\";\n\n switch (true) {\n case /^1[0-9]{2}$/.test(statusCode):\n _this.emit(\"progress\", response);\n\n break;\n\n case /^2[0-9]{2}$/.test(statusCode):\n _this.emit(\"accepted\", response);\n\n if (_this.registrationExpiredTimer !== undefined) {\n clearTimeout(_this.registrationExpiredTimer);\n _this.registrationExpiredTimer = undefined;\n }\n\n _this.unregistered(response);\n\n break;\n\n default:\n _this.unregistered(response, Utils_1.Utils.sipErrorCause(response.statusCode || 0));\n\n }\n };\n\n this.onRequestTimeout = function () {// Not actually unregistered...\n // this.unregistered(undefined, SIP.C.causes.REQUEST_TIMEOUT);\n };\n\n this.request.cseq++;\n this.request.setHeader(\"cseq\", this.request.cseq + \" REGISTER\");\n this.request.extraHeaders = extraHeaders;\n this.send();\n };\n\n RegisterContext.prototype.unregistered = function (response, cause) {\n this.registered = false;\n this.emit(\"unregistered\", response || undefined, cause || undefined);\n };\n\n RegisterContext.prototype.send = function () {\n var _this = this;\n\n this.ua.userAgentCore.register(this.request, {\n onAccept: function onAccept(response) {\n return _this.receiveResponse(response.message);\n },\n onProgress: function onProgress(response) {\n return _this.receiveResponse(response.message);\n },\n onRedirect: function onRedirect(response) {\n return _this.receiveResponse(response.message);\n },\n onReject: function onReject(response) {\n return _this.receiveResponse(response.message);\n },\n onTrying: function onTrying(response) {\n return _this.receiveResponse(response.message);\n }\n });\n return this;\n };\n\n RegisterContext.prototype.registrationFailure = function (response, cause) {\n this.emit(\"failed\", response || undefined, cause || undefined);\n };\n\n RegisterContext.prototype.onTransportDisconnected = function () {\n this.registeredBefore = this.registered;\n\n if (this.registrationTimer !== undefined) {\n clearTimeout(this.registrationTimer);\n this.registrationTimer = undefined;\n }\n\n if (this.registrationExpiredTimer !== undefined) {\n clearTimeout(this.registrationExpiredTimer);\n this.registrationExpiredTimer = undefined;\n }\n\n if (this.registered) {\n this.unregistered(undefined, Constants_1.C.causes.CONNECTION_ERROR);\n }\n };\n /**\n * Helper Function to generate Contact Header\n * @private\n * returns {String}\n */\n\n\n RegisterContext.prototype.generateContactHeader = function (expires) {\n if (expires === void 0) {\n expires = 0;\n }\n\n var contact = this.contact;\n\n if (this.options.regId && this.options.instanceId) {\n contact += \";reg-id=\" + this.options.regId;\n contact += ';+sip.instance=\"\"';\n }\n\n if (this.options.extraContactHeaderParams) {\n this.options.extraContactHeaderParams.forEach(function (header) {\n contact += \";\" + header;\n });\n }\n\n contact += \";expires=\" + expires;\n return contact;\n };\n\n return RegisterContext;\n}(ClientContext_1.ClientContext);\n\nexports.RegisterContext = RegisterContext;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar ClientContext_1 = require(\"./ClientContext\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Exceptions_1 = require(\"./Exceptions\");\n\nvar ReferContext_1 = require(\"./ReferContext\");\n\nvar ServerContext_1 = require(\"./ServerContext\");\n\nvar DTMF_1 = require(\"./Session/DTMF\");\n\nvar Utils_1 = require(\"./Utils\");\n/*\n * @param {function returning SIP.sessionDescriptionHandler} [sessionDescriptionHandlerFactory]\n * (See the documentation for the sessionDescriptionHandlerFactory argument of the UA constructor.)\n */\n\n\nvar Session =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(Session, _super);\n\n function Session(sessionDescriptionHandlerFactory) {\n var _this = _super.call(this) || this;\n\n _this.data = {};\n _this.type = Enums_1.TypeStrings.Session;\n\n if (!sessionDescriptionHandlerFactory) {\n throw new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"A session description handler is required for the session to function\");\n }\n\n _this.status = Session.C.STATUS_NULL;\n _this.pendingReinvite = false;\n _this.sessionDescriptionHandlerFactory = sessionDescriptionHandlerFactory;\n _this.hasOffer = false;\n _this.hasAnswer = false; // Session Timers\n\n _this.timers = {\n ackTimer: undefined,\n expiresTimer: undefined,\n invite2xxTimer: undefined,\n userNoAnswerTimer: undefined,\n rel1xxTimer: undefined,\n prackTimer: undefined\n }; // Session info\n\n _this.startTime = undefined;\n _this.endTime = undefined;\n _this.tones = undefined; // Hold state\n\n _this.localHold = false;\n _this.earlySdp = undefined;\n _this.rel100 = Constants_1.C.supported.UNSUPPORTED;\n return _this;\n }\n\n Session.prototype.dtmf = function (tones, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // Check Session Status\n\n\n if (this.status !== Enums_1.SessionStatus.STATUS_CONFIRMED && this.status !== Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n } // Check tones\n\n\n if (!tones || !tones.toString().match(/^[0-9A-D#*,]+$/i)) {\n throw new TypeError(\"Invalid tones: \" + tones);\n }\n\n var sendDTMF = function sendDTMF() {\n if (_this.status === Enums_1.SessionStatus.STATUS_TERMINATED || !_this.tones || _this.tones.length === 0) {\n // Stop sending DTMF\n _this.tones = undefined;\n return;\n }\n\n var dtmf = _this.tones.shift();\n\n var timeout;\n\n if (dtmf.tone === \",\") {\n timeout = 2000;\n } else {\n dtmf.on(\"failed\", function () {\n _this.tones = undefined;\n });\n dtmf.send(options);\n timeout = dtmf.duration + dtmf.interToneGap;\n } // Set timeout for the next tone\n\n\n setTimeout(sendDTMF, timeout);\n };\n\n tones = tones.toString();\n var dtmfType = this.ua.configuration.dtmfType;\n\n if (this.sessionDescriptionHandler && dtmfType === Constants_1.C.dtmfType.RTP) {\n var sent = this.sessionDescriptionHandler.sendDtmf(tones, options);\n\n if (!sent) {\n this.logger.warn(\"Attempt to use dtmfType 'RTP' has failed, falling back to INFO packet method\");\n dtmfType = Constants_1.C.dtmfType.INFO;\n }\n }\n\n if (dtmfType === Constants_1.C.dtmfType.INFO) {\n var dtmfs = [];\n var tonesArray = tones.split(\"\");\n\n while (tonesArray.length > 0) {\n dtmfs.push(new DTMF_1.DTMF(this, tonesArray.shift(), options));\n }\n\n if (this.tones) {\n // Tones are already queued, just add to the queue\n this.tones = this.tones.concat(dtmfs);\n return this;\n }\n\n this.tones = dtmfs;\n sendDTMF();\n }\n\n return this;\n };\n\n Session.prototype.bye = function (options) {\n if (options === void 0) {\n options = {};\n } // Check Session Status\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n this.logger.error(\"Error: Attempted to send BYE in a terminated session.\");\n return this;\n }\n\n this.logger.log(\"terminating Session\");\n var statusCode = options.statusCode;\n\n if (statusCode && (statusCode < 200 || statusCode >= 700)) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n options.receiveResponse = function () {};\n\n return this.sendRequest(Constants_1.C.BYE, options).terminated();\n };\n\n Session.prototype.refer = function (target, options) {\n if (options === void 0) {\n options = {};\n } // Check Session Status\n\n\n if (this.status !== Enums_1.SessionStatus.STATUS_CONFIRMED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n this.referContext = new ReferContext_1.ReferClientContext(this.ua, this, target, options);\n this.emit(\"referRequested\", this.referContext);\n this.referContext.refer(options);\n return this.referContext;\n };\n /**\n * Sends in dialog request.\n * @param method Request method.\n * @param options Options bucket.\n */\n\n\n Session.prototype.sendRequest = function (method, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!this.session) {\n throw new Error(\"Session undefined.\");\n } // Convert any \"body\" option to a Body.\n\n\n if (options.body) {\n options.body = Utils_1.Utils.fromBodyObj(options.body);\n } // Convert any \"receiveResponse\" callback option passed to an OutgoingRequestDelegate.\n\n\n var delegate;\n var callback = options.receiveResponse;\n\n if (callback) {\n delegate = {\n onAccept: function onAccept(response) {\n return callback(response.message);\n },\n onProgress: function onProgress(response) {\n return callback(response.message);\n },\n onRedirect: function onRedirect(response) {\n return callback(response.message);\n },\n onReject: function onReject(response) {\n return callback(response.message);\n },\n onTrying: function onTrying(response) {\n return callback(response.message);\n }\n };\n }\n\n var request;\n var requestOptions = options;\n\n switch (method) {\n case Constants_1.C.BYE:\n request = this.session.bye(delegate, requestOptions);\n break;\n\n case Constants_1.C.INVITE:\n request = this.session.invite(delegate, requestOptions);\n break;\n\n case Constants_1.C.REFER:\n request = this.session.refer(delegate, requestOptions);\n break;\n\n default:\n throw new Error(\"Unexpected \" + method + \". Method not implemented by user agent core.\");\n } // Ported - Emit the request event\n\n\n this.emit(method.toLowerCase(), request.message);\n return this;\n };\n\n Session.prototype.close = function () {\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return this;\n }\n\n this.logger.log(\"closing INVITE session \" + this.id); // 1st Step. Terminate media.\n\n if (this.sessionDescriptionHandler) {\n this.sessionDescriptionHandler.close();\n } // 2nd Step. Terminate signaling.\n // Clear session timers\n\n\n for (var timer in this.timers) {\n if (this.timers[timer]) {\n clearTimeout(this.timers[timer]);\n }\n }\n\n this.status = Enums_1.SessionStatus.STATUS_TERMINATED;\n\n if (this.ua.transport) {\n this.ua.transport.removeListener(\"transportError\", this.errorListener);\n }\n\n delete this.ua.sessions[this.id];\n return this;\n };\n\n Session.prototype.hold = function (options, modifiers) {\n if (options === void 0) {\n options = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n if (this.status !== Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK && this.status !== Enums_1.SessionStatus.STATUS_CONFIRMED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n if (this.localHold) {\n this.logger.log(\"Session is already on hold, cannot put it on hold again\");\n return;\n }\n\n options.modifiers = modifiers;\n\n if (this.sessionDescriptionHandler) {\n options.modifiers.push(this.sessionDescriptionHandler.holdModifier);\n }\n\n this.localHold = true;\n this.sendReinvite(options);\n };\n\n Session.prototype.unhold = function (options, modifiers) {\n if (options === void 0) {\n options = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n if (this.status !== Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK && this.status !== Enums_1.SessionStatus.STATUS_CONFIRMED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n if (!this.localHold) {\n this.logger.log(\"Session is not on hold, cannot unhold it\");\n return;\n }\n\n options.modifiers = modifiers;\n this.localHold = false;\n this.sendReinvite(options);\n };\n\n Session.prototype.reinvite = function (options, modifiers) {\n if (options === void 0) {\n options = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n options.modifiers = modifiers;\n return this.sendReinvite(options);\n };\n\n Session.prototype.terminate = function (options) {\n // here for types and to be overridden\n return this;\n };\n\n Session.prototype.onTransportError = function () {\n if (this.status !== Enums_1.SessionStatus.STATUS_CONFIRMED && this.status !== Enums_1.SessionStatus.STATUS_TERMINATED) {\n this.failed(undefined, Constants_1.C.causes.CONNECTION_ERROR);\n }\n };\n\n Session.prototype.onRequestTimeout = function () {\n if (this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n this.terminated(undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n } else if (this.status !== Enums_1.SessionStatus.STATUS_TERMINATED) {\n this.failed(undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n this.terminated(undefined, Constants_1.C.causes.REQUEST_TIMEOUT);\n }\n };\n\n Session.prototype.onDialogError = function (response) {\n if (this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n this.terminated(response, Constants_1.C.causes.DIALOG_ERROR);\n } else if (this.status !== Enums_1.SessionStatus.STATUS_TERMINATED) {\n this.failed(response, Constants_1.C.causes.DIALOG_ERROR);\n this.terminated(response, Constants_1.C.causes.DIALOG_ERROR);\n }\n };\n\n Session.prototype.on = function (name, callback) {\n return _super.prototype.on.call(this, name, callback);\n };\n\n Session.prototype.onAck = function (incomingRequest) {\n var _this = this;\n\n var confirmSession = function confirmSession() {\n clearTimeout(_this.timers.ackTimer);\n clearTimeout(_this.timers.invite2xxTimer);\n _this.status = Enums_1.SessionStatus.STATUS_CONFIRMED;\n var contentDisp = incomingRequest.message.getHeader(\"Content-Disposition\");\n\n if (contentDisp && contentDisp.type === \"render\") {\n _this.renderbody = incomingRequest.message.body;\n _this.rendertype = incomingRequest.message.getHeader(\"Content-Type\");\n }\n\n _this.emit(\"confirmed\", incomingRequest.message);\n };\n\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK) {\n if (this.sessionDescriptionHandler && this.sessionDescriptionHandler.hasDescription(incomingRequest.message.getHeader(\"Content-Type\") || \"\")) {\n this.hasAnswer = true;\n this.sessionDescriptionHandler.setDescription(incomingRequest.message.body, this.sessionDescriptionHandlerOptions, this.modifiers).catch(function (e) {\n _this.logger.warn(e);\n\n _this.terminate({\n statusCode: \"488\",\n reasonPhrase: \"Bad Media Description\"\n });\n\n _this.failed(incomingRequest.message, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n\n _this.terminated(incomingRequest.message, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n\n throw e;\n }).then(function () {\n return confirmSession();\n });\n } else {\n confirmSession();\n }\n }\n };\n\n Session.prototype.receiveRequest = function (incomingRequest) {\n switch (incomingRequest.message.method) {\n // TODO: This needs a default case\n case Constants_1.C.BYE:\n incomingRequest.accept();\n\n if (this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n this.emit(\"bye\", incomingRequest.message);\n this.terminated(incomingRequest.message, Constants_1.C.BYE);\n }\n\n break;\n\n case Constants_1.C.INVITE:\n if (this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n this.logger.log(\"re-INVITE received\");\n this.receiveReinvite(incomingRequest);\n }\n\n break;\n\n case Constants_1.C.INFO:\n if (this.status === Enums_1.SessionStatus.STATUS_CONFIRMED || this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK) {\n if (this.onInfo) {\n return this.onInfo(incomingRequest.message);\n }\n\n var contentType = incomingRequest.message.getHeader(\"content-type\");\n\n if (contentType) {\n if (contentType.match(/^application\\/dtmf-relay/i)) {\n if (incomingRequest.message.body) {\n var body = incomingRequest.message.body.split(\"\\r\\n\", 2);\n\n if (body.length === 2) {\n var tone = void 0;\n var duration = void 0;\n var regTone = /^(Signal\\s*?=\\s*?)([0-9A-D#*]{1})(\\s)?.*/;\n\n if (regTone.test(body[0])) {\n tone = body[0].replace(regTone, \"$2\");\n }\n\n var regDuration = /^(Duration\\s?=\\s?)([0-9]{1,4})(\\s)?.*/;\n\n if (regDuration.test(body[1])) {\n duration = parseInt(body[1].replace(regDuration, \"$2\"), 10);\n }\n\n if (tone && duration) {\n new DTMF_1.DTMF(this, tone, {\n duration: duration\n }).init_incoming(incomingRequest);\n }\n }\n }\n } else {\n incomingRequest.reject({\n statusCode: 415,\n extraHeaders: [\"Accept: application/dtmf-relay\"]\n });\n }\n }\n }\n\n break;\n\n case Constants_1.C.REFER:\n if (this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n this.logger.log(\"REFER received\");\n this.referContext = new ReferContext_1.ReferServerContext(this.ua, incomingRequest, this.session);\n\n if (this.listeners(\"referRequested\").length) {\n this.emit(\"referRequested\", this.referContext);\n } else {\n this.logger.log(\"No referRequested listeners, automatically accepting and following the refer\");\n var options = {\n followRefer: true\n };\n\n if (this.passedOptions) {\n options.inviteOptions = this.passedOptions;\n }\n\n this.referContext.accept(options, this.modifiers);\n }\n }\n\n break;\n\n case Constants_1.C.NOTIFY:\n if (this.referContext && this.referContext.type === Enums_1.TypeStrings.ReferClientContext && incomingRequest.message.hasHeader(\"event\") && /^refer(;.*)?$/.test(incomingRequest.message.getHeader(\"event\"))) {\n this.referContext.receiveNotify(incomingRequest);\n return;\n }\n\n incomingRequest.accept();\n this.emit(\"notify\", incomingRequest.message);\n break;\n }\n }; // In dialog INVITE Reception\n\n\n Session.prototype.receiveReinvite = function (incomingRequest) {\n // TODO: Should probably check state of the session\n var _this = this;\n\n this.emit(\"reinvite\", this, incomingRequest.message);\n\n if (incomingRequest.message.hasHeader(\"P-Asserted-Identity\")) {\n this.assertedIdentity = core_1.Grammar.nameAddrHeaderParse(incomingRequest.message.getHeader(\"P-Asserted-Identity\"));\n }\n\n var promise;\n\n if (!this.sessionDescriptionHandler) {\n this.logger.warn(\"No SessionDescriptionHandler to reinvite\");\n return;\n }\n\n if (incomingRequest.message.getHeader(\"Content-Length\") === \"0\" && !incomingRequest.message.getHeader(\"Content-Type\")) {\n // Invite w/o SDP\n promise = this.sessionDescriptionHandler.getDescription(this.sessionDescriptionHandlerOptions, this.modifiers);\n } else if (this.sessionDescriptionHandler.hasDescription(incomingRequest.message.getHeader(\"Content-Type\") || \"\")) {\n // Invite w/ SDP\n promise = this.sessionDescriptionHandler.setDescription(incomingRequest.message.body, this.sessionDescriptionHandlerOptions, this.modifiers).then(this.sessionDescriptionHandler.getDescription.bind(this.sessionDescriptionHandler, this.sessionDescriptionHandlerOptions, this.modifiers));\n } else {\n // Bad Packet (should never get hit)\n incomingRequest.reject({\n statusCode: 415\n });\n this.emit(\"reinviteFailed\", this);\n return;\n }\n\n promise.catch(function (e) {\n var statusCode;\n\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n statusCode = 500;\n } else if (e.type === Enums_1.TypeStrings.RenegotiationError) {\n _this.emit(\"renegotiationError\", e);\n\n _this.logger.warn(e.toString());\n\n statusCode = 488;\n } else {\n _this.logger.error(e);\n\n statusCode = 488;\n }\n\n incomingRequest.reject({\n statusCode: statusCode\n });\n\n _this.emit(\"reinviteFailed\", _this); // TODO: This could be better\n\n\n throw e;\n }).then(function (description) {\n var extraHeaders = [\"Contact: \" + _this.contact];\n incomingRequest.accept({\n statusCode: 200,\n extraHeaders: extraHeaders,\n body: Utils_1.Utils.fromBodyObj(description)\n });\n _this.status = Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK;\n\n _this.emit(\"reinviteAccepted\", _this);\n });\n };\n\n Session.prototype.sendReinvite = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (this.pendingReinvite) {\n this.logger.warn(\"Reinvite in progress. Please wait until complete, then try again.\");\n return;\n }\n\n if (!this.sessionDescriptionHandler) {\n this.logger.warn(\"No SessionDescriptionHandler, can't reinvite..\");\n return;\n }\n\n this.pendingReinvite = true;\n options.modifiers = options.modifiers || [];\n var extraHeaders = (options.extraHeaders || []).slice();\n extraHeaders.push(\"Contact: \" + this.contact); // this is UA.C.ALLOWED_METHODS, removed to get around circular dependency\n\n extraHeaders.push(\"Allow: \" + [\"ACK\", \"CANCEL\", \"INVITE\", \"MESSAGE\", \"BYE\", \"OPTIONS\", \"INFO\", \"NOTIFY\", \"REFER\"].toString());\n this.sessionDescriptionHandler.getDescription(options.sessionDescriptionHandlerOptions, options.modifiers).then(function (description) {\n if (!_this.session) {\n throw new Error(\"Session undefined.\");\n }\n\n var delegate = {\n onAccept: function onAccept(response) {\n if (_this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n _this.logger.error(\"Received reinvite response, but in STATUS_TERMINATED\"); // TODO: Do we need to send a SIP response?\n\n\n return;\n }\n\n if (!_this.pendingReinvite) {\n _this.logger.error(\"Received reinvite response, but have no pending reinvite\"); // TODO: Do we need to send a SIP response?\n\n\n return;\n } // FIXME: Why is this set here?\n\n\n _this.status = Enums_1.SessionStatus.STATUS_CONFIRMED; // 17.1.1.1 - For each final response that is received at the client transaction,\n // the client transaction sends an ACK,\n\n _this.emit(\"ack\", response.ack());\n\n _this.pendingReinvite = false; // TODO: All of these timers should move into the Transaction layer\n\n clearTimeout(_this.timers.invite2xxTimer);\n\n if (!_this.sessionDescriptionHandler || !_this.sessionDescriptionHandler.hasDescription(response.message.getHeader(\"Content-Type\") || \"\")) {\n _this.logger.error(\"2XX response received to re-invite but did not have a description\");\n\n _this.emit(\"reinviteFailed\", _this);\n\n _this.emit(\"renegotiationError\", new Exceptions_1.Exceptions.RenegotiationError(\"2XX response received to re-invite but did not have a description\"));\n\n return;\n }\n\n _this.sessionDescriptionHandler.setDescription(response.message.body, _this.sessionDescriptionHandlerOptions, _this.modifiers).catch(function (e) {\n _this.logger.error(\"Could not set the description in 2XX response\");\n\n _this.logger.error(e);\n\n _this.emit(\"reinviteFailed\", _this);\n\n _this.emit(\"renegotiationError\", e);\n\n _this.sendRequest(Constants_1.C.BYE, {\n extraHeaders: [\"Reason: \" + Utils_1.Utils.getReasonHeaderValue(488, \"Not Acceptable Here\")]\n });\n\n _this.terminated(undefined, Constants_1.C.causes.INCOMPATIBLE_SDP);\n\n throw e;\n }).then(function () {\n _this.emit(\"reinviteAccepted\", _this);\n });\n },\n onProgress: function onProgress(response) {\n return;\n },\n onRedirect: function onRedirect(response) {\n // FIXME: Does ACK need to be sent?\n _this.pendingReinvite = false;\n\n _this.logger.log(\"Received a non 1XX or 2XX response to a re-invite\");\n\n _this.emit(\"reinviteFailed\", _this);\n\n _this.emit(\"renegotiationError\", new Exceptions_1.Exceptions.RenegotiationError(\"Invalid response to a re-invite\"));\n },\n onReject: function onReject(response) {\n // FIXME: Does ACK need to be sent?\n _this.pendingReinvite = false;\n\n _this.logger.log(\"Received a non 1XX or 2XX response to a re-invite\");\n\n _this.emit(\"reinviteFailed\", _this);\n\n _this.emit(\"renegotiationError\", new Exceptions_1.Exceptions.RenegotiationError(\"Invalid response to a re-invite\"));\n },\n onTrying: function onTrying(response) {\n return;\n }\n };\n var requestOptions = {\n extraHeaders: extraHeaders,\n body: Utils_1.Utils.fromBodyObj(description)\n };\n\n _this.session.invite(delegate, requestOptions);\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.RenegotiationError) {\n _this.pendingReinvite = false;\n\n _this.emit(\"renegotiationError\", e);\n\n _this.logger.warn(\"Renegotiation Error\");\n\n _this.logger.warn(e.toString());\n\n throw e;\n }\n\n _this.logger.error(\"sessionDescriptionHandler error\");\n\n _this.logger.error(e);\n\n throw e;\n });\n };\n\n Session.prototype.failed = function (response, cause) {\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return this;\n }\n\n this.emit(\"failed\", response, cause);\n return this;\n };\n\n Session.prototype.rejected = function (response, cause) {\n this.emit(\"rejected\", response, cause);\n return this;\n };\n\n Session.prototype.canceled = function () {\n if (this.sessionDescriptionHandler) {\n this.sessionDescriptionHandler.close();\n }\n\n this.emit(\"cancel\");\n return this;\n };\n\n Session.prototype.accepted = function (response, cause) {\n if (!(response instanceof String)) {\n cause = Utils_1.Utils.getReasonPhrase(response && response.statusCode || 0, cause);\n }\n\n this.startTime = new Date();\n\n if (this.replacee) {\n this.replacee.emit(\"replaced\", this);\n this.replacee.terminate();\n }\n\n this.emit(\"accepted\", response, cause);\n return this;\n };\n\n Session.prototype.terminated = function (message, cause) {\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return this;\n }\n\n this.endTime = new Date();\n this.close();\n this.emit(\"terminated\", message, cause);\n return this;\n };\n\n Session.prototype.connecting = function (request) {\n this.emit(\"connecting\", {\n request: request\n });\n return this;\n };\n\n Session.C = Enums_1.SessionStatus;\n return Session;\n}(events_1.EventEmitter);\n\nexports.Session = Session; // tslint:disable-next-line:max-classes-per-file\n\nvar InviteServerContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(InviteServerContext, _super);\n\n function InviteServerContext(ua, incomingInviteRequest) {\n var _this = this;\n\n if (!ua.configuration.sessionDescriptionHandlerFactory) {\n ua.logger.warn(\"Can't build ISC without SDH Factory\");\n throw new Error(\"ISC Constructor Failed\");\n }\n\n _this = _super.call(this, ua.configuration.sessionDescriptionHandlerFactory) || this;\n _this._canceled = false;\n _this.rseq = Math.floor(Math.random() * 10000);\n _this.incomingRequest = incomingInviteRequest;\n var request = incomingInviteRequest.message;\n ServerContext_1.ServerContext.initializer(_this, ua, incomingInviteRequest);\n _this.type = Enums_1.TypeStrings.InviteServerContext;\n var contentDisp = request.parseHeader(\"Content-Disposition\");\n\n if (contentDisp && contentDisp.type === \"render\") {\n _this.renderbody = request.body;\n _this.rendertype = request.getHeader(\"Content-Type\");\n }\n\n _this.status = Enums_1.SessionStatus.STATUS_INVITE_RECEIVED;\n _this.fromTag = request.fromTag;\n _this.id = request.callId + _this.fromTag;\n _this.request = request;\n _this.contact = _this.ua.contact.toString();\n _this.logger = ua.getLogger(\"sip.inviteservercontext\", _this.id); // Save the session into the ua sessions collection.\n\n _this.ua.sessions[_this.id] = _this; // Set 100rel if necessary\n\n var set100rel = function set100rel(header, relSetting) {\n if (request.hasHeader(header) && request.getHeader(header).toLowerCase().indexOf(\"100rel\") >= 0) {\n _this.rel100 = relSetting;\n }\n };\n\n set100rel(\"require\", Constants_1.C.supported.REQUIRED);\n set100rel(\"supported\", Constants_1.C.supported.SUPPORTED); // Set the toTag on the incoming request to the toTag which\n // will be used in the response to the incoming request!!!\n // FIXME: HACK: This is a hack to port an existing behavior.\n // The behavior being ported appears to be a hack itself,\n // so this is a hack to port a hack. At least one test spec\n // relies on it (which is yet another hack).\n\n _this.request.toTag = incomingInviteRequest.toTag;\n _this.status = Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER; // Set userNoAnswerTimer\n\n _this.timers.userNoAnswerTimer = setTimeout(function () {\n incomingInviteRequest.reject({\n statusCode: 408\n });\n\n _this.failed(request, Constants_1.C.causes.NO_ANSWER);\n\n _this.terminated(request, Constants_1.C.causes.NO_ANSWER);\n }, _this.ua.configuration.noAnswerTimeout || 60);\n /* Set expiresTimer\n * RFC3261 13.3.1\n */\n // Get the Expires header value if exists\n\n if (request.hasHeader(\"expires\")) {\n var expires = Number(request.getHeader(\"expires\") || 0) * 1000;\n _this.timers.expiresTimer = setTimeout(function () {\n if (_this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER) {\n incomingInviteRequest.reject({\n statusCode: 487\n });\n\n _this.failed(request, Constants_1.C.causes.EXPIRES);\n\n _this.terminated(request, Constants_1.C.causes.EXPIRES);\n }\n }, expires);\n }\n\n _this.errorListener = _this.onTransportError.bind(_this);\n\n if (ua.transport) {\n ua.transport.on(\"transportError\", _this.errorListener);\n }\n\n return _this;\n }\n\n Object.defineProperty(InviteServerContext.prototype, \"autoSendAnInitialProvisionalResponse\", {\n /**\n * If true, a first provisional response after the 100 Trying\n * will be sent automatically. This is false it the UAC required\n * reliable provisional responses (100rel in Require header),\n * otherwise it is true. The provisional is sent by calling\n * `progress()` without any options.\n *\n * FIXME: TODO: It seems reasonable that the ISC user should\n * be able to optionally disable this behavior. As the provisional\n * is sent prior to the \"invite\" event being emitted, it's a known\n * issue that the ISC user cannot register listeners or do any other\n * setup prior to the call to `progress()`. As an example why this is\n * an issue, setting `ua.configuration.rel100` to REQUIRED will result\n * in an attempt by `progress()` to send a 183 with SDP produced by\n * calling `getDescription()` on a session description handler, but\n * the ISC user cannot perform any potentially required session description\n * handler initialization (thus preventing the utilization of setting\n * `ua.configuration.rel100` to REQUIRED). That begs the question of\n * why this behavior is disabled when the UAC requires 100rel but not\n * when the UAS requires 100rel? But ignoring that, it's just one example\n * of a class of cases where the ISC user needs to do something prior\n * to the first call to `progress()` and is unable to do so.\n */\n get: function get() {\n return this.rel100 === Constants_1.C.supported.REQUIRED ? false : true;\n },\n enumerable: true,\n configurable: true\n }); // type hack for servercontext interface\n\n InviteServerContext.prototype.reply = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n return this;\n }; // typing note: this was the only function using its super in ServerContext\n // so the bottom half of this function is copied and paired down from that\n\n\n InviteServerContext.prototype.reject = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // Check Session Status\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n this.logger.log(\"rejecting RTCSession\");\n var statusCode = options.statusCode || 480;\n var reasonPhrase = Utils_1.Utils.getReasonPhrase(statusCode, options.reasonPhrase);\n var extraHeaders = options.extraHeaders || [];\n\n if (statusCode < 300 || statusCode > 699) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n }\n\n var body = options.body ? core_1.fromBodyLegacy(options.body) : undefined; // FIXME: Need to redirect to someplae\n\n var response = statusCode < 400 ? this.incomingRequest.redirect([], {\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n }) : this.incomingRequest.reject({\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n });\n [\"rejected\", \"failed\"].forEach(function (event) {\n _this.emit(event, response.message, reasonPhrase);\n });\n return this.terminated();\n };\n /**\n * Accept the incoming INVITE request to start a Session.\n * Replies to the INVITE request with a 200 Ok response.\n * @param options Options bucket.\n */\n\n\n InviteServerContext.prototype.accept = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // FIXME: Need guard against calling more than once.\n\n\n this._accept(options).then(function (_a) {\n var message = _a.message,\n session = _a.session;\n session.delegate = {\n onAck: function onAck(ackRequest) {\n return _this.onAck(ackRequest);\n },\n onAckTimeout: function onAckTimeout() {\n return _this.onAckTimeout();\n },\n onBye: function onBye(byeRequest) {\n return _this.receiveRequest(byeRequest);\n },\n onInfo: function onInfo(infoRequest) {\n return _this.receiveRequest(infoRequest);\n },\n onInvite: function onInvite(inviteRequest) {\n return _this.receiveRequest(inviteRequest);\n },\n onNotify: function onNotify(notifyRequest) {\n return _this.receiveRequest(notifyRequest);\n },\n onPrack: function onPrack(prackRequest) {\n return _this.receiveRequest(prackRequest);\n },\n onRefer: function onRefer(referRequest) {\n return _this.receiveRequest(referRequest);\n }\n };\n _this.session = session;\n _this.status = Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK;\n\n _this.accepted(message, Utils_1.Utils.getReasonPhrase(200));\n }).catch(function (error) {\n _this.onContextError(error); // FIXME: Assuming error due to async race on CANCEL and eating error.\n\n\n if (!_this._canceled) {\n throw error;\n }\n });\n\n return this;\n };\n /**\n * Report progress to the the caller.\n * Replies to the INVITE request with a 1xx provisional response.\n * @param options Options bucket.\n */\n\n\n InviteServerContext.prototype.progress = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // Ported\n\n\n var statusCode = options.statusCode || 180;\n\n if (statusCode < 100 || statusCode > 199) {\n throw new TypeError(\"Invalid statusCode: \" + statusCode);\n } // Ported\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n this.logger.warn(\"Unexpected call for progress while terminated, ignoring\");\n return this;\n } // Added\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_ANSWERED) {\n this.logger.warn(\"Unexpected call for progress while answered, ignoring\");\n return this;\n } // Added\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_ANSWERED_WAITING_FOR_PRACK) {\n this.logger.warn(\"Unexpected call for progress while answered (waiting for prack), ignoring\");\n return this;\n } // After the first reliable provisional response for a request has been\n // acknowledged, the UAS MAY send additional reliable provisional\n // responses. The UAS MUST NOT send a second reliable provisional\n // response until the first is acknowledged. After the first, it is\n // RECOMMENDED that the UAS not send an additional reliable provisional\n // response until the previous is acknowledged. The first reliable\n // provisional response receives special treatment because it conveys\n // the initial sequence number. If additional reliable provisional\n // responses were sent before the first was acknowledged, the UAS could\n // not be certain these were received in order.\n // https://tools.ietf.org/html/rfc3262#section-3\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_PRACK) {\n this.logger.warn(\"Unexpected call for progress while waiting for prack, ignoring\");\n return this;\n } // Ported\n\n\n if (options.statusCode === 100) {\n try {\n this.incomingRequest.trying();\n } catch (error) {\n this.onContextError(error); // FIXME: Assuming error due to async race on CANCEL and eating error.\n\n if (!this._canceled) {\n throw error;\n }\n }\n\n return this;\n } // Standard provisional response.\n\n\n if (!(this.rel100 === Constants_1.C.supported.REQUIRED) && !(this.rel100 === Constants_1.C.supported.SUPPORTED && options.rel100) && !(this.rel100 === Constants_1.C.supported.SUPPORTED && this.ua.configuration.rel100 === Constants_1.C.supported.REQUIRED)) {\n this._progress(options).catch(function (error) {\n _this.onContextError(error); // FIXME: Assuming error due to async race on CANCEL and eating error.\n\n\n if (!_this._canceled) {\n throw error;\n }\n });\n\n return this;\n } // Reliable provisional response.\n\n\n this._reliableProgressWaitForPrack(options).catch(function (error) {\n _this.onContextError(error); // FIXME: Assuming error due to async race on CANCEL and eating error.\n\n\n if (!_this._canceled) {\n throw error;\n }\n });\n\n return this;\n };\n /**\n * Reject an unaccepted incoming INVITE request or send BYE if established session.\n * @param options Options bucket. FIXME: This options bucket needs to be typed.\n */\n\n\n InviteServerContext.prototype.terminate = function (options) {\n // The caller's UA MAY send a BYE for either confirmed or early dialogs,\n // and the callee's UA MAY send a BYE on confirmed dialogs, but MUST NOT\n // send a BYE on early dialogs. However, the callee's UA MUST NOT send a\n // BYE on a confirmed dialog until it has received an ACK for its 2xx\n // response or until the server transaction times out.\n // https://tools.ietf.org/html/rfc3261#section-15\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // We don't yet have a dialog, so reject request.\n\n\n if (!this.session) {\n this.reject(options);\n return this;\n }\n\n switch (this.session.sessionState) {\n case core_1.SessionState.Initial:\n this.reject(options);\n return this;\n\n case core_1.SessionState.Early:\n this.reject(options);\n return this;\n\n case core_1.SessionState.AckWait:\n this.session.delegate = {\n // When ACK shows up, say BYE.\n onAck: function onAck() {\n _this.sendRequest(Constants_1.C.BYE, options);\n },\n // Or the server transaction times out before the ACK arrives.\n onAckTimeout: function onAckTimeout() {\n _this.sendRequest(Constants_1.C.BYE, options);\n }\n }; // Ported\n\n this.emit(\"bye\", this.request);\n this.terminated();\n return this;\n\n case core_1.SessionState.Confirmed:\n this.bye(options);\n return this;\n\n case core_1.SessionState.Terminated:\n return this;\n\n default:\n return this;\n }\n };\n\n InviteServerContext.prototype.onCancel = function (message) {\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER || this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_PRACK || this.status === Enums_1.SessionStatus.STATUS_ANSWERED_WAITING_FOR_PRACK || this.status === Enums_1.SessionStatus.STATUS_EARLY_MEDIA || this.status === Enums_1.SessionStatus.STATUS_ANSWERED) {\n this.status = Enums_1.SessionStatus.STATUS_CANCELED;\n this.incomingRequest.reject({\n statusCode: 487\n });\n this.canceled();\n this.rejected(message, Constants_1.C.causes.CANCELED);\n this.failed(message, Constants_1.C.causes.CANCELED);\n this.terminated(message, Constants_1.C.causes.CANCELED);\n }\n };\n\n InviteServerContext.prototype.receiveRequest = function (incomingRequest) {\n var _this = this;\n\n switch (incomingRequest.message.method) {\n case Constants_1.C.PRACK:\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_PRACK || this.status === Enums_1.SessionStatus.STATUS_ANSWERED_WAITING_FOR_PRACK) {\n if (!this.hasAnswer) {\n this.sessionDescriptionHandler = this.setupSessionDescriptionHandler();\n this.emit(\"SessionDescriptionHandler-created\", this.sessionDescriptionHandler);\n\n if (this.sessionDescriptionHandler.hasDescription(incomingRequest.message.getHeader(\"Content-Type\") || \"\")) {\n this.hasAnswer = true;\n this.sessionDescriptionHandler.setDescription(incomingRequest.message.body, this.sessionDescriptionHandlerOptions, this.modifiers).then(function () {\n clearTimeout(_this.timers.rel1xxTimer);\n clearTimeout(_this.timers.prackTimer);\n incomingRequest.accept();\n\n if (_this.status === Enums_1.SessionStatus.STATUS_ANSWERED_WAITING_FOR_PRACK) {\n _this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n\n _this.accept();\n }\n\n _this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n }, function (e) {\n _this.logger.warn(e);\n\n _this.terminate({\n statusCode: \"488\",\n reasonPhrase: \"Bad Media Description\"\n });\n\n _this.failed(incomingRequest.message, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n\n _this.terminated(incomingRequest.message, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n });\n } else {\n this.terminate({\n statusCode: \"488\",\n reasonPhrase: \"Bad Media Description\"\n });\n this.failed(incomingRequest.message, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n this.terminated(incomingRequest.message, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n }\n } else {\n clearTimeout(this.timers.rel1xxTimer);\n clearTimeout(this.timers.prackTimer);\n incomingRequest.accept();\n\n if (this.status === Enums_1.SessionStatus.STATUS_ANSWERED_WAITING_FOR_PRACK) {\n this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n this.accept();\n }\n\n this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n }\n } else if (this.status === Enums_1.SessionStatus.STATUS_EARLY_MEDIA) {\n incomingRequest.accept();\n }\n\n break;\n\n default:\n _super.prototype.receiveRequest.call(this, incomingRequest);\n\n break;\n }\n }; // Internal Function to setup the handler consistently\n\n\n InviteServerContext.prototype.setupSessionDescriptionHandler = function () {\n if (this.sessionDescriptionHandler) {\n return this.sessionDescriptionHandler;\n }\n\n return this.sessionDescriptionHandlerFactory(this, this.ua.configuration.sessionDescriptionHandlerFactoryOptions);\n };\n\n InviteServerContext.prototype.generateResponseOfferAnswer = function (options) {\n if (!this.session) {\n var body = core_1.getBody(this.incomingRequest.message);\n\n if (!body || body.contentDisposition !== \"session\") {\n return this.getOffer(options);\n } else {\n return this.setOfferAndGetAnswer(body, options);\n }\n } else {\n switch (this.session.signalingState) {\n case core_1.SignalingState.Initial:\n return this.getOffer(options);\n\n case core_1.SignalingState.Stable:\n return Promise.resolve(undefined);\n\n case core_1.SignalingState.HaveLocalOffer:\n // o Once the UAS has sent or received an answer to the initial\n // offer, it MUST NOT generate subsequent offers in any responses\n // to the initial INVITE. This means that a UAS based on this\n // specification alone can never generate subsequent offers until\n // completion of the initial transaction.\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n return Promise.resolve(undefined);\n\n case core_1.SignalingState.HaveRemoteOffer:\n if (!this.session.offer) {\n throw new Error(\"Session offer undefined\");\n }\n\n return this.setOfferAndGetAnswer(this.session.offer, options);\n\n case core_1.SignalingState.Closed:\n throw new Error(\"Invalid signaling state \" + this.session.signalingState + \".\");\n\n default:\n throw new Error(\"Invalid signaling state \" + this.session.signalingState + \".\");\n }\n }\n };\n\n InviteServerContext.prototype.handlePrackOfferAnswer = function (request, options) {\n if (!this.session) {\n throw new Error(\"Session undefined.\");\n } // If the PRACK doesn't have an offer/answer, nothing to be done.\n\n\n var body = core_1.getBody(request.message);\n\n if (!body || body.contentDisposition !== \"session\") {\n return Promise.resolve(undefined);\n } // If the UAC receives a reliable provisional response with an offer\n // (this would occur if the UAC sent an INVITE without an offer, in\n // which case the first reliable provisional response will contain the\n // offer), it MUST generate an answer in the PRACK. If the UAC receives\n // a reliable provisional response with an answer, it MAY generate an\n // additional offer in the PRACK. If the UAS receives a PRACK with an\n // offer, it MUST place the answer in the 2xx to the PRACK.\n // https://tools.ietf.org/html/rfc3262#section-5\n\n\n switch (this.session.signalingState) {\n case core_1.SignalingState.Initial:\n // State should never be reached as first reliable provisional response must have answer/offer.\n throw new Error(\"Invalid signaling state \" + this.session.signalingState + \".\");\n\n case core_1.SignalingState.Stable:\n // Receved answer.\n return this.setAnswer(body, options).then(function () {\n return undefined;\n });\n\n case core_1.SignalingState.HaveLocalOffer:\n // State should never be reached as local offer would be answered by this PRACK\n throw new Error(\"Invalid signaling state \" + this.session.signalingState + \".\");\n\n case core_1.SignalingState.HaveRemoteOffer:\n // Receved offer, generate answer.\n return this.setOfferAndGetAnswer(body, options);\n\n case core_1.SignalingState.Closed:\n throw new Error(\"Invalid signaling state \" + this.session.signalingState + \".\");\n\n default:\n throw new Error(\"Invalid signaling state \" + this.session.signalingState + \".\");\n }\n };\n /**\n * Called when session canceled.\n */\n\n\n InviteServerContext.prototype.canceled = function () {\n this._canceled = true;\n return _super.prototype.canceled.call(this);\n };\n /**\n * Called when session terminated.\n * Using it here just for the PRACK timeout.\n */\n\n\n InviteServerContext.prototype.terminated = function (message, cause) {\n this.prackNeverArrived();\n return _super.prototype.terminated.call(this, message, cause);\n };\n /**\n * A version of `accept` which resolves a session when the 200 Ok response is sent.\n * @param options Options bucket.\n * @throws {ClosedSessionDescriptionHandlerError} The session description handler closed before method completed.\n * @throws {TransactionStateError} The transaction state does not allow for `accept()` to be called.\n * Note that the transaction state can change while this call is in progress.\n */\n\n\n InviteServerContext.prototype._accept = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n } // FIXME: Ported - callback for in dialog INFO requests.\n // Turns out accept() can be called more than once if we are waiting\n // for a PRACK in which case \"options\" get completely tossed away.\n // So this is broken in that case (and potentially other uses of options).\n // Tempted to just try to fix it now, but leaving it broken for the moment.\n\n\n this.onInfo = options.onInfo; // The UAS MAY send a final response to the initial request before\n // having received PRACKs for all unacknowledged reliable provisional\n // responses, unless the final response is 2xx and any of the\n // unacknowledged reliable provisional responses contained a session\n // description. In that case, it MUST NOT send a final response until\n // those provisional responses are acknowledged. If the UAS does send a\n // final response when reliable responses are still unacknowledged, it\n // SHOULD NOT continue to retransmit the unacknowledged reliable\n // provisional responses, but it MUST be prepared to process PRACK\n // requests for those outstanding responses. A UAS MUST NOT send new\n // reliable provisional responses (as opposed to retransmissions of\n // unacknowledged ones) after sending a final response to a request.\n // https://tools.ietf.org/html/rfc3262#section-3\n\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_PRACK) {\n this.status = Enums_1.SessionStatus.STATUS_ANSWERED_WAITING_FOR_PRACK;\n return this.waitForArrivalOfPrack().then(function () {\n _this.status = Enums_1.SessionStatus.STATUS_ANSWERED;\n clearTimeout(_this.timers.userNoAnswerTimer); // Ported\n }).then(function () {\n return _this.generateResponseOfferAnswer(options);\n }).then(function (body) {\n return _this.incomingRequest.accept({\n statusCode: 200,\n body: body\n });\n });\n } // Ported\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER) {\n this.status = Enums_1.SessionStatus.STATUS_ANSWERED;\n } else {\n return Promise.reject(new Exceptions_1.Exceptions.InvalidStateError(this.status));\n }\n\n this.status = Enums_1.SessionStatus.STATUS_ANSWERED;\n clearTimeout(this.timers.userNoAnswerTimer); // Ported\n\n return this.generateResponseOfferAnswer(options).then(function (body) {\n return _this.incomingRequest.accept({\n statusCode: 200,\n body: body\n });\n });\n };\n /**\n * A version of `progress` which resolves when the provisional response is sent.\n * @param options Options bucket.\n * @throws {ClosedSessionDescriptionHandlerError} The session description handler closed before method completed.\n * @throws {TransactionStateError} The transaction state does not allow for `progress()` to be called.\n * Note that the transaction state can change while this call is in progress.\n */\n\n\n InviteServerContext.prototype._progress = function (options) {\n if (options === void 0) {\n options = {};\n } // Ported\n\n\n var statusCode = options.statusCode || 180;\n var reasonPhrase = options.reasonPhrase;\n var extraHeaders = (options.extraHeaders || []).slice();\n var body = options.body ? core_1.fromBodyLegacy(options.body) : undefined; // The 183 (Session Progress) response is used to convey information\n // about the progress of the call that is not otherwise classified. The\n // Reason-Phrase, header fields, or message body MAY be used to convey\n // more details about the call progress.\n // https://tools.ietf.org/html/rfc3261#section-21.1.5\n // It is the de facto industry standard to utilize 183 with SDP to provide \"early media\".\n // While it is unlikely someone would want to send a 183 without SDP, so it should be an option.\n\n if (statusCode === 183 && !body) {\n return this._progressWithSDP(options);\n }\n\n try {\n var progressResponse = this.incomingRequest.progress({\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n });\n this.emit(\"progress\", progressResponse.message, reasonPhrase); // Ported\n\n this.session = progressResponse.session;\n return Promise.resolve(progressResponse);\n } catch (error) {\n return Promise.reject(error);\n }\n };\n /**\n * A version of `progress` which resolves when the provisional response with sdp is sent.\n * @param options Options bucket.\n * @throws {ClosedSessionDescriptionHandlerError} The session description handler closed before method completed.\n * @throws {TransactionStateError} The transaction state does not allow for `progress()` to be called.\n * Note that the transaction state can change while this call is in progress.\n */\n\n\n InviteServerContext.prototype._progressWithSDP = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var statusCode = options.statusCode || 183;\n var reasonPhrase = options.reasonPhrase;\n var extraHeaders = (options.extraHeaders || []).slice(); // Get an offer/answer and send a reply.\n\n return this.generateResponseOfferAnswer(options).then(function (body) {\n return _this.incomingRequest.progress({\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n });\n }).then(function (progressResponse) {\n _this.emit(\"progress\", progressResponse.message, reasonPhrase); // Ported\n\n\n _this.session = progressResponse.session;\n return progressResponse;\n });\n };\n /**\n * A version of `progress` which resolves when the reliable provisional response is sent.\n * @param options Options bucket.\n * @throws {ClosedSessionDescriptionHandlerError} The session description handler closed before method completed.\n * @throws {TransactionStateError} The transaction state does not allow for `progress()` to be called.\n * Note that the transaction state can change while this call is in progress.\n */\n\n\n InviteServerContext.prototype._reliableProgress = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var statusCode = options.statusCode || 183;\n var reasonPhrase = options.reasonPhrase;\n var extraHeaders = (options.extraHeaders || []).slice();\n extraHeaders.push(\"Require: 100rel\");\n extraHeaders.push(\"RSeq: \" + Math.floor(Math.random() * 10000)); // Get an offer/answer and send a reply.\n\n return this.generateResponseOfferAnswer(options).then(function (body) {\n return _this.incomingRequest.progress({\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n });\n }).then(function (progressResponse) {\n _this.emit(\"progress\", progressResponse.message, reasonPhrase); // Ported\n\n\n _this.session = progressResponse.session;\n return progressResponse;\n });\n };\n /**\n * A version of `progress` which resolves when the reliable provisional response is acknowledged.\n * @param options Options bucket.\n * @throws {ClosedSessionDescriptionHandlerError} The session description handler closed before method completed.\n * @throws {TransactionStateError} The transaction state does not allow for `progress()` to be called.\n * Note that the transaction state can change while this call is in progress.\n */\n\n\n InviteServerContext.prototype._reliableProgressWaitForPrack = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var statusCode = options.statusCode || 183;\n var reasonPhrase = options.reasonPhrase;\n var extraHeaders = (options.extraHeaders || []).slice();\n extraHeaders.push(\"Require: 100rel\");\n extraHeaders.push(\"RSeq: \" + this.rseq++);\n var body; // Ported - set status.\n\n this.status = Enums_1.SessionStatus.STATUS_WAITING_FOR_PRACK;\n return new Promise(function (resolve, reject) {\n var waitingForPrack = true;\n return _this.generateResponseOfferAnswer(options).then(function (offerAnswer) {\n body = offerAnswer;\n return _this.incomingRequest.progress({\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n });\n }).then(function (progressResponse) {\n _this.emit(\"progress\", progressResponse.message, reasonPhrase); // Ported\n\n\n _this.session = progressResponse.session;\n var prackRequest;\n var prackResponse;\n progressResponse.session.delegate = {\n onPrack: function onPrack(request) {\n prackRequest = request;\n clearTimeout(prackWaitTimeoutTimer);\n clearTimeout(rel1xxRetransmissionTimer);\n\n if (!waitingForPrack) {\n return;\n }\n\n waitingForPrack = false;\n\n _this.handlePrackOfferAnswer(prackRequest, options).then(function (prackResponseBody) {\n try {\n prackResponse = prackRequest.accept({\n statusCode: 200,\n body: prackResponseBody\n }); // Ported - set status.\n\n if (_this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_PRACK) {\n _this.status = Enums_1.SessionStatus.STATUS_WAITING_FOR_ANSWER;\n }\n\n _this.prackArrived();\n\n resolve({\n prackRequest: prackRequest,\n prackResponse: prackResponse,\n progressResponse: progressResponse\n });\n } catch (error) {\n reject(error);\n }\n });\n }\n }; // https://tools.ietf.org/html/rfc3262#section-3\n\n var prackWaitTimeout = function prackWaitTimeout() {\n if (!waitingForPrack) {\n return;\n }\n\n waitingForPrack = false;\n\n _this.logger.warn(\"No PRACK received, rejecting INVITE.\");\n\n clearTimeout(rel1xxRetransmissionTimer);\n\n try {\n _this.incomingRequest.reject({\n statusCode: 504\n });\n\n _this.terminated(undefined, Constants_1.C.causes.NO_PRACK);\n\n reject(new Exceptions_1.Exceptions.TerminatedSessionError());\n } catch (error) {\n reject(error);\n }\n };\n\n var prackWaitTimeoutTimer = setTimeout(prackWaitTimeout, core_1.Timers.T1 * 64); // https://tools.ietf.org/html/rfc3262#section-3\n\n var rel1xxRetransmission = function rel1xxRetransmission() {\n try {\n _this.incomingRequest.progress({\n statusCode: statusCode,\n reasonPhrase: reasonPhrase,\n extraHeaders: extraHeaders,\n body: body\n });\n } catch (error) {\n waitingForPrack = false;\n reject(error);\n return;\n }\n\n rel1xxRetransmissionTimer = setTimeout(rel1xxRetransmission, timeout *= 2);\n };\n\n var timeout = core_1.Timers.T1;\n var rel1xxRetransmissionTimer = setTimeout(rel1xxRetransmission, timeout);\n });\n });\n };\n /**\n * Callback for when ACK for a 2xx response is never received.\n * @param session Session the ACK never arrived for\n */\n\n\n InviteServerContext.prototype.onAckTimeout = function () {\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK) {\n this.logger.log(\"no ACK received for an extended period of time, terminating the call\");\n\n if (!this.session) {\n throw new Error(\"Session undefined.\");\n }\n\n this.session.bye();\n this.terminated(undefined, Constants_1.C.causes.NO_ACK);\n }\n };\n /**\n * FIXME: TODO: The current library interface presents async methods without a\n * proper async error handling mechanism. Arguably a promise based interface\n * would be an improvement over the pattern of returning `this`. The approach has\n * been generally along the lines of log a error and terminate.\n */\n\n\n InviteServerContext.prototype.onContextError = function (error) {\n var statusCode = 480;\n\n if (error instanceof core_1.Exception) {\n // There might be interest in catching these Exceptions.\n if (error instanceof Exceptions_1.Exceptions.SessionDescriptionHandlerError) {\n this.logger.error(error.message);\n\n if (error.error) {\n this.logger.error(error.error);\n }\n } else if (error instanceof Exceptions_1.Exceptions.TerminatedSessionError) {\n // PRACK never arrived, so we timed out waiting for it.\n this.logger.warn(\"Incoming session terminated while waiting for PRACK.\");\n } else if (error instanceof Exceptions_1.Exceptions.UnsupportedSessionDescriptionContentTypeError) {\n statusCode = 415;\n } else if (error instanceof core_1.Exception) {\n this.logger.error(error.message);\n }\n } else if (error instanceof Error) {\n // Other Errors hould go uncaught.\n this.logger.error(error.message);\n } else {\n // We don't actually know what a session description handler implementation might throw\n // our way, so as a last resort, just assume we are getting an \"any\" and log it.\n this.logger.error(\"An error occurred in the session description handler.\");\n this.logger.error(error);\n }\n\n try {\n this.incomingRequest.reject({\n statusCode: statusCode\n }); // \"Temporarily Unavailable\"\n\n this.failed(this.incomingRequest.message, error.message);\n this.terminated(this.incomingRequest.message, error.message);\n } catch (error) {\n return;\n }\n };\n\n InviteServerContext.prototype.prackArrived = function () {\n if (this.waitingForPrackResolve) {\n this.waitingForPrackResolve();\n }\n\n this.waitingForPrackPromise = undefined;\n this.waitingForPrackResolve = undefined;\n this.waitingForPrackReject = undefined;\n };\n\n InviteServerContext.prototype.prackNeverArrived = function () {\n if (this.waitingForPrackReject) {\n this.waitingForPrackReject(new Exceptions_1.Exceptions.TerminatedSessionError());\n }\n\n this.waitingForPrackPromise = undefined;\n this.waitingForPrackResolve = undefined;\n this.waitingForPrackReject = undefined;\n };\n /**\n * @throws {Exceptions.TerminatedSessionError} The session terminated before being accepted (i.e. cancel arrived).\n */\n\n\n InviteServerContext.prototype.waitForArrivalOfPrack = function () {\n var _this = this;\n\n if (this.waitingForPrackPromise) {\n throw new Error(\"Already waiting for PRACK\");\n }\n\n this.waitingForPrackPromise = new Promise(function (resolve, reject) {\n _this.waitingForPrackResolve = resolve;\n _this.waitingForPrackReject = reject;\n });\n return this.waitingForPrackPromise;\n };\n\n InviteServerContext.prototype.getOffer = function (options) {\n this.hasOffer = true;\n var sdh = this.getSessionDescriptionHandler();\n return sdh.getDescription(options.sessionDescriptionHandlerOptions, options.modifiers).then(function (bodyObj) {\n return Utils_1.Utils.fromBodyObj(bodyObj);\n });\n };\n\n InviteServerContext.prototype.setAnswer = function (answer, options) {\n this.hasAnswer = true;\n var sdh = this.getSessionDescriptionHandler();\n\n if (!sdh.hasDescription(answer.contentType)) {\n return Promise.reject(new Exceptions_1.Exceptions.UnsupportedSessionDescriptionContentTypeError());\n }\n\n return sdh.setDescription(answer.content, options.sessionDescriptionHandlerOptions, options.modifiers);\n };\n\n InviteServerContext.prototype.setOfferAndGetAnswer = function (offer, options) {\n this.hasOffer = true;\n this.hasAnswer = true;\n var sdh = this.getSessionDescriptionHandler();\n\n if (!sdh.hasDescription(offer.contentType)) {\n return Promise.reject(new Exceptions_1.Exceptions.UnsupportedSessionDescriptionContentTypeError());\n }\n\n return sdh.setDescription(offer.content, options.sessionDescriptionHandlerOptions, options.modifiers).then(function () {\n return sdh.getDescription(options.sessionDescriptionHandlerOptions, options.modifiers);\n }).then(function (bodyObj) {\n return Utils_1.Utils.fromBodyObj(bodyObj);\n });\n };\n\n InviteServerContext.prototype.getSessionDescriptionHandler = function () {\n // Create our session description handler if not already done so...\n var sdh = this.sessionDescriptionHandler = this.setupSessionDescriptionHandler(); // FIXME: Ported - this can get emitted multiple times even when only created once... don't we care?\n\n this.emit(\"SessionDescriptionHandler-created\", this.sessionDescriptionHandler); // Return.\n\n return sdh;\n };\n\n return InviteServerContext;\n}(Session);\n\nexports.InviteServerContext = InviteServerContext; // tslint:disable-next-line:max-classes-per-file\n\nvar InviteClientContext =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(InviteClientContext, _super);\n\n function InviteClientContext(ua, target, options, modifiers) {\n if (options === void 0) {\n options = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n var _this = this;\n\n if (!ua.configuration.sessionDescriptionHandlerFactory) {\n ua.logger.warn(\"Can't build ISC without SDH Factory\");\n throw new Error(\"ICC Constructor Failed\");\n }\n\n options.params = options.params || {};\n var anonymous = options.anonymous || false;\n var fromTag = Utils_1.Utils.newTag();\n options.params.fromTag = fromTag;\n /* Do not add ;ob in initial forming dialog requests if the registration over\n * the current connection got a GRUU URI.\n */\n\n var contact = ua.contact.toString({\n anonymous: anonymous,\n outbound: anonymous ? !ua.contact.tempGruu : !ua.contact.pubGruu\n });\n var extraHeaders = (options.extraHeaders || []).slice();\n\n if (anonymous && ua.configuration.uri) {\n options.params.fromDisplayName = \"Anonymous\";\n options.params.fromUri = \"sip:anonymous@anonymous.invalid\";\n extraHeaders.push(\"P-Preferred-Identity: \" + ua.configuration.uri.toString());\n extraHeaders.push(\"Privacy: id\");\n }\n\n extraHeaders.push(\"Contact: \" + contact); // this is UA.C.ALLOWED_METHODS, removed to get around circular dependency\n\n extraHeaders.push(\"Allow: \" + [\"ACK\", \"CANCEL\", \"INVITE\", \"MESSAGE\", \"BYE\", \"OPTIONS\", \"INFO\", \"NOTIFY\", \"REFER\"].toString());\n\n if (ua.configuration.rel100 === Constants_1.C.supported.REQUIRED) {\n extraHeaders.push(\"Require: 100rel\");\n }\n\n if (ua.configuration.replaces === Constants_1.C.supported.REQUIRED) {\n extraHeaders.push(\"Require: replaces\");\n }\n\n options.extraHeaders = extraHeaders;\n _this = _super.call(this, ua.configuration.sessionDescriptionHandlerFactory) || this;\n ClientContext_1.ClientContext.initializer(_this, ua, Constants_1.C.INVITE, target, options);\n _this.earlyMediaSessionDescriptionHandlers = new Map();\n _this.type = Enums_1.TypeStrings.InviteClientContext;\n _this.passedOptions = options; // Save for later to use with refer\n\n _this.sessionDescriptionHandlerOptions = options.sessionDescriptionHandlerOptions || {};\n _this.modifiers = modifiers;\n _this.inviteWithoutSdp = options.inviteWithoutSdp || false; // Set anonymous property\n\n _this.anonymous = options.anonymous || false; // Custom data to be sent either in INVITE or in ACK\n\n _this.renderbody = options.renderbody || undefined;\n _this.rendertype = options.rendertype || \"text/plain\"; // Session parameter initialization\n\n _this.fromTag = fromTag;\n _this.contact = contact; // Check Session Status\n\n if (_this.status !== Enums_1.SessionStatus.STATUS_NULL) {\n throw new Exceptions_1.Exceptions.InvalidStateError(_this.status);\n } // OutgoingSession specific parameters\n\n\n _this.isCanceled = false;\n _this.received100 = false;\n _this.method = Constants_1.C.INVITE;\n _this.logger = ua.getLogger(\"sip.inviteclientcontext\");\n ua.applicants[_this.toString()] = _this;\n _this.id = _this.request.callId + _this.fromTag;\n _this.onInfo = options.onInfo;\n _this.errorListener = _this.onTransportError.bind(_this);\n\n if (ua.transport) {\n ua.transport.on(\"transportError\", _this.errorListener);\n }\n\n return _this;\n }\n\n InviteClientContext.prototype.receiveResponse = function (response) {\n throw new Error(\"Unimplemented.\");\n }; // hack for getting around ClientContext interface\n\n\n InviteClientContext.prototype.send = function () {\n this.sendInvite();\n return this;\n };\n\n InviteClientContext.prototype.invite = function () {\n var _this = this; // Save the session into the ua sessions collection.\n // Note: placing in constructor breaks call to request.cancel on close... User does not need this anyway\n\n\n this.ua.sessions[this.id] = this; // This should allow the function to return so that listeners can be set up for these events\n\n Promise.resolve().then(function () {\n // FIXME: There is a race condition where cancel (or terminate) can be called synchronously after invite.\n if (_this.isCanceled || _this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return;\n }\n\n if (_this.inviteWithoutSdp) {\n // just send an invite with no sdp...\n if (_this.renderbody && _this.rendertype) {\n _this.request.body = {\n body: _this.renderbody,\n contentType: _this.rendertype\n };\n }\n\n _this.status = Enums_1.SessionStatus.STATUS_INVITE_SENT;\n\n _this.send();\n } else {\n // Initialize Media Session\n _this.sessionDescriptionHandler = _this.sessionDescriptionHandlerFactory(_this, _this.ua.configuration.sessionDescriptionHandlerFactoryOptions || {});\n\n _this.emit(\"SessionDescriptionHandler-created\", _this.sessionDescriptionHandler);\n\n _this.sessionDescriptionHandler.getDescription(_this.sessionDescriptionHandlerOptions, _this.modifiers).then(function (description) {\n // FIXME: There is a race condition where cancel (or terminate) can be called (a)synchronously after invite.\n if (_this.isCanceled || _this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return;\n }\n\n _this.hasOffer = true;\n _this.request.body = description;\n _this.status = Enums_1.SessionStatus.STATUS_INVITE_SENT;\n\n _this.send();\n }, function (err) {\n if (err.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n _this.logger.log(err.message);\n\n if (err.error) {\n _this.logger.log(err.error);\n }\n }\n\n if (_this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return;\n }\n\n _this.failed(undefined, Constants_1.C.causes.WEBRTC_ERROR);\n\n _this.terminated(undefined, Constants_1.C.causes.WEBRTC_ERROR);\n });\n }\n });\n return this;\n };\n\n InviteClientContext.prototype.cancel = function (options) {\n if (options === void 0) {\n options = {};\n } // Check Session Status\n\n\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED || this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n throw new Exceptions_1.Exceptions.InvalidStateError(this.status);\n }\n\n if (this.isCanceled) {\n throw new Exceptions_1.Exceptions.InvalidStateError(Enums_1.SessionStatus.STATUS_CANCELED);\n }\n\n this.isCanceled = true;\n this.logger.log(\"Canceling session\");\n var cancelReason = Utils_1.Utils.getCancelReason(options.statusCode, options.reasonPhrase);\n options.extraHeaders = (options.extraHeaders || []).slice();\n\n if (this.outgoingInviteRequest) {\n this.logger.warn(\"Canceling session before it was created\");\n this.outgoingInviteRequest.cancel(cancelReason, options);\n }\n\n return this.canceled();\n };\n\n InviteClientContext.prototype.terminate = function (options) {\n if (this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return this;\n }\n\n if (this.status === Enums_1.SessionStatus.STATUS_WAITING_FOR_ACK || this.status === Enums_1.SessionStatus.STATUS_CONFIRMED) {\n this.bye(options);\n } else {\n this.cancel(options);\n }\n\n return this;\n };\n /**\n * 13.2.1 Creating the Initial INVITE\n *\n * Since the initial INVITE represents a request outside of a dialog,\n * its construction follows the procedures of Section 8.1.1. Additional\n * processing is required for the specific case of INVITE.\n *\n * An Allow header field (Section 20.5) SHOULD be present in the INVITE.\n * It indicates what methods can be invoked within a dialog, on the UA\n * sending the INVITE, for the duration of the dialog. For example, a\n * UA capable of receiving INFO requests within a dialog [34] SHOULD\n * include an Allow header field listing the INFO method.\n *\n * A Supported header field (Section 20.37) SHOULD be present in the\n * INVITE. It enumerates all the extensions understood by the UAC.\n *\n * An Accept (Section 20.1) header field MAY be present in the INVITE.\n * It indicates which Content-Types are acceptable to the UA, in both\n * the response received by it, and in any subsequent requests sent to\n * it within dialogs established by the INVITE. The Accept header field\n * is especially useful for indicating support of various session\n * description formats.\n *\n * The UAC MAY add an Expires header field (Section 20.19) to limit the\n * validity of the invitation. If the time indicated in the Expires\n * header field is reached and no final answer for the INVITE has been\n * received, the UAC core SHOULD generate a CANCEL request for the\n * INVITE, as per Section 9.\n *\n * A UAC MAY also find it useful to add, among others, Subject (Section\n * 20.36), Organization (Section 20.25) and User-Agent (Section 20.41)\n * header fields. They all contain information related to the INVITE.\n *\n * The UAC MAY choose to add a message body to the INVITE. Section\n * 8.1.1.10 deals with how to construct the header fields -- Content-\n * Type among others -- needed to describe the message body.\n *\n * https://tools.ietf.org/html/rfc3261#section-13.2.1\n */\n\n\n InviteClientContext.prototype.sendInvite = function () {\n // There are special rules for message bodies that contain a session\n // description - their corresponding Content-Disposition is \"session\".\n // SIP uses an offer/answer model where one UA sends a session\n // description, called the offer, which contains a proposed description\n // of the session. The offer indicates the desired communications means\n // (audio, video, games), parameters of those means (such as codec\n // types) and addresses for receiving media from the answerer. The\n // other UA responds with another session description, called the\n // answer, which indicates which communications means are accepted, the\n // parameters that apply to those means, and addresses for receiving\n // media from the offerer. An offer/answer exchange is within the\n // context of a dialog, so that if a SIP INVITE results in multiple\n // dialogs, each is a separate offer/answer exchange. The offer/answer\n // model defines restrictions on when offers and answers can be made\n // (for example, you cannot make a new offer while one is in progress).\n // This results in restrictions on where the offers and answers can\n // appear in SIP messages. In this specification, offers and answers\n // can only appear in INVITE requests and responses, and ACK. The usage\n // of offers and answers is further restricted. For the initial INVITE\n // transaction, the rules are:\n //\n // o The initial offer MUST be in either an INVITE or, if not there,\n // in the first reliable non-failure message from the UAS back to\n // the UAC. In this specification, that is the final 2xx\n // response.\n //\n // o If the initial offer is in an INVITE, the answer MUST be in a\n // reliable non-failure message from UAS back to UAC which is\n // correlated to that INVITE. For this specification, that is\n // only the final 2xx response to that INVITE. That same exact\n // answer MAY also be placed in any provisional responses sent\n // prior to the answer. The UAC MUST treat the first session\n // description it receives as the answer, and MUST ignore any\n // session descriptions in subsequent responses to the initial\n // INVITE.\n //\n // o If the initial offer is in the first reliable non-failure\n // message from the UAS back to UAC, the answer MUST be in the\n // acknowledgement for that message (in this specification, ACK\n // for a 2xx response).\n //\n // o After having sent or received an answer to the first offer, the\n // UAC MAY generate subsequent offers in requests based on rules\n // specified for that method, but only if it has received answers\n // to any previous offers, and has not sent any offers to which it\n // hasn't gotten an answer.\n //\n // o Once the UAS has sent or received an answer to the initial\n // offer, it MUST NOT generate subsequent offers in any responses\n // to the initial INVITE. This means that a UAS based on this\n // specification alone can never generate subsequent offers until\n // completion of the initial transaction.\n //\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n var _this = this; // 5 The Offer/Answer Model and PRACK\n //\n // RFC 3261 describes guidelines for the sets of messages in which\n // offers and answers [3] can appear. Based on those guidelines, this\n // extension provides additional opportunities for offer/answer\n // exchanges.\n // If the INVITE contained an offer, the UAS MAY generate an answer in a\n // reliable provisional response (assuming these are supported by the\n // UAC). That results in the establishment of the session before\n // completion of the call. Similarly, if a reliable provisional\n // response is the first reliable message sent back to the UAC, and the\n // INVITE did not contain an offer, one MUST appear in that reliable\n // provisional response.\n // If the UAC receives a reliable provisional response with an offer\n // (this would occur if the UAC sent an INVITE without an offer, in\n // which case the first reliable provisional response will contain the\n // offer), it MUST generate an answer in the PRACK. If the UAC receives\n // a reliable provisional response with an answer, it MAY generate an\n // additional offer in the PRACK. If the UAS receives a PRACK with an\n // offer, it MUST place the answer in the 2xx to the PRACK.\n // Once an answer has been sent or received, the UA SHOULD establish the\n // session based on the parameters of the offer and answer, even if the\n // original INVITE itself has not been responded to.\n // If the UAS had placed a session description in any reliable\n // provisional response that is unacknowledged when the INVITE is\n // accepted, the UAS MUST delay sending the 2xx until the provisional\n // response is acknowledged. Otherwise, the reliability of the 1xx\n // cannot be guaranteed, and reliability is needed for proper operation\n // of the offer/answer exchange.\n // All user agents that support this extension MUST support all\n // offer/answer exchanges that are possible based on the rules in\n // Section 13.2 of RFC 3261, based on the existence of INVITE and PRACK\n // as requests, and 2xx and reliable 1xx as non-failure reliable\n // responses.\n //\n // https://tools.ietf.org/html/rfc3262#section-5\n ////\n // The Offer/Answer Model Implementation\n //\n // The offer/answer model is straight forward, but one MUST READ the specifications...\n //\n // 13.2.1 Creating the Initial INVITE (paragraph 8 in particular)\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n //\n // 5 The Offer/Answer Model and PRACK\n // https://tools.ietf.org/html/rfc3262#section-5\n //\n // Session Initiation Protocol (SIP) Usage of the Offer/Answer Model\n // https://tools.ietf.org/html/rfc6337\n //\n // *** IMPORTANT IMPLEMENTATION CHOICES ***\n //\n // TLDR...\n //\n // 1) Only one offer/answer exchange permitted during initial INVITE.\n // 2) No \"early media\" if the initial offer is in an INVITE.\n //\n //\n // 1) Initial Offer/Answer Restriction.\n //\n // Our implementation replaces the following bullet point...\n //\n // o After having sent or received an answer to the first offer, the\n // UAC MAY generate subsequent offers in requests based on rules\n // specified for that method, but only if it has received answers\n // to any previous offers, and has not sent any offers to which it\n // hasn't gotten an answer.\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n //\n // ...with...\n //\n // o After having sent or received an answer to the first offer, the\n // UAC MUST NOT generate subsequent offers in requests based on rules\n // specified for that method.\n //\n // ...which in combination with this bullet point...\n //\n // o Once the UAS has sent or received an answer to the initial\n // offer, it MUST NOT generate subsequent offers in any responses\n // to the initial INVITE. This means that a UAS based on this\n // specification alone can never generate subsequent offers until\n // completion of the initial transaction.\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n //\n // ...ensures that EXACTLY ONE offer/answer exchange will occur\n // during an initial out of dialog INVITE request made by our UAC.\n //\n //\n // 2) Early Media Restriction.\n //\n // While our implementation adheres to the following bullet point...\n //\n // o If the initial offer is in an INVITE, the answer MUST be in a\n // reliable non-failure message from UAS back to UAC which is\n // correlated to that INVITE. For this specification, that is\n // only the final 2xx response to that INVITE. That same exact\n // answer MAY also be placed in any provisional responses sent\n // prior to the answer. The UAC MUST treat the first session\n // description it receives as the answer, and MUST ignore any\n // session descriptions in subsequent responses to the initial\n // INVITE.\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n //\n // We have made the following implementation decision with regard to early media...\n //\n // o If the initial offer is in the INVITE, the answer from the\n // UAS back to the UAC will establish a media session only\n // only after the final 2xx response to that INVITE is received.\n //\n // The reason for this decision is rooted in a restriction currently\n // inherent in WebRTC. Specifically, while a SIP INVITE request with an\n // initial offer may fork resulting in more than one provisional answer,\n // there is currently no easy/good way to to \"fork\" an offer generated\n // by a peer connection. In particular, a WebRTC offer currently may only\n // be matched with one answer and we have no good way to know which\n // \"provisional answer\" is going to be the \"final answer\". So we have\n // decided to punt and not create any \"early media\" sessions in this case.\n //\n // The upshot is that if you want \"early media\", you must not put the\n // initial offer in the INVITE. Instead, force the UAS to provide the\n // initial offer by sending an INVITE without an offer. In the WebRTC\n // case this allows us to create a unique peer connection with a unique\n // answer for every provisional offer with \"early media\" on all of them.\n ////\n ////\n // ROADMAP: The Offer/Answer Model Implementation\n //\n // The \"no early media if offer in INVITE\" implementation is not a\n // welcome one. The masses want it. The want it and they want it\n // to work for WebRTC (so they want to have their cake and eat too).\n //\n // So while we currently cannot make the offer in INVITE+forking+webrtc\n // case work, we decided to do the following...\n //\n // 1) modify SDH Factory to provide an initial offer without giving us the SDH, and then...\n // 2) stick that offer in the initial INVITE, and when 183 with initial answer is received...\n // 3) ask SDH Factory if it supports \"earlyRemoteAnswer\"\n // a) if true, ask SDH Factory to createSDH(localOffer).then((sdh) => sdh.setDescription(remoteAnswer)\n // b) if false, defer getting a SDH until 2xx response is received\n //\n // Our supplied WebRTC SDH will default to behavior 3b which works in forking environment (without)\n // early media if initial offer is in the INVITE). We will, however, provide an \"inviteWillNotFork\"\n // option which if set to \"true\" will have our supplied WebRTC SDH behave in the 3a manner.\n // That will result in\n // - early media working with initial offer in the INVITE, and...\n // - if the INVITE forks, the session terminating with an ERROR that reads like\n // \"You set 'inviteWillNotFork' to true but the INVITE forked. You can't eat your cake, and have it too.\"\n // - furthermore, we accept that users will report that error to us as \"bug\" regardless\n //\n // So, SDH Factory is going to end up with a new interface along the lines of...\n //\n // interface SessionDescriptionHandlerFactory {\n // makeLocalOffer(): Promise;\n // makeSessionDescriptionHandler(\n // initialOffer: ContentTypeAndBody, offerType: \"local\" | \"remote\"\n // ): Promise;\n // supportsEarlyRemoteAnswer: boolean;\n // supportsContentType(contentType: string): boolean;\n // getDescription(description: ContentTypeAndBody): Promise\n // setDescription(description: ContentTypeAndBody): Promise\n // }\n //\n // We should be able to get rid of all the hasOffer/hasAnswer tracking code and otherwise code\n // it up to the same interaction with the SDH Factory and SDH regardless of signaling scenario.\n ////\n // Send the INVITE request.\n\n\n this.outgoingInviteRequest = this.ua.userAgentCore.invite(this.request, {\n onAccept: function onAccept(inviteResponse) {\n return _this.onAccept(inviteResponse);\n },\n onProgress: function onProgress(inviteResponse) {\n return _this.onProgress(inviteResponse);\n },\n onRedirect: function onRedirect(inviteResponse) {\n return _this.onRedirect(inviteResponse);\n },\n onReject: function onReject(inviteResponse) {\n return _this.onReject(inviteResponse);\n },\n onTrying: function onTrying(inviteResponse) {\n return _this.onTrying(inviteResponse);\n }\n });\n };\n\n InviteClientContext.prototype.ackAndBye = function (inviteResponse, session, statusCode, reasonPhrase) {\n if (!this.ua.userAgentCore) {\n throw new Error(\"Method requires user agent core.\");\n }\n\n var extraHeaders = [];\n\n if (statusCode) {\n extraHeaders.push(\"Reason: \" + Utils_1.Utils.getReasonHeaderValue(statusCode, reasonPhrase));\n }\n\n var outgoingAckRequest = inviteResponse.ack();\n this.emit(\"ack\", outgoingAckRequest.message);\n var outgoingByeRequest = session.bye(undefined, {\n extraHeaders: extraHeaders\n });\n this.emit(\"bye\", outgoingByeRequest.message);\n };\n\n InviteClientContext.prototype.disposeEarlyMedia = function () {\n if (!this.earlyMediaSessionDescriptionHandlers) {\n throw new Error(\"Early media session description handlers undefined.\");\n }\n\n this.earlyMediaSessionDescriptionHandlers.forEach(function (sessionDescriptionHandler) {\n sessionDescriptionHandler.close();\n });\n };\n /**\n * Handle final response to initial INVITE.\n * @param inviteResponse 2xx response.\n */\n\n\n InviteClientContext.prototype.onAccept = function (inviteResponse) {\n var _this = this;\n\n if (!this.earlyMediaSessionDescriptionHandlers) {\n throw new Error(\"Early media session description handlers undefined.\");\n }\n\n var response = inviteResponse.message;\n var session = inviteResponse.session; // Our transaction layer is \"non-standard\" in that it will only\n // pass us a 2xx response once per branch, so there is no need to\n // worry about dealing with 2xx retransmissions. However, we can\n // and do still get 2xx responses for multiple branches (when an\n // INVITE is forked) which may create multiple confirmed dialogs.\n // Herein we are acking and sending a bye to any confirmed dialogs\n // which arrive beyond the first one. This is the desired behavior\n // for most applications (but certainly not all).\n // If we already received a confirmed dialog, ack & bye this session.\n\n if (this.session) {\n this.ackAndBye(inviteResponse, session);\n return;\n } // If the user requested cancellation, ack & bye this session.\n\n\n if (this.isCanceled) {\n this.ackAndBye(inviteResponse, session);\n this.emit(\"bye\", this.request); // FIXME: Ported this odd second \"bye\" emit\n\n return;\n } // Ported behavior.\n\n\n if (response.hasHeader(\"P-Asserted-Identity\")) {\n this.assertedIdentity = core_1.Grammar.nameAddrHeaderParse(response.getHeader(\"P-Asserted-Identity\"));\n } // We have a confirmed dialog.\n\n\n this.session = session;\n this.session.delegate = {\n onAck: function onAck(ackRequest) {\n return _this.onAck(ackRequest);\n },\n onBye: function onBye(byeRequest) {\n return _this.receiveRequest(byeRequest);\n },\n onInfo: function onInfo(infoRequest) {\n return _this.receiveRequest(infoRequest);\n },\n onInvite: function onInvite(inviteRequest) {\n return _this.receiveRequest(inviteRequest);\n },\n onNotify: function onNotify(notifyRequest) {\n return _this.receiveRequest(notifyRequest);\n },\n onPrack: function onPrack(prackRequest) {\n return _this.receiveRequest(prackRequest);\n },\n onRefer: function onRefer(referRequest) {\n return _this.receiveRequest(referRequest);\n }\n };\n\n switch (session.signalingState) {\n case core_1.SignalingState.Initial:\n // INVITE without Offer, so MUST have Offer at this point, so invalid state.\n this.ackAndBye(inviteResponse, session, 400, \"Missing session description\");\n this.failed(response, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n break;\n\n case core_1.SignalingState.HaveLocalOffer:\n // INVITE with Offer, so MUST have Answer at this point, so invalid state.\n this.ackAndBye(inviteResponse, session, 400, \"Missing session description\");\n this.failed(response, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n break;\n\n case core_1.SignalingState.HaveRemoteOffer:\n // INVITE without Offer, received offer in 2xx, so MUST send Answer in ACK.\n var sdh_1 = this.sessionDescriptionHandlerFactory(this, this.ua.configuration.sessionDescriptionHandlerFactoryOptions || {});\n this.sessionDescriptionHandler = sdh_1;\n this.emit(\"SessionDescriptionHandler-created\", this.sessionDescriptionHandler);\n\n if (!sdh_1.hasDescription(response.getHeader(\"Content-Type\") || \"\")) {\n this.ackAndBye(inviteResponse, session, 400, \"Missing session description\");\n this.failed(response, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n break;\n }\n\n this.hasOffer = true;\n sdh_1.setDescription(response.body, this.sessionDescriptionHandlerOptions, this.modifiers).then(function () {\n return sdh_1.getDescription(_this.sessionDescriptionHandlerOptions, _this.modifiers);\n }).then(function (description) {\n if (_this.isCanceled || _this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return;\n }\n\n _this.status = Enums_1.SessionStatus.STATUS_CONFIRMED;\n _this.hasAnswer = true;\n var body = {\n contentDisposition: \"session\",\n contentType: description.contentType,\n content: description.body\n };\n var ackRequest = inviteResponse.ack({\n body: body\n });\n\n _this.emit(\"ack\", ackRequest.message);\n\n _this.accepted(response);\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n _this.logger.warn(\"invalid description\");\n\n _this.logger.warn(e.toString()); // TODO: This message is inconsistent\n\n\n _this.ackAndBye(inviteResponse, session, 488, \"Invalid session description\");\n\n _this.failed(response, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION);\n } else {\n throw e;\n }\n });\n break;\n\n case core_1.SignalingState.Stable:\n // This session has completed an initial offer/answer exchange...\n var options_1;\n\n if (this.renderbody && this.rendertype) {\n options_1 = {\n body: {\n contentDisposition: \"render\",\n contentType: this.rendertype,\n content: this.renderbody\n }\n };\n } // If INVITE with Offer and we have been waiting till now to apply the answer.\n\n\n if (this.hasOffer && !this.hasAnswer) {\n if (!this.sessionDescriptionHandler) {\n throw new Error(\"Session description handler undefined.\");\n }\n\n var answer = session.answer;\n\n if (!answer) {\n throw new Error(\"Answer is undefined.\");\n }\n\n this.sessionDescriptionHandler.setDescription(answer.content, this.sessionDescriptionHandlerOptions, this.modifiers).then(function () {\n _this.hasAnswer = true;\n _this.status = Enums_1.SessionStatus.STATUS_CONFIRMED;\n var ackRequest = inviteResponse.ack(options_1);\n\n _this.emit(\"ack\", ackRequest.message);\n\n _this.accepted(response);\n }).catch(function (error) {\n _this.logger.error(error);\n\n _this.ackAndBye(inviteResponse, session, 488, \"Not Acceptable Here\");\n\n _this.failed(response, Constants_1.C.causes.BAD_MEDIA_DESCRIPTION); // FIME: DON'T EAT UNHANDLED ERRORS!\n\n });\n } else {\n // Otherwise INVITE with or without Offer and we have already completed the initial exchange.\n this.sessionDescriptionHandler = this.earlyMediaSessionDescriptionHandlers.get(session.id);\n\n if (!this.sessionDescriptionHandler) {\n throw new Error(\"Session description handler undefined.\");\n }\n\n this.earlyMediaSessionDescriptionHandlers.delete(session.id);\n this.hasOffer = true;\n this.hasAnswer = true;\n this.status = Enums_1.SessionStatus.STATUS_CONFIRMED;\n var ackRequest = inviteResponse.ack();\n this.emit(\"ack\", ackRequest.message);\n this.accepted(response);\n }\n\n break;\n\n case core_1.SignalingState.Closed:\n // Dialog has terminated.\n break;\n\n default:\n throw new Error(\"Unknown session signaling state.\");\n }\n\n this.disposeEarlyMedia();\n };\n /**\n * Handle provisional response to initial INVITE.\n * @param inviteResponse 1xx response.\n */\n\n\n InviteClientContext.prototype.onProgress = function (inviteResponse) {\n var _this = this; // Ported - User requested cancellation.\n\n\n if (this.isCanceled) {\n return;\n }\n\n if (!this.outgoingInviteRequest) {\n throw new Error(\"Outgoing INVITE request undefined.\");\n }\n\n if (!this.earlyMediaSessionDescriptionHandlers) {\n throw new Error(\"Early media session description handlers undefined.\");\n }\n\n var response = inviteResponse.message;\n var session = inviteResponse.session; // Ported - Set status.\n\n this.status = Enums_1.SessionStatus.STATUS_1XX_RECEIVED; // Ported - Set assertedIdentity.\n\n if (response.hasHeader(\"P-Asserted-Identity\")) {\n this.assertedIdentity = core_1.Grammar.nameAddrHeaderParse(response.getHeader(\"P-Asserted-Identity\"));\n } // The provisional response MUST establish a dialog if one is not yet created.\n // https://tools.ietf.org/html/rfc3262#section-4\n\n\n if (!session) {\n // A response with a to tag MUST create a session (should never get here).\n throw new Error(\"Session undefined.\");\n } // If a provisional response is received for an initial request, and\n // that response contains a Require header field containing the option\n // tag 100rel, the response is to be sent reliably. If the response is\n // a 100 (Trying) (as opposed to 101 to 199), this option tag MUST be\n // ignored, and the procedures below MUST NOT be used.\n // https://tools.ietf.org/html/rfc3262#section-4\n\n\n var requireHeader = response.getHeader(\"require\");\n var rseqHeader = response.getHeader(\"rseq\");\n var rseq = requireHeader && requireHeader.includes(\"100rel\") && rseqHeader ? Number(rseqHeader) : undefined;\n var responseReliable = !!rseq;\n var extraHeaders = [];\n\n if (responseReliable) {\n extraHeaders.push(\"RAck: \" + response.getHeader(\"rseq\") + \" \" + response.getHeader(\"cseq\"));\n } // INVITE without Offer and session still has no offer (and no answer).\n\n\n if (session.signalingState === core_1.SignalingState.Initial) {\n // Similarly, if a reliable provisional\n // response is the first reliable message sent back to the UAC, and the\n // INVITE did not contain an offer, one MUST appear in that reliable\n // provisional response.\n // https://tools.ietf.org/html/rfc3262#section-5\n if (responseReliable) {\n this.logger.warn(\"First reliable provisional response received MUST contain an offer when INVITE does not contain an offer.\"); // FIXME: Known popular UA's currently end up here...\n\n inviteResponse.prack({\n extraHeaders: extraHeaders\n });\n }\n\n this.emit(\"progress\", response);\n return;\n } // INVITE with Offer and session only has that initial local offer.\n\n\n if (session.signalingState === core_1.SignalingState.HaveLocalOffer) {\n if (responseReliable) {\n inviteResponse.prack({\n extraHeaders: extraHeaders\n });\n }\n\n this.emit(\"progress\", response);\n return;\n } // INVITE without Offer and received initial offer in provisional response\n\n\n if (session.signalingState === core_1.SignalingState.HaveRemoteOffer) {\n // The initial offer MUST be in either an INVITE or, if not there,\n // in the first reliable non-failure message from the UAS back to\n // the UAC.\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n // According to Section 13.2.1 of [RFC3261], 'The first reliable\n // non-failure message' must have an offer if there is no offer in the\n // INVITE request. This means that the User Agent (UA) that receives\n // the INVITE request without an offer must include an offer in the\n // first reliable response with 100rel extension. If no reliable\n // provisional response has been sent, the User Agent Server (UAS) must\n // include an offer when sending 2xx response.\n // https://tools.ietf.org/html/rfc6337#section-2.2\n if (!responseReliable) {\n this.logger.warn(\"Non-reliable provisional response MUST NOT contain an initial offer, discarding response.\");\n return;\n } // If the initial offer is in the first reliable non-failure\n // message from the UAS back to UAC, the answer MUST be in the\n // acknowledgement for that message\n\n\n var sdh_2 = this.sessionDescriptionHandlerFactory(this, this.ua.configuration.sessionDescriptionHandlerFactoryOptions || {});\n this.emit(\"SessionDescriptionHandler-created\", sdh_2);\n this.earlyMediaSessionDescriptionHandlers.set(session.id, sdh_2);\n sdh_2.setDescription(response.body, this.sessionDescriptionHandlerOptions, this.modifiers).then(function () {\n return sdh_2.getDescription(_this.sessionDescriptionHandlerOptions, _this.modifiers);\n }).then(function (description) {\n var body = {\n contentDisposition: \"session\",\n contentType: description.contentType,\n content: description.body\n };\n inviteResponse.prack({\n extraHeaders: extraHeaders,\n body: body\n });\n _this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n\n _this.emit(\"progress\", response);\n }).catch(function (error) {\n if (_this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return;\n }\n\n _this.failed(undefined, Constants_1.C.causes.WEBRTC_ERROR);\n\n _this.terminated(undefined, Constants_1.C.causes.WEBRTC_ERROR);\n });\n return;\n } // This session has completed an initial offer/answer exchange, so...\n // - INVITE with SDP and this provisional response MAY be reliable\n // - INVITE without SDP and this provisional response MAY be reliable\n\n\n if (session.signalingState === core_1.SignalingState.Stable) {\n if (responseReliable) {\n inviteResponse.prack({\n extraHeaders: extraHeaders\n });\n } // Note: As documented, no early media if offer was in INVITE, so nothing to be done.\n // FIXME: TODO: Add a flag/hack to allow early media in this case. There are people\n // in non-forking environments (think straight to FreeSWITCH) who want\n // early media on a 183. Not sure how to actually make it work, basically\n // something like...\n\n\n if (0\n /* flag */\n && this.hasOffer && !this.hasAnswer && this.sessionDescriptionHandler) {\n this.hasAnswer = true;\n this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n this.sessionDescriptionHandler.setDescription(response.body, this.sessionDescriptionHandlerOptions, this.modifiers).then(function () {\n _this.status = Enums_1.SessionStatus.STATUS_EARLY_MEDIA;\n }).catch(function (error) {\n if (_this.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n return;\n }\n\n _this.failed(undefined, Constants_1.C.causes.WEBRTC_ERROR);\n\n _this.terminated(undefined, Constants_1.C.causes.WEBRTC_ERROR);\n });\n }\n\n this.emit(\"progress\", response);\n return;\n }\n };\n /**\n * Handle final response to initial INVITE.\n * @param inviteResponse 3xx response.\n */\n\n\n InviteClientContext.prototype.onRedirect = function (inviteResponse) {\n this.disposeEarlyMedia();\n var response = inviteResponse.message;\n var statusCode = response.statusCode;\n var cause = Utils_1.Utils.sipErrorCause(statusCode || 0);\n this.rejected(response, cause);\n this.failed(response, cause);\n this.terminated(response, cause);\n };\n /**\n * Handle final response to initial INVITE.\n * @param inviteResponse 4xx, 5xx, or 6xx response.\n */\n\n\n InviteClientContext.prototype.onReject = function (inviteResponse) {\n this.disposeEarlyMedia();\n var response = inviteResponse.message;\n var statusCode = response.statusCode;\n var cause = Utils_1.Utils.sipErrorCause(statusCode || 0);\n this.rejected(response, cause);\n this.failed(response, cause);\n this.terminated(response, cause);\n };\n /**\n * Handle final response to initial INVITE.\n * @param inviteResponse 100 response.\n */\n\n\n InviteClientContext.prototype.onTrying = function (inviteResponse) {\n this.received100 = true;\n this.emit(\"progress\", inviteResponse.message);\n };\n\n return InviteClientContext;\n}(Session);\n\nexports.InviteClientContext = InviteClientContext;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar allowed_methods_1 = require(\"./core/user-agent-core/allowed-methods\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Utils_1 = require(\"./Utils\");\n/**\n * While this class is named `Subscription`, it is closer to\n * an implementation of a \"subscriber\" as defined in RFC 6665\n * \"SIP-Specific Event Notifications\".\n * https://tools.ietf.org/html/rfc6665\n * @class Class creating a SIP Subscriber.\n */\n\n\nvar Subscription =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(Subscription, _super);\n /**\n * Constructor.\n * @param ua User agent.\n * @param target Subscription target.\n * @param event Subscription event.\n * @param options Options bucket.\n */\n\n\n function Subscription(ua, target, event, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = _super.call(this) || this;\n\n _this.data = {};\n _this.method = Constants_1.C.SUBSCRIBE;\n _this.body = undefined; // ClientContext interface\n\n _this.type = Enums_1.TypeStrings.Subscription;\n _this.ua = ua;\n _this.logger = ua.getLogger(\"sip.subscription\");\n\n if (options.body) {\n _this.body = {\n body: options.body,\n contentType: options.contentType ? options.contentType : \"application/sdp\"\n };\n } // Target URI\n\n\n var uri = ua.normalizeTarget(target);\n\n if (!uri) {\n throw new TypeError(\"Invalid target: \" + target);\n }\n\n _this.uri = uri; // Subscription event\n\n _this.event = event; // Subscription expires\n\n if (options.expires === undefined) {\n _this.expires = 3600;\n } else if (typeof options.expires !== \"number\") {\n // pre-typescript type guard\n ua.logger.warn(\"Option \\\"expires\\\" must be a number. Using default of 3600.\");\n _this.expires = 3600;\n } else {\n _this.expires = options.expires;\n } // Subscription extra headers\n\n\n _this.extraHeaders = (options.extraHeaders || []).slice(); // Subscription context.\n\n _this.context = _this.initContext();\n _this.disposed = false; // ClientContext interface\n\n _this.request = _this.context.message;\n\n if (!_this.request.from) {\n throw new Error(\"From undefined.\");\n }\n\n if (!_this.request.to) {\n throw new Error(\"From undefined.\");\n }\n\n _this.localIdentity = _this.request.from;\n _this.remoteIdentity = _this.request.to; // Add to UA's collection\n\n _this.id = _this.request.callId + _this.request.from.parameters.tag + _this.event;\n _this.ua.subscriptions[_this.id] = _this;\n return _this;\n }\n /**\n * Destructor.\n */\n\n\n Subscription.prototype.dispose = function () {\n if (this.disposed) {\n return;\n }\n\n if (this.retryAfterTimer) {\n clearTimeout(this.retryAfterTimer);\n this.retryAfterTimer = undefined;\n }\n\n this.context.dispose();\n this.disposed = true; // Remove from UA's collection\n\n delete this.ua.subscriptions[this.id];\n };\n\n Subscription.prototype.on = function (name, callback) {\n return _super.prototype.on.call(this, name, callback);\n };\n\n Subscription.prototype.emit = function (event) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n return _super.prototype.emit.apply(this, [event].concat(args));\n };\n /**\n * Gracefully terminate.\n */\n\n\n Subscription.prototype.close = function () {\n if (this.disposed) {\n return;\n }\n\n this.dispose();\n\n switch (this.context.state) {\n case core_1.SubscriptionState.Initial:\n this.onTerminated();\n break;\n\n case core_1.SubscriptionState.NotifyWait:\n this.onTerminated();\n break;\n\n case core_1.SubscriptionState.Pending:\n this.unsubscribe();\n break;\n\n case core_1.SubscriptionState.Active:\n this.unsubscribe();\n break;\n\n case core_1.SubscriptionState.Terminated:\n this.onTerminated();\n break;\n\n default:\n break;\n }\n };\n /**\n * Send a re-SUBSCRIBE request if there is an \"active\" subscription.\n */\n\n\n Subscription.prototype.refresh = function () {\n var _this = this;\n\n switch (this.context.state) {\n case core_1.SubscriptionState.Initial:\n break;\n\n case core_1.SubscriptionState.NotifyWait:\n break;\n\n case core_1.SubscriptionState.Pending:\n break;\n\n case core_1.SubscriptionState.Active:\n if (this.subscription) {\n var request = this.subscription.refresh();\n request.delegate = {\n onAccept: function onAccept(response) {\n return _this.onAccepted(response);\n },\n onRedirect: function onRedirect(response) {\n return _this.onFailed(response);\n },\n onReject: function onReject(response) {\n return _this.onFailed(response);\n }\n };\n }\n\n break;\n\n case core_1.SubscriptionState.Terminated:\n break;\n\n default:\n break;\n }\n };\n /**\n * Send an initial SUBSCRIBE request if no subscription.\n * Send a re-SUBSCRIBE request if there is an \"active\" subscription.\n */\n\n\n Subscription.prototype.subscribe = function () {\n var _this = this;\n\n switch (this.context.state) {\n case core_1.SubscriptionState.Initial:\n this.context.subscribe().then(function (result) {\n if (result.success) {\n if (result.success.subscription) {\n _this.subscription = result.success.subscription;\n _this.subscription.delegate = {\n onNotify: function onNotify(request) {\n return _this.onNotify(request);\n },\n onRefresh: function onRefresh(request) {\n return _this.onRefresh(request);\n },\n onTerminated: function onTerminated() {\n return _this.close();\n }\n };\n }\n\n _this.onNotify(result.success.request);\n } else if (result.failure) {\n _this.onFailed(result.failure.response);\n }\n });\n break;\n\n case core_1.SubscriptionState.NotifyWait:\n break;\n\n case core_1.SubscriptionState.Pending:\n break;\n\n case core_1.SubscriptionState.Active:\n this.refresh();\n break;\n\n case core_1.SubscriptionState.Terminated:\n break;\n\n default:\n break;\n }\n\n return this;\n };\n /**\n * Send a re-SUBSCRIBE request if there is a \"pending\" or \"active\" subscription.\n */\n\n\n Subscription.prototype.unsubscribe = function () {\n this.dispose();\n\n switch (this.context.state) {\n case core_1.SubscriptionState.Initial:\n break;\n\n case core_1.SubscriptionState.NotifyWait:\n break;\n\n case core_1.SubscriptionState.Pending:\n if (this.subscription) {\n this.subscription.unsubscribe(); // responses intentionally ignored\n }\n\n break;\n\n case core_1.SubscriptionState.Active:\n if (this.subscription) {\n this.subscription.unsubscribe(); // responses intentionally ignored\n }\n\n break;\n\n case core_1.SubscriptionState.Terminated:\n break;\n\n default:\n break;\n }\n\n this.onTerminated();\n };\n\n Subscription.prototype.onAccepted = function (response) {\n var statusCode = response.message.statusCode ? response.message.statusCode : 0;\n var cause = Utils_1.Utils.getReasonPhrase(statusCode);\n this.emit(\"accepted\", response.message, cause);\n };\n\n Subscription.prototype.onFailed = function (response) {\n this.close();\n\n if (response) {\n var statusCode = response.message.statusCode ? response.message.statusCode : 0;\n var cause = Utils_1.Utils.getReasonPhrase(statusCode);\n this.emit(\"failed\", response.message, cause);\n this.emit(\"rejected\", response.message, cause);\n }\n };\n\n Subscription.prototype.onNotify = function (request) {\n var _this = this;\n\n request.accept(); // Send 200 response.\n\n this.emit(\"notify\", {\n request: request.message\n }); // If we've set state to done, no further processing should take place\n // and we are only interested in cleaning up after the appropriate NOTIFY.\n\n if (this.disposed) {\n return;\n } // If the \"Subscription-State\" value is \"terminated\", the subscriber\n // MUST consider the subscription terminated. The \"expires\" parameter\n // has no semantics for \"terminated\" -- notifiers SHOULD NOT include an\n // \"expires\" parameter on a \"Subscription-State\" header field with a\n // value of \"terminated\", and subscribers MUST ignore any such\n // parameter, if present. If a reason code is present, the client\n // should behave as described below. If no reason code or an unknown\n // reason code is present, the client MAY attempt to re-subscribe at any\n // time (unless a \"retry-after\" parameter is present, in which case the\n // client SHOULD NOT attempt re-subscription until after the number of\n // seconds specified by the \"retry-after\" parameter). The reason codes\n // defined by this document are:\n // https://tools.ietf.org/html/rfc6665#section-4.1.3\n\n\n var subscriptionState = request.message.parseHeader(\"Subscription-State\");\n\n if (subscriptionState && subscriptionState.state) {\n switch (subscriptionState.state) {\n case \"terminated\":\n if (subscriptionState.reason) {\n this.logger.log(\"Terminated subscription with reason \" + subscriptionState.reason);\n\n switch (subscriptionState.reason) {\n case \"deactivated\":\n case \"timeout\":\n this.initContext();\n this.subscribe();\n return;\n\n case \"probation\":\n case \"giveup\":\n this.initContext();\n\n if (subscriptionState.params && subscriptionState.params[\"retry-after\"]) {\n this.retryAfterTimer = setTimeout(function () {\n return _this.subscribe();\n }, subscriptionState.params[\"retry-after\"]);\n } else {\n this.subscribe();\n }\n\n return;\n\n case \"rejected\":\n case \"noresource\":\n case \"invariant\":\n break;\n }\n }\n\n this.close();\n break;\n\n default:\n break;\n }\n }\n };\n\n Subscription.prototype.onRefresh = function (request) {\n var _this = this;\n\n request.delegate = {\n onAccept: function onAccept(response) {\n return _this.onAccepted(response);\n }\n };\n };\n\n Subscription.prototype.onTerminated = function () {\n this.emit(\"terminated\");\n };\n\n Subscription.prototype.initContext = function () {\n var _this = this;\n\n var options = {\n extraHeaders: this.extraHeaders,\n body: this.body ? Utils_1.Utils.fromBodyObj(this.body) : undefined\n };\n this.context = new SubscribeClientContext(this.ua.userAgentCore, this.uri, this.event, this.expires, options);\n this.context.delegate = {\n onAccept: function onAccept(response) {\n return _this.onAccepted(response);\n }\n };\n return this.context;\n };\n\n return Subscription;\n}(events_1.EventEmitter);\n\nexports.Subscription = Subscription; // tslint:disable-next-line:max-classes-per-file\n\nvar SubscribeClientContext =\n/** @class */\nfunction () {\n function SubscribeClientContext(core, target, event, expires, options, delegate) {\n this.core = core;\n this.target = target;\n this.event = event;\n this.expires = expires;\n this.subscribed = false;\n this.logger = core.loggerFactory.getLogger(\"sip.subscription\");\n this.delegate = delegate;\n var allowHeader = \"Allow: \" + allowed_methods_1.AllowedMethods.toString();\n var extraHeaders = (options && options.extraHeaders || []).slice();\n extraHeaders.push(allowHeader);\n extraHeaders.push(\"Event: \" + this.event);\n extraHeaders.push(\"Expires: \" + this.expires);\n extraHeaders.push(\"Contact: \" + this.core.configuration.contact.toString());\n var body = options && options.body;\n this.message = core.makeOutgoingRequestMessage(Constants_1.C.SUBSCRIBE, this.target, this.core.configuration.aor, this.target, {}, extraHeaders, body);\n }\n /** Destructor. */\n\n\n SubscribeClientContext.prototype.dispose = function () {\n if (this.subscription) {\n this.subscription.dispose();\n }\n\n if (this.request) {\n this.request.waitNotifyStop();\n this.request.dispose();\n }\n };\n\n Object.defineProperty(SubscribeClientContext.prototype, \"state\", {\n /** Subscription state. */\n get: function get() {\n if (this.subscription) {\n return this.subscription.subscriptionState;\n } else if (this.subscribed) {\n return core_1.SubscriptionState.NotifyWait;\n } else {\n return core_1.SubscriptionState.Initial;\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Establish subscription.\n * @param options Options bucket.\n */\n\n SubscribeClientContext.prototype.subscribe = function () {\n var _this = this;\n\n if (this.subscribed) {\n return Promise.reject(new Error(\"Not in initial state. Did you call subscribe more than once?\"));\n }\n\n this.subscribed = true;\n return new Promise(function (resolve, reject) {\n if (!_this.message) {\n throw new Error(\"Message undefined.\");\n }\n\n _this.request = _this.core.subscribe(_this.message, {\n // This SUBSCRIBE request will be confirmed with a final response.\n // 200-class responses indicate that the subscription has been accepted\n // and that a NOTIFY request will be sent immediately.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.1\n onAccept: function onAccept(response) {\n if (_this.delegate && _this.delegate.onAccept) {\n _this.delegate.onAccept(response);\n }\n },\n // Due to the potential for out-of-order messages, packet loss, and\n // forking, the subscriber MUST be prepared to receive NOTIFY requests\n // before the SUBSCRIBE transaction has completed.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.4\n onNotify: function onNotify(requestWithSubscription) {\n _this.subscription = requestWithSubscription.subscription;\n\n if (_this.subscription) {\n _this.subscription.autoRefresh = true;\n }\n\n resolve({\n success: requestWithSubscription\n });\n },\n // If this Timer N expires prior to the receipt of a NOTIFY request,\n // the subscriber considers the subscription failed, and cleans up\n // any state associated with the subscription attempt.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.4\n onNotifyTimeout: function onNotifyTimeout() {\n resolve({\n failure: {}\n });\n },\n // This SUBSCRIBE request will be confirmed with a final response.\n // Non-200-class final responses indicate that no subscription or new\n // dialog usage has been created, and no subsequent NOTIFY request will\n // be sent.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.1\n onRedirect: function onRedirect(response) {\n resolve({\n failure: {\n response: response\n }\n });\n },\n // This SUBSCRIBE request will be confirmed with a final response.\n // Non-200-class final responses indicate that no subscription or new\n // dialog usage has been created, and no subsequent NOTIFY request will\n // be sent.\n // https://tools.ietf.org/html/rfc6665#section-4.1.2.1\n onReject: function onReject(response) {\n resolve({\n failure: {\n response: response\n }\n });\n }\n });\n });\n };\n\n return SubscribeClientContext;\n}();","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar ClientContext_1 = require(\"./ClientContext\");\n\nvar Constants_1 = require(\"./Constants\");\n\nvar core_1 = require(\"./core\");\n\nvar Enums_1 = require(\"./Enums\");\n\nvar Exceptions_1 = require(\"./Exceptions\");\n\nvar Parser_1 = require(\"./Parser\");\n\nvar PublishContext_1 = require(\"./PublishContext\");\n\nvar ReferContext_1 = require(\"./ReferContext\");\n\nvar RegisterContext_1 = require(\"./RegisterContext\");\n\nvar ServerContext_1 = require(\"./ServerContext\");\n\nvar Session_1 = require(\"./Session\");\n\nvar Subscription_1 = require(\"./Subscription\");\n\nvar Utils_1 = require(\"./Utils\");\n\nvar SessionDescriptionHandler_1 = require(\"./Web/SessionDescriptionHandler\");\n\nvar Transport_1 = require(\"./Web/Transport\");\n/**\n * @class Class creating a SIP User Agent.\n * @param {function returning SIP.sessionDescriptionHandler} [configuration.sessionDescriptionHandlerFactory]\n * A function will be invoked by each of the UA's Sessions to build the sessionDescriptionHandler for that Session.\n * If no (or a falsy) value is provided, each Session will use a default (WebRTC) sessionDescriptionHandler.\n */\n\n\nvar UA =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(UA, _super);\n\n function UA(configuration) {\n var _this = _super.call(this) || this;\n /** Unload listener. */\n\n\n _this.unloadListener = function () {\n _this.stop();\n };\n\n _this.type = Enums_1.TypeStrings.UA;\n _this.log = new core_1.LoggerFactory();\n _this.logger = _this.getLogger(\"sip.ua\");\n _this.configuration = {}; // User actions outside any session/dialog (MESSAGE)\n\n _this.applicants = {};\n _this.data = {};\n _this.sessions = {};\n _this.subscriptions = {};\n _this.publishers = {};\n _this.status = Enums_1.UAStatus.STATUS_INIT;\n /**\n * Load configuration\n *\n * @throws {SIP.Exceptions.ConfigurationError}\n * @throws {TypeError}\n */\n\n if (configuration === undefined) {\n configuration = {};\n } else if (typeof configuration === \"string\" || configuration instanceof String) {\n configuration = {\n uri: configuration\n };\n } // Apply log configuration if present\n\n\n if (configuration.log) {\n if (configuration.log.hasOwnProperty(\"builtinEnabled\")) {\n _this.log.builtinEnabled = configuration.log.builtinEnabled;\n }\n\n if (configuration.log.hasOwnProperty(\"connector\")) {\n _this.log.connector = configuration.log.connector;\n }\n\n if (configuration.log.hasOwnProperty(\"level\")) {\n var level = configuration.log.level;\n var normalized = void 0;\n\n if (typeof level === \"string\") {\n switch (level) {\n case \"error\":\n normalized = core_1.Levels.error;\n break;\n\n case \"warn\":\n normalized = core_1.Levels.warn;\n break;\n\n case \"log\":\n normalized = core_1.Levels.log;\n break;\n\n case \"debug\":\n normalized = core_1.Levels.debug;\n break;\n\n default:\n break;\n }\n } else {\n switch (level) {\n case 0:\n normalized = core_1.Levels.error;\n break;\n\n case 1:\n normalized = core_1.Levels.warn;\n break;\n\n case 2:\n normalized = core_1.Levels.log;\n break;\n\n case 3:\n normalized = core_1.Levels.debug;\n break;\n\n default:\n break;\n }\n } // avoid setting level when invalid, use default level instead\n\n\n if (normalized === undefined) {\n _this.logger.error(\"Invalid \\\"level\\\" parameter value: \" + JSON.stringify(level));\n } else {\n _this.log.level = normalized;\n }\n }\n }\n\n try {\n _this.loadConfig(configuration);\n } catch (e) {\n _this.status = Enums_1.UAStatus.STATUS_NOT_READY;\n _this.error = UA.C.CONFIGURATION_ERROR;\n throw e;\n }\n\n if (!_this.configuration.transportConstructor) {\n throw new core_1.TransportError(\"Transport constructor not set\");\n }\n\n _this.transport = new _this.configuration.transportConstructor(_this.getLogger(\"sip.transport\"), _this.configuration.transportOptions);\n var userAgentCoreConfiguration = makeUserAgentCoreConfigurationFromUA(_this); // The Replaces header contains information used to match an existing\n // SIP dialog (call-id, to-tag, and from-tag). Upon receiving an INVITE\n // with a Replaces header, the User Agent (UA) attempts to match this\n // information with a confirmed or early dialog.\n // https://tools.ietf.org/html/rfc3891#section-3\n\n var handleInviteWithReplacesHeader = function handleInviteWithReplacesHeader(context, request) {\n if (_this.configuration.replaces !== Constants_1.C.supported.UNSUPPORTED) {\n var replaces = request.parseHeader(\"replaces\");\n\n if (replaces) {\n var targetSession = _this.sessions[replaces.call_id + replaces.replaces_from_tag] || _this.sessions[replaces.call_id + replaces.replaces_to_tag] || undefined;\n\n if (!targetSession) {\n _this.userAgentCore.replyStateless(request, {\n statusCode: 481\n });\n\n return;\n }\n\n if (targetSession.status === Enums_1.SessionStatus.STATUS_TERMINATED) {\n _this.userAgentCore.replyStateless(request, {\n statusCode: 603\n });\n\n return;\n }\n\n var targetDialogId = replaces.call_id + replaces.replaces_to_tag + replaces.replaces_from_tag;\n\n var targetDialog = _this.userAgentCore.dialogs.get(targetDialogId);\n\n if (!targetDialog) {\n _this.userAgentCore.replyStateless(request, {\n statusCode: 481\n });\n\n return;\n }\n\n if (!targetDialog.early && replaces.early_only) {\n _this.userAgentCore.replyStateless(request, {\n statusCode: 486\n });\n\n return;\n }\n\n context.replacee = targetSession;\n }\n }\n };\n\n var userAgentCoreDelegate = {\n onInvite: function onInvite(incomingInviteRequest) {\n // FIXME: Ported - 100 Trying send should be configurable.\n // Only required if TU will not respond in 200ms.\n // https://tools.ietf.org/html/rfc3261#section-17.2.1\n incomingInviteRequest.trying();\n incomingInviteRequest.delegate = {\n onCancel: function onCancel(cancel) {\n context.onCancel(cancel);\n },\n onTransportError: function onTransportError(error) {\n context.onTransportError();\n }\n };\n var context = new Session_1.InviteServerContext(_this, incomingInviteRequest); // Ported - handling of out of dialog INVITE with Replaces.\n\n handleInviteWithReplacesHeader(context, incomingInviteRequest.message); // Ported - make the first call to progress automatically.\n\n if (context.autoSendAnInitialProvisionalResponse) {\n context.progress();\n }\n\n _this.emit(\"invite\", context);\n },\n onMessage: function onMessage(incomingMessageRequest) {\n // Ported - handling of out of dialog MESSAGE.\n var serverContext = new ServerContext_1.ServerContext(_this, incomingMessageRequest);\n serverContext.body = incomingMessageRequest.message.body;\n serverContext.contentType = incomingMessageRequest.message.getHeader(\"Content-Type\") || \"text/plain\";\n incomingMessageRequest.accept();\n\n _this.emit(\"message\", serverContext); // TODO: Review. Why is a \"ServerContext\" emitted? What use it is?\n\n },\n onNotify: function onNotify(incomingNotifyRequest) {\n // DEPRECATED: Out of dialog NOTIFY is an obsolete usage.\n // Ported - handling of out of dialog NOTIFY.\n if (_this.configuration.allowLegacyNotifications && _this.listeners(\"notify\").length > 0) {\n incomingNotifyRequest.accept();\n\n _this.emit(\"notify\", {\n request: incomingNotifyRequest.message\n });\n } else {\n incomingNotifyRequest.reject({\n statusCode: 481\n });\n }\n },\n onRefer: function onRefer(incomingReferRequest) {\n // Ported - handling of out of dialog REFER.\n _this.logger.log(\"Received an out of dialog refer\");\n\n if (!_this.configuration.allowOutOfDialogRefers) {\n incomingReferRequest.reject({\n statusCode: 405\n });\n }\n\n _this.logger.log(\"Allow out of dialog refers is enabled on the UA\");\n\n var referContext = new ReferContext_1.ReferServerContext(_this, incomingReferRequest);\n\n if (_this.listeners(\"outOfDialogReferRequested\").length) {\n _this.emit(\"outOfDialogReferRequested\", referContext);\n } else {\n _this.logger.log(\"No outOfDialogReferRequest listeners, automatically accepting and following the out of dialog refer\");\n\n referContext.accept({\n followRefer: true\n });\n }\n },\n onSubscribe: function onSubscribe(incomingSubscribeRequest) {\n _this.emit(\"subscribe\", incomingSubscribeRequest);\n }\n };\n _this.userAgentCore = new core_1.UserAgentCore(userAgentCoreConfiguration, userAgentCoreDelegate); // Initialize registerContext\n\n _this.registerContext = new RegisterContext_1.RegisterContext(_this, configuration.registerOptions);\n\n _this.registerContext.on(\"failed\", _this.emit.bind(_this, \"registrationFailed\"));\n\n _this.registerContext.on(\"registered\", _this.emit.bind(_this, \"registered\"));\n\n _this.registerContext.on(\"unregistered\", _this.emit.bind(_this, \"unregistered\"));\n\n if (_this.configuration.autostart) {\n _this.start();\n }\n\n return _this;\n } // =================\n // High Level API\n // =================\n\n\n UA.prototype.register = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.register) {\n this.configuration.register = true;\n }\n\n this.registerContext.register(options);\n return this;\n };\n /**\n * Unregister.\n *\n * @param {Boolean} [all] unregister all user bindings.\n *\n */\n\n\n UA.prototype.unregister = function (options) {\n var _this = this;\n\n this.configuration.register = false;\n this.transport.afterConnected(function () {\n _this.registerContext.unregister(options);\n });\n return this;\n };\n\n UA.prototype.isRegistered = function () {\n return this.registerContext.registered;\n };\n /**\n * Make an outgoing call.\n *\n * @param {String} target\n * @param {Object} views\n * @param {Object} [options.media] gets passed to SIP.sessionDescriptionHandler.getDescription as mediaHint\n *\n * @throws {TypeError}\n *\n */\n\n\n UA.prototype.invite = function (target, options, modifiers) {\n var _this = this;\n\n var context = new Session_1.InviteClientContext(this, target, options, modifiers); // Delay sending actual invite until the next 'tick' if we are already\n // connected, so that API consumers can register to events fired by the\n // the session.\n\n this.transport.afterConnected(function () {\n context.invite();\n\n _this.emit(\"inviteSent\", context);\n });\n return context;\n };\n\n UA.prototype.subscribe = function (target, event, options) {\n var sub = new Subscription_1.Subscription(this, target, event, options);\n this.transport.afterConnected(function () {\n return sub.subscribe();\n });\n return sub;\n };\n /**\n * Send PUBLISH Event State Publication (RFC3903)\n *\n * @param {String} target\n * @param {String} event\n * @param {String} body\n * @param {Object} [options]\n *\n * @throws {SIP.Exceptions.MethodParameterError}\n */\n\n\n UA.prototype.publish = function (target, event, body, options) {\n var pub = new PublishContext_1.PublishContext(this, target, event, options);\n this.transport.afterConnected(function () {\n pub.publish(body);\n });\n return pub;\n };\n /**\n * Send a message.\n *\n * @param {String} target\n * @param {String} body\n * @param {Object} [options]\n *\n * @throws {TypeError}\n */\n\n\n UA.prototype.message = function (target, body, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (body === undefined) {\n throw new TypeError(\"Not enough arguments\");\n } // There is no Message module, so it is okay that the UA handles defaults here.\n\n\n options.contentType = options.contentType || \"text/plain\";\n options.body = body;\n return this.request(Constants_1.C.MESSAGE, target, options);\n };\n\n UA.prototype.request = function (method, target, options) {\n var req = new ClientContext_1.ClientContext(this, method, target, options);\n this.transport.afterConnected(function () {\n return req.send();\n });\n return req;\n };\n /**\n * Gracefully close.\n */\n\n\n UA.prototype.stop = function () {\n this.logger.log(\"user requested closure...\");\n\n if (this.status === Enums_1.UAStatus.STATUS_USER_CLOSED) {\n this.logger.warn(\"UA already closed\");\n return this;\n } // Close registerContext\n\n\n this.logger.log(\"closing registerContext\");\n this.registerContext.close(); // Run terminate on every Session\n\n for (var session in this.sessions) {\n if (this.sessions[session]) {\n this.logger.log(\"closing session \" + session);\n this.sessions[session].terminate();\n }\n } // Run unsubscribe on every Subscription\n\n\n for (var subscription in this.subscriptions) {\n if (this.subscriptions[subscription]) {\n this.logger.log(\"unsubscribe \" + subscription);\n this.subscriptions[subscription].unsubscribe();\n }\n } // Run close on every Publisher\n\n\n for (var publisher in this.publishers) {\n if (this.publishers[publisher]) {\n this.logger.log(\"unpublish \" + publisher);\n this.publishers[publisher].close();\n }\n } // Run close on every applicant\n\n\n for (var applicant in this.applicants) {\n if (this.applicants[applicant]) {\n this.applicants[applicant].close();\n }\n }\n\n this.status = Enums_1.UAStatus.STATUS_USER_CLOSED; // Disconnect the transport and reset user agent core\n\n this.transport.disconnect();\n this.userAgentCore.reset();\n\n if (this.configuration.autostop) {\n // Google Chrome Packaged Apps don't allow 'unload' listeners: unload is not available in packaged apps\n var googleChromePackagedApp = typeof chrome !== \"undefined\" && chrome.app && chrome.app.runtime ? true : false;\n\n if (typeof window !== \"undefined\" && !googleChromePackagedApp) {\n window.removeEventListener(\"unload\", this.unloadListener);\n }\n }\n\n return this;\n };\n /**\n * Connect to the WS server if status = STATUS_INIT.\n * Resume UA after being closed.\n *\n */\n\n\n UA.prototype.start = function () {\n this.logger.log(\"user requested startup...\");\n\n if (this.status === Enums_1.UAStatus.STATUS_INIT) {\n this.status = Enums_1.UAStatus.STATUS_STARTING;\n this.setTransportListeners();\n this.emit(\"transportCreated\", this.transport);\n this.transport.connect();\n } else if (this.status === Enums_1.UAStatus.STATUS_USER_CLOSED) {\n this.logger.log(\"resuming\");\n this.status = Enums_1.UAStatus.STATUS_READY;\n this.transport.connect();\n } else if (this.status === Enums_1.UAStatus.STATUS_STARTING) {\n this.logger.log(\"UA is in STARTING status, not opening new connection\");\n } else if (this.status === Enums_1.UAStatus.STATUS_READY) {\n this.logger.log(\"UA is in READY status, not resuming\");\n } else {\n this.logger.error(\"Connection is down. Auto-Recovery system is trying to connect\");\n }\n\n if (this.configuration.autostop) {\n // Google Chrome Packaged Apps don't allow 'unload' listeners: unload is not available in packaged apps\n var googleChromePackagedApp = typeof chrome !== \"undefined\" && chrome.app && chrome.app.runtime ? true : false;\n\n if (typeof window !== \"undefined\" && !googleChromePackagedApp) {\n window.addEventListener(\"unload\", this.unloadListener);\n }\n }\n\n return this;\n };\n /**\n * Normalize a string into a valid SIP request URI\n *\n * @param {String} target\n *\n * @returns {SIP.URI|undefined}\n */\n\n\n UA.prototype.normalizeTarget = function (target) {\n return Utils_1.Utils.normalizeTarget(target, this.configuration.hostportParams);\n };\n\n UA.prototype.getLogger = function (category, label) {\n return this.log.getLogger(category, label);\n };\n\n UA.prototype.getLoggerFactory = function () {\n return this.log;\n };\n\n UA.prototype.getSupportedResponseOptions = function () {\n var optionTags = [];\n\n if (this.contact.pubGruu || this.contact.tempGruu) {\n optionTags.push(\"gruu\");\n }\n\n if (this.configuration.rel100 === Constants_1.C.supported.SUPPORTED) {\n optionTags.push(\"100rel\");\n }\n\n if (this.configuration.replaces === Constants_1.C.supported.SUPPORTED) {\n optionTags.push(\"replaces\");\n }\n\n optionTags.push(\"outbound\");\n optionTags = optionTags.concat(this.configuration.extraSupported || []);\n var allowUnregistered = this.configuration.hackAllowUnregisteredOptionTags || false;\n var optionTagSet = {};\n optionTags = optionTags.filter(function (optionTag) {\n var registered = Constants_1.C.OPTION_TAGS[optionTag];\n var unique = !optionTagSet[optionTag];\n optionTagSet[optionTag] = true;\n return (registered || allowUnregistered) && unique;\n });\n return optionTags;\n };\n /**\n * Get the session to which the request belongs to, if any.\n * @param {SIP.IncomingRequest} request.\n * @returns {SIP.OutgoingSession|SIP.IncomingSession|undefined}\n */\n\n\n UA.prototype.findSession = function (request) {\n return this.sessions[request.callId + request.fromTag] || this.sessions[request.callId + request.toTag] || undefined;\n };\n\n UA.prototype.on = function (name, callback) {\n return _super.prototype.on.call(this, name, callback);\n }; // ==============================\n // Event Handlers\n // ==============================\n\n\n UA.prototype.onTransportError = function () {\n if (this.status === Enums_1.UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n\n if (!this.error || this.error !== UA.C.NETWORK_ERROR) {\n this.status = Enums_1.UAStatus.STATUS_NOT_READY;\n this.error = UA.C.NETWORK_ERROR;\n }\n };\n /**\n * Helper function. Sets transport listeners\n */\n\n\n UA.prototype.setTransportListeners = function () {\n var _this = this;\n\n this.transport.on(\"connected\", function () {\n return _this.onTransportConnected();\n });\n this.transport.on(\"message\", function (message) {\n return _this.onTransportReceiveMsg(message);\n });\n this.transport.on(\"transportError\", function () {\n return _this.onTransportError();\n });\n };\n /**\n * Transport connection event.\n * @event\n * @param {SIP.Transport} transport.\n */\n\n\n UA.prototype.onTransportConnected = function () {\n var _this = this;\n\n if (this.configuration.register) {\n // In an effor to maintain behavior from when we \"initialized\" an\n // authentication factory, this is in a Promise.then\n Promise.resolve().then(function () {\n return _this.registerContext.register();\n });\n }\n };\n /**\n * Handle SIP message received from the transport.\n * @param messageString The message.\n */\n\n\n UA.prototype.onTransportReceiveMsg = function (messageString) {\n var _this = this;\n\n var message = Parser_1.Parser.parseMessage(messageString, this.getLogger(\"sip.parser\"));\n\n if (!message) {\n this.logger.warn(\"UA failed to parse incoming SIP message - discarding.\");\n return;\n }\n\n if (this.status === Enums_1.UAStatus.STATUS_USER_CLOSED && message instanceof core_1.IncomingRequestMessage) {\n this.logger.warn(\"UA received message when status = USER_CLOSED - aborting\");\n return;\n } // A valid SIP request formulated by a UAC MUST, at a minimum, contain\n // the following header fields: To, From, CSeq, Call-ID, Max-Forwards,\n // and Via; all of these header fields are mandatory in all SIP\n // requests.\n // https://tools.ietf.org/html/rfc3261#section-8.1.1\n\n\n var hasMinimumHeaders = function hasMinimumHeaders() {\n var mandatoryHeaders = [\"from\", \"to\", \"call_id\", \"cseq\", \"via\"];\n\n for (var _i = 0, mandatoryHeaders_1 = mandatoryHeaders; _i < mandatoryHeaders_1.length; _i++) {\n var header = mandatoryHeaders_1[_i];\n\n if (!message.hasHeader(header)) {\n _this.logger.warn(\"Missing mandatory header field : \" + header + \".\");\n\n return false;\n }\n }\n\n return true;\n }; // Request Checks\n\n\n if (message instanceof core_1.IncomingRequestMessage) {\n // This is port of SanityCheck.minimumHeaders().\n if (!hasMinimumHeaders()) {\n this.logger.warn(\"Request missing mandatory header field. Dropping.\");\n return;\n } // FIXME: This is non-standard and should be a configruable behavior (desirable regardless).\n // Custom SIP.js check to reject request from ourself (this instance of SIP.js).\n // This is port of SanityCheck.rfc3261_16_3_4().\n\n\n if (!message.toTag && message.callId.substr(0, 5) === this.configuration.sipjsId) {\n this.userAgentCore.replyStateless(message, {\n statusCode: 482\n });\n return;\n } // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to reject requests if body length wrong.\n // This is port of SanityCheck.rfc3261_18_3_request().\n\n\n var len = Utils_1.Utils.str_utf8_length(message.body);\n var contentLength = message.getHeader(\"content-length\");\n\n if (contentLength && len < Number(contentLength)) {\n this.userAgentCore.replyStateless(message, {\n statusCode: 400\n });\n return;\n }\n } // Reponse Checks\n\n\n if (message instanceof core_1.IncomingResponseMessage) {\n // This is port of SanityCheck.minimumHeaders().\n if (!hasMinimumHeaders()) {\n this.logger.warn(\"Response missing mandatory header field. Dropping.\");\n return;\n } // Custom SIP.js check to drop responses if multiple Via headers.\n // This is port of SanityCheck.rfc3261_8_1_3_3().\n\n\n if (message.getHeaders(\"via\").length > 1) {\n this.logger.warn(\"More than one Via header field present in the response. Dropping.\");\n return;\n } // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to drop responses if bad Via header.\n // This is port of SanityCheck.rfc3261_18_1_2().\n\n\n if (message.via.host !== this.configuration.viaHost || message.via.port !== undefined) {\n this.logger.warn(\"Via sent-by in the response does not match UA Via host value. Dropping.\");\n return;\n } // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to reject requests if body length wrong.\n // This is port of SanityCheck.rfc3261_18_3_response().\n\n\n var len = Utils_1.Utils.str_utf8_length(message.body);\n var contentLength = message.getHeader(\"content-length\");\n\n if (contentLength && len < Number(contentLength)) {\n this.logger.warn(\"Message body length is lower than the value in Content-Length header field. Dropping.\");\n return;\n }\n } // Handle Request\n\n\n if (message instanceof core_1.IncomingRequestMessage) {\n this.userAgentCore.receiveIncomingRequestFromTransport(message);\n return;\n } // Handle Response\n\n\n if (message instanceof core_1.IncomingResponseMessage) {\n this.userAgentCore.receiveIncomingResponseFromTransport(message);\n return;\n }\n\n throw new Error(\"Invalid message type.\");\n }; // =================\n // Utils\n // =================\n\n\n UA.prototype.checkAuthenticationFactory = function (authenticationFactory) {\n if (!(authenticationFactory instanceof Function)) {\n return;\n }\n\n if (!authenticationFactory.initialize) {\n authenticationFactory.initialize = function () {\n return Promise.resolve();\n };\n }\n\n return authenticationFactory;\n };\n /**\n * Configuration load.\n * returns {void}\n */\n\n\n UA.prototype.loadConfig = function (configuration) {\n var _this = this; // Settings and default values\n\n\n var settings = {\n /* Host address\n * Value to be set in Via sent_by and host part of Contact FQDN\n */\n viaHost: Utils_1.Utils.createRandomToken(12) + \".invalid\",\n uri: new core_1.URI(\"sip\", \"anonymous.\" + Utils_1.Utils.createRandomToken(6), \"anonymous.invalid\", undefined, undefined),\n // Custom Configuration Settings\n custom: {},\n // Display name\n displayName: \"\",\n // Password\n password: undefined,\n register: true,\n // Registration parameters\n registerOptions: {},\n // Transport related parameters\n transportConstructor: Transport_1.Transport,\n transportOptions: {},\n usePreloadedRoute: false,\n // string to be inserted into User-Agent request header\n userAgentString: Constants_1.C.USER_AGENT,\n // Session parameters\n noAnswerTimeout: 60,\n // Hacks\n hackViaTcp: false,\n hackIpInContact: false,\n hackWssInTransport: false,\n hackAllowUnregisteredOptionTags: false,\n // Session Description Handler Options\n sessionDescriptionHandlerFactoryOptions: {\n constraints: {},\n peerConnectionOptions: {}\n },\n extraSupported: [],\n contactName: Utils_1.Utils.createRandomToken(8),\n contactTransport: \"ws\",\n forceRport: false,\n // autostarting\n autostart: true,\n autostop: true,\n // Reliable Provisional Responses\n rel100: Constants_1.C.supported.UNSUPPORTED,\n // DTMF type: 'info' or 'rtp' (RFC 4733)\n // RTP Payload Spec: https://tools.ietf.org/html/rfc4733\n // WebRTC Audio Spec: https://tools.ietf.org/html/rfc7874\n dtmfType: Constants_1.C.dtmfType.INFO,\n // Replaces header (RFC 3891)\n // http://tools.ietf.org/html/rfc3891\n replaces: Constants_1.C.supported.UNSUPPORTED,\n sessionDescriptionHandlerFactory: SessionDescriptionHandler_1.SessionDescriptionHandler.defaultFactory,\n authenticationFactory: this.checkAuthenticationFactory(function (ua) {\n return new core_1.DigestAuthentication(ua.getLoggerFactory(), _this.configuration.authorizationUser, _this.configuration.password);\n }),\n allowLegacyNotifications: false,\n allowOutOfDialogRefers: false,\n experimentalFeatures: false\n };\n var configCheck = this.getConfigurationCheck(); // Check Mandatory parameters\n\n for (var parameter in configCheck.mandatory) {\n if (!configuration.hasOwnProperty(parameter)) {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter);\n } else {\n var value = configuration[parameter];\n var checkedValue = configCheck.mandatory[parameter](value);\n\n if (checkedValue !== undefined) {\n settings[parameter] = checkedValue;\n } else {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter, value);\n }\n }\n } // Check Optional parameters\n\n\n for (var parameter in configCheck.optional) {\n if (configuration.hasOwnProperty(parameter)) {\n var value = configuration[parameter]; // If the parameter value is an empty array, but shouldn't be, apply its default value.\n // If the parameter value is null, empty string, or undefined then apply its default value.\n // If it's a number with NaN value then also apply its default value.\n // NOTE: JS does not allow \"value === NaN\", the following does the work:\n\n if (value instanceof Array && value.length === 0 || value === null || value === \"\" || value === undefined || typeof value === \"number\" && isNaN(value)) {\n continue;\n }\n\n var checkedValue = configCheck.optional[parameter](value);\n\n if (checkedValue !== undefined) {\n settings[parameter] = checkedValue;\n } else {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter, value);\n }\n }\n } // Post Configuration Process\n // Allow passing 0 number as displayName.\n\n\n if (settings.displayName === 0) {\n settings.displayName = \"0\";\n } // sipjsId instance parameter. Static random tag of length 5\n\n\n settings.sipjsId = Utils_1.Utils.createRandomToken(5); // String containing settings.uri without scheme and user.\n\n var hostportParams = settings.uri.clone();\n hostportParams.user = undefined;\n settings.hostportParams = hostportParams.toRaw().replace(/^sip:/i, \"\");\n /* Check whether authorizationUser is explicitly defined.\n * Take 'settings.uri.user' value if not.\n */\n\n if (!settings.authorizationUser) {\n settings.authorizationUser = settings.uri.user;\n } // User noAnswerTimeout\n\n\n settings.noAnswerTimeout = settings.noAnswerTimeout * 1000; // Via Host\n\n if (settings.hackIpInContact) {\n if (typeof settings.hackIpInContact === \"boolean\") {\n var from = 1;\n var to = 254;\n var octet = Math.floor(Math.random() * (to - from + 1) + from); // random Test-Net IP (http://tools.ietf.org/html/rfc5735)\n\n settings.viaHost = \"192.0.2.\" + octet;\n } else if (typeof settings.hackIpInContact === \"string\") {\n settings.viaHost = settings.hackIpInContact;\n }\n } // Contact transport parameter\n\n\n if (settings.hackWssInTransport) {\n settings.contactTransport = \"wss\";\n }\n\n this.contact = {\n pubGruu: undefined,\n tempGruu: undefined,\n uri: new core_1.URI(\"sip\", settings.contactName, settings.viaHost, undefined, {\n transport: settings.contactTransport\n }),\n toString: function toString(options) {\n if (options === void 0) {\n options = {};\n }\n\n var anonymous = options.anonymous || false;\n var outbound = options.outbound || false;\n var contact = \"<\";\n\n if (anonymous) {\n contact += (_this.contact.tempGruu || \"sip:anonymous@anonymous.invalid;transport=\" + settings.contactTransport).toString();\n } else {\n contact += (_this.contact.pubGruu || _this.contact.uri).toString();\n }\n\n if (outbound) {\n contact += \";ob\";\n }\n\n contact += \">\";\n return contact;\n }\n };\n var skeleton = {}; // Fill the value of the configuration_skeleton\n\n for (var parameter in settings) {\n if (settings.hasOwnProperty(parameter)) {\n skeleton[parameter] = settings[parameter];\n }\n }\n\n Object.assign(this.configuration, skeleton);\n this.logger.log(\"configuration parameters after validation:\");\n\n for (var parameter in settings) {\n if (settings.hasOwnProperty(parameter)) {\n switch (parameter) {\n case \"uri\":\n case \"sessionDescriptionHandlerFactory\":\n this.logger.log(\"· \" + parameter + \": \" + settings[parameter]);\n break;\n\n case \"password\":\n this.logger.log(\"· \" + parameter + \": \" + \"NOT SHOWN\");\n break;\n\n case \"transportConstructor\":\n this.logger.log(\"· \" + parameter + \": \" + settings[parameter].name);\n break;\n\n default:\n this.logger.log(\"· \" + parameter + \": \" + JSON.stringify(settings[parameter]));\n }\n }\n }\n\n return;\n };\n /**\n * Configuration checker.\n * @return {Boolean}\n */\n\n\n UA.prototype.getConfigurationCheck = function () {\n return {\n mandatory: {},\n optional: {\n uri: function uri(_uri) {\n if (!/^sip:/i.test(_uri)) {\n _uri = Constants_1.C.SIP + \":\" + _uri;\n }\n\n var parsed = core_1.Grammar.URIParse(_uri);\n\n if (!parsed || !parsed.user) {\n return;\n } else {\n return parsed;\n }\n },\n transportConstructor: function transportConstructor(_transportConstructor) {\n if (_transportConstructor instanceof Function) {\n return _transportConstructor;\n }\n },\n transportOptions: function transportOptions(_transportOptions) {\n if (typeof _transportOptions === \"object\") {\n return _transportOptions;\n }\n },\n authorizationUser: function authorizationUser(_authorizationUser) {\n if (core_1.Grammar.parse('\"' + _authorizationUser + '\"', \"quoted_string\") === -1) {\n return;\n } else {\n return _authorizationUser;\n }\n },\n displayName: function displayName(_displayName) {\n if (core_1.Grammar.parse('\"' + _displayName + '\"', \"displayName\") === -1) {\n return;\n } else {\n return _displayName;\n }\n },\n dtmfType: function dtmfType(_dtmfType) {\n switch (_dtmfType) {\n case Constants_1.C.dtmfType.RTP:\n return Constants_1.C.dtmfType.RTP;\n\n case Constants_1.C.dtmfType.INFO: // Fall through\n\n default:\n return Constants_1.C.dtmfType.INFO;\n }\n },\n hackViaTcp: function hackViaTcp(_hackViaTcp) {\n if (typeof _hackViaTcp === \"boolean\") {\n return _hackViaTcp;\n }\n },\n hackIpInContact: function hackIpInContact(_hackIpInContact) {\n if (typeof _hackIpInContact === \"boolean\") {\n return _hackIpInContact;\n } else if (typeof _hackIpInContact === \"string\" && core_1.Grammar.parse(_hackIpInContact, \"host\") !== -1) {\n return _hackIpInContact;\n }\n },\n hackWssInTransport: function hackWssInTransport(_hackWssInTransport) {\n if (typeof _hackWssInTransport === \"boolean\") {\n return _hackWssInTransport;\n }\n },\n hackAllowUnregisteredOptionTags: function hackAllowUnregisteredOptionTags(_hackAllowUnregisteredOptionTags) {\n if (typeof _hackAllowUnregisteredOptionTags === \"boolean\") {\n return _hackAllowUnregisteredOptionTags;\n }\n },\n contactTransport: function contactTransport(_contactTransport) {\n if (typeof _contactTransport === \"string\") {\n return _contactTransport;\n }\n },\n extraSupported: function extraSupported(optionTags) {\n if (!(optionTags instanceof Array)) {\n return;\n }\n\n for (var _i = 0, optionTags_1 = optionTags; _i < optionTags_1.length; _i++) {\n var tag = optionTags_1[_i];\n\n if (typeof tag !== \"string\") {\n return;\n }\n }\n\n return optionTags;\n },\n forceRport: function forceRport(_forceRport) {\n if (typeof _forceRport === \"boolean\") {\n return _forceRport;\n }\n },\n noAnswerTimeout: function noAnswerTimeout(_noAnswerTimeout) {\n if (Utils_1.Utils.isDecimal(_noAnswerTimeout)) {\n var value = Number(_noAnswerTimeout);\n\n if (value > 0) {\n return value;\n }\n }\n },\n password: function password(_password) {\n return String(_password);\n },\n rel100: function rel100(_rel) {\n if (_rel === Constants_1.C.supported.REQUIRED) {\n return Constants_1.C.supported.REQUIRED;\n } else if (_rel === Constants_1.C.supported.SUPPORTED) {\n return Constants_1.C.supported.SUPPORTED;\n } else {\n return Constants_1.C.supported.UNSUPPORTED;\n }\n },\n replaces: function replaces(_replaces) {\n if (_replaces === Constants_1.C.supported.REQUIRED) {\n return Constants_1.C.supported.REQUIRED;\n } else if (_replaces === Constants_1.C.supported.SUPPORTED) {\n return Constants_1.C.supported.SUPPORTED;\n } else {\n return Constants_1.C.supported.UNSUPPORTED;\n }\n },\n register: function register(_register) {\n if (typeof _register === \"boolean\") {\n return _register;\n }\n },\n registerOptions: function registerOptions(_registerOptions) {\n if (typeof _registerOptions === \"object\") {\n return _registerOptions;\n }\n },\n usePreloadedRoute: function usePreloadedRoute(_usePreloadedRoute) {\n if (typeof _usePreloadedRoute === \"boolean\") {\n return _usePreloadedRoute;\n }\n },\n userAgentString: function userAgentString(_userAgentString) {\n if (typeof _userAgentString === \"string\") {\n return _userAgentString;\n }\n },\n autostart: function autostart(_autostart) {\n if (typeof _autostart === \"boolean\") {\n return _autostart;\n }\n },\n autostop: function autostop(_autostop) {\n if (typeof _autostop === \"boolean\") {\n return _autostop;\n }\n },\n sessionDescriptionHandlerFactory: function sessionDescriptionHandlerFactory(_sessionDescriptionHandlerFactory) {\n if (_sessionDescriptionHandlerFactory instanceof Function) {\n return _sessionDescriptionHandlerFactory;\n }\n },\n sessionDescriptionHandlerFactoryOptions: function sessionDescriptionHandlerFactoryOptions(options) {\n if (typeof options === \"object\") {\n return options;\n }\n },\n authenticationFactory: this.checkAuthenticationFactory,\n allowLegacyNotifications: function allowLegacyNotifications(_allowLegacyNotifications) {\n if (typeof _allowLegacyNotifications === \"boolean\") {\n return _allowLegacyNotifications;\n }\n },\n custom: function custom(_custom) {\n if (typeof _custom === \"object\") {\n return _custom;\n }\n },\n contactName: function contactName(_contactName) {\n if (typeof _contactName === \"string\") {\n return _contactName;\n }\n },\n experimentalFeatures: function experimentalFeatures(_experimentalFeatures) {\n if (typeof _experimentalFeatures === \"boolean\") {\n return _experimentalFeatures;\n }\n }\n }\n };\n };\n\n UA.C = {\n // UA status codes\n STATUS_INIT: 0,\n STATUS_STARTING: 1,\n STATUS_READY: 2,\n STATUS_USER_CLOSED: 3,\n STATUS_NOT_READY: 4,\n // UA error codes\n CONFIGURATION_ERROR: 1,\n NETWORK_ERROR: 2,\n ALLOWED_METHODS: [\"ACK\", \"CANCEL\", \"INVITE\", \"MESSAGE\", \"BYE\", \"OPTIONS\", \"INFO\", \"NOTIFY\", \"REFER\"],\n ACCEPTED_BODY_TYPES: [\"application/sdp\", \"application/dtmf-relay\"],\n MAX_FORWARDS: 70,\n TAG_LENGTH: 10\n };\n return UA;\n}(events_1.EventEmitter);\n\nexports.UA = UA;\n\n(function (UA) {\n var DtmfType;\n\n (function (DtmfType) {\n DtmfType[\"RTP\"] = \"rtp\";\n DtmfType[\"INFO\"] = \"info\";\n })(DtmfType = UA.DtmfType || (UA.DtmfType = {}));\n})(UA = exports.UA || (exports.UA = {}));\n\nexports.UA = UA;\n/**\n * Factory function to generate configuration give a UA.\n * @param ua UA\n */\n\nfunction makeUserAgentCoreConfigurationFromUA(ua) {\n // FIXME: Configuration URI is a bad mix of types currently. It also needs to exist.\n if (!(ua.configuration.uri instanceof core_1.URI)) {\n throw new Error(\"Configuration URI not instance of URI.\");\n }\n\n var aor = ua.configuration.uri;\n var contact = ua.contact;\n var displayName = ua.configuration.displayName ? ua.configuration.displayName : \"\";\n var hackViaTcp = ua.configuration.hackViaTcp ? true : false;\n var routeSet = ua.configuration.usePreloadedRoute && ua.transport.server && ua.transport.server.sipUri ? [ua.transport.server.sipUri] : [];\n var sipjsId = ua.configuration.sipjsId || Utils_1.Utils.createRandomToken(5);\n var supportedOptionTags = [];\n supportedOptionTags.push(\"outbound\"); // TODO: is this really supported?\n\n if (ua.configuration.rel100 === Constants_1.C.supported.SUPPORTED) {\n supportedOptionTags.push(\"100rel\");\n }\n\n if (ua.configuration.replaces === Constants_1.C.supported.SUPPORTED) {\n supportedOptionTags.push(\"replaces\");\n }\n\n if (ua.configuration.extraSupported) {\n supportedOptionTags.push.apply(supportedOptionTags, ua.configuration.extraSupported);\n }\n\n if (!ua.configuration.hackAllowUnregisteredOptionTags) {\n supportedOptionTags = supportedOptionTags.filter(function (optionTag) {\n return Constants_1.C.OPTION_TAGS[optionTag];\n });\n }\n\n supportedOptionTags = Array.from(new Set(supportedOptionTags)); // array of unique values\n\n var supportedOptionTagsResponse = ua.getSupportedResponseOptions();\n var userAgentHeaderFieldValue = ua.configuration.userAgentString || \"sipjs\";\n\n if (!ua.configuration.viaHost) {\n throw new Error(\"Configuration via host undefined\");\n }\n\n var viaForceRport = ua.configuration.forceRport ? true : false;\n var viaHost = ua.configuration.viaHost;\n var configuration = {\n aor: aor,\n contact: contact,\n displayName: displayName,\n hackViaTcp: hackViaTcp,\n loggerFactory: ua.getLoggerFactory(),\n routeSet: routeSet,\n sipjsId: sipjsId,\n supportedOptionTags: supportedOptionTags,\n supportedOptionTagsResponse: supportedOptionTagsResponse,\n userAgentHeaderFieldValue: userAgentHeaderFieldValue,\n viaForceRport: viaForceRport,\n viaHost: viaHost,\n authenticationFactory: function authenticationFactory() {\n if (ua.configuration.authenticationFactory) {\n return ua.configuration.authenticationFactory(ua);\n }\n\n return undefined;\n },\n transportAccessor: function transportAccessor() {\n return ua.transport;\n }\n };\n return configuration;\n}\n\nexports.makeUserAgentCoreConfigurationFromUA = makeUserAgentCoreConfigurationFromUA;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar events_1 = require(\"events\");\n\nvar Enums_1 = require(\"../Enums\");\n\nvar Exceptions_1 = require(\"../Exceptions\");\n\nvar Utils_1 = require(\"../Utils\");\n\nvar Modifiers = tslib_1.__importStar(require(\"./Modifiers\"));\n\nvar SessionDescriptionHandlerObserver_1 = require(\"./SessionDescriptionHandlerObserver\");\n/* SessionDescriptionHandler\n * @class PeerConnection helper Class.\n * @param {SIP.Session} session\n * @param {Object} [options]\n */\n\n\nvar SessionDescriptionHandler =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(SessionDescriptionHandler, _super);\n\n function SessionDescriptionHandler(logger, observer, options) {\n var _this = _super.call(this) || this;\n\n _this.type = Enums_1.TypeStrings.SessionDescriptionHandler; // TODO: Validate the options\n\n _this.options = options || {};\n _this.logger = logger;\n _this.observer = observer;\n _this.dtmfSender = undefined;\n _this.shouldAcquireMedia = true;\n _this.CONTENT_TYPE = \"application/sdp\";\n _this.C = {\n DIRECTION: {\n NULL: null,\n SENDRECV: \"sendrecv\",\n SENDONLY: \"sendonly\",\n RECVONLY: \"recvonly\",\n INACTIVE: \"inactive\"\n }\n };\n\n _this.logger.log(\"SessionDescriptionHandlerOptions: \" + JSON.stringify(_this.options));\n\n _this.direction = _this.C.DIRECTION.NULL;\n _this.modifiers = _this.options.modifiers || [];\n\n if (!Array.isArray(_this.modifiers)) {\n _this.modifiers = [_this.modifiers];\n }\n\n _this.iceGatheringTimeout = false;\n\n _this.initPeerConnection(_this.options.peerConnectionOptions);\n\n _this.constraints = _this.checkAndDefaultConstraints(_this.options.constraints);\n return _this;\n }\n /**\n * @param {SIP.Session} session\n * @param {Object} [options]\n */\n\n\n SessionDescriptionHandler.defaultFactory = function (session, options) {\n var logger = session.ua.getLogger(\"sip.invitecontext.sessionDescriptionHandler\", session.id);\n var observer = new SessionDescriptionHandlerObserver_1.SessionDescriptionHandlerObserver(session, options);\n return new SessionDescriptionHandler(logger, observer, options);\n }; // Functions the sesssion can use\n\n /**\n * Destructor\n */\n\n\n SessionDescriptionHandler.prototype.close = function () {\n this.logger.log(\"closing PeerConnection\"); // have to check signalingState since this.close() gets called multiple times\n\n if (this.peerConnection && this.peerConnection.signalingState !== \"closed\") {\n if (this.peerConnection.getSenders) {\n this.peerConnection.getSenders().forEach(function (sender) {\n if (sender.track) {\n sender.track.stop();\n }\n });\n } else {\n this.logger.warn(\"Using getLocalStreams which is deprecated\");\n this.peerConnection.getLocalStreams().forEach(function (stream) {\n stream.getTracks().forEach(function (track) {\n track.stop();\n });\n });\n }\n\n if (this.peerConnection.getReceivers) {\n this.peerConnection.getReceivers().forEach(function (receiver) {\n if (receiver.track) {\n receiver.track.stop();\n }\n });\n } else {\n this.logger.warn(\"Using getRemoteStreams which is deprecated\");\n this.peerConnection.getRemoteStreams().forEach(function (stream) {\n stream.getTracks().forEach(function (track) {\n track.stop();\n });\n });\n }\n\n this.resetIceGatheringComplete();\n this.peerConnection.close();\n }\n };\n /**\n * Gets the local description from the underlying media implementation\n * @param {Object} [options] Options object to be used by getDescription\n * @param {MediaStreamConstraints} [options.constraints] MediaStreamConstraints\n * https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints\n * @param {Object} [options.peerConnectionOptions] If this is set it will recreate the peer\n * connection with the new options\n * @param {Array} [modifiers] Array with one time use description modifiers\n * @returns {Promise} Promise that resolves with the local description to be used for the session\n */\n\n\n SessionDescriptionHandler.prototype.getDescription = function (options, modifiers) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n if (options.peerConnectionOptions) {\n this.initPeerConnection(options.peerConnectionOptions);\n } // Merge passed constraints with saved constraints and save\n\n\n var newConstraints = Object.assign({}, this.constraints, options.constraints);\n newConstraints = this.checkAndDefaultConstraints(newConstraints);\n\n if (JSON.stringify(newConstraints) !== JSON.stringify(this.constraints)) {\n this.constraints = newConstraints;\n this.shouldAcquireMedia = true;\n }\n\n if (!Array.isArray(modifiers)) {\n modifiers = [modifiers];\n }\n\n modifiers = modifiers.concat(this.modifiers);\n return Promise.resolve().then(function () {\n if (_this.shouldAcquireMedia) {\n return _this.acquire(_this.constraints).then(function () {\n _this.shouldAcquireMedia = false;\n });\n }\n }).then(function () {\n return _this.createOfferOrAnswer(options.RTCOfferOptions, modifiers);\n }).then(function (description) {\n if (description.sdp === undefined) {\n throw new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"getDescription\", undefined, \"SDP undefined\");\n }\n\n _this.emit(\"getDescription\", description);\n\n return {\n body: description.sdp,\n contentType: _this.CONTENT_TYPE\n };\n });\n };\n /**\n * Check if the Session Description Handler can handle the Content-Type described by a SIP Message\n * @param {String} contentType The content type that is in the SIP Message\n * @returns {boolean}\n */\n\n\n SessionDescriptionHandler.prototype.hasDescription = function (contentType) {\n return contentType === this.CONTENT_TYPE;\n };\n /**\n * The modifier that should be used when the session would like to place the call on hold\n * @param {String} [sdp] The description that will be modified\n * @returns {Promise} Promise that resolves with modified SDP\n */\n\n\n SessionDescriptionHandler.prototype.holdModifier = function (description) {\n if (!description.sdp) {\n return Promise.resolve(description);\n }\n\n if (!/a=(sendrecv|sendonly|recvonly|inactive)/.test(description.sdp)) {\n description.sdp = description.sdp.replace(/(m=[^\\r]*\\r\\n)/g, \"$1a=sendonly\\r\\n\");\n } else {\n description.sdp = description.sdp.replace(/a=sendrecv\\r\\n/g, \"a=sendonly\\r\\n\");\n description.sdp = description.sdp.replace(/a=recvonly\\r\\n/g, \"a=inactive\\r\\n\");\n }\n\n return Promise.resolve(description);\n };\n /**\n * Set the remote description to the underlying media implementation\n * @param {String} sessionDescription The description provided by a SIP message to be set on the media implementation\n * @param {Object} [options] Options object to be used by getDescription\n * @param {MediaStreamConstraints} [options.constraints] MediaStreamConstraints\n * https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints\n * @param {Object} [options.peerConnectionOptions] If this is set it will recreate the peer\n * connection with the new options\n * @param {Array} [modifiers] Array with one time use description modifiers\n * @returns {Promise} Promise that resolves once the description is set\n */\n\n\n SessionDescriptionHandler.prototype.setDescription = function (sessionDescription, options, modifiers) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n if (options.peerConnectionOptions) {\n this.initPeerConnection(options.peerConnectionOptions);\n }\n\n if (!Array.isArray(modifiers)) {\n modifiers = [modifiers];\n }\n\n modifiers = modifiers.concat(this.modifiers);\n var description = {\n type: this.hasOffer(\"local\") ? \"answer\" : \"offer\",\n sdp: sessionDescription\n };\n return Promise.resolve().then(function () {\n // Media should be acquired in getDescription unless we need to do it sooner for some reason (FF61+)\n if (_this.shouldAcquireMedia && _this.options.alwaysAcquireMediaFirst) {\n return _this.acquire(_this.constraints).then(function () {\n _this.shouldAcquireMedia = false;\n });\n }\n }).then(function () {\n return Utils_1.Utils.reducePromises(modifiers, description);\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"setDescription\", e, \"The modifiers did not resolve successfully\");\n\n _this.logger.error(error.message);\n\n _this.emit(\"peerConnection-setRemoteDescriptionFailed\", error);\n\n throw error;\n }).then(function (modifiedDescription) {\n _this.emit(\"setDescription\", modifiedDescription);\n\n return _this.peerConnection.setRemoteDescription(modifiedDescription);\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n } // Check the original SDP for video, and ensure that we have want to do audio fallback\n\n\n if (/^m=video.+$/gm.test(sessionDescription) && !options.disableAudioFallback) {\n // Do not try to audio fallback again\n options.disableAudioFallback = true; // Remove video first, then do the other modifiers\n\n return _this.setDescription(sessionDescription, options, [Modifiers.stripVideo].concat(modifiers));\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"setDescription\", e);\n\n if (error.error) {\n _this.logger.error(error.error);\n }\n\n _this.emit(\"peerConnection-setRemoteDescriptionFailed\", error);\n\n throw error;\n }).then(function () {\n if (_this.peerConnection.getReceivers) {\n _this.emit(\"setRemoteDescription\", _this.peerConnection.getReceivers());\n } else {\n _this.emit(\"setRemoteDescription\", _this.peerConnection.getRemoteStreams());\n }\n\n _this.emit(\"confirmed\", _this);\n });\n };\n /**\n * Send DTMF via RTP (RFC 4733)\n * @param {String} tones A string containing DTMF digits\n * @param {Object} [options] Options object to be used by sendDtmf\n * @returns {boolean} true if DTMF send is successful, false otherwise\n */\n\n\n SessionDescriptionHandler.prototype.sendDtmf = function (tones, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!this.dtmfSender && this.hasBrowserGetSenderSupport()) {\n var senders = this.peerConnection.getSenders();\n\n if (senders.length > 0) {\n this.dtmfSender = senders[0].dtmf;\n }\n }\n\n if (!this.dtmfSender && this.hasBrowserTrackSupport()) {\n var streams = this.peerConnection.getLocalStreams();\n\n if (streams.length > 0) {\n var audioTracks = streams[0].getAudioTracks();\n\n if (audioTracks.length > 0) {\n this.dtmfSender = this.peerConnection.createDTMFSender(audioTracks[0]);\n }\n }\n }\n\n if (!this.dtmfSender) {\n return false;\n }\n\n try {\n this.dtmfSender.insertDTMF(tones, options.duration, options.interToneGap);\n } catch (e) {\n if (e.type === \"InvalidStateError\" || e.type === \"InvalidCharacterError\") {\n this.logger.error(e);\n return false;\n } else {\n throw e;\n }\n }\n\n this.logger.log(\"DTMF sent via RTP: \" + tones.toString());\n return true;\n };\n /**\n * Get the direction of the session description\n * @returns {String} direction of the description\n */\n\n\n SessionDescriptionHandler.prototype.getDirection = function () {\n return this.direction;\n };\n\n SessionDescriptionHandler.prototype.on = function (name, callback) {\n return _super.prototype.on.call(this, name, callback);\n }; // Internal functions\n\n\n SessionDescriptionHandler.prototype.createOfferOrAnswer = function (RTCOfferOptions, modifiers) {\n var _this = this;\n\n if (RTCOfferOptions === void 0) {\n RTCOfferOptions = {};\n }\n\n if (modifiers === void 0) {\n modifiers = [];\n }\n\n var methodName = this.hasOffer(\"remote\") ? \"createAnswer\" : \"createOffer\";\n var pc = this.peerConnection;\n this.logger.log(methodName);\n var method = this.hasOffer(\"remote\") ? pc.createAnswer : pc.createOffer;\n return method.apply(pc, RTCOfferOptions).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"createOfferOrAnswer\", e, \"peerConnection-\" + methodName + \"Failed\");\n\n _this.emit(\"peerConnection-\" + methodName + \"Failed\", error);\n\n throw error;\n }).then(function (sdp) {\n return Utils_1.Utils.reducePromises(modifiers, _this.createRTCSessionDescriptionInit(sdp));\n }).then(function (sdp) {\n _this.resetIceGatheringComplete();\n\n _this.logger.log(\"Setting local sdp.\");\n\n _this.logger.log(\"sdp is \" + sdp.sdp || \"undefined\");\n\n return pc.setLocalDescription(sdp);\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"createOfferOrAnswer\", e, \"peerConnection-SetLocalDescriptionFailed\");\n\n _this.emit(\"peerConnection-SetLocalDescriptionFailed\", error);\n\n throw error;\n }).then(function () {\n return _this.waitForIceGatheringComplete();\n }).then(function () {\n var localDescription = _this.createRTCSessionDescriptionInit(_this.peerConnection.localDescription);\n\n return Utils_1.Utils.reducePromises(modifiers, localDescription);\n }).then(function (localDescription) {\n _this.setDirection(localDescription.sdp || \"\");\n\n return localDescription;\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"createOfferOrAnswer\", e);\n\n _this.logger.error(error.toString());\n\n throw error;\n });\n }; // Creates an RTCSessionDescriptionInit from an RTCSessionDescription\n\n\n SessionDescriptionHandler.prototype.createRTCSessionDescriptionInit = function (RTCSessionDescription) {\n return {\n type: RTCSessionDescription.type,\n sdp: RTCSessionDescription.sdp\n };\n };\n\n SessionDescriptionHandler.prototype.addDefaultIceCheckingTimeout = function (peerConnectionOptions) {\n if (peerConnectionOptions.iceCheckingTimeout === undefined) {\n peerConnectionOptions.iceCheckingTimeout = 5000;\n }\n\n return peerConnectionOptions;\n };\n\n SessionDescriptionHandler.prototype.addDefaultIceServers = function (rtcConfiguration) {\n if (!rtcConfiguration.iceServers) {\n rtcConfiguration.iceServers = [{\n urls: \"stun:stun.l.google.com:19302\"\n }];\n }\n\n return rtcConfiguration;\n };\n\n SessionDescriptionHandler.prototype.checkAndDefaultConstraints = function (constraints) {\n var defaultConstraints = {\n audio: true,\n video: !this.options.alwaysAcquireMediaFirst\n };\n constraints = constraints || defaultConstraints; // Empty object check\n\n if (Object.keys(constraints).length === 0 && constraints.constructor === Object) {\n return defaultConstraints;\n }\n\n return constraints;\n };\n\n SessionDescriptionHandler.prototype.hasBrowserTrackSupport = function () {\n return Boolean(this.peerConnection.addTrack);\n };\n\n SessionDescriptionHandler.prototype.hasBrowserGetSenderSupport = function () {\n return Boolean(this.peerConnection.getSenders);\n };\n\n SessionDescriptionHandler.prototype.initPeerConnection = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n options = this.addDefaultIceCheckingTimeout(options);\n options.rtcConfiguration = options.rtcConfiguration || {};\n options.rtcConfiguration = this.addDefaultIceServers(options.rtcConfiguration);\n this.logger.log(\"initPeerConnection\");\n\n if (this.peerConnection) {\n this.logger.log(\"Already have a peer connection for this session. Tearing down.\");\n this.resetIceGatheringComplete();\n this.peerConnection.close();\n }\n\n this.peerConnection = new RTCPeerConnection(options.rtcConfiguration);\n this.logger.log(\"New peer connection created\");\n\n if (\"ontrack\" in this.peerConnection) {\n this.peerConnection.addEventListener(\"track\", function (e) {\n _this.logger.log(\"track added\");\n\n _this.observer.trackAdded();\n\n _this.emit(\"addTrack\", e);\n });\n } else {\n this.logger.warn(\"Using onaddstream which is deprecated\");\n\n this.peerConnection.onaddstream = function (e) {\n _this.logger.log(\"stream added\");\n\n _this.emit(\"addStream\", e);\n };\n }\n\n this.peerConnection.onicecandidate = function (e) {\n _this.emit(\"iceCandidate\", e);\n\n if (e.candidate) {\n _this.logger.log(\"ICE candidate received: \" + (e.candidate.candidate === null ? null : e.candidate.candidate.trim()));\n } else if (e.candidate === null) {\n // indicates the end of candidate gathering\n _this.logger.log(\"ICE candidate gathering complete\");\n\n _this.triggerIceGatheringComplete();\n }\n };\n\n this.peerConnection.onicegatheringstatechange = function () {\n _this.logger.log(\"RTCIceGatheringState changed: \" + _this.peerConnection.iceGatheringState);\n\n switch (_this.peerConnection.iceGatheringState) {\n case \"gathering\":\n _this.emit(\"iceGathering\", _this);\n\n if (!_this.iceGatheringTimer && options.iceCheckingTimeout) {\n _this.iceGatheringTimeout = false;\n _this.iceGatheringTimer = setTimeout(function () {\n _this.logger.log(\"RTCIceChecking Timeout Triggered after \" + options.iceCheckingTimeout + \" milliseconds\");\n\n _this.iceGatheringTimeout = true;\n\n _this.triggerIceGatheringComplete();\n }, options.iceCheckingTimeout);\n }\n\n break;\n\n case \"complete\":\n _this.triggerIceGatheringComplete();\n\n break;\n }\n };\n\n this.peerConnection.oniceconnectionstatechange = function () {\n var stateEvent;\n\n switch (_this.peerConnection.iceConnectionState) {\n case \"new\":\n stateEvent = \"iceConnection\";\n break;\n\n case \"checking\":\n stateEvent = \"iceConnectionChecking\";\n break;\n\n case \"connected\":\n stateEvent = \"iceConnectionConnected\";\n break;\n\n case \"completed\":\n stateEvent = \"iceConnectionCompleted\";\n break;\n\n case \"failed\":\n stateEvent = \"iceConnectionFailed\";\n break;\n\n case \"disconnected\":\n stateEvent = \"iceConnectionDisconnected\";\n break;\n\n case \"closed\":\n stateEvent = \"iceConnectionClosed\";\n break;\n\n default:\n _this.logger.warn(\"Unknown iceConnection state: \" + _this.peerConnection.iceConnectionState);\n\n return;\n }\n\n _this.logger.log(\"ICE Connection State changed to \" + stateEvent);\n\n _this.emit(stateEvent, _this);\n };\n };\n\n SessionDescriptionHandler.prototype.acquire = function (constraints) {\n var _this = this; // Default audio & video to true\n\n\n constraints = this.checkAndDefaultConstraints(constraints);\n return new Promise(function (resolve, reject) {\n /*\n * Make the call asynchronous, so that ICCs have a chance\n * to define callbacks to `userMediaRequest`\n */\n _this.logger.log(\"acquiring local media\");\n\n _this.emit(\"userMediaRequest\", constraints);\n\n if (constraints.audio || constraints.video) {\n navigator.mediaDevices.getUserMedia(constraints).then(function (streams) {\n _this.observer.trackAdded();\n\n _this.emit(\"userMedia\", streams);\n\n resolve(streams);\n }).catch(function (e) {\n _this.emit(\"userMediaFailed\", e);\n\n reject(e);\n });\n } else {\n // Local streams were explicitly excluded.\n resolve([]);\n }\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"acquire\", e, \"unable to acquire streams\");\n\n _this.logger.error(error.message);\n\n if (error.error) {\n _this.logger.error(error.error);\n }\n\n throw error;\n }).then(function (streams) {\n _this.logger.log(\"acquired local media streams\");\n\n try {\n // Remove old tracks\n if (_this.peerConnection.removeTrack) {\n _this.peerConnection.getSenders().forEach(function (sender) {\n _this.peerConnection.removeTrack(sender);\n });\n }\n\n return streams;\n } catch (e) {\n return Promise.reject(e);\n }\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"acquire\", e, \"error removing streams\");\n\n _this.logger.error(error.message);\n\n if (error.error) {\n _this.logger.error(error.error);\n }\n\n throw error;\n }).then(function (streams) {\n try {\n streams = [].concat(streams);\n streams.forEach(function (stream) {\n if (_this.peerConnection.addTrack) {\n stream.getTracks().forEach(function (track) {\n _this.peerConnection.addTrack(track, stream);\n });\n } else {\n // Chrome 59 does not support addTrack\n _this.peerConnection.addStream(stream);\n }\n });\n } catch (e) {\n return Promise.reject(e);\n }\n\n return Promise.resolve();\n }).catch(function (e) {\n if (e.type === Enums_1.TypeStrings.SessionDescriptionHandlerError) {\n throw e;\n }\n\n var error = new Exceptions_1.Exceptions.SessionDescriptionHandlerError(\"acquire\", e, \"error adding stream\");\n\n _this.logger.error(error.message);\n\n if (error.error) {\n _this.logger.error(error.error);\n }\n\n throw error;\n });\n };\n\n SessionDescriptionHandler.prototype.hasOffer = function (where) {\n var offerState = \"have-\" + where + \"-offer\";\n return this.peerConnection.signalingState === offerState;\n }; // ICE gathering state handling\n\n\n SessionDescriptionHandler.prototype.isIceGatheringComplete = function () {\n return this.peerConnection.iceGatheringState === \"complete\" || this.iceGatheringTimeout;\n };\n\n SessionDescriptionHandler.prototype.resetIceGatheringComplete = function () {\n this.iceGatheringTimeout = false;\n this.logger.log(\"resetIceGatheringComplete\");\n\n if (this.iceGatheringTimer) {\n clearTimeout(this.iceGatheringTimer);\n this.iceGatheringTimer = undefined;\n }\n\n if (this.iceGatheringDeferred) {\n this.iceGatheringDeferred.reject();\n this.iceGatheringDeferred = undefined;\n }\n };\n\n SessionDescriptionHandler.prototype.setDirection = function (sdp) {\n var match = sdp.match(/a=(sendrecv|sendonly|recvonly|inactive)/);\n\n if (match === null) {\n this.direction = this.C.DIRECTION.NULL;\n this.observer.directionChanged();\n return;\n }\n\n var direction = match[1];\n\n switch (direction) {\n case this.C.DIRECTION.SENDRECV:\n case this.C.DIRECTION.SENDONLY:\n case this.C.DIRECTION.RECVONLY:\n case this.C.DIRECTION.INACTIVE:\n this.direction = direction;\n break;\n\n default:\n this.direction = this.C.DIRECTION.NULL;\n break;\n }\n\n this.observer.directionChanged();\n };\n\n SessionDescriptionHandler.prototype.triggerIceGatheringComplete = function () {\n if (this.isIceGatheringComplete()) {\n this.emit(\"iceGatheringComplete\", this);\n\n if (this.iceGatheringTimer) {\n clearTimeout(this.iceGatheringTimer);\n this.iceGatheringTimer = undefined;\n }\n\n if (this.iceGatheringDeferred) {\n this.iceGatheringDeferred.resolve();\n this.iceGatheringDeferred = undefined;\n }\n }\n };\n\n SessionDescriptionHandler.prototype.waitForIceGatheringComplete = function () {\n this.logger.log(\"waitForIceGatheringComplete\");\n\n if (this.isIceGatheringComplete()) {\n this.logger.log(\"ICE is already complete. Return resolved.\");\n return Promise.resolve();\n } else if (!this.iceGatheringDeferred) {\n this.iceGatheringDeferred = Utils_1.Utils.defer();\n }\n\n this.logger.log(\"ICE is not complete. Returning promise\");\n return this.iceGatheringDeferred ? this.iceGatheringDeferred.promise : Promise.resolve();\n };\n\n return SessionDescriptionHandler;\n}(events_1.EventEmitter);\n\nexports.SessionDescriptionHandler = SessionDescriptionHandler;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar tslib_1 = require(\"tslib\");\n\nvar core_1 = require(\"../core\");\n\nvar Enums_1 = require(\"../Enums\");\n\nvar Exceptions_1 = require(\"../Exceptions\");\n\nvar Utils_1 = require(\"../Utils\");\n\nvar TransportStatus;\n\n(function (TransportStatus) {\n TransportStatus[TransportStatus[\"STATUS_CONNECTING\"] = 0] = \"STATUS_CONNECTING\";\n TransportStatus[TransportStatus[\"STATUS_OPEN\"] = 1] = \"STATUS_OPEN\";\n TransportStatus[TransportStatus[\"STATUS_CLOSING\"] = 2] = \"STATUS_CLOSING\";\n TransportStatus[TransportStatus[\"STATUS_CLOSED\"] = 3] = \"STATUS_CLOSED\";\n})(TransportStatus = exports.TransportStatus || (exports.TransportStatus = {}));\n/**\n * Compute an amount of time in seconds to wait before sending another\n * keep-alive.\n * @returns {Number}\n */\n\n\nvar computeKeepAliveTimeout = function computeKeepAliveTimeout(upperBound) {\n var lowerBound = upperBound * 0.8;\n return 1000 * (Math.random() * (upperBound - lowerBound) + lowerBound);\n};\n/**\n * @class Transport\n * @param {Object} options\n */\n\n\nvar Transport =\n/** @class */\nfunction (_super) {\n tslib_1.__extends(Transport, _super);\n\n function Transport(logger, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = _super.call(this, logger, options) || this;\n\n _this.type = Enums_1.TypeStrings.Transport;\n _this.reconnectionAttempts = 0;\n _this.status = TransportStatus.STATUS_CONNECTING;\n _this.configuration = _this.loadConfig(options);\n _this.server = _this.configuration.wsServers[0];\n return _this;\n }\n /**\n * @returns {Boolean}\n */\n\n\n Transport.prototype.isConnected = function () {\n return this.status === TransportStatus.STATUS_OPEN;\n };\n /**\n * Send a message.\n * @param {SIP.OutgoingRequest|String} msg\n * @param {Object} [options]\n * @returns {Promise}\n */\n\n\n Transport.prototype.sendPromise = function (msg, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!this.statusAssert(TransportStatus.STATUS_OPEN, options.force)) {\n this.onError(\"unable to send message - WebSocket not open\");\n return Promise.reject();\n }\n\n var message = msg.toString();\n\n if (this.ws) {\n if (this.configuration.traceSip === true) {\n this.logger.log(\"sending WebSocket message:\\n\\n\" + message + \"\\n\");\n }\n\n this.ws.send(message);\n return Promise.resolve({\n msg: message\n });\n } else {\n this.onError(\"unable to send message - WebSocket does not exist\");\n return Promise.reject();\n }\n };\n /**\n * Disconnect socket.\n */\n\n\n Transport.prototype.disconnectPromise = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (this.disconnectionPromise) {\n // Already disconnecting. Just return this.\n return this.disconnectionPromise;\n }\n\n options.code = options.code || 1000;\n\n if (!this.statusTransition(TransportStatus.STATUS_CLOSING, options.force)) {\n if (this.status === TransportStatus.STATUS_CLOSED) {\n // Websocket is already closed\n return Promise.resolve({\n overrideEvent: true\n });\n } else if (this.connectionPromise) {\n // Websocket is connecting, cannot move to disconneting yet\n return this.connectionPromise.then(function () {\n return Promise.reject(\"The websocket did not disconnect\");\n }).catch(function () {\n return Promise.resolve({\n overrideEvent: true\n });\n });\n } else {\n // Cannot move to disconnecting, but not in connecting state.\n return Promise.reject(\"The websocket did not disconnect\");\n }\n }\n\n this.emit(\"disconnecting\");\n this.disconnectionPromise = new Promise(function (resolve, reject) {\n _this.disconnectDeferredResolve = resolve;\n\n if (_this.reconnectTimer) {\n clearTimeout(_this.reconnectTimer);\n _this.reconnectTimer = undefined;\n }\n\n if (_this.ws) {\n _this.stopSendingKeepAlives();\n\n _this.logger.log(\"closing WebSocket \" + _this.server.wsUri);\n\n _this.ws.close(options.code, options.reason);\n } else {\n reject(\"Attempted to disconnect but the websocket doesn't exist\");\n }\n });\n return this.disconnectionPromise;\n };\n /**\n * Connect socket.\n */\n\n\n Transport.prototype.connectPromise = function (options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (this.status === TransportStatus.STATUS_CLOSING && !options.force) {\n return Promise.reject(\"WebSocket \" + this.server.wsUri + \" is closing\");\n }\n\n if (this.connectionPromise) {\n return this.connectionPromise;\n }\n\n this.server = this.server || this.getNextWsServer(options.force);\n this.connectionPromise = new Promise(function (resolve, reject) {\n if ((_this.status === TransportStatus.STATUS_OPEN || _this.status === TransportStatus.STATUS_CLOSING) && !options.force) {\n _this.logger.warn(\"WebSocket \" + _this.server.wsUri + \" is already connected\");\n\n reject(\"Failed status check - attempted to open a connection but already open/closing\");\n return;\n }\n\n _this.connectDeferredResolve = resolve;\n _this.connectDeferredReject = reject;\n _this.status = TransportStatus.STATUS_CONNECTING;\n\n _this.emit(\"connecting\");\n\n _this.logger.log(\"connecting to WebSocket \" + _this.server.wsUri);\n\n _this.disposeWs();\n\n try {\n _this.ws = new WebSocket(_this.server.wsUri, \"sip\");\n } catch (e) {\n _this.ws = null;\n\n _this.statusTransition(TransportStatus.STATUS_CLOSED, true);\n\n _this.onError(\"error connecting to WebSocket \" + _this.server.wsUri + \":\" + e);\n\n reject(\"Failed to create a websocket\");\n _this.connectDeferredResolve = undefined;\n _this.connectDeferredReject = undefined;\n return;\n }\n\n if (!_this.ws) {\n reject(\"Unexpected instance websocket not set\");\n _this.connectDeferredResolve = undefined;\n _this.connectDeferredReject = undefined;\n return;\n }\n\n _this.connectionTimeout = setTimeout(function () {\n _this.statusTransition(TransportStatus.STATUS_CLOSED);\n\n _this.logger.warn(\"took too long to connect - exceeded time set in configuration.connectionTimeout: \" + _this.configuration.connectionTimeout + \"s\");\n\n _this.emit(\"disconnected\", {\n code: 1000\n });\n\n _this.connectionPromise = undefined;\n reject(\"Connection timeout\");\n _this.connectDeferredResolve = undefined;\n _this.connectDeferredReject = undefined;\n }, _this.configuration.connectionTimeout * 1000);\n _this.boundOnOpen = _this.onOpen.bind(_this);\n _this.boundOnMessage = _this.onMessage.bind(_this);\n _this.boundOnClose = _this.onClose.bind(_this);\n _this.boundOnError = _this.onWebsocketError.bind(_this);\n\n _this.ws.addEventListener(\"open\", _this.boundOnOpen);\n\n _this.ws.addEventListener(\"message\", _this.boundOnMessage);\n\n _this.ws.addEventListener(\"close\", _this.boundOnClose);\n\n _this.ws.addEventListener(\"error\", _this.boundOnError);\n });\n return this.connectionPromise;\n };\n /**\n * @event\n * @param {event} e\n */\n\n\n Transport.prototype.onMessage = function (e) {\n var data = e.data;\n var finishedData; // CRLF Keep Alive response from server. Clear our keep alive timeout.\n\n if (/^(\\r\\n)+$/.test(data)) {\n this.clearKeepAliveTimeout();\n\n if (this.configuration.traceSip === true) {\n this.logger.log(\"received WebSocket message with CRLF Keep Alive response\");\n }\n\n return;\n } else if (!data) {\n this.logger.warn(\"received empty message, message discarded\");\n return;\n } else if (typeof data !== \"string\") {\n // WebSocket binary message.\n try {\n // the UInt8Data was here prior to types, and doesn't check\n finishedData = String.fromCharCode.apply(null, new Uint8Array(data));\n } catch (err) {\n this.logger.warn(\"received WebSocket binary message failed to be converted into string, message discarded\");\n return;\n }\n\n if (this.configuration.traceSip === true) {\n this.logger.log(\"received WebSocket binary message:\\n\\n\" + data + \"\\n\");\n }\n } else {\n // WebSocket text message.\n if (this.configuration.traceSip === true) {\n this.logger.log(\"received WebSocket text message:\\n\\n\" + data + \"\\n\");\n }\n\n finishedData = data;\n }\n\n this.emit(\"message\", finishedData);\n }; // Transport Event Handlers\n\n /**\n * @event\n * @param {event} e\n */\n\n\n Transport.prototype.onOpen = function () {\n if (this.status === TransportStatus.STATUS_CLOSED) {\n // Indicated that the transport thinks the ws is dead already\n var ws = this.ws;\n this.disposeWs();\n ws.close(1000);\n return;\n }\n\n this.statusTransition(TransportStatus.STATUS_OPEN, true);\n this.emit(\"connected\");\n\n if (this.connectionTimeout) {\n clearTimeout(this.connectionTimeout);\n this.connectionTimeout = undefined;\n }\n\n this.logger.log(\"WebSocket \" + this.server.wsUri + \" connected\"); // Clear reconnectTimer since we are not disconnected\n\n if (this.reconnectTimer !== undefined) {\n clearTimeout(this.reconnectTimer);\n this.reconnectTimer = undefined;\n } // Reset reconnectionAttempts\n\n\n this.reconnectionAttempts = 0; // Reset disconnection promise so we can disconnect from a fresh state\n\n this.disconnectionPromise = undefined;\n this.disconnectDeferredResolve = undefined; // Start sending keep-alives\n\n this.startSendingKeepAlives();\n\n if (this.connectDeferredResolve) {\n this.connectDeferredResolve({\n overrideEvent: true\n });\n this.connectDeferredResolve = undefined;\n this.connectDeferredReject = undefined;\n } else {\n this.logger.warn(\"Unexpected websocket.onOpen with no connectDeferredResolve\");\n }\n };\n /**\n * @event\n * @param {event} e\n */\n\n\n Transport.prototype.onClose = function (e) {\n this.logger.log(\"WebSocket disconnected (code: \" + e.code + (e.reason ? \"| reason: \" + e.reason : \"\") + \")\");\n\n if (this.status !== TransportStatus.STATUS_CLOSING) {\n this.logger.warn(\"WebSocket closed without SIP.js requesting it\");\n this.emit(\"transportError\");\n }\n\n this.stopSendingKeepAlives(); // Clean up connection variables so we can connect again from a fresh state\n\n if (this.connectionTimeout) {\n clearTimeout(this.connectionTimeout);\n }\n\n if (this.connectDeferredReject) {\n this.connectDeferredReject(\"Websocket Closed\");\n }\n\n this.connectionTimeout = undefined;\n this.connectionPromise = undefined;\n this.connectDeferredResolve = undefined;\n this.connectDeferredReject = undefined; // Check whether the user requested to close.\n\n if (this.disconnectDeferredResolve) {\n this.disconnectDeferredResolve({\n overrideEvent: true\n });\n this.statusTransition(TransportStatus.STATUS_CLOSED);\n this.disconnectDeferredResolve = undefined;\n return;\n }\n\n this.statusTransition(TransportStatus.STATUS_CLOSED, true);\n this.emit(\"disconnected\", {\n code: e.code,\n reason: e.reason\n });\n this.reconnect();\n };\n /**\n * Removes event listeners and clears the instance ws\n */\n\n\n Transport.prototype.disposeWs = function () {\n if (this.ws) {\n this.ws.removeEventListener(\"open\", this.boundOnOpen);\n this.ws.removeEventListener(\"message\", this.boundOnMessage);\n this.ws.removeEventListener(\"close\", this.boundOnClose);\n this.ws.removeEventListener(\"error\", this.boundOnError);\n this.ws = undefined;\n }\n };\n /**\n * @event\n * @param {string} e\n */\n\n\n Transport.prototype.onError = function (e) {\n this.logger.warn(\"Transport error: \" + e);\n this.emit(\"transportError\");\n };\n /**\n * @event\n * @private\n */\n\n\n Transport.prototype.onWebsocketError = function () {\n this.onError(\"The Websocket had an error\");\n };\n /**\n * Reconnection attempt logic.\n */\n\n\n Transport.prototype.reconnect = function () {\n var _this = this;\n\n if (this.reconnectionAttempts > 0) {\n this.logger.log(\"Reconnection attempt \" + this.reconnectionAttempts + \" failed\");\n }\n\n if (this.noAvailableServers()) {\n this.logger.warn(\"attempted to get next ws server but there are no available ws servers left\");\n this.logger.warn(\"no available ws servers left - going to closed state\");\n this.statusTransition(TransportStatus.STATUS_CLOSED, true);\n this.emit(\"closed\");\n this.resetServerErrorStatus();\n return;\n }\n\n if (this.isConnected()) {\n this.logger.warn(\"attempted to reconnect while connected - forcing disconnect\");\n this.disconnect({\n force: true\n });\n }\n\n this.reconnectionAttempts += 1;\n\n if (this.reconnectionAttempts > this.configuration.maxReconnectionAttempts) {\n this.logger.warn(\"maximum reconnection attempts for WebSocket \" + this.server.wsUri);\n this.logger.log(\"transport \" + this.server.wsUri + \" failed | connection state set to 'error'\");\n this.server.isError = true;\n this.emit(\"transportError\");\n\n if (!this.noAvailableServers()) {\n this.server = this.getNextWsServer();\n } // When there are no available servers, the reconnect function ends on the next recursive call\n // after checking for no available servers again.\n\n\n this.reconnectionAttempts = 0;\n this.reconnect();\n } else {\n this.logger.log(\"trying to reconnect to WebSocket \" + this.server.wsUri + \" (reconnection attempt \" + this.reconnectionAttempts + \")\");\n this.reconnectTimer = setTimeout(function () {\n _this.connect();\n\n _this.reconnectTimer = undefined;\n }, this.reconnectionAttempts === 1 ? 0 : this.configuration.reconnectionTimeout * 1000);\n }\n };\n /**\n * Resets the error state of all servers in the configuration\n */\n\n\n Transport.prototype.resetServerErrorStatus = function () {\n for (var _i = 0, _a = this.configuration.wsServers; _i < _a.length; _i++) {\n var websocket = _a[_i];\n websocket.isError = false;\n }\n };\n /**\n * Retrieve the next server to which connect.\n * @param {Boolean} force allows bypass of server error status checking\n * @returns {Object} WsServer\n */\n\n\n Transport.prototype.getNextWsServer = function (force) {\n if (force === void 0) {\n force = false;\n }\n\n if (this.noAvailableServers()) {\n this.logger.warn(\"attempted to get next ws server but there are no available ws servers left\");\n throw new Error(\"Attempted to get next ws server, but there are no available ws servers left.\");\n } // Order servers by weight\n\n\n var candidates = [];\n\n for (var _i = 0, _a = this.configuration.wsServers; _i < _a.length; _i++) {\n var wsServer = _a[_i];\n\n if (wsServer.isError && !force) {\n continue;\n } else if (candidates.length === 0) {\n candidates.push(wsServer);\n } else if (wsServer.weight > candidates[0].weight) {\n candidates = [wsServer];\n } else if (wsServer.weight === candidates[0].weight) {\n candidates.push(wsServer);\n }\n }\n\n var idx = Math.floor(Math.random() * candidates.length);\n return candidates[idx];\n };\n /**\n * Checks all configuration servers, returns true if all of them have isError: true and false otherwise\n * @returns {Boolean}\n */\n\n\n Transport.prototype.noAvailableServers = function () {\n for (var _i = 0, _a = this.configuration.wsServers; _i < _a.length; _i++) {\n var server = _a[_i];\n\n if (!server.isError) {\n return false;\n }\n }\n\n return true;\n }; // ==============================\n // KeepAlive Stuff\n // ==============================\n\n /**\n * Send a keep-alive (a double-CRLF sequence).\n * @returns {Boolean}\n */\n\n\n Transport.prototype.sendKeepAlive = function () {\n var _this = this;\n\n if (this.keepAliveDebounceTimeout) {\n // We already have an outstanding keep alive, do not send another.\n return;\n }\n\n this.keepAliveDebounceTimeout = setTimeout(function () {\n _this.emit(\"keepAliveDebounceTimeout\");\n\n _this.clearKeepAliveTimeout();\n }, this.configuration.keepAliveDebounce * 1000);\n return this.send(\"\\r\\n\\r\\n\");\n };\n\n Transport.prototype.clearKeepAliveTimeout = function () {\n if (this.keepAliveDebounceTimeout) {\n clearTimeout(this.keepAliveDebounceTimeout);\n }\n\n this.keepAliveDebounceTimeout = undefined;\n };\n /**\n * Start sending keep-alives.\n */\n\n\n Transport.prototype.startSendingKeepAlives = function () {\n var _this = this;\n\n if (this.configuration.keepAliveInterval && !this.keepAliveInterval) {\n this.keepAliveInterval = setInterval(function () {\n _this.sendKeepAlive();\n\n _this.startSendingKeepAlives();\n }, computeKeepAliveTimeout(this.configuration.keepAliveInterval));\n }\n };\n /**\n * Stop sending keep-alives.\n */\n\n\n Transport.prototype.stopSendingKeepAlives = function () {\n if (this.keepAliveInterval) {\n clearInterval(this.keepAliveInterval);\n }\n\n if (this.keepAliveDebounceTimeout) {\n clearTimeout(this.keepAliveDebounceTimeout);\n }\n\n this.keepAliveInterval = undefined;\n this.keepAliveDebounceTimeout = undefined;\n }; // ==============================\n // Status Stuff\n // ==============================\n\n /**\n * Checks given status against instance current status. Returns true if they match\n * @param {Number} status\n * @param {Boolean} [force]\n * @returns {Boolean}\n */\n\n\n Transport.prototype.statusAssert = function (status, force) {\n if (status === this.status) {\n return true;\n } else {\n if (force) {\n this.logger.warn(\"Attempted to assert \" + Object.keys(TransportStatus)[this.status] + \" as \" + Object.keys(TransportStatus)[status] + \"- continuing with option: 'force'\");\n return true;\n } else {\n this.logger.warn(\"Tried to assert \" + Object.keys(TransportStatus)[status] + \" but is currently \" + Object.keys(TransportStatus)[this.status]);\n return false;\n }\n }\n };\n /**\n * Transitions the status. Checks for legal transition via assertion beforehand\n * @param {Number} status\n * @param {Boolean} [force]\n * @returns {Boolean}\n */\n\n\n Transport.prototype.statusTransition = function (status, force) {\n if (force === void 0) {\n force = false;\n }\n\n this.logger.log(\"Attempting to transition status from \" + Object.keys(TransportStatus)[this.status] + \" to \" + Object.keys(TransportStatus)[status]);\n\n if (status === TransportStatus.STATUS_CONNECTING && this.statusAssert(TransportStatus.STATUS_CLOSED, force) || status === TransportStatus.STATUS_OPEN && this.statusAssert(TransportStatus.STATUS_CONNECTING, force) || status === TransportStatus.STATUS_CLOSING && this.statusAssert(TransportStatus.STATUS_OPEN, force) || status === TransportStatus.STATUS_CLOSED) {\n this.status = status;\n return true;\n } else {\n this.logger.warn(\"Status transition failed - result: no-op - reason:\" + \" either gave an nonexistent status or attempted illegal transition\");\n return false;\n }\n }; // ==============================\n // Configuration Handling\n // ==============================\n\n /**\n * Configuration load.\n * returns {Configuration}\n */\n\n\n Transport.prototype.loadConfig = function (configuration) {\n var settings = {\n wsServers: [{\n scheme: \"WSS\",\n sipUri: \"\",\n weight: 0,\n wsUri: \"wss://edge.sip.onsip.com\",\n isError: false\n }],\n connectionTimeout: 5,\n maxReconnectionAttempts: 3,\n reconnectionTimeout: 4,\n keepAliveInterval: 0,\n keepAliveDebounce: 10,\n // Logging\n traceSip: false\n };\n var configCheck = this.getConfigurationCheck(); // Check Mandatory parameters\n\n for (var parameter in configCheck.mandatory) {\n if (!configuration.hasOwnProperty(parameter)) {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter);\n } else {\n var value = configuration[parameter];\n var checkedValue = configCheck.mandatory[parameter](value);\n\n if (checkedValue !== undefined) {\n settings[parameter] = checkedValue;\n } else {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter, value);\n }\n }\n } // Check Optional parameters\n\n\n for (var parameter in configCheck.optional) {\n if (configuration.hasOwnProperty(parameter)) {\n var value = configuration[parameter]; // If the parameter value is an empty array, but shouldn't be, apply its default value.\n // If the parameter value is null, empty string, or undefined then apply its default value.\n // If it's a number with NaN value then also apply its default value.\n // NOTE: JS does not allow \"value === NaN\", the following does the work:\n\n if (value instanceof Array && value.length === 0 || value === null || value === \"\" || value === undefined || typeof value === \"number\" && isNaN(value)) {\n continue;\n }\n\n var checkedValue = configCheck.optional[parameter](value);\n\n if (checkedValue !== undefined) {\n settings[parameter] = checkedValue;\n } else {\n throw new Exceptions_1.Exceptions.ConfigurationError(parameter, value);\n }\n }\n }\n\n var skeleton = {}; // Fill the value of the configuration_skeleton\n\n for (var parameter in settings) {\n if (settings.hasOwnProperty(parameter)) {\n skeleton[parameter] = {\n value: settings[parameter]\n };\n }\n }\n\n var returnConfiguration = Object.defineProperties({}, skeleton);\n this.logger.log(\"configuration parameters after validation:\");\n\n for (var parameter in settings) {\n if (settings.hasOwnProperty(parameter)) {\n this.logger.log(\"· \" + parameter + \": \" + JSON.stringify(settings[parameter]));\n }\n }\n\n return returnConfiguration;\n };\n /**\n * Configuration checker.\n * @return {Boolean}\n */\n\n\n Transport.prototype.getConfigurationCheck = function () {\n return {\n mandatory: {},\n optional: {\n // Note: this function used to call 'this.logger.error' but calling 'this' with anything here is invalid\n wsServers: function wsServers(_wsServers) {\n /* Allow defining wsServers parameter as:\n * String: \"host\"\n * Array of Strings: [\"host1\", \"host2\"]\n * Array of Objects: [{wsUri:\"host1\", weight:1}, {wsUri:\"host2\", weight:0}]\n * Array of Objects and Strings: [{wsUri:\"host1\"}, \"host2\"]\n */\n if (typeof _wsServers === \"string\") {\n _wsServers = [{\n wsUri: _wsServers\n }];\n } else if (_wsServers instanceof Array) {\n for (var idx = 0; idx < _wsServers.length; idx++) {\n if (typeof _wsServers[idx] === \"string\") {\n _wsServers[idx] = {\n wsUri: _wsServers[idx]\n };\n }\n }\n } else {\n return;\n }\n\n if (_wsServers.length === 0) {\n return false;\n }\n\n for (var _i = 0, wsServers_1 = _wsServers; _i < wsServers_1.length; _i++) {\n var wsServer = wsServers_1[_i];\n\n if (!wsServer.wsUri) {\n return;\n }\n\n if (wsServer.weight && !Number(wsServer.weight)) {\n return;\n }\n\n var url = core_1.Grammar.parse(wsServer.wsUri, \"absoluteURI\");\n\n if (url === -1) {\n return;\n } else if ([\"wss\", \"ws\", \"udp\"].indexOf(url.scheme) < 0) {\n return;\n } else {\n wsServer.sipUri = \"\";\n\n if (!wsServer.weight) {\n wsServer.weight = 0;\n }\n\n wsServer.isError = false;\n wsServer.scheme = url.scheme.toUpperCase();\n }\n }\n\n return _wsServers;\n },\n keepAliveInterval: function keepAliveInterval(_keepAliveInterval) {\n if (Utils_1.Utils.isDecimal(_keepAliveInterval)) {\n var value = Number(_keepAliveInterval);\n\n if (value > 0) {\n return value;\n }\n }\n },\n keepAliveDebounce: function keepAliveDebounce(_keepAliveDebounce) {\n if (Utils_1.Utils.isDecimal(_keepAliveDebounce)) {\n var value = Number(_keepAliveDebounce);\n\n if (value > 0) {\n return value;\n }\n }\n },\n traceSip: function traceSip(_traceSip) {\n if (typeof _traceSip === \"boolean\") {\n return _traceSip;\n }\n },\n connectionTimeout: function connectionTimeout(_connectionTimeout) {\n if (Utils_1.Utils.isDecimal(_connectionTimeout)) {\n var value = Number(_connectionTimeout);\n\n if (value > 0) {\n return value;\n }\n }\n },\n maxReconnectionAttempts: function maxReconnectionAttempts(_maxReconnectionAttempts) {\n if (Utils_1.Utils.isDecimal(_maxReconnectionAttempts)) {\n var value = Number(_maxReconnectionAttempts);\n\n if (value >= 0) {\n return value;\n }\n }\n },\n reconnectionTimeout: function reconnectionTimeout(_reconnectionTimeout) {\n if (Utils_1.Utils.isDecimal(_reconnectionTimeout)) {\n var value = Number(_reconnectionTimeout);\n\n if (value > 0) {\n return value;\n }\n }\n }\n }\n };\n };\n\n Transport.C = TransportStatus;\n return Transport;\n}(core_1.Transport);\n\nexports.Transport = Transport;","var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.getImageSource=exports.ToolbarAndroid=exports.TabBarItemIOS=exports.TabBarItem=exports.Button=exports.default=void 0;var _createIconSet=_interopRequireDefault(require(\"./lib/create-icon-set\"));var _MaterialIcons=_interopRequireDefault(require(\"./glyphmaps/MaterialIcons.json\"));var iconSet=(0,_createIconSet.default)(_MaterialIcons.default,'Material Icons','MaterialIcons.ttf');var _default=iconSet;exports.default=_default;var Button=iconSet.Button;exports.Button=Button;var TabBarItem=iconSet.TabBarItem;exports.TabBarItem=TabBarItem;var TabBarItemIOS=iconSet.TabBarItemIOS;exports.TabBarItemIOS=TabBarItemIOS;var ToolbarAndroid=iconSet.ToolbarAndroid;exports.ToolbarAndroid=ToolbarAndroid;var getImageSource=iconSet.getImageSource;exports.getImageSource=getImageSource;","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar stringTag = '[object String]';\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n\nfunction isString(value) {\n return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;\n}\n\nmodule.exports = isString;","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\nmodule.exports = freeGlobal;","var arrayMap = require('./_arrayMap'),\n baseClone = require('./_baseClone'),\n baseUnset = require('./_baseUnset'),\n castPath = require('./_castPath'),\n copyObject = require('./_copyObject'),\n customOmitClone = require('./_customOmitClone'),\n flatRest = require('./_flatRest'),\n getAllKeysIn = require('./_getAllKeysIn');\n/** Used to compose bitmasks for cloning. */\n\n\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n\nvar omit = flatRest(function (object, paths) {\n var result = {};\n\n if (object == null) {\n return result;\n }\n\n var isDeep = false;\n paths = arrayMap(paths, function (path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n\n var length = paths.length;\n\n while (length--) {\n baseUnset(result, paths[length]);\n }\n\n return result;\n});\nmodule.exports = omit;","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n\n return result;\n}\n\nmodule.exports = arrayMap;","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n\n\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n} // Add methods to `Stack`.\n\n\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\nmodule.exports = Stack;","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n/** `Object#toString` result references. */\n\n\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n } // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n\n\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n/** Used to resolve the decompiled source of functions. */\n\nvar funcToString = funcProto.toString;\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n\n try {\n return func + '';\n } catch (e) {}\n }\n\n return '';\n}\n\nmodule.exports = toSource;","var defineProperty = require('./_defineProperty');\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n\n\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;","var getNative = require('./_getNative');\n\nvar defineProperty = function () {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}();\n\nmodule.exports = defineProperty;","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.\n isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.\n isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.\n isIndex(key, length)))) {\n result.push(key);\n }\n }\n\n return result;\n}\n\nmodule.exports = arrayLikeKeys;","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n\n return result;\n}\n\nmodule.exports = baseTimes;","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n/* Node.js helper references. */\n\n\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\nmodule.exports = isTypedArray;","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function (arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n\n\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n\n\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\n\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {\n var result = [];\n\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n\n return result;\n};\nmodule.exports = getSymbolsIn;","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\n\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\n\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n\n\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;","var root = require('./_root');\n/** Built-in value references. */\n\n\nvar Uint8Array = root.Uint8Array;\nmodule.exports = Uint8Array;","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n\n\nfunction baseGet(object, path) {\n path = castPath(path, object);\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n\n return index && index == length ? object : undefined;\n}\n\nmodule.exports = baseGet;","var flatten = require('./flatten'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n\n\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n/** Used to compose bitmasks for value comparisons. */\n\n\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n } // Assume cyclic values are equal.\n\n\n var stacked = stack.get(array);\n\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n\n var index = -1,\n result = true,\n seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined;\n stack.set(array, other);\n stack.set(other, array); // Ignore non-index properties.\n\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);\n }\n\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n\n result = false;\n break;\n } // Recursively compare arrays (susceptible to call stack limits).\n\n\n if (seen) {\n if (!arraySome(other, function (othValue, othIndex) {\n if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n result = false;\n break;\n }\n }\n\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport {\n View,\n Text,\n TouchableNativeFeedback,\n TouchableOpacity,\n ActivityIndicator,\n Platform,\n StyleSheet,\n} from 'react-native';\n\nimport { withTheme, ViewPropTypes } from '../config';\nimport { renderNode, nodeType, conditionalStyle, color } from '../helpers';\nimport Icon from '../icons/Icon';\n\nconst defaultLoadingProps = (type, theme) => ({\n color: type === 'solid' ? 'white' : theme.colors.primary,\n size: 'small',\n});\n\nclass Button extends Component {\n componentDidMount() {\n const { linearGradientProps, ViewComponent } = this.props;\n if (linearGradientProps && !global.Expo && !ViewComponent) {\n /* eslint-disable no-console */\n console.error(\n `You need to pass a ViewComponent to use linearGradientProps !\\nExample: ViewComponent={require('react-native-linear-gradient')}`\n );\n }\n }\n\n render() {\n const {\n TouchableComponent,\n containerStyle,\n onPress,\n buttonStyle,\n type,\n loading,\n loadingStyle,\n loadingProps: passedLoadingProps,\n title,\n titleProps,\n titleStyle,\n icon,\n iconContainerStyle,\n iconRight,\n disabled,\n disabledStyle,\n disabledTitleStyle,\n raised,\n linearGradientProps,\n ViewComponent = !disabled && linearGradientProps && global.Expo\n ? global.Expo.LinearGradient\n : View,\n theme,\n ...attributes\n } = this.props;\n\n if (\n Platform.OS === 'android' &&\n (buttonStyle.borderRadius && !attributes.background)\n ) {\n if (Platform.Version >= 21) {\n attributes.background = TouchableNativeFeedback.Ripple(\n 'ThemeAttrAndroid',\n false\n );\n } else {\n attributes.background = TouchableNativeFeedback.SelectableBackground();\n }\n }\n\n const loadingProps = {\n ...defaultLoadingProps(type, theme),\n ...passedLoadingProps,\n };\n\n return (\n \n \n \n {loading && (\n \n )}\n\n {!loading &&\n icon &&\n !iconRight &&\n renderNode(Icon, icon, {\n containerStyle: StyleSheet.flatten([\n styles.iconContainer,\n iconContainerStyle,\n ]),\n })}\n\n {!loading && !!title && (\n \n {title}\n \n )}\n\n {!loading &&\n icon &&\n iconRight &&\n renderNode(Icon, icon, {\n containerStyle: StyleSheet.flatten([\n styles.iconContainer,\n iconContainerStyle,\n ]),\n })}\n \n \n \n );\n }\n}\n\nButton.propTypes = {\n title: PropTypes.string,\n titleStyle: Text.propTypes.style,\n titleProps: PropTypes.object,\n buttonStyle: ViewPropTypes.style,\n type: PropTypes.oneOf(['solid', 'clear', 'outline']),\n loading: PropTypes.bool,\n loadingStyle: ViewPropTypes.style,\n loadingProps: PropTypes.object,\n onPress: PropTypes.func,\n containerStyle: ViewPropTypes.style,\n icon: nodeType,\n iconContainerStyle: ViewPropTypes.style,\n iconRight: PropTypes.bool,\n linearGradientProps: PropTypes.object,\n TouchableComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n ViewComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n disabled: PropTypes.bool,\n disabledStyle: ViewPropTypes.style,\n disabledTitleStyle: Text.propTypes.style,\n raised: PropTypes.bool,\n theme: PropTypes.object,\n};\n\nButton.defaultProps = {\n title: '',\n iconRight: false,\n TouchableComponent: Platform.select({\n android: TouchableNativeFeedback,\n default: TouchableOpacity,\n }),\n onPress: () => console.log('Please attach a method to this component'),\n type: 'solid',\n buttonStyle: {\n borderRadius: 3,\n },\n disabled: false,\n raised: false,\n loading: false,\n};\n\nconst styles = {\n button: (type, theme) => ({\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 3,\n backgroundColor: type === 'solid' ? theme.colors.primary : 'transparent',\n padding: 8,\n borderWidth: type === 'outline' ? StyleSheet.hairlineWidth : 0,\n borderColor: theme.colors.primary,\n }),\n container: {\n borderRadius: 3,\n },\n disabled: (type, theme) => ({\n ...conditionalStyle(type === 'solid', {\n backgroundColor: theme.colors.disabled,\n }),\n ...conditionalStyle(type === 'outline', {\n borderColor: color(theme.colors.disabled).darken(0.3),\n }),\n }),\n disabledTitle: theme => ({\n color: color(theme.colors.disabled).darken(0.3),\n }),\n title: (type, theme) => ({\n color: type === 'solid' ? 'white' : theme.colors.primary,\n fontSize: 16,\n textAlign: 'center',\n paddingTop: 2,\n paddingBottom: 1,\n ...Platform.select({\n android: {\n fontFamily: 'sans-serif-medium',\n },\n default: {\n fontSize: 18,\n },\n }),\n }),\n iconContainer: {\n marginHorizontal: 5,\n },\n raised: type =>\n type !== 'clear' && {\n backgroundColor: '#fff',\n ...Platform.select({\n android: {\n elevation: 4,\n },\n default: {\n shadowColor: 'rgba(0,0,0, .4)',\n shadowOffset: { height: 1, width: 1 },\n shadowOpacity: 1,\n shadowRadius: 1,\n },\n }),\n },\n loading: {\n marginVertical: 2,\n },\n};\n\nexport { Button };\nexport default withTheme(Button, 'Button');\n","export default {\n android: {\n regular: {\n fontFamily: 'sans-serif',\n },\n light: {\n fontFamily: 'sans-serif-light',\n },\n condensed: {\n fontFamily: 'sans-serif-condensed',\n },\n condensed_light: {\n fontFamily: 'sans-serif-condensed',\n fontWeight: 'light',\n },\n black: {\n // note(brentvatne): sans-serif-black is only supported on Android 5+,\n // we can detect that here and use it in that case at some point.\n fontFamily: 'sans-serif',\n fontWeight: 'bold',\n },\n thin: {\n fontFamily: 'sans-serif-thin',\n },\n medium: {\n fontFamily: 'sans-serif-medium',\n },\n bold: {\n fontFamily: 'sans-serif',\n fontWeight: 'bold',\n },\n },\n default: {},\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport deepmerge from 'deepmerge';\n\nimport colors from './colors';\n\nconst ThemeContext = React.createContext();\n\nexport default class ThemeProvider extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n theme: deepmerge(\n {\n colors,\n },\n props.theme\n ),\n };\n }\n\n updateTheme = updates => {\n this.setState(({ theme }) => ({\n theme: deepmerge(theme, updates),\n }));\n };\n\n getTheme = () => this.state.theme;\n\n render() {\n return (\n \n {this.props.children}\n \n );\n }\n}\n\nThemeProvider.propTypes = {\n theme: PropTypes.object,\n children: PropTypes.node.isRequired,\n};\n\nThemeProvider.defaultProps = {\n theme: {},\n};\n\nexport const ThemeConsumer = ThemeContext.Consumer;\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.deepmerge = factory();\n})(this, function () {\n 'use strict';\n\n var isMergeableObject = function isMergeableObject(value) {\n return isNonNullObject(value) && !isSpecial(value);\n };\n\n function isNonNullObject(value) {\n return !!value && typeof value === 'object';\n }\n\n function isSpecial(value) {\n var stringValue = Object.prototype.toString.call(value);\n return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value);\n } // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\n\n\n var canUseSymbol = typeof Symbol === 'function' && Symbol.for;\n var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\n function isReactElement(value) {\n return value.$$typeof === REACT_ELEMENT_TYPE;\n }\n\n function emptyTarget(val) {\n return Array.isArray(val) ? [] : {};\n }\n\n function cloneUnlessOtherwiseSpecified(value, options) {\n return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;\n }\n\n function defaultArrayMerge(target, source, options) {\n return target.concat(source).map(function (element) {\n return cloneUnlessOtherwiseSpecified(element, options);\n });\n }\n\n function getMergeFunction(key, options) {\n if (!options.customMerge) {\n return deepmerge;\n }\n\n var customMerge = options.customMerge(key);\n return typeof customMerge === 'function' ? customMerge : deepmerge;\n }\n\n function mergeObject(target, source, options) {\n var destination = {};\n\n if (options.isMergeableObject(target)) {\n Object.keys(target).forEach(function (key) {\n destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n });\n }\n\n Object.keys(source).forEach(function (key) {\n if (!options.isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n } else {\n destination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n }\n });\n return destination;\n }\n\n function deepmerge(target, source, options) {\n options = options || {};\n options.arrayMerge = options.arrayMerge || defaultArrayMerge;\n options.isMergeableObject = options.isMergeableObject || isMergeableObject;\n var sourceIsArray = Array.isArray(source);\n var targetIsArray = Array.isArray(target);\n var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n if (!sourceAndTargetTypesMatch) {\n return cloneUnlessOtherwiseSpecified(source, options);\n } else if (sourceIsArray) {\n return options.arrayMerge(target, source, options);\n } else {\n return mergeObject(target, source, options);\n }\n }\n\n deepmerge.all = function deepmergeAll(array, options) {\n if (!Array.isArray(array)) {\n throw new Error('first argument should be an array');\n }\n\n return array.reduce(function (prev, next) {\n return deepmerge(prev, next, options);\n }, {});\n };\n\n var deepmerge_1 = deepmerge;\n return deepmerge_1;\n});","'use strict';\n\nmodule.exports = {\n \"aliceblue\": [240, 248, 255],\n \"antiquewhite\": [250, 235, 215],\n \"aqua\": [0, 255, 255],\n \"aquamarine\": [127, 255, 212],\n \"azure\": [240, 255, 255],\n \"beige\": [245, 245, 220],\n \"bisque\": [255, 228, 196],\n \"black\": [0, 0, 0],\n \"blanchedalmond\": [255, 235, 205],\n \"blue\": [0, 0, 255],\n \"blueviolet\": [138, 43, 226],\n \"brown\": [165, 42, 42],\n \"burlywood\": [222, 184, 135],\n \"cadetblue\": [95, 158, 160],\n \"chartreuse\": [127, 255, 0],\n \"chocolate\": [210, 105, 30],\n \"coral\": [255, 127, 80],\n \"cornflowerblue\": [100, 149, 237],\n \"cornsilk\": [255, 248, 220],\n \"crimson\": [220, 20, 60],\n \"cyan\": [0, 255, 255],\n \"darkblue\": [0, 0, 139],\n \"darkcyan\": [0, 139, 139],\n \"darkgoldenrod\": [184, 134, 11],\n \"darkgray\": [169, 169, 169],\n \"darkgreen\": [0, 100, 0],\n \"darkgrey\": [169, 169, 169],\n \"darkkhaki\": [189, 183, 107],\n \"darkmagenta\": [139, 0, 139],\n \"darkolivegreen\": [85, 107, 47],\n \"darkorange\": [255, 140, 0],\n \"darkorchid\": [153, 50, 204],\n \"darkred\": [139, 0, 0],\n \"darksalmon\": [233, 150, 122],\n \"darkseagreen\": [143, 188, 143],\n \"darkslateblue\": [72, 61, 139],\n \"darkslategray\": [47, 79, 79],\n \"darkslategrey\": [47, 79, 79],\n \"darkturquoise\": [0, 206, 209],\n \"darkviolet\": [148, 0, 211],\n \"deeppink\": [255, 20, 147],\n \"deepskyblue\": [0, 191, 255],\n \"dimgray\": [105, 105, 105],\n \"dimgrey\": [105, 105, 105],\n \"dodgerblue\": [30, 144, 255],\n \"firebrick\": [178, 34, 34],\n \"floralwhite\": [255, 250, 240],\n \"forestgreen\": [34, 139, 34],\n \"fuchsia\": [255, 0, 255],\n \"gainsboro\": [220, 220, 220],\n \"ghostwhite\": [248, 248, 255],\n \"gold\": [255, 215, 0],\n \"goldenrod\": [218, 165, 32],\n \"gray\": [128, 128, 128],\n \"green\": [0, 128, 0],\n \"greenyellow\": [173, 255, 47],\n \"grey\": [128, 128, 128],\n \"honeydew\": [240, 255, 240],\n \"hotpink\": [255, 105, 180],\n \"indianred\": [205, 92, 92],\n \"indigo\": [75, 0, 130],\n \"ivory\": [255, 255, 240],\n \"khaki\": [240, 230, 140],\n \"lavender\": [230, 230, 250],\n \"lavenderblush\": [255, 240, 245],\n \"lawngreen\": [124, 252, 0],\n \"lemonchiffon\": [255, 250, 205],\n \"lightblue\": [173, 216, 230],\n \"lightcoral\": [240, 128, 128],\n \"lightcyan\": [224, 255, 255],\n \"lightgoldenrodyellow\": [250, 250, 210],\n \"lightgray\": [211, 211, 211],\n \"lightgreen\": [144, 238, 144],\n \"lightgrey\": [211, 211, 211],\n \"lightpink\": [255, 182, 193],\n \"lightsalmon\": [255, 160, 122],\n \"lightseagreen\": [32, 178, 170],\n \"lightskyblue\": [135, 206, 250],\n \"lightslategray\": [119, 136, 153],\n \"lightslategrey\": [119, 136, 153],\n \"lightsteelblue\": [176, 196, 222],\n \"lightyellow\": [255, 255, 224],\n \"lime\": [0, 255, 0],\n \"limegreen\": [50, 205, 50],\n \"linen\": [250, 240, 230],\n \"magenta\": [255, 0, 255],\n \"maroon\": [128, 0, 0],\n \"mediumaquamarine\": [102, 205, 170],\n \"mediumblue\": [0, 0, 205],\n \"mediumorchid\": [186, 85, 211],\n \"mediumpurple\": [147, 112, 219],\n \"mediumseagreen\": [60, 179, 113],\n \"mediumslateblue\": [123, 104, 238],\n \"mediumspringgreen\": [0, 250, 154],\n \"mediumturquoise\": [72, 209, 204],\n \"mediumvioletred\": [199, 21, 133],\n \"midnightblue\": [25, 25, 112],\n \"mintcream\": [245, 255, 250],\n \"mistyrose\": [255, 228, 225],\n \"moccasin\": [255, 228, 181],\n \"navajowhite\": [255, 222, 173],\n \"navy\": [0, 0, 128],\n \"oldlace\": [253, 245, 230],\n \"olive\": [128, 128, 0],\n \"olivedrab\": [107, 142, 35],\n \"orange\": [255, 165, 0],\n \"orangered\": [255, 69, 0],\n \"orchid\": [218, 112, 214],\n \"palegoldenrod\": [238, 232, 170],\n \"palegreen\": [152, 251, 152],\n \"paleturquoise\": [175, 238, 238],\n \"palevioletred\": [219, 112, 147],\n \"papayawhip\": [255, 239, 213],\n \"peachpuff\": [255, 218, 185],\n \"peru\": [205, 133, 63],\n \"pink\": [255, 192, 203],\n \"plum\": [221, 160, 221],\n \"powderblue\": [176, 224, 230],\n \"purple\": [128, 0, 128],\n \"rebeccapurple\": [102, 51, 153],\n \"red\": [255, 0, 0],\n \"rosybrown\": [188, 143, 143],\n \"royalblue\": [65, 105, 225],\n \"saddlebrown\": [139, 69, 19],\n \"salmon\": [250, 128, 114],\n \"sandybrown\": [244, 164, 96],\n \"seagreen\": [46, 139, 87],\n \"seashell\": [255, 245, 238],\n \"sienna\": [160, 82, 45],\n \"silver\": [192, 192, 192],\n \"skyblue\": [135, 206, 235],\n \"slateblue\": [106, 90, 205],\n \"slategray\": [112, 128, 144],\n \"slategrey\": [112, 128, 144],\n \"snow\": [255, 250, 250],\n \"springgreen\": [0, 255, 127],\n \"steelblue\": [70, 130, 180],\n \"tan\": [210, 180, 140],\n \"teal\": [0, 128, 128],\n \"thistle\": [216, 191, 216],\n \"tomato\": [255, 99, 71],\n \"turquoise\": [64, 224, 208],\n \"violet\": [238, 130, 238],\n \"wheat\": [245, 222, 179],\n \"white\": [255, 255, 255],\n \"whitesmoke\": [245, 245, 245],\n \"yellow\": [255, 255, 0],\n \"yellowgreen\": [154, 205, 50]\n};","/* MIT license */\nvar cssKeywords = require('color-name'); // NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\n\nvar reverseKeywords = {};\n\nfor (var key in cssKeywords) {\n if (cssKeywords.hasOwnProperty(key)) {\n reverseKeywords[cssKeywords[key]] = key;\n }\n}\n\nvar convert = module.exports = {\n rgb: {\n channels: 3,\n labels: 'rgb'\n },\n hsl: {\n channels: 3,\n labels: 'hsl'\n },\n hsv: {\n channels: 3,\n labels: 'hsv'\n },\n hwb: {\n channels: 3,\n labels: 'hwb'\n },\n cmyk: {\n channels: 4,\n labels: 'cmyk'\n },\n xyz: {\n channels: 3,\n labels: 'xyz'\n },\n lab: {\n channels: 3,\n labels: 'lab'\n },\n lch: {\n channels: 3,\n labels: 'lch'\n },\n hex: {\n channels: 1,\n labels: ['hex']\n },\n keyword: {\n channels: 1,\n labels: ['keyword']\n },\n ansi16: {\n channels: 1,\n labels: ['ansi16']\n },\n ansi256: {\n channels: 1,\n labels: ['ansi256']\n },\n hcg: {\n channels: 3,\n labels: ['h', 'c', 'g']\n },\n apple: {\n channels: 3,\n labels: ['r16', 'g16', 'b16']\n },\n gray: {\n channels: 1,\n labels: ['gray']\n }\n}; // hide .channels and .labels properties\n\nfor (var model in convert) {\n if (convert.hasOwnProperty(model)) {\n if (!('channels' in convert[model])) {\n throw new Error('missing channels property: ' + model);\n }\n\n if (!('labels' in convert[model])) {\n throw new Error('missing channel labels property: ' + model);\n }\n\n if (convert[model].labels.length !== convert[model].channels) {\n throw new Error('channel and label counts mismatch: ' + model);\n }\n\n var channels = convert[model].channels;\n var labels = convert[model].labels;\n delete convert[model].channels;\n delete convert[model].labels;\n Object.defineProperty(convert[model], 'channels', {\n value: channels\n });\n Object.defineProperty(convert[model], 'labels', {\n value: labels\n });\n }\n}\n\nconvert.rgb.hsl = function (rgb) {\n var r = rgb[0] / 255;\n var g = rgb[1] / 255;\n var b = rgb[2] / 255;\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var delta = max - min;\n var h;\n var s;\n var l;\n\n if (max === min) {\n h = 0;\n } else if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else if (b === max) {\n h = 4 + (r - g) / delta;\n }\n\n h = Math.min(h * 60, 360);\n\n if (h < 0) {\n h += 360;\n }\n\n l = (min + max) / 2;\n\n if (max === min) {\n s = 0;\n } else if (l <= 0.5) {\n s = delta / (max + min);\n } else {\n s = delta / (2 - max - min);\n }\n\n return [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n var rdif;\n var gdif;\n var bdif;\n var h;\n var s;\n var r = rgb[0] / 255;\n var g = rgb[1] / 255;\n var b = rgb[2] / 255;\n var v = Math.max(r, g, b);\n var diff = v - Math.min(r, g, b);\n\n var diffc = function diffc(c) {\n return (v - c) / 6 / diff + 1 / 2;\n };\n\n if (diff === 0) {\n h = s = 0;\n } else {\n s = diff / v;\n rdif = diffc(r);\n gdif = diffc(g);\n bdif = diffc(b);\n\n if (r === v) {\n h = bdif - gdif;\n } else if (g === v) {\n h = 1 / 3 + rdif - bdif;\n } else if (b === v) {\n h = 2 / 3 + gdif - rdif;\n }\n\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n }\n\n return [h * 360, s * 100, v * 100];\n};\n\nconvert.rgb.hwb = function (rgb) {\n var r = rgb[0];\n var g = rgb[1];\n var b = rgb[2];\n var h = convert.rgb.hsl(rgb)[0];\n var w = 1 / 255 * Math.min(r, Math.min(g, b));\n b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n return [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n var r = rgb[0] / 255;\n var g = rgb[1] / 255;\n var b = rgb[2] / 255;\n var c;\n var m;\n var y;\n var k;\n k = Math.min(1 - r, 1 - g, 1 - b);\n c = (1 - r - k) / (1 - k) || 0;\n m = (1 - g - k) / (1 - k) || 0;\n y = (1 - b - k) / (1 - k) || 0;\n return [c * 100, m * 100, y * 100, k * 100];\n};\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\n\n\nfunction comparativeDistance(x, y) {\n return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);\n}\n\nconvert.rgb.keyword = function (rgb) {\n var reversed = reverseKeywords[rgb];\n\n if (reversed) {\n return reversed;\n }\n\n var currentClosestDistance = Infinity;\n var currentClosestKeyword;\n\n for (var keyword in cssKeywords) {\n if (cssKeywords.hasOwnProperty(keyword)) {\n var value = cssKeywords[keyword]; // Compute comparative distance\n\n var distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest\n\n if (distance < currentClosestDistance) {\n currentClosestDistance = distance;\n currentClosestKeyword = keyword;\n }\n }\n }\n\n return currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n return cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n var r = rgb[0] / 255;\n var g = rgb[1] / 255;\n var b = rgb[2] / 255; // assume sRGB\n\n r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;\n g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;\n b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;\n var x = r * 0.4124 + g * 0.3576 + b * 0.1805;\n var y = r * 0.2126 + g * 0.7152 + b * 0.0722;\n var z = r * 0.0193 + g * 0.1192 + b * 0.9505;\n return [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n var xyz = convert.rgb.xyz(rgb);\n var x = xyz[0];\n var y = xyz[1];\n var z = xyz[2];\n var l;\n var a;\n var b;\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;\n y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;\n z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;\n l = 116 * y - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n return [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n var h = hsl[0] / 360;\n var s = hsl[1] / 100;\n var l = hsl[2] / 100;\n var t1;\n var t2;\n var t3;\n var rgb;\n var val;\n\n if (s === 0) {\n val = l * 255;\n return [val, val, val];\n }\n\n if (l < 0.5) {\n t2 = l * (1 + s);\n } else {\n t2 = l + s - l * s;\n }\n\n t1 = 2 * l - t2;\n rgb = [0, 0, 0];\n\n for (var i = 0; i < 3; i++) {\n t3 = h + 1 / 3 * -(i - 1);\n\n if (t3 < 0) {\n t3++;\n }\n\n if (t3 > 1) {\n t3--;\n }\n\n if (6 * t3 < 1) {\n val = t1 + (t2 - t1) * 6 * t3;\n } else if (2 * t3 < 1) {\n val = t2;\n } else if (3 * t3 < 2) {\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n } else {\n val = t1;\n }\n\n rgb[i] = val * 255;\n }\n\n return rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n var h = hsl[0];\n var s = hsl[1] / 100;\n var l = hsl[2] / 100;\n var smin = s;\n var lmin = Math.max(l, 0.01);\n var sv;\n var v;\n l *= 2;\n s *= l <= 1 ? l : 2 - l;\n smin *= lmin <= 1 ? lmin : 2 - lmin;\n v = (l + s) / 2;\n sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);\n return [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n var h = hsv[0] / 60;\n var s = hsv[1] / 100;\n var v = hsv[2] / 100;\n var hi = Math.floor(h) % 6;\n var f = h - Math.floor(h);\n var p = 255 * v * (1 - s);\n var q = 255 * v * (1 - s * f);\n var t = 255 * v * (1 - s * (1 - f));\n v *= 255;\n\n switch (hi) {\n case 0:\n return [v, t, p];\n\n case 1:\n return [q, v, p];\n\n case 2:\n return [p, v, t];\n\n case 3:\n return [p, q, v];\n\n case 4:\n return [t, p, v];\n\n case 5:\n return [v, p, q];\n }\n};\n\nconvert.hsv.hsl = function (hsv) {\n var h = hsv[0];\n var s = hsv[1] / 100;\n var v = hsv[2] / 100;\n var vmin = Math.max(v, 0.01);\n var lmin;\n var sl;\n var l;\n l = (2 - s) * v;\n lmin = (2 - s) * vmin;\n sl = s * vmin;\n sl /= lmin <= 1 ? lmin : 2 - lmin;\n sl = sl || 0;\n l /= 2;\n return [h, sl * 100, l * 100];\n}; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb\n\n\nconvert.hwb.rgb = function (hwb) {\n var h = hwb[0] / 360;\n var wh = hwb[1] / 100;\n var bl = hwb[2] / 100;\n var ratio = wh + bl;\n var i;\n var v;\n var f;\n var n; // wh + bl cant be > 1\n\n if (ratio > 1) {\n wh /= ratio;\n bl /= ratio;\n }\n\n i = Math.floor(6 * h);\n v = 1 - bl;\n f = 6 * h - i;\n\n if ((i & 0x01) !== 0) {\n f = 1 - f;\n }\n\n n = wh + f * (v - wh); // linear interpolation\n\n var r;\n var g;\n var b;\n\n switch (i) {\n default:\n case 6:\n case 0:\n r = v;\n g = n;\n b = wh;\n break;\n\n case 1:\n r = n;\n g = v;\n b = wh;\n break;\n\n case 2:\n r = wh;\n g = v;\n b = n;\n break;\n\n case 3:\n r = wh;\n g = n;\n b = v;\n break;\n\n case 4:\n r = n;\n g = wh;\n b = v;\n break;\n\n case 5:\n r = v;\n g = wh;\n b = n;\n break;\n }\n\n return [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n var c = cmyk[0] / 100;\n var m = cmyk[1] / 100;\n var y = cmyk[2] / 100;\n var k = cmyk[3] / 100;\n var r;\n var g;\n var b;\n r = 1 - Math.min(1, c * (1 - k) + k);\n g = 1 - Math.min(1, m * (1 - k) + k);\n b = 1 - Math.min(1, y * (1 - k) + k);\n return [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n var x = xyz[0] / 100;\n var y = xyz[1] / 100;\n var z = xyz[2] / 100;\n var r;\n var g;\n var b;\n r = x * 3.2406 + y * -1.5372 + z * -0.4986;\n g = x * -0.9689 + y * 1.8758 + z * 0.0415;\n b = x * 0.0557 + y * -0.2040 + z * 1.0570; // assume sRGB\n\n r = r > 0.0031308 ? 1.055 * Math.pow(r, 1.0 / 2.4) - 0.055 : r * 12.92;\n g = g > 0.0031308 ? 1.055 * Math.pow(g, 1.0 / 2.4) - 0.055 : g * 12.92;\n b = b > 0.0031308 ? 1.055 * Math.pow(b, 1.0 / 2.4) - 0.055 : b * 12.92;\n r = Math.min(Math.max(0, r), 1);\n g = Math.min(Math.max(0, g), 1);\n b = Math.min(Math.max(0, b), 1);\n return [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n var x = xyz[0];\n var y = xyz[1];\n var z = xyz[2];\n var l;\n var a;\n var b;\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;\n y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;\n z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;\n l = 116 * y - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n return [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n var l = lab[0];\n var a = lab[1];\n var b = lab[2];\n var x;\n var y;\n var z;\n y = (l + 16) / 116;\n x = a / 500 + y;\n z = y - b / 200;\n var y2 = Math.pow(y, 3);\n var x2 = Math.pow(x, 3);\n var z2 = Math.pow(z, 3);\n y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n x *= 95.047;\n y *= 100;\n z *= 108.883;\n return [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n var l = lab[0];\n var a = lab[1];\n var b = lab[2];\n var hr;\n var h;\n var c;\n hr = Math.atan2(b, a);\n h = hr * 360 / 2 / Math.PI;\n\n if (h < 0) {\n h += 360;\n }\n\n c = Math.sqrt(a * a + b * b);\n return [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n var l = lch[0];\n var c = lch[1];\n var h = lch[2];\n var a;\n var b;\n var hr;\n hr = h / 360 * 2 * Math.PI;\n a = c * Math.cos(hr);\n b = c * Math.sin(hr);\n return [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n var r = args[0];\n var g = args[1];\n var b = args[2];\n var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n value = Math.round(value / 50);\n\n if (value === 0) {\n return 30;\n }\n\n var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));\n\n if (value === 2) {\n ansi += 60;\n }\n\n return ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n // optimization here; we already know the value and don't need to get\n // it converted for us.\n return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n var r = args[0];\n var g = args[1];\n var b = args[2]; // we use the extended greyscale palette here, with the exception of\n // black and white. normal palette only has 4 greyscale shades.\n\n if (r === g && g === b) {\n if (r < 8) {\n return 16;\n }\n\n if (r > 248) {\n return 231;\n }\n\n return Math.round((r - 8) / 247 * 24) + 232;\n }\n\n var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);\n return ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n var color = args % 10; // handle greyscale\n\n if (color === 0 || color === 7) {\n if (args > 50) {\n color += 3.5;\n }\n\n color = color / 10.5 * 255;\n return [color, color, color];\n }\n\n var mult = (~~(args > 50) + 1) * 0.5;\n var r = (color & 1) * mult * 255;\n var g = (color >> 1 & 1) * mult * 255;\n var b = (color >> 2 & 1) * mult * 255;\n return [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n // handle greyscale\n if (args >= 232) {\n var c = (args - 232) * 10 + 8;\n return [c, c, c];\n }\n\n args -= 16;\n var rem;\n var r = Math.floor(args / 36) / 5 * 255;\n var g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n var b = rem % 6 / 5 * 255;\n return [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);\n var string = integer.toString(16).toUpperCase();\n return '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\n if (!match) {\n return [0, 0, 0];\n }\n\n var colorString = match[0];\n\n if (match[0].length === 3) {\n colorString = colorString.split('').map(function (char) {\n return char + char;\n }).join('');\n }\n\n var integer = parseInt(colorString, 16);\n var r = integer >> 16 & 0xFF;\n var g = integer >> 8 & 0xFF;\n var b = integer & 0xFF;\n return [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n var r = rgb[0] / 255;\n var g = rgb[1] / 255;\n var b = rgb[2] / 255;\n var max = Math.max(Math.max(r, g), b);\n var min = Math.min(Math.min(r, g), b);\n var chroma = max - min;\n var grayscale;\n var hue;\n\n if (chroma < 1) {\n grayscale = min / (1 - chroma);\n } else {\n grayscale = 0;\n }\n\n if (chroma <= 0) {\n hue = 0;\n } else if (max === r) {\n hue = (g - b) / chroma % 6;\n } else if (max === g) {\n hue = 2 + (b - r) / chroma;\n } else {\n hue = 4 + (r - g) / chroma + 4;\n }\n\n hue /= 6;\n hue %= 1;\n return [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n var s = hsl[1] / 100;\n var l = hsl[2] / 100;\n var c = 1;\n var f = 0;\n\n if (l < 0.5) {\n c = 2.0 * s * l;\n } else {\n c = 2.0 * s * (1.0 - l);\n }\n\n if (c < 1.0) {\n f = (l - 0.5 * c) / (1.0 - c);\n }\n\n return [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n var s = hsv[1] / 100;\n var v = hsv[2] / 100;\n var c = s * v;\n var f = 0;\n\n if (c < 1.0) {\n f = (v - c) / (1 - c);\n }\n\n return [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n var h = hcg[0] / 360;\n var c = hcg[1] / 100;\n var g = hcg[2] / 100;\n\n if (c === 0.0) {\n return [g * 255, g * 255, g * 255];\n }\n\n var pure = [0, 0, 0];\n var hi = h % 1 * 6;\n var v = hi % 1;\n var w = 1 - v;\n var mg = 0;\n\n switch (Math.floor(hi)) {\n case 0:\n pure[0] = 1;\n pure[1] = v;\n pure[2] = 0;\n break;\n\n case 1:\n pure[0] = w;\n pure[1] = 1;\n pure[2] = 0;\n break;\n\n case 2:\n pure[0] = 0;\n pure[1] = 1;\n pure[2] = v;\n break;\n\n case 3:\n pure[0] = 0;\n pure[1] = w;\n pure[2] = 1;\n break;\n\n case 4:\n pure[0] = v;\n pure[1] = 0;\n pure[2] = 1;\n break;\n\n default:\n pure[0] = 1;\n pure[1] = 0;\n pure[2] = w;\n }\n\n mg = (1.0 - c) * g;\n return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];\n};\n\nconvert.hcg.hsv = function (hcg) {\n var c = hcg[1] / 100;\n var g = hcg[2] / 100;\n var v = c + g * (1.0 - c);\n var f = 0;\n\n if (v > 0.0) {\n f = c / v;\n }\n\n return [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n var c = hcg[1] / 100;\n var g = hcg[2] / 100;\n var l = g * (1.0 - c) + 0.5 * c;\n var s = 0;\n\n if (l > 0.0 && l < 0.5) {\n s = c / (2 * l);\n } else if (l >= 0.5 && l < 1.0) {\n s = c / (2 * (1 - l));\n }\n\n return [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n var c = hcg[1] / 100;\n var g = hcg[2] / 100;\n var v = c + g * (1.0 - c);\n return [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n var w = hwb[1] / 100;\n var b = hwb[2] / 100;\n var v = 1 - b;\n var c = v - w;\n var g = 0;\n\n if (c < 1) {\n g = (v - c) / (1 - c);\n }\n\n return [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n return [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n return [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n return [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n return [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n var val = Math.round(gray[0] / 100 * 255) & 0xFF;\n var integer = (val << 16) + (val << 8) + val;\n var string = integer.toString(16).toUpperCase();\n return '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n var val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n return [val / 255 * 100];\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n View,\n Text,\n Image as RNImage,\n Platform,\n StyleSheet,\n TouchableOpacity,\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableWithoutFeedback,\n} from 'react-native';\n\nimport { withTheme, ViewPropTypes } from '../config';\nimport { renderNode, nodeType } from '../helpers';\n\nimport Icon from '../icons/Icon';\nimport Image from '../image/Image';\n\nconst avatarSizes = {\n small: 34,\n medium: 50,\n large: 75,\n xlarge: 150,\n};\n\nconst defaultEditButton = {\n name: 'mode-edit',\n type: 'material',\n color: '#fff',\n underlayColor: '#000',\n};\n\nconst Avatar = ({\n onPress,\n onLongPress,\n Component = onPress || onLongPress ? TouchableOpacity : View,\n containerStyle,\n icon,\n iconStyle,\n source,\n size,\n avatarStyle,\n rounded,\n title,\n titleStyle,\n overlayContainerStyle,\n showEditButton,\n editButton: passedEditButton,\n onEditPress,\n imageProps,\n placeholderStyle,\n renderPlaceholderContent,\n ImageComponent,\n ...attributes\n}) => {\n const width =\n typeof size === 'number' ? size : avatarSizes[size] || avatarSizes.small;\n const height = width;\n const titleSize = width / 2;\n const iconSize = width / 2;\n\n const editButton = {\n ...defaultEditButton,\n ...passedEditButton,\n };\n const editButtonSize = editButton.size || (width + height) / 2 / 3;\n\n const Utils = showEditButton && (\n \n \n \n \n \n );\n\n const PlaceholderContent =\n (renderPlaceholderContent &&\n renderNode(undefined, renderPlaceholderContent)) ||\n (title && (\n \n {title}\n \n )) ||\n (icon && (\n \n ));\n\n // Remove placeholder styling if we're not using image\n const hidePlaceholder = !source;\n\n return (\n \n \n {Utils}\n \n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'transparent',\n },\n avatar: {\n flex: 1,\n width: null,\n height: null,\n },\n overlayContainer: {\n flex: 1,\n backgroundColor: '#bdbdbd',\n },\n title: {\n color: '#ffffff',\n backgroundColor: 'transparent',\n textAlign: 'center',\n },\n editButton: {\n position: 'absolute',\n bottom: 0,\n right: 0,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#aaa',\n ...Platform.select({\n android: {\n elevation: 1,\n },\n default: {\n shadowColor: '#000',\n shadowOffset: { width: 1, height: 1 },\n shadowRadius: 2,\n shadowOpacity: 0.5,\n },\n }),\n },\n});\n\nAvatar.propTypes = {\n Component: PropTypes.oneOf([\n View,\n TouchableOpacity,\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableWithoutFeedback,\n ]),\n onPress: PropTypes.func,\n onLongPress: PropTypes.func,\n containerStyle: ViewPropTypes.style,\n source: RNImage.propTypes.source,\n avatarStyle: ViewPropTypes.style,\n rounded: PropTypes.bool,\n title: PropTypes.string,\n titleStyle: Text.propTypes.style,\n overlayContainerStyle: ViewPropTypes.style,\n activeOpacity: PropTypes.number,\n icon: PropTypes.object,\n iconStyle: Text.propTypes.style,\n size: PropTypes.oneOfType([\n PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']),\n PropTypes.number,\n ]),\n showEditButton: PropTypes.bool,\n onEditPress: PropTypes.func,\n editButton: PropTypes.shape({\n size: PropTypes.number,\n name: PropTypes.string,\n type: PropTypes.string,\n color: PropTypes.string,\n underlayColor: PropTypes.string,\n style: ViewPropTypes.style,\n }),\n placeholderStyle: ViewPropTypes.style,\n renderPlaceholderContent: nodeType,\n imageProps: PropTypes.object,\n ImageComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n};\n\nAvatar.defaultProps = {\n showEditButton: false,\n onEditPress: null,\n size: 'small',\n editButton: defaultEditButton,\n ImageComponent: RNImage,\n};\n\nexport { Avatar };\nexport default withTheme(Avatar, 'Avatar');\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Animated,\n Image as RNImage,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport { nodeType } from '../helpers';\nimport { ViewPropTypes, withTheme } from '../config';\n\nclass Image extends React.PureComponent {\n placeholderContainerOpacity = new Animated.Value(1);\n\n onLoadEnd = () => {\n /* Images finish loading in the same frame for some reason,\n the images will fade in separately with staggerNonce */\n const minimumWait = 100;\n const staggerNonce = 200 * Math.random();\n\n setTimeout(\n () =>\n Animated.timing(this.placeholderContainerOpacity, {\n toValue: 0,\n duration: 350,\n useNativeDriver: true,\n }).start(),\n minimumWait + staggerNonce\n );\n };\n\n render() {\n const {\n placeholderStyle,\n PlaceholderContent,\n containerStyle,\n style,\n ImageComponent,\n ...attributes\n } = this.props;\n\n return (\n \n {Platform.select({\n android: (\n \n \n \n {PlaceholderContent}\n \n \n\n \n \n ),\n default: (\n \n \n\n \n \n {PlaceholderContent}\n \n \n \n ),\n })}\n \n );\n }\n}\n\nconst styles = {\n container: {\n backgroundColor: 'transparent',\n position: 'relative',\n },\n placeholderContainer: {\n ...StyleSheet.absoluteFillObject,\n },\n placeholder: {\n backgroundColor: '#bdbdbd',\n alignItems: 'center',\n justifyContent: 'center',\n },\n};\n\nImage.propTypes = {\n ...RNImage.propTypes,\n ImageComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n PlaceholderContent: nodeType,\n containerStyle: ViewPropTypes.style,\n placeholderStyle: RNImage.propTypes.style,\n};\n\nImage.defaultProps = {\n ImageComponent: RNImage,\n};\n\nexport { Image };\nexport default withTheme(Image, 'Image');\n","/* eslint-disable react/default-props-match-prop-types */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n StyleSheet,\n TouchableOpacity,\n View,\n Platform,\n Text as NativeText,\n} from 'react-native';\n\nimport TextElement from '../text/Text';\nimport CheckBoxIcon from './CheckBoxIcon';\nimport { fonts, ViewPropTypes, withTheme } from '../config';\n\nconst CheckBox = props => {\n const { theme, ...rest } = props;\n\n const {\n Component,\n checked,\n iconRight,\n title,\n titleProps,\n center,\n right,\n containerStyle,\n textStyle,\n wrapperStyle,\n onPress,\n onLongPress,\n checkedTitle,\n fontFamily,\n checkedColor = theme.colors.primary,\n ...attributes\n } = rest;\n\n return (\n \n \n {!iconRight && }\n\n {React.isValidElement(title)\n ? title\n : title && (\n \n {checked ? checkedTitle || title : title}\n \n )}\n\n {iconRight && }\n \n \n );\n};\nCheckBox.propTypes = {\n ...CheckBoxIcon.propTypes,\n Component: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n iconRight: PropTypes.bool,\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n titleProps: PropTypes.object,\n center: PropTypes.bool,\n right: PropTypes.bool,\n containerStyle: ViewPropTypes.style,\n wrapperStyle: ViewPropTypes.style,\n textStyle: NativeText.propTypes.style,\n onPress: PropTypes.func,\n onLongPress: PropTypes.func,\n checkedTitle: PropTypes.string,\n fontFamily: PropTypes.string,\n};\n\nCheckBox.defaultProps = {\n checked: false,\n iconRight: false,\n right: false,\n center: false,\n uncheckedColor: '#bfbfbf',\n checkedIcon: 'check-square-o',\n uncheckedIcon: 'square-o',\n size: 24,\n Component: TouchableOpacity,\n titleProps: {},\n};\n\nconst styles = {\n wrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n container: {\n margin: 5,\n marginLeft: 10,\n marginRight: 10,\n padding: 10,\n },\n containerHasTitle: {\n borderWidth: 1,\n borderRadius: 3,\n backgroundColor: '#fafafa',\n borderColor: '#ededed',\n },\n text: theme => ({\n marginLeft: 10,\n marginRight: 10,\n color: theme.colors.grey1,\n ...Platform.select({\n android: {\n ...fonts.android.bold,\n },\n default: {\n fontWeight: 'bold',\n },\n }),\n }),\n};\n\nexport { CheckBox };\nexport default withTheme(CheckBox, 'CheckBox');\n","/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n View,\n Text as NativeText,\n TouchableNativeFeedback,\n TouchableOpacity,\n Platform,\n StyleSheet,\n} from 'react-native';\n\nimport { ViewPropTypes, withTheme } from '../config';\nimport { normalizeText, color } from '../helpers';\n\nimport Text from '../text/Text';\n\nconst ButtonGroup = props => {\n const { theme, ...rest } = props;\n\n const {\n Component,\n buttons,\n onPress,\n selectedIndex,\n selectedIndexes,\n selectMultiple,\n containerStyle,\n innerBorderStyle,\n lastBorderStyle,\n buttonStyle,\n textStyle,\n selectedTextStyle,\n selectedButtonStyle,\n underlayColor = theme.colors.primary,\n activeOpacity,\n onHideUnderlay,\n onShowUnderlay,\n setOpacityTo,\n containerBorderRadius,\n disabled,\n disabledStyle,\n disabledTextStyle,\n disabledSelectedStyle,\n disabledSelectedTextStyle,\n ...attributes\n } = rest;\n\n let innerBorderWidth = 1;\n\n if (\n innerBorderStyle &&\n Object.prototype.hasOwnProperty.call(innerBorderStyle, 'width')\n ) {\n innerBorderWidth = innerBorderStyle.width;\n }\n\n return (\n \n {buttons.map((button, i) => {\n const isSelected = selectedIndex === i || selectedIndexes.includes(i);\n const isDisabled =\n disabled === true ||\n (Array.isArray(disabled) && disabled.includes(i));\n\n return (\n \n {\n if (selectMultiple) {\n if (selectedIndexes.includes(i)) {\n onPress(selectedIndexes.filter(index => index !== i));\n } else {\n onPress([...selectedIndexes, i]);\n }\n } else {\n onPress(i);\n }\n }}\n style={styles.button}\n >\n \n {button.element ? (\n \n ) : (\n \n {button}\n \n )}\n \n \n \n );\n })}\n \n );\n};\n\nconst styles = {\n button: {\n flex: 1,\n },\n textContainer: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n container: {\n marginLeft: 10,\n marginRight: 10,\n marginBottom: 5,\n marginTop: 5,\n borderColor: '#e3e3e3',\n borderWidth: 1,\n flexDirection: 'row',\n borderRadius: 3,\n overflow: 'hidden',\n backgroundColor: '#fff',\n height: 40,\n },\n buttonText: theme => ({\n fontSize: normalizeText(13),\n color: theme.colors.grey2,\n ...Platform.select({\n android: {},\n default: {\n fontWeight: '500',\n },\n }),\n }),\n disabled: {\n backgroundColor: 'transparent',\n },\n disabledText: theme => ({\n color: color(theme.colors.disabled).darken(0.3),\n }),\n disabledSelected: theme => ({\n backgroundColor: theme.colors.disabled,\n }),\n};\n\nButtonGroup.propTypes = {\n button: PropTypes.object,\n Component: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n onPress: PropTypes.func,\n buttons: PropTypes.array,\n containerStyle: ViewPropTypes.style,\n textStyle: NativeText.propTypes.style,\n selectedTextStyle: NativeText.propTypes.style,\n selectedButtonStyle: ViewPropTypes.style,\n underlayColor: PropTypes.string,\n selectedIndex: PropTypes.number,\n selectedIndexes: PropTypes.arrayOf(PropTypes.number),\n activeOpacity: PropTypes.number,\n onHideUnderlay: PropTypes.func,\n onShowUnderlay: PropTypes.func,\n setOpacityTo: PropTypes.func,\n innerBorderStyle: PropTypes.shape({\n color: PropTypes.string,\n width: PropTypes.number,\n }),\n lastBorderStyle: PropTypes.oneOfType([\n ViewPropTypes.style,\n NativeText.propTypes.style,\n ]),\n buttonStyle: ViewPropTypes.style,\n containerBorderRadius: PropTypes.number,\n selectMultiple: PropTypes.bool,\n theme: PropTypes.object,\n disabled: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.arrayOf(PropTypes.number),\n ]),\n disabledStyle: ViewPropTypes.style,\n disabledTextStyle: NativeText.propTypes.style,\n disabledSelectedStyle: ViewPropTypes.style,\n disabledSelectedTextStyle: NativeText.propTypes.style,\n};\n\nButtonGroup.defaultProps = {\n selectedIndexes: [],\n selectMultiple: false,\n containerBorderRadius: 3,\n disabled: false,\n Component: Platform.select({\n android: TouchableNativeFeedback,\n default: TouchableOpacity,\n }),\n onPress: () => null,\n};\n\nexport { ButtonGroup };\nexport default withTheme(ButtonGroup, 'ButtonGroup');\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { View, StyleSheet } from 'react-native';\n\nimport { ViewPropTypes, withTheme } from '../config';\n\nconst Divider = ({ style, theme, ...rest }) => (\n \n);\n\nDivider.propTypes = {\n style: ViewPropTypes.style,\n theme: PropTypes.object,\n};\n\nconst styles = {\n container: theme => ({\n backgroundColor: theme.colors.divider,\n height: StyleSheet.hairlineWidth,\n }),\n};\n\nexport { Divider };\nexport default withTheme(Divider, 'Divider');\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABd1JREFUaAXtWV9sU1UYP127P10HKzIGmJA4x+YWgcCTPCAhog4QHQbopj6MEYgmWpQHo4BK4hxLTGQbw0SmwxclZHtyc92ASZwzGRpxwtAlsG5g4mg7cF3/rO3W7Xp+d5ymXs+9t93aziz7ktN7zz3n+77f75xz7znfV41AhcwDSZoHHEQKC0T+bzO5MCMLMxKnEVhYWnEa2Bmb1UWrGbjSRfy0TDpsZLy3R1TXZq8g2uUrScraDUT/1DbxXsnupP0u8V1uF/VxD1sQ6MNW2sYnSSot0Ygm0p3d910b8Zw7G3Kq5ASAMt888h9CAD1aWxUaACUbIJTx8n6i37pdqVuoTZWI4HUT1+d1BEQg2mXL3frivW9n5K9rJoWFDvpoipaUid97CsYutr3nv/LDHmHMSzSGDLL4gJnon94BNeLrsBDXF3VE8HqIJt2AUe9L3/rcyeQVD/9MsrPv0y5T3t6rWaS//xlfS9P7wWG7EXogsvigmdpbhKq8YEbkZMrjEobN+4S7OzcJNlORMNZhKaF9FT8QtH2Jq762ATooY5daxcLqo2eqPxScziXyiAiBD/9Fy7PUpx96wAAsSgIlWXFWV4pghs1lduHOHUXnUmCuCy0FFMR9RmBo56abbotlmbSfUl2wWjPvmcv+hA1gURJZIhhJGKCj4oFBJYdybbYLFwzUhp2WAaGxMUWun9JzYXDQaDcVjQMLMMmJLBHH/j0iEd+lli1KjtTaXA01j7nqT+er9VNq915qLQYRYJITLhF/d+f0kirffZsqapScJKKNYtA6yneL7wuw8YT74vq7u0R8+udNxzUazZwHXhTDpL7Y9AlAMWzSAeQSYRuUtiDve6nCXNXTcvNb4Zthk+LgEhm/8ZvYL61wg1OqMFd13Zr1f8E3wybFwSUS1mki7H6ub8eVAKgR0SspJ7gtVckfl4guJ1fUCQz0PaSknMi2YG/PSvhLWbOe65ZLJDknT+wsWAc3crXm4GFg4NZmuMVhkidcIrpHp4n4b/S8w1NK9DPsZcGBW6/DL8MmxcAlgngA4r/c/rjgdkd1PpI6iEXd47Evo/HLKthi2KR2uUTEIOnBWvQ2Nx2RKiW83mwxwyfeD2DjCm+7x7PA9V+nD40l2wQ6K9lc5QQ8FGw2g41iwFkLmOSEOyPAhygPI4BAaPRcQzs1INs3nnzczeergQFYgElW5Bji+YT1pjgS4mhcu3pc1kicGgK9V9fBNwqwKAn39Buu4P66IbTEgo67kQXQMSAmDA2l0yXlAQlgUBPV5YIEAFtiIxVHLIJnhL8jxQA8M0FBpwxXHb1Cl5QBvoFBVdSYon06di8TZwbxs+B3zSpQUgJFI8I0h3nfdcwEDbFVY3WGXzWLwpwilXPvUDlBhkSXs3oqq6ImT2M0DrD2WFyFkRHj/Q8OX58Y7F+FTEv22Sb17MkDx6pLiwHE93tpVR0lkUuCg/1J9ldLrTSWX8vaZ3v1W//Is7/2kg0k4CPr1JcRkxB9s6mJ9Bq+zPB993V8G11KkMPY22HZxfaKaJZTOGbVr1Z4Z3YPMn9XvBv6NDvP1B6gbVHH9lRHO1p/qo59Yp0nP4r4nWBY2DXid4QzkMT7TSNx0+whRPfI6s+yNu94Q2MyTfL6Sp8JfX1L7336cVfw9q1CtC2iWUlDsUnaLeL6rIjACxLZo9WVZHLYjjTptdTSki1LXiyXDZExc/T8VkTzyG3YsWkKlmQePqa8a0dAZ9ZE4AP5YWf1CRL46UfUpnRr1xdnnTjdKs3A4Nw0Ulv5VaC3Zxf0Up/YRIyHj0b3UkORJ2yNxeKKnBNyxOKaL93+S6C7s5DaTaIl2dfd+Qp9oSfRhj5y+amZ4ojJjIQP0L9nh5D0F/aKB0+WzY/pLIQ5jjkRZhsfAvyfgg0Ugg1u8cFDob8ZWL9YXeNGBABpeEqcNZUiVuNbx2TD1FiQiSsRAMRSg6j+USP2mvlP3InMHFp0mhGftaIzm/jeC0QSP+bKHufNjPwDPck1Dr1qXKMAAAAASUVORK5CYII=\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAADhJJREFUaAXdWQdYFMce/+/t3h0nIB5NVBQLfMSWoNEYjY0Ea4zGgkaNURNjbzEmamyHJX6mYNTEqImxPRskfhIVMF+M+IwFpBzgoQjSmxQ5FDjubnfnzczdnkDAaILPvPen7O7szOzvN/86uwzCAv8Hwv0vcECAf+hyP1xzGSOrA535J2rEAhxBfbB1kNe7+McQIeDJL8MwtSEiHgliubkSFRrLUKWpEgTezOqFSpmrnSv0de5q6/vMTYsSwHAY/EN+RUBibk2JkFaRxWlrspgEcw6bzlRADKrERE0AVQaAB3EovNM3lLGIRKq5Z0akDgFMpMh4T4i+p2POVSXKQiFHVqovBhC4B95c89gOnH18PxNreN7Bp8bdQT1hA4CfPacS8TCbozwTIiL2XJnVhDKrC4WwokvMl8brbB6vh7ZGVebznEOYt90LEX0dOsTM7DBWn241oCv4OFsXjMChmZ+cUwjPjAjRArEHQqLYpEfH8s8LS6uiOBAFCBCdo0bIu309pdeYs/5Mh5rfcL+9+I/KhcGcp7KHPK/fNkOcIVcJCiU4KhytN6mFwX9NIxYSlodeLNMKC3OPsDeU1dxo0T3WV+mx9vPn5kYSZN/BUgAMPLBkPgoNnChS5v5RfN6FwRQ4y8i4gTIHaKN0ode22EDC79MWUcTGhMUk8mhv9mkzaGeg/nErzStS9y6jaMg/DcgGX9BwVqXZmm0nGg31B/frC4/OzNqOBCSaa+PGiebpimAlYRBNSJP6gxluzEBTk7Yk7cqNeJ6CvADciLQdSozCoi4b8lonFouE0wWxzSB6RuH2nJ8IaMvqWOE/VSKSJgiJdan7zJAyF01O3nIWP1tRC+bD05BA9uHFw7NAa/ucm9v6Qsw76GJxHCUiiIKVBkJPzUeoT2ADNiIetqQd5jfw17nJYvvjx7qvnHwMVlGUmswQjxh98nAezGZ/5+7hq7ymlgPCJsRoSGi1SahbV6ytUEipLhrnq24DnRzb8fgmVyd52ig14QlOUrbZtmeEmiDlfTQx6dMTNmT4ZEj86mUQPbsakuYiSJqHIPq98kHxH0+jfQgZSaxmFZJ7ReUWsyBjUdou7B/kt640uWk9pIDQgZwIE+hmonGJG2hEwtioHwRo1yyC20vQxvSDKF6fxmsr0vng7BAEusVoYMKKKYSDZE40AOBrnD+mQPIsFF50hScUJN+T6DQ9Eatz/1z0uxmSZ6Lx2qAY/DCbCe8oC2+ONVG2/s4BsqwUlBWMOTgnFGvm3eKtt8JoksDttgAQEL861jdlBbprvEfH1NY6Gf9QhWQZ/qaQuofY7dVyHT+66AD3utA2c0bHt0biNj5Qp6EOfqc00xfA2GKIUw9SX8hwUQjkDwv3mlMPETjOLaryal/SMDJ9Jx2zLu3w1F+V+hcX2PUW3BVqtnZOIv2INBkRqXhLr8oT+mXv4foKLtWdHbxHv9Hct5SYR9dQIA4KCoHDqBGQ/lgYUvFKwos81gAChRynbiwRPotNeLHtblfnrCej32j5ikVDtcZIY20qlxoaOpJxOGw3dIu2kRViGRbumsrFqem7WF9cMPip2oz5wvudGy/GzpZH9dKYo4jTagBaOapvcpX2RScrrrXu5dLVrJLJ5WR6PLt4tiyaBZ6p6eHc4XqY5WloQ/ohzXFFrs9u1XC+fTMPDhOrX+pbexIDe4TUt8XGuuJcIc7SBQsOyYvRgptfT6ezYxKWp1j+Sw48Urt2IugWog8ydqNLJQnocmkiWp++H0HaUjREu2atNGZv/rl+r2pXo97xK1CpqYLGkcbwPHJjJdkiBgmx93QIb2oEvBxWxdIDg2fn5DIO/q2/wa8RrnNThXabj3RfsQZwxgZ/izlJwOjRmieGx68ZHcmXbAVU7U3Ni2lWPUzZ8tNzfhu2kn54weyn6z5LOGRO8bni9bHQV92Flcy3znzWi0aJEJhSyPg26xSaX7CTAXVH7JJ4kckGmlRrmCDoK/A1awa1u3y4QR0a2WPDRDrU0sdKut6jrWQwWNmK1B98kExQOSvts2lCtHadkrzl3FFIHfq90wT+vbavc9Ki1pvJdtm4j1jBhhVdFucXH5GtdZ0itlK23BNnyC5qJuPYKsGIett3cihmy+Yd45ObtTeorkb4BU1iYANokIbRMEzjToUzdyAKZHE0I+Eq1YbGsnZo8o2tR4/KMoZu4AbzM9uObBxjrYEN5hGphom+lyLAdZwLEjfzv+l1r9UeR84PFUT0H3d7M3oh7sOcTwvD3UhbIAppsF4i9/4gJADgXDE7do/Nl8YnbTwBurm0NiM1GpHG/ILetP77AxEpY2ZWFYgQuxD5p65HX2afDKQgdF0VwbkhKnL+Y1lM1yHadaa28YtRYNKWF0mblIXJ+eOKNAbj4d5MDIok5cx6XCXbSFgTbG3QDZ3XISIxLzPdRyOTgoSXbqxEB/LOzbaCIi5D3QZP5DIj+bPbz93+GI3VbhxH7pMwa+332AdpzNH7sa5vJmhiQPcu2pnxo8lsLaWk6rkh4PXb6hCRbn5yex+CK+PxSm8yfZS654uvssOGRFbonPF9EhzarUzdF+OVuwoFJKxbTVHjHd1jo5c6WokvT/m+2zDt2gxSzhzO/cViS/gh0qJKmP7s2GDUOlcSAwfvRoHWVAQ3HarxKxgWOoqK+4EOXTK9lG7t9rIJartSQ+i1np9PxKHTEtzq5GgJbQNHUj9F+bOAt6/zUnYExBvywqLZimZnW03nR7r3pQvyZxGqgVlpvG6QrBlvS/MMJehqWbJ5T1aYOPPml6iL9gMEN+ahl+KWa0OQjtZBOEI9dplj7UuJz74ZPL099i/QLkGx+lu2beuTakIC36Bp1dtF0r4FNWXCcO161Dt2+f1pKZ93I6siOWqDK1SvsXY0m5y8dRMkL0QBSesRDiqWavYxnVoCXv/YCBFLN7I6RDNEUqtyTaSEGBb3ySaC0TttES3s6uFt8FIijKdh8IYqBFLmoYU3dwqlpvt0gySFe/qgv/jvkUTInFLkOJr7iwCx+O1H/Iq4HWnhlMTjmJUUmTQFp12HJay5DLcWoq23D5trRDOtnZqCBMH5SPvG92mlmVFdAFMKf5KNcfQGo1rR80zVtYNk6XH+FhslQ4IAjmZxvfaaxyVu7nmm8GJSuSPqB+V3Tf2cunBKhmMEvA95kjfuDarb2vhIImSThF8qw4E8vFNFBnin+cATQ4yeqSnO5knvp+z8qjEyNnI4Mo3RBo1NgbK4Zgzboo+5tQ7kCoUJv5IiY+mLayuQv3tolAgJgURuVeagjRVRsFbtbxjnMeDdXi26DfQtkyUmOpYuWZ22fwvpU1szxB/INUaJBiWs+iTVvvqkJ7J/MMH15e4dVa1OgaM93s3RGosMbTJpnAgpGrG4K1owPqwryhXKVOfvxQ8c5/FK8Vg3/9egpPr6r6qslbU1QwJAlL+GJ6G5Z9yHJ/LdZJtfrnFJndVmaK/F7cbeKTDdkwPZhtu2Ak3GA+8Z6gmBT3xDsl1XhRPs9JwkDi/cxtbk15BNT+RCz4CyXfpLw37MjDx/2iV/yVDtOo9R9i9PX+wz0jgtZXu3z+L2H3bydPEbpHe+HNxtzihsonryGAGQkZb/5KKJpY5GLBnV8rYcfyWC77J/hm+yTsJQ9z7sbqe3hONMRr+R2nWHCIb5LQaUL/cYNux9g3f6PSc06cT9i1dHJKzZlFydfTm/Bfj11Kt/C/adM4iQ+OBKMC00HyAz/9SJSGWBCb8ZxN8rYHByEMzO2w4x1ZlQyRtgTvs32U0qfyFcljttYuLGi+ElMYNGeAxg+6q7FblWyeAylPSIcHiw2p2zd/Q0cZBv0t8l+43BOHJty1tG9h3gZ+fZGngT1rhoKWtIYxNJndqGbGm33DkCG4uPwmD7PnDGexMEuPUCpcxS2K7u9Dbrmu0gzNWfGCgvlkdFl+tMQQ9+V4DIoYMegai3uoug5hzZ1Rn7mVhz4agz2ZfUo9oN0GPH58+WJQy5VHJ9NpTngsLN7vH3LI9LlCQTKemdyDuP4PdhpJRG5AOkJFL9c99chXM9QpF3r/G+ccsQxLyN1qTuE+9U5UtdyVH8OvMkgth5aFv2qQCCY3PW8RHjkzaZIXoCwttmwVj3i0DtsX/5HO+FSRBhoEqogW9LzsPY5gNgltdosMNawAToPRLvjcgMi2/vgZ6qtrCowwT2srozfutXDp0dvMjunQYIAWcdjmEZP8eOZjAjeVpldv/Nd/6FIquSwy+ZCiHMa4kwumV/qg3JlAnRphAZXgI6T7bhLkTVpMMoJz8bCRK5sAbo/StlyXCgPIImSNLgIm/OdKlFgiwG/ppE+3rae3BelXaQby5fcKQ89tfL+LNydMfl4tMiQR6Kn2wBWmF6gONjIXRU0q03XWGyagRctWiE3YU4uyt9YFJry9adaIvcJ0JI0CPWHJE2Slemn6I1CjOmuHaQO0O6zwr0krozXTQyoikzOn0g/mfLIzxvxJwE/JGxOb3Hyiz+WMFXwcHcCAi5fwkOei0FD6VznTwjTSQdCTlsXjDNbSDTXuGCPuowEdScA37/ZfkeLvVr6qONCDUh1gNuVGZhQiIU1JRCoiEHTlUkQZxBC0Etp8LE1q9anv+I4Cmt9gj3PoD/aE8yt5Rgm5qANJ+NiAE7O/BpMCPvO2pigL+cAtcGJql8YF3rdSQpUt95Uicl/aVv6tJDn8aRqBxXPwzkVhWCruIOqFglcDhiyTkluCidoJ2qJcixqRB5UhJPA3Bjc9KXD38GkEY2bCSS2TQ22bNst71FIWSkUGwBhGH/w8HXXrj/APcsxPS9UkzkAAAAAElFTkSuQmCC\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAJvklEQVRoBe1ZfWwU1xGfd3d7+BNjcDCxWmICwVArpRVfaYCCG6AirQlJhClJANVtUyG1UVH/oK36ceGPVgglkUJo+PAnjgHbcYIJKYQvgw0mBJsGAzIEpxgCsUn4sG93z3e3H9N5e7v0bN/Z5zO2qogn3b63s+/Nm9/MvJnZPYbU4BvQbN8ADAaEB0D+3yz5wCIDtwjFGCPOdIs13WNP9/swGzvC0AeHjDrxJSdgnD1djN7cyhCY0+iHGqKm0VTGmE0wJ/TeDREQrn0uu+nJuqajX9LQfweYkAQsZrgdmMN4qLTUgPrp24yJ10EblgTOKatRyPhJMOSQiNig5xGuaa5lavqtZk25vJc5v6qxMbWFCP+mZ5MBh2WAkr5C58byH3vehnZQ7WOelZnYnKR/fQ6ci/agMCmbGa5o8jIYBl0GFwh3JW4F1YO+0wWa0PRbB5LHeOyOehskHUJdUJidOVBtXRgLMFWj6VrcNIBxS3Li5vy5ovN8wSpszC/SVBnil9UAcyaS6IZpgyCYQ26RQWk6+Tk1vfO2Jle9pOM2QKl03ify4d8t6ikFgLzn5z+VSmdfworRKFUsesea4z30+/ZOWqt1XNUDDAOdMQ66kLUGoVkgvLdVX1UO+rYCipWL19FOho9h/RZBLJqQI+eNXkKex7jzccER2+Kl0jlHsRJQrlq+1Xu5crG0Y5YuFWci+mUTwVAB0VRDM2QJVdmTg+Im8MvvZi+xNNxeNG6hlOe4gRWpKOWl7DUAEJAL5ZnOABiMFbc/0YRlj6FYMhPF1wB95yoC2tZDg+AP749F+AamFYwdvXf82t5l6H4L7nTsfGamBcJdmJqLO50o7Zx7W6r44UKLfs8iW6Yasda7P3e+r3gMittA8114P7z0AXjGNQogXGhT8B4a0jX15nk/fvgcujfBLfnd579vCSsWfOuv+H4cypWLa2nnEQHtd8kkxlQLlFg8sVYvf5Lyidc0ce94IgfSQ2jknOmnqZrYqvgvHdD1Q2sQtwO6N8Mp765nJ94DUTj2TdydgvKuWeUWDavnhcxhWA0GXSyZuw5LAdWbjX5D5cEWNwhdLyGZWZt16Y34TfFR9Wu6eE3X7rQKrP1zcNyutds6doP363bwAZyH2Kn/TJyTnc8yXX6+3l00oSQhueMlyZO+OXH5idWchuVL7SyrQuXj7q3hM9NKqqyDneZ65e5TQt5HDERpOYFqUymL9Vy025Rqu3yL+CFIzAl1IKSdwpFzDyb+7C8fMzZNAWjglo6X3plRlRB/6SmPlP5q4ov1Li4BoosKDxdlk9Bt6j2yDTkQJhgx4B413KB3IGZWVpoPobZvAcM4AMk58RAoU2ogZfJRGDOpKTHLRZC+JP5VAMvpR41HKbn0ybwE1jRKltJWJqxsLDF830U5nrl4wRW+tRoZD8AZk8InUflilidmF25lV08Lcacrmq9yMYXK+KvKqb//IBQf/GhFvLt85mx34YR/SAWPXMGyVHRvgzpx65hMPh/Lwc7zRai1wTR0uYx6C68UjhALRrfxfXXV1/spN0UObxHTGijf1JzaYZvP/uhOYeafTuLLIMBywJaWdAfl4Pk6OFbJX+x7RnAIgqp5fVQwVUgSyx3+K6gGaAN0gYPlQMjzEAyCjxu+dJEzgS5frH81Qfsq1T/+RY3ZnXbyRzJN73oID8TchZIxY+gAm2NYoJ6eTyyzQOkoEKfquvYGFUBfgC3uDVXT9icMn3+C5VQYh5xboKKCCvEIQeAWENivQfEcWZsjXC99RY79DsZlLDAsZIrSexfCmbqQyLSa9t7TKBWwhu6crFAZTDfciFwpmNbXuN5MhJ37cmdLxRm6vJnCbutZs1gLdF2ECnHTex4xvbOzdgN6iLn/8JoZXCgePi3huObrSZuRngNrndWjK5BPxP2rMsWi8R1eqsuUax9HlASD8fQBJKAN9cYZBQuoet2xYAcXgAtt9OS5lkDR9BYf+XhumlSYfk3JM0AohoA9E3Cw3D3GvQO5N11Fz4erdQ+V054jv5llgAiySlQgzChmVMJ5afVYFD0ILmbfQMzSQG1rVDXSmLRj3mlLcO5W1ri/vWUNsSBjMy9FlKsnfYbe+mkJS9d9A+EzTebekxsVzOfvCi+s44Lzs9FfAHx+uema8q7s6fImqkJO5/PTqFv7WML1p+8XEPS5dalsnu7jYPasNN70rIjTH0CWNdx5KZuxjKEm34rqXAQDjQwIX2G5GH1A8JKLuQsz3N5TfzQq3HCVbChwlju2nd0QL26EG+rxDQb3gViDM4g84fCPCPQxwT5qvM2eVa3G+i8lKp/VfNBx4fWRLOuoaoXRUMJ3oVGS5Pfxjcem2+yQpqc9wW/prFH2HkCLHAjfxACD4Hh0ngPn7FYTOk9MtJ+pOogXNiUwF4EJ844RLF/D3QAQ8NU8FffQI+BInUjVMm9Rx43Acm6W/rX/1XC+M0V+Ki1Q2j6tAevWjOQc0czSAe7hr+LbsB/3r6CtzZf8/gnRY3bkZ6TL0iAwjWV+nZKlWPx4s7sqK8MAQ4WidRaCoVi0jrrXR7o3gqh8soVzHVC0ssTqn2vdk4q7dMCnGX1l66QyUUB5vHC36aKndPpzzAUqFavIazFL+MBSl+E/QmvDZLqPx2QDNw0Hdj447+iAGF8QGVDporO65aAL392mJo8bo2lqfixrqZSK0gvb6B2FquQAoKVg5zmndasrhm+q3P10RuIoOnHDk3l5P8DDwTlSs0wTRa/7jv6Nf7eS22v/kBzgBiDmj8gS85I7xILUDrkk82U8uDbJemb1ctFj72FZBn2FbA8Uh8Z3jCgkCFrS5/uItXmPXqdgI10G+uDsT2p1G5GHJ8fEXzRU40cL0+Tr547EDbu5Rfp8vctdPGUfw+HXbY4RGjrtcx03d//IO369HhOTZFbRAzdK9EBsDtBjxnLHSPJnfu8RAnohNdnpwDfpZerHB2Sx8Nt1gPEz7GOXPhzrrswF9Sy9+5EHeAC8k9ZizLRfBtyan7U+3v56KDEUIcg6kQ/NLK/855iq0XuKtPPpA8G8PbtfeKXzLcDOmvU8vGm61Kao10/7lSvH/dqdZtOd6EmUBWIoQQf4t4IG3uOv6cPOrbVJNqi12WAP1QqzYlVY4h8xDWKy/4Us7qEwfsMjVZhHwVqJcDwAIJYgGihNH2hCc4kd9E7yHR18D2frzseXMRaXQkGY/Im7jhmuDeHvhyt1AzgAIJyTBYYPVY1k5qfAxuxC4BDfL//vJnSo2wEC4SwJjIEnyE0s7Q+C5kOB4LT7ACQc66GlR5fZh1bGiHZ7ACQiNQ3hpAcWGUJlR7TVfwENK3tP+oju6AAAAABJRU5ErkJggg==\"","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n return fn.apply(thisArg, args);\n };\n};","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n}\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\n\n\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};","'use strict';\n\nvar utils = require('./utils');\n\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter; // Only Node.JS has a process variable that is of [[Class]] process\n\n if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n } else if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n }\n\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {\n return data;\n }\n\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n\n return data;\n }],\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) {\n /* Ignore */\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n maxContentLength: -1,\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\nmodule.exports = defaults;","'use strict';\n\nvar utils = require('./../utils');\n\nvar settle = require('./../core/settle');\n\nvar buildURL = require('./../helpers/buildURL');\n\nvar parseHeaders = require('./../helpers/parseHeaders');\n\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\n\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest(); // HTTP basic authentication\n\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); // Set the request timeout in MS\n\n request.timeout = config.timeout; // Listen for ready state\n\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n } // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n\n\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n } // Prepare the response\n\n\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n settle(resolve, reject, response); // Clean up request\n\n request = null;\n }; // Handle browser request cancellation (as opposed to a manual cancellation)\n\n\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request\n\n request = null;\n }; // Handle low level network errors\n\n\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request)); // Clean up request\n\n request = null;\n }; // Handle timeout\n\n\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', request)); // Clean up request\n\n request = null;\n }; // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies'); // Add xsrf header\n\n\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n } // Add headers to the request\n\n\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n } // Add withCredentials to request if needed\n\n\n if (config.withCredentials) {\n request.withCredentials = true;\n } // Add responseType to request if needed\n\n\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n } // Handle progress if needed\n\n\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n } // Not all browsers support upload events\n\n\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel); // Clean up request\n\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n } // Send the request\n\n\n request.send(requestData);\n });\n};","'use strict';\n\nvar enhanceError = require('./enhanceError');\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\n\n\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};","'use strict';\n\nvar utils = require('../utils');\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\n\n\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n utils.forEach(['baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath'], function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n return config;\n};","'use strict';\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\n\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\nmodule.exports = Cancel;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = findTabbableDescendants;\n/*!\n * Adapted from jQuery UI core\n *\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\n\nvar tabbableNode = /input|select|textarea|button|object/;\n\nfunction hidesContents(element) {\n var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0; // If the node is empty, this is good enough\n\n if (zeroSize && !element.innerHTML) return true; // Otherwise we need to check some styles\n\n var style = window.getComputedStyle(element);\n return zeroSize ? style.getPropertyValue(\"overflow\") !== \"visible\" : style.getPropertyValue(\"display\") == \"none\";\n}\n\nfunction visible(element) {\n var parentElement = element;\n\n while (parentElement) {\n if (parentElement === document.body) break;\n if (hidesContents(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n\n return true;\n}\n\nfunction focusable(element, isTabIndexNotNaN) {\n var nodeName = element.nodeName.toLowerCase();\n var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === \"a\" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\n\nfunction tabbable(element) {\n var tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);\n}\n\nfunction findTabbableDescendants(element) {\n return [].slice.call(element.querySelectorAll(\"*\"), 0).filter(tabbable);\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\nexports.resetForTesting = resetForTesting;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar globalElement = null;\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\n\nfunction setElement(element) {\n var useElement = element;\n\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = \"length\" in el ? el[0] : el;\n }\n\n globalElement = useElement || globalElement;\n return globalElement;\n}\n\nfunction validateElement(appElement) {\n if (!appElement && !globalElement) {\n (0, _warning2.default)(false, [\"react-modal: App element is not defined.\", \"Please use `Modal.setAppElement(el)` or set `appElement={el}`.\", \"This is needed so screen readers don't see main content\", \"when modal is opened. It is not recommended, but you can opt-out\", \"by setting `ariaHideApp={false}`.\"].join(\" \"));\n return false;\n }\n\n return true;\n}\n\nfunction hide(appElement) {\n if (validateElement(appElement)) {\n (appElement || globalElement).setAttribute(\"aria-hidden\", \"true\");\n }\n}\n\nfunction show(appElement) {\n if (validateElement(appElement)) {\n (appElement || globalElement).removeAttribute(\"aria-hidden\");\n }\n}\n\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}\n\nfunction resetForTesting() {\n globalElement = null;\n}","var parser = require('./parser');\n\nvar writer = require('./writer');\n\nexports.write = writer;\nexports.parse = parser.parse;\nexports.parseFmtpConfig = parser.parseFmtpConfig;\nexports.parseParams = parser.parseParams;\nexports.parsePayloads = parser.parsePayloads;\nexports.parseRemoteCandidates = parser.parseRemoteCandidates;\nexports.parseImageAttributes = parser.parseImageAttributes;\nexports.parseSimulcastStreamList = parser.parseSimulcastStreamList;","var grammar = module.exports = {\n v: [{\n name: 'version',\n reg: /^(\\d*)$/\n }],\n o: [{\n // o=- 20518 0 IN IP4 203.0.113.1\n // NB: sessionId will be a String in most cases because it is huge\n name: 'origin',\n reg: /^(\\S*) (\\d*) (\\d*) (\\S*) IP(\\d) (\\S*)/,\n names: ['username', 'sessionId', 'sessionVersion', 'netType', 'ipVer', 'address'],\n format: '%s %s %d %s IP%d %s'\n }],\n // default parsing of these only (though some of these feel outdated)\n s: [{\n name: 'name'\n }],\n i: [{\n name: 'description'\n }],\n u: [{\n name: 'uri'\n }],\n e: [{\n name: 'email'\n }],\n p: [{\n name: 'phone'\n }],\n z: [{\n name: 'timezones'\n }],\n // TODO: this one can actually be parsed properly...\n r: [{\n name: 'repeats'\n }],\n // TODO: this one can also be parsed properly\n // k: [{}], // outdated thing ignored\n t: [{\n // t=0 0\n name: 'timing',\n reg: /^(\\d*) (\\d*)/,\n names: ['start', 'stop'],\n format: '%d %d'\n }],\n c: [{\n // c=IN IP4 10.47.197.26\n name: 'connection',\n reg: /^IN IP(\\d) (\\S*)/,\n names: ['version', 'ip'],\n format: 'IN IP%d %s'\n }],\n b: [{\n // b=AS:4000\n push: 'bandwidth',\n reg: /^(TIAS|AS|CT|RR|RS):(\\d*)/,\n names: ['type', 'limit'],\n format: '%s:%s'\n }],\n m: [{\n // m=video 51744 RTP/AVP 126 97 98 34 31\n // NB: special - pushes to session\n // TODO: rtp/fmtp should be filtered by the payloads found here?\n reg: /^(\\w*) (\\d*) ([\\w/]*)(?: (.*))?/,\n names: ['type', 'port', 'protocol', 'payloads'],\n format: '%s %d %s %s'\n }],\n a: [{\n // a=rtpmap:110 opus/48000/2\n push: 'rtp',\n reg: /^rtpmap:(\\d*) ([\\w\\-.]*)(?:\\s*\\/(\\d*)(?:\\s*\\/(\\S*))?)?/,\n names: ['payload', 'codec', 'rate', 'encoding'],\n format: function format(o) {\n return o.encoding ? 'rtpmap:%d %s/%s/%s' : o.rate ? 'rtpmap:%d %s/%s' : 'rtpmap:%d %s';\n }\n }, {\n // a=fmtp:108 profile-level-id=24;object=23;bitrate=64000\n // a=fmtp:111 minptime=10; useinbandfec=1\n push: 'fmtp',\n reg: /^fmtp:(\\d*) ([\\S| ]*)/,\n names: ['payload', 'config'],\n format: 'fmtp:%d %s'\n }, {\n // a=control:streamid=0\n name: 'control',\n reg: /^control:(.*)/,\n format: 'control:%s'\n }, {\n // a=rtcp:65179 IN IP4 193.84.77.194\n name: 'rtcp',\n reg: /^rtcp:(\\d*)(?: (\\S*) IP(\\d) (\\S*))?/,\n names: ['port', 'netType', 'ipVer', 'address'],\n format: function format(o) {\n return o.address != null ? 'rtcp:%d %s IP%d %s' : 'rtcp:%d';\n }\n }, {\n // a=rtcp-fb:98 trr-int 100\n push: 'rtcpFbTrrInt',\n reg: /^rtcp-fb:(\\*|\\d*) trr-int (\\d*)/,\n names: ['payload', 'value'],\n format: 'rtcp-fb:%d trr-int %d'\n }, {\n // a=rtcp-fb:98 nack rpsi\n push: 'rtcpFb',\n reg: /^rtcp-fb:(\\*|\\d*) ([\\w-_]*)(?: ([\\w-_]*))?/,\n names: ['payload', 'type', 'subtype'],\n format: function format(o) {\n return o.subtype != null ? 'rtcp-fb:%s %s %s' : 'rtcp-fb:%s %s';\n }\n }, {\n // a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\n // a=extmap:1/recvonly URI-gps-string\n // a=extmap:3 urn:ietf:params:rtp-hdrext:encrypt urn:ietf:params:rtp-hdrext:smpte-tc 25@600/24\n push: 'ext',\n reg: /^extmap:(\\d+)(?:\\/(\\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\\S*)(?: (\\S*))?/,\n names: ['value', 'direction', 'encrypt-uri', 'uri', 'config'],\n format: function format(o) {\n return 'extmap:%d' + (o.direction ? '/%s' : '%v') + (o['encrypt-uri'] ? ' %s' : '%v') + ' %s' + (o.config ? ' %s' : '');\n }\n }, {\n // a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PS1uQCVeeCFCanVmcjkpPywjNWhcYD0mXXtxaVBR|2^20|1:32\n push: 'crypto',\n reg: /^crypto:(\\d*) ([\\w_]*) (\\S*)(?: (\\S*))?/,\n names: ['id', 'suite', 'config', 'sessionConfig'],\n format: function format(o) {\n return o.sessionConfig != null ? 'crypto:%d %s %s %s' : 'crypto:%d %s %s';\n }\n }, {\n // a=setup:actpass\n name: 'setup',\n reg: /^setup:(\\w*)/,\n format: 'setup:%s'\n }, {\n // a=mid:1\n name: 'mid',\n reg: /^mid:([^\\s]*)/,\n format: 'mid:%s'\n }, {\n // a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a\n name: 'msid',\n reg: /^msid:(.*)/,\n format: 'msid:%s'\n }, {\n // a=ptime:20\n name: 'ptime',\n reg: /^ptime:(\\d*)/,\n format: 'ptime:%d'\n }, {\n // a=maxptime:60\n name: 'maxptime',\n reg: /^maxptime:(\\d*)/,\n format: 'maxptime:%d'\n }, {\n // a=sendrecv\n name: 'direction',\n reg: /^(sendrecv|recvonly|sendonly|inactive)/\n }, {\n // a=ice-lite\n name: 'icelite',\n reg: /^(ice-lite)/\n }, {\n // a=ice-ufrag:F7gI\n name: 'iceUfrag',\n reg: /^ice-ufrag:(\\S*)/,\n format: 'ice-ufrag:%s'\n }, {\n // a=ice-pwd:x9cml/YzichV2+XlhiMu8g\n name: 'icePwd',\n reg: /^ice-pwd:(\\S*)/,\n format: 'ice-pwd:%s'\n }, {\n // a=fingerprint:SHA-1 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33\n name: 'fingerprint',\n reg: /^fingerprint:(\\S*) (\\S*)/,\n names: ['type', 'hash'],\n format: 'fingerprint:%s %s'\n }, {\n // a=candidate:0 1 UDP 2113667327 203.0.113.1 54400 typ host\n // a=candidate:1162875081 1 udp 2113937151 192.168.34.75 60017 typ host generation 0 network-id 3 network-cost 10\n // a=candidate:3289912957 2 udp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 generation 0 network-id 3 network-cost 10\n // a=candidate:229815620 1 tcp 1518280447 192.168.150.19 60017 typ host tcptype active generation 0 network-id 3 network-cost 10\n // a=candidate:3289912957 2 tcp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 tcptype passive generation 0 network-id 3 network-cost 10\n push: 'candidates',\n reg: /^candidate:(\\S*) (\\d*) (\\S*) (\\d*) (\\S*) (\\d*) typ (\\S*)(?: raddr (\\S*) rport (\\d*))?(?: tcptype (\\S*))?(?: generation (\\d*))?(?: network-id (\\d*))?(?: network-cost (\\d*))?/,\n names: ['foundation', 'component', 'transport', 'priority', 'ip', 'port', 'type', 'raddr', 'rport', 'tcptype', 'generation', 'network-id', 'network-cost'],\n format: function format(o) {\n var str = 'candidate:%s %d %s %d %s %d typ %s';\n str += o.raddr != null ? ' raddr %s rport %d' : '%v%v'; // NB: candidate has three optional chunks, so %void middles one if it's missing\n\n str += o.tcptype != null ? ' tcptype %s' : '%v';\n\n if (o.generation != null) {\n str += ' generation %d';\n }\n\n str += o['network-id'] != null ? ' network-id %d' : '%v';\n str += o['network-cost'] != null ? ' network-cost %d' : '%v';\n return str;\n }\n }, {\n // a=end-of-candidates (keep after the candidates line for readability)\n name: 'endOfCandidates',\n reg: /^(end-of-candidates)/\n }, {\n // a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ...\n name: 'remoteCandidates',\n reg: /^remote-candidates:(.*)/,\n format: 'remote-candidates:%s'\n }, {\n // a=ice-options:google-ice\n name: 'iceOptions',\n reg: /^ice-options:(\\S*)/,\n format: 'ice-options:%s'\n }, {\n // a=ssrc:2566107569 cname:t9YU8M1UxTF8Y1A1\n push: 'ssrcs',\n reg: /^ssrc:(\\d*) ([\\w_-]*)(?::(.*))?/,\n names: ['id', 'attribute', 'value'],\n format: function format(o) {\n var str = 'ssrc:%d';\n\n if (o.attribute != null) {\n str += ' %s';\n\n if (o.value != null) {\n str += ':%s';\n }\n }\n\n return str;\n }\n }, {\n // a=ssrc-group:FEC 1 2\n // a=ssrc-group:FEC-FR 3004364195 1080772241\n push: 'ssrcGroups',\n // token-char = %x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 / %x41-5A / %x5E-7E\n reg: /^ssrc-group:([\\x21\\x23\\x24\\x25\\x26\\x27\\x2A\\x2B\\x2D\\x2E\\w]*) (.*)/,\n names: ['semantics', 'ssrcs'],\n format: 'ssrc-group:%s %s'\n }, {\n // a=msid-semantic: WMS Jvlam5X3SX1OP6pn20zWogvaKJz5Hjf9OnlV\n name: 'msidSemantic',\n reg: /^msid-semantic:\\s?(\\w*) (\\S*)/,\n names: ['semantic', 'token'],\n format: 'msid-semantic: %s %s' // space after ':' is not accidental\n\n }, {\n // a=group:BUNDLE audio video\n push: 'groups',\n reg: /^group:(\\w*) (.*)/,\n names: ['type', 'mids'],\n format: 'group:%s %s'\n }, {\n // a=rtcp-mux\n name: 'rtcpMux',\n reg: /^(rtcp-mux)/\n }, {\n // a=rtcp-rsize\n name: 'rtcpRsize',\n reg: /^(rtcp-rsize)/\n }, {\n // a=sctpmap:5000 webrtc-datachannel 1024\n name: 'sctpmap',\n reg: /^sctpmap:([\\w_/]*) (\\S*)(?: (\\S*))?/,\n names: ['sctpmapNumber', 'app', 'maxMessageSize'],\n format: function format(o) {\n return o.maxMessageSize != null ? 'sctpmap:%s %s %s' : 'sctpmap:%s %s';\n }\n }, {\n // a=x-google-flag:conference\n name: 'xGoogleFlag',\n reg: /^x-google-flag:([^\\s]*)/,\n format: 'x-google-flag:%s'\n }, {\n // a=rid:1 send max-width=1280;max-height=720;max-fps=30;depend=0\n push: 'rids',\n reg: /^rid:([\\d\\w]+) (\\w+)(?: ([\\S| ]*))?/,\n names: ['id', 'direction', 'params'],\n format: function format(o) {\n return o.params ? 'rid:%s %s %s' : 'rid:%s %s';\n }\n }, {\n // a=imageattr:97 send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]\n // a=imageattr:* send [x=800,y=640] recv *\n // a=imageattr:100 recv [x=320,y=240]\n push: 'imageattrs',\n reg: new RegExp( // a=imageattr:97\n '^imageattr:(\\\\d+|\\\\*)' + // send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320]\n '[\\\\s\\\\t]+(send|recv)[\\\\s\\\\t]+(\\\\*|\\\\[\\\\S+\\\\](?:[\\\\s\\\\t]+\\\\[\\\\S+\\\\])*)' + // recv [x=330,y=250]\n '(?:[\\\\s\\\\t]+(recv|send)[\\\\s\\\\t]+(\\\\*|\\\\[\\\\S+\\\\](?:[\\\\s\\\\t]+\\\\[\\\\S+\\\\])*))?'),\n names: ['pt', 'dir1', 'attrs1', 'dir2', 'attrs2'],\n format: function format(o) {\n return 'imageattr:%s %s %s' + (o.dir2 ? ' %s %s' : '');\n }\n }, {\n // a=simulcast:send 1,2,3;~4,~5 recv 6;~7,~8\n // a=simulcast:recv 1;4,5 send 6;7\n name: 'simulcast',\n reg: new RegExp( // a=simulcast:\n '^simulcast:' + // send 1,2,3;~4,~5\n '(send|recv) ([a-zA-Z0-9\\\\-_~;,]+)' + // space + recv 6;~7,~8\n '(?:\\\\s?(send|recv) ([a-zA-Z0-9\\\\-_~;,]+))?' + // end\n '$'),\n names: ['dir1', 'list1', 'dir2', 'list2'],\n format: function format(o) {\n return 'simulcast:%s %s' + (o.dir2 ? ' %s %s' : '');\n }\n }, {\n // old simulcast draft 03 (implemented by Firefox)\n // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-simulcast-03\n // a=simulcast: recv pt=97;98 send pt=97\n // a=simulcast: send rid=5;6;7 paused=6,7\n name: 'simulcast_03',\n reg: /^simulcast:[\\s\\t]+([\\S+\\s\\t]+)$/,\n names: ['value'],\n format: 'simulcast: %s'\n }, {\n // a=framerate:25\n // a=framerate:29.97\n name: 'framerate',\n reg: /^framerate:(\\d+(?:$|\\.\\d+))/,\n format: 'framerate:%s'\n }, {\n // RFC4570\n // a=source-filter: incl IN IP4 239.5.2.31 10.1.15.5\n name: 'sourceFilter',\n reg: /^source-filter: *(excl|incl) (\\S*) (IP4|IP6|\\*) (\\S*) (.*)/,\n names: ['filterMode', 'netType', 'addressTypes', 'destAddress', 'srcList'],\n format: 'source-filter: %s %s %s %s %s'\n }, {\n // a=bundle-only\n name: 'bundleOnly',\n reg: /^(bundle-only)/\n }, {\n // a=label:1\n name: 'label',\n reg: /^label:(.+)/,\n format: 'label:%s'\n }, {\n // RFC version 26 for SCTP over DTLS\n // https://tools.ietf.org/html/draft-ietf-mmusic-sctp-sdp-26#section-5\n name: 'sctpPort',\n reg: /^sctp-port:(\\d+)$/,\n format: 'sctp-port:%s'\n }, {\n // RFC version 26 for SCTP over DTLS\n // https://tools.ietf.org/html/draft-ietf-mmusic-sctp-sdp-26#section-6\n name: 'maxMessageSize',\n reg: /^max-message-size:(\\d+)$/,\n format: 'max-message-size:%s'\n }, {\n // any a= that we don't understand is kept verbatim on media.invalid\n push: 'invalid',\n names: ['value']\n }]\n}; // set sensible defaults to avoid polluting the grammar with boring details\n\nObject.keys(grammar).forEach(function (key) {\n var objs = grammar[key];\n objs.forEach(function (obj) {\n if (!obj.reg) {\n obj.reg = /(.*)/;\n }\n\n if (!obj.format) {\n obj.format = '%s';\n }\n });\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createPrefixer;\n\nvar _prefixProperty = require('./utils/prefixProperty');\n\nvar _prefixProperty2 = _interopRequireDefault(_prefixProperty);\n\nvar _prefixValue = require('./utils/prefixValue');\n\nvar _prefixValue2 = _interopRequireDefault(_prefixValue);\n\nvar _addNewValuesOnly = require('./utils/addNewValuesOnly');\n\nvar _addNewValuesOnly2 = _interopRequireDefault(_addNewValuesOnly);\n\nvar _isObject = require('./utils/isObject');\n\nvar _isObject2 = _interopRequireDefault(_isObject);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction createPrefixer(_ref) {\n var prefixMap = _ref.prefixMap,\n plugins = _ref.plugins;\n return function prefix(style) {\n for (var property in style) {\n var value = style[property]; // handle nested objects\n\n if ((0, _isObject2.default)(value)) {\n style[property] = prefix(value); // handle array values\n } else if (Array.isArray(value)) {\n var combinedValue = [];\n\n for (var i = 0, len = value.length; i < len; ++i) {\n var processedValue = (0, _prefixValue2.default)(plugins, property, value[i], style, prefixMap);\n (0, _addNewValuesOnly2.default)(combinedValue, processedValue || value[i]);\n } // only modify the value if it was touched\n // by any plugin to prevent unnecessary mutations\n\n\n if (combinedValue.length > 0) {\n style[property] = combinedValue;\n }\n } else {\n var _processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap); // only modify the value if it was touched\n // by any plugin to prevent unnecessary mutations\n\n\n if (_processedValue) {\n style[property] = _processedValue;\n }\n\n style = (0, _prefixProperty2.default)(prefixMap, property, style);\n }\n }\n\n return style;\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = backgroundClip; // https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip#Browser_compatibility\n\nfunction backgroundClip(property, value) {\n if (typeof value === 'string' && value === 'text') {\n return ['-webkit-text', 'text'];\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = crossFade;\n\nvar _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n} // http://caniuse.com/#search=cross-fade\n\n\nvar prefixes = ['-webkit-', ''];\n\nfunction crossFade(property, value) {\n if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('cross-fade(') > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/cross-fade\\(/g, prefix + 'cross-fade(');\n });\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cursor;\nvar prefixes = ['-webkit-', '-moz-', ''];\nvar values = {\n 'zoom-in': true,\n 'zoom-out': true,\n grab: true,\n grabbing: true\n};\n\nfunction cursor(property, value) {\n if (property === 'cursor' && values.hasOwnProperty(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = filter;\n\nvar _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n} // http://caniuse.com/#feat=css-filter-function\n\n\nvar prefixes = ['-webkit-', ''];\n\nfunction filter(property, value) {\n if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('filter(') > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/filter\\(/g, prefix + 'filter(');\n });\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = flex;\nvar values = {\n flex: ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex'],\n 'inline-flex': ['-webkit-inline-box', '-moz-inline-box', '-ms-inline-flexbox', '-webkit-inline-flex', 'inline-flex']\n};\n\nfunction flex(property, value) {\n if (property === 'display' && values.hasOwnProperty(value)) {\n return values[value];\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = flexboxIE;\nvar alternativeValues = {\n 'space-around': 'distribute',\n 'space-between': 'justify',\n 'flex-start': 'start',\n 'flex-end': 'end'\n};\nvar alternativeProps = {\n alignContent: 'msFlexLinePack',\n alignSelf: 'msFlexItemAlign',\n alignItems: 'msFlexAlign',\n justifyContent: 'msFlexPack',\n order: 'msFlexOrder',\n flexGrow: 'msFlexPositive',\n flexShrink: 'msFlexNegative',\n flexBasis: 'msFlexPreferredSize' // Full expanded syntax is flex-grow | flex-shrink | flex-basis.\n\n};\nvar flexShorthandMappings = {\n auto: '1 1 auto',\n inherit: 'inherit',\n initial: '0 1 auto',\n none: '0 0 auto',\n unset: 'unset'\n};\nvar isUnitlessNumber = /^\\d+(\\.\\d+)?$/;\n\nfunction flexboxIE(property, value, style) {\n if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {\n style[alternativeProps[property]] = alternativeValues[value] || value;\n }\n\n if (property === 'flex') {\n // For certain values we can do straight mappings based on the spec\n // for the expansions.\n if (Object.prototype.hasOwnProperty.call(flexShorthandMappings, value)) {\n style.msFlex = flexShorthandMappings[value];\n return;\n } // Here we have no direct mapping, so we favor looking for a\n // unitless positive number as that will be the most common use-case.\n\n\n if (isUnitlessNumber.test(value)) {\n style.msFlex = value + ' 1 0%';\n return;\n } // The next thing we can look for is if there are multiple values.\n\n\n var flexValues = value.split(/\\s/); // If we only have a single value that wasn't a positive unitless\n // or a pre-mapped value, then we can assume it is a unit value.\n\n switch (flexValues.length) {\n case 1:\n style.msFlex = '1 1 ' + value;\n return;\n\n case 2:\n // If we have 2 units, then we expect that the first will\n // always be a unitless number and represents flex-grow.\n // The second unit will represent flex-shrink for a unitless\n // value, or flex-basis otherwise.\n if (isUnitlessNumber.test(flexValues[1])) {\n style.msFlex = flexValues[0] + ' ' + flexValues[1] + ' 0%';\n } else {\n style.msFlex = flexValues[0] + ' 1 ' + flexValues[1];\n }\n\n return;\n\n default:\n style.msFlex = value;\n }\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = flexboxOld;\nvar alternativeValues = {\n 'space-around': 'justify',\n 'space-between': 'justify',\n 'flex-start': 'start',\n 'flex-end': 'end',\n 'wrap-reverse': 'multiple',\n wrap: 'multiple'\n};\nvar alternativeProps = {\n alignItems: 'WebkitBoxAlign',\n justifyContent: 'WebkitBoxPack',\n flexWrap: 'WebkitBoxLines',\n flexGrow: 'WebkitBoxFlex'\n};\n\nfunction flexboxOld(property, value, style) {\n if (property === 'flexDirection' && typeof value === 'string') {\n if (value.indexOf('column') > -1) {\n style.WebkitBoxOrient = 'vertical';\n } else {\n style.WebkitBoxOrient = 'horizontal';\n }\n\n if (value.indexOf('reverse') > -1) {\n style.WebkitBoxDirection = 'reverse';\n } else {\n style.WebkitBoxDirection = 'normal';\n }\n }\n\n if (alternativeProps.hasOwnProperty(property)) {\n style[alternativeProps[property]] = alternativeValues[value] || value;\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = gradient;\n\nvar _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar prefixes = ['-webkit-', '-moz-', ''];\nvar values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;\n\nfunction gradient(property, value) {\n if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && values.test(value)) {\n return prefixes.map(function (prefix) {\n return value.replace(values, function (grad) {\n return prefix + grad;\n });\n });\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = imageSet;\n\nvar _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n} // http://caniuse.com/#feat=css-image-set\n\n\nvar prefixes = ['-webkit-', ''];\n\nfunction imageSet(property, value) {\n if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('image-set(') > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/image-set\\(/g, prefix + 'image-set(');\n });\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = position;\n\nfunction position(property, value) {\n if (property === 'position' && value === 'sticky') {\n return ['-webkit-sticky', 'sticky'];\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = sizing;\nvar prefixes = ['-webkit-', '-moz-', ''];\nvar properties = {\n maxHeight: true,\n maxWidth: true,\n width: true,\n height: true,\n columnWidth: true,\n minWidth: true,\n minHeight: true\n};\nvar values = {\n 'min-content': true,\n 'max-content': true,\n 'fill-available': true,\n 'fit-content': true,\n 'contain-floats': true\n};\n\nfunction sizing(property, value) {\n if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = transition;\n\nvar _hyphenateProperty = require('css-in-js-utils/lib/hyphenateProperty');\n\nvar _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);\n\nvar _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nvar _capitalizeString = require('../utils/capitalizeString');\n\nvar _capitalizeString2 = _interopRequireDefault(_capitalizeString);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar properties = {\n transition: true,\n transitionProperty: true,\n WebkitTransition: true,\n WebkitTransitionProperty: true,\n MozTransition: true,\n MozTransitionProperty: true\n};\nvar prefixMapping = {\n Webkit: '-webkit-',\n Moz: '-moz-',\n ms: '-ms-'\n};\n\nfunction prefixValue(value, propertyPrefixMap) {\n if ((0, _isPrefixedValue2.default)(value)) {\n return value;\n } // only split multi values, not cubic beziers\n\n\n var multipleValues = value.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g);\n\n for (var i = 0, len = multipleValues.length; i < len; ++i) {\n var singleValue = multipleValues[i];\n var values = [singleValue];\n\n for (var property in propertyPrefixMap) {\n var dashCaseProperty = (0, _hyphenateProperty2.default)(property);\n\n if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== 'order') {\n var prefixes = propertyPrefixMap[property];\n\n for (var j = 0, pLen = prefixes.length; j < pLen; ++j) {\n // join all prefixes and create a new value\n values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty));\n }\n }\n }\n\n multipleValues[i] = values.join(',');\n }\n\n return multipleValues.join(',');\n}\n\nfunction transition(property, value, style, propertyPrefixMap) {\n // also check for already prefixed transitions\n if (typeof value === 'string' && properties.hasOwnProperty(property)) {\n var outputValue = prefixValue(value, propertyPrefixMap); // if the property is already prefixed\n\n var webkitOutput = outputValue.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g).filter(function (val) {\n return !/-moz-|-ms-/.test(val);\n }).join(',');\n\n if (property.indexOf('Webkit') > -1) {\n return webkitOutput;\n }\n\n var mozOutput = outputValue.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g).filter(function (val) {\n return !/-webkit-|-ms-/.test(val);\n }).join(',');\n\n if (property.indexOf('Moz') > -1) {\n return mozOutput;\n }\n\n style['Webkit' + (0, _capitalizeString2.default)(property)] = webkitOutput;\n style['Moz' + (0, _capitalizeString2.default)(property)] = mozOutput;\n return outputValue;\n }\n}","/**\n * BezierEasing - use bezier curve for transition easing function\n * https://github.com/gre/bezier-easing\n *\n * @copyright 2014-2015 Gaëtan Renaudeau. MIT License.\n * \n */\n'use strict'; // These values are established by empiricism with tests (tradeoff: performance VS precision)\n\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n} // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\n\n\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n} // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\n\n\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n var currentX,\n currentT,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n}\n\nmodule.exports = function bezier(mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n // eslint-disable-line yoda\n throw new Error('bezier x values must be in [0, 1] range');\n } // Precompute samples table\n\n\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample; // Interpolate to provide an initial guess for t\n\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n var initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n if (mX1 === mY1 && mX2 === mY2) {\n return x; // linear\n } // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n\n\n if (x === 0) {\n return 0;\n }\n\n if (x === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nimport Animation from './Animation';\nimport { shouldUseNativeDriver } from '../NativeAnimatedHelper';\n\nvar DecayAnimation =\n/*#__PURE__*/\nfunction (_Animation) {\n _inheritsLoose(DecayAnimation, _Animation);\n\n function DecayAnimation(config) {\n var _this;\n\n _this = _Animation.call(this) || this;\n _this._deceleration = config.deceleration !== undefined ? config.deceleration : 0.998;\n _this._velocity = config.velocity;\n _this._useNativeDriver = shouldUseNativeDriver(config);\n _this.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true;\n _this.__iterations = config.iterations !== undefined ? config.iterations : 1;\n return _this;\n }\n\n var _proto = DecayAnimation.prototype;\n\n _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n return {\n type: 'decay',\n deceleration: this._deceleration,\n velocity: this._velocity,\n iterations: this.__iterations\n };\n };\n\n _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n this.__active = true;\n this._lastValue = fromValue;\n this._fromValue = fromValue;\n this._onUpdate = onUpdate;\n this.__onEnd = onEnd;\n this._startTime = Date.now();\n\n if (this._useNativeDriver) {\n this.__startNativeAnimation(animatedValue);\n } else {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n };\n\n _proto.onUpdate = function onUpdate() {\n var now = Date.now();\n var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));\n\n this._onUpdate(value);\n\n if (Math.abs(this._lastValue - value) < 0.1) {\n this.__debouncedOnEnd({\n finished: true\n });\n\n return;\n }\n\n this._lastValue = value;\n\n if (this.__active) {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n };\n\n _proto.stop = function stop() {\n _Animation.prototype.stop.call(this);\n\n this.__active = false;\n global.cancelAnimationFrame(this._animationFrame);\n\n this.__debouncedOnEnd({\n finished: false\n });\n };\n\n return DecayAnimation;\n}(Animation);\n\nexport default DecayAnimation;","'use strict';\n\nvar isObj = require('is-obj');\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Sources cannot be null or undefined');\n }\n\n return Object(val);\n}\n\nfunction assignKey(to, from, key) {\n var val = from[key];\n\n if (val === undefined || val === null) {\n return;\n }\n\n if (hasOwnProperty.call(to, key)) {\n if (to[key] === undefined || to[key] === null) {\n throw new TypeError('Cannot convert undefined or null to object (' + key + ')');\n }\n }\n\n if (!hasOwnProperty.call(to, key) || !isObj(val)) {\n to[key] = val;\n } else {\n to[key] = assign(Object(to[key]), from[key]);\n }\n}\n\nfunction assign(to, from) {\n if (to === from) {\n return to;\n }\n\n from = Object(from);\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n assignKey(to, from, key);\n }\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(from);\n\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n assignKey(to, from, symbols[i]);\n }\n }\n }\n\n return to;\n}\n\nmodule.exports = function deepAssign(target) {\n target = toObject(target);\n\n for (var s = 1; s < arguments.length; s++) {\n assign(target, arguments[s]);\n }\n\n return target;\n};","/** @license React v16.8.6\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nvar k = require(\"object-assign\"),\n n = \"function\" === typeof Symbol && Symbol.for,\n p = n ? Symbol.for(\"react.element\") : 60103,\n q = n ? Symbol.for(\"react.portal\") : 60106,\n r = n ? Symbol.for(\"react.fragment\") : 60107,\n t = n ? Symbol.for(\"react.strict_mode\") : 60108,\n u = n ? Symbol.for(\"react.profiler\") : 60114,\n v = n ? Symbol.for(\"react.provider\") : 60109,\n w = n ? Symbol.for(\"react.context\") : 60110,\n x = n ? Symbol.for(\"react.concurrent_mode\") : 60111,\n y = n ? Symbol.for(\"react.forward_ref\") : 60112,\n z = n ? Symbol.for(\"react.suspense\") : 60113,\n aa = n ? Symbol.for(\"react.memo\") : 60115,\n ba = n ? Symbol.for(\"react.lazy\") : 60116,\n A = \"function\" === typeof Symbol && Symbol.iterator;\n\nfunction ca(a, b, d, c, e, g, h, f) {\n if (!a) {\n a = void 0;\n if (void 0 === b) a = Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else {\n var l = [d, c, e, g, h, f],\n m = 0;\n a = Error(b.replace(/%s/g, function () {\n return l[m++];\n }));\n a.name = \"Invariant Violation\";\n }\n a.framesToPop = 1;\n throw a;\n }\n}\n\nfunction B(a) {\n for (var b = arguments.length - 1, d = \"https://reactjs.org/docs/error-decoder.html?invariant=\" + a, c = 0; c < b; c++) {\n d += \"&args[]=\" + encodeURIComponent(arguments[c + 1]);\n }\n\n ca(!1, \"Minified React error #\" + a + \"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. \", d);\n}\n\nvar C = {\n isMounted: function isMounted() {\n return !1;\n },\n enqueueForceUpdate: function enqueueForceUpdate() {},\n enqueueReplaceState: function enqueueReplaceState() {},\n enqueueSetState: function enqueueSetState() {}\n},\n D = {};\n\nfunction E(a, b, d) {\n this.props = a;\n this.context = b;\n this.refs = D;\n this.updater = d || C;\n}\n\nE.prototype.isReactComponent = {};\n\nE.prototype.setState = function (a, b) {\n \"object\" !== typeof a && \"function\" !== typeof a && null != a ? B(\"85\") : void 0;\n this.updater.enqueueSetState(this, a, b, \"setState\");\n};\n\nE.prototype.forceUpdate = function (a) {\n this.updater.enqueueForceUpdate(this, a, \"forceUpdate\");\n};\n\nfunction F() {}\n\nF.prototype = E.prototype;\n\nfunction G(a, b, d) {\n this.props = a;\n this.context = b;\n this.refs = D;\n this.updater = d || C;\n}\n\nvar H = G.prototype = new F();\nH.constructor = G;\nk(H, E.prototype);\nH.isPureReactComponent = !0;\nvar I = {\n current: null\n},\n J = {\n current: null\n},\n K = Object.prototype.hasOwnProperty,\n L = {\n key: !0,\n ref: !0,\n __self: !0,\n __source: !0\n};\n\nfunction M(a, b, d) {\n var c = void 0,\n e = {},\n g = null,\n h = null;\n if (null != b) for (c in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (g = \"\" + b.key), b) {\n K.call(b, c) && !L.hasOwnProperty(c) && (e[c] = b[c]);\n }\n var f = arguments.length - 2;\n if (1 === f) e.children = d;else if (1 < f) {\n for (var l = Array(f), m = 0; m < f; m++) {\n l[m] = arguments[m + 2];\n }\n\n e.children = l;\n }\n if (a && a.defaultProps) for (c in f = a.defaultProps, f) {\n void 0 === e[c] && (e[c] = f[c]);\n }\n return {\n $$typeof: p,\n type: a,\n key: g,\n ref: h,\n props: e,\n _owner: J.current\n };\n}\n\nfunction da(a, b) {\n return {\n $$typeof: p,\n type: a.type,\n key: b,\n ref: a.ref,\n props: a.props,\n _owner: a._owner\n };\n}\n\nfunction N(a) {\n return \"object\" === typeof a && null !== a && a.$$typeof === p;\n}\n\nfunction escape(a) {\n var b = {\n \"=\": \"=0\",\n \":\": \"=2\"\n };\n return \"$\" + (\"\" + a).replace(/[=:]/g, function (a) {\n return b[a];\n });\n}\n\nvar O = /\\/+/g,\n P = [];\n\nfunction Q(a, b, d, c) {\n if (P.length) {\n var e = P.pop();\n e.result = a;\n e.keyPrefix = b;\n e.func = d;\n e.context = c;\n e.count = 0;\n return e;\n }\n\n return {\n result: a,\n keyPrefix: b,\n func: d,\n context: c,\n count: 0\n };\n}\n\nfunction R(a) {\n a.result = null;\n a.keyPrefix = null;\n a.func = null;\n a.context = null;\n a.count = 0;\n 10 > P.length && P.push(a);\n}\n\nfunction S(a, b, d, c) {\n var e = typeof a;\n if (\"undefined\" === e || \"boolean\" === e) a = null;\n var g = !1;\n if (null === a) g = !0;else switch (e) {\n case \"string\":\n case \"number\":\n g = !0;\n break;\n\n case \"object\":\n switch (a.$$typeof) {\n case p:\n case q:\n g = !0;\n }\n\n }\n if (g) return d(c, a, \"\" === b ? \".\" + T(a, 0) : b), 1;\n g = 0;\n b = \"\" === b ? \".\" : b + \":\";\n if (Array.isArray(a)) for (var h = 0; h < a.length; h++) {\n e = a[h];\n var f = b + T(e, h);\n g += S(e, f, d, c);\n } else if (null === a || \"object\" !== typeof a ? f = null : (f = A && a[A] || a[\"@@iterator\"], f = \"function\" === typeof f ? f : null), \"function\" === typeof f) for (a = f.call(a), h = 0; !(e = a.next()).done;) {\n e = e.value, f = b + T(e, h++), g += S(e, f, d, c);\n } else \"object\" === e && (d = \"\" + a, B(\"31\", \"[object Object]\" === d ? \"object with keys {\" + Object.keys(a).join(\", \") + \"}\" : d, \"\"));\n return g;\n}\n\nfunction U(a, b, d) {\n return null == a ? 0 : S(a, \"\", b, d);\n}\n\nfunction T(a, b) {\n return \"object\" === typeof a && null !== a && null != a.key ? escape(a.key) : b.toString(36);\n}\n\nfunction ea(a, b) {\n a.func.call(a.context, b, a.count++);\n}\n\nfunction fa(a, b, d) {\n var c = a.result,\n e = a.keyPrefix;\n a = a.func.call(a.context, b, a.count++);\n Array.isArray(a) ? V(a, c, d, function (a) {\n return a;\n }) : null != a && (N(a) && (a = da(a, e + (!a.key || b && b.key === a.key ? \"\" : (\"\" + a.key).replace(O, \"$&/\") + \"/\") + d)), c.push(a));\n}\n\nfunction V(a, b, d, c, e) {\n var g = \"\";\n null != d && (g = (\"\" + d).replace(O, \"$&/\") + \"/\");\n b = Q(b, g, c, e);\n U(a, fa, b);\n R(b);\n}\n\nfunction W() {\n var a = I.current;\n null === a ? B(\"321\") : void 0;\n return a;\n}\n\nvar X = {\n Children: {\n map: function map(a, b, d) {\n if (null == a) return a;\n var c = [];\n V(a, c, null, b, d);\n return c;\n },\n forEach: function forEach(a, b, d) {\n if (null == a) return a;\n b = Q(null, null, b, d);\n U(a, ea, b);\n R(b);\n },\n count: function count(a) {\n return U(a, function () {\n return null;\n }, null);\n },\n toArray: function toArray(a) {\n var b = [];\n V(a, b, null, function (a) {\n return a;\n });\n return b;\n },\n only: function only(a) {\n N(a) ? void 0 : B(\"143\");\n return a;\n }\n },\n createRef: function createRef() {\n return {\n current: null\n };\n },\n Component: E,\n PureComponent: G,\n createContext: function createContext(a, b) {\n void 0 === b && (b = null);\n a = {\n $$typeof: w,\n _calculateChangedBits: b,\n _currentValue: a,\n _currentValue2: a,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n a.Provider = {\n $$typeof: v,\n _context: a\n };\n return a.Consumer = a;\n },\n forwardRef: function forwardRef(a) {\n return {\n $$typeof: y,\n render: a\n };\n },\n lazy: function lazy(a) {\n return {\n $$typeof: ba,\n _ctor: a,\n _status: -1,\n _result: null\n };\n },\n memo: function memo(a, b) {\n return {\n $$typeof: aa,\n type: a,\n compare: void 0 === b ? null : b\n };\n },\n useCallback: function useCallback(a, b) {\n return W().useCallback(a, b);\n },\n useContext: function useContext(a, b) {\n return W().useContext(a, b);\n },\n useEffect: function useEffect(a, b) {\n return W().useEffect(a, b);\n },\n useImperativeHandle: function useImperativeHandle(a, b, d) {\n return W().useImperativeHandle(a, b, d);\n },\n useDebugValue: function useDebugValue() {},\n useLayoutEffect: function useLayoutEffect(a, b) {\n return W().useLayoutEffect(a, b);\n },\n useMemo: function useMemo(a, b) {\n return W().useMemo(a, b);\n },\n useReducer: function useReducer(a, b, d) {\n return W().useReducer(a, b, d);\n },\n useRef: function useRef(a) {\n return W().useRef(a);\n },\n useState: function useState(a) {\n return W().useState(a);\n },\n Fragment: r,\n StrictMode: t,\n Suspense: z,\n createElement: M,\n cloneElement: function cloneElement(a, b, d) {\n null === a || void 0 === a ? B(\"267\", a) : void 0;\n var c = void 0,\n e = k({}, a.props),\n g = a.key,\n h = a.ref,\n f = a._owner;\n\n if (null != b) {\n void 0 !== b.ref && (h = b.ref, f = J.current);\n void 0 !== b.key && (g = \"\" + b.key);\n var l = void 0;\n a.type && a.type.defaultProps && (l = a.type.defaultProps);\n\n for (c in b) {\n K.call(b, c) && !L.hasOwnProperty(c) && (e[c] = void 0 === b[c] && void 0 !== l ? l[c] : b[c]);\n }\n }\n\n c = arguments.length - 2;\n if (1 === c) e.children = d;else if (1 < c) {\n l = Array(c);\n\n for (var m = 0; m < c; m++) {\n l[m] = arguments[m + 2];\n }\n\n e.children = l;\n }\n return {\n $$typeof: p,\n type: a.type,\n key: g,\n ref: h,\n props: e,\n _owner: f\n };\n },\n createFactory: function createFactory(a) {\n var b = M.bind(null, a);\n b.type = a;\n return b;\n },\n isValidElement: N,\n version: \"16.8.6\",\n unstable_ConcurrentMode: x,\n unstable_Profiler: u,\n __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {\n ReactCurrentDispatcher: I,\n ReactCurrentOwner: J,\n assign: k\n }\n},\n Y = {\n default: X\n},\n Z = Y && X || Y;\nmodule.exports = Z.default || Z;","/** @license React v16.8.6\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';\n\nvar aa = require(\"react\"),\n n = require(\"object-assign\"),\n r = require(\"scheduler\");\n\nfunction ba(a, b, c, d, e, f, g, h) {\n if (!a) {\n a = void 0;\n if (void 0 === b) a = Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else {\n var l = [c, d, e, f, g, h],\n k = 0;\n a = Error(b.replace(/%s/g, function () {\n return l[k++];\n }));\n a.name = \"Invariant Violation\";\n }\n a.framesToPop = 1;\n throw a;\n }\n}\n\nfunction x(a) {\n for (var b = arguments.length - 1, c = \"https://reactjs.org/docs/error-decoder.html?invariant=\" + a, d = 0; d < b; d++) {\n c += \"&args[]=\" + encodeURIComponent(arguments[d + 1]);\n }\n\n ba(!1, \"Minified React error #\" + a + \"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. \", c);\n}\n\naa ? void 0 : x(\"227\");\n\nfunction ca(a, b, c, d, e, f, g, h, l) {\n var k = Array.prototype.slice.call(arguments, 3);\n\n try {\n b.apply(c, k);\n } catch (m) {\n this.onError(m);\n }\n}\n\nvar da = !1,\n ea = null,\n fa = !1,\n ha = null,\n ia = {\n onError: function onError(a) {\n da = !0;\n ea = a;\n }\n};\n\nfunction ja(a, b, c, d, e, f, g, h, l) {\n da = !1;\n ea = null;\n ca.apply(ia, arguments);\n}\n\nfunction ka(a, b, c, d, e, f, g, h, l) {\n ja.apply(this, arguments);\n\n if (da) {\n if (da) {\n var k = ea;\n da = !1;\n ea = null;\n } else x(\"198\"), k = void 0;\n\n fa || (fa = !0, ha = k);\n }\n}\n\nvar la = null,\n ma = {};\n\nfunction na() {\n if (la) for (var a in ma) {\n var b = ma[a],\n c = la.indexOf(a);\n -1 < c ? void 0 : x(\"96\", a);\n\n if (!oa[c]) {\n b.extractEvents ? void 0 : x(\"97\", a);\n oa[c] = b;\n c = b.eventTypes;\n\n for (var d in c) {\n var e = void 0;\n var f = c[d],\n g = b,\n h = d;\n pa.hasOwnProperty(h) ? x(\"99\", h) : void 0;\n pa[h] = f;\n var l = f.phasedRegistrationNames;\n\n if (l) {\n for (e in l) {\n l.hasOwnProperty(e) && qa(l[e], g, h);\n }\n\n e = !0;\n } else f.registrationName ? (qa(f.registrationName, g, h), e = !0) : e = !1;\n\n e ? void 0 : x(\"98\", d, a);\n }\n }\n }\n}\n\nfunction qa(a, b, c) {\n ra[a] ? x(\"100\", a) : void 0;\n ra[a] = b;\n sa[a] = b.eventTypes[c].dependencies;\n}\n\nvar oa = [],\n pa = {},\n ra = {},\n sa = {},\n ta = null,\n ua = null,\n va = null;\n\nfunction wa(a, b, c) {\n var d = a.type || \"unknown-event\";\n a.currentTarget = va(c);\n ka(d, b, void 0, a);\n a.currentTarget = null;\n}\n\nfunction xa(a, b) {\n null == b ? x(\"30\") : void 0;\n if (null == a) return b;\n\n if (Array.isArray(a)) {\n if (Array.isArray(b)) return a.push.apply(a, b), a;\n a.push(b);\n return a;\n }\n\n return Array.isArray(b) ? [a].concat(b) : [a, b];\n}\n\nfunction ya(a, b, c) {\n Array.isArray(a) ? a.forEach(b, c) : a && b.call(c, a);\n}\n\nvar za = null;\n\nfunction Aa(a) {\n if (a) {\n var b = a._dispatchListeners,\n c = a._dispatchInstances;\n if (Array.isArray(b)) for (var d = 0; d < b.length && !a.isPropagationStopped(); d++) {\n wa(a, b[d], c[d]);\n } else b && wa(a, b, c);\n a._dispatchListeners = null;\n a._dispatchInstances = null;\n a.isPersistent() || a.constructor.release(a);\n }\n}\n\nvar Ba = {\n injectEventPluginOrder: function injectEventPluginOrder(a) {\n la ? x(\"101\") : void 0;\n la = Array.prototype.slice.call(a);\n na();\n },\n injectEventPluginsByName: function injectEventPluginsByName(a) {\n var b = !1,\n c;\n\n for (c in a) {\n if (a.hasOwnProperty(c)) {\n var d = a[c];\n ma.hasOwnProperty(c) && ma[c] === d || (ma[c] ? x(\"102\", c) : void 0, ma[c] = d, b = !0);\n }\n }\n\n b && na();\n }\n};\n\nfunction Ca(a, b) {\n var c = a.stateNode;\n if (!c) return null;\n var d = ta(c);\n if (!d) return null;\n c = d[b];\n\n a: switch (b) {\n case \"onClick\":\n case \"onClickCapture\":\n case \"onDoubleClick\":\n case \"onDoubleClickCapture\":\n case \"onMouseDown\":\n case \"onMouseDownCapture\":\n case \"onMouseMove\":\n case \"onMouseMoveCapture\":\n case \"onMouseUp\":\n case \"onMouseUpCapture\":\n (d = !d.disabled) || (a = a.type, d = !(\"button\" === a || \"input\" === a || \"select\" === a || \"textarea\" === a));\n a = !d;\n break a;\n\n default:\n a = !1;\n }\n\n if (a) return null;\n c && \"function\" !== typeof c ? x(\"231\", b, typeof c) : void 0;\n return c;\n}\n\nfunction Da(a) {\n null !== a && (za = xa(za, a));\n a = za;\n za = null;\n if (a && (ya(a, Aa), za ? x(\"95\") : void 0, fa)) throw a = ha, fa = !1, ha = null, a;\n}\n\nvar Ea = Math.random().toString(36).slice(2),\n Fa = \"__reactInternalInstance$\" + Ea,\n Ga = \"__reactEventHandlers$\" + Ea;\n\nfunction Ha(a) {\n if (a[Fa]) return a[Fa];\n\n for (; !a[Fa];) {\n if (a.parentNode) a = a.parentNode;else return null;\n }\n\n a = a[Fa];\n return 5 === a.tag || 6 === a.tag ? a : null;\n}\n\nfunction Ia(a) {\n a = a[Fa];\n return !a || 5 !== a.tag && 6 !== a.tag ? null : a;\n}\n\nfunction Ja(a) {\n if (5 === a.tag || 6 === a.tag) return a.stateNode;\n x(\"33\");\n}\n\nfunction Ka(a) {\n return a[Ga] || null;\n}\n\nfunction La(a) {\n do {\n a = a.return;\n } while (a && 5 !== a.tag);\n\n return a ? a : null;\n}\n\nfunction Ma(a, b, c) {\n if (b = Ca(a, c.dispatchConfig.phasedRegistrationNames[b])) c._dispatchListeners = xa(c._dispatchListeners, b), c._dispatchInstances = xa(c._dispatchInstances, a);\n}\n\nfunction Na(a) {\n if (a && a.dispatchConfig.phasedRegistrationNames) {\n for (var b = a._targetInst, c = []; b;) {\n c.push(b), b = La(b);\n }\n\n for (b = c.length; 0 < b--;) {\n Ma(c[b], \"captured\", a);\n }\n\n for (b = 0; b < c.length; b++) {\n Ma(c[b], \"bubbled\", a);\n }\n }\n}\n\nfunction Oa(a, b, c) {\n a && c && c.dispatchConfig.registrationName && (b = Ca(a, c.dispatchConfig.registrationName)) && (c._dispatchListeners = xa(c._dispatchListeners, b), c._dispatchInstances = xa(c._dispatchInstances, a));\n}\n\nfunction Pa(a) {\n a && a.dispatchConfig.registrationName && Oa(a._targetInst, null, a);\n}\n\nfunction Qa(a) {\n ya(a, Na);\n}\n\nvar Ra = !(\"undefined\" === typeof window || !window.document || !window.document.createElement);\n\nfunction Sa(a, b) {\n var c = {};\n c[a.toLowerCase()] = b.toLowerCase();\n c[\"Webkit\" + a] = \"webkit\" + b;\n c[\"Moz\" + a] = \"moz\" + b;\n return c;\n}\n\nvar Ta = {\n animationend: Sa(\"Animation\", \"AnimationEnd\"),\n animationiteration: Sa(\"Animation\", \"AnimationIteration\"),\n animationstart: Sa(\"Animation\", \"AnimationStart\"),\n transitionend: Sa(\"Transition\", \"TransitionEnd\")\n},\n Ua = {},\n Va = {};\nRa && (Va = document.createElement(\"div\").style, \"AnimationEvent\" in window || (delete Ta.animationend.animation, delete Ta.animationiteration.animation, delete Ta.animationstart.animation), \"TransitionEvent\" in window || delete Ta.transitionend.transition);\n\nfunction Wa(a) {\n if (Ua[a]) return Ua[a];\n if (!Ta[a]) return a;\n var b = Ta[a],\n c;\n\n for (c in b) {\n if (b.hasOwnProperty(c) && c in Va) return Ua[a] = b[c];\n }\n\n return a;\n}\n\nvar Xa = Wa(\"animationend\"),\n Ya = Wa(\"animationiteration\"),\n Za = Wa(\"animationstart\"),\n $a = Wa(\"transitionend\"),\n ab = \"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),\n bb = null,\n cb = null,\n db = null;\n\nfunction eb() {\n if (db) return db;\n var a,\n b = cb,\n c = b.length,\n d,\n e = \"value\" in bb ? bb.value : bb.textContent,\n f = e.length;\n\n for (a = 0; a < c && b[a] === e[a]; a++) {\n ;\n }\n\n var g = c - a;\n\n for (d = 1; d <= g && b[c - d] === e[f - d]; d++) {\n ;\n }\n\n return db = e.slice(a, 1 < d ? 1 - d : void 0);\n}\n\nfunction fb() {\n return !0;\n}\n\nfunction gb() {\n return !1;\n}\n\nfunction y(a, b, c, d) {\n this.dispatchConfig = a;\n this._targetInst = b;\n this.nativeEvent = c;\n a = this.constructor.Interface;\n\n for (var e in a) {\n a.hasOwnProperty(e) && ((b = a[e]) ? this[e] = b(c) : \"target\" === e ? this.target = d : this[e] = c[e]);\n }\n\n this.isDefaultPrevented = (null != c.defaultPrevented ? c.defaultPrevented : !1 === c.returnValue) ? fb : gb;\n this.isPropagationStopped = gb;\n return this;\n}\n\nn(y.prototype, {\n preventDefault: function preventDefault() {\n this.defaultPrevented = !0;\n var a = this.nativeEvent;\n a && (a.preventDefault ? a.preventDefault() : \"unknown\" !== typeof a.returnValue && (a.returnValue = !1), this.isDefaultPrevented = fb);\n },\n stopPropagation: function stopPropagation() {\n var a = this.nativeEvent;\n a && (a.stopPropagation ? a.stopPropagation() : \"unknown\" !== typeof a.cancelBubble && (a.cancelBubble = !0), this.isPropagationStopped = fb);\n },\n persist: function persist() {\n this.isPersistent = fb;\n },\n isPersistent: gb,\n destructor: function destructor() {\n var a = this.constructor.Interface,\n b;\n\n for (b in a) {\n this[b] = null;\n }\n\n this.nativeEvent = this._targetInst = this.dispatchConfig = null;\n this.isPropagationStopped = this.isDefaultPrevented = gb;\n this._dispatchInstances = this._dispatchListeners = null;\n }\n});\ny.Interface = {\n type: null,\n target: null,\n currentTarget: function currentTarget() {\n return null;\n },\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function timeStamp(a) {\n return a.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\ny.extend = function (a) {\n function b() {}\n\n function c() {\n return d.apply(this, arguments);\n }\n\n var d = this;\n b.prototype = d.prototype;\n var e = new b();\n n(e, c.prototype);\n c.prototype = e;\n c.prototype.constructor = c;\n c.Interface = n({}, d.Interface, a);\n c.extend = d.extend;\n hb(c);\n return c;\n};\n\nhb(y);\n\nfunction ib(a, b, c, d) {\n if (this.eventPool.length) {\n var e = this.eventPool.pop();\n this.call(e, a, b, c, d);\n return e;\n }\n\n return new this(a, b, c, d);\n}\n\nfunction jb(a) {\n a instanceof this ? void 0 : x(\"279\");\n a.destructor();\n 10 > this.eventPool.length && this.eventPool.push(a);\n}\n\nfunction hb(a) {\n a.eventPool = [];\n a.getPooled = ib;\n a.release = jb;\n}\n\nvar kb = y.extend({\n data: null\n}),\n lb = y.extend({\n data: null\n}),\n mb = [9, 13, 27, 32],\n nb = Ra && \"CompositionEvent\" in window,\n ob = null;\nRa && \"documentMode\" in document && (ob = document.documentMode);\nvar pb = Ra && \"TextEvent\" in window && !ob,\n qb = Ra && (!nb || ob && 8 < ob && 11 >= ob),\n rb = String.fromCharCode(32),\n sb = {\n beforeInput: {\n phasedRegistrationNames: {\n bubbled: \"onBeforeInput\",\n captured: \"onBeforeInputCapture\"\n },\n dependencies: [\"compositionend\", \"keypress\", \"textInput\", \"paste\"]\n },\n compositionEnd: {\n phasedRegistrationNames: {\n bubbled: \"onCompositionEnd\",\n captured: \"onCompositionEndCapture\"\n },\n dependencies: \"blur compositionend keydown keypress keyup mousedown\".split(\" \")\n },\n compositionStart: {\n phasedRegistrationNames: {\n bubbled: \"onCompositionStart\",\n captured: \"onCompositionStartCapture\"\n },\n dependencies: \"blur compositionstart keydown keypress keyup mousedown\".split(\" \")\n },\n compositionUpdate: {\n phasedRegistrationNames: {\n bubbled: \"onCompositionUpdate\",\n captured: \"onCompositionUpdateCapture\"\n },\n dependencies: \"blur compositionupdate keydown keypress keyup mousedown\".split(\" \")\n }\n},\n tb = !1;\n\nfunction ub(a, b) {\n switch (a) {\n case \"keyup\":\n return -1 !== mb.indexOf(b.keyCode);\n\n case \"keydown\":\n return 229 !== b.keyCode;\n\n case \"keypress\":\n case \"mousedown\":\n case \"blur\":\n return !0;\n\n default:\n return !1;\n }\n}\n\nfunction vb(a) {\n a = a.detail;\n return \"object\" === typeof a && \"data\" in a ? a.data : null;\n}\n\nvar wb = !1;\n\nfunction xb(a, b) {\n switch (a) {\n case \"compositionend\":\n return vb(b);\n\n case \"keypress\":\n if (32 !== b.which) return null;\n tb = !0;\n return rb;\n\n case \"textInput\":\n return a = b.data, a === rb && tb ? null : a;\n\n default:\n return null;\n }\n}\n\nfunction yb(a, b) {\n if (wb) return \"compositionend\" === a || !nb && ub(a, b) ? (a = eb(), db = cb = bb = null, wb = !1, a) : null;\n\n switch (a) {\n case \"paste\":\n return null;\n\n case \"keypress\":\n if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) {\n if (b.char && 1 < b.char.length) return b.char;\n if (b.which) return String.fromCharCode(b.which);\n }\n\n return null;\n\n case \"compositionend\":\n return qb && \"ko\" !== b.locale ? null : b.data;\n\n default:\n return null;\n }\n}\n\nvar zb = {\n eventTypes: sb,\n extractEvents: function extractEvents(a, b, c, d) {\n var e = void 0;\n var f = void 0;\n if (nb) b: {\n switch (a) {\n case \"compositionstart\":\n e = sb.compositionStart;\n break b;\n\n case \"compositionend\":\n e = sb.compositionEnd;\n break b;\n\n case \"compositionupdate\":\n e = sb.compositionUpdate;\n break b;\n }\n\n e = void 0;\n } else wb ? ub(a, c) && (e = sb.compositionEnd) : \"keydown\" === a && 229 === c.keyCode && (e = sb.compositionStart);\n e ? (qb && \"ko\" !== c.locale && (wb || e !== sb.compositionStart ? e === sb.compositionEnd && wb && (f = eb()) : (bb = d, cb = \"value\" in bb ? bb.value : bb.textContent, wb = !0)), e = kb.getPooled(e, b, c, d), f ? e.data = f : (f = vb(c), null !== f && (e.data = f)), Qa(e), f = e) : f = null;\n (a = pb ? xb(a, c) : yb(a, c)) ? (b = lb.getPooled(sb.beforeInput, b, c, d), b.data = a, Qa(b)) : b = null;\n return null === f ? b : null === b ? f : [f, b];\n }\n},\n Ab = null,\n Bb = null,\n Cb = null;\n\nfunction Db(a) {\n if (a = ua(a)) {\n \"function\" !== typeof Ab ? x(\"280\") : void 0;\n var b = ta(a.stateNode);\n Ab(a.stateNode, a.type, b);\n }\n}\n\nfunction Eb(a) {\n Bb ? Cb ? Cb.push(a) : Cb = [a] : Bb = a;\n}\n\nfunction Fb() {\n if (Bb) {\n var a = Bb,\n b = Cb;\n Cb = Bb = null;\n Db(a);\n if (b) for (a = 0; a < b.length; a++) {\n Db(b[a]);\n }\n }\n}\n\nfunction Gb(a, b) {\n return a(b);\n}\n\nfunction Hb(a, b, c) {\n return a(b, c);\n}\n\nfunction Ib() {}\n\nvar Jb = !1;\n\nfunction Kb(a, b) {\n if (Jb) return a(b);\n Jb = !0;\n\n try {\n return Gb(a, b);\n } finally {\n if (Jb = !1, null !== Bb || null !== Cb) Ib(), Fb();\n }\n}\n\nvar Lb = {\n color: !0,\n date: !0,\n datetime: !0,\n \"datetime-local\": !0,\n email: !0,\n month: !0,\n number: !0,\n password: !0,\n range: !0,\n search: !0,\n tel: !0,\n text: !0,\n time: !0,\n url: !0,\n week: !0\n};\n\nfunction Mb(a) {\n var b = a && a.nodeName && a.nodeName.toLowerCase();\n return \"input\" === b ? !!Lb[a.type] : \"textarea\" === b ? !0 : !1;\n}\n\nfunction Nb(a) {\n a = a.target || a.srcElement || window;\n a.correspondingUseElement && (a = a.correspondingUseElement);\n return 3 === a.nodeType ? a.parentNode : a;\n}\n\nfunction Ob(a) {\n if (!Ra) return !1;\n a = \"on\" + a;\n var b = a in document;\n b || (b = document.createElement(\"div\"), b.setAttribute(a, \"return;\"), b = \"function\" === typeof b[a]);\n return b;\n}\n\nfunction Pb(a) {\n var b = a.type;\n return (a = a.nodeName) && \"input\" === a.toLowerCase() && (\"checkbox\" === b || \"radio\" === b);\n}\n\nfunction Qb(a) {\n var b = Pb(a) ? \"checked\" : \"value\",\n c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b),\n d = \"\" + a[b];\n\n if (!a.hasOwnProperty(b) && \"undefined\" !== typeof c && \"function\" === typeof c.get && \"function\" === typeof c.set) {\n var e = c.get,\n f = c.set;\n Object.defineProperty(a, b, {\n configurable: !0,\n get: function get() {\n return e.call(this);\n },\n set: function set(a) {\n d = \"\" + a;\n f.call(this, a);\n }\n });\n Object.defineProperty(a, b, {\n enumerable: c.enumerable\n });\n return {\n getValue: function getValue() {\n return d;\n },\n setValue: function setValue(a) {\n d = \"\" + a;\n },\n stopTracking: function stopTracking() {\n a._valueTracker = null;\n delete a[b];\n }\n };\n }\n}\n\nfunction Rb(a) {\n a._valueTracker || (a._valueTracker = Qb(a));\n}\n\nfunction Sb(a) {\n if (!a) return !1;\n var b = a._valueTracker;\n if (!b) return !0;\n var c = b.getValue();\n var d = \"\";\n a && (d = Pb(a) ? a.checked ? \"true\" : \"false\" : a.value);\n a = d;\n return a !== c ? (b.setValue(a), !0) : !1;\n}\n\nvar Tb = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\nTb.hasOwnProperty(\"ReactCurrentDispatcher\") || (Tb.ReactCurrentDispatcher = {\n current: null\n});\nvar Ub = /^(.*)[\\\\\\/]/,\n z = \"function\" === typeof Symbol && Symbol.for,\n Vb = z ? Symbol.for(\"react.element\") : 60103,\n Wb = z ? Symbol.for(\"react.portal\") : 60106,\n Xb = z ? Symbol.for(\"react.fragment\") : 60107,\n Yb = z ? Symbol.for(\"react.strict_mode\") : 60108,\n Zb = z ? Symbol.for(\"react.profiler\") : 60114,\n $b = z ? Symbol.for(\"react.provider\") : 60109,\n ac = z ? Symbol.for(\"react.context\") : 60110,\n bc = z ? Symbol.for(\"react.concurrent_mode\") : 60111,\n cc = z ? Symbol.for(\"react.forward_ref\") : 60112,\n dc = z ? Symbol.for(\"react.suspense\") : 60113,\n ec = z ? Symbol.for(\"react.memo\") : 60115,\n fc = z ? Symbol.for(\"react.lazy\") : 60116,\n gc = \"function\" === typeof Symbol && Symbol.iterator;\n\nfunction hc(a) {\n if (null === a || \"object\" !== typeof a) return null;\n a = gc && a[gc] || a[\"@@iterator\"];\n return \"function\" === typeof a ? a : null;\n}\n\nfunction ic(a) {\n if (null == a) return null;\n if (\"function\" === typeof a) return a.displayName || a.name || null;\n if (\"string\" === typeof a) return a;\n\n switch (a) {\n case bc:\n return \"ConcurrentMode\";\n\n case Xb:\n return \"Fragment\";\n\n case Wb:\n return \"Portal\";\n\n case Zb:\n return \"Profiler\";\n\n case Yb:\n return \"StrictMode\";\n\n case dc:\n return \"Suspense\";\n }\n\n if (\"object\" === typeof a) switch (a.$$typeof) {\n case ac:\n return \"Context.Consumer\";\n\n case $b:\n return \"Context.Provider\";\n\n case cc:\n var b = a.render;\n b = b.displayName || b.name || \"\";\n return a.displayName || (\"\" !== b ? \"ForwardRef(\" + b + \")\" : \"ForwardRef\");\n\n case ec:\n return ic(a.type);\n\n case fc:\n if (a = 1 === a._status ? a._result : null) return ic(a);\n }\n return null;\n}\n\nfunction jc(a) {\n var b = \"\";\n\n do {\n a: switch (a.tag) {\n case 3:\n case 4:\n case 6:\n case 7:\n case 10:\n case 9:\n var c = \"\";\n break a;\n\n default:\n var d = a._debugOwner,\n e = a._debugSource,\n f = ic(a.type);\n c = null;\n d && (c = ic(d.type));\n d = f;\n f = \"\";\n e ? f = \" (at \" + e.fileName.replace(Ub, \"\") + \":\" + e.lineNumber + \")\" : c && (f = \" (created by \" + c + \")\");\n c = \"\\n in \" + (d || \"Unknown\") + f;\n }\n\n b += c;\n a = a.return;\n } while (a);\n\n return b;\n}\n\nvar kc = /^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,\n lc = Object.prototype.hasOwnProperty,\n mc = {},\n nc = {};\n\nfunction oc(a) {\n if (lc.call(nc, a)) return !0;\n if (lc.call(mc, a)) return !1;\n if (kc.test(a)) return nc[a] = !0;\n mc[a] = !0;\n return !1;\n}\n\nfunction pc(a, b, c, d) {\n if (null !== c && 0 === c.type) return !1;\n\n switch (typeof b) {\n case \"function\":\n case \"symbol\":\n return !0;\n\n case \"boolean\":\n if (d) return !1;\n if (null !== c) return !c.acceptsBooleans;\n a = a.toLowerCase().slice(0, 5);\n return \"data-\" !== a && \"aria-\" !== a;\n\n default:\n return !1;\n }\n}\n\nfunction qc(a, b, c, d) {\n if (null === b || \"undefined\" === typeof b || pc(a, b, c, d)) return !0;\n if (d) return !1;\n if (null !== c) switch (c.type) {\n case 3:\n return !b;\n\n case 4:\n return !1 === b;\n\n case 5:\n return isNaN(b);\n\n case 6:\n return isNaN(b) || 1 > b;\n }\n return !1;\n}\n\nfunction C(a, b, c, d, e) {\n this.acceptsBooleans = 2 === b || 3 === b || 4 === b;\n this.attributeName = d;\n this.attributeNamespace = e;\n this.mustUseProperty = c;\n this.propertyName = a;\n this.type = b;\n}\n\nvar D = {};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function (a) {\n D[a] = new C(a, 0, !1, a, null);\n});\n[[\"acceptCharset\", \"accept-charset\"], [\"className\", \"class\"], [\"htmlFor\", \"for\"], [\"httpEquiv\", \"http-equiv\"]].forEach(function (a) {\n var b = a[0];\n D[b] = new C(b, 1, !1, a[1], null);\n});\n[\"contentEditable\", \"draggable\", \"spellCheck\", \"value\"].forEach(function (a) {\n D[a] = new C(a, 2, !1, a.toLowerCase(), null);\n});\n[\"autoReverse\", \"externalResourcesRequired\", \"focusable\", \"preserveAlpha\"].forEach(function (a) {\n D[a] = new C(a, 2, !1, a, null);\n});\n\"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function (a) {\n D[a] = new C(a, 3, !1, a.toLowerCase(), null);\n});\n[\"checked\", \"multiple\", \"muted\", \"selected\"].forEach(function (a) {\n D[a] = new C(a, 3, !0, a, null);\n});\n[\"capture\", \"download\"].forEach(function (a) {\n D[a] = new C(a, 4, !1, a, null);\n});\n[\"cols\", \"rows\", \"size\", \"span\"].forEach(function (a) {\n D[a] = new C(a, 6, !1, a, null);\n});\n[\"rowSpan\", \"start\"].forEach(function (a) {\n D[a] = new C(a, 5, !1, a.toLowerCase(), null);\n});\nvar rc = /[\\-:]([a-z])/g;\n\nfunction sc(a) {\n return a[1].toUpperCase();\n}\n\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function (a) {\n var b = a.replace(rc, sc);\n D[b] = new C(b, 1, !1, a, null);\n});\n\"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function (a) {\n var b = a.replace(rc, sc);\n D[b] = new C(b, 1, !1, a, \"http://www.w3.org/1999/xlink\");\n});\n[\"xml:base\", \"xml:lang\", \"xml:space\"].forEach(function (a) {\n var b = a.replace(rc, sc);\n D[b] = new C(b, 1, !1, a, \"http://www.w3.org/XML/1998/namespace\");\n});\n[\"tabIndex\", \"crossOrigin\"].forEach(function (a) {\n D[a] = new C(a, 1, !1, a.toLowerCase(), null);\n});\n\nfunction tc(a, b, c, d) {\n var e = D.hasOwnProperty(b) ? D[b] : null;\n var f = null !== e ? 0 === e.type : d ? !1 : !(2 < b.length) || \"o\" !== b[0] && \"O\" !== b[0] || \"n\" !== b[1] && \"N\" !== b[1] ? !1 : !0;\n f || (qc(b, c, e, d) && (c = null), d || null === e ? oc(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, \"\" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? !1 : \"\" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && !0 === c ? \"\" : \"\" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))));\n}\n\nfunction uc(a) {\n switch (typeof a) {\n case \"boolean\":\n case \"number\":\n case \"object\":\n case \"string\":\n case \"undefined\":\n return a;\n\n default:\n return \"\";\n }\n}\n\nfunction vc(a, b) {\n var c = b.checked;\n return n({}, b, {\n defaultChecked: void 0,\n defaultValue: void 0,\n value: void 0,\n checked: null != c ? c : a._wrapperState.initialChecked\n });\n}\n\nfunction wc(a, b) {\n var c = null == b.defaultValue ? \"\" : b.defaultValue,\n d = null != b.checked ? b.checked : b.defaultChecked;\n c = uc(null != b.value ? b.value : c);\n a._wrapperState = {\n initialChecked: d,\n initialValue: c,\n controlled: \"checkbox\" === b.type || \"radio\" === b.type ? null != b.checked : null != b.value\n };\n}\n\nfunction xc(a, b) {\n b = b.checked;\n null != b && tc(a, \"checked\", b, !1);\n}\n\nfunction yc(a, b) {\n xc(a, b);\n var c = uc(b.value),\n d = b.type;\n if (null != c) {\n if (\"number\" === d) {\n if (0 === c && \"\" === a.value || a.value != c) a.value = \"\" + c;\n } else a.value !== \"\" + c && (a.value = \"\" + c);\n } else if (\"submit\" === d || \"reset\" === d) {\n a.removeAttribute(\"value\");\n return;\n }\n b.hasOwnProperty(\"value\") ? zc(a, b.type, c) : b.hasOwnProperty(\"defaultValue\") && zc(a, b.type, uc(b.defaultValue));\n null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked);\n}\n\nfunction Ac(a, b, c) {\n if (b.hasOwnProperty(\"value\") || b.hasOwnProperty(\"defaultValue\")) {\n var d = b.type;\n if (!(\"submit\" !== d && \"reset\" !== d || void 0 !== b.value && null !== b.value)) return;\n b = \"\" + a._wrapperState.initialValue;\n c || b === a.value || (a.value = b);\n a.defaultValue = b;\n }\n\n c = a.name;\n \"\" !== c && (a.name = \"\");\n a.defaultChecked = !a.defaultChecked;\n a.defaultChecked = !!a._wrapperState.initialChecked;\n \"\" !== c && (a.name = c);\n}\n\nfunction zc(a, b, c) {\n if (\"number\" !== b || a.ownerDocument.activeElement !== a) null == c ? a.defaultValue = \"\" + a._wrapperState.initialValue : a.defaultValue !== \"\" + c && (a.defaultValue = \"\" + c);\n}\n\nvar Bc = {\n change: {\n phasedRegistrationNames: {\n bubbled: \"onChange\",\n captured: \"onChangeCapture\"\n },\n dependencies: \"blur change click focus input keydown keyup selectionchange\".split(\" \")\n }\n};\n\nfunction Cc(a, b, c) {\n a = y.getPooled(Bc.change, a, b, c);\n a.type = \"change\";\n Eb(c);\n Qa(a);\n return a;\n}\n\nvar Dc = null,\n Ec = null;\n\nfunction Fc(a) {\n Da(a);\n}\n\nfunction Gc(a) {\n var b = Ja(a);\n if (Sb(b)) return a;\n}\n\nfunction Hc(a, b) {\n if (\"change\" === a) return b;\n}\n\nvar Ic = !1;\nRa && (Ic = Ob(\"input\") && (!document.documentMode || 9 < document.documentMode));\n\nfunction Jc() {\n Dc && (Dc.detachEvent(\"onpropertychange\", Kc), Ec = Dc = null);\n}\n\nfunction Kc(a) {\n \"value\" === a.propertyName && Gc(Ec) && (a = Cc(Ec, a, Nb(a)), Kb(Fc, a));\n}\n\nfunction Lc(a, b, c) {\n \"focus\" === a ? (Jc(), Dc = b, Ec = c, Dc.attachEvent(\"onpropertychange\", Kc)) : \"blur\" === a && Jc();\n}\n\nfunction Mc(a) {\n if (\"selectionchange\" === a || \"keyup\" === a || \"keydown\" === a) return Gc(Ec);\n}\n\nfunction Nc(a, b) {\n if (\"click\" === a) return Gc(b);\n}\n\nfunction Oc(a, b) {\n if (\"input\" === a || \"change\" === a) return Gc(b);\n}\n\nvar Pc = {\n eventTypes: Bc,\n _isInputEventSupported: Ic,\n extractEvents: function extractEvents(a, b, c, d) {\n var e = b ? Ja(b) : window,\n f = void 0,\n g = void 0,\n h = e.nodeName && e.nodeName.toLowerCase();\n \"select\" === h || \"input\" === h && \"file\" === e.type ? f = Hc : Mb(e) ? Ic ? f = Oc : (f = Mc, g = Lc) : (h = e.nodeName) && \"input\" === h.toLowerCase() && (\"checkbox\" === e.type || \"radio\" === e.type) && (f = Nc);\n if (f && (f = f(a, b))) return Cc(f, c, d);\n g && g(a, e, b);\n \"blur\" === a && (a = e._wrapperState) && a.controlled && \"number\" === e.type && zc(e, \"number\", e.value);\n }\n},\n Qc = y.extend({\n view: null,\n detail: null\n}),\n Rc = {\n Alt: \"altKey\",\n Control: \"ctrlKey\",\n Meta: \"metaKey\",\n Shift: \"shiftKey\"\n};\n\nfunction Sc(a) {\n var b = this.nativeEvent;\n return b.getModifierState ? b.getModifierState(a) : (a = Rc[a]) ? !!b[a] : !1;\n}\n\nfunction Tc() {\n return Sc;\n}\n\nvar Uc = 0,\n Vc = 0,\n Wc = !1,\n Xc = !1,\n Yc = Qc.extend({\n screenX: null,\n screenY: null,\n clientX: null,\n clientY: null,\n pageX: null,\n pageY: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n getModifierState: Tc,\n button: null,\n buttons: null,\n relatedTarget: function relatedTarget(a) {\n return a.relatedTarget || (a.fromElement === a.srcElement ? a.toElement : a.fromElement);\n },\n movementX: function movementX(a) {\n if (\"movementX\" in a) return a.movementX;\n var b = Uc;\n Uc = a.screenX;\n return Wc ? \"mousemove\" === a.type ? a.screenX - b : 0 : (Wc = !0, 0);\n },\n movementY: function movementY(a) {\n if (\"movementY\" in a) return a.movementY;\n var b = Vc;\n Vc = a.screenY;\n return Xc ? \"mousemove\" === a.type ? a.screenY - b : 0 : (Xc = !0, 0);\n }\n}),\n Zc = Yc.extend({\n pointerId: null,\n width: null,\n height: null,\n pressure: null,\n tangentialPressure: null,\n tiltX: null,\n tiltY: null,\n twist: null,\n pointerType: null,\n isPrimary: null\n}),\n $c = {\n mouseEnter: {\n registrationName: \"onMouseEnter\",\n dependencies: [\"mouseout\", \"mouseover\"]\n },\n mouseLeave: {\n registrationName: \"onMouseLeave\",\n dependencies: [\"mouseout\", \"mouseover\"]\n },\n pointerEnter: {\n registrationName: \"onPointerEnter\",\n dependencies: [\"pointerout\", \"pointerover\"]\n },\n pointerLeave: {\n registrationName: \"onPointerLeave\",\n dependencies: [\"pointerout\", \"pointerover\"]\n }\n},\n ad = {\n eventTypes: $c,\n extractEvents: function extractEvents(a, b, c, d) {\n var e = \"mouseover\" === a || \"pointerover\" === a,\n f = \"mouseout\" === a || \"pointerout\" === a;\n if (e && (c.relatedTarget || c.fromElement) || !f && !e) return null;\n e = d.window === d ? d : (e = d.ownerDocument) ? e.defaultView || e.parentWindow : window;\n f ? (f = b, b = (b = c.relatedTarget || c.toElement) ? Ha(b) : null) : f = null;\n if (f === b) return null;\n var g = void 0,\n h = void 0,\n l = void 0,\n k = void 0;\n if (\"mouseout\" === a || \"mouseover\" === a) g = Yc, h = $c.mouseLeave, l = $c.mouseEnter, k = \"mouse\";else if (\"pointerout\" === a || \"pointerover\" === a) g = Zc, h = $c.pointerLeave, l = $c.pointerEnter, k = \"pointer\";\n var m = null == f ? e : Ja(f);\n e = null == b ? e : Ja(b);\n a = g.getPooled(h, f, c, d);\n a.type = k + \"leave\";\n a.target = m;\n a.relatedTarget = e;\n c = g.getPooled(l, b, c, d);\n c.type = k + \"enter\";\n c.target = e;\n c.relatedTarget = m;\n d = b;\n if (f && d) a: {\n b = f;\n e = d;\n k = 0;\n\n for (g = b; g; g = La(g)) {\n k++;\n }\n\n g = 0;\n\n for (l = e; l; l = La(l)) {\n g++;\n }\n\n for (; 0 < k - g;) {\n b = La(b), k--;\n }\n\n for (; 0 < g - k;) {\n e = La(e), g--;\n }\n\n for (; k--;) {\n if (b === e || b === e.alternate) break a;\n b = La(b);\n e = La(e);\n }\n\n b = null;\n } else b = null;\n e = b;\n\n for (b = []; f && f !== e;) {\n k = f.alternate;\n if (null !== k && k === e) break;\n b.push(f);\n f = La(f);\n }\n\n for (f = []; d && d !== e;) {\n k = d.alternate;\n if (null !== k && k === e) break;\n f.push(d);\n d = La(d);\n }\n\n for (d = 0; d < b.length; d++) {\n Oa(b[d], \"bubbled\", a);\n }\n\n for (d = f.length; 0 < d--;) {\n Oa(f[d], \"captured\", c);\n }\n\n return [a, c];\n }\n};\n\nfunction bd(a, b) {\n return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;\n}\n\nvar cd = Object.prototype.hasOwnProperty;\n\nfunction dd(a, b) {\n if (bd(a, b)) return !0;\n if (\"object\" !== typeof a || null === a || \"object\" !== typeof b || null === b) return !1;\n var c = Object.keys(a),\n d = Object.keys(b);\n if (c.length !== d.length) return !1;\n\n for (d = 0; d < c.length; d++) {\n if (!cd.call(b, c[d]) || !bd(a[c[d]], b[c[d]])) return !1;\n }\n\n return !0;\n}\n\nfunction ed(a) {\n var b = a;\n if (a.alternate) for (; b.return;) {\n b = b.return;\n } else {\n if (0 !== (b.effectTag & 2)) return 1;\n\n for (; b.return;) {\n if (b = b.return, 0 !== (b.effectTag & 2)) return 1;\n }\n }\n return 3 === b.tag ? 2 : 3;\n}\n\nfunction fd(a) {\n 2 !== ed(a) ? x(\"188\") : void 0;\n}\n\nfunction gd(a) {\n var b = a.alternate;\n if (!b) return b = ed(a), 3 === b ? x(\"188\") : void 0, 1 === b ? null : a;\n\n for (var c = a, d = b;;) {\n var e = c.return,\n f = e ? e.alternate : null;\n if (!e || !f) break;\n\n if (e.child === f.child) {\n for (var g = e.child; g;) {\n if (g === c) return fd(e), a;\n if (g === d) return fd(e), b;\n g = g.sibling;\n }\n\n x(\"188\");\n }\n\n if (c.return !== d.return) c = e, d = f;else {\n g = !1;\n\n for (var h = e.child; h;) {\n if (h === c) {\n g = !0;\n c = e;\n d = f;\n break;\n }\n\n if (h === d) {\n g = !0;\n d = e;\n c = f;\n break;\n }\n\n h = h.sibling;\n }\n\n if (!g) {\n for (h = f.child; h;) {\n if (h === c) {\n g = !0;\n c = f;\n d = e;\n break;\n }\n\n if (h === d) {\n g = !0;\n d = f;\n c = e;\n break;\n }\n\n h = h.sibling;\n }\n\n g ? void 0 : x(\"189\");\n }\n }\n c.alternate !== d ? x(\"190\") : void 0;\n }\n\n 3 !== c.tag ? x(\"188\") : void 0;\n return c.stateNode.current === c ? a : b;\n}\n\nfunction hd(a) {\n a = gd(a);\n if (!a) return null;\n\n for (var b = a;;) {\n if (5 === b.tag || 6 === b.tag) return b;\n if (b.child) b.child.return = b, b = b.child;else {\n if (b === a) break;\n\n for (; !b.sibling;) {\n if (!b.return || b.return === a) return null;\n b = b.return;\n }\n\n b.sibling.return = b.return;\n b = b.sibling;\n }\n }\n\n return null;\n}\n\nvar id = y.extend({\n animationName: null,\n elapsedTime: null,\n pseudoElement: null\n}),\n jd = y.extend({\n clipboardData: function clipboardData(a) {\n return \"clipboardData\" in a ? a.clipboardData : window.clipboardData;\n }\n}),\n kd = Qc.extend({\n relatedTarget: null\n});\n\nfunction ld(a) {\n var b = a.keyCode;\n \"charCode\" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b;\n 10 === a && (a = 13);\n return 32 <= a || 13 === a ? a : 0;\n}\n\nvar md = {\n Esc: \"Escape\",\n Spacebar: \" \",\n Left: \"ArrowLeft\",\n Up: \"ArrowUp\",\n Right: \"ArrowRight\",\n Down: \"ArrowDown\",\n Del: \"Delete\",\n Win: \"OS\",\n Menu: \"ContextMenu\",\n Apps: \"ContextMenu\",\n Scroll: \"ScrollLock\",\n MozPrintableKey: \"Unidentified\"\n},\n nd = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 12: \"Clear\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 19: \"Pause\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 45: \"Insert\",\n 46: \"Delete\",\n 112: \"F1\",\n 113: \"F2\",\n 114: \"F3\",\n 115: \"F4\",\n 116: \"F5\",\n 117: \"F6\",\n 118: \"F7\",\n 119: \"F8\",\n 120: \"F9\",\n 121: \"F10\",\n 122: \"F11\",\n 123: \"F12\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 224: \"Meta\"\n},\n od = Qc.extend({\n key: function key(a) {\n if (a.key) {\n var b = md[a.key] || a.key;\n if (\"Unidentified\" !== b) return b;\n }\n\n return \"keypress\" === a.type ? (a = ld(a), 13 === a ? \"Enter\" : String.fromCharCode(a)) : \"keydown\" === a.type || \"keyup\" === a.type ? nd[a.keyCode] || \"Unidentified\" : \"\";\n },\n location: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n repeat: null,\n locale: null,\n getModifierState: Tc,\n charCode: function charCode(a) {\n return \"keypress\" === a.type ? ld(a) : 0;\n },\n keyCode: function keyCode(a) {\n return \"keydown\" === a.type || \"keyup\" === a.type ? a.keyCode : 0;\n },\n which: function which(a) {\n return \"keypress\" === a.type ? ld(a) : \"keydown\" === a.type || \"keyup\" === a.type ? a.keyCode : 0;\n }\n}),\n pd = Yc.extend({\n dataTransfer: null\n}),\n qd = Qc.extend({\n touches: null,\n targetTouches: null,\n changedTouches: null,\n altKey: null,\n metaKey: null,\n ctrlKey: null,\n shiftKey: null,\n getModifierState: Tc\n}),\n rd = y.extend({\n propertyName: null,\n elapsedTime: null,\n pseudoElement: null\n}),\n sd = Yc.extend({\n deltaX: function deltaX(a) {\n return \"deltaX\" in a ? a.deltaX : \"wheelDeltaX\" in a ? -a.wheelDeltaX : 0;\n },\n deltaY: function deltaY(a) {\n return \"deltaY\" in a ? a.deltaY : \"wheelDeltaY\" in a ? -a.wheelDeltaY : \"wheelDelta\" in a ? -a.wheelDelta : 0;\n },\n deltaZ: null,\n deltaMode: null\n}),\n td = [[\"abort\", \"abort\"], [Xa, \"animationEnd\"], [Ya, \"animationIteration\"], [Za, \"animationStart\"], [\"canplay\", \"canPlay\"], [\"canplaythrough\", \"canPlayThrough\"], [\"drag\", \"drag\"], [\"dragenter\", \"dragEnter\"], [\"dragexit\", \"dragExit\"], [\"dragleave\", \"dragLeave\"], [\"dragover\", \"dragOver\"], [\"durationchange\", \"durationChange\"], [\"emptied\", \"emptied\"], [\"encrypted\", \"encrypted\"], [\"ended\", \"ended\"], [\"error\", \"error\"], [\"gotpointercapture\", \"gotPointerCapture\"], [\"load\", \"load\"], [\"loadeddata\", \"loadedData\"], [\"loadedmetadata\", \"loadedMetadata\"], [\"loadstart\", \"loadStart\"], [\"lostpointercapture\", \"lostPointerCapture\"], [\"mousemove\", \"mouseMove\"], [\"mouseout\", \"mouseOut\"], [\"mouseover\", \"mouseOver\"], [\"playing\", \"playing\"], [\"pointermove\", \"pointerMove\"], [\"pointerout\", \"pointerOut\"], [\"pointerover\", \"pointerOver\"], [\"progress\", \"progress\"], [\"scroll\", \"scroll\"], [\"seeking\", \"seeking\"], [\"stalled\", \"stalled\"], [\"suspend\", \"suspend\"], [\"timeupdate\", \"timeUpdate\"], [\"toggle\", \"toggle\"], [\"touchmove\", \"touchMove\"], [$a, \"transitionEnd\"], [\"waiting\", \"waiting\"], [\"wheel\", \"wheel\"]],\n ud = {},\n vd = {};\n\nfunction wd(a, b) {\n var c = a[0];\n a = a[1];\n var d = \"on\" + (a[0].toUpperCase() + a.slice(1));\n b = {\n phasedRegistrationNames: {\n bubbled: d,\n captured: d + \"Capture\"\n },\n dependencies: [c],\n isInteractive: b\n };\n ud[a] = b;\n vd[c] = b;\n}\n\n[[\"blur\", \"blur\"], [\"cancel\", \"cancel\"], [\"click\", \"click\"], [\"close\", \"close\"], [\"contextmenu\", \"contextMenu\"], [\"copy\", \"copy\"], [\"cut\", \"cut\"], [\"auxclick\", \"auxClick\"], [\"dblclick\", \"doubleClick\"], [\"dragend\", \"dragEnd\"], [\"dragstart\", \"dragStart\"], [\"drop\", \"drop\"], [\"focus\", \"focus\"], [\"input\", \"input\"], [\"invalid\", \"invalid\"], [\"keydown\", \"keyDown\"], [\"keypress\", \"keyPress\"], [\"keyup\", \"keyUp\"], [\"mousedown\", \"mouseDown\"], [\"mouseup\", \"mouseUp\"], [\"paste\", \"paste\"], [\"pause\", \"pause\"], [\"play\", \"play\"], [\"pointercancel\", \"pointerCancel\"], [\"pointerdown\", \"pointerDown\"], [\"pointerup\", \"pointerUp\"], [\"ratechange\", \"rateChange\"], [\"reset\", \"reset\"], [\"seeked\", \"seeked\"], [\"submit\", \"submit\"], [\"touchcancel\", \"touchCancel\"], [\"touchend\", \"touchEnd\"], [\"touchstart\", \"touchStart\"], [\"volumechange\", \"volumeChange\"]].forEach(function (a) {\n wd(a, !0);\n});\ntd.forEach(function (a) {\n wd(a, !1);\n});\nvar xd = {\n eventTypes: ud,\n isInteractiveTopLevelEventType: function isInteractiveTopLevelEventType(a) {\n a = vd[a];\n return void 0 !== a && !0 === a.isInteractive;\n },\n extractEvents: function extractEvents(a, b, c, d) {\n var e = vd[a];\n if (!e) return null;\n\n switch (a) {\n case \"keypress\":\n if (0 === ld(c)) return null;\n\n case \"keydown\":\n case \"keyup\":\n a = od;\n break;\n\n case \"blur\":\n case \"focus\":\n a = kd;\n break;\n\n case \"click\":\n if (2 === c.button) return null;\n\n case \"auxclick\":\n case \"dblclick\":\n case \"mousedown\":\n case \"mousemove\":\n case \"mouseup\":\n case \"mouseout\":\n case \"mouseover\":\n case \"contextmenu\":\n a = Yc;\n break;\n\n case \"drag\":\n case \"dragend\":\n case \"dragenter\":\n case \"dragexit\":\n case \"dragleave\":\n case \"dragover\":\n case \"dragstart\":\n case \"drop\":\n a = pd;\n break;\n\n case \"touchcancel\":\n case \"touchend\":\n case \"touchmove\":\n case \"touchstart\":\n a = qd;\n break;\n\n case Xa:\n case Ya:\n case Za:\n a = id;\n break;\n\n case $a:\n a = rd;\n break;\n\n case \"scroll\":\n a = Qc;\n break;\n\n case \"wheel\":\n a = sd;\n break;\n\n case \"copy\":\n case \"cut\":\n case \"paste\":\n a = jd;\n break;\n\n case \"gotpointercapture\":\n case \"lostpointercapture\":\n case \"pointercancel\":\n case \"pointerdown\":\n case \"pointermove\":\n case \"pointerout\":\n case \"pointerover\":\n case \"pointerup\":\n a = Zc;\n break;\n\n default:\n a = y;\n }\n\n b = a.getPooled(e, b, c, d);\n Qa(b);\n return b;\n }\n},\n yd = xd.isInteractiveTopLevelEventType,\n zd = [];\n\nfunction Ad(a) {\n var b = a.targetInst,\n c = b;\n\n do {\n if (!c) {\n a.ancestors.push(c);\n break;\n }\n\n var d;\n\n for (d = c; d.return;) {\n d = d.return;\n }\n\n d = 3 !== d.tag ? null : d.stateNode.containerInfo;\n if (!d) break;\n a.ancestors.push(c);\n c = Ha(d);\n } while (c);\n\n for (c = 0; c < a.ancestors.length; c++) {\n b = a.ancestors[c];\n var e = Nb(a.nativeEvent);\n d = a.topLevelType;\n\n for (var f = a.nativeEvent, g = null, h = 0; h < oa.length; h++) {\n var l = oa[h];\n l && (l = l.extractEvents(d, b, f, e)) && (g = xa(g, l));\n }\n\n Da(g);\n }\n}\n\nvar Bd = !0;\n\nfunction E(a, b) {\n if (!b) return null;\n var c = (yd(a) ? Cd : Dd).bind(null, a);\n b.addEventListener(a, c, !1);\n}\n\nfunction Ed(a, b) {\n if (!b) return null;\n var c = (yd(a) ? Cd : Dd).bind(null, a);\n b.addEventListener(a, c, !0);\n}\n\nfunction Cd(a, b) {\n Hb(Dd, a, b);\n}\n\nfunction Dd(a, b) {\n if (Bd) {\n var c = Nb(b);\n c = Ha(c);\n null === c || \"number\" !== typeof c.tag || 2 === ed(c) || (c = null);\n\n if (zd.length) {\n var d = zd.pop();\n d.topLevelType = a;\n d.nativeEvent = b;\n d.targetInst = c;\n a = d;\n } else a = {\n topLevelType: a,\n nativeEvent: b,\n targetInst: c,\n ancestors: []\n };\n\n try {\n Kb(Ad, a);\n } finally {\n a.topLevelType = null, a.nativeEvent = null, a.targetInst = null, a.ancestors.length = 0, 10 > zd.length && zd.push(a);\n }\n }\n}\n\nvar Fd = {},\n Gd = 0,\n Hd = \"_reactListenersID\" + (\"\" + Math.random()).slice(2);\n\nfunction Id(a) {\n Object.prototype.hasOwnProperty.call(a, Hd) || (a[Hd] = Gd++, Fd[a[Hd]] = {});\n return Fd[a[Hd]];\n}\n\nfunction Jd(a) {\n a = a || (\"undefined\" !== typeof document ? document : void 0);\n if (\"undefined\" === typeof a) return null;\n\n try {\n return a.activeElement || a.body;\n } catch (b) {\n return a.body;\n }\n}\n\nfunction Kd(a) {\n for (; a && a.firstChild;) {\n a = a.firstChild;\n }\n\n return a;\n}\n\nfunction Ld(a, b) {\n var c = Kd(a);\n a = 0;\n\n for (var d; c;) {\n if (3 === c.nodeType) {\n d = a + c.textContent.length;\n if (a <= b && d >= b) return {\n node: c,\n offset: b - a\n };\n a = d;\n }\n\n a: {\n for (; c;) {\n if (c.nextSibling) {\n c = c.nextSibling;\n break a;\n }\n\n c = c.parentNode;\n }\n\n c = void 0;\n }\n\n c = Kd(c);\n }\n}\n\nfunction Md(a, b) {\n return a && b ? a === b ? !0 : a && 3 === a.nodeType ? !1 : b && 3 === b.nodeType ? Md(a, b.parentNode) : \"contains\" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : !1 : !1;\n}\n\nfunction Nd() {\n for (var a = window, b = Jd(); b instanceof a.HTMLIFrameElement;) {\n try {\n var c = \"string\" === typeof b.contentWindow.location.href;\n } catch (d) {\n c = !1;\n }\n\n if (c) a = b.contentWindow;else break;\n b = Jd(a.document);\n }\n\n return b;\n}\n\nfunction Od(a) {\n var b = a && a.nodeName && a.nodeName.toLowerCase();\n return b && (\"input\" === b && (\"text\" === a.type || \"search\" === a.type || \"tel\" === a.type || \"url\" === a.type || \"password\" === a.type) || \"textarea\" === b || \"true\" === a.contentEditable);\n}\n\nfunction Pd() {\n var a = Nd();\n\n if (Od(a)) {\n if (\"selectionStart\" in a) var b = {\n start: a.selectionStart,\n end: a.selectionEnd\n };else a: {\n b = (b = a.ownerDocument) && b.defaultView || window;\n var c = b.getSelection && b.getSelection();\n\n if (c && 0 !== c.rangeCount) {\n b = c.anchorNode;\n var d = c.anchorOffset,\n e = c.focusNode;\n c = c.focusOffset;\n\n try {\n b.nodeType, e.nodeType;\n } catch (A) {\n b = null;\n break a;\n }\n\n var f = 0,\n g = -1,\n h = -1,\n l = 0,\n k = 0,\n m = a,\n p = null;\n\n b: for (;;) {\n for (var t;;) {\n m !== b || 0 !== d && 3 !== m.nodeType || (g = f + d);\n m !== e || 0 !== c && 3 !== m.nodeType || (h = f + c);\n 3 === m.nodeType && (f += m.nodeValue.length);\n if (null === (t = m.firstChild)) break;\n p = m;\n m = t;\n }\n\n for (;;) {\n if (m === a) break b;\n p === b && ++l === d && (g = f);\n p === e && ++k === c && (h = f);\n if (null !== (t = m.nextSibling)) break;\n m = p;\n p = m.parentNode;\n }\n\n m = t;\n }\n\n b = -1 === g || -1 === h ? null : {\n start: g,\n end: h\n };\n } else b = null;\n }\n b = b || {\n start: 0,\n end: 0\n };\n } else b = null;\n\n return {\n focusedElem: a,\n selectionRange: b\n };\n}\n\nfunction Qd(a) {\n var b = Nd(),\n c = a.focusedElem,\n d = a.selectionRange;\n\n if (b !== c && c && c.ownerDocument && Md(c.ownerDocument.documentElement, c)) {\n if (null !== d && Od(c)) if (b = d.start, a = d.end, void 0 === a && (a = b), \"selectionStart\" in c) c.selectionStart = b, c.selectionEnd = Math.min(a, c.value.length);else if (a = (b = c.ownerDocument || document) && b.defaultView || window, a.getSelection) {\n a = a.getSelection();\n var e = c.textContent.length,\n f = Math.min(d.start, e);\n d = void 0 === d.end ? f : Math.min(d.end, e);\n !a.extend && f > d && (e = d, d = f, f = e);\n e = Ld(c, f);\n var g = Ld(c, d);\n e && g && (1 !== a.rangeCount || a.anchorNode !== e.node || a.anchorOffset !== e.offset || a.focusNode !== g.node || a.focusOffset !== g.offset) && (b = b.createRange(), b.setStart(e.node, e.offset), a.removeAllRanges(), f > d ? (a.addRange(b), a.extend(g.node, g.offset)) : (b.setEnd(g.node, g.offset), a.addRange(b)));\n }\n b = [];\n\n for (a = c; a = a.parentNode;) {\n 1 === a.nodeType && b.push({\n element: a,\n left: a.scrollLeft,\n top: a.scrollTop\n });\n }\n\n \"function\" === typeof c.focus && c.focus();\n\n for (c = 0; c < b.length; c++) {\n a = b[c], a.element.scrollLeft = a.left, a.element.scrollTop = a.top;\n }\n }\n}\n\nvar Rd = Ra && \"documentMode\" in document && 11 >= document.documentMode,\n Sd = {\n select: {\n phasedRegistrationNames: {\n bubbled: \"onSelect\",\n captured: \"onSelectCapture\"\n },\n dependencies: \"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange\".split(\" \")\n }\n},\n Td = null,\n Ud = null,\n Vd = null,\n Wd = !1;\n\nfunction Xd(a, b) {\n var c = b.window === b ? b.document : 9 === b.nodeType ? b : b.ownerDocument;\n if (Wd || null == Td || Td !== Jd(c)) return null;\n c = Td;\n \"selectionStart\" in c && Od(c) ? c = {\n start: c.selectionStart,\n end: c.selectionEnd\n } : (c = (c.ownerDocument && c.ownerDocument.defaultView || window).getSelection(), c = {\n anchorNode: c.anchorNode,\n anchorOffset: c.anchorOffset,\n focusNode: c.focusNode,\n focusOffset: c.focusOffset\n });\n return Vd && dd(Vd, c) ? null : (Vd = c, a = y.getPooled(Sd.select, Ud, a, b), a.type = \"select\", a.target = Td, Qa(a), a);\n}\n\nvar Yd = {\n eventTypes: Sd,\n extractEvents: function extractEvents(a, b, c, d) {\n var e = d.window === d ? d.document : 9 === d.nodeType ? d : d.ownerDocument,\n f;\n\n if (!(f = !e)) {\n a: {\n e = Id(e);\n f = sa.onSelect;\n\n for (var g = 0; g < f.length; g++) {\n var h = f[g];\n\n if (!e.hasOwnProperty(h) || !e[h]) {\n e = !1;\n break a;\n }\n }\n\n e = !0;\n }\n\n f = !e;\n }\n\n if (f) return null;\n e = b ? Ja(b) : window;\n\n switch (a) {\n case \"focus\":\n if (Mb(e) || \"true\" === e.contentEditable) Td = e, Ud = b, Vd = null;\n break;\n\n case \"blur\":\n Vd = Ud = Td = null;\n break;\n\n case \"mousedown\":\n Wd = !0;\n break;\n\n case \"contextmenu\":\n case \"mouseup\":\n case \"dragend\":\n return Wd = !1, Xd(c, d);\n\n case \"selectionchange\":\n if (Rd) break;\n\n case \"keydown\":\n case \"keyup\":\n return Xd(c, d);\n }\n\n return null;\n }\n};\nBa.injectEventPluginOrder(\"ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin\".split(\" \"));\nta = Ka;\nua = Ia;\nva = Ja;\nBa.injectEventPluginsByName({\n SimpleEventPlugin: xd,\n EnterLeaveEventPlugin: ad,\n ChangeEventPlugin: Pc,\n SelectEventPlugin: Yd,\n BeforeInputEventPlugin: zb\n});\n\nfunction Zd(a) {\n var b = \"\";\n aa.Children.forEach(a, function (a) {\n null != a && (b += a);\n });\n return b;\n}\n\nfunction $d(a, b) {\n a = n({\n children: void 0\n }, b);\n if (b = Zd(b.children)) a.children = b;\n return a;\n}\n\nfunction ae(a, b, c, d) {\n a = a.options;\n\n if (b) {\n b = {};\n\n for (var e = 0; e < c.length; e++) {\n b[\"$\" + c[e]] = !0;\n }\n\n for (c = 0; c < a.length; c++) {\n e = b.hasOwnProperty(\"$\" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = !0);\n }\n } else {\n c = \"\" + uc(c);\n b = null;\n\n for (e = 0; e < a.length; e++) {\n if (a[e].value === c) {\n a[e].selected = !0;\n d && (a[e].defaultSelected = !0);\n return;\n }\n\n null !== b || a[e].disabled || (b = a[e]);\n }\n\n null !== b && (b.selected = !0);\n }\n}\n\nfunction be(a, b) {\n null != b.dangerouslySetInnerHTML ? x(\"91\") : void 0;\n return n({}, b, {\n value: void 0,\n defaultValue: void 0,\n children: \"\" + a._wrapperState.initialValue\n });\n}\n\nfunction ce(a, b) {\n var c = b.value;\n null == c && (c = b.defaultValue, b = b.children, null != b && (null != c ? x(\"92\") : void 0, Array.isArray(b) && (1 >= b.length ? void 0 : x(\"93\"), b = b[0]), c = b), null == c && (c = \"\"));\n a._wrapperState = {\n initialValue: uc(c)\n };\n}\n\nfunction de(a, b) {\n var c = uc(b.value),\n d = uc(b.defaultValue);\n null != c && (c = \"\" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c));\n null != d && (a.defaultValue = \"\" + d);\n}\n\nfunction ee(a) {\n var b = a.textContent;\n b === a._wrapperState.initialValue && (a.value = b);\n}\n\nvar fe = {\n html: \"http://www.w3.org/1999/xhtml\",\n mathml: \"http://www.w3.org/1998/Math/MathML\",\n svg: \"http://www.w3.org/2000/svg\"\n};\n\nfunction ge(a) {\n switch (a) {\n case \"svg\":\n return \"http://www.w3.org/2000/svg\";\n\n case \"math\":\n return \"http://www.w3.org/1998/Math/MathML\";\n\n default:\n return \"http://www.w3.org/1999/xhtml\";\n }\n}\n\nfunction he(a, b) {\n return null == a || \"http://www.w3.org/1999/xhtml\" === a ? ge(b) : \"http://www.w3.org/2000/svg\" === a && \"foreignObject\" === b ? \"http://www.w3.org/1999/xhtml\" : a;\n}\n\nvar ie = void 0,\n je = function (a) {\n return \"undefined\" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function (b, c, d, e) {\n MSApp.execUnsafeLocalFunction(function () {\n return a(b, c, d, e);\n });\n } : a;\n}(function (a, b) {\n if (a.namespaceURI !== fe.svg || \"innerHTML\" in a) a.innerHTML = b;else {\n ie = ie || document.createElement(\"div\");\n ie.innerHTML = \"\";\n\n for (b = ie.firstChild; a.firstChild;) {\n a.removeChild(a.firstChild);\n }\n\n for (; b.firstChild;) {\n a.appendChild(b.firstChild);\n }\n }\n});\n\nfunction ke(a, b) {\n if (b) {\n var c = a.firstChild;\n\n if (c && c === a.lastChild && 3 === c.nodeType) {\n c.nodeValue = b;\n return;\n }\n }\n\n a.textContent = b;\n}\n\nvar le = {\n animationIterationCount: !0,\n borderImageOutset: !0,\n borderImageSlice: !0,\n borderImageWidth: !0,\n boxFlex: !0,\n boxFlexGroup: !0,\n boxOrdinalGroup: !0,\n columnCount: !0,\n columns: !0,\n flex: !0,\n flexGrow: !0,\n flexPositive: !0,\n flexShrink: !0,\n flexNegative: !0,\n flexOrder: !0,\n gridArea: !0,\n gridRow: !0,\n gridRowEnd: !0,\n gridRowSpan: !0,\n gridRowStart: !0,\n gridColumn: !0,\n gridColumnEnd: !0,\n gridColumnSpan: !0,\n gridColumnStart: !0,\n fontWeight: !0,\n lineClamp: !0,\n lineHeight: !0,\n opacity: !0,\n order: !0,\n orphans: !0,\n tabSize: !0,\n widows: !0,\n zIndex: !0,\n zoom: !0,\n fillOpacity: !0,\n floodOpacity: !0,\n stopOpacity: !0,\n strokeDasharray: !0,\n strokeDashoffset: !0,\n strokeMiterlimit: !0,\n strokeOpacity: !0,\n strokeWidth: !0\n},\n me = [\"Webkit\", \"ms\", \"Moz\", \"O\"];\nObject.keys(le).forEach(function (a) {\n me.forEach(function (b) {\n b = b + a.charAt(0).toUpperCase() + a.substring(1);\n le[b] = le[a];\n });\n});\n\nfunction ne(a, b, c) {\n return null == b || \"boolean\" === typeof b || \"\" === b ? \"\" : c || \"number\" !== typeof b || 0 === b || le.hasOwnProperty(a) && le[a] ? (\"\" + b).trim() : b + \"px\";\n}\n\nfunction oe(a, b) {\n a = a.style;\n\n for (var c in b) {\n if (b.hasOwnProperty(c)) {\n var d = 0 === c.indexOf(\"--\"),\n e = ne(c, b[c], d);\n \"float\" === c && (c = \"cssFloat\");\n d ? a.setProperty(c, e) : a[c] = e;\n }\n }\n}\n\nvar pe = n({\n menuitem: !0\n}, {\n area: !0,\n base: !0,\n br: !0,\n col: !0,\n embed: !0,\n hr: !0,\n img: !0,\n input: !0,\n keygen: !0,\n link: !0,\n meta: !0,\n param: !0,\n source: !0,\n track: !0,\n wbr: !0\n});\n\nfunction qe(a, b) {\n b && (pe[a] && (null != b.children || null != b.dangerouslySetInnerHTML ? x(\"137\", a, \"\") : void 0), null != b.dangerouslySetInnerHTML && (null != b.children ? x(\"60\") : void 0, \"object\" === typeof b.dangerouslySetInnerHTML && \"__html\" in b.dangerouslySetInnerHTML ? void 0 : x(\"61\")), null != b.style && \"object\" !== typeof b.style ? x(\"62\", \"\") : void 0);\n}\n\nfunction re(a, b) {\n if (-1 === a.indexOf(\"-\")) return \"string\" === typeof b.is;\n\n switch (a) {\n case \"annotation-xml\":\n case \"color-profile\":\n case \"font-face\":\n case \"font-face-src\":\n case \"font-face-uri\":\n case \"font-face-format\":\n case \"font-face-name\":\n case \"missing-glyph\":\n return !1;\n\n default:\n return !0;\n }\n}\n\nfunction se(a, b) {\n a = 9 === a.nodeType || 11 === a.nodeType ? a : a.ownerDocument;\n var c = Id(a);\n b = sa[b];\n\n for (var d = 0; d < b.length; d++) {\n var e = b[d];\n\n if (!c.hasOwnProperty(e) || !c[e]) {\n switch (e) {\n case \"scroll\":\n Ed(\"scroll\", a);\n break;\n\n case \"focus\":\n case \"blur\":\n Ed(\"focus\", a);\n Ed(\"blur\", a);\n c.blur = !0;\n c.focus = !0;\n break;\n\n case \"cancel\":\n case \"close\":\n Ob(e) && Ed(e, a);\n break;\n\n case \"invalid\":\n case \"submit\":\n case \"reset\":\n break;\n\n default:\n -1 === ab.indexOf(e) && E(e, a);\n }\n\n c[e] = !0;\n }\n }\n}\n\nfunction te() {}\n\nvar ue = null,\n ve = null;\n\nfunction we(a, b) {\n switch (a) {\n case \"button\":\n case \"input\":\n case \"select\":\n case \"textarea\":\n return !!b.autoFocus;\n }\n\n return !1;\n}\n\nfunction xe(a, b) {\n return \"textarea\" === a || \"option\" === a || \"noscript\" === a || \"string\" === typeof b.children || \"number\" === typeof b.children || \"object\" === typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;\n}\n\nvar ye = \"function\" === typeof setTimeout ? setTimeout : void 0,\n ze = \"function\" === typeof clearTimeout ? clearTimeout : void 0,\n Ae = r.unstable_scheduleCallback,\n Be = r.unstable_cancelCallback;\n\nfunction Ce(a, b, c, d, e) {\n a[Ga] = e;\n \"input\" === c && \"radio\" === e.type && null != e.name && xc(a, e);\n re(c, d);\n d = re(c, e);\n\n for (var f = 0; f < b.length; f += 2) {\n var g = b[f],\n h = b[f + 1];\n \"style\" === g ? oe(a, h) : \"dangerouslySetInnerHTML\" === g ? je(a, h) : \"children\" === g ? ke(a, h) : tc(a, g, h, d);\n }\n\n switch (c) {\n case \"input\":\n yc(a, e);\n break;\n\n case \"textarea\":\n de(a, e);\n break;\n\n case \"select\":\n b = a._wrapperState.wasMultiple, a._wrapperState.wasMultiple = !!e.multiple, c = e.value, null != c ? ae(a, !!e.multiple, c, !1) : b !== !!e.multiple && (null != e.defaultValue ? ae(a, !!e.multiple, e.defaultValue, !0) : ae(a, !!e.multiple, e.multiple ? [] : \"\", !1));\n }\n}\n\nfunction De(a) {\n for (a = a.nextSibling; a && 1 !== a.nodeType && 3 !== a.nodeType;) {\n a = a.nextSibling;\n }\n\n return a;\n}\n\nfunction Ee(a) {\n for (a = a.firstChild; a && 1 !== a.nodeType && 3 !== a.nodeType;) {\n a = a.nextSibling;\n }\n\n return a;\n}\n\nnew Set();\nvar Fe = [],\n Ge = -1;\n\nfunction F(a) {\n 0 > Ge || (a.current = Fe[Ge], Fe[Ge] = null, Ge--);\n}\n\nfunction G(a, b) {\n Ge++;\n Fe[Ge] = a.current;\n a.current = b;\n}\n\nvar He = {},\n H = {\n current: He\n},\n I = {\n current: !1\n},\n Ie = He;\n\nfunction Je(a, b) {\n var c = a.type.contextTypes;\n if (!c) return He;\n var d = a.stateNode;\n if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext;\n var e = {},\n f;\n\n for (f in c) {\n e[f] = b[f];\n }\n\n d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e);\n return e;\n}\n\nfunction J(a) {\n a = a.childContextTypes;\n return null !== a && void 0 !== a;\n}\n\nfunction Ke(a) {\n F(I, a);\n F(H, a);\n}\n\nfunction Le(a) {\n F(I, a);\n F(H, a);\n}\n\nfunction Me(a, b, c) {\n H.current !== He ? x(\"168\") : void 0;\n G(H, b, a);\n G(I, c, a);\n}\n\nfunction Ne(a, b, c) {\n var d = a.stateNode;\n a = b.childContextTypes;\n if (\"function\" !== typeof d.getChildContext) return c;\n d = d.getChildContext();\n\n for (var e in d) {\n e in a ? void 0 : x(\"108\", ic(b) || \"Unknown\", e);\n }\n\n return n({}, c, d);\n}\n\nfunction Oe(a) {\n var b = a.stateNode;\n b = b && b.__reactInternalMemoizedMergedChildContext || He;\n Ie = H.current;\n G(H, b, a);\n G(I, I.current, a);\n return !0;\n}\n\nfunction Pe(a, b, c) {\n var d = a.stateNode;\n d ? void 0 : x(\"169\");\n c ? (b = Ne(a, b, Ie), d.__reactInternalMemoizedMergedChildContext = b, F(I, a), F(H, a), G(H, b, a)) : F(I, a);\n G(I, c, a);\n}\n\nvar Qe = null,\n Re = null;\n\nfunction Se(a) {\n return function (b) {\n try {\n return a(b);\n } catch (c) {}\n };\n}\n\nfunction Te(a) {\n if (\"undefined\" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;\n var b = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n if (b.isDisabled || !b.supportsFiber) return !0;\n\n try {\n var c = b.inject(a);\n Qe = Se(function (a) {\n return b.onCommitFiberRoot(c, a);\n });\n Re = Se(function (a) {\n return b.onCommitFiberUnmount(c, a);\n });\n } catch (d) {}\n\n return !0;\n}\n\nfunction Ue(a, b, c, d) {\n this.tag = a;\n this.key = c;\n this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;\n this.index = 0;\n this.ref = null;\n this.pendingProps = b;\n this.contextDependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;\n this.mode = d;\n this.effectTag = 0;\n this.lastEffect = this.firstEffect = this.nextEffect = null;\n this.childExpirationTime = this.expirationTime = 0;\n this.alternate = null;\n}\n\nfunction K(a, b, c, d) {\n return new Ue(a, b, c, d);\n}\n\nfunction Ve(a) {\n a = a.prototype;\n return !(!a || !a.isReactComponent);\n}\n\nfunction We(a) {\n if (\"function\" === typeof a) return Ve(a) ? 1 : 0;\n\n if (void 0 !== a && null !== a) {\n a = a.$$typeof;\n if (a === cc) return 11;\n if (a === ec) return 14;\n }\n\n return 2;\n}\n\nfunction Xe(a, b) {\n var c = a.alternate;\n null === c ? (c = K(a.tag, b, a.key, a.mode), c.elementType = a.elementType, c.type = a.type, c.stateNode = a.stateNode, c.alternate = a, a.alternate = c) : (c.pendingProps = b, c.effectTag = 0, c.nextEffect = null, c.firstEffect = null, c.lastEffect = null);\n c.childExpirationTime = a.childExpirationTime;\n c.expirationTime = a.expirationTime;\n c.child = a.child;\n c.memoizedProps = a.memoizedProps;\n c.memoizedState = a.memoizedState;\n c.updateQueue = a.updateQueue;\n c.contextDependencies = a.contextDependencies;\n c.sibling = a.sibling;\n c.index = a.index;\n c.ref = a.ref;\n return c;\n}\n\nfunction Ye(a, b, c, d, e, f) {\n var g = 2;\n d = a;\n if (\"function\" === typeof a) Ve(a) && (g = 1);else if (\"string\" === typeof a) g = 5;else a: switch (a) {\n case Xb:\n return Ze(c.children, e, f, b);\n\n case bc:\n return $e(c, e | 3, f, b);\n\n case Yb:\n return $e(c, e | 2, f, b);\n\n case Zb:\n return a = K(12, c, b, e | 4), a.elementType = Zb, a.type = Zb, a.expirationTime = f, a;\n\n case dc:\n return a = K(13, c, b, e), a.elementType = dc, a.type = dc, a.expirationTime = f, a;\n\n default:\n if (\"object\" === typeof a && null !== a) switch (a.$$typeof) {\n case $b:\n g = 10;\n break a;\n\n case ac:\n g = 9;\n break a;\n\n case cc:\n g = 11;\n break a;\n\n case ec:\n g = 14;\n break a;\n\n case fc:\n g = 16;\n d = null;\n break a;\n }\n x(\"130\", null == a ? a : typeof a, \"\");\n }\n b = K(g, c, b, e);\n b.elementType = a;\n b.type = d;\n b.expirationTime = f;\n return b;\n}\n\nfunction Ze(a, b, c, d) {\n a = K(7, a, d, b);\n a.expirationTime = c;\n return a;\n}\n\nfunction $e(a, b, c, d) {\n a = K(8, a, d, b);\n b = 0 === (b & 1) ? Yb : bc;\n a.elementType = b;\n a.type = b;\n a.expirationTime = c;\n return a;\n}\n\nfunction af(a, b, c) {\n a = K(6, a, null, b);\n a.expirationTime = c;\n return a;\n}\n\nfunction bf(a, b, c) {\n b = K(4, null !== a.children ? a.children : [], a.key, b);\n b.expirationTime = c;\n b.stateNode = {\n containerInfo: a.containerInfo,\n pendingChildren: null,\n implementation: a.implementation\n };\n return b;\n}\n\nfunction cf(a, b) {\n a.didError = !1;\n var c = a.earliestPendingTime;\n 0 === c ? a.earliestPendingTime = a.latestPendingTime = b : c < b ? a.earliestPendingTime = b : a.latestPendingTime > b && (a.latestPendingTime = b);\n df(b, a);\n}\n\nfunction ef(a, b) {\n a.didError = !1;\n if (0 === b) a.earliestPendingTime = 0, a.latestPendingTime = 0, a.earliestSuspendedTime = 0, a.latestSuspendedTime = 0, a.latestPingedTime = 0;else {\n b < a.latestPingedTime && (a.latestPingedTime = 0);\n var c = a.latestPendingTime;\n 0 !== c && (c > b ? a.earliestPendingTime = a.latestPendingTime = 0 : a.earliestPendingTime > b && (a.earliestPendingTime = a.latestPendingTime));\n c = a.earliestSuspendedTime;\n 0 === c ? cf(a, b) : b < a.latestSuspendedTime ? (a.earliestSuspendedTime = 0, a.latestSuspendedTime = 0, a.latestPingedTime = 0, cf(a, b)) : b > c && cf(a, b);\n }\n df(0, a);\n}\n\nfunction ff(a, b) {\n a.didError = !1;\n a.latestPingedTime >= b && (a.latestPingedTime = 0);\n var c = a.earliestPendingTime,\n d = a.latestPendingTime;\n c === b ? a.earliestPendingTime = d === b ? a.latestPendingTime = 0 : d : d === b && (a.latestPendingTime = c);\n c = a.earliestSuspendedTime;\n d = a.latestSuspendedTime;\n 0 === c ? a.earliestSuspendedTime = a.latestSuspendedTime = b : c < b ? a.earliestSuspendedTime = b : d > b && (a.latestSuspendedTime = b);\n df(b, a);\n}\n\nfunction gf(a, b) {\n var c = a.earliestPendingTime;\n a = a.earliestSuspendedTime;\n c > b && (b = c);\n a > b && (b = a);\n return b;\n}\n\nfunction df(a, b) {\n var c = b.earliestSuspendedTime,\n d = b.latestSuspendedTime,\n e = b.earliestPendingTime,\n f = b.latestPingedTime;\n e = 0 !== e ? e : f;\n 0 === e && (0 === a || d < a) && (e = d);\n a = e;\n 0 !== a && c > a && (a = c);\n b.nextExpirationTimeToWorkOn = e;\n b.expirationTime = a;\n}\n\nfunction L(a, b) {\n if (a && a.defaultProps) {\n b = n({}, b);\n a = a.defaultProps;\n\n for (var c in a) {\n void 0 === b[c] && (b[c] = a[c]);\n }\n }\n\n return b;\n}\n\nfunction hf(a) {\n var b = a._result;\n\n switch (a._status) {\n case 1:\n return b;\n\n case 2:\n throw b;\n\n case 0:\n throw b;\n\n default:\n a._status = 0;\n b = a._ctor;\n b = b();\n b.then(function (b) {\n 0 === a._status && (b = b.default, a._status = 1, a._result = b);\n }, function (b) {\n 0 === a._status && (a._status = 2, a._result = b);\n });\n\n switch (a._status) {\n case 1:\n return a._result;\n\n case 2:\n throw a._result;\n }\n\n a._result = b;\n throw b;\n }\n}\n\nvar jf = new aa.Component().refs;\n\nfunction kf(a, b, c, d) {\n b = a.memoizedState;\n c = c(d, b);\n c = null === c || void 0 === c ? b : n({}, b, c);\n a.memoizedState = c;\n d = a.updateQueue;\n null !== d && 0 === a.expirationTime && (d.baseState = c);\n}\n\nvar tf = {\n isMounted: function isMounted(a) {\n return (a = a._reactInternalFiber) ? 2 === ed(a) : !1;\n },\n enqueueSetState: function enqueueSetState(a, b, c) {\n a = a._reactInternalFiber;\n var d = lf();\n d = mf(d, a);\n var e = nf(d);\n e.payload = b;\n void 0 !== c && null !== c && (e.callback = c);\n of();\n pf(a, e);\n qf(a, d);\n },\n enqueueReplaceState: function enqueueReplaceState(a, b, c) {\n a = a._reactInternalFiber;\n var d = lf();\n d = mf(d, a);\n var e = nf(d);\n e.tag = rf;\n e.payload = b;\n void 0 !== c && null !== c && (e.callback = c);\n of();\n pf(a, e);\n qf(a, d);\n },\n enqueueForceUpdate: function enqueueForceUpdate(a, b) {\n a = a._reactInternalFiber;\n var c = lf();\n c = mf(c, a);\n var d = nf(c);\n d.tag = sf;\n void 0 !== b && null !== b && (d.callback = b);\n of();\n pf(a, d);\n qf(a, c);\n }\n};\n\nfunction uf(a, b, c, d, e, f, g) {\n a = a.stateNode;\n return \"function\" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f, g) : b.prototype && b.prototype.isPureReactComponent ? !dd(c, d) || !dd(e, f) : !0;\n}\n\nfunction vf(a, b, c) {\n var d = !1,\n e = He;\n var f = b.contextType;\n \"object\" === typeof f && null !== f ? f = M(f) : (e = J(b) ? Ie : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Je(a, e) : He);\n b = new b(c, f);\n a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;\n b.updater = tf;\n a.stateNode = b;\n b._reactInternalFiber = a;\n d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f);\n return b;\n}\n\nfunction wf(a, b, c, d) {\n a = b.state;\n \"function\" === typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d);\n \"function\" === typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d);\n b.state !== a && tf.enqueueReplaceState(b, b.state, null);\n}\n\nfunction xf(a, b, c, d) {\n var e = a.stateNode;\n e.props = c;\n e.state = a.memoizedState;\n e.refs = jf;\n var f = b.contextType;\n \"object\" === typeof f && null !== f ? e.context = M(f) : (f = J(b) ? Ie : H.current, e.context = Je(a, f));\n f = a.updateQueue;\n null !== f && (yf(a, f, c, e, d), e.state = a.memoizedState);\n f = b.getDerivedStateFromProps;\n \"function\" === typeof f && (kf(a, b, f, c), e.state = a.memoizedState);\n \"function\" === typeof b.getDerivedStateFromProps || \"function\" === typeof e.getSnapshotBeforeUpdate || \"function\" !== typeof e.UNSAFE_componentWillMount && \"function\" !== typeof e.componentWillMount || (b = e.state, \"function\" === typeof e.componentWillMount && e.componentWillMount(), \"function\" === typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), b !== e.state && tf.enqueueReplaceState(e, e.state, null), f = a.updateQueue, null !== f && (yf(a, f, c, e, d), e.state = a.memoizedState));\n \"function\" === typeof e.componentDidMount && (a.effectTag |= 4);\n}\n\nvar zf = Array.isArray;\n\nfunction Af(a, b, c) {\n a = c.ref;\n\n if (null !== a && \"function\" !== typeof a && \"object\" !== typeof a) {\n if (c._owner) {\n c = c._owner;\n var d = void 0;\n c && (1 !== c.tag ? x(\"309\") : void 0, d = c.stateNode);\n d ? void 0 : x(\"147\", a);\n var e = \"\" + a;\n if (null !== b && null !== b.ref && \"function\" === typeof b.ref && b.ref._stringRef === e) return b.ref;\n\n b = function b(a) {\n var b = d.refs;\n b === jf && (b = d.refs = {});\n null === a ? delete b[e] : b[e] = a;\n };\n\n b._stringRef = e;\n return b;\n }\n\n \"string\" !== typeof a ? x(\"284\") : void 0;\n c._owner ? void 0 : x(\"290\", a);\n }\n\n return a;\n}\n\nfunction Bf(a, b) {\n \"textarea\" !== a.type && x(\"31\", \"[object Object]\" === Object.prototype.toString.call(b) ? \"object with keys {\" + Object.keys(b).join(\", \") + \"}\" : b, \"\");\n}\n\nfunction Cf(a) {\n function b(b, c) {\n if (a) {\n var d = b.lastEffect;\n null !== d ? (d.nextEffect = c, b.lastEffect = c) : b.firstEffect = b.lastEffect = c;\n c.nextEffect = null;\n c.effectTag = 8;\n }\n }\n\n function c(c, d) {\n if (!a) return null;\n\n for (; null !== d;) {\n b(c, d), d = d.sibling;\n }\n\n return null;\n }\n\n function d(a, b) {\n for (a = new Map(); null !== b;) {\n null !== b.key ? a.set(b.key, b) : a.set(b.index, b), b = b.sibling;\n }\n\n return a;\n }\n\n function e(a, b, c) {\n a = Xe(a, b, c);\n a.index = 0;\n a.sibling = null;\n return a;\n }\n\n function f(b, c, d) {\n b.index = d;\n if (!a) return c;\n d = b.alternate;\n if (null !== d) return d = d.index, d < c ? (b.effectTag = 2, c) : d;\n b.effectTag = 2;\n return c;\n }\n\n function g(b) {\n a && null === b.alternate && (b.effectTag = 2);\n return b;\n }\n\n function h(a, b, c, d) {\n if (null === b || 6 !== b.tag) return b = af(c, a.mode, d), b.return = a, b;\n b = e(b, c, d);\n b.return = a;\n return b;\n }\n\n function l(a, b, c, d) {\n if (null !== b && b.elementType === c.type) return d = e(b, c.props, d), d.ref = Af(a, b, c), d.return = a, d;\n d = Ye(c.type, c.key, c.props, null, a.mode, d);\n d.ref = Af(a, b, c);\n d.return = a;\n return d;\n }\n\n function k(a, b, c, d) {\n if (null === b || 4 !== b.tag || b.stateNode.containerInfo !== c.containerInfo || b.stateNode.implementation !== c.implementation) return b = bf(c, a.mode, d), b.return = a, b;\n b = e(b, c.children || [], d);\n b.return = a;\n return b;\n }\n\n function m(a, b, c, d, f) {\n if (null === b || 7 !== b.tag) return b = Ze(c, a.mode, d, f), b.return = a, b;\n b = e(b, c, d);\n b.return = a;\n return b;\n }\n\n function p(a, b, c) {\n if (\"string\" === typeof b || \"number\" === typeof b) return b = af(\"\" + b, a.mode, c), b.return = a, b;\n\n if (\"object\" === typeof b && null !== b) {\n switch (b.$$typeof) {\n case Vb:\n return c = Ye(b.type, b.key, b.props, null, a.mode, c), c.ref = Af(a, null, b), c.return = a, c;\n\n case Wb:\n return b = bf(b, a.mode, c), b.return = a, b;\n }\n\n if (zf(b) || hc(b)) return b = Ze(b, a.mode, c, null), b.return = a, b;\n Bf(a, b);\n }\n\n return null;\n }\n\n function t(a, b, c, d) {\n var e = null !== b ? b.key : null;\n if (\"string\" === typeof c || \"number\" === typeof c) return null !== e ? null : h(a, b, \"\" + c, d);\n\n if (\"object\" === typeof c && null !== c) {\n switch (c.$$typeof) {\n case Vb:\n return c.key === e ? c.type === Xb ? m(a, b, c.props.children, d, e) : l(a, b, c, d) : null;\n\n case Wb:\n return c.key === e ? k(a, b, c, d) : null;\n }\n\n if (zf(c) || hc(c)) return null !== e ? null : m(a, b, c, d, null);\n Bf(a, c);\n }\n\n return null;\n }\n\n function A(a, b, c, d, e) {\n if (\"string\" === typeof d || \"number\" === typeof d) return a = a.get(c) || null, h(b, a, \"\" + d, e);\n\n if (\"object\" === typeof d && null !== d) {\n switch (d.$$typeof) {\n case Vb:\n return a = a.get(null === d.key ? c : d.key) || null, d.type === Xb ? m(b, a, d.props.children, e, d.key) : l(b, a, d, e);\n\n case Wb:\n return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);\n }\n\n if (zf(d) || hc(d)) return a = a.get(c) || null, m(b, a, d, e, null);\n Bf(b, d);\n }\n\n return null;\n }\n\n function v(e, g, h, k) {\n for (var l = null, m = null, q = g, u = g = 0, B = null; null !== q && u < h.length; u++) {\n q.index > u ? (B = q, q = null) : B = q.sibling;\n var w = t(e, q, h[u], k);\n\n if (null === w) {\n null === q && (q = B);\n break;\n }\n\n a && q && null === w.alternate && b(e, q);\n g = f(w, g, u);\n null === m ? l = w : m.sibling = w;\n m = w;\n q = B;\n }\n\n if (u === h.length) return c(e, q), l;\n\n if (null === q) {\n for (; u < h.length; u++) {\n if (q = p(e, h[u], k)) g = f(q, g, u), null === m ? l = q : m.sibling = q, m = q;\n }\n\n return l;\n }\n\n for (q = d(e, q); u < h.length; u++) {\n if (B = A(q, e, u, h[u], k)) a && null !== B.alternate && q.delete(null === B.key ? u : B.key), g = f(B, g, u), null === m ? l = B : m.sibling = B, m = B;\n }\n\n a && q.forEach(function (a) {\n return b(e, a);\n });\n return l;\n }\n\n function R(e, g, h, k) {\n var l = hc(h);\n \"function\" !== typeof l ? x(\"150\") : void 0;\n h = l.call(h);\n null == h ? x(\"151\") : void 0;\n\n for (var m = l = null, q = g, u = g = 0, B = null, w = h.next(); null !== q && !w.done; u++, w = h.next()) {\n q.index > u ? (B = q, q = null) : B = q.sibling;\n var v = t(e, q, w.value, k);\n\n if (null === v) {\n q || (q = B);\n break;\n }\n\n a && q && null === v.alternate && b(e, q);\n g = f(v, g, u);\n null === m ? l = v : m.sibling = v;\n m = v;\n q = B;\n }\n\n if (w.done) return c(e, q), l;\n\n if (null === q) {\n for (; !w.done; u++, w = h.next()) {\n w = p(e, w.value, k), null !== w && (g = f(w, g, u), null === m ? l = w : m.sibling = w, m = w);\n }\n\n return l;\n }\n\n for (q = d(e, q); !w.done; u++, w = h.next()) {\n w = A(q, e, u, w.value, k), null !== w && (a && null !== w.alternate && q.delete(null === w.key ? u : w.key), g = f(w, g, u), null === m ? l = w : m.sibling = w, m = w);\n }\n\n a && q.forEach(function (a) {\n return b(e, a);\n });\n return l;\n }\n\n return function (a, d, f, h) {\n var k = \"object\" === typeof f && null !== f && f.type === Xb && null === f.key;\n k && (f = f.props.children);\n var l = \"object\" === typeof f && null !== f;\n if (l) switch (f.$$typeof) {\n case Vb:\n a: {\n l = f.key;\n\n for (k = d; null !== k;) {\n if (k.key === l) {\n if (7 === k.tag ? f.type === Xb : k.elementType === f.type) {\n c(a, k.sibling);\n d = e(k, f.type === Xb ? f.props.children : f.props, h);\n d.ref = Af(a, k, f);\n d.return = a;\n a = d;\n break a;\n } else {\n c(a, k);\n break;\n }\n } else b(a, k);\n k = k.sibling;\n }\n\n f.type === Xb ? (d = Ze(f.props.children, a.mode, h, f.key), d.return = a, a = d) : (h = Ye(f.type, f.key, f.props, null, a.mode, h), h.ref = Af(a, d, f), h.return = a, a = h);\n }\n\n return g(a);\n\n case Wb:\n a: {\n for (k = f.key; null !== d;) {\n if (d.key === k) {\n if (4 === d.tag && d.stateNode.containerInfo === f.containerInfo && d.stateNode.implementation === f.implementation) {\n c(a, d.sibling);\n d = e(d, f.children || [], h);\n d.return = a;\n a = d;\n break a;\n } else {\n c(a, d);\n break;\n }\n } else b(a, d);\n d = d.sibling;\n }\n\n d = bf(f, a.mode, h);\n d.return = a;\n a = d;\n }\n\n return g(a);\n }\n if (\"string\" === typeof f || \"number\" === typeof f) return f = \"\" + f, null !== d && 6 === d.tag ? (c(a, d.sibling), d = e(d, f, h), d.return = a, a = d) : (c(a, d), d = af(f, a.mode, h), d.return = a, a = d), g(a);\n if (zf(f)) return v(a, d, f, h);\n if (hc(f)) return R(a, d, f, h);\n l && Bf(a, f);\n if (\"undefined\" === typeof f && !k) switch (a.tag) {\n case 1:\n case 0:\n h = a.type, x(\"152\", h.displayName || h.name || \"Component\");\n }\n return c(a, d);\n };\n}\n\nvar Df = Cf(!0),\n Ef = Cf(!1),\n Ff = {},\n N = {\n current: Ff\n},\n Gf = {\n current: Ff\n},\n Hf = {\n current: Ff\n};\n\nfunction If(a) {\n a === Ff ? x(\"174\") : void 0;\n return a;\n}\n\nfunction Jf(a, b) {\n G(Hf, b, a);\n G(Gf, a, a);\n G(N, Ff, a);\n var c = b.nodeType;\n\n switch (c) {\n case 9:\n case 11:\n b = (b = b.documentElement) ? b.namespaceURI : he(null, \"\");\n break;\n\n default:\n c = 8 === c ? b.parentNode : b, b = c.namespaceURI || null, c = c.tagName, b = he(b, c);\n }\n\n F(N, a);\n G(N, b, a);\n}\n\nfunction Kf(a) {\n F(N, a);\n F(Gf, a);\n F(Hf, a);\n}\n\nfunction Lf(a) {\n If(Hf.current);\n var b = If(N.current);\n var c = he(b, a.type);\n b !== c && (G(Gf, a, a), G(N, c, a));\n}\n\nfunction Mf(a) {\n Gf.current === a && (F(N, a), F(Gf, a));\n}\n\nvar Nf = 0,\n Of = 2,\n Pf = 4,\n Qf = 8,\n Rf = 16,\n Sf = 32,\n Tf = 64,\n Uf = 128,\n Vf = Tb.ReactCurrentDispatcher,\n Wf = 0,\n Xf = null,\n O = null,\n P = null,\n Yf = null,\n Q = null,\n Zf = null,\n $f = 0,\n ag = null,\n bg = 0,\n cg = !1,\n dg = null,\n eg = 0;\n\nfunction fg() {\n x(\"321\");\n}\n\nfunction gg(a, b) {\n if (null === b) return !1;\n\n for (var c = 0; c < b.length && c < a.length; c++) {\n if (!bd(a[c], b[c])) return !1;\n }\n\n return !0;\n}\n\nfunction hg(a, b, c, d, e, f) {\n Wf = f;\n Xf = b;\n P = null !== a ? a.memoizedState : null;\n Vf.current = null === P ? ig : jg;\n b = c(d, e);\n\n if (cg) {\n do {\n cg = !1, eg += 1, P = null !== a ? a.memoizedState : null, Zf = Yf, ag = Q = O = null, Vf.current = jg, b = c(d, e);\n } while (cg);\n\n dg = null;\n eg = 0;\n }\n\n Vf.current = kg;\n a = Xf;\n a.memoizedState = Yf;\n a.expirationTime = $f;\n a.updateQueue = ag;\n a.effectTag |= bg;\n a = null !== O && null !== O.next;\n Wf = 0;\n Zf = Q = Yf = P = O = Xf = null;\n $f = 0;\n ag = null;\n bg = 0;\n a ? x(\"300\") : void 0;\n return b;\n}\n\nfunction lg() {\n Vf.current = kg;\n Wf = 0;\n Zf = Q = Yf = P = O = Xf = null;\n $f = 0;\n ag = null;\n bg = 0;\n cg = !1;\n dg = null;\n eg = 0;\n}\n\nfunction mg() {\n var a = {\n memoizedState: null,\n baseState: null,\n queue: null,\n baseUpdate: null,\n next: null\n };\n null === Q ? Yf = Q = a : Q = Q.next = a;\n return Q;\n}\n\nfunction ng() {\n if (null !== Zf) Q = Zf, Zf = Q.next, O = P, P = null !== O ? O.next : null;else {\n null === P ? x(\"310\") : void 0;\n O = P;\n var a = {\n memoizedState: O.memoizedState,\n baseState: O.baseState,\n queue: O.queue,\n baseUpdate: O.baseUpdate,\n next: null\n };\n Q = null === Q ? Yf = a : Q.next = a;\n P = O.next;\n }\n return Q;\n}\n\nfunction og(a, b) {\n return \"function\" === typeof b ? b(a) : b;\n}\n\nfunction pg(a) {\n var b = ng(),\n c = b.queue;\n null === c ? x(\"311\") : void 0;\n c.lastRenderedReducer = a;\n\n if (0 < eg) {\n var d = c.dispatch;\n\n if (null !== dg) {\n var e = dg.get(c);\n\n if (void 0 !== e) {\n dg.delete(c);\n var f = b.memoizedState;\n\n do {\n f = a(f, e.action), e = e.next;\n } while (null !== e);\n\n bd(f, b.memoizedState) || (qg = !0);\n b.memoizedState = f;\n b.baseUpdate === c.last && (b.baseState = f);\n c.lastRenderedState = f;\n return [f, d];\n }\n }\n\n return [b.memoizedState, d];\n }\n\n d = c.last;\n var g = b.baseUpdate;\n f = b.baseState;\n null !== g ? (null !== d && (d.next = null), d = g.next) : d = null !== d ? d.next : null;\n\n if (null !== d) {\n var h = e = null,\n l = d,\n k = !1;\n\n do {\n var m = l.expirationTime;\n m < Wf ? (k || (k = !0, h = g, e = f), m > $f && ($f = m)) : f = l.eagerReducer === a ? l.eagerState : a(f, l.action);\n g = l;\n l = l.next;\n } while (null !== l && l !== d);\n\n k || (h = g, e = f);\n bd(f, b.memoizedState) || (qg = !0);\n b.memoizedState = f;\n b.baseUpdate = h;\n b.baseState = e;\n c.lastRenderedState = f;\n }\n\n return [b.memoizedState, c.dispatch];\n}\n\nfunction rg(a, b, c, d) {\n a = {\n tag: a,\n create: b,\n destroy: c,\n deps: d,\n next: null\n };\n null === ag ? (ag = {\n lastEffect: null\n }, ag.lastEffect = a.next = a) : (b = ag.lastEffect, null === b ? ag.lastEffect = a.next = a : (c = b.next, b.next = a, a.next = c, ag.lastEffect = a));\n return a;\n}\n\nfunction sg(a, b, c, d) {\n var e = mg();\n bg |= a;\n e.memoizedState = rg(b, c, void 0, void 0 === d ? null : d);\n}\n\nfunction tg(a, b, c, d) {\n var e = ng();\n d = void 0 === d ? null : d;\n var f = void 0;\n\n if (null !== O) {\n var g = O.memoizedState;\n f = g.destroy;\n\n if (null !== d && gg(d, g.deps)) {\n rg(Nf, c, f, d);\n return;\n }\n }\n\n bg |= a;\n e.memoizedState = rg(b, c, f, d);\n}\n\nfunction ug(a, b) {\n if (\"function\" === typeof b) return a = a(), b(a), function () {\n b(null);\n };\n if (null !== b && void 0 !== b) return a = a(), b.current = a, function () {\n b.current = null;\n };\n}\n\nfunction vg() {}\n\nfunction wg(a, b, c) {\n 25 > eg ? void 0 : x(\"301\");\n var d = a.alternate;\n if (a === Xf || null !== d && d === Xf) {\n if (cg = !0, a = {\n expirationTime: Wf,\n action: c,\n eagerReducer: null,\n eagerState: null,\n next: null\n }, null === dg && (dg = new Map()), c = dg.get(b), void 0 === c) dg.set(b, a);else {\n for (b = c; null !== b.next;) {\n b = b.next;\n }\n\n b.next = a;\n }\n } else {\n of();\n var e = lf();\n e = mf(e, a);\n var f = {\n expirationTime: e,\n action: c,\n eagerReducer: null,\n eagerState: null,\n next: null\n },\n g = b.last;\n if (null === g) f.next = f;else {\n var h = g.next;\n null !== h && (f.next = h);\n g.next = f;\n }\n b.last = f;\n if (0 === a.expirationTime && (null === d || 0 === d.expirationTime) && (d = b.lastRenderedReducer, null !== d)) try {\n var l = b.lastRenderedState,\n k = d(l, c);\n f.eagerReducer = d;\n f.eagerState = k;\n if (bd(k, l)) return;\n } catch (m) {} finally {}\n qf(a, e);\n }\n}\n\nvar kg = {\n readContext: M,\n useCallback: fg,\n useContext: fg,\n useEffect: fg,\n useImperativeHandle: fg,\n useLayoutEffect: fg,\n useMemo: fg,\n useReducer: fg,\n useRef: fg,\n useState: fg,\n useDebugValue: fg\n},\n ig = {\n readContext: M,\n useCallback: function useCallback(a, b) {\n mg().memoizedState = [a, void 0 === b ? null : b];\n return a;\n },\n useContext: M,\n useEffect: function useEffect(a, b) {\n return sg(516, Uf | Tf, a, b);\n },\n useImperativeHandle: function useImperativeHandle(a, b, c) {\n c = null !== c && void 0 !== c ? c.concat([a]) : null;\n return sg(4, Pf | Sf, ug.bind(null, b, a), c);\n },\n useLayoutEffect: function useLayoutEffect(a, b) {\n return sg(4, Pf | Sf, a, b);\n },\n useMemo: function useMemo(a, b) {\n var c = mg();\n b = void 0 === b ? null : b;\n a = a();\n c.memoizedState = [a, b];\n return a;\n },\n useReducer: function useReducer(a, b, c) {\n var d = mg();\n b = void 0 !== c ? c(b) : b;\n d.memoizedState = d.baseState = b;\n a = d.queue = {\n last: null,\n dispatch: null,\n lastRenderedReducer: a,\n lastRenderedState: b\n };\n a = a.dispatch = wg.bind(null, Xf, a);\n return [d.memoizedState, a];\n },\n useRef: function useRef(a) {\n var b = mg();\n a = {\n current: a\n };\n return b.memoizedState = a;\n },\n useState: function useState(a) {\n var b = mg();\n \"function\" === typeof a && (a = a());\n b.memoizedState = b.baseState = a;\n a = b.queue = {\n last: null,\n dispatch: null,\n lastRenderedReducer: og,\n lastRenderedState: a\n };\n a = a.dispatch = wg.bind(null, Xf, a);\n return [b.memoizedState, a];\n },\n useDebugValue: vg\n},\n jg = {\n readContext: M,\n useCallback: function useCallback(a, b) {\n var c = ng();\n b = void 0 === b ? null : b;\n var d = c.memoizedState;\n if (null !== d && null !== b && gg(b, d[1])) return d[0];\n c.memoizedState = [a, b];\n return a;\n },\n useContext: M,\n useEffect: function useEffect(a, b) {\n return tg(516, Uf | Tf, a, b);\n },\n useImperativeHandle: function useImperativeHandle(a, b, c) {\n c = null !== c && void 0 !== c ? c.concat([a]) : null;\n return tg(4, Pf | Sf, ug.bind(null, b, a), c);\n },\n useLayoutEffect: function useLayoutEffect(a, b) {\n return tg(4, Pf | Sf, a, b);\n },\n useMemo: function useMemo(a, b) {\n var c = ng();\n b = void 0 === b ? null : b;\n var d = c.memoizedState;\n if (null !== d && null !== b && gg(b, d[1])) return d[0];\n a = a();\n c.memoizedState = [a, b];\n return a;\n },\n useReducer: pg,\n useRef: function useRef() {\n return ng().memoizedState;\n },\n useState: function useState(a) {\n return pg(og, a);\n },\n useDebugValue: vg\n},\n xg = null,\n yg = null,\n zg = !1;\n\nfunction Ag(a, b) {\n var c = K(5, null, null, 0);\n c.elementType = \"DELETED\";\n c.type = \"DELETED\";\n c.stateNode = b;\n c.return = a;\n c.effectTag = 8;\n null !== a.lastEffect ? (a.lastEffect.nextEffect = c, a.lastEffect = c) : a.firstEffect = a.lastEffect = c;\n}\n\nfunction Bg(a, b) {\n switch (a.tag) {\n case 5:\n var c = a.type;\n b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b;\n return null !== b ? (a.stateNode = b, !0) : !1;\n\n case 6:\n return b = \"\" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, !0) : !1;\n\n case 13:\n return !1;\n\n default:\n return !1;\n }\n}\n\nfunction Cg(a) {\n if (zg) {\n var b = yg;\n\n if (b) {\n var c = b;\n\n if (!Bg(a, b)) {\n b = De(c);\n\n if (!b || !Bg(a, b)) {\n a.effectTag |= 2;\n zg = !1;\n xg = a;\n return;\n }\n\n Ag(xg, c);\n }\n\n xg = a;\n yg = Ee(b);\n } else a.effectTag |= 2, zg = !1, xg = a;\n }\n}\n\nfunction Dg(a) {\n for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 18 !== a.tag;) {\n a = a.return;\n }\n\n xg = a;\n}\n\nfunction Eg(a) {\n if (a !== xg) return !1;\n if (!zg) return Dg(a), zg = !0, !1;\n var b = a.type;\n if (5 !== a.tag || \"head\" !== b && \"body\" !== b && !xe(b, a.memoizedProps)) for (b = yg; b;) {\n Ag(a, b), b = De(b);\n }\n Dg(a);\n yg = xg ? De(a.stateNode) : null;\n return !0;\n}\n\nfunction Fg() {\n yg = xg = null;\n zg = !1;\n}\n\nvar Gg = Tb.ReactCurrentOwner,\n qg = !1;\n\nfunction S(a, b, c, d) {\n b.child = null === a ? Ef(b, null, c, d) : Df(b, a.child, c, d);\n}\n\nfunction Hg(a, b, c, d, e) {\n c = c.render;\n var f = b.ref;\n Ig(b, e);\n d = hg(a, b, c, d, f, e);\n if (null !== a && !qg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, a.expirationTime <= e && (a.expirationTime = 0), Jg(a, b, e);\n b.effectTag |= 1;\n S(a, b, d, e);\n return b.child;\n}\n\nfunction Kg(a, b, c, d, e, f) {\n if (null === a) {\n var g = c.type;\n if (\"function\" === typeof g && !Ve(g) && void 0 === g.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, b.type = g, Lg(a, b, g, d, e, f);\n a = Ye(c.type, null, d, null, b.mode, f);\n a.ref = b.ref;\n a.return = b;\n return b.child = a;\n }\n\n g = a.child;\n if (e < f && (e = g.memoizedProps, c = c.compare, c = null !== c ? c : dd, c(e, d) && a.ref === b.ref)) return Jg(a, b, f);\n b.effectTag |= 1;\n a = Xe(g, d, f);\n a.ref = b.ref;\n a.return = b;\n return b.child = a;\n}\n\nfunction Lg(a, b, c, d, e, f) {\n return null !== a && dd(a.memoizedProps, d) && a.ref === b.ref && (qg = !1, e < f) ? Jg(a, b, f) : Mg(a, b, c, d, f);\n}\n\nfunction Ng(a, b) {\n var c = b.ref;\n if (null === a && null !== c || null !== a && a.ref !== c) b.effectTag |= 128;\n}\n\nfunction Mg(a, b, c, d, e) {\n var f = J(c) ? Ie : H.current;\n f = Je(b, f);\n Ig(b, e);\n c = hg(a, b, c, d, f, e);\n if (null !== a && !qg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, a.expirationTime <= e && (a.expirationTime = 0), Jg(a, b, e);\n b.effectTag |= 1;\n S(a, b, c, e);\n return b.child;\n}\n\nfunction Og(a, b, c, d, e) {\n if (J(c)) {\n var f = !0;\n Oe(b);\n } else f = !1;\n\n Ig(b, e);\n if (null === b.stateNode) null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2), vf(b, c, d, e), xf(b, c, d, e), d = !0;else if (null === a) {\n var g = b.stateNode,\n h = b.memoizedProps;\n g.props = h;\n var l = g.context,\n k = c.contextType;\n \"object\" === typeof k && null !== k ? k = M(k) : (k = J(c) ? Ie : H.current, k = Je(b, k));\n var m = c.getDerivedStateFromProps,\n p = \"function\" === typeof m || \"function\" === typeof g.getSnapshotBeforeUpdate;\n p || \"function\" !== typeof g.UNSAFE_componentWillReceiveProps && \"function\" !== typeof g.componentWillReceiveProps || (h !== d || l !== k) && wf(b, g, d, k);\n Pg = !1;\n var t = b.memoizedState;\n l = g.state = t;\n var A = b.updateQueue;\n null !== A && (yf(b, A, d, g, e), l = b.memoizedState);\n h !== d || t !== l || I.current || Pg ? (\"function\" === typeof m && (kf(b, c, m, d), l = b.memoizedState), (h = Pg || uf(b, c, h, d, t, l, k)) ? (p || \"function\" !== typeof g.UNSAFE_componentWillMount && \"function\" !== typeof g.componentWillMount || (\"function\" === typeof g.componentWillMount && g.componentWillMount(), \"function\" === typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), \"function\" === typeof g.componentDidMount && (b.effectTag |= 4)) : (\"function\" === typeof g.componentDidMount && (b.effectTag |= 4), b.memoizedProps = d, b.memoizedState = l), g.props = d, g.state = l, g.context = k, d = h) : (\"function\" === typeof g.componentDidMount && (b.effectTag |= 4), d = !1);\n } else g = b.stateNode, h = b.memoizedProps, g.props = b.type === b.elementType ? h : L(b.type, h), l = g.context, k = c.contextType, \"object\" === typeof k && null !== k ? k = M(k) : (k = J(c) ? Ie : H.current, k = Je(b, k)), m = c.getDerivedStateFromProps, (p = \"function\" === typeof m || \"function\" === typeof g.getSnapshotBeforeUpdate) || \"function\" !== typeof g.UNSAFE_componentWillReceiveProps && \"function\" !== typeof g.componentWillReceiveProps || (h !== d || l !== k) && wf(b, g, d, k), Pg = !1, l = b.memoizedState, t = g.state = l, A = b.updateQueue, null !== A && (yf(b, A, d, g, e), t = b.memoizedState), h !== d || l !== t || I.current || Pg ? (\"function\" === typeof m && (kf(b, c, m, d), t = b.memoizedState), (m = Pg || uf(b, c, h, d, l, t, k)) ? (p || \"function\" !== typeof g.UNSAFE_componentWillUpdate && \"function\" !== typeof g.componentWillUpdate || (\"function\" === typeof g.componentWillUpdate && g.componentWillUpdate(d, t, k), \"function\" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, t, k)), \"function\" === typeof g.componentDidUpdate && (b.effectTag |= 4), \"function\" === typeof g.getSnapshotBeforeUpdate && (b.effectTag |= 256)) : (\"function\" !== typeof g.componentDidUpdate || h === a.memoizedProps && l === a.memoizedState || (b.effectTag |= 4), \"function\" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && l === a.memoizedState || (b.effectTag |= 256), b.memoizedProps = d, b.memoizedState = t), g.props = d, g.state = t, g.context = k, d = m) : (\"function\" !== typeof g.componentDidUpdate || h === a.memoizedProps && l === a.memoizedState || (b.effectTag |= 4), \"function\" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && l === a.memoizedState || (b.effectTag |= 256), d = !1);\n return Qg(a, b, c, d, f, e);\n}\n\nfunction Qg(a, b, c, d, e, f) {\n Ng(a, b);\n var g = 0 !== (b.effectTag & 64);\n if (!d && !g) return e && Pe(b, c, !1), Jg(a, b, f);\n d = b.stateNode;\n Gg.current = b;\n var h = g && \"function\" !== typeof c.getDerivedStateFromError ? null : d.render();\n b.effectTag |= 1;\n null !== a && g ? (b.child = Df(b, a.child, null, f), b.child = Df(b, null, h, f)) : S(a, b, h, f);\n b.memoizedState = d.state;\n e && Pe(b, c, !0);\n return b.child;\n}\n\nfunction Rg(a) {\n var b = a.stateNode;\n b.pendingContext ? Me(a, b.pendingContext, b.pendingContext !== b.context) : b.context && Me(a, b.context, !1);\n Jf(a, b.containerInfo);\n}\n\nfunction Sg(a, b, c) {\n var d = b.mode,\n e = b.pendingProps,\n f = b.memoizedState;\n\n if (0 === (b.effectTag & 64)) {\n f = null;\n var g = !1;\n } else f = {\n timedOutAt: null !== f ? f.timedOutAt : 0\n }, g = !0, b.effectTag &= -65;\n\n if (null === a) {\n if (g) {\n var h = e.fallback;\n a = Ze(null, d, 0, null);\n 0 === (b.mode & 1) && (a.child = null !== b.memoizedState ? b.child.child : b.child);\n d = Ze(h, d, c, null);\n a.sibling = d;\n c = a;\n c.return = d.return = b;\n } else c = d = Ef(b, null, e.children, c);\n } else null !== a.memoizedState ? (d = a.child, h = d.sibling, g ? (c = e.fallback, e = Xe(d, d.pendingProps, 0), 0 === (b.mode & 1) && (g = null !== b.memoizedState ? b.child.child : b.child, g !== d.child && (e.child = g)), d = e.sibling = Xe(h, c, h.expirationTime), c = e, e.childExpirationTime = 0, c.return = d.return = b) : c = d = Df(b, d.child, e.children, c)) : (h = a.child, g ? (g = e.fallback, e = Ze(null, d, 0, null), e.child = h, 0 === (b.mode & 1) && (e.child = null !== b.memoizedState ? b.child.child : b.child), d = e.sibling = Ze(g, d, c, null), d.effectTag |= 2, c = e, e.childExpirationTime = 0, c.return = d.return = b) : d = c = Df(b, h, e.children, c)), b.stateNode = a.stateNode;\n b.memoizedState = f;\n b.child = c;\n return d;\n}\n\nfunction Jg(a, b, c) {\n null !== a && (b.contextDependencies = a.contextDependencies);\n if (b.childExpirationTime < c) return null;\n null !== a && b.child !== a.child ? x(\"153\") : void 0;\n\n if (null !== b.child) {\n a = b.child;\n c = Xe(a, a.pendingProps, a.expirationTime);\n b.child = c;\n\n for (c.return = b; null !== a.sibling;) {\n a = a.sibling, c = c.sibling = Xe(a, a.pendingProps, a.expirationTime), c.return = b;\n }\n\n c.sibling = null;\n }\n\n return b.child;\n}\n\nfunction Tg(a, b, c) {\n var d = b.expirationTime;\n if (null !== a) {\n if (a.memoizedProps !== b.pendingProps || I.current) qg = !0;else {\n if (d < c) {\n qg = !1;\n\n switch (b.tag) {\n case 3:\n Rg(b);\n Fg();\n break;\n\n case 5:\n Lf(b);\n break;\n\n case 1:\n J(b.type) && Oe(b);\n break;\n\n case 4:\n Jf(b, b.stateNode.containerInfo);\n break;\n\n case 10:\n Ug(b, b.memoizedProps.value);\n break;\n\n case 13:\n if (null !== b.memoizedState) {\n d = b.child.childExpirationTime;\n if (0 !== d && d >= c) return Sg(a, b, c);\n b = Jg(a, b, c);\n return null !== b ? b.sibling : null;\n }\n\n }\n\n return Jg(a, b, c);\n }\n }\n } else qg = !1;\n b.expirationTime = 0;\n\n switch (b.tag) {\n case 2:\n d = b.elementType;\n null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2);\n a = b.pendingProps;\n var e = Je(b, H.current);\n Ig(b, c);\n e = hg(null, b, d, a, e, c);\n b.effectTag |= 1;\n\n if (\"object\" === typeof e && null !== e && \"function\" === typeof e.render && void 0 === e.$$typeof) {\n b.tag = 1;\n lg();\n\n if (J(d)) {\n var f = !0;\n Oe(b);\n } else f = !1;\n\n b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null;\n var g = d.getDerivedStateFromProps;\n \"function\" === typeof g && kf(b, d, g, a);\n e.updater = tf;\n b.stateNode = e;\n e._reactInternalFiber = b;\n xf(b, d, a, c);\n b = Qg(null, b, d, !0, f, c);\n } else b.tag = 0, S(null, b, e, c), b = b.child;\n\n return b;\n\n case 16:\n e = b.elementType;\n null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2);\n f = b.pendingProps;\n a = hf(e);\n b.type = a;\n e = b.tag = We(a);\n f = L(a, f);\n g = void 0;\n\n switch (e) {\n case 0:\n g = Mg(null, b, a, f, c);\n break;\n\n case 1:\n g = Og(null, b, a, f, c);\n break;\n\n case 11:\n g = Hg(null, b, a, f, c);\n break;\n\n case 14:\n g = Kg(null, b, a, L(a.type, f), d, c);\n break;\n\n default:\n x(\"306\", a, \"\");\n }\n\n return g;\n\n case 0:\n return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : L(d, e), Mg(a, b, d, e, c);\n\n case 1:\n return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : L(d, e), Og(a, b, d, e, c);\n\n case 3:\n Rg(b);\n d = b.updateQueue;\n null === d ? x(\"282\") : void 0;\n e = b.memoizedState;\n e = null !== e ? e.element : null;\n yf(b, d, b.pendingProps, null, c);\n d = b.memoizedState.element;\n if (d === e) Fg(), b = Jg(a, b, c);else {\n e = b.stateNode;\n if (e = (null === a || null === a.child) && e.hydrate) yg = Ee(b.stateNode.containerInfo), xg = b, e = zg = !0;\n e ? (b.effectTag |= 2, b.child = Ef(b, null, d, c)) : (S(a, b, d, c), Fg());\n b = b.child;\n }\n return b;\n\n case 5:\n return Lf(b), null === a && Cg(b), d = b.type, e = b.pendingProps, f = null !== a ? a.memoizedProps : null, g = e.children, xe(d, e) ? g = null : null !== f && xe(d, f) && (b.effectTag |= 16), Ng(a, b), 1 !== c && b.mode & 1 && e.hidden ? (b.expirationTime = b.childExpirationTime = 1, b = null) : (S(a, b, g, c), b = b.child), b;\n\n case 6:\n return null === a && Cg(b), null;\n\n case 13:\n return Sg(a, b, c);\n\n case 4:\n return Jf(b, b.stateNode.containerInfo), d = b.pendingProps, null === a ? b.child = Df(b, null, d, c) : S(a, b, d, c), b.child;\n\n case 11:\n return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : L(d, e), Hg(a, b, d, e, c);\n\n case 7:\n return S(a, b, b.pendingProps, c), b.child;\n\n case 8:\n return S(a, b, b.pendingProps.children, c), b.child;\n\n case 12:\n return S(a, b, b.pendingProps.children, c), b.child;\n\n case 10:\n a: {\n d = b.type._context;\n e = b.pendingProps;\n g = b.memoizedProps;\n f = e.value;\n Ug(b, f);\n\n if (null !== g) {\n var h = g.value;\n f = bd(h, f) ? 0 : (\"function\" === typeof d._calculateChangedBits ? d._calculateChangedBits(h, f) : 1073741823) | 0;\n\n if (0 === f) {\n if (g.children === e.children && !I.current) {\n b = Jg(a, b, c);\n break a;\n }\n } else for (h = b.child, null !== h && (h.return = b); null !== h;) {\n var l = h.contextDependencies;\n\n if (null !== l) {\n g = h.child;\n\n for (var k = l.first; null !== k;) {\n if (k.context === d && 0 !== (k.observedBits & f)) {\n 1 === h.tag && (k = nf(c), k.tag = sf, pf(h, k));\n h.expirationTime < c && (h.expirationTime = c);\n k = h.alternate;\n null !== k && k.expirationTime < c && (k.expirationTime = c);\n k = c;\n\n for (var m = h.return; null !== m;) {\n var p = m.alternate;\n if (m.childExpirationTime < k) m.childExpirationTime = k, null !== p && p.childExpirationTime < k && (p.childExpirationTime = k);else if (null !== p && p.childExpirationTime < k) p.childExpirationTime = k;else break;\n m = m.return;\n }\n\n l.expirationTime < c && (l.expirationTime = c);\n break;\n }\n\n k = k.next;\n }\n } else g = 10 === h.tag ? h.type === b.type ? null : h.child : h.child;\n\n if (null !== g) g.return = h;else for (g = h; null !== g;) {\n if (g === b) {\n g = null;\n break;\n }\n\n h = g.sibling;\n\n if (null !== h) {\n h.return = g.return;\n g = h;\n break;\n }\n\n g = g.return;\n }\n h = g;\n }\n }\n\n S(a, b, e.children, c);\n b = b.child;\n }\n\n return b;\n\n case 9:\n return e = b.type, f = b.pendingProps, d = f.children, Ig(b, c), e = M(e, f.unstable_observedBits), d = d(e), b.effectTag |= 1, S(a, b, d, c), b.child;\n\n case 14:\n return e = b.type, f = L(e, b.pendingProps), f = L(e.type, f), Kg(a, b, e, f, d, c);\n\n case 15:\n return Lg(a, b, b.type, b.pendingProps, d, c);\n\n case 17:\n return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : L(d, e), null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2), b.tag = 1, J(d) ? (a = !0, Oe(b)) : a = !1, Ig(b, c), vf(b, d, e, c), xf(b, d, e, c), Qg(null, b, d, !0, a, c);\n }\n\n x(\"156\");\n}\n\nvar Vg = {\n current: null\n},\n Wg = null,\n Xg = null,\n Yg = null;\n\nfunction Ug(a, b) {\n var c = a.type._context;\n G(Vg, c._currentValue, a);\n c._currentValue = b;\n}\n\nfunction Zg(a) {\n var b = Vg.current;\n F(Vg, a);\n a.type._context._currentValue = b;\n}\n\nfunction Ig(a, b) {\n Wg = a;\n Yg = Xg = null;\n var c = a.contextDependencies;\n null !== c && c.expirationTime >= b && (qg = !0);\n a.contextDependencies = null;\n}\n\nfunction M(a, b) {\n if (Yg !== a && !1 !== b && 0 !== b) {\n if (\"number\" !== typeof b || 1073741823 === b) Yg = a, b = 1073741823;\n b = {\n context: a,\n observedBits: b,\n next: null\n };\n null === Xg ? (null === Wg ? x(\"308\") : void 0, Xg = b, Wg.contextDependencies = {\n first: b,\n expirationTime: 0\n }) : Xg = Xg.next = b;\n }\n\n return a._currentValue;\n}\n\nvar $g = 0,\n rf = 1,\n sf = 2,\n ah = 3,\n Pg = !1;\n\nfunction bh(a) {\n return {\n baseState: a,\n firstUpdate: null,\n lastUpdate: null,\n firstCapturedUpdate: null,\n lastCapturedUpdate: null,\n firstEffect: null,\n lastEffect: null,\n firstCapturedEffect: null,\n lastCapturedEffect: null\n };\n}\n\nfunction ch(a) {\n return {\n baseState: a.baseState,\n firstUpdate: a.firstUpdate,\n lastUpdate: a.lastUpdate,\n firstCapturedUpdate: null,\n lastCapturedUpdate: null,\n firstEffect: null,\n lastEffect: null,\n firstCapturedEffect: null,\n lastCapturedEffect: null\n };\n}\n\nfunction nf(a) {\n return {\n expirationTime: a,\n tag: $g,\n payload: null,\n callback: null,\n next: null,\n nextEffect: null\n };\n}\n\nfunction dh(a, b) {\n null === a.lastUpdate ? a.firstUpdate = a.lastUpdate = b : (a.lastUpdate.next = b, a.lastUpdate = b);\n}\n\nfunction pf(a, b) {\n var c = a.alternate;\n\n if (null === c) {\n var d = a.updateQueue;\n var e = null;\n null === d && (d = a.updateQueue = bh(a.memoizedState));\n } else d = a.updateQueue, e = c.updateQueue, null === d ? null === e ? (d = a.updateQueue = bh(a.memoizedState), e = c.updateQueue = bh(c.memoizedState)) : d = a.updateQueue = ch(e) : null === e && (e = c.updateQueue = ch(d));\n\n null === e || d === e ? dh(d, b) : null === d.lastUpdate || null === e.lastUpdate ? (dh(d, b), dh(e, b)) : (dh(d, b), e.lastUpdate = b);\n}\n\nfunction eh(a, b) {\n var c = a.updateQueue;\n c = null === c ? a.updateQueue = bh(a.memoizedState) : fh(a, c);\n null === c.lastCapturedUpdate ? c.firstCapturedUpdate = c.lastCapturedUpdate = b : (c.lastCapturedUpdate.next = b, c.lastCapturedUpdate = b);\n}\n\nfunction fh(a, b) {\n var c = a.alternate;\n null !== c && b === c.updateQueue && (b = a.updateQueue = ch(b));\n return b;\n}\n\nfunction gh(a, b, c, d, e, f) {\n switch (c.tag) {\n case rf:\n return a = c.payload, \"function\" === typeof a ? a.call(f, d, e) : a;\n\n case ah:\n a.effectTag = a.effectTag & -2049 | 64;\n\n case $g:\n a = c.payload;\n e = \"function\" === typeof a ? a.call(f, d, e) : a;\n if (null === e || void 0 === e) break;\n return n({}, d, e);\n\n case sf:\n Pg = !0;\n }\n\n return d;\n}\n\nfunction yf(a, b, c, d, e) {\n Pg = !1;\n b = fh(a, b);\n\n for (var f = b.baseState, g = null, h = 0, l = b.firstUpdate, k = f; null !== l;) {\n var m = l.expirationTime;\n m < e ? (null === g && (g = l, f = k), h < m && (h = m)) : (k = gh(a, b, l, k, c, d), null !== l.callback && (a.effectTag |= 32, l.nextEffect = null, null === b.lastEffect ? b.firstEffect = b.lastEffect = l : (b.lastEffect.nextEffect = l, b.lastEffect = l)));\n l = l.next;\n }\n\n m = null;\n\n for (l = b.firstCapturedUpdate; null !== l;) {\n var p = l.expirationTime;\n p < e ? (null === m && (m = l, null === g && (f = k)), h < p && (h = p)) : (k = gh(a, b, l, k, c, d), null !== l.callback && (a.effectTag |= 32, l.nextEffect = null, null === b.lastCapturedEffect ? b.firstCapturedEffect = b.lastCapturedEffect = l : (b.lastCapturedEffect.nextEffect = l, b.lastCapturedEffect = l)));\n l = l.next;\n }\n\n null === g && (b.lastUpdate = null);\n null === m ? b.lastCapturedUpdate = null : a.effectTag |= 32;\n null === g && null === m && (f = k);\n b.baseState = f;\n b.firstUpdate = g;\n b.firstCapturedUpdate = m;\n a.expirationTime = h;\n a.memoizedState = k;\n}\n\nfunction hh(a, b, c) {\n null !== b.firstCapturedUpdate && (null !== b.lastUpdate && (b.lastUpdate.next = b.firstCapturedUpdate, b.lastUpdate = b.lastCapturedUpdate), b.firstCapturedUpdate = b.lastCapturedUpdate = null);\n ih(b.firstEffect, c);\n b.firstEffect = b.lastEffect = null;\n ih(b.firstCapturedEffect, c);\n b.firstCapturedEffect = b.lastCapturedEffect = null;\n}\n\nfunction ih(a, b) {\n for (; null !== a;) {\n var c = a.callback;\n\n if (null !== c) {\n a.callback = null;\n var d = b;\n \"function\" !== typeof c ? x(\"191\", c) : void 0;\n c.call(d);\n }\n\n a = a.nextEffect;\n }\n}\n\nfunction jh(a, b) {\n return {\n value: a,\n source: b,\n stack: jc(b)\n };\n}\n\nfunction kh(a) {\n a.effectTag |= 4;\n}\n\nvar lh = void 0,\n mh = void 0,\n nh = void 0,\n oh = void 0;\n\nlh = function lh(a, b) {\n for (var c = b.child; null !== c;) {\n if (5 === c.tag || 6 === c.tag) a.appendChild(c.stateNode);else if (4 !== c.tag && null !== c.child) {\n c.child.return = c;\n c = c.child;\n continue;\n }\n if (c === b) break;\n\n for (; null === c.sibling;) {\n if (null === c.return || c.return === b) return;\n c = c.return;\n }\n\n c.sibling.return = c.return;\n c = c.sibling;\n }\n};\n\nmh = function mh() {};\n\nnh = function nh(a, b, c, d, e) {\n var f = a.memoizedProps;\n\n if (f !== d) {\n var g = b.stateNode;\n If(N.current);\n a = null;\n\n switch (c) {\n case \"input\":\n f = vc(g, f);\n d = vc(g, d);\n a = [];\n break;\n\n case \"option\":\n f = $d(g, f);\n d = $d(g, d);\n a = [];\n break;\n\n case \"select\":\n f = n({}, f, {\n value: void 0\n });\n d = n({}, d, {\n value: void 0\n });\n a = [];\n break;\n\n case \"textarea\":\n f = be(g, f);\n d = be(g, d);\n a = [];\n break;\n\n default:\n \"function\" !== typeof f.onClick && \"function\" === typeof d.onClick && (g.onclick = te);\n }\n\n qe(c, d);\n g = c = void 0;\n var h = null;\n\n for (c in f) {\n if (!d.hasOwnProperty(c) && f.hasOwnProperty(c) && null != f[c]) if (\"style\" === c) {\n var l = f[c];\n\n for (g in l) {\n l.hasOwnProperty(g) && (h || (h = {}), h[g] = \"\");\n }\n } else \"dangerouslySetInnerHTML\" !== c && \"children\" !== c && \"suppressContentEditableWarning\" !== c && \"suppressHydrationWarning\" !== c && \"autoFocus\" !== c && (ra.hasOwnProperty(c) ? a || (a = []) : (a = a || []).push(c, null));\n }\n\n for (c in d) {\n var k = d[c];\n l = null != f ? f[c] : void 0;\n if (d.hasOwnProperty(c) && k !== l && (null != k || null != l)) if (\"style\" === c) {\n if (l) {\n for (g in l) {\n !l.hasOwnProperty(g) || k && k.hasOwnProperty(g) || (h || (h = {}), h[g] = \"\");\n }\n\n for (g in k) {\n k.hasOwnProperty(g) && l[g] !== k[g] && (h || (h = {}), h[g] = k[g]);\n }\n } else h || (a || (a = []), a.push(c, h)), h = k;\n } else \"dangerouslySetInnerHTML\" === c ? (k = k ? k.__html : void 0, l = l ? l.__html : void 0, null != k && l !== k && (a = a || []).push(c, \"\" + k)) : \"children\" === c ? l === k || \"string\" !== typeof k && \"number\" !== typeof k || (a = a || []).push(c, \"\" + k) : \"suppressContentEditableWarning\" !== c && \"suppressHydrationWarning\" !== c && (ra.hasOwnProperty(c) ? (null != k && se(e, c), a || l === k || (a = [])) : (a = a || []).push(c, k));\n }\n\n h && (a = a || []).push(\"style\", h);\n e = a;\n (b.updateQueue = e) && kh(b);\n }\n};\n\noh = function oh(a, b, c, d) {\n c !== d && kh(b);\n};\n\nvar ph = \"function\" === typeof WeakSet ? WeakSet : Set;\n\nfunction qh(a, b) {\n var c = b.source,\n d = b.stack;\n null === d && null !== c && (d = jc(c));\n null !== c && ic(c.type);\n b = b.value;\n null !== a && 1 === a.tag && ic(a.type);\n\n try {\n console.error(b);\n } catch (e) {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction rh(a) {\n var b = a.ref;\n if (null !== b) if (\"function\" === typeof b) try {\n b(null);\n } catch (c) {\n sh(a, c);\n } else b.current = null;\n}\n\nfunction th(a, b, c) {\n c = c.updateQueue;\n c = null !== c ? c.lastEffect : null;\n\n if (null !== c) {\n var d = c = c.next;\n\n do {\n if ((d.tag & a) !== Nf) {\n var e = d.destroy;\n d.destroy = void 0;\n void 0 !== e && e();\n }\n\n (d.tag & b) !== Nf && (e = d.create, d.destroy = e());\n d = d.next;\n } while (d !== c);\n }\n}\n\nfunction uh(a, b) {\n for (var c = a;;) {\n if (5 === c.tag) {\n var d = c.stateNode;\n if (b) d.style.display = \"none\";else {\n d = c.stateNode;\n var e = c.memoizedProps.style;\n e = void 0 !== e && null !== e && e.hasOwnProperty(\"display\") ? e.display : null;\n d.style.display = ne(\"display\", e);\n }\n } else if (6 === c.tag) c.stateNode.nodeValue = b ? \"\" : c.memoizedProps;else if (13 === c.tag && null !== c.memoizedState) {\n d = c.child.sibling;\n d.return = c;\n c = d;\n continue;\n } else if (null !== c.child) {\n c.child.return = c;\n c = c.child;\n continue;\n }\n\n if (c === a) break;\n\n for (; null === c.sibling;) {\n if (null === c.return || c.return === a) return;\n c = c.return;\n }\n\n c.sibling.return = c.return;\n c = c.sibling;\n }\n}\n\nfunction vh(a) {\n \"function\" === typeof Re && Re(a);\n\n switch (a.tag) {\n case 0:\n case 11:\n case 14:\n case 15:\n var b = a.updateQueue;\n\n if (null !== b && (b = b.lastEffect, null !== b)) {\n var c = b = b.next;\n\n do {\n var d = c.destroy;\n\n if (void 0 !== d) {\n var e = a;\n\n try {\n d();\n } catch (f) {\n sh(e, f);\n }\n }\n\n c = c.next;\n } while (c !== b);\n }\n\n break;\n\n case 1:\n rh(a);\n b = a.stateNode;\n if (\"function\" === typeof b.componentWillUnmount) try {\n b.props = a.memoizedProps, b.state = a.memoizedState, b.componentWillUnmount();\n } catch (f) {\n sh(a, f);\n }\n break;\n\n case 5:\n rh(a);\n break;\n\n case 4:\n wh(a);\n }\n}\n\nfunction xh(a) {\n return 5 === a.tag || 3 === a.tag || 4 === a.tag;\n}\n\nfunction yh(a) {\n a: {\n for (var b = a.return; null !== b;) {\n if (xh(b)) {\n var c = b;\n break a;\n }\n\n b = b.return;\n }\n\n x(\"160\");\n c = void 0;\n }\n\n var d = b = void 0;\n\n switch (c.tag) {\n case 5:\n b = c.stateNode;\n d = !1;\n break;\n\n case 3:\n b = c.stateNode.containerInfo;\n d = !0;\n break;\n\n case 4:\n b = c.stateNode.containerInfo;\n d = !0;\n break;\n\n default:\n x(\"161\");\n }\n\n c.effectTag & 16 && (ke(b, \"\"), c.effectTag &= -17);\n\n a: b: for (c = a;;) {\n for (; null === c.sibling;) {\n if (null === c.return || xh(c.return)) {\n c = null;\n break a;\n }\n\n c = c.return;\n }\n\n c.sibling.return = c.return;\n\n for (c = c.sibling; 5 !== c.tag && 6 !== c.tag && 18 !== c.tag;) {\n if (c.effectTag & 2) continue b;\n if (null === c.child || 4 === c.tag) continue b;else c.child.return = c, c = c.child;\n }\n\n if (!(c.effectTag & 2)) {\n c = c.stateNode;\n break a;\n }\n }\n\n for (var e = a;;) {\n if (5 === e.tag || 6 === e.tag) {\n if (c) {\n if (d) {\n var f = b,\n g = e.stateNode,\n h = c;\n 8 === f.nodeType ? f.parentNode.insertBefore(g, h) : f.insertBefore(g, h);\n } else b.insertBefore(e.stateNode, c);\n } else d ? (g = b, h = e.stateNode, 8 === g.nodeType ? (f = g.parentNode, f.insertBefore(h, g)) : (f = g, f.appendChild(h)), g = g._reactRootContainer, null !== g && void 0 !== g || null !== f.onclick || (f.onclick = te)) : b.appendChild(e.stateNode);\n } else if (4 !== e.tag && null !== e.child) {\n e.child.return = e;\n e = e.child;\n continue;\n }\n if (e === a) break;\n\n for (; null === e.sibling;) {\n if (null === e.return || e.return === a) return;\n e = e.return;\n }\n\n e.sibling.return = e.return;\n e = e.sibling;\n }\n}\n\nfunction wh(a) {\n for (var b = a, c = !1, d = void 0, e = void 0;;) {\n if (!c) {\n c = b.return;\n\n a: for (;;) {\n null === c ? x(\"160\") : void 0;\n\n switch (c.tag) {\n case 5:\n d = c.stateNode;\n e = !1;\n break a;\n\n case 3:\n d = c.stateNode.containerInfo;\n e = !0;\n break a;\n\n case 4:\n d = c.stateNode.containerInfo;\n e = !0;\n break a;\n }\n\n c = c.return;\n }\n\n c = !0;\n }\n\n if (5 === b.tag || 6 === b.tag) {\n a: for (var f = b, g = f;;) {\n if (vh(g), null !== g.child && 4 !== g.tag) g.child.return = g, g = g.child;else {\n if (g === f) break;\n\n for (; null === g.sibling;) {\n if (null === g.return || g.return === f) break a;\n g = g.return;\n }\n\n g.sibling.return = g.return;\n g = g.sibling;\n }\n }\n\n e ? (f = d, g = b.stateNode, 8 === f.nodeType ? f.parentNode.removeChild(g) : f.removeChild(g)) : d.removeChild(b.stateNode);\n } else if (4 === b.tag) {\n if (null !== b.child) {\n d = b.stateNode.containerInfo;\n e = !0;\n b.child.return = b;\n b = b.child;\n continue;\n }\n } else if (vh(b), null !== b.child) {\n b.child.return = b;\n b = b.child;\n continue;\n }\n\n if (b === a) break;\n\n for (; null === b.sibling;) {\n if (null === b.return || b.return === a) return;\n b = b.return;\n 4 === b.tag && (c = !1);\n }\n\n b.sibling.return = b.return;\n b = b.sibling;\n }\n}\n\nfunction zh(a, b) {\n switch (b.tag) {\n case 0:\n case 11:\n case 14:\n case 15:\n th(Pf, Qf, b);\n break;\n\n case 1:\n break;\n\n case 5:\n var c = b.stateNode;\n\n if (null != c) {\n var d = b.memoizedProps;\n a = null !== a ? a.memoizedProps : d;\n var e = b.type,\n f = b.updateQueue;\n b.updateQueue = null;\n null !== f && Ce(c, f, e, a, d, b);\n }\n\n break;\n\n case 6:\n null === b.stateNode ? x(\"162\") : void 0;\n b.stateNode.nodeValue = b.memoizedProps;\n break;\n\n case 3:\n break;\n\n case 12:\n break;\n\n case 13:\n c = b.memoizedState;\n d = void 0;\n a = b;\n null === c ? d = !1 : (d = !0, a = b.child, 0 === c.timedOutAt && (c.timedOutAt = lf()));\n null !== a && uh(a, d);\n c = b.updateQueue;\n\n if (null !== c) {\n b.updateQueue = null;\n var g = b.stateNode;\n null === g && (g = b.stateNode = new ph());\n c.forEach(function (a) {\n var c = Ah.bind(null, b, a);\n g.has(a) || (g.add(a), a.then(c, c));\n });\n }\n\n break;\n\n case 17:\n break;\n\n default:\n x(\"163\");\n }\n}\n\nvar Bh = \"function\" === typeof WeakMap ? WeakMap : Map;\n\nfunction Ch(a, b, c) {\n c = nf(c);\n c.tag = ah;\n c.payload = {\n element: null\n };\n var d = b.value;\n\n c.callback = function () {\n Dh(d);\n qh(a, b);\n };\n\n return c;\n}\n\nfunction Eh(a, b, c) {\n c = nf(c);\n c.tag = ah;\n var d = a.type.getDerivedStateFromError;\n\n if (\"function\" === typeof d) {\n var e = b.value;\n\n c.payload = function () {\n return d(e);\n };\n }\n\n var f = a.stateNode;\n null !== f && \"function\" === typeof f.componentDidCatch && (c.callback = function () {\n \"function\" !== typeof d && (null === Fh ? Fh = new Set([this]) : Fh.add(this));\n var c = b.value,\n e = b.stack;\n qh(a, b);\n this.componentDidCatch(c, {\n componentStack: null !== e ? e : \"\"\n });\n });\n return c;\n}\n\nfunction Gh(a) {\n switch (a.tag) {\n case 1:\n J(a.type) && Ke(a);\n var b = a.effectTag;\n return b & 2048 ? (a.effectTag = b & -2049 | 64, a) : null;\n\n case 3:\n return Kf(a), Le(a), b = a.effectTag, 0 !== (b & 64) ? x(\"285\") : void 0, a.effectTag = b & -2049 | 64, a;\n\n case 5:\n return Mf(a), null;\n\n case 13:\n return b = a.effectTag, b & 2048 ? (a.effectTag = b & -2049 | 64, a) : null;\n\n case 18:\n return null;\n\n case 4:\n return Kf(a), null;\n\n case 10:\n return Zg(a), null;\n\n default:\n return null;\n }\n}\n\nvar Hh = Tb.ReactCurrentDispatcher,\n Ih = Tb.ReactCurrentOwner,\n Jh = 1073741822,\n Kh = !1,\n T = null,\n Lh = null,\n U = 0,\n Mh = -1,\n Nh = !1,\n V = null,\n Oh = !1,\n Ph = null,\n Qh = null,\n Rh = null,\n Fh = null;\n\nfunction Sh() {\n if (null !== T) for (var a = T.return; null !== a;) {\n var b = a;\n\n switch (b.tag) {\n case 1:\n var c = b.type.childContextTypes;\n null !== c && void 0 !== c && Ke(b);\n break;\n\n case 3:\n Kf(b);\n Le(b);\n break;\n\n case 5:\n Mf(b);\n break;\n\n case 4:\n Kf(b);\n break;\n\n case 10:\n Zg(b);\n }\n\n a = a.return;\n }\n Lh = null;\n U = 0;\n Mh = -1;\n Nh = !1;\n T = null;\n}\n\nfunction Th() {\n for (; null !== V;) {\n var a = V.effectTag;\n a & 16 && ke(V.stateNode, \"\");\n\n if (a & 128) {\n var b = V.alternate;\n null !== b && (b = b.ref, null !== b && (\"function\" === typeof b ? b(null) : b.current = null));\n }\n\n switch (a & 14) {\n case 2:\n yh(V);\n V.effectTag &= -3;\n break;\n\n case 6:\n yh(V);\n V.effectTag &= -3;\n zh(V.alternate, V);\n break;\n\n case 4:\n zh(V.alternate, V);\n break;\n\n case 8:\n a = V, wh(a), a.return = null, a.child = null, a.memoizedState = null, a.updateQueue = null, a = a.alternate, null !== a && (a.return = null, a.child = null, a.memoizedState = null, a.updateQueue = null);\n }\n\n V = V.nextEffect;\n }\n}\n\nfunction Uh() {\n for (; null !== V;) {\n if (V.effectTag & 256) a: {\n var a = V.alternate,\n b = V;\n\n switch (b.tag) {\n case 0:\n case 11:\n case 15:\n th(Of, Nf, b);\n break a;\n\n case 1:\n if (b.effectTag & 256 && null !== a) {\n var c = a.memoizedProps,\n d = a.memoizedState;\n a = b.stateNode;\n b = a.getSnapshotBeforeUpdate(b.elementType === b.type ? c : L(b.type, c), d);\n a.__reactInternalSnapshotBeforeUpdate = b;\n }\n\n break a;\n\n case 3:\n case 5:\n case 6:\n case 4:\n case 17:\n break a;\n\n default:\n x(\"163\");\n }\n }\n V = V.nextEffect;\n }\n}\n\nfunction Vh(a, b) {\n for (; null !== V;) {\n var c = V.effectTag;\n\n if (c & 36) {\n var d = V.alternate,\n e = V,\n f = b;\n\n switch (e.tag) {\n case 0:\n case 11:\n case 15:\n th(Rf, Sf, e);\n break;\n\n case 1:\n var g = e.stateNode;\n if (e.effectTag & 4) if (null === d) g.componentDidMount();else {\n var h = e.elementType === e.type ? d.memoizedProps : L(e.type, d.memoizedProps);\n g.componentDidUpdate(h, d.memoizedState, g.__reactInternalSnapshotBeforeUpdate);\n }\n d = e.updateQueue;\n null !== d && hh(e, d, g, f);\n break;\n\n case 3:\n d = e.updateQueue;\n\n if (null !== d) {\n g = null;\n if (null !== e.child) switch (e.child.tag) {\n case 5:\n g = e.child.stateNode;\n break;\n\n case 1:\n g = e.child.stateNode;\n }\n hh(e, d, g, f);\n }\n\n break;\n\n case 5:\n f = e.stateNode;\n null === d && e.effectTag & 4 && we(e.type, e.memoizedProps) && f.focus();\n break;\n\n case 6:\n break;\n\n case 4:\n break;\n\n case 12:\n break;\n\n case 13:\n break;\n\n case 17:\n break;\n\n default:\n x(\"163\");\n }\n }\n\n c & 128 && (e = V.ref, null !== e && (f = V.stateNode, \"function\" === typeof e ? e(f) : e.current = f));\n c & 512 && (Ph = a);\n V = V.nextEffect;\n }\n}\n\nfunction Wh(a, b) {\n Rh = Qh = Ph = null;\n var c = W;\n W = !0;\n\n do {\n if (b.effectTag & 512) {\n var d = !1,\n e = void 0;\n\n try {\n var f = b;\n th(Uf, Nf, f);\n th(Nf, Tf, f);\n } catch (g) {\n d = !0, e = g;\n }\n\n d && sh(b, e);\n }\n\n b = b.nextEffect;\n } while (null !== b);\n\n W = c;\n c = a.expirationTime;\n 0 !== c && Xh(a, c);\n X || W || Yh(1073741823, !1);\n}\n\nfunction of() {\n null !== Qh && Be(Qh);\n null !== Rh && Rh();\n}\n\nfunction Zh(a, b) {\n Oh = Kh = !0;\n a.current === b ? x(\"177\") : void 0;\n var c = a.pendingCommitExpirationTime;\n 0 === c ? x(\"261\") : void 0;\n a.pendingCommitExpirationTime = 0;\n var d = b.expirationTime,\n e = b.childExpirationTime;\n ef(a, e > d ? e : d);\n Ih.current = null;\n d = void 0;\n 1 < b.effectTag ? null !== b.lastEffect ? (b.lastEffect.nextEffect = b, d = b.firstEffect) : d = b : d = b.firstEffect;\n ue = Bd;\n ve = Pd();\n Bd = !1;\n\n for (V = d; null !== V;) {\n e = !1;\n var f = void 0;\n\n try {\n Uh();\n } catch (h) {\n e = !0, f = h;\n }\n\n e && (null === V ? x(\"178\") : void 0, sh(V, f), null !== V && (V = V.nextEffect));\n }\n\n for (V = d; null !== V;) {\n e = !1;\n f = void 0;\n\n try {\n Th();\n } catch (h) {\n e = !0, f = h;\n }\n\n e && (null === V ? x(\"178\") : void 0, sh(V, f), null !== V && (V = V.nextEffect));\n }\n\n Qd(ve);\n ve = null;\n Bd = !!ue;\n ue = null;\n a.current = b;\n\n for (V = d; null !== V;) {\n e = !1;\n f = void 0;\n\n try {\n Vh(a, c);\n } catch (h) {\n e = !0, f = h;\n }\n\n e && (null === V ? x(\"178\") : void 0, sh(V, f), null !== V && (V = V.nextEffect));\n }\n\n if (null !== d && null !== Ph) {\n var g = Wh.bind(null, a, d);\n Qh = r.unstable_runWithPriority(r.unstable_NormalPriority, function () {\n return Ae(g);\n });\n Rh = g;\n }\n\n Kh = Oh = !1;\n \"function\" === typeof Qe && Qe(b.stateNode);\n c = b.expirationTime;\n b = b.childExpirationTime;\n b = b > c ? b : c;\n 0 === b && (Fh = null);\n $h(a, b);\n}\n\nfunction ai(a) {\n for (;;) {\n var b = a.alternate,\n c = a.return,\n d = a.sibling;\n\n if (0 === (a.effectTag & 1024)) {\n T = a;\n\n a: {\n var e = b;\n b = a;\n var f = U;\n var g = b.pendingProps;\n\n switch (b.tag) {\n case 2:\n break;\n\n case 16:\n break;\n\n case 15:\n case 0:\n break;\n\n case 1:\n J(b.type) && Ke(b);\n break;\n\n case 3:\n Kf(b);\n Le(b);\n g = b.stateNode;\n g.pendingContext && (g.context = g.pendingContext, g.pendingContext = null);\n if (null === e || null === e.child) Eg(b), b.effectTag &= -3;\n mh(b);\n break;\n\n case 5:\n Mf(b);\n var h = If(Hf.current);\n f = b.type;\n if (null !== e && null != b.stateNode) nh(e, b, f, g, h), e.ref !== b.ref && (b.effectTag |= 128);else if (g) {\n var l = If(N.current);\n\n if (Eg(b)) {\n g = b;\n e = g.stateNode;\n var k = g.type,\n m = g.memoizedProps,\n p = h;\n e[Fa] = g;\n e[Ga] = m;\n f = void 0;\n h = k;\n\n switch (h) {\n case \"iframe\":\n case \"object\":\n E(\"load\", e);\n break;\n\n case \"video\":\n case \"audio\":\n for (k = 0; k < ab.length; k++) {\n E(ab[k], e);\n }\n\n break;\n\n case \"source\":\n E(\"error\", e);\n break;\n\n case \"img\":\n case \"image\":\n case \"link\":\n E(\"error\", e);\n E(\"load\", e);\n break;\n\n case \"form\":\n E(\"reset\", e);\n E(\"submit\", e);\n break;\n\n case \"details\":\n E(\"toggle\", e);\n break;\n\n case \"input\":\n wc(e, m);\n E(\"invalid\", e);\n se(p, \"onChange\");\n break;\n\n case \"select\":\n e._wrapperState = {\n wasMultiple: !!m.multiple\n };\n E(\"invalid\", e);\n se(p, \"onChange\");\n break;\n\n case \"textarea\":\n ce(e, m), E(\"invalid\", e), se(p, \"onChange\");\n }\n\n qe(h, m);\n k = null;\n\n for (f in m) {\n m.hasOwnProperty(f) && (l = m[f], \"children\" === f ? \"string\" === typeof l ? e.textContent !== l && (k = [\"children\", l]) : \"number\" === typeof l && e.textContent !== \"\" + l && (k = [\"children\", \"\" + l]) : ra.hasOwnProperty(f) && null != l && se(p, f));\n }\n\n switch (h) {\n case \"input\":\n Rb(e);\n Ac(e, m, !0);\n break;\n\n case \"textarea\":\n Rb(e);\n ee(e, m);\n break;\n\n case \"select\":\n case \"option\":\n break;\n\n default:\n \"function\" === typeof m.onClick && (e.onclick = te);\n }\n\n f = k;\n g.updateQueue = f;\n g = null !== f ? !0 : !1;\n g && kh(b);\n } else {\n m = b;\n p = f;\n e = g;\n k = 9 === h.nodeType ? h : h.ownerDocument;\n l === fe.html && (l = ge(p));\n l === fe.html ? \"script\" === p ? (e = k.createElement(\"div\"), e.innerHTML = \"