decord/source/modules/spotify/SpotifyActionCreators.tsx

571 lines
24 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7281
// Function ID: 7282
2026-07-20 16:05:17 +00:00
// Name: apiRequest
2026-08-24 06:08:38 +00:00
// Dependencies: [7282, 7280, 676, 4263, 530, 709, 687, 500, 7283, 2]
2026-07-29 08:29:29 +00:00
// Exports: fetchIsSpotifyProtocolRegistered, getAccessToken, getDevices, getProfile, pause, play, setActiveDevice, subscribePlayerStateNotifications
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 7281 (apiRequest)
import set from "set" /* 500 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import setDefault from "set" /* 7283 */;
import closure_3 from "isProtocolRegistered" /* 7282 */;
import SPOTIFY_APP_PROTOCOL from "SPOTIFY_APP_PROTOCOL" /* 7280 */;
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function apiRequest(arg0, arg1, arg2, arg3) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
obj = arg3;
2026-07-29 08:29:29 +00:00
let num = arg4;
2026-07-20 16:05:17 +00:00
if (arg4 === undefined) {
num = 1;
}
2026-07-23 10:11:24 +00:00
obj = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg3);
obj = { authorization: "Bearer " + arg2 };
2026-07-29 08:29:29 +00:00
obj.headers = obj;
2026-07-20 16:05:17 +00:00
const promise = arg0(obj);
return arg0(obj).then((status) => {
let rejectResult = status;
if (202 === status.status) {
rejectResult = Promise.reject(status);
}
return rejectResult;
}).catch((status) => {
let tmp = true !== obj.onlyRetryOnAuthorizationErrors;
if (tmp) {
tmp = 202 === status.status;
}
if (401 === status.status) {
2026-08-24 06:08:38 +00:00
if (closure_3 > 0) {
2026-07-20 16:05:17 +00:00
if (202 === status.status) {
2026-07-23 10:11:24 +00:00
obj = callback(obj[3]);
2026-07-20 16:05:17 +00:00
let timeoutPromiseResult = obj.timeoutPromise(5000);
} else {
timeoutPromiseResult = Promise.resolve();
}
2026-07-29 08:29:29 +00:00
let nextPromise = timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch((body) => {
body = body.body;
let code;
if (body != null) {
code = body.code;
}
2026-08-24 06:08:38 +00:00
if (code === closure_1_6.CONNECTION_REVOKED) {
2026-07-29 08:29:29 +00:00
let obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE", accountId: null };
obj[1] = callback;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[5]).dispatch(obj);
let obj2 = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
} else if (429 === body.status) {
2026-08-24 06:08:38 +00:00
let result = body.headers["retry-after"] * closure_1_1(closure_1_2[6]).Millis.SECOND;
2026-07-29 08:29:29 +00:00
let _isNaN = isNaN;
let num2 = 5000;
if (!isNaN(result)) {
num2 = 5000;
if (0 !== result) {
num2 = result;
}
}
2026-08-24 06:08:38 +00:00
obj = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
return obj.timeoutPromise(num2).then(() => {
2026-08-24 06:08:38 +00:00
let HTTP = closure_1_0(closure_1_2[4]).HTTP;
let value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false });
let obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
});
}
return Promise.reject(body);
}).then((accessToken) => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN", accountId: closure_0, accessToken: accessToken.body.access_token };
obj.dispatch(obj);
return accessToken;
});
});
timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch((body) => {
body = body.body;
let code;
if (body != null) {
code = body.code;
}
2026-08-24 06:08:38 +00:00
if (code === closure_1_6.CONNECTION_REVOKED) {
2026-07-29 08:29:29 +00:00
let obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE", accountId: null };
obj[1] = callback;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[5]).dispatch(obj);
let obj2 = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
} else if (429 === body.status) {
2026-08-24 06:08:38 +00:00
let result = body.headers["retry-after"] * closure_1_1(closure_1_2[6]).Millis.SECOND;
2026-07-29 08:29:29 +00:00
let _isNaN = isNaN;
let num2 = 5000;
if (!isNaN(result)) {
num2 = 5000;
if (0 !== result) {
num2 = result;
}
}
2026-08-24 06:08:38 +00:00
obj = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
return obj.timeoutPromise(num2).then(() => {
2026-08-24 06:08:38 +00:00
let HTTP = closure_1_0(closure_1_2[4]).HTTP;
let value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false });
let obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
});
}
return Promise.reject(body);
}).then((accessToken) => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN", accountId: closure_0, accessToken: accessToken.body.access_token };
obj.dispatch(obj);
return accessToken;
});
}).then((body) => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(obj);
obj = { authorization: "Bearer " + body.body.access_token };
obj.headers = obj;
let promise = callback(obj);
return callback(obj).then((status) => {
let rejectResult = status;
if (202 === status.status) {
rejectResult = Promise.reject(status);
}
return rejectResult;
}).catch((status) => {
let tmp = true !== obj.onlyRetryOnAuthorizationErrors;
if (tmp) {
tmp = 202 === status.status;
}
if (401 === status.status) {
2026-08-24 06:08:38 +00:00
if (closure_3 > 0) {
2026-07-29 08:29:29 +00:00
if (202 === status.status) {
obj = callback(obj[3]);
let timeoutPromiseResult = obj.timeoutPromise(5000);
} else {
timeoutPromiseResult = Promise.resolve();
}
let nextPromise = timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
});
timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
}).then((body) => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(obj);
obj = { authorization: "Bearer " + body.body.access_token };
obj.headers = obj;
let promise = callback(obj);
return callback(obj).then(() => { ... }).catch(() => { ... });
}).then((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
return new Promise(() => { ... });
});
let nextPromise1 = timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
}).then((body) => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(obj);
obj = { authorization: "Bearer " + body.body.access_token };
obj.headers = obj;
let promise = callback(obj);
return callback(obj).then(() => { ... }).catch(() => { ... });
});
}
}
return Promise.reject(status);
});
}).then((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-23 10:11:24 +00:00
return new Promise((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-23 10:11:24 +00:00
return setImmediate(() => callback(callback));
});
});
2026-07-29 08:29:29 +00:00
let nextPromise1 = timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch((body) => {
body = body.body;
let code;
if (body != null) {
code = body.code;
}
2026-08-24 06:08:38 +00:00
if (code === closure_1_6.CONNECTION_REVOKED) {
2026-07-29 08:29:29 +00:00
let obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE", accountId: null };
obj[1] = callback;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[5]).dispatch(obj);
let obj2 = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
} else if (429 === body.status) {
2026-08-24 06:08:38 +00:00
let result = body.headers["retry-after"] * closure_1_1(closure_1_2[6]).Millis.SECOND;
2026-07-29 08:29:29 +00:00
let _isNaN = isNaN;
let num2 = 5000;
if (!isNaN(result)) {
num2 = 5000;
if (0 !== result) {
num2 = result;
}
}
2026-08-24 06:08:38 +00:00
obj = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
return obj.timeoutPromise(num2).then(() => {
2026-08-24 06:08:38 +00:00
let HTTP = closure_1_0(closure_1_2[4]).HTTP;
let value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false });
let obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
});
}
return Promise.reject(body);
}).then((accessToken) => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN", accountId: closure_0, accessToken: accessToken.body.access_token };
obj.dispatch(obj);
return accessToken;
});
}).then((body) => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(obj);
obj = { authorization: "Bearer " + body.body.access_token };
obj.headers = obj;
let promise = callback(obj);
return callback(obj).then((status) => {
let rejectResult = status;
if (202 === status.status) {
rejectResult = Promise.reject(status);
}
return rejectResult;
}).catch((status) => {
let tmp = true !== obj.onlyRetryOnAuthorizationErrors;
if (tmp) {
tmp = 202 === status.status;
}
if (401 === status.status) {
2026-08-24 06:08:38 +00:00
if (closure_3 > 0) {
2026-07-29 08:29:29 +00:00
if (202 === status.status) {
obj = callback(obj[3]);
let timeoutPromiseResult = obj.timeoutPromise(5000);
} else {
timeoutPromiseResult = Promise.resolve();
}
let nextPromise = timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
});
timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
}).then((body) => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(obj);
obj = { authorization: "Bearer " + body.body.access_token };
obj.headers = obj;
let promise = callback(obj);
return callback(obj).then(() => { ... }).catch(() => { ... });
}).then((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
return new Promise(() => { ... });
});
let nextPromise1 = timeoutPromiseResult.then(() => {
2026-08-24 06:08:38 +00:00
closure_0 = closure_1;
const HTTP = closure_1_0(closure_1_2[4]).HTTP;
const value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false });
obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_1), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
}).then((body) => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = {};
2026-07-29 08:29:29 +00:00
let merged = Object.assign(obj);
obj = { authorization: "Bearer " + body.body.access_token };
obj.headers = obj;
let promise = callback(obj);
return callback(obj).then(() => { ... }).catch(() => { ... });
});
}
}
return Promise.reject(status);
});
});
2026-07-20 16:05:17 +00:00
}
}
return Promise.reject(status);
});
}
2026-08-24 06:08:38 +00:00
({ SPOTIFY_APP_PROTOCOL: c4, SpotifyEndpoints: c5 } = SPOTIFY_APP_PROTOCOL);
({ AbortCodes: closure_6, Endpoints: error, PlatformTypes: closure_8 } = ME);
2026-07-29 08:29:29 +00:00
let obj = { get: apiRequest.bind(null, require("sendRequest").HTTP.get), put: apiRequest.bind(null, require("sendRequest").HTTP.put) };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/spotify/SpotifyActionCreators.tsx");
2026-07-29 08:29:29 +00:00
export const SpotifyAPI = obj;
export const getAccessToken = function getAccessToken(id) {
2026-07-23 10:11:24 +00:00
const _require = id;
2026-07-29 08:29:29 +00:00
const HTTP = _require(530).HTTP;
const value = HTTP.get({ url: closure_7.CONNECTION_ACCESS_TOKEN(constants.SPOTIFY, id), oldFormErrors: true, rejectWithError: false });
2026-08-24 06:08:38 +00:00
obj = { url: closure_7.CONNECTION_ACCESS_TOKEN(constants.SPOTIFY, id), oldFormErrors: true, rejectWithError: false };
2026-07-20 16:05:17 +00:00
return value.catch((body) => {
body = body.body;
let code;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
code = body.code;
}
2026-08-24 06:08:38 +00:00
if (code === closure_1_6.CONNECTION_REVOKED) {
2026-07-29 08:29:29 +00:00
let obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE", accountId: null };
obj[1] = callback;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[5]).dispatch(obj);
let obj2 = closure_1_1(closure_1_2[5]);
2026-07-20 16:05:17 +00:00
} else if (429 === body.status) {
2026-08-24 06:08:38 +00:00
let result = body.headers["retry-after"] * closure_1_1(closure_1_2[6]).Millis.SECOND;
2026-07-29 08:29:29 +00:00
let _isNaN = isNaN;
2026-07-20 16:05:17 +00:00
let num2 = 5000;
if (!isNaN(result)) {
num2 = 5000;
if (0 !== result) {
num2 = result;
}
}
2026-08-24 06:08:38 +00:00
obj = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
return obj.timeoutPromise(num2).then(() => {
2026-08-24 06:08:38 +00:00
let HTTP = closure_1_0(closure_1_2[4]).HTTP;
let value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false });
let obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch((body) => {
body = body.body;
let code;
if (body != null) {
code = body.code;
}
2026-08-24 06:08:38 +00:00
if (code === closure_1_6.CONNECTION_REVOKED) {
2026-07-29 08:29:29 +00:00
let obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE", accountId: null };
obj[1] = callback;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[5]).dispatch(obj);
let obj2 = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
} else if (429 === body.status) {
2026-08-24 06:08:38 +00:00
let result = body.headers["retry-after"] * closure_1_1(closure_1_2[6]).Millis.SECOND;
2026-07-29 08:29:29 +00:00
let _isNaN = isNaN;
let num2 = 5000;
if (!isNaN(result)) {
num2 = 5000;
if (0 !== result) {
num2 = result;
}
}
2026-08-24 06:08:38 +00:00
obj = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
return obj.timeoutPromise(num2).then(() => {
2026-08-24 06:08:38 +00:00
let HTTP = closure_1_0(closure_1_2[4]).HTTP;
let value = HTTP.get({ url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false });
let obj = { url: closure_1_7.CONNECTION_ACCESS_TOKEN(closure_1_8.SPOTIFY, closure_0), oldFormErrors: true, rejectWithError: false };
2026-07-29 08:29:29 +00:00
return value.catch(() => { ... }).then(() => { ... });
});
}
return Promise.reject(body);
}).then((accessToken) => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN", accountId: closure_0, accessToken: accessToken.body.access_token };
obj.dispatch(obj);
return accessToken;
});
});
2026-07-20 16:05:17 +00:00
}
return Promise.reject(body);
}).then((accessToken) => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[5]);
2026-07-23 10:11:24 +00:00
obj = { type: "SPOTIFY_ACCOUNT_ACCESS_TOKEN", accountId: closure_0, accessToken: accessToken.body.access_token };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
return accessToken;
});
2026-07-29 08:29:29 +00:00
};
export const subscribePlayerStateNotifications = function subscribePlayerStateNotifications(accountId, accessToken, connectionId) {
2026-08-24 06:08:38 +00:00
closure_0 = accountId;
closure_1 = accessToken;
closure_2 = connectionId;
2026-07-29 08:29:29 +00:00
let num = arg3;
2026-07-20 16:05:17 +00:00
if (arg3 === undefined) {
num = 2;
}
2026-07-23 10:11:24 +00:00
obj = { url: closure_5.NOTIFICATIONS_PLAYER, query: obj };
2026-07-20 16:05:17 +00:00
obj = { connection_id: connectionId };
return obj.put(accountId, accessToken, obj).catch((arg0) => {
2026-08-24 06:08:38 +00:00
if (closure_3 <= 0) {
2026-07-20 16:05:17 +00:00
let rejectResult = Promise.reject(arg0);
} else {
2026-07-29 08:29:29 +00:00
let obj = callback(table[3]);
rejectResult = callback(table[3]).timeoutPromise(5000).then(() => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = { url: closure_1_5.NOTIFICATIONS_PLAYER, query: obj };
2026-07-29 08:29:29 +00:00
obj = { connection_id: closure_2 };
2026-08-24 06:08:38 +00:00
return closure_1_9.put(closure_0, closure_1, obj).catch((arg0) => {
if (closure_3 <= 0) {
2026-07-29 08:29:29 +00:00
let rejectResult = Promise.reject(arg0);
} else {
let obj = callback(table[3]);
rejectResult = callback(table[3]).timeoutPromise(5000).then(() => {
2026-08-24 06:08:38 +00:00
closure_3 = closure_3 - 1;
obj = { url: closure_1_5.NOTIFICATIONS_PLAYER, query: obj };
2026-07-29 08:29:29 +00:00
obj = { connection_id: closure_2 };
2026-08-24 06:08:38 +00:00
return closure_1_9.put(closure_0, closure_1, obj).catch(() => { ... });
2026-07-29 08:29:29 +00:00
});
let timeoutPromiseResult = callback(table[3]).timeoutPromise(5000);
}
return rejectResult;
});
});
let timeoutPromiseResult = callback(table[3]).timeoutPromise(5000);
2026-07-20 16:05:17 +00:00
}
return rejectResult;
});
2026-07-29 08:29:29 +00:00
};
export const getProfile = function getProfile(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
obj = { url: closure_5.PROFILE };
2026-07-29 08:29:29 +00:00
const value = obj.get(arg0, arg1, obj);
2026-07-20 16:05:17 +00:00
return value.then((body) => {
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[5]);
2026-07-23 10:11:24 +00:00
obj = { type: "SPOTIFY_PROFILE_UPDATE", accountId: closure_0, isPremium: "premium" === body.body.product };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
return body;
});
};
export const getDevices = function getDevices(accountId, accessToken) {
2026-08-24 06:08:38 +00:00
closure_0 = accountId;
obj = { url: closure_5.PLAYER_DEVICES };
2026-07-20 16:05:17 +00:00
const value = obj.get(accountId, accessToken, obj);
return value.then((body) => {
if (body.body) {
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
obj = { type: "SPOTIFY_SET_DEVICES", accountId: null, devices: null };
obj[1] = closure_0;
obj[2] = body.body.devices;
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
}
return body;
});
};
2026-07-29 08:29:29 +00:00
export const play = function play(arg0, arg1, album_id, TRACK) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = album_id;
obj = arg4;
2026-07-20 16:05:17 +00:00
if (arg4 === undefined) {
obj = {};
}
2026-07-23 10:11:24 +00:00
let deviceId;
2026-07-20 16:05:17 +00:00
let position;
2026-07-23 10:11:24 +00:00
c5 = undefined;
2026-07-29 08:29:29 +00:00
const PLAYER_OPENResult = c5.PLAYER_OPEN(TRACK, album_id, false);
2026-07-23 10:11:24 +00:00
deviceId = obj.deviceId;
2026-07-20 16:05:17 +00:00
position = obj.position;
2026-07-23 10:11:24 +00:00
({ contextUri, repeat: c5 } = obj);
2026-07-29 08:29:29 +00:00
obj = { url: c5.PLAYER_PLAY, query: { device_id: deviceId }, body: null };
2026-07-20 16:05:17 +00:00
let tmp3;
if (null != contextUri) {
tmp3 = contextUri;
}
2026-07-29 08:29:29 +00:00
obj = { context_uri: tmp3, uris: null, offset: null, position_ms: null };
2026-07-20 16:05:17 +00:00
let tmp4;
if (null == contextUri) {
const items = [PLAYER_OPENResult];
tmp4 = items;
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp4;
2026-07-20 16:05:17 +00:00
let tmp5;
if (null != contextUri) {
2026-08-24 06:08:38 +00:00
obj1 = { uri: null };
2026-07-29 08:29:29 +00:00
obj1[0] = PLAYER_OPENResult;
2026-07-20 16:05:17 +00:00
tmp5 = obj1;
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp5;
2026-07-20 16:05:17 +00:00
let num = 0;
if (null != position) {
num = position;
}
2026-07-29 08:29:29 +00:00
obj[3] = num;
obj[2] = obj;
2026-07-23 10:11:24 +00:00
let putResult = obj.put(arg0, arg1, obj);
2026-07-20 16:05:17 +00:00
return obj.put(arg0, arg1, obj).then((arg0) => {
let putResult = arg0;
2026-07-23 10:11:24 +00:00
if (null != _undefined) {
2026-08-24 06:08:38 +00:00
obj = { url: null, query: null };
2026-07-29 08:29:29 +00:00
obj[0] = _undefined.PLAYER_REPEAT;
obj = { device_id: null, state: null };
obj[0] = deviceId;
2026-07-20 16:05:17 +00:00
let str = "off";
2026-07-29 08:29:29 +00:00
if (tmp2) {
2026-07-20 16:05:17 +00:00
str = "context";
}
2026-07-29 08:29:29 +00:00
obj[1] = str;
obj[1] = obj;
2026-08-24 06:08:38 +00:00
putResult = closure_1_9.put(closure_0, closure_1, obj);
2026-07-29 08:29:29 +00:00
const tmp4 = closure_0;
const tmp5 = closure_1;
2026-07-20 16:05:17 +00:00
}
return putResult;
}).then((arg0) => {
2026-08-24 06:08:38 +00:00
obj = callback(album_id[5]);
2026-07-29 08:29:29 +00:00
obj = { type: "SPOTIFY_PLAYER_PLAY", id: album_id, position: null };
2026-07-20 16:05:17 +00:00
let num = 0;
if (null != position) {
num = position;
}
2026-07-29 08:29:29 +00:00
obj[2] = num;
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
return arg0;
});
};
export const pause = function pause(arg0, arg1) {
2026-08-24 06:08:38 +00:00
obj = { url: closure_5.PLAYER_PAUSE };
2026-07-20 16:05:17 +00:00
return obj.put(arg0, arg1, obj).then((arg0) => {
2026-07-29 08:29:29 +00:00
callback(table[5]).dispatch({ type: "SPOTIFY_PLAYER_PAUSE" });
2026-07-20 16:05:17 +00:00
return arg0;
});
};
export const fetchIsSpotifyProtocolRegistered = function fetchIsSpotifyProtocolRegistered() {
if (!protocolRegistered.isProtocolRegistered()) {
if (obj.isDesktop()) {
2026-08-24 06:08:38 +00:00
const obj2 = setDefault;
setDefault.isProtocolRegistered(closure_4).then((isRegistered) => {
obj = callback(table[5]);
2026-07-20 16:05:17 +00:00
obj = { type: "SPOTIFY_SET_PROTOCOL_REGISTERED", isRegistered };
obj.dispatch(obj);
});
2026-08-24 06:08:38 +00:00
const isProtocolRegisteredResult = setDefault.isProtocolRegistered(closure_4);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj = set;
2026-07-20 16:05:17 +00:00
}
};
export const setActiveDevice = function setActiveDevice(accountId, deviceId) {
2026-08-24 06:08:38 +00:00
obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "SPOTIFY_SET_ACTIVE_DEVICE", accountId, deviceId };
obj.dispatch(obj);
};