/* Metro module 7766; source: unknown; dependencies: [31, 33, 7760, 7765] */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as Module07760Module from './module-07760.js'; /* Metro dependency 7760 */
function _fun62148(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#62148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7944:6, offset: 0x01b58a08, size: 249 bytes, params: 8, frame: 19
const env0_0 = require;
const extractFont2 = extractFont;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
const env0_6 = RegExp('^\\s*((?:(?:normal|bold|italic)\\s+)*)(?:(\\d+(?:\\.\\d+)?(?:%|px|em|pt|pc|mm|cm|in]))*(?:\\s*\\/.*?)?\\s+)?\\s*"?([^"]*)',
'i');
const env0_7 = RegExp('^[\\s"\']*', '');
const env0_8 = RegExp('[\\s"\']*$', '');
const env0_9 = RegExp('\\s*,\\s*', 'g');
const env0_10 = {};
exports.default = extractText;
exports.extractFont = extractFont2;
exports.setTSpan = function(a0) {
env0_3 = a0;
};
function extractSingleFontFamily(a0) { // fn#62149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7944:301, offset: 0x01b58b01, size: 67 bytes, params: 2, frame: 15
return a0 ? a0.split(env0_9)[0].replace(env0_7, '').replace(env0_8, '') : null;
}
function extractFont({fontData, fontStyle, fontVariant, fontWeight, fontStretch, fontSize, fontFamily, textAnchor, textDecoration, letterSpacing, wordSpacing, kerning, fontFeatureSettings, fontVariantLigatures, fontVariationSettings, font}) { // fn#62150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7944:393, offset: 0x01b58b44, size: 494 bytes, params: 2, frame: 32
var r7;
var r0;
var r3;
var hasOwnProperty;
var binding;
var value3;
var regexp;
var value4;
var value5;
var property;
var value7;
var value;
const pickNotNil = Module07760Module.pickNotNil;
let object = {fontData: fontData, fontStyle: fontStyle, fontVariant: fontVariant, fontWeight: fontWeight,
fontStretch: fontStretch, fontSize: fontSize};
object.fontFamily = extractSingleFontFamily(fontFamily);
object.textAnchor = textAnchor;
object.textDecoration = textDecoration;
object.letterSpacing = letterSpacing;
object.wordSpacing = wordSpacing;
object.kerning = kerning;
object.fontFeatureSettings = fontFeatureSettings;
object.fontVariantLigatures = fontVariantLigatures;
object.fontVariationSettings = fontVariationSettings;
const value2 = Reflect.apply(pickNotNil, Module07760Module, [object]);
if (typeof font !== 'string') {
r3 = font;
} else {
hasOwnProperty = global.Object.prototype.hasOwnProperty;
if (hasOwnProperty.call(env0_10, font)) {
r0 = env0_10[font];
} else {
binding = env0_6;
value3 = binding.exec(font);
if (value3) {
regexp = RegExp('bold', '');
value4 = regexp.exec(value3[1]);
regexp = RegExp('italic', '');
value5 = regexp.exec(value3[1]);
binding = env0_10;
object = {};
property = value3[2];
r7 = property || 12;
object.fontSize = r7;
value7 = 'normal';
object.fontWeight = value4 ? 'bold' : value7;
r7 = value5 ? 'italic' : value7;
object.fontStyle = r7;
object.fontFamily = extractSingleFontFamily(value3[3]);
binding[font] = object;
property = env0_10[font];
r0 = property;
} else {
value = null;
env0_10[font] = value;
r0 = value;
}
}
r3 = r0;
}
const Object = global.Object;
return Object.assign({}, r3, value2);
}
function getChild(a0) { // fn#62151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7944:1331, offset: 0x01b58d32, size: 65 bytes, params: 2, frame: 16
var r0;
let value = a0;
const value2 = typeof value;
if (value2 === 'string') {
value = ((Component) => {global.String(value)})(env0_3);
r0 = value;
} else if (value2 !== 'number') {
r0 = value;
} else {
value = ((Component) => {global.String(value)})(env0_3);
r0 = value;
}
return r0;
}
function extractText(a0, a1) { // fn#62152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7944:1435, offset: 0x01b58d73, size: 373 bytes, params: 3, frame: 27
const x = a0.x;
const y = a0.y;
const dx = a0.dx;
const dy = a0.dy;
const rotate = a0.rotate;
const children = a0.children;
const inlineSize = a0.inlineSize;
const baselineShift = a0.baselineShift;
const verticalAlign = a0.verticalAlign;
const alignmentBaseline = a0.alignmentBaseline;
let value = typeof children;
const r11 = (
value === 'string' || value === 'number'
? (
a1
? ((Component) => {global.String(children)})(env0_3)
: null
)
: Children.count(children) > 1 || global.Array.isArray(children) ? Children.map(children,
getChild) : children
);
const object = {};
value = null;
object.content = value !== r11 ? value : global.String(children);
object.children = r11;
object.inlineSize = inlineSize;
object.baselineShift = baselineShift;
object.verticalAlign = verticalAlign;
object.alignmentBaseline = alignmentBaseline;
object.font = extractFont(a0);
object.x = (importDefault(7765) /* metro dependency 7765 */)(x);
object.y = (importDefault(7765) /* metro dependency 7765 */)(y);
object.dx = (importDefault(7765) /* metro dependency 7765 */)(dx);
object.dy = (importDefault(7765) /* metro dependency 7765 */)(dy);
object.rotate = (importDefault(7765) /* metro dependency 7765 */)(rotate);
return object;
}
}
global.__d(_fun62148, 7766, [31, 33, 7760, 7765]) /* metro module 7766, dependencies: [31, 33, 7760, 7765] */;