@storybook/addon-ondevice-notes
Version:
Write notes for your react-native Storybook stories.
1,245 lines • 318 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
var __exportAll = (all, no_symbols) => {
let target = {};
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
return target;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
let storybook_manager_api = require("storybook/manager-api");
let storybook_internal_core_events = require("storybook/internal/core-events");
let react = require("react");
react = __toESM(react);
let react_native = require("react-native");
let react_jsx_runtime = require("react/jsx-runtime");
let _storybook_react_native_theming = require("@storybook/react-native-theming");
//#region ../../node_modules/react-is/cjs/react-is.production.min.js
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((exports) => {
var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
function z(a) {
if ("object" === typeof a && null !== a) {
var u = a.$$typeof;
switch (u) {
case c: switch (a = a.type, a) {
case l:
case m:
case e:
case g:
case f:
case p: return a;
default: switch (a = a && a.$$typeof, a) {
case k:
case n:
case t:
case r:
case h: return a;
default: return u;
}
}
case d: return u;
}
}
}
function A(a) {
return z(a) === m;
}
exports.AsyncMode = l;
exports.ConcurrentMode = m;
exports.ContextConsumer = k;
exports.ContextProvider = h;
exports.Element = c;
exports.ForwardRef = n;
exports.Fragment = e;
exports.Lazy = t;
exports.Memo = r;
exports.Portal = d;
exports.Profiler = g;
exports.StrictMode = f;
exports.Suspense = p;
exports.isAsyncMode = function(a) {
return A(a) || z(a) === l;
};
exports.isConcurrentMode = A;
exports.isContextConsumer = function(a) {
return z(a) === k;
};
exports.isContextProvider = function(a) {
return z(a) === h;
};
exports.isElement = function(a) {
return "object" === typeof a && null !== a && a.$$typeof === c;
};
exports.isForwardRef = function(a) {
return z(a) === n;
};
exports.isFragment = function(a) {
return z(a) === e;
};
exports.isLazy = function(a) {
return z(a) === t;
};
exports.isMemo = function(a) {
return z(a) === r;
};
exports.isPortal = function(a) {
return z(a) === d;
};
exports.isProfiler = function(a) {
return z(a) === g;
};
exports.isStrictMode = function(a) {
return z(a) === f;
};
exports.isSuspense = function(a) {
return z(a) === p;
};
exports.isValidElementType = function(a) {
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
};
exports.typeOf = z;
}));
//#endregion
//#region ../../node_modules/react-is/cjs/react-is.development.js
/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => {
if (process.env.NODE_ENV !== "production") (function() {
"use strict";
var hasSymbol = typeof Symbol === "function" && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
function isValidElementType(type) {
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
}
function typeOf(object) {
if (typeof object === "object" && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_ASYNC_MODE_TYPE:
case REACT_CONCURRENT_MODE_TYPE:
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE: return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE: return $$typeofType;
default: return $$typeof;
}
}
case REACT_PORTAL_TYPE: return $$typeof;
}
}
}
var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false;
function isAsyncMode(object) {
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true;
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
}
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
})();
}));
//#endregion
//#region ../../node_modules/react-is/index.js
var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
if (process.env.NODE_ENV === "production") module.exports = require_react_is_production_min();
else module.exports = require_react_is_development();
}));
//#endregion
//#region ../../node_modules/object-assign/index.js
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var require_object_assign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === void 0) throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) return false;
var test1 = /* @__PURE__ */ new String("abc");
test1[5] = "de";
if (Object.getOwnPropertyNames(test1)[0] === "5") return false;
var test2 = {};
for (var i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i;
if (Object.getOwnPropertyNames(test2).map(function(n) {
return test2[n];
}).join("") !== "0123456789") return false;
var test3 = {};
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") return false;
return true;
} catch (err) {
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) if (hasOwnProperty.call(from, key)) to[key] = from[key];
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]];
}
}
return to;
};
}));
//#endregion
//#region ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_ReactPropTypesSecret = /* @__PURE__ */ __commonJSMin(((exports, module) => {
module.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
}));
//#endregion
//#region ../../node_modules/prop-types/lib/has.js
var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => {
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
}));
//#endregion
//#region ../../node_modules/prop-types/checkPropTypes.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_checkPropTypes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
var printWarning = function() {};
if (process.env.NODE_ENV !== "production") {
var ReactPropTypesSecret = require_ReactPropTypesSecret();
var loggedTypeFailures = {};
var has = require_has();
printWarning = function(text) {
var message = "Warning: " + text;
if (typeof console !== "undefined") console.error(message);
try {
throw new Error(message);
} catch (x) {}
};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== "production") {
for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) {
var error;
try {
if (typeof typeSpecs[typeSpecName] !== "function") {
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
err.name = "Invariant Violation";
throw err;
}
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
if (error && !(error instanceof Error)) printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).");
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : "";
printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : ""));
}
}
}
}
/**
* Resets warning cache when testing.
*
* @private
*/
checkPropTypes.resetWarningCache = function() {
if (process.env.NODE_ENV !== "production") loggedTypeFailures = {};
};
module.exports = checkPropTypes;
}));
//#endregion
//#region ../../node_modules/prop-types/factoryWithTypeCheckers.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
var ReactIs = require_react_is();
var assign = require_object_assign();
var ReactPropTypesSecret = require_ReactPropTypesSecret();
var has = require_has();
var checkPropTypes = require_checkPropTypes();
var printWarning = function() {};
if (process.env.NODE_ENV !== "production") printWarning = function(text) {
var message = "Warning: " + text;
if (typeof console !== "undefined") console.error(message);
try {
throw new Error(message);
} catch (x) {}
};
function emptyFunctionThatReturnsNull() {
return null;
}
module.exports = function(isValidElement, throwOnDirectAccess) {
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = "@@iterator";
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === "function") return iteratorFn;
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = "<<anonymous>>";
var ReactPropTypes = {
array: createPrimitiveTypeChecker("array"),
bigint: createPrimitiveTypeChecker("bigint"),
bool: createPrimitiveTypeChecker("boolean"),
func: createPrimitiveTypeChecker("function"),
number: createPrimitiveTypeChecker("number"),
object: createPrimitiveTypeChecker("object"),
string: createPrimitiveTypeChecker("string"),
symbol: createPrimitiveTypeChecker("symbol"),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
elementType: createElementTypeTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker,
exact: createStrictShapeTypeChecker
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
if (x === y) return x !== 0 || 1 / x === 1 / y;
else return x !== x && y !== y;
}
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message, data) {
this.message = message;
this.data = data && typeof data === "object" ? data : {};
this.stack = "";
}
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== "production") {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
err.name = "Invariant Violation";
throw err;
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
var cacheKey = componentName + ":" + propName;
if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.");
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
}
return null;
} else return validate(props, propName, componentName, location, propFullName);
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
if (getPropType(propValue) !== expectedType) {
var preciseType = getPreciseType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType });
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
if (error instanceof Error) return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!ReactIs.isValidElementType(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
if (process.env.NODE_ENV !== "production") if (arguments.length > 1) printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).");
else printWarning("Invalid argument supplied to oneOf, expected an array.");
return emptyFunctionThatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) if (is(propValue, expectedValues[i])) return null;
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
if (getPreciseType(value) === "symbol") return String(value);
return value;
});
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
for (var key in propValue) if (has(propValue, key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error instanceof Error) return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
process.env.NODE_ENV !== "production" && printWarning("Invalid argument supplied to oneOfType, expected an instance of array.");
return emptyFunctionThatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== "function") {
printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + ".");
return emptyFunctionThatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
var expectedTypes = [];
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
if (checkerResult == null) return null;
if (checkerResult.data && has(checkerResult.data, "expectedType")) expectedTypes.push(checkerResult.data.expectedType);
}
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
return null;
}
return createChainableTypeChecker(validate);
}
function invalidValidatorError(componentName, location, propFullName, key, type) {
return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`.");
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error) return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function createStrictShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
for (var key in assign({}, props[propName], shapeTypes)) {
var checker = shapeTypes[key];
if (has(shapeTypes, key) && typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
if (!checker) return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " "));
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error) return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case "number":
case "string":
case "undefined": return true;
case "boolean": return !propValue;
case "object":
if (Array.isArray(propValue)) return propValue.every(isNode);
if (propValue === null || isValidElement(propValue)) return true;
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) if (!isNode(step.value)) return false;
} else while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) return false;
}
}
} else return false;
return true;
default: return false;
}
}
function isSymbol(propType, propValue) {
if (propType === "symbol") return true;
if (!propValue) return false;
if (propValue["@@toStringTag"] === "Symbol") return true;
if (typeof Symbol === "function" && propValue instanceof Symbol) return true;
return false;
}
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) return "array";
if (propValue instanceof RegExp) return "object";
if (isSymbol(propType, propValue)) return "symbol";
return propType;
}
function getPreciseType(propValue) {
if (typeof propValue === "undefined" || propValue === null) return "" + propValue;
var propType = getPropType(propValue);
if (propType === "object") {
if (propValue instanceof Date) return "date";
else if (propValue instanceof RegExp) return "regexp";
}
return propType;
}
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case "array":
case "object": return "an " + type;
case "boolean":
case "date":
case "regexp": return "a " + type;
default: return type;
}
}
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS;
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
}));
//#endregion
//#region ../../node_modules/prop-types/factoryWithThrowingShims.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var require_factoryWithThrowingShims = /* @__PURE__ */ __commonJSMin(((exports, module) => {
var ReactPropTypesSecret = require_ReactPropTypesSecret();
function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) return;
var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
err.name = "Invariant Violation";
throw err;
}
shim.isRequired = shim;
function getShim() {
return shim;
}
var ReactPropTypes = {
array: shim,
bigint: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
}));
//#endregion
//#region ../../node_modules/prop-types/index.js
var require_prop_types = /* @__PURE__ */ __commonJSMin(((exports, module) => {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (process.env.NODE_ENV !== "production") {
var ReactIs = require_react_is();
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, true);
} else module.exports = require_factoryWithThrowingShims()();
}));
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/getUniqueID.js
var import_prop_types = /* @__PURE__ */ __toESM(require_prop_types());
let uuid = (/* @__PURE__ */ new Date()).getTime();
function getUniqueID() {
uuid++;
return `rnmr_${uuid.toString(16)}`;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/getTokenTypeByToken.js
const regSelectOpenClose = /_open|_close/g;
/**
*
* @example {
"type": "heading_open",
"tag": "h1",
"attrs": null,
"map": [
1,
2
],
"nesting": 1,
"level": 0,
"children": null,
"content": "",
"markup": "#",
"info": "",
"meta": null,
"block": true,
"hidden": false
}
* @param token
* @return {String}
*/
function getTokenTypeByToken(token) {
let cleanedType = "unknown";
if (token.type) cleanedType = token.type.replace(regSelectOpenClose, "");
switch (cleanedType) {
case "heading":
cleanedType = `${cleanedType}${token.tag.substr(1)}`;
break;
default: break;
}
return cleanedType;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/tokensToAST.js
/**
*
* @param {{type: string, tag:string, content: string, children: *, attrs: Array, meta, info, block: boolean}} token
* @param {number} tokenIndex
* @return {{type: string, content, tokenIndex: *, index: number, attributes: {}, children: *}}
*/
function createNode(token, tokenIndex) {
const type = getTokenTypeByToken(token);
const content = token.content;
let attributes = {};
if (token.attrs) attributes = token.attrs.reduce((prev, curr) => {
const [name, value] = curr;
return {
...prev,
[name]: value
};
}, {});
return {
type,
sourceType: token.type,
sourceInfo: token.info,
sourceMeta: token.meta,
block: token.block,
markup: token.markup,
key: getUniqueID() + "_" + type,
content,
tokenIndex,
index: 0,
attributes,
children: tokensToAST(token.children)
};
}
/**
*
* @param {Array<{type: string, tag:string, content: string, children: *, attrs: Array}>}tokens
* @return {Array}
*/
function tokensToAST(tokens) {
let stack = [];
let children = [];
if (!tokens || tokens.length === 0) return [];
for (let i = 0; i < tokens.length; i++) {
const token = tokens[i];
const astNode = createNode(token, i);
if (!(astNode.type === "text" && astNode.children.length === 0 && astNode.content === "")) {
astNode.index = children.length;
if (token.nesting === 1) {
children.push(astNode);
stack.push(children);
children = astNode.children;
} else if (token.nesting === -1) children = stack.pop();
else if (token.nesting === 0) children.push(astNode);
}
}
return children;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/stringToTokens.js
function stringToTokens(source, markdownIt) {
let result = [];
try {
result = markdownIt.parse(source, {});
} catch (err) {
console.warn(err);
}
return result;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/flattenInlineTokens.js
function flattenTokens(tokens) {
return tokens.reduce((acc, curr) => {
if (curr.type === "inline" && curr.children && curr.children.length > 0) {
const children = flattenTokens(curr.children);
while (children.length) acc.push(children.shift());
} else acc.push(curr);
return acc;
}, []);
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/renderInlineAsText.js
function renderInlineAsText(tokens) {
var result = "";
for (var i = 0, len = tokens.length; i < len; i++) if (tokens[i].type === "text") result += tokens[i].content;
else if (tokens[i].type === "image") result += renderInlineAsText(tokens[i].children);
return result;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/cleanupTokens.js
function cleanupTokens(tokens) {
tokens = flattenTokens(tokens);
tokens.forEach((token) => {
token.type = getTokenTypeByToken(token);
if (token.type === "image" || token.type === "hardbreak") token.block = true;
if (token.type === "image") token.attrs[token.attrIndex("alt")][1] = renderInlineAsText(token.children);
});
/**
* changing a link token to a blocklink to fix issue where link tokens with
* nested non text tokens breaks component
*/
const stack = [];
tokens = tokens.reduce((acc, token, index) => {
if (token.type === "link" && token.nesting === 1) stack.push(token);
else if (stack.length > 0 && token.type === "link" && token.nesting === -1) {
if (stack.some((stackToken) => stackToken.block)) {
stack[0].type = "blocklink";
stack[0].block = true;
token.type = "blocklink";
token.block = true;
}
stack.push(token);
while (stack.length) acc.push(stack.shift());
} else if (stack.length > 0) stack.push(token);
else acc.push(token);
return acc;
}, []);
return tokens;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/Token.js
var Token$1 = class {
constructor(type, nesting = 0, children = null, block = false) {
this.type = type;
this.nesting = nesting;
this.children = children;
this.block = block;
}
};
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/groupTextTokens.js
function groupTextTokens(tokens) {
const result = [];
let hasGroup = false;
tokens.forEach((token, index) => {
if (!token.block && !hasGroup) {
hasGroup = true;
result.push(new Token$1("textgroup", 1));
result.push(token);
} else if (!token.block && hasGroup) result.push(token);
else if (token.block && hasGroup) {
hasGroup = false;
result.push(new Token$1("textgroup", -1));
result.push(token);
} else result.push(token);
});
return result;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/omitListItemParagraph.js
function omitListItemParagraph(tokens) {
let depth = null;
return tokens.filter((token, index) => {
if (depth !== null) depth = depth + token.nesting;
if (token.type === "list_item" && token.nesting === 1 && depth === null) {
const next = index + 1 in tokens ? tokens[index + 1] : null;
if (next && next.type === "paragraph" && next.nesting === 1) {
depth = 0;
return true;
}
} else if (token.type === "paragraph") {
if (token.nesting === 1 && depth === 1) return false;
else if (token.nesting === -1 && depth === 0) {
depth = null;
return false;
}
}
return true;
});
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/parser.js
/**
*
* @param {string} source
* @param {function} [renderer]
* @param {AstRenderer} [markdownIt]
* @return {View}
*/
function parser(source, renderer, markdownIt) {
if (Array.isArray(source)) return renderer(source);
let tokens = stringToTokens(source, markdownIt);
tokens = cleanupTokens(tokens);
tokens = groupTextTokens(tokens);
tokens = omitListItemParagraph(tokens);
return renderer(tokensToAST(tokens));
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/hasParents.js
/**
*
* @param {Array} parents
* @param {string} type
* @return {boolean}
*/
function hasParents(parents, type) {
return parents.findIndex((el) => el.type === type) > -1;
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/util/openUrl.js
function openUrl(url, customCallback) {
if (customCallback) {
const result = customCallback(url);
if (url && result && typeof result === "boolean") react_native.Linking.openURL(url);
} else if (url) react_native.Linking.openURL(url);
}
//#endregion
//#region ../../node_modules/react-native-markdown-display/src/lib/data/textStyleProps.js
var import_FitImage = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => {
var __extends = exports && exports.__extends || (function() {
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
d.__proto__ = b;
} || function(d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return function(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = exports && exports.__assign || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
exports.__esModule = true;
var PropTypes = require_prop_types();
var React$3 = require("react");
var react_1 = require("react");
var react_native_1 = require("react-native");
var propTypes = __assign({}, react_native_1.Image.propTypes, {
indicator: PropTypes.bool,
indicatorColor: PropTypes.string,
indicatorSize: PropTypes.oneOfType([PropTypes.oneOf(["small", "large"]), PropTypes.number]),
originalHeight: PropTypes.number,
originalWidth: PropTypes.number
});
var styles = react_native_1.StyleSheet.create({ container: {
alignItems: "center",
justifyContent: "center"
} });
exports["default"] = function(_super) {
__extends(FitImage, _super);
function FitImage(props) {
var _this = _super.call(this, props) || this;
_this.ImageComponent = react_native_1.ImageBackground || react_native_1.Image;
_this.mounted = false;
_this.sizeStyle = {};
_this.shouldDisplayIndicator = function() {
return _this.state.isLoading && _this.props.indicator !== false;
};
_this.onLoad = function() {
if (_this.state.isLoading) _this.setState({ isLoading: false });
if (typeof _this.props.onLoad === "function") _this.props.onLoad();
};
_this.onLoadStart = function() {
if (_this.isFirstLoad) {
_this.setState({ isLoading: true });
_this.isFirstLoad = false;
}
};
_this.onError = function() {
if (_this.state.isLoading) _this.setState({ isLoading: false });
};
_this.getHeight = function() {
if (_this.style && _this.style.height) return Number(_this.style.height);
return Math.round(_this.getOriginalHeight() * _this.getRatio());
};
_this.getOriginalHeight = function() {
return _this.props.originalHeight || _this.state.originalHeight || 0;
};
_this.getOriginalWidth = function() {
return _this.props.originalWidth || _this.state.originalWidth || 0;
};
_this.getRatio = function() {
if (_this.getOriginalWidth() === 0) return 0;
return _this.state.layoutWidth / _this.getOriginalWidth();
};
_this.onLayout = function(event) {
var layoutWidth = event.nativeEvent.layout.width;
_this.setState({ layoutWidth });
};
_this.fetchOriginalSizeFromRemoteImage = function() {
var uri;
if (_this.props.source instanceof Array) uri = _this.props.source[0].uri;
else uri = _this.props.source.uri;
if (!uri) return;
react_native_1.Image.getSize(uri, function(originalWidth, originalHeight) {
if (!_this.mounted) return;
_this.setOriginalSize(originalWidth, originalHeight);
}, function() {
return null;
});
};
_this.setOriginalSize = function(originalWidth, originalHeight) {
_this.setState({
originalHeight,
originalWidth
});
};
_this.renderActivityIndicator = function() {
return React$3.createElement(react_native_1.ActivityIndicator, {
color: _this.props.indicatorColor,
size: _this.props.indicatorSize
});
};
_this.style = react_native_1.StyleSheet.flatten(props.style);
if (_this.style) {
if ([_this.style.width, _this.style.height].filter(Boolean).length === 1) thr