create-expo-cljs-app
Version:
Create a react native application with Expo and Shadow-CLJS!
1,490 lines (1,488 loc) • 274 kB
JavaScript
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
* @nolint
* @preventMunge
* @generated
*/
"use strict";
require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore");
var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"),
React = require("react"),
Scheduler = require("scheduler");
function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) {
var funcArgs = Array.prototype.slice.call(arguments, 3);
try {
func.apply(context, funcArgs);
} catch (error) {
this.onError(error);
}
}
var hasError = !1,
caughtError = null,
hasRethrowError = !1,
rethrowError = null,
reporter = {
onError: function(error) {
hasError = !0;
caughtError = error;
}
};
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
hasError = !1;
caughtError = null;
invokeGuardedCallbackImpl.apply(reporter, arguments);
}
function invokeGuardedCallbackAndCatchFirstError(
name,
func,
context,
a,
b,
c,
d,
e,
f
) {
invokeGuardedCallback.apply(this, arguments);
if (hasError) {
if (hasError) {
var error = caughtError;
hasError = !1;
caughtError = null;
} else
throw Error(
"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."
);
hasRethrowError || ((hasRethrowError = !0), (rethrowError = error));
}
}
var getFiberCurrentPropsFromNode = null,
getInstanceFromNode = null,
getNodeFromInstance = null;
function executeDispatch(event, listener, inst) {
var type = event.type || "unknown-event";
event.currentTarget = getNodeFromInstance(inst);
invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
event.currentTarget = null;
}
function executeDirectDispatch(event) {
var dispatchListener = event._dispatchListeners,
dispatchInstance = event._dispatchInstances;
if (Array.isArray(dispatchListener))
throw Error("executeDirectDispatch(...): Invalid `event`.");
event.currentTarget = dispatchListener
? getNodeFromInstance(dispatchInstance)
: null;
dispatchListener = dispatchListener ? dispatchListener(event) : null;
event.currentTarget = null;
event._dispatchListeners = null;
event._dispatchInstances = null;
return dispatchListener;
}
function functionThatReturnsTrue() {
return !0;
}
function functionThatReturnsFalse() {
return !1;
}
function SyntheticEvent(
dispatchConfig,
targetInst,
nativeEvent,
nativeEventTarget
) {
this.dispatchConfig = dispatchConfig;
this._targetInst = targetInst;
this.nativeEvent = nativeEvent;
this._dispatchInstances = this._dispatchListeners = null;
dispatchConfig = this.constructor.Interface;
for (var propName in dispatchConfig)
dispatchConfig.hasOwnProperty(propName) &&
((targetInst = dispatchConfig[propName])
? (this[propName] = targetInst(nativeEvent))
: "target" === propName
? (this.target = nativeEventTarget)
: (this[propName] = nativeEvent[propName]));
this.isDefaultPrevented = (null != nativeEvent.defaultPrevented
? nativeEvent.defaultPrevented
: !1 === nativeEvent.returnValue)
? functionThatReturnsTrue
: functionThatReturnsFalse;
this.isPropagationStopped = functionThatReturnsFalse;
return this;
}
Object.assign(SyntheticEvent.prototype, {
preventDefault: function() {
this.defaultPrevented = !0;
var event = this.nativeEvent;
event &&
(event.preventDefault
? event.preventDefault()
: "unknown" !== typeof event.returnValue && (event.returnValue = !1),
(this.isDefaultPrevented = functionThatReturnsTrue));
},
stopPropagation: function() {
var event = this.nativeEvent;
event &&
(event.stopPropagation
? event.stopPropagation()
: "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0),
(this.isPropagationStopped = functionThatReturnsTrue));
},
persist: function() {
this.isPersistent = functionThatReturnsTrue;
},
isPersistent: functionThatReturnsFalse,
destructor: function() {
var Interface = this.constructor.Interface,
propName;
for (propName in Interface) this[propName] = null;
this.nativeEvent = this._targetInst = this.dispatchConfig = null;
this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse;
this._dispatchInstances = this._dispatchListeners = null;
}
});
SyntheticEvent.Interface = {
type: null,
target: null,
currentTarget: function() {
return null;
},
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function(event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
SyntheticEvent.extend = function(Interface) {
function E() {}
function Class() {
return Super.apply(this, arguments);
}
var Super = this;
E.prototype = Super.prototype;
var prototype = new E();
Object.assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = Object.assign({}, Super.Interface, Interface);
Class.extend = Super.extend;
addEventPoolingTo(Class);
return Class;
};
addEventPoolingTo(SyntheticEvent);
function createOrGetPooledEvent(
dispatchConfig,
targetInst,
nativeEvent,
nativeInst
) {
if (this.eventPool.length) {
var instance = this.eventPool.pop();
this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
return instance;
}
return new this(dispatchConfig, targetInst, nativeEvent, nativeInst);
}
function releasePooledEvent(event) {
if (!(event instanceof this))
throw Error(
"Trying to release an event instance into a pool of a different type."
);
event.destructor();
10 > this.eventPool.length && this.eventPool.push(event);
}
function addEventPoolingTo(EventConstructor) {
EventConstructor.getPooled = createOrGetPooledEvent;
EventConstructor.eventPool = [];
EventConstructor.release = releasePooledEvent;
}
var ResponderSyntheticEvent = SyntheticEvent.extend({
touchHistory: function() {
return null;
}
});
function isStartish(topLevelType) {
return "topTouchStart" === topLevelType;
}
function isMoveish(topLevelType) {
return "topTouchMove" === topLevelType;
}
var startDependencies = ["topTouchStart"],
moveDependencies = ["topTouchMove"],
endDependencies = ["topTouchCancel", "topTouchEnd"],
touchBank = [],
touchHistory = {
touchBank: touchBank,
numberActiveTouches: 0,
indexOfSingleActiveTouch: -1,
mostRecentTimeStamp: 0
};
function timestampForTouch(touch) {
return touch.timeStamp || touch.timestamp;
}
function getTouchIdentifier(_ref) {
_ref = _ref.identifier;
if (null == _ref) throw Error("Touch object is missing identifier.");
return _ref;
}
function recordTouchStart(touch) {
var identifier = getTouchIdentifier(touch),
touchRecord = touchBank[identifier];
touchRecord
? ((touchRecord.touchActive = !0),
(touchRecord.startPageX = touch.pageX),
(touchRecord.startPageY = touch.pageY),
(touchRecord.startTimeStamp = timestampForTouch(touch)),
(touchRecord.currentPageX = touch.pageX),
(touchRecord.currentPageY = touch.pageY),
(touchRecord.currentTimeStamp = timestampForTouch(touch)),
(touchRecord.previousPageX = touch.pageX),
(touchRecord.previousPageY = touch.pageY),
(touchRecord.previousTimeStamp = timestampForTouch(touch)))
: ((touchRecord = {
touchActive: !0,
startPageX: touch.pageX,
startPageY: touch.pageY,
startTimeStamp: timestampForTouch(touch),
currentPageX: touch.pageX,
currentPageY: touch.pageY,
currentTimeStamp: timestampForTouch(touch),
previousPageX: touch.pageX,
previousPageY: touch.pageY,
previousTimeStamp: timestampForTouch(touch)
}),
(touchBank[identifier] = touchRecord));
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
}
function recordTouchMove(touch) {
var touchRecord = touchBank[getTouchIdentifier(touch)];
touchRecord &&
((touchRecord.touchActive = !0),
(touchRecord.previousPageX = touchRecord.currentPageX),
(touchRecord.previousPageY = touchRecord.currentPageY),
(touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
(touchRecord.currentPageX = touch.pageX),
(touchRecord.currentPageY = touch.pageY),
(touchRecord.currentTimeStamp = timestampForTouch(touch)),
(touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
}
function recordTouchEnd(touch) {
var touchRecord = touchBank[getTouchIdentifier(touch)];
touchRecord &&
((touchRecord.touchActive = !1),
(touchRecord.previousPageX = touchRecord.currentPageX),
(touchRecord.previousPageY = touchRecord.currentPageY),
(touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
(touchRecord.currentPageX = touch.pageX),
(touchRecord.currentPageY = touch.pageY),
(touchRecord.currentTimeStamp = timestampForTouch(touch)),
(touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
}
var ResponderTouchHistoryStore = {
recordTouchTrack: function(topLevelType, nativeEvent) {
if (isMoveish(topLevelType))
nativeEvent.changedTouches.forEach(recordTouchMove);
else if (isStartish(topLevelType))
nativeEvent.changedTouches.forEach(recordTouchStart),
(touchHistory.numberActiveTouches = nativeEvent.touches.length),
1 === touchHistory.numberActiveTouches &&
(touchHistory.indexOfSingleActiveTouch =
nativeEvent.touches[0].identifier);
else if (
"topTouchEnd" === topLevelType ||
"topTouchCancel" === topLevelType
)
if (
(nativeEvent.changedTouches.forEach(recordTouchEnd),
(touchHistory.numberActiveTouches = nativeEvent.touches.length),
1 === touchHistory.numberActiveTouches)
)
for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++)
if (
((nativeEvent = touchBank[topLevelType]),
null != nativeEvent && nativeEvent.touchActive)
) {
touchHistory.indexOfSingleActiveTouch = topLevelType;
break;
}
},
touchHistory: touchHistory
};
function accumulate(current, next) {
if (null == next)
throw Error(
"accumulate(...): Accumulated items must not be null or undefined."
);
return null == current
? next
: Array.isArray(current)
? current.concat(next)
: Array.isArray(next)
? [current].concat(next)
: [current, next];
}
function accumulateInto(current, next) {
if (null == next)
throw Error(
"accumulateInto(...): Accumulated items must not be null or undefined."
);
if (null == current) return next;
if (Array.isArray(current)) {
if (Array.isArray(next)) return current.push.apply(current, next), current;
current.push(next);
return current;
}
return Array.isArray(next) ? [current].concat(next) : [current, next];
}
function forEachAccumulated(arr, cb, scope) {
Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr);
}
var responderInst = null,
trackedTouchCount = 0;
function changeResponder(nextResponderInst, blockHostResponder) {
var oldResponderInst = responderInst;
responderInst = nextResponderInst;
if (null !== ResponderEventPlugin.GlobalResponderHandler)
ResponderEventPlugin.GlobalResponderHandler.onChange(
oldResponderInst,
nextResponderInst,
blockHostResponder
);
}
var eventTypes = {
startShouldSetResponder: {
phasedRegistrationNames: {
bubbled: "onStartShouldSetResponder",
captured: "onStartShouldSetResponderCapture"
},
dependencies: startDependencies
},
scrollShouldSetResponder: {
phasedRegistrationNames: {
bubbled: "onScrollShouldSetResponder",
captured: "onScrollShouldSetResponderCapture"
},
dependencies: ["topScroll"]
},
selectionChangeShouldSetResponder: {
phasedRegistrationNames: {
bubbled: "onSelectionChangeShouldSetResponder",
captured: "onSelectionChangeShouldSetResponderCapture"
},
dependencies: ["topSelectionChange"]
},
moveShouldSetResponder: {
phasedRegistrationNames: {
bubbled: "onMoveShouldSetResponder",
captured: "onMoveShouldSetResponderCapture"
},
dependencies: moveDependencies
},
responderStart: {
registrationName: "onResponderStart",
dependencies: startDependencies
},
responderMove: {
registrationName: "onResponderMove",
dependencies: moveDependencies
},
responderEnd: {
registrationName: "onResponderEnd",
dependencies: endDependencies
},
responderRelease: {
registrationName: "onResponderRelease",
dependencies: endDependencies
},
responderTerminationRequest: {
registrationName: "onResponderTerminationRequest",
dependencies: []
},
responderGrant: { registrationName: "onResponderGrant", dependencies: [] },
responderReject: { registrationName: "onResponderReject", dependencies: [] },
responderTerminate: {
registrationName: "onResponderTerminate",
dependencies: []
}
};
function getParent(inst) {
do inst = inst.return;
while (inst && 5 !== inst.tag);
return inst ? inst : null;
}
function traverseTwoPhase(inst, fn, arg) {
for (var path = []; inst; ) path.push(inst), (inst = getParent(inst));
for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg);
for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg);
}
function getListener(inst, registrationName) {
inst = inst.stateNode;
if (null === inst) return null;
inst = getFiberCurrentPropsFromNode(inst);
if (null === inst) return null;
if ((inst = inst[registrationName]) && "function" !== typeof inst)
throw Error(
"Expected `" +
registrationName +
"` listener to be a function, instead got a value of `" +
typeof inst +
"` type."
);
return inst;
}
function accumulateDirectionalDispatches(inst, phase, event) {
if (
(phase = getListener(
inst,
event.dispatchConfig.phasedRegistrationNames[phase]
))
)
(event._dispatchListeners = accumulateInto(
event._dispatchListeners,
phase
)),
(event._dispatchInstances = accumulateInto(
event._dispatchInstances,
inst
));
}
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
var inst = event._targetInst;
if (inst && event && event.dispatchConfig.registrationName) {
var listener = getListener(inst, event.dispatchConfig.registrationName);
listener &&
((event._dispatchListeners = accumulateInto(
event._dispatchListeners,
listener
)),
(event._dispatchInstances = accumulateInto(
event._dispatchInstances,
inst
)));
}
}
}
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
var targetInst = event._targetInst;
targetInst = targetInst ? getParent(targetInst) : null;
traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event);
}
}
function accumulateTwoPhaseDispatchesSingle(event) {
event &&
event.dispatchConfig.phasedRegistrationNames &&
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
}
var ResponderEventPlugin = {
_getResponder: function() {
return responderInst;
},
eventTypes: eventTypes,
extractEvents: function(
topLevelType,
targetInst,
nativeEvent,
nativeEventTarget
) {
if (isStartish(topLevelType)) trackedTouchCount += 1;
else if (
"topTouchEnd" === topLevelType ||
"topTouchCancel" === topLevelType
)
if (0 <= trackedTouchCount) --trackedTouchCount;
else return null;
ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);
if (
targetInst &&
(("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) ||
(0 < trackedTouchCount && "topSelectionChange" === topLevelType) ||
isStartish(topLevelType) ||
isMoveish(topLevelType))
) {
var shouldSetEventType = isStartish(topLevelType)
? eventTypes.startShouldSetResponder
: isMoveish(topLevelType)
? eventTypes.moveShouldSetResponder
: "topSelectionChange" === topLevelType
? eventTypes.selectionChangeShouldSetResponder
: eventTypes.scrollShouldSetResponder;
if (responderInst)
b: {
var JSCompiler_temp = responderInst;
for (
var depthA = 0, tempA = JSCompiler_temp;
tempA;
tempA = getParent(tempA)
)
depthA++;
tempA = 0;
for (var tempB = targetInst; tempB; tempB = getParent(tempB))
tempA++;
for (; 0 < depthA - tempA; )
(JSCompiler_temp = getParent(JSCompiler_temp)), depthA--;
for (; 0 < tempA - depthA; )
(targetInst = getParent(targetInst)), tempA--;
for (; depthA--; ) {
if (
JSCompiler_temp === targetInst ||
JSCompiler_temp === targetInst.alternate
)
break b;
JSCompiler_temp = getParent(JSCompiler_temp);
targetInst = getParent(targetInst);
}
JSCompiler_temp = null;
}
else JSCompiler_temp = targetInst;
targetInst = JSCompiler_temp;
JSCompiler_temp = targetInst === responderInst;
shouldSetEventType = ResponderSyntheticEvent.getPooled(
shouldSetEventType,
targetInst,
nativeEvent,
nativeEventTarget
);
shouldSetEventType.touchHistory =
ResponderTouchHistoryStore.touchHistory;
JSCompiler_temp
? forEachAccumulated(
shouldSetEventType,
accumulateTwoPhaseDispatchesSingleSkipTarget
)
: forEachAccumulated(
shouldSetEventType,
accumulateTwoPhaseDispatchesSingle
);
b: {
JSCompiler_temp = shouldSetEventType._dispatchListeners;
targetInst = shouldSetEventType._dispatchInstances;
if (Array.isArray(JSCompiler_temp))
for (
depthA = 0;
depthA < JSCompiler_temp.length &&
!shouldSetEventType.isPropagationStopped();
depthA++
) {
if (
JSCompiler_temp[depthA](shouldSetEventType, targetInst[depthA])
) {
JSCompiler_temp = targetInst[depthA];
break b;
}
}
else if (
JSCompiler_temp &&
JSCompiler_temp(shouldSetEventType, targetInst)
) {
JSCompiler_temp = targetInst;
break b;
}
JSCompiler_temp = null;
}
shouldSetEventType._dispatchInstances = null;
shouldSetEventType._dispatchListeners = null;
shouldSetEventType.isPersistent() ||
shouldSetEventType.constructor.release(shouldSetEventType);
if (JSCompiler_temp && JSCompiler_temp !== responderInst)
if (
((shouldSetEventType = ResponderSyntheticEvent.getPooled(
eventTypes.responderGrant,
JSCompiler_temp,
nativeEvent,
nativeEventTarget
)),
(shouldSetEventType.touchHistory =
ResponderTouchHistoryStore.touchHistory),
forEachAccumulated(
shouldSetEventType,
accumulateDirectDispatchesSingle
),
(targetInst = !0 === executeDirectDispatch(shouldSetEventType)),
responderInst)
)
if (
((depthA = ResponderSyntheticEvent.getPooled(
eventTypes.responderTerminationRequest,
responderInst,
nativeEvent,
nativeEventTarget
)),
(depthA.touchHistory = ResponderTouchHistoryStore.touchHistory),
forEachAccumulated(depthA, accumulateDirectDispatchesSingle),
(tempA =
!depthA._dispatchListeners || executeDirectDispatch(depthA)),
depthA.isPersistent() || depthA.constructor.release(depthA),
tempA)
) {
depthA = ResponderSyntheticEvent.getPooled(
eventTypes.responderTerminate,
responderInst,
nativeEvent,
nativeEventTarget
);
depthA.touchHistory = ResponderTouchHistoryStore.touchHistory;
forEachAccumulated(depthA, accumulateDirectDispatchesSingle);
var JSCompiler_temp$jscomp$0 = accumulate(
JSCompiler_temp$jscomp$0,
[shouldSetEventType, depthA]
);
changeResponder(JSCompiler_temp, targetInst);
} else
(shouldSetEventType = ResponderSyntheticEvent.getPooled(
eventTypes.responderReject,
JSCompiler_temp,
nativeEvent,
nativeEventTarget
)),
(shouldSetEventType.touchHistory =
ResponderTouchHistoryStore.touchHistory),
forEachAccumulated(
shouldSetEventType,
accumulateDirectDispatchesSingle
),
(JSCompiler_temp$jscomp$0 = accumulate(
JSCompiler_temp$jscomp$0,
shouldSetEventType
));
else
(JSCompiler_temp$jscomp$0 = accumulate(
JSCompiler_temp$jscomp$0,
shouldSetEventType
)),
changeResponder(JSCompiler_temp, targetInst);
else JSCompiler_temp$jscomp$0 = null;
} else JSCompiler_temp$jscomp$0 = null;
shouldSetEventType = responderInst && isStartish(topLevelType);
JSCompiler_temp = responderInst && isMoveish(topLevelType);
targetInst =
responderInst &&
("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType);
if (
(shouldSetEventType = shouldSetEventType
? eventTypes.responderStart
: JSCompiler_temp
? eventTypes.responderMove
: targetInst
? eventTypes.responderEnd
: null)
)
(shouldSetEventType = ResponderSyntheticEvent.getPooled(
shouldSetEventType,
responderInst,
nativeEvent,
nativeEventTarget
)),
(shouldSetEventType.touchHistory =
ResponderTouchHistoryStore.touchHistory),
forEachAccumulated(
shouldSetEventType,
accumulateDirectDispatchesSingle
),
(JSCompiler_temp$jscomp$0 = accumulate(
JSCompiler_temp$jscomp$0,
shouldSetEventType
));
shouldSetEventType = responderInst && "topTouchCancel" === topLevelType;
if (
(topLevelType =
responderInst &&
!shouldSetEventType &&
("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType))
)
a: {
if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length)
for (
JSCompiler_temp = 0;
JSCompiler_temp < topLevelType.length;
JSCompiler_temp++
)
if (
((targetInst = topLevelType[JSCompiler_temp].target),
null !== targetInst &&
void 0 !== targetInst &&
0 !== targetInst)
) {
depthA = getInstanceFromNode(targetInst);
b: {
for (targetInst = responderInst; depthA; ) {
if (
targetInst === depthA ||
targetInst === depthA.alternate
) {
targetInst = !0;
break b;
}
depthA = getParent(depthA);
}
targetInst = !1;
}
if (targetInst) {
topLevelType = !1;
break a;
}
}
topLevelType = !0;
}
if (
(topLevelType = shouldSetEventType
? eventTypes.responderTerminate
: topLevelType
? eventTypes.responderRelease
: null)
)
(nativeEvent = ResponderSyntheticEvent.getPooled(
topLevelType,
responderInst,
nativeEvent,
nativeEventTarget
)),
(nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory),
forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle),
(JSCompiler_temp$jscomp$0 = accumulate(
JSCompiler_temp$jscomp$0,
nativeEvent
)),
changeResponder(null);
return JSCompiler_temp$jscomp$0;
},
GlobalResponderHandler: null,
injection: {
injectGlobalResponderHandler: function(GlobalResponderHandler) {
ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;
}
}
},
eventPluginOrder = null,
namesToPlugins = {};
function recomputePluginOrdering() {
if (eventPluginOrder)
for (var pluginName in namesToPlugins) {
var pluginModule = namesToPlugins[pluginName],
pluginIndex = eventPluginOrder.indexOf(pluginName);
if (!(-1 < pluginIndex))
throw Error(
"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" +
pluginName +
"`."
);
if (!plugins[pluginIndex]) {
if (!pluginModule.extractEvents)
throw Error(
"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" +
pluginName +
"` does not."
);
plugins[pluginIndex] = pluginModule;
pluginIndex = pluginModule.eventTypes;
for (var eventName in pluginIndex) {
var JSCompiler_inline_result = void 0;
var dispatchConfig = pluginIndex[eventName],
eventName$jscomp$0 = eventName;
if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0))
throw Error(
"EventPluginRegistry: More than one plugin attempted to publish the same event name, `" +
eventName$jscomp$0 +
"`."
);
eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (JSCompiler_inline_result in phasedRegistrationNames)
phasedRegistrationNames.hasOwnProperty(
JSCompiler_inline_result
) &&
publishRegistrationName(
phasedRegistrationNames[JSCompiler_inline_result],
pluginModule,
eventName$jscomp$0
);
JSCompiler_inline_result = !0;
} else
dispatchConfig.registrationName
? (publishRegistrationName(
dispatchConfig.registrationName,
pluginModule,
eventName$jscomp$0
),
(JSCompiler_inline_result = !0))
: (JSCompiler_inline_result = !1);
if (!JSCompiler_inline_result)
throw Error(
"EventPluginRegistry: Failed to publish event `" +
eventName +
"` for plugin `" +
pluginName +
"`."
);
}
}
}
}
function publishRegistrationName(registrationName, pluginModule) {
if (registrationNameModules[registrationName])
throw Error(
"EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" +
registrationName +
"`."
);
registrationNameModules[registrationName] = pluginModule;
}
var plugins = [],
eventNameDispatchConfigs = {},
registrationNameModules = {};
function getListener$1(inst, registrationName) {
inst = inst.stateNode;
if (null === inst) return null;
inst = getFiberCurrentPropsFromNode(inst);
if (null === inst) return null;
if ((inst = inst[registrationName]) && "function" !== typeof inst)
throw Error(
"Expected `" +
registrationName +
"` listener to be a function, instead got a value of `" +
typeof inst +
"` type."
);
return inst;
}
var customBubblingEventTypes =
ReactNativePrivateInterface.ReactNativeViewConfigRegistry
.customBubblingEventTypes,
customDirectEventTypes =
ReactNativePrivateInterface.ReactNativeViewConfigRegistry
.customDirectEventTypes;
function accumulateDirectionalDispatches$1(inst, phase, event) {
if (
(phase = getListener$1(
inst,
event.dispatchConfig.phasedRegistrationNames[phase]
))
)
(event._dispatchListeners = accumulateInto(
event._dispatchListeners,
phase
)),
(event._dispatchInstances = accumulateInto(
event._dispatchInstances,
inst
));
}
function accumulateTwoPhaseDispatchesSingle$1(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
for (var inst = event._targetInst, path = []; inst; ) {
path.push(inst);
do inst = inst.return;
while (inst && 5 !== inst.tag);
inst = inst ? inst : null;
}
for (inst = path.length; 0 < inst--; )
accumulateDirectionalDispatches$1(path[inst], "captured", event);
for (inst = 0; inst < path.length; inst++)
accumulateDirectionalDispatches$1(path[inst], "bubbled", event);
}
}
function accumulateDirectDispatchesSingle$1(event) {
if (event && event.dispatchConfig.registrationName) {
var inst = event._targetInst;
if (inst && event && event.dispatchConfig.registrationName) {
var listener = getListener$1(inst, event.dispatchConfig.registrationName);
listener &&
((event._dispatchListeners = accumulateInto(
event._dispatchListeners,
listener
)),
(event._dispatchInstances = accumulateInto(
event._dispatchInstances,
inst
)));
}
}
}
if (eventPluginOrder)
throw Error(
"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."
);
eventPluginOrder = Array.prototype.slice.call([
"ResponderEventPlugin",
"ReactNativeBridgeEventPlugin"
]);
recomputePluginOrdering();
var injectedNamesToPlugins$jscomp$inline_222 = {
ResponderEventPlugin: ResponderEventPlugin,
ReactNativeBridgeEventPlugin: {
eventTypes: {},
extractEvents: function(
topLevelType,
targetInst,
nativeEvent,
nativeEventTarget
) {
if (null == targetInst) return null;
var bubbleDispatchConfig = customBubblingEventTypes[topLevelType],
directDispatchConfig = customDirectEventTypes[topLevelType];
if (!bubbleDispatchConfig && !directDispatchConfig)
throw Error(
'Unsupported top level event type "' + topLevelType + '" dispatched'
);
topLevelType = SyntheticEvent.getPooled(
bubbleDispatchConfig || directDispatchConfig,
targetInst,
nativeEvent,
nativeEventTarget
);
if (bubbleDispatchConfig)
forEachAccumulated(
topLevelType,
accumulateTwoPhaseDispatchesSingle$1
);
else if (directDispatchConfig)
forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle$1);
else return null;
return topLevelType;
}
}
},
isOrderingDirty$jscomp$inline_223 = !1,
pluginName$jscomp$inline_224;
for (pluginName$jscomp$inline_224 in injectedNamesToPlugins$jscomp$inline_222)
if (
injectedNamesToPlugins$jscomp$inline_222.hasOwnProperty(
pluginName$jscomp$inline_224
)
) {
var pluginModule$jscomp$inline_225 =
injectedNamesToPlugins$jscomp$inline_222[pluginName$jscomp$inline_224];
if (
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_224) ||
namesToPlugins[pluginName$jscomp$inline_224] !==
pluginModule$jscomp$inline_225
) {
if (namesToPlugins[pluginName$jscomp$inline_224])
throw Error(
"EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
pluginName$jscomp$inline_224 +
"`."
);
namesToPlugins[
pluginName$jscomp$inline_224
] = pluginModule$jscomp$inline_225;
isOrderingDirty$jscomp$inline_223 = !0;
}
}
isOrderingDirty$jscomp$inline_223 && recomputePluginOrdering();
var instanceCache = new Map(),
instanceProps = new Map();
function getInstanceFromTag(tag) {
return instanceCache.get(tag) || null;
}
function batchedUpdatesImpl(fn, bookkeeping) {
return fn(bookkeeping);
}
var isInsideEventHandler = !1;
function batchedUpdates(fn, bookkeeping) {
if (isInsideEventHandler) return fn(bookkeeping);
isInsideEventHandler = !0;
try {
return batchedUpdatesImpl(fn, bookkeeping);
} finally {
isInsideEventHandler = !1;
}
}
var eventQueue = null;
function executeDispatchesAndReleaseTopLevel(e) {
if (e) {
var dispatchListeners = e._dispatchListeners,
dispatchInstances = e._dispatchInstances;
if (Array.isArray(dispatchListeners))
for (
var i = 0;
i < dispatchListeners.length && !e.isPropagationStopped();
i++
)
executeDispatch(e, dispatchListeners[i], dispatchInstances[i]);
else
dispatchListeners &&
executeDispatch(e, dispatchListeners, dispatchInstances);
e._dispatchListeners = null;
e._dispatchInstances = null;
e.isPersistent() || e.constructor.release(e);
}
}
var EMPTY_NATIVE_EVENT = {};
function _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) {
var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT,
inst = getInstanceFromTag(rootNodeID),
target = null;
null != inst && (target = inst.stateNode);
batchedUpdates(function() {
var JSCompiler_inline_result = target;
for (
var events = null, legacyPlugins = plugins, i = 0;
i < legacyPlugins.length;
i++
) {
var possiblePlugin = legacyPlugins[i];
possiblePlugin &&
(possiblePlugin = possiblePlugin.extractEvents(
topLevelType,
inst,
nativeEvent,
JSCompiler_inline_result
)) &&
(events = accumulateInto(events, possiblePlugin));
}
JSCompiler_inline_result = events;
null !== JSCompiler_inline_result &&
(eventQueue = accumulateInto(eventQueue, JSCompiler_inline_result));
JSCompiler_inline_result = eventQueue;
eventQueue = null;
if (JSCompiler_inline_result) {
forEachAccumulated(
JSCompiler_inline_result,
executeDispatchesAndReleaseTopLevel
);
if (eventQueue)
throw Error(
"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."
);
if (hasRethrowError)
throw ((JSCompiler_inline_result = rethrowError),
(hasRethrowError = !1),
(rethrowError = null),
JSCompiler_inline_result);
}
});
}
ReactNativePrivateInterface.RCTEventEmitter.register({
receiveEvent: function(rootNodeID, topLevelType, nativeEventParam) {
_receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam);
},
receiveTouches: function(eventTopLevelType, touches, changedIndices) {
if (
"topTouchEnd" === eventTopLevelType ||
"topTouchCancel" === eventTopLevelType
) {
var JSCompiler_temp = [];
for (var i = 0; i < changedIndices.length; i++) {
var index$0 = changedIndices[i];
JSCompiler_temp.push(touches[index$0]);
touches[index$0] = null;
}
for (i = changedIndices = 0; i < touches.length; i++)
(index$0 = touches[i]),
null !== index$0 && (touches[changedIndices++] = index$0);
touches.length = changedIndices;
} else
for (JSCompiler_temp = [], i = 0; i < changedIndices.length; i++)
JSCompiler_temp.push(touches[changedIndices[i]]);
for (
changedIndices = 0;
changedIndices < JSCompiler_temp.length;
changedIndices++
) {
i = JSCompiler_temp[changedIndices];
i.changedTouches = JSCompiler_temp;
i.touches = touches;
index$0 = null;
var target = i.target;
null === target || void 0 === target || 1 > target || (index$0 = target);
_receiveRootNodeIDEvent(index$0, eventTopLevelType, i);
}
}
});
getFiberCurrentPropsFromNode = function(stateNode) {
return instanceProps.get(stateNode._nativeTag) || null;
};
getInstanceFromNode = getInstanceFromTag;
getNodeFromInstance = function(inst) {
inst = inst.stateNode;
var tag = inst._nativeTag;
void 0 === tag && ((inst = inst.canonical), (tag = inst._nativeTag));
if (!tag) throw Error("All native instances should have a tag.");
return inst;
};
ResponderEventPlugin.injection.injectGlobalResponderHandler({
onChange: function(from, to, blockNativeResponder) {
null !== to
? ReactNativePrivateInterface.UIManager.setJSResponder(
to.stateNode._nativeTag,
blockNativeResponder
)
: ReactNativePrivateInterface.UIManager.clearJSResponder();
}
});
var ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
REACT_ELEMENT_TYPE = 60103,
REACT_PORTAL_TYPE = 60106,
REACT_FRAGMENT_TYPE = 60107,
REACT_STRICT_MODE_TYPE = 60108,
REACT_PROFILER_TYPE = 60114,
REACT_PROVIDER_TYPE = 60109,
REACT_CONTEXT_TYPE = 60110,
REACT_FORWARD_REF_TYPE = 60112,
REACT_SUSPENSE_TYPE = 60113,
REACT_SUSPENSE_LIST_TYPE = 60120,
REACT_MEMO_TYPE = 60115,
REACT_LAZY_TYPE = 60116,
REACT_BLOCK_TYPE = 60121,
REACT_DEBUG_TRACING_MODE_TYPE = 60129,
REACT_OFFSCREEN_TYPE = 60130,
REACT_LEGACY_HIDDEN_TYPE = 60131;
if ("function" === typeof Symbol && Symbol.for) {
var symbolFor = Symbol.for;
REACT_ELEMENT_TYPE = symbolFor("react.element");
REACT_PORTAL_TYPE = symbolFor("react.portal");
REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
REACT_PROFILER_TYPE = symbolFor("react.profiler");
REACT_PROVIDER_TYPE = symbolFor("react.provider");
REACT_CONTEXT_TYPE = symbolFor("react.context");
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
REACT_MEMO_TYPE = symbolFor("react.memo");
REACT_LAZY_TYPE = symbolFor("react.lazy");
REACT_BLOCK_TYPE = symbolFor("react.block");
symbolFor("react.scope");
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
}
var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator;
function getIteratorFn(maybeIterable) {
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
maybeIterable =
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
maybeIterable["@@iterator"];
return "function" === typeof maybeIterable ? maybeIterable : null;
}
function getComponentName(type) {
if (null == type) return null;
if ("function" === typeof type) return type.displayName || type.name || null;
if ("string" === typeof type) return type;
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if ("object" === typeof type)
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
return (type.displayName || "Context") + ".Consumer";
case REACT_PROVIDER_TYPE:
return (type._context.displayName || "Context") + ".Provider";
case REACT_FORWARD_REF_TYPE:
var innerType = type.render;
innerType = innerType.displayName || innerType.name || "";
return (
type.displayName ||
("" !== innerType ? "ForwardRef(" + innerType + ")" : "ForwardRef")
);
case REACT_MEMO_TYPE:
return getComponentName(type.type);
case REACT_BLOCK_TYPE:
return getComponentName(type._render);
case REACT_LAZY_TYPE:
innerType = type._payload;
type = type._init;
try {
return getComponentName(type(innerType));
} catch (x) {}
}
return null;
}
function getNearestMountedFiber(fiber) {
var node = fiber,
nearestMounted = fiber;
if (fiber.alternate) for (; node.return; ) node = node.return;
else {
fiber = node;
do
(node = fiber),
0 !== (node.flags & 1026) && (nearestMounted = node.return),
(fiber = node.return);
while (fiber);
}
return 3 === node.tag ? nearestMounted : null;
}
function assertIsMounted(fiber) {
if (getNearestMountedFiber(fiber) !== fiber)
throw Error("Unable to find node on an unmounted component.");
}
function findCurrentFiberUsingSlowPath(fiber) {
var alternate = fiber.alternate;
if (!alternate) {
alternate = getNearestMountedFiber(fiber);
if (null === alternate)
throw Error("Unable to find node on an unmounted component.");
return alternate !== fiber ? null : fiber;
}
for (var a = fiber, b = alternate; ; ) {
var parentA = a.return;
if (null === parentA) break;
var parentB = parentA.alternate;
if (null === parentB) {
b = parentA.return;
if (null !== b) {
a = b;
continue;
}
break;
}
if (parentA.child === parentB.child) {
for (parentB = parentA.child; parentB; ) {
if (parentB === a) return assertIsMounted(parentA), fiber;
if (parentB === b) return assertIsMounted(parentA), alternate;
parentB = parentB.sibling;
}
throw Error("Unable to find node on an unmounted component.");
}
if (a.return !== b.return) (a = parentA), (b = parentB);
else {
for (var didFindChild = !1, child$1 = parentA.child; child$1; ) {
if (child$1 === a) {
didFindChild = !0;
a = parentA;
b = parentB;
break;
}
if (child$1 === b) {
didFindChild = !0;
b = parentA;
a = parentB;
break;
}
child$1 = child$1.sibling;
}
if (!didFindChild) {
for (child$1 = parentB.child; child$1; ) {
if (child$1 === a) {
didFindChild = !0;
a = parentB;
b = parentA;
break;
}
if (child$1 === b) {
didFindChild = !0;
b = parentB;
a = parentA;
break;
}
child$1 = child$1.sibling;
}
if (!didFindChild)
throw Error(
"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
);
}
}
if (a.alternate !== b)
throw Error(
"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
);
}
if (3 !== a.tag)
throw Error("Unable to find node on an unmounted component.");
return a.stateNode.current === a ? fiber : alternate;
}
function findCurrentHostFiber(parent) {
parent = findCurrentFiberUsingSlowPath(parent);
if (!parent) return null;
for (var node = parent; ; ) {
if (5 === node.tag || 6 === node.tag) return node;
if (node.child) (node.child.return = node), (node = node.child);
else {
if (node === parent) break;
for (; !node.sibling; ) {
if (!node.return || node.return === parent) return null;
node = node.return;
}
node.sibling.return = node.return;
node = node.sibling;
}
}
return null;
}
function doesFiberContain(parentFiber, childFiber) {
for (
var parentFiberAlternate = parentFiber.alternate;
null !== childFiber;
) {
if (childFiber === parentFiber || childFiber === parentFiberAlternate)
return !0;
childFiber = childFiber.return;
}
return !1;
}
var emptyObject = {},
removedKeys = null,
removedKeyCount = 0,
deepDifferOptions = { unsafelyIgnoreFunctions: !0 };
function defaultDiffer(prevProp, nextProp) {
return "object" !== typeof nextProp || null === nextProp
? !0
: ReactNativePrivateInterface.deepDiffer(
prevProp,
nextProp,
deepDifferOptions
);
}
function restoreDeletedValuesInNestedArray(
updatePayload,
node,
validAttributes
) {
if (Array.isArray(node))
for (var i = node.length; i-- && 0 < removedKeyCount; )
restoreDeletedValuesInNestedArray(
updatePayload,
node[i],
validAttributes
);
else if (node && 0 < removedKeyCount)
for (i in removedKeys)
if (removedKeys[i]) {
var nextProp = node[i];
if (void 0 !== nextProp) {
var attributeConfig = validAttributes[i];
if (attributeConfig) {
"function" === typeof nextProp && (nextProp = !0);
"undefined" === typeof nextProp && (nextProp = null);
if ("object" !== typeof attributeConfig)
updatePayload[i] = nextProp;
else if (
"function" === typeof attributeConfig.diff ||
"function" === typeof attributeConfig.process
)
(nextProp =
"function" === typeof attributeConfig.process
? attributeConfig.process(nextProp)
: nextProp),
(updatePayload[i] = nextProp);
removedKeys[i] = !1;
removedKeyCount--;
}
}
}
}
function diffNestedProperty(
updatePayload,
prevProp,
nextProp,
validAttributes
) {
if (!updatePayload && prevProp === nextProp) return updatePayload;
if (!prevProp || !nextProp)
return nextProp
? addNestedProperty(updatePayload, nextProp, validAttributes)
: prevProp
? clearNestedProperty(updatePayload, prevProp, validAttributes)
: updatePayload;
if (!Array.isArray(prevProp) && !Array.isArray(nextProp))
return diffProperties(updatePayload, prevProp, nextProp, validAttributes);
if (Array.isArray(prevProp) && Array.isArray(nextProp)) {
var minLength =
prevProp.length < nextProp.length ? prevProp.length : nextProp.length,
i;
for (i = 0; i < minLength; i++)
updatePayload = diffNestedProperty(
updatePayload,
prevProp[i],
nextProp[i],
validAttributes
);
for (; i < prevProp.length; i++)
updatePayload = clearNestedProperty(
updatePayload,
prevProp[i],
validAttributes
);
for (; i < nextProp.length; i++)
updatePayload = addNestedProperty(
updatePayload,
nextProp[i],
validAttributes
);
return updatePayload;
}
return Array.isArray(prevProp)
? diffProperties(
updatePayload,
ReactNativePrivateInterface.flattenStyle(prevProp),
nextProp,
validAttributes
)
: diffProperties(
updatePayload,
prevProp,
ReactNativePrivateInterface.flattenStyle(nextProp),
validAttributes
);
}
function addNestedProperty(updatePayload, nextProp, validAttributes) {
if (!nextProp) return updatePayload;
if (!Array.isArray(nextProp))
return diffProperties(
updatePayload,
emptyObject,
nextProp,
validAttributes
);
for (var i = 0; i < nextProp.length; i++)
updatePayload = addNestedProperty(
updatePayload,
nextProp[i],
validAttributes
);
return updatePayload;
}
function clearNestedProperty(updatePayload, prevProp, validAttributes) {
if (!prevProp) return updatePayload;
if (!Array.isArray(prevProp))
return diffProperties(
updatePayload,
prevProp,
emptyObject,
validAttributes
);
for (var i = 0; i < prevProp.length; i++)
updatePayload = clearNestedProperty(
updatePayload,
prevProp[i],
validAttributes
);
return updatePayload;
}
function diffProperties(updatePayload, prevProps, nextProps, validAttributes) {
var attributeConfig, propKey;
for (propKey in nextProps)
if ((attributeConfig = validAttributes[propKey])) {
var prevProp = prevProps[propKey];
var nextProp = nextProps[propKey];
"function" === typeof nextProp &&
((nextProp = !0), "function" === typeof prevProp && (prevProp = !0));
"undefined" === typeof nextProp &&
((nextProp = null),
"undefined" === typeof prevProp && (prevProp = null));
rem