367 lines
17 KiB
TypeScript
367 lines
17 KiB
TypeScript
/* Metro module 10216; source: modules/now_playing/native/UserActivitySpotify.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 6868, 33, 1582, 507, 3853, 10217, 4578, 8381, 1244, 1305, 2] */
|
|
function _fun79435(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:6, offset: 0x01e5426d, size: 506 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const closure = function() {
|
|
return Linking.canOpenURL('' + SPOTIFY_APP_PROTOCOL + ':');
|
|
};
|
|
const closure2 = function() {
|
|
var Identifier = importAll(dependencyMap[9]).getConstants().Identifier;
|
|
var HTTP = require(dependencyMap[10]).HTTP;
|
|
var object = {};
|
|
object.url = SpotifyEndpoints.INSTALL_ATTRIBUTION(Identifier);
|
|
object.rejectWithError = true;
|
|
HTTP.get(object);
|
|
};
|
|
const closure3 = openUrl_79442;
|
|
const closure4 = openTrack;
|
|
const closure5 = openArtist;
|
|
const closure6 = openAlbum;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_9 = value2.Linking;
|
|
const env0_10 = value2.View;
|
|
const spotifyConstantsModule = require(6868) /* metro dependency 6868: SpotifyConstants */;
|
|
const env0_11 = spotifyConstantsModule.SPOTIFY_APP_PROTOCOL;
|
|
const env0_12 = spotifyConstantsModule.SpotifyEndpoints;
|
|
const env0_13 = spotifyConstantsModule.SpotifyResourceTypes;
|
|
const value4 = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value4.jsx;
|
|
const env0_15 = value4.jsxs;
|
|
let PureComponent = value.PureComponent;
|
|
const value5 = _fun79455(PureComponent);
|
|
PureComponent = value.PureComponent;
|
|
const value6 = _fun79460(PureComponent);
|
|
PureComponent = value.PureComponent;
|
|
value = _fun79467(PureComponent);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/now_playing/native/UserActivitySpotify.tsx');
|
|
exports.canOpenSpotifyUrl = closure;
|
|
exports.attributeInstall = closure2;
|
|
exports.openUrl = closure3;
|
|
exports.openTrack = closure4;
|
|
exports.openArtist = closure5;
|
|
exports.openAlbum = closure6;
|
|
exports.SpotifyPlayButton = SpotifyPlayButton;
|
|
exports.SpotifyTrack = value5;
|
|
exports.SpotifyArtists = value6;
|
|
exports.SpotifyAlbum = value;
|
|
}
|
|
|
|
function _callSuper_79436(a0, a1, a2) { // fn#79436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:297, offset: 0x01e54467, size: 100 bytes, params: 4, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = a2;
|
|
const value3 = env0_7(a1);
|
|
const binding = env0_6;
|
|
if (_isNativeReflectConstruct_79437()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value3, value || [], env0_7(a0).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value3.apply(a0, value);
|
|
r0 = value;
|
|
}
|
|
return binding(a0, r0);
|
|
}
|
|
|
|
function _isNativeReflectConstruct_79437() { // fn#79437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:428, offset: 0x01e544cb, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_79437_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function openUrl_79442(a0, a1, a2) { // fn#79442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:816, offset: 0x01e545c5, size: 137 bytes, params: 4, frame: 20
|
|
var r0;
|
|
var defaultImport;
|
|
var value;
|
|
if (a0) {
|
|
value = Linking.openURL(SpotifyEndpoints.PLAYER_OPEN(a1, a2, true, 'mobile'));
|
|
value = value.catch(function() {
|
|
});
|
|
r0 = value;
|
|
} else {
|
|
defaultImport = importDefault(3853) /* metro dependency 3853: Linking */;
|
|
r0 = defaultImport.openURL(SpotifyEndpoints.WEB_OPEN(a1, a2, 'mobile'));
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function openTrack({sync_id}) { // fn#79444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:950, offset: 0x01e5464e, size: 65 bytes, params: 2, frame: 13
|
|
let value = canOpenSpotifyUrl();
|
|
value = value.then(function(a0) {
|
|
var openUrl_79442Binding = openUrl_79442;
|
|
var TRACK = SpotifyResourceTypes.TRACK;
|
|
return openUrl_79442Binding(a0, TRACK, sync_id);
|
|
});
|
|
value.catch(function() {
|
|
});
|
|
}
|
|
|
|
function openArtist(a0, a1, a2) { // fn#79447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1056, offset: 0x01e546b5, size: 73 bytes, params: 4, frame: 13
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
let value = canOpenSpotifyUrl();
|
|
value = value.then(_fun79448);
|
|
value.catch(function() {
|
|
});
|
|
}
|
|
|
|
function openAlbum(a0, a1) { // fn#79451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1243, offset: 0x01e54781, size: 66 bytes, params: 3, frame: 13
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
let value = canOpenSpotifyUrl();
|
|
value = value.then(_fun79452);
|
|
value.catch(function() {
|
|
});
|
|
}
|
|
|
|
function _fun79455(a0) { // fn#79455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1410, offset: 0x01e5483b, size: 72 bytes, params: 2, frame: 15
|
|
const closure = SpotifyTrack;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'render', value: value_79458}]);
|
|
}
|
|
|
|
function _fun79460(a0) { // fn#79460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1842, offset: 0x01e5497c, size: 99 bytes, params: 2, frame: 16
|
|
const closure = SpotifyArtists;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'renderLink', value: value_79463}, {key: 'render', value: value_79465}]);
|
|
}
|
|
|
|
function _fun79467(a0) { // fn#79467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2517, offset: 0x01e54bc4, size: 72 bytes, params: 2, frame: 15
|
|
const closure = SpotifyAlbum;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'render', value: value_79470}]);
|
|
}
|
|
|
|
function SpotifyPlayButton({activity, style}) { // fn#79471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:3191, offset: 0x01e54cd2, size: 225 bytes, params: 2, frame: 23
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const object = {};
|
|
const Button2 = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const Icon = Button2.Icon;
|
|
object.icon = <Icon source={importDefault(8381) /* metro dependency 8381 */} />;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const LEgD7t = (require(1244) /* metro dependency 1244: indexNative */).t.LEgD7t;
|
|
object.text = Reflect.apply(formatToPlainString, intl, [LEgD7t, {platform: activity.name}]);
|
|
object.size = 'sm';
|
|
object.onPress = onPress_79472;
|
|
object.grow = true;
|
|
return (
|
|
<View style={style}>
|
|
<Button {...object} />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun79448(a0) { // fn#79448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1109, offset: 0x01e546fe, size: 76 bytes, params: 2, frame: 14
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
const getSpotifyMetadataFromActivity = (require(10217) /* metro dependency 10217: SpotifyUtils */).getSpotifyMetadataFromActivity;
|
|
value = Reflect.apply(getSpotifyMetadataFromActivity, value, [env0_0, require]);
|
|
return value.then(_fun79449);
|
|
}
|
|
|
|
function _fun79452(a0) { // fn#79452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1293, offset: 0x01e547c3, size: 76 bytes, params: 2, frame: 14
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
const getSpotifyMetadataFromActivity = (require(10217) /* metro dependency 10217: SpotifyUtils */).getSpotifyMetadataFromActivity;
|
|
value = Reflect.apply(getSpotifyMetadataFromActivity, value, [env0_0, require]);
|
|
return value.then(_fun79453);
|
|
}
|
|
|
|
function SpotifyTrack(a0) { // fn#79456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1422, offset: 0x01e54883, size: 79 bytes, params: 2, frame: 18
|
|
let value = copyRestArgs(0, undefined);
|
|
env1_4(this, SpotifyTrack);
|
|
const _callSuper_79436Binding = _callSuper_79436;
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
value = _callSuper_79436Binding(this, SpotifyTrack, items2);
|
|
value.handleOpenSpotifyTrack = handleOpenSpotifyTrack;
|
|
return value;
|
|
}
|
|
|
|
function value_79458() { // fn#79458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1645, offset: 0x01e548f4, size: 95 bytes, params: 1, frame: 15
|
|
const props = this.props;
|
|
const text = props.text;
|
|
const env0_1 = props.onPress;
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
return (
|
|
<LegacyText onPress={onPress_79459} suppressHighlighting>
|
|
{text}
|
|
</LegacyText>
|
|
);
|
|
}
|
|
|
|
function SpotifyArtists(a0) { // fn#79461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1854, offset: 0x01e549df, size: 79 bytes, params: 2, frame: 18
|
|
let value = copyRestArgs(0, undefined);
|
|
env1_4(this, SpotifyArtists);
|
|
const _callSuper_79436Binding = _callSuper_79436;
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
value = _callSuper_79436Binding(this, SpotifyArtists, items2);
|
|
value.handleOpenSpotifyArtist = handleOpenSpotifyArtist;
|
|
return value;
|
|
}
|
|
|
|
function value_79463(a0, a1, a2) { // fn#79463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2111, offset: 0x01e54a5a, size: 160 bytes, params: 4, frame: 20
|
|
var environment;
|
|
const env0_1 = a1;
|
|
const env0_2 = this.props.onPress;
|
|
const value = environment.__proto__;
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
const LegacyText2 = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
const items2 = [<LegacyText2 onPress={onPress_79464} suppressHighlighting>{a0}</LegacyText2>];
|
|
items2[1] = a2 ? '' : ', ';
|
|
return (
|
|
<LegacyText key={a1}>
|
|
{items2}
|
|
</LegacyText>
|
|
);
|
|
}
|
|
|
|
function value_79465() { // fn#79465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2348, offset: 0x01e54b28, size: 118 bytes, params: 1, frame: 16
|
|
const value = this.props.artists.split('; ');
|
|
const env0_1 = value.length - 1;
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
return (
|
|
<LegacyText>
|
|
{value.map(_fun79466)}
|
|
</LegacyText>
|
|
);
|
|
}
|
|
|
|
function SpotifyAlbum(a0) { // fn#79468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2529, offset: 0x01e54c0c, size: 79 bytes, params: 2, frame: 18
|
|
let value = copyRestArgs(0, undefined);
|
|
env1_4(this, SpotifyAlbum);
|
|
const _callSuper_79436Binding = _callSuper_79436;
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
value = _callSuper_79436Binding(this, SpotifyAlbum, items2);
|
|
value.handleOpenSpotifyAlbum = handleOpenSpotifyAlbum;
|
|
return value;
|
|
}
|
|
|
|
function value_79470() { // fn#79470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2769, offset: 0x01e54c83, size: 79 bytes, params: 1, frame: 15
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
return (
|
|
<LegacyText onPress={this.handleOpenSpotifyAlbum} suppressHighlighting>
|
|
{this.props.text}
|
|
</LegacyText>
|
|
);
|
|
}
|
|
|
|
function SpotifyPlayButtonOnPress() { // fn#79472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:3429, owner: SpotifyPlayButton.onPress, offset: 0x01e54db3, size: 69 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const env0_0 = activity.sync_id;
|
|
let value = environment.__proto__;
|
|
value = canOpenSpotifyUrl();
|
|
value = value.then(_fun79473);
|
|
value.catch(function() {
|
|
});
|
|
}
|
|
|
|
function _fun79449({artist_ids}) { // fn#79449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1163, offset: 0x01e5474a, size: 55 bytes, params: 2, frame: 15
|
|
const property = artist_ids[importDefault];
|
|
const openUrl_79442Binding = openUrl_79442;
|
|
const binding = env0_0;
|
|
const ARTIST = SpotifyResourceTypes.ARTIST;
|
|
return openUrl_79442Binding(binding, ARTIST, property);
|
|
}
|
|
|
|
function _fun79453({album_id}) { // fn#79453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1347, offset: 0x01e5480f, size: 44 bytes, params: 2, frame: 15
|
|
const openUrl_79442Binding = openUrl_79442;
|
|
const binding = env0_0;
|
|
const ALBUM = SpotifyResourceTypes.ALBUM;
|
|
return openUrl_79442Binding(binding, ALBUM, album_id);
|
|
}
|
|
|
|
function handleOpenSpotifyTrack() { // fn#79457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1548, owner: SpotifyTrack.handleOpenSpotifyTrack, offset: 0x01e548d2, size: 34 bytes, params: 1, frame: 11
|
|
openTrack(env0_0.props.activity);
|
|
}
|
|
|
|
function value_79458OnPress() { // fn#79459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1732, owner: value_79458.onPress, offset: 0x01e54953, size: 41 bytes, params: 1, frame: 10
|
|
if (onPress != null) {
|
|
onPress();
|
|
}
|
|
env0_0.handleOpenSpotifyTrack();
|
|
}
|
|
|
|
function handleOpenSpotifyArtist(a0) { // fn#79462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1987, owner: SpotifyArtists.handleOpenSpotifyArtist, offset: 0x01e54a2e, size: 44 bytes, params: 2, frame: 15
|
|
const props = env0_0.props;
|
|
const openArtistBinding = openArtist;
|
|
const activity = props.activity;
|
|
const userId = props.userId;
|
|
openArtistBinding(activity, userId, a0);
|
|
}
|
|
|
|
function value_79463OnPress() { // fn#79464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2223, owner: value_79463.onPress, offset: 0x01e54afa, size: 46 bytes, params: 1, frame: 11
|
|
if (onPress != null) {
|
|
onPress();
|
|
}
|
|
env0_0.handleOpenSpotifyArtist(require);
|
|
}
|
|
|
|
function _fun79466(a0, a1) { // fn#79466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2455, offset: 0x01e54b9e, size: 38 bytes, params: 3, frame: 15
|
|
return env0_0.renderLink(a0, a1, a1 === env0_1);
|
|
}
|
|
|
|
function handleOpenSpotifyAlbum() { // fn#79469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2655, owner: SpotifyAlbum.handleOpenSpotifyAlbum, offset: 0x01e54c5b, size: 40 bytes, params: 1, frame: 13
|
|
const props = env0_0.props;
|
|
const openAlbumBinding = openAlbum;
|
|
const activity = props.activity;
|
|
const userId = props.userId;
|
|
openAlbumBinding(activity, userId);
|
|
}
|
|
|
|
function _fun79473(a0) { // fn#79473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:3476, offset: 0x01e54df8, size: 132 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var r0;
|
|
var defaultImport;
|
|
let value = environment.__proto__.__proto__;
|
|
if (a0) {
|
|
value = Linking.openURL(SpotifyEndpoints.PLAYER_OPEN(SpotifyResourceTypes.TRACK, sync_id));
|
|
value = value.catch(function() {
|
|
});
|
|
r0 = value;
|
|
} else {
|
|
attributeInstall();
|
|
defaultImport = importDefault(3853) /* metro dependency 3853: Linking */;
|
|
r0 = defaultImport.openURL(SpotifyEndpoints.APP_STORE);
|
|
}
|
|
return r0;
|
|
}
|
|
|