Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,327 @@
|
||||
/* Metro module 6869; source: modules/spotify/SpotifyActionCreators.tsx; dependencies: [6870, 6868, 661, 4041, 507, 694, 672, 477, 6871, 2] */
|
||||
function _fun54365(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:6, offset: 0x01363f14, size: 371 bytes, params: 8, frame: 22
|
||||
var object2;
|
||||
const env0_0 = require;
|
||||
const closure = apiRequest;
|
||||
const closure2 = getAccessToken;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const spotifyProtocolStore = importDefault(6870) /* metro dependency 6870: SpotifyProtocolStore */;
|
||||
let value = require(6868) /* metro dependency 6868: SpotifyConstants */;
|
||||
const env0_4 = value.SPOTIFY_APP_PROTOCOL;
|
||||
const env0_5 = value.SpotifyEndpoints;
|
||||
value = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_6 = value.AbortCodes;
|
||||
const env0_7 = value.Endpoints;
|
||||
const env0_8 = value.PlatformTypes;
|
||||
object2 = {};
|
||||
const bind = closure.bind;
|
||||
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
||||
const get = HTTP.get;
|
||||
object2.get = Reflect.apply(bind, closure, [null, get]);
|
||||
object2.put = closure.bind(null, HTTP.put);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyActionCreators.tsx');
|
||||
exports.SpotifyAPI = object2;
|
||||
exports.getAccessToken = closure2;
|
||||
exports.subscribePlayerStateNotifications = subscribePlayerStateNotifications;
|
||||
exports.getProfile = getProfile;
|
||||
exports.getDevices = getDevices;
|
||||
exports.play = play_54385;
|
||||
exports.pause = pause_54388;
|
||||
exports.fetchIsSpotifyProtocolRegistered = fetchIsSpotifyProtocolRegistered;
|
||||
exports.setActiveDevice = setActiveDevice_54392;
|
||||
}
|
||||
|
||||
function apiRequest(a0, a1, a2, a3) { // fn#54366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:219, offset: 0x01364087, size: 136 bytes, params: 5, frame: 17
|
||||
let value = a4;
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
const env0_2 = a3;
|
||||
const env0_3 = value !== undefined ? value : 1;
|
||||
const object2 = {};
|
||||
copyDataProperties(object2, a3, undefined);
|
||||
object2['headers'] = {authorization: 'Bearer ' + a2};
|
||||
value = a0(object2);
|
||||
value = value.then(function(a0) {
|
||||
var r0;
|
||||
var value = a0;
|
||||
if (value.status !== 202) {
|
||||
r0 = value;
|
||||
} else {
|
||||
value = global.Promise.reject(value);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
});
|
||||
return value.catch(_fun54368);
|
||||
}
|
||||
|
||||
function getAccessToken(a0) { // fn#54374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:780, offset: 0x0136429f, size: 124 bytes, params: 2, frame: 17
|
||||
const env0_0 = a0;
|
||||
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
||||
const get = HTTP.get;
|
||||
const CONNECTION_ACCESS_TOKEN = Endpoints.CONNECTION_ACCESS_TOKEN;
|
||||
const SPOTIFY = PlatformTypes.SPOTIFY;
|
||||
let value = Reflect.apply(get, HTTP, [{'url': null, 'oldFormErrors': true, 'rejectWithError': false,
|
||||
url: Reflect.apply(CONNECTION_ACCESS_TOKEN, Endpoints, [SPOTIFY, a0])}]);
|
||||
value = value.catch(_fun54375);
|
||||
return value.then(_fun54377);
|
||||
}
|
||||
|
||||
function subscribePlayerStateNotifications(a0, a1, a2) { // fn#54378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1544, offset: 0x01364494, size: 105 bytes, params: 4, frame: 18
|
||||
const value = a3;
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
const env0_2 = a2;
|
||||
const env0_3 = value !== undefined ? value : 2;
|
||||
const binding = env0_9;
|
||||
const put = binding.put;
|
||||
const NOTIFICATIONS_PLAYER = SpotifyEndpoints.NOTIFICATIONS_PLAYER;
|
||||
return Reflect.apply(put, binding, [a0, a1, {url: NOTIFICATIONS_PLAYER,
|
||||
query: {connection_id: a2}}]).catch(_fun54379);
|
||||
}
|
||||
|
||||
function getProfile(a0, a1) { // fn#54381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1803, offset: 0x01364588, size: 64 bytes, params: 3, frame: 16
|
||||
const env0_0 = a0;
|
||||
const binding = env0_9;
|
||||
const get = binding.get;
|
||||
const PROFILE = SpotifyEndpoints.PROFILE;
|
||||
return Reflect.apply(get, binding, [a0, a1, {url: PROFILE}]).then(_fun54382);
|
||||
}
|
||||
|
||||
function getDevices(a0, a1) { // fn#54383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1990, offset: 0x01364620, size: 64 bytes, params: 3, frame: 16
|
||||
const env0_0 = a0;
|
||||
const binding = env0_9;
|
||||
const get = binding.get;
|
||||
const PLAYER_DEVICES = SpotifyEndpoints.PLAYER_DEVICES;
|
||||
return Reflect.apply(get, binding, [a0, a1, {url: PLAYER_DEVICES}]).then(_fun54384);
|
||||
}
|
||||
|
||||
function play_54385(a0, a1, a2, a3) { // fn#54385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2169, offset: 0x013646b8, size: 273 bytes, params: 5, frame: 25
|
||||
let value = a4;
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
const env0_2 = a2;
|
||||
const value2 = undefined;
|
||||
const r2 = value !== value2 ? value : {};
|
||||
const value3 = SpotifyEndpoints.PLAYER_OPEN(a3, a2, false);
|
||||
const deviceId = r2.deviceId;
|
||||
const position = r2.position;
|
||||
const contextUri = r2.contextUri;
|
||||
const env0_5 = r2.repeat;
|
||||
const binding = env0_9;
|
||||
const put = binding.put;
|
||||
const PLAYER_PLAY = SpotifyEndpoints.PLAYER_PLAY;
|
||||
value = Reflect.apply(put, binding, [a0, a1, {url: PLAYER_PLAY, query: {device_id: deviceId},
|
||||
body: {context_uri: contextUri ?? value2, uris: contextUri == null ? [value3] : value2,
|
||||
offset: contextUri != null ? {uri: value3} : value2, position_ms: position ?? 0}}]);
|
||||
value = value.then(_fun54386);
|
||||
return value.then(_fun54387);
|
||||
}
|
||||
|
||||
function pause_54388(a0, a1) { // fn#54388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2644, offset: 0x0136487e, size: 61 bytes, params: 3, frame: 15
|
||||
const binding = env0_9;
|
||||
const put = binding.put;
|
||||
const PLAYER_PAUSE = SpotifyEndpoints.PLAYER_PAUSE;
|
||||
return Reflect.apply(put, binding, [a0, a1, {url: PLAYER_PAUSE}]).then(_fun54389);
|
||||
}
|
||||
|
||||
function fetchIsSpotifyProtocolRegistered() { // fn#54390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2802, offset: 0x013648ef, size: 111 bytes, params: 1, frame: 13
|
||||
var moduleValue;
|
||||
if (!SpotifyProtocolStore.isProtocolRegistered()) {
|
||||
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
|
||||
if (moduleValue.isDesktop()) {
|
||||
(importDefault(6871) /* metro dependency 6871: GameUtilsNative */).isProtocolRegistered(SPOTIFY_APP_PROTOCOL).then(_fun54391);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setActiveDevice_54392(a0, a1) { // fn#54392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:3031, offset: 0x01364997, size: 65 bytes, params: 3, frame: 13
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_SET_ACTIVE_DEVICE',
|
||||
accountId: a0, deviceId: a1});
|
||||
}
|
||||
|
||||
function _fun54368(a0) { // fn#54368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:364, offset: 0x01364136, size: 208 bytes, params: 2, frame: 14
|
||||
var environment;
|
||||
var r4;
|
||||
var r0;
|
||||
var value;
|
||||
if (a0.status === 401) {
|
||||
if (env0_3 > 0) {
|
||||
if (a0.status === 202) {
|
||||
value = environment.__proto__;
|
||||
value = require(4041) /* metro dependency 4041: Timers */;
|
||||
value = value.timeoutPromise(5000);
|
||||
r4 = value;
|
||||
} else {
|
||||
r4 = global.Promise.resolve();
|
||||
}
|
||||
value = r4.then(function() {
|
||||
return getAccessToken(require);
|
||||
});
|
||||
value = value.then(_fun54370);
|
||||
value = value.then(_fun54371);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = global.Promise.reject(a0);
|
||||
}
|
||||
} else if (importAll.onlyRetryOnAuthorizationErrors !== true && a0.status === 202) {
|
||||
if (env0_3 > 0) {
|
||||
if (a0.status === 202) {
|
||||
value = environment.__proto__;
|
||||
value = require(4041) /* metro dependency 4041: Timers */;
|
||||
value = value.timeoutPromise(5000);
|
||||
r4 = value;
|
||||
} else {
|
||||
r4 = global.Promise.resolve();
|
||||
}
|
||||
value = r4.then(_fun54369);
|
||||
value = value.then(_fun54370);
|
||||
value = value.then(_fun54371);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = global.Promise.reject(a0);
|
||||
}
|
||||
} else {
|
||||
r0 = global.Promise.reject(a0);
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun54375(a0) { // fn#54375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:920, offset: 0x0136431b, size: 274 bytes, params: 2, frame: 15
|
||||
const code = a0.body?.code;
|
||||
const CONNECTION_REVOKED = AbortCodes.CONNECTION_REVOKED;
|
||||
if (code === CONNECTION_REVOKED) {
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE',
|
||||
|
||||
accountId: env0_0});
|
||||
return global.Promise.reject(a0);
|
||||
}
|
||||
if (a0.status !== 429) {
|
||||
return global.Promise.reject(a0);
|
||||
}
|
||||
const property = a0.headers['retry-after'];
|
||||
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const SECOND = Millis.SECOND;
|
||||
const value3 = property * SECOND;
|
||||
const r5 = global.isNaN(value3) || value3 === 0 ? 5000 : value3;
|
||||
value = require(4041) /* metro dependency 4041: Timers */;
|
||||
value = value.timeoutPromise(r5);
|
||||
return value.then(_fun54376);
|
||||
}
|
||||
|
||||
function _fun54377(a0) { // fn#54377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1262, offset: 0x01364444, size: 80 bytes, params: 2, frame: 14
|
||||
const access_token = a0.body.access_token;
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_ACCOUNT_ACCESS_TOKEN',
|
||||
accountId: env0_0, accessToken: access_token});
|
||||
return a0;
|
||||
}
|
||||
|
||||
function _fun54379(a0) { // fn#54379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1676, offset: 0x013644fd, size: 98 bytes, params: 2, frame: 12
|
||||
var environment;
|
||||
var r0;
|
||||
var value;
|
||||
if (env0_3 <= 0) {
|
||||
r0 = global.Promise.reject(a0);
|
||||
} else {
|
||||
value = environment.__proto__;
|
||||
value = require(4041) /* metro dependency 4041: Timers */;
|
||||
value = value.timeoutPromise(5000);
|
||||
value = value.then(_fun54380);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun54382(a0) { // fn#54382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1868, offset: 0x013645c8, size: 88 bytes, params: 2, frame: 14
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PROFILE_UPDATE',
|
||||
accountId: env0_0, isPremium: a0.body.product === 'premium'});
|
||||
return a0;
|
||||
}
|
||||
|
||||
function _fun54384(a0) { // fn#54384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2062, offset: 0x01364660, size: 88 bytes, params: 2, frame: 13
|
||||
var value;
|
||||
if (a0.body) {
|
||||
value = environment.__proto__;
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.dispatch({type: 'SPOTIFY_SET_DEVICES', accountId: env0_0, devices: a0.body.devices});
|
||||
}
|
||||
return a0;
|
||||
}
|
||||
|
||||
function _fun54386(a0) { // fn#54386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2455, offset: 0x013647c9, size: 97 bytes, params: 2, frame: 19
|
||||
var r0;
|
||||
var binding;
|
||||
var put;
|
||||
var binding2;
|
||||
let value = a0;
|
||||
let repeatBinding = repeat;
|
||||
if (repeatBinding == null) {
|
||||
r0 = value;
|
||||
} else {
|
||||
value = environment.__proto__;
|
||||
binding = env1_9;
|
||||
put = binding.put;
|
||||
binding2 = env0_0;
|
||||
repeatBinding = repeat;
|
||||
value = 'off';
|
||||
value = Reflect.apply(put, binding, [binding2, require, {url: SpotifyEndpoints.PLAYER_REPEAT,
|
||||
query: {device_id: deviceId, state: repeatBinding ? 'context' : value}}]);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun54387(a0) { // fn#54387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2553, offset: 0x0136482a, size: 84 bytes, params: 2, frame: 14
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PLAYER_PLAY',
|
||||
id: importDefault, position: position ?? 0});
|
||||
return a0;
|
||||
}
|
||||
|
||||
function _fun54389(a0) { // fn#54389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2709, offset: 0x013648bb, size: 52 bytes, params: 2, frame: 12
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PLAYER_PAUSE'});
|
||||
return a0;
|
||||
}
|
||||
|
||||
function _fun54391(a0) { // fn#54391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:2931, offset: 0x0136495e, size: 57 bytes, params: 2, frame: 13
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_SET_PROTOCOL_REGISTERED',
|
||||
isRegistered: a0});
|
||||
}
|
||||
|
||||
function _fun54369() { // fn#54369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:528, offset: 0x01364206, size: 23 bytes, params: 1, frame: 11
|
||||
return getAccessToken(require);
|
||||
}
|
||||
|
||||
function _fun54370({body}) { // fn#54370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:558, offset: 0x0136421d, size: 55 bytes, params: 2, frame: 19
|
||||
return apiRequest(env1_0, require, body.access_token, importAll, env1_3 - 1);
|
||||
}
|
||||
|
||||
function _fun54371(a0) { // fn#54371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:617, offset: 0x01364254, size: 44 bytes, params: 2, frame: 11
|
||||
let env0_0 = a0;
|
||||
const Promise = global.Promise;
|
||||
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
||||
const promise = new Promise(function(a0) {
|
||||
var env0_0 = a0;
|
||||
return global.setImmediate(_fun54373);
|
||||
});
|
||||
return promise instanceof Object ? promise : value;
|
||||
}
|
||||
|
||||
function _fun54376() { // fn#54376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1204, offset: 0x0136442d, size: 23 bytes, params: 1, frame: 11
|
||||
return getAccessToken(env1_0);
|
||||
}
|
||||
|
||||
function _fun54380() { // fn#54380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:1736, offset: 0x0136455f, size: 41 bytes, params: 1, frame: 17
|
||||
return subscribePlayerStateNotifications(env1_0, require, importDefault, env1_3 - 1);
|
||||
}
|
||||
|
||||
function _fun54372(a0) { // fn#54372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7047:633, offset: 0x01364280, size: 31 bytes, params: 2, frame: 11
|
||||
const env0_0 = a0;
|
||||
return global.setImmediate(_fun54373);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/* Metro module 6868; source: modules/spotify/SpotifyConstants.tsx; dependencies: [661, 4915, 477, 2] */
|
||||
function _fun54357(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:6, offset: 0x01363a5c, size: 692 bytes, params: 8, frame: 27
|
||||
let Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const PlatformTypes = (require(661) /* metro dependency 661: Constants */).PlatformTypes;
|
||||
let value = importDefault(4915) /* metro dependency 4915: Platforms */;
|
||||
const get = value.get;
|
||||
const SPOTIFY = PlatformTypes.SPOTIFY;
|
||||
const name = Reflect.apply(get, value, [SPOTIFY]).name;
|
||||
const closure = function(a0) {
|
||||
return '?utm_source=discord&utm_medium=' + a0;
|
||||
};
|
||||
Object = global.Object;
|
||||
const freeze = Object.freeze;
|
||||
const object = {};
|
||||
object.PROFILE = '' + 'https://api.spotify.com/v1' + '/me';
|
||||
object.NOTIFICATIONS_PLAYER = '' + 'https://api.spotify.com/v1' + '/me/notifications/player';
|
||||
object.PLAYER = '' + 'https://api.spotify.com/v1' + '/me/player';
|
||||
object.PLAYER_DEVICES = '' + 'https://api.spotify.com/v1' + '/me/player/devices';
|
||||
object.PLAYER_PLAY = '' + 'https://api.spotify.com/v1' + '/me/player/play';
|
||||
object.PLAYER_PAUSE = '' + 'https://api.spotify.com/v1' + '/me/player/pause';
|
||||
object.PLAYER_REPEAT = '' + 'https://api.spotify.com/v1' + '/me/player/repeat';
|
||||
object.WEB_OPEN = function(a0, a1) {
|
||||
var value = a2;
|
||||
return 'https://open.spotify.com/' + (0, global.encodeURIComponent)(a0) + '/' + (0,
|
||||
global.encodeURIComponent)(a1) + spotifyUtmParams(value !== undefined ? value : 'desktop');
|
||||
};
|
||||
object.EMBED = EMBED;
|
||||
object.PLAYER_OPEN = function(a0, a1) {
|
||||
var r1;
|
||||
var r7;
|
||||
var value = a2;
|
||||
var value2 = a3;
|
||||
r1 = !(value !== undefined) || value;
|
||||
r7 = value2 !== undefined ? value2 : 'desktop';
|
||||
value = (0, global.encodeURIComponent)(a0);
|
||||
var value3 = (0, global.encodeURIComponent)(a1);
|
||||
var value4 = '';
|
||||
return value4 + 'spotify' + ':' + value + ':' + value3 + (r1 ? spotifyUtmParams(r7) : value4);
|
||||
};
|
||||
object.PREMIUM_SITE = 'https://www.spotify.com/premium/' + closure('desktop');
|
||||
object.INSTALL_ATTRIBUTION = function(a0) {
|
||||
return 'https://app.adjust.com/bdyga9?campaign=' + a0;
|
||||
};
|
||||
value = require(477) /* metro dependency 477: PlatformUtils */;
|
||||
value = value.isAndroid();
|
||||
let value2 = 'https://itunes.apple.com/us/app/spotify-music/id324684580?mt=8';
|
||||
object.APP_STORE = value ? 'https://play.google.com/store/apps/details?id=com.spotify.music&hl=en_US&gl=US' : value2;
|
||||
object.IOS_APP_STORE = value2;
|
||||
value = Reflect.apply(freeze, Object, [object]);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyConstants.tsx');
|
||||
exports.SPOTIFY_APP_PROTOCOL = 'spotify';
|
||||
exports.SPOTIFY_PARTY_PREFIX = 'spotify:';
|
||||
exports.SPOTIFY_PLATFORM_NAME = name;
|
||||
exports.isSpotifyParty = function(a0) {
|
||||
return a0 != null && a0.startsWith('spotify:');
|
||||
};
|
||||
exports.SpotifyResourceTypes = {TRACK: 'track', ARTIST: 'artist', ALBUM: 'album', PLAYLIST: 'playlist',
|
||||
EPISODE: 'episode', SHOW: 'show'};
|
||||
exports.SpotifyActionTypes = {USER_ACTIVITY_PLAY: 'user_activity_play', USER_ACTIVITY_SYNC: 'user_activity_sync',
|
||||
EMBED_SYNC: 'embed_sync'};
|
||||
exports.SPOTIFY_HOSTNAMES = ['open.spotify.com', 'www.spotify.com'];
|
||||
exports.SpotifyEndpoints = value;
|
||||
exports.getSpotifyResourceType = getSpotifyResourceType;
|
||||
}
|
||||
|
||||
function EMBED(a0) { // fn#54360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:932, offset: 0x01363d82, size: 55 bytes, params: 2, frame: 13
|
||||
let value = a1;
|
||||
value = spotifyUtmParams(value !== undefined ? value : 'desktop');
|
||||
return 'https://open.spotify.com/embed' + a0 + value;
|
||||
}
|
||||
|
||||
function getSpotifyResourceType(a0) { // fn#54364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7046:1908, offset: 0x01363e6a, size: 170 bytes, params: 2, frame: 3
|
||||
if (typeof a0 === 'string') {
|
||||
if (a0 === 'track') {
|
||||
return env0_0.TRACK;
|
||||
}
|
||||
if (a0 === 'artist') {
|
||||
return env0_0.ARTIST;
|
||||
}
|
||||
if (a0 === 'album') {
|
||||
return env0_0.ALBUM;
|
||||
}
|
||||
if (a0 === 'playlist') {
|
||||
return env0_0.PLAYLIST;
|
||||
}
|
||||
if (a0 === 'episode') {
|
||||
return env0_0.EPISODE;
|
||||
}
|
||||
if (a0 === 'show') {
|
||||
return env0_0.SHOW;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/* Metro module 6870; source: modules/spotify/SpotifyProtocolStore.tsx; dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */
|
||||
function _fun54393(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:6, offset: 0x013649d8, size: 267 bytes, params: 8, frame: 18
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_0 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_1 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_2 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_3 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_4 = importDefault(18) /* metro dependency 18 */;
|
||||
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
||||
let value = _fun54397(Store);
|
||||
value.displayName = 'SpotifyProtocolStore';
|
||||
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
||||
{SPOTIFY_SET_PROTOCOL_REGISTERED: function(a0) {
|
||||
env0_5 = a0.isRegistered;
|
||||
}});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyProtocolStore.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_54394() { // fn#54394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:148, offset: 0x01364ae3, size: 94 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_54394_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function _fun54397(a0) { // fn#54397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7048:356, offset: 0x01364b41, size: 68 bytes, params: 2, frame: 15
|
||||
const closure = SpotifyProtocolStore;
|
||||
env0_4(closure, a0);
|
||||
return env0_1(closure, [{key: 'isProtocolRegistered', value: value_54399}]);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,341 @@
|
||||
/* Metro module 10217; source: modules/spotify/SpotifyUtils.tsx; dependencies: [5, 4266, 6870, 6867, 6868, 661, 672, 4915, 6869, 10218, 2] */
|
||||
function _fun79476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:6, offset: 0x01e54e7c, size: 369 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const _arrayLikeToArray_79479 = function(a0, a1) {
|
||||
var r0;
|
||||
var r1;
|
||||
var r2;
|
||||
var value3;
|
||||
var length;
|
||||
var value5;
|
||||
var value = undefined;
|
||||
var value2 = value == null;
|
||||
reducibleJoin2: while (true) {
|
||||
if (value2) {
|
||||
r0 = value2;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
value3 = value > a0.length;
|
||||
r0 = value3;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
reducibleJoin4: while (true) {
|
||||
if (r0) {
|
||||
length = a0.length;
|
||||
r1 = length;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
r1 = value;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
value = (0, global.Array)(r1);
|
||||
var value4 = 0;
|
||||
if (value4 < r1) {
|
||||
r2 = value4;
|
||||
reducibleLoop5: while (true) {
|
||||
value[r2] = a0[r2];
|
||||
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
||||
if (value5 < r1) {
|
||||
r2 = value5;
|
||||
continue reducibleLoop5;
|
||||
}
|
||||
break reducibleLoop5;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
const asString_79480 = function(a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
return a0;
|
||||
}
|
||||
var Error = global.Error;
|
||||
throw new Error('value is not a string');
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const runningGameStoreNative = importDefault(4266) /* metro dependency 4266: RunningGameStoreNative */;
|
||||
const spotifyProtocolStore = importDefault(6870) /* metro dependency 6870: SpotifyProtocolStore */;
|
||||
const spotifyStore = importDefault(6867) /* metro dependency 6867: SpotifyStore */;
|
||||
const spotifyConstantsModule = require(6868) /* metro dependency 6868: SpotifyConstants */;
|
||||
const env0_7 = spotifyConstantsModule.SPOTIFY_APP_PROTOCOL;
|
||||
const env0_8 = spotifyConstantsModule.SpotifyResourceTypes;
|
||||
const env0_9 = spotifyConstantsModule.getSpotifyResourceType;
|
||||
const env0_10 = (require(661) /* metro dependency 661: Constants */).PlatformTypes;
|
||||
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const SECOND = Millis.SECOND;
|
||||
const env0_11 = 30 * SECOND;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spotify/SpotifyUtils.tsx');
|
||||
exports.isSpotifyPlayable = isSpotifyPlayable;
|
||||
exports.ensureSpotifyPlayable = ensureSpotifyPlayable;
|
||||
exports.isSpotifyPremium = isSpotifyPremium;
|
||||
exports.ensureSpotifyPremium = ensureSpotifyPremium;
|
||||
exports.getSpotifyMetadataFromActivity = function() {
|
||||
return _getSpotifyMetadataFromActivity.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelperLoose_79477(a0, a1) { // fn#79477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:253, offset: 0x01e54fed, size: 372 bytes, params: 3, frame: 20
|
||||
var r6;
|
||||
var r9;
|
||||
var r5;
|
||||
var value3;
|
||||
var regexp;
|
||||
const env0_0 = a0;
|
||||
const Symbol = global.Symbol;
|
||||
let value = typeof Symbol !== 'undefined';
|
||||
let r1 = value && a0[global.Symbol.iterator];
|
||||
r1 = !r1 ? a0['@@iterator'] : r1;
|
||||
if (r1) {
|
||||
value = r1.call(a0);
|
||||
return value.next.bind(value);
|
||||
}
|
||||
const Array = global.Array;
|
||||
if (Array.isArray(a0)) {
|
||||
if (r1) {
|
||||
}
|
||||
return _fun79478;
|
||||
}
|
||||
value = undefined;
|
||||
if (a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
value = _arrayLikeToArray_79479(a0, value);
|
||||
r5 = value;
|
||||
} else {
|
||||
value3 = ({}).toString.call(a0).slice(8, -1);
|
||||
r6 = value3 === 'Object' && a0.constructor;
|
||||
r9 = r6 ? a0.constructor.name : value3;
|
||||
if (r9 === 'Map') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Set') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Arguments') {
|
||||
value = _arrayLikeToArray_79479(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
||||
if (regexp.test(r9)) {
|
||||
value = _arrayLikeToArray_79479(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
}
|
||||
r5 = r6;
|
||||
}
|
||||
} else {
|
||||
r5 = value;
|
||||
}
|
||||
if (r5) {
|
||||
if (r5) {
|
||||
}
|
||||
return _fun79478;
|
||||
}
|
||||
const TypeError = global.TypeError;
|
||||
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
||||
}
|
||||
|
||||
function _getSpotifyMetadataFromActivity() { // fn#79481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1287, offset: 0x01e55195, size: 50 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun79483).apply(this, arguments);
|
||||
}
|
||||
|
||||
function isSpotifyPlayable(a0) { // fn#79484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1888, offset: 0x01e5532e, size: 41 bytes, params: 2, frame: 10
|
||||
let value = a0.getActiveSocketAndDevice();
|
||||
value = value != null;
|
||||
return value || SpotifyProtocolStore.isProtocolRegistered();
|
||||
}
|
||||
|
||||
function ensureSpotifyPlayable() { // fn#79485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2012, offset: 0x01e55357, size: 342 bytes, params: 1, frame: 19
|
||||
var Promise;
|
||||
var playableComputerDevices;
|
||||
var isObservedAppRunning;
|
||||
var defaultImport;
|
||||
var promise;
|
||||
var property;
|
||||
var socket;
|
||||
var device;
|
||||
var value;
|
||||
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
|
||||
if (activeSocketAndDevice != null) {
|
||||
return global.Promise.resolve(activeSocketAndDevice);
|
||||
}
|
||||
if (SpotifyProtocolStore.isProtocolRegistered()) {
|
||||
playableComputerDevices = SpotifyStore.getPlayableComputerDevices();
|
||||
isObservedAppRunning = RunningGameStoreNative.isObservedAppRunning;
|
||||
defaultImport = importDefault(4915) /* metro dependency 4915: Platforms */;
|
||||
if (Reflect.apply(isObservedAppRunning, RunningGameStoreNative,
|
||||
[defaultImport.get(PlatformTypes.SPOTIFY).name])) {
|
||||
if (playableComputerDevices.length > 0) {
|
||||
property = playableComputerDevices[0];
|
||||
socket = property.socket;
|
||||
device = property.device;
|
||||
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
||||
value.setActiveDevice(socket.accountId, device.id);
|
||||
Promise = global.Promise;
|
||||
return Promise.resolve({socket: socket, device: device});
|
||||
}
|
||||
Promise = global.Promise;
|
||||
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
||||
promise = new Promise(_fun79486);
|
||||
return promise instanceof Object ? promise : value;
|
||||
}
|
||||
Promise = global.Promise;
|
||||
value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
||||
promise = new Promise(_fun79486);
|
||||
return promise instanceof Object ? promise : value;
|
||||
}
|
||||
Promise = global.Promise;
|
||||
const reject = Promise.reject;
|
||||
const Error = global.Error;
|
||||
return Reflect.apply(reject, Promise, [new Error('protocol is not registered')]);
|
||||
}
|
||||
|
||||
function isSpotifyPremium() { // fn#79492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3034, offset: 0x01e556b0, size: 40 bytes, params: 1, frame: 10
|
||||
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
|
||||
const value2 = null;
|
||||
return value2 == activeSocketAndDevice ? value2 : activeSocketAndDevice.socket.isPremium;
|
||||
}
|
||||
|
||||
function ensureSpotifyPremium() { // fn#79493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3161, offset: 0x01e556d8, size: 181 bytes, params: 1, frame: 14
|
||||
var r0;
|
||||
var Promise;
|
||||
var value;
|
||||
const activeSocketAndDevice = SpotifyStore.getActiveSocketAndDevice();
|
||||
if (activeSocketAndDevice == null) {
|
||||
Promise = global.Promise;
|
||||
return Promise.reject(new global.Error('no active profile'));
|
||||
}
|
||||
const socket = activeSocketAndDevice.socket;
|
||||
if (socket.isPremium) {
|
||||
r0 = global.Promise.resolve();
|
||||
} else {
|
||||
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
||||
value = value.getProfile(socket.accountId, socket.accessToken);
|
||||
value = value.then(_fun79494);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function* _fun79483(a0, a1) { // fn#79483, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:1372, offset: 0x01e551d2, size: 348 bytes, params: 3, frame: 19
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
value = environment.__proto__.__proto__;
|
||||
let binding = env2_0;
|
||||
const value3 = undefined;
|
||||
const value4 = binding(env2_2[9]);
|
||||
const getMetadata = value4.getMetadata;
|
||||
yield Reflect.apply(getMetadata, value4, [a0, a1]);
|
||||
const value5 = undefined;
|
||||
if (false) {
|
||||
return value5;
|
||||
}
|
||||
binding = env2_9;
|
||||
const binding2 = env2_14;
|
||||
const r3 = value5.type ?? env2_8.TRACK;
|
||||
binding2(r3);
|
||||
const value7 = binding(r3);
|
||||
if (value7 === null) {
|
||||
throw new global.Error('invalid type ' + value5.type);
|
||||
}
|
||||
const object2 = {};
|
||||
let context_uri = value5.context_uri;
|
||||
context_uri = typeof context_uri !== 'string' ? value3 : value5.context_uri;
|
||||
object2.context_uri = context_uri;
|
||||
binding = env2_14;
|
||||
const album_id = value5.album_id;
|
||||
binding(album_id);
|
||||
object2.album_id = album_id;
|
||||
let Array = global.Array;
|
||||
object2.artist_ids = Array.isArray(value5.artist_ids) ? value5.artist_ids.map(env2_14) : [];
|
||||
object2.type = value7;
|
||||
Array = global.Array;
|
||||
object2.button_urls = Array.isArray(value5.button_urls) ? value5.button_urls.map(env2_14) : [];
|
||||
return object2;
|
||||
}
|
||||
|
||||
function _fun79486(a0, a1) { // fn#79486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2454, offset: 0x01e554ad, size: 124 bytes, params: 3, frame: 16
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
const env0_2 = global.setTimeout(_fun79487, env1_11);
|
||||
SpotifyStore.addChangeListener(onSpotifyStoreChange);
|
||||
global.window.open('' + SPOTIFY_APP_PROTOCOL + ':');
|
||||
}
|
||||
|
||||
function _fun79494() { // fn#79494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:3398, offset: 0x01e5578d, size: 73 bytes, params: 1, frame: 13
|
||||
if (socket.isPremium) {
|
||||
return undefined;
|
||||
}
|
||||
const Promise = global.Promise;
|
||||
const reject = Promise.reject;
|
||||
const Error = global.Error;
|
||||
return Reflect.apply(reject, Promise, [new Error('spotify account is not premium')]);
|
||||
}
|
||||
|
||||
function _fun79487() { // fn#79487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2480, offset: 0x01e55529, size: 72 bytes, params: 1, frame: 12
|
||||
const value = environment.__proto__.__proto__;
|
||||
SpotifyStore.removeChangeListener(onSpotifyStoreChange);
|
||||
const Error = global.Error;
|
||||
require(new Error('timeout launching spotify'));
|
||||
}
|
||||
|
||||
function onSpotifyStoreChange() { // fn#79488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2598, offset: 0x01e55571, size: 89 bytes, params: 1, frame: 15
|
||||
var environment;
|
||||
var r2;
|
||||
var value3;
|
||||
var socket;
|
||||
var device;
|
||||
var value4;
|
||||
const closure = onSpotifyStoreChange_loop;
|
||||
let value = environment.__proto__.__proto__;
|
||||
const _createForOfIteratorHelperLoose_79477Binding = _createForOfIteratorHelperLoose_79477;
|
||||
value = SpotifyStore.getPlayableComputerDevices();
|
||||
value = _createForOfIteratorHelperLoose_79477Binding(value);
|
||||
const value2 = value();
|
||||
let done = value2.done;
|
||||
if (!done) {
|
||||
for (r2 = value2; true; r2 = value4) {
|
||||
value3 = r2.value;
|
||||
socket = value3.socket;
|
||||
device = value3.device;
|
||||
closure(socket, device);
|
||||
value4 = value();
|
||||
done = value4.done;
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onSpotifyStoreChange_loop(a0, a1) { // fn#79489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2619, owner: onSpotifyStoreChange._loop, offset: 0x01e555ca, size: 113 bytes, params: 3, frame: 14
|
||||
var environment;
|
||||
var clearTimeout;
|
||||
var value2;
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
let value = environment.__proto__.__proto__;
|
||||
value = env2_0.find(function(a0) {
|
||||
return a0.device.id === require.id;
|
||||
});
|
||||
if (value == null) {
|
||||
clearTimeout = global.clearTimeout;
|
||||
value = environment.__proto__;
|
||||
clearTimeout(env1_2);
|
||||
value2 = environment.__proto__.__proto__.__proto__;
|
||||
SpotifyStore.removeChangeListener(onSpotifyStoreChange);
|
||||
global.setImmediate(_fun79491);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun79491() { // fn#79491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10403:2748, offset: 0x01e5565b, size: 85 bytes, params: 1, frame: 16
|
||||
let value = environment.__proto__.__proto__.__proto__.__proto__;
|
||||
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
||||
const setActiveDevice = value.setActiveDevice;
|
||||
const binding = env0_0;
|
||||
Reflect.apply(setActiveDevice, value, [binding.accountId, require.id]);
|
||||
value = environment.__proto__.__proto__;
|
||||
env2_0({socket: binding, device: require});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user