143 lines
6.7 KiB
JavaScript
143 lines
6.7 KiB
JavaScript
/* Metro module 951; source: unknown; dependencies: [77, 948, 908, 950] */
|
|
import * as Module00077Module from './module-00077.js'; /* Metro dependency 77 */
|
|
|
|
function _fun10085(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1078:6, offset: 0x00d7c130, size: 110 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const getNotificationAttributes2 = getNotificationAttributes;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.buildTypeSpecificAttributes = buildTypeSpecificAttributes;
|
|
exports.getNotificationAttributes = getNotificationAttributes2;
|
|
function getNotificationAttributes(a0, a1, a2) { // fn#10086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1078:44, offset: 0x00d7c19e, size: 896 bytes, params: 4, frame: 19
|
|
var r3;
|
|
var data;
|
|
var uri;
|
|
var value;
|
|
var MCP_RESOURCE_URI_ATTRIBUTE;
|
|
var String;
|
|
var moduleValue;
|
|
var parseStringToURLObject;
|
|
var stringToURLObject;
|
|
var protocol;
|
|
var MCP_LOGGING_DATA_TYPE_ATTRIBUTE;
|
|
var MCP_LOGGING_MESSAGE_ATTRIBUTE;
|
|
const object = {};
|
|
if (a0 === 'notifications/cancelled') {
|
|
value = a1 != null;
|
|
if (value && a1.requestId) {
|
|
object['mcp.cancelled.request_id'] = global.String(a1.requestId);
|
|
}
|
|
value = a1 != null;
|
|
if (value && a1.reason) {
|
|
object['mcp.cancelled.reason'] = global.String(a1.reason);
|
|
}
|
|
} else if (a0 === 'notifications/message') {
|
|
value = a1 != null;
|
|
r3 = value && a1.level;
|
|
if (r3) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_LOGGING_LEVEL_ATTRIBUTE] = global.String(a1.level);
|
|
}
|
|
value = a1 != null;
|
|
r3 = value && a1.logger;
|
|
if (r3) {
|
|
object[(require(948) /* metro dependency 948 */).MCP_LOGGING_LOGGER_ATTRIBUTE] = global.String(a1.logger);
|
|
}
|
|
value = undefined;
|
|
data = a1 == null ? value : a1.data;
|
|
if (value !== data) {
|
|
MCP_LOGGING_DATA_TYPE_ATTRIBUTE = (require(948) /* metro dependency 948 */).MCP_LOGGING_DATA_TYPE_ATTRIBUTE;
|
|
data = a1.data;
|
|
object[MCP_LOGGING_DATA_TYPE_ATTRIBUTE] = typeof data;
|
|
if (a2) {
|
|
MCP_LOGGING_MESSAGE_ATTRIBUTE = (require(948) /* metro dependency 948 */).MCP_LOGGING_MESSAGE_ATTRIBUTE;
|
|
data = a1.data;
|
|
object[MCP_LOGGING_MESSAGE_ATTRIBUTE] = typeof data === 'string' ? data : global.JSON.stringify(data);
|
|
}
|
|
}
|
|
} else if (a0 === 'notifications/progress') {
|
|
value = a1 != null;
|
|
if (value && a1.progressToken) {
|
|
object['mcp.progress.token'] = global.String(a1.progressToken);
|
|
}
|
|
value = undefined;
|
|
if (typeof (a1 == null ? value : a1.progress) === 'number') {
|
|
object['mcp.progress.current'] = a1.progress;
|
|
}
|
|
if (typeof (a1 == null ? value : a1.total) === 'number') {
|
|
object['mcp.progress.total'] = a1.total;
|
|
if (typeof (a1 == null ? value : a1.progress) === 'number') {
|
|
object['mcp.progress.percentage'] = a1.progress / a1.total * 100;
|
|
}
|
|
}
|
|
if (a1 != null && a1.message) {
|
|
object['mcp.progress.message'] = global.String(a1.message);
|
|
}
|
|
} else if (a0 === 'notifications/resources/updated') {
|
|
if (a1 != null) {
|
|
uri = a1.uri;
|
|
if (uri) {
|
|
MCP_RESOURCE_URI_ATTRIBUTE = (require(948) /* metro dependency 948 */).MCP_RESOURCE_URI_ATTRIBUTE;
|
|
String = global.String;
|
|
uri = a1.uri;
|
|
object[MCP_RESOURCE_URI_ATTRIBUTE] = String(uri);
|
|
moduleValue = require(908) /* metro dependency 908 */;
|
|
parseStringToURLObject = moduleValue.parseStringToURLObject;
|
|
String = global.String;
|
|
uri = a1.uri;
|
|
stringToURLObject = Reflect.apply(parseStringToURLObject, moduleValue, [String(uri)]);
|
|
if (stringToURLObject) {
|
|
value = require(908) /* metro dependency 908 */;
|
|
value = !value.isURLObjectRelative(stringToURLObject);
|
|
r3 = value;
|
|
} else {
|
|
r3 = stringToURLObject;
|
|
}
|
|
if (r3) {
|
|
protocol = stringToURLObject.protocol;
|
|
object['mcp.resource.protocol'] = protocol.replace(':', '');
|
|
}
|
|
}
|
|
}
|
|
} else if (a0 === 'notifications/initialized') {
|
|
object['mcp.lifecycle.phase'] = 'initialization_complete';
|
|
object['mcp.protocol.ready'] = 1;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function buildTypeSpecificAttributes(a0, a1, a2, a3) { // fn#10087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1078:1593, offset: 0x00d7c51e, size: 256 bytes, params: 5, frame: 26
|
|
var r3;
|
|
var r1;
|
|
var moduleValue;
|
|
var value4;
|
|
var Object;
|
|
var assign;
|
|
var attributes;
|
|
var moduleValue2;
|
|
let value = a2;
|
|
if (a0 === 'request') {
|
|
moduleValue = require(950) /* metro dependency 950 */;
|
|
value4 = moduleValue.extractTargetInfo(a1.method, value || ({}));
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
r3 = a1.id !== undefined && Module00077Module({}, (require(948) /* metro dependency 948 */).MCP_REQUEST_ID_ATTRIBUTE,
|
|
global.String(a1.id));
|
|
attributes = value4.attributes;
|
|
if (a3) {
|
|
moduleValue2 = require(950) /* metro dependency 950 */;
|
|
value = moduleValue2.getRequestArguments(a1.method, value || ({}));
|
|
r1 = value;
|
|
} else {
|
|
r1 = {};
|
|
}
|
|
return Reflect.apply(assign, Object, [{}, r3, attributes, r1]);
|
|
}
|
|
return getNotificationAttributes(a1.method, value || ({}), a3);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun10085, 951, [77, 948, 908, 950]) /* metro module 951, dependencies: [77, 948, 908, 950] */;
|