2026-07-23 10:11:24 +00:00
// Module ID: 4811
2026-07-24 07:16:23 +00:00
// Function ID: 41994
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-24 07:16:23 +00:00
// Dependencies: [15, 17, 18, 6, 7, 4150, 1194, 4812, 4943, 4217, 4952, 4146, 8355, 653, 4814, 664, 3, 4015, 686, 22, 10930, 561, 675, 620, 12613, 10563, 1327, 7909, 566, 2]
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
// Module 4811 (_isNativeReflectConstruct)
import closure_3 from "set" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import dispatcher from "dispatcher" ;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_isNativeReflectConstruct" ;
import closure_11 from "_isNativeReflectConstruct" ;
import closure_12 from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import closure_14 from "_isNativeReflectConstruct" ;
import spotifyUtmParams from "spotifyUtmParams" ;
import ME from "ME" ;
import importDefaultResult1 from "_classCallCheck" ;
import set from "_inherits" ;
let closure_15 ;
let closure_16 ;
let closure_17 ;
let closure_18 ;
let closure_19 ;
let closure_21 ;
let closure_22 ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = ! valueOf . call ( Reflect . construct ( Boolean , [ ] , ( ) = > {
} ) ) ;
function _isNativeReflectConstruct() {
return closure_0 ;
}
const result = _isNativeReflectConstruct ( ) ;
}
2026-07-23 10:11:24 +00:00
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function _getActiveSocketAndDevice() {
for ( const key10005 in closure_44 ) {
let tmp5 = key10005 ;
2026-07-23 10:11:24 +00:00
let tmp6 = dependencyMap ;
let tmp7 = dependencyMap [ key10005 ] ;
2026-07-20 16:05:17 +00:00
if ( ! tmp7 . connected ) {
continue ;
} else {
2026-07-23 10:11:24 +00:00
let tmp = dependencyMap2 ;
if ( null == dependencyMap2 [ key10005 ] ) {
2026-07-20 16:05:17 +00:00
continue ;
} else {
2026-07-23 10:11:24 +00:00
let tmp2 = dependencyMap2 ;
let arr = dependencyMap2 [ key10005 ] ;
2026-07-20 16:05:17 +00:00
let found = arr . find ( ( is_active ) = > is_active . is_active ) ;
let tmp4 = found ;
if ( null == found ) {
continue ;
} else {
let obj = { socket : tmp7 , device : found } ;
return obj ;
}
}
continue ;
}
continue ;
}
}
function calculateStartTime ( startTime , position ) {
let num = 0 ;
const timestamp = Date . now ( ) ;
if ( null != startTime ) {
num = startTime . startTime ;
}
const diff = timestamp - position ;
if ( Math . abs ( diff - num ) > closure_31 ) {
num = diff ;
}
return num ;
}
function sendStoppedPlayerState ( accountId ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 686 ) ;
obj = { type : "SPOTIFY_PLAYER_STATE" , accountId , track : null , volumePercent : 0 , isPlaying : false , repeat : false , position : 0 , context : null } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
}
function findSpotifyActivity ( arg0 ) {
return closure_12 . findActivity ( arg0 , ( party ) = > {
let tmp = null != party . party && null != party . party . id ;
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_16 ( party . party . id ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ) ;
}
function upsertAccount ( accountId , accessToken ) {
if ( accountId in closure_44 ) {
tmp [ accountId ] . accessToken = accessToken ;
const _HermesInternal2 = HermesInternal ;
importDefaultResult1 . info ( "Updated account access token: " + accountId ) ;
} else {
const prototype = tmp12 . prototype ;
const tmp7 = new tmp12 ( accountId , accessToken ) ;
tmp [ accountId ] = tmp7 ;
const _HermesInternal = HermesInternal ;
importDefaultResult1 . info ( "Added account: " + accountId ) ;
}
}
function removeAccount ( arg0 ) {
2026-07-23 10:11:24 +00:00
if ( arg0 in dependencyMap ) {
dependencyMap [ arg0 ] . disconnect ( ) ;
delete tmp [ tmp2 ] ;
let tmp9 = null != tmp7 ;
if ( tmp9 ) {
tmp9 = null != c23 ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( tmp9 ) {
tmp9 = tmp7 . track . id === c23 . track . id ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( tmp9 ) {
c23 = null ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
delete tmp [ tmp2 ] ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
importDefaultResult1 . info ( "Removed account: " + arg0 ) ;
2026-07-23 10:11:24 +00:00
const obj = dependencyMap [ arg0 ] ;
2026-07-20 16:05:17 +00:00
}
}
function setActiveDevice ( arg0 , arg1 ) {
let done ;
2026-07-23 10:11:24 +00:00
const tmp = _createForOfIteratorHelperLoose ( dependencyMap2 [ arg0 ] ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
value . is_active = value . id === arg1 ;
let iter2 = tmp ( ) ;
iter = iter2 ;
done = iter2 . done ;
} while ( ! done ) ;
}
}
function activitySync ( userId , activity , arg2 ) {
let device ;
let party ;
let socket ;
let sync_id ;
let timestamps ;
const tmp = _getActiveSocketAndDevice ( ) ;
if ( null == tmp ) {
return false ;
} else {
( { socket , device } = tmp ) ;
( { sync_id , party , timestamps } = activity ) ;
if ( null != sync_id ) {
if ( null != party ) {
if ( null != party . id ) {
if ( callback3 ( party . id ) ) {
if ( null != timestamps ) {
if ( null != timestamps . start ) {
let start = timestamps . start ;
}
const _Math = Math ;
const _Date2 = Date ;
let tmp7 = null != tmp6 ;
const bound = Math . max ( 0 , Date . now ( ) - start ) ;
if ( tmp7 ) {
tmp7 = false === tmp6 . repeat ;
}
let tmp8 = false ;
if ( tmp7 ) {
tmp8 = null ;
}
const metadata = activity . metadata ;
let type ;
if ( null != metadata ) {
type = metadata . type ;
}
if ( null == type ) {
type = constants2 . TRACK ;
}
const tmp9Result = closure_15 ( type ) ;
if ( null != tmp9Result ) {
2026-07-24 07:16:23 +00:00
const obj3 = require ( 10930 ) /* apiRequest */ ;
2026-07-20 16:05:17 +00:00
let obj = { position : + bound , deviceId : device.id , repeat : tmp8 } ;
obj3 . play ( socket . accountId , socket . accessToken , sync_id , tmp9Result , obj ) ;
obj = { userId , partyId : party.id , trackId : sync_id , startTime : start } ;
let str = "presence change" ;
if ( arg2 ) {
2026-07-23 10:11:24 +00:00
obj = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
const obj1 = { party_id : party.id , other_user_id : userId } ;
obj . track ( constants3 . SPOTIFY_LISTEN_ALONG_STARTED , obj1 ) ;
str = "started" ;
}
const _HermesInternal = HermesInternal ;
importDefaultResult1 . info ( "Listen along " + str + ": " + socket . accountId + " to " + userId + " playing " + sync_id + " on " + device . name ) ;
}
}
const _Date = Date ;
start = Date . now ( ) ;
}
}
}
}
return false ;
}
}
function handleUserActivitySyncStop() {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
obj = { } ;
let partyId = null ;
2026-07-23 10:11:24 +00:00
if ( null != c24 ) {
partyId = c24 . partyId ;
2026-07-20 16:05:17 +00:00
}
obj . party_id = partyId ;
let userId = null ;
2026-07-23 10:11:24 +00:00
if ( null != c24 ) {
userId = c24 . userId ;
2026-07-20 16:05:17 +00:00
}
obj . other_user_id = userId ;
obj . track ( constants3 . SPOTIFY_LISTEN_ALONG_ENDED , obj ) ;
let trackId = null ;
2026-07-23 10:11:24 +00:00
if ( null != c24 ) {
trackId = c24 . trackId ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
c24 = null ;
2026-07-20 16:05:17 +00:00
importDefaultResult1 . info ( "Listen along stopped" ) ;
const tmp9 = _getActiveSocketAndDevice ( ) ;
if ( null != tmp9 ) {
const socket = tmp9 . socket ;
if ( tmp12 ) {
2026-07-24 07:16:23 +00:00
require ( 10930 ) /* apiRequest */ . pause ( socket . accountId , socket . accessToken ) ;
const obj3 = require ( 10930 ) /* apiRequest */ ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
tmp12 = null != dependencyMap3 [ socket . accountId ] && dependencyMap3 [ socket . accountId ] . track . id === trackId ;
2026-07-20 16:05:17 +00:00
}
}
function handleUserConnectionsUpdate() {
let iter3 ;
const keys = Object . keys ( closure_44 ) ;
const accounts = store2 . getAccounts ( ) ;
2026-07-23 10:11:24 +00:00
const found = accounts . filter ( ( type ) = > type . type === outer1_20 . SPOTIFY ) ;
2026-07-20 16:05:17 +00:00
if ( null == found ) {
return false ;
} else {
const mapped = found . map ( ( id ) = > id . id ) ;
for ( let num = 0 ; num < keys . length ; num = num + 1 ) {
let tmp = keys [ num ] ;
if ( ! mapped . includes ( tmp ) ) {
let tmp2 = removeAccount ;
let tmp3 = removeAccount ( tmp ) ;
}
}
const tmp5 = _createForOfIteratorHelperLoose ( found ) ;
const iter = tmp5 ( ) ;
let iter2 = iter ;
let flag = false ;
let flag2 = false ;
if ( ! iter . done ) {
do {
let value = iter2 . value ;
let tmp6 = closure_23 ;
let tmp7 = null != closure_23 ;
if ( tmp7 ) {
let tmp8 = closure_23 ;
tmp7 = closure_23 . account . id === value . id ;
}
if ( tmp7 ) {
let tmp9 = closure_23 ;
closure_23 . account = value ;
flag = true ;
}
let tmp10 = flag ;
if ( ! keys . includes ( value . id ) ) {
if ( null == value . accessToken ) {
2026-07-23 10:11:24 +00:00
let tmp13 = require ;
let tmp14 = dependencyMap ;
2026-07-24 07:16:23 +00:00
let obj = require ( 10930 ) /* apiRequest */ ;
2026-07-20 16:05:17 +00:00
let accessToken = obj . getAccessToken ( value . id ) ;
} else {
2026-07-23 10:11:24 +00:00
let tmp11 = upsertAccount ;
let tmp12 = upsertAccount ( value . id , value . accessToken ) ;
2026-07-20 16:05:17 +00:00
}
}
iter3 = tmp5 ( ) ;
iter2 = iter3 ;
flag2 = flag ;
} while ( ! iter3 . done ) ;
}
return flag2 ;
}
}
function autoPause() {
if ( null != closure_23 ) {
const tmp10 = _getActiveSocketAndDevice ( ) ;
if ( null != tmp10 ) {
const socket = tmp10 . socket ;
2026-07-23 10:11:24 +00:00
let c47 = true ;
2026-07-24 07:16:23 +00:00
require ( 10930 ) /* apiRequest */ . pause ( socket . accountId , socket . accessToken ) ;
const obj = require ( 10930 ) /* apiRequest */ ;
2026-07-23 10:11:24 +00:00
importDefault ( 675 ) . track ( constants3 . SPOTIFY_AUTO_PAUSED ) ;
2026-07-20 16:05:17 +00:00
importDefaultResult1 . info ( "Playback auto paused" ) ;
2026-07-23 10:11:24 +00:00
const obj2 = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
function setSpeaking ( id , arg1 ) {
if ( id === store . getId ( ) ) {
const result = currentClientInVoiceChannel . isCurrentClientInVoiceChannel ( ) ;
2026-07-24 07:16:23 +00:00
let obj = require ( 10563 ) /* _checkIsSpeaking */ ;
2026-07-23 10:11:24 +00:00
obj = { userId : id , checkSoundSharing : true , checkSoundboardSounds : false } ;
2026-07-20 16:05:17 +00:00
if ( result ) {
if ( obj . getIsSpeaking ( obj ) ) {
if ( null != closure_23 ) {
timeout . start ( closure_28 , autoPause , false ) ;
timeout1 . stop ( ) ;
}
}
}
2026-07-23 10:11:24 +00:00
timeout1 . start ( 100 , ( ) = > outer1_39 . stop ( ) , false ) ;
2026-07-20 16:05:17 +00:00
}
return false ;
}
function updatePlayerState ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
let closure_3 ;
let _createForOfIteratorHelperLoose ;
2026-07-20 16:05:17 +00:00
let context ;
2026-07-23 10:11:24 +00:00
let dependencyMap ;
2026-07-20 16:05:17 +00:00
let item ;
2026-07-23 10:11:24 +00:00
const _require = arg0 ;
2026-07-20 16:05:17 +00:00
const device = arg2 . device ;
2026-07-23 10:11:24 +00:00
let obj = device ;
( { progress_ms : dependencyMap , is_playing : closure_3 , repeat_state : _createForOfIteratorHelperLoose , item , context } = arg2 ) ;
let obj2 ;
2026-07-20 16:05:17 +00:00
if ( null != item ) {
if ( item . type === constants2 . TRACK ) {
let id = item . id ;
if ( tmp7 ) {
id = item . linked_from . id ;
}
2026-07-23 10:11:24 +00:00
obj = { id } ;
2026-07-20 16:05:17 +00:00
( { name : obj.name , duration_ms : obj.duration } = item ) ;
obj . type = constants2 . TRACK ;
obj = { } ;
const album2 = item . album ;
id = undefined ;
if ( null != album2 ) {
id = album2 . id ;
}
let str3 = "" ;
let str4 = "" ;
if ( null != id ) {
str4 = id ;
}
obj . id = str4 ;
const album3 = item . album ;
let name ;
if ( null != album3 ) {
name = album3 . name ;
}
if ( null != name ) {
str3 = name ;
}
obj . name = str3 ;
const album4 = item . album ;
let first ;
if ( null != album4 ) {
first = album4 . images [ 0 ] ;
}
obj . image = first ;
const album5 = item . album ;
let type ;
if ( null != album5 ) {
type = album5 . type ;
}
if ( null == type ) {
type = constants2 . ALBUM ;
}
obj . type = type ;
obj . album = obj ;
const _Array = Array ;
if ( Array . isArray ( item . artists ) ) {
const artists = item . artists ;
let found = artists . filter ( ( id ) = > {
2026-07-23 10:11:24 +00:00
let isNotNullishResult = callback ( outer1_2 [ 26 ] ) . isNotNullish ( id . id ) ;
2026-07-20 16:05:17 +00:00
if ( isNotNullishResult ) {
2026-07-23 10:11:24 +00:00
isNotNullishResult = callback ( outer1_2 [ 26 ] ) . isNotNullish ( id . name ) ;
const obj2 = callback ( outer1_2 [ 26 ] ) ;
2026-07-20 16:05:17 +00:00
}
return isNotNullishResult ;
} ) ;
} else {
found = [ ] ;
}
obj . artists = found ;
obj . isLocal = item . is_local || false ;
2026-07-23 10:11:24 +00:00
obj2 = obj ;
tmp7 = null != item . linked_from && null != item . linked_from . id ;
2026-07-20 16:05:17 +00:00
}
let tmp15 = null != device ;
if ( tmp15 ) {
tmp15 = true !== device . is_active ;
}
if ( tmp15 ) {
obj = { } ;
const merged = Object . assign ( device ) ;
obj [ "is_active" ] = true ;
}
if ( null != context ) {
const items = [ constants2 . PLAYLIST , constants2 . ALBUM ] ;
if ( items . includes ( context . type ) ) {
let context2 = tmp13 . getPlayerState ( arg0 ) ;
if ( null != context2 ) {
context2 = context2 . context ;
let resolved = Promise . resolve ( context2 ) ;
}
if ( context . type === constants2 . ALBUM ) {
resolved = Promise . resolve ( context ) ;
} else {
2026-07-24 07:16:23 +00:00
const SpotifyAPI = _require ( 10930 ) . SpotifyAPI ;
2026-07-20 16:05:17 +00:00
const obj1 = { url : context.href } ;
const value = SpotifyAPI . get ( arg0 , arg1 , obj1 ) ;
resolved = value . then ( ( body ) = > body . body ) . catch ( ( status ) = > {
if ( status ) {
if ( 404 === status . status ) {
return null ;
}
}
throw status ;
} ) ;
const nextPromise = value . then ( ( body ) = > body . body ) ;
}
}
}
const resolved1 = Promise . resolve ( undefined ) ;
return resolved1 . then ( ( arg0 ) = > {
let tmp = arg0 ;
let _public = null == arg0 ;
if ( ! _public ) {
2026-07-23 10:11:24 +00:00
_public = tmp . type !== outer1_19 . PLAYLIST ;
2026-07-20 16:05:17 +00:00
}
if ( ! _public ) {
_public = tmp . public ;
}
if ( ! _public ) {
tmp = null ;
}
2026-07-23 10:11:24 +00:00
obj = obj ( outer1_2 [ 18 ] ) ;
obj = { type : "SPOTIFY_PLAYER_STATE" , accountId : closure_0 , track : obj2 } ;
2026-07-20 16:05:17 +00:00
let num = 0 ;
if ( null != obj ) {
num = obj . volume_percent ;
}
obj . volumePercent = num ;
obj . isPlaying = closure_3 ;
2026-07-23 10:11:24 +00:00
obj . repeat = "off" !== _createForOfIteratorHelperLoose ;
2026-07-20 16:05:17 +00:00
obj . position = closure_2 ;
obj . context = tmp ;
obj . device = obj ;
obj . dispatch ( obj ) ;
} ) ;
}
if ( null != item ) {
if ( item . type === constants2 . EPISODE ) {
2026-07-23 10:11:24 +00:00
obj2 = { } ;
2026-07-20 16:05:17 +00:00
( { id : obj5.id , name : obj5.name , duration_ms : obj5.duration } = item ) ;
obj2 . type = constants2 . EPISODE ;
const obj3 = { } ;
const show3 = item . show ;
let id1 ;
if ( null != show3 ) {
id1 = show3 . id ;
}
let str = "" ;
let str2 = "" ;
if ( null != id1 ) {
str2 = id1 ;
}
obj3 . id = str2 ;
const show = item . show ;
let name1 ;
if ( null != show ) {
name1 = show . name ;
}
if ( null != name1 ) {
str = name1 ;
}
obj3 . name = str ;
const show2 = item . show ;
let first1 ;
if ( null != show2 ) {
first1 = show2 . images [ 0 ] ;
}
obj3 . image = first1 ;
const album = item . album ;
let type1 ;
if ( null != album ) {
type1 = album . type ;
}
if ( null == type1 ) {
type1 = constants2 . SHOW ;
}
obj3 . type = type1 ;
obj2 . album = obj3 ;
obj2 . artists = [ ] ;
obj2 . isLocal = false ;
}
}
}
function getPlayerState ( arg0 ) {
2026-07-23 10:11:24 +00:00
const _require = arg0 ;
let closure_1 = arg1 ;
2026-07-24 07:16:23 +00:00
const SpotifyAPI = _require ( 10930 ) . SpotifyAPI ;
2026-07-20 16:05:17 +00:00
let obj = { url : constants.PLAYER } ;
obj = { additional_types : "" + constants2 . TRACK + "," + constants2 . EPISODE } ;
obj . query = obj ;
obj . onlyRetryOnAuthorizationErrors = true ;
const value = SpotifyAPI . get ( arg0 , arg1 , obj ) ;
return value . then ( ( body ) = > {
2026-07-23 10:11:24 +00:00
let closure_0 = body ;
2026-07-20 16:05:17 +00:00
body = body . body ;
if ( null != body ) {
2026-07-23 10:11:24 +00:00
outer1_66 ( closure_0 , closure_1 , body ) . then ( ( ) = > closure_0 ) ;
const promise = outer1_66 ( closure_0 , closure_1 , body ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
outer1_57 ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
}
} ) . catch ( ( ) = > {
2026-07-23 10:11:24 +00:00
outer1_57 ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
2026-07-23 10:11:24 +00:00
( { getSpotifyResourceType : closure_15 , isSpotifyParty : closure_16 , SPOTIFY_PARTY_PREFIX : closure_17 , SpotifyEndpoints : closure_18 , SpotifyResourceTypes : closure_19 } = spotifyUtmParams ) ;
const PlatformTypes = ME . PlatformTypes ;
( { ActivityFlags : closure_21 , AnalyticEvents : closure_22 } = ME ) ;
let closure_26 = require ( "getPlatformUserUrl" ) . get ( PlatformTypes . SPOTIFY ) ;
let closure_27 = 30 * require ( "set" ) . Millis . SECOND ;
let closure_28 = 30 * require ( "set" ) . Millis . SECOND ;
let closure_29 = 5 * require ( "set" ) . Millis . MINUTE ;
let closure_30 = 5 * require ( "set" ) . Millis . SECOND ;
let closure_31 = 1.5 * require ( "set" ) . Millis . SECOND ;
const MINUTE = require ( "set" ) . Millis . MINUTE ;
let closure_33 = 3 * require ( "set" ) . Millis . SECOND ;
2026-07-20 16:05:17 +00:00
let closure_34 = { PLAYER_STATE_CHANGED : "PLAYER_STATE_CHANGED" , DEVICE_STATE_CHANGED : "DEVICE_STATE_CHANGED" } ;
2026-07-23 10:11:24 +00:00
const message = "message" ;
const ping = "ping" ;
const single = "single" ;
2026-07-20 16:05:17 +00:00
importDefaultResult1 = new importDefaultResult1 ( "Spotify" ) ;
2026-07-23 10:11:24 +00:00
const timeout = new require ( "_createForOfIteratorHelperLoose" ) . Timeout ( ) ;
const timeout1 = new require ( "_createForOfIteratorHelperLoose" ) . Timeout ( ) ;
const timeout2 = new require ( "_createForOfIteratorHelperLoose" ) . Timeout ( ) ;
const timeout3 = new require ( "_createForOfIteratorHelperLoose" ) . Timeout ( ) ;
const timeout4 = new require ( "_createForOfIteratorHelperLoose" ) . Timeout ( ) ;
2026-07-20 16:05:17 +00:00
let closure_44 = { } ;
let closure_45 = { } ;
let closure_46 = { } ;
2026-07-23 10:11:24 +00:00
let c47 = false ;
let c48 = null ;
let items = [ WebSocket . CONNECTING , WebSocket . OPEN ] ;
let set = new Set ( items ) ;
let tmp12 = ( ( ) = > {
2026-07-20 16:05:17 +00:00
class SpotifySocket {
constructor ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
self = this ;
tmp = outer1_6 ( this , self ) ;
2026-07-20 16:05:17 +00:00
this . _requestedDisconnect = false ;
this . _requestedConnect = false ;
2026-07-23 10:11:24 +00:00
obj = outer1_1 ( outer1_2 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
this . handleDeviceStateChange = obj . throttle ( ( ) = > {
2026-07-23 10:11:24 +00:00
const devices = SpotifySocket ( outer2_2 [ 20 ] ) . getDevices ( self . accountId , self . accessToken ) ;
outer2_67 ( self . accountId , self . accessToken ) ;
} , outer1_33 ) ;
2026-07-20 16:05:17 +00:00
this . accountId = arg0 ;
this . accessToken = arg1 ;
2026-07-23 10:11:24 +00:00
interval = new SpotifySocket ( outer1_2 [ 17 ] ) . Interval ( ) ;
2026-07-20 16:05:17 +00:00
this . pingInterval = interval ;
2026-07-23 10:11:24 +00:00
tmp3 = outer1_1 ( outer1_2 [ 21 ] ) ;
tmp3 = new tmp3 ( undefined , outer1_32 ) ;
2026-07-20 16:05:17 +00:00
this . backoff = tmp3 ;
connectResult = this . connect ( ) ;
return ;
}
}
let obj = {
key : "connected" ,
get ( ) {
let hasItem = null != this . socket ;
if ( hasItem ) {
2026-07-23 10:11:24 +00:00
hasItem = outer1_49 . has ( tmp . socket . readyState ) ;
2026-07-20 16:05:17 +00:00
}
return hasItem ;
}
} ;
const items = [ obj , , , , , , , ] ;
obj = {
key : "connect" ,
value() {
2026-07-23 10:11:24 +00:00
let self = this ;
self = this ;
2026-07-20 16:05:17 +00:00
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
outer1_38 . info ( "WS Connecting" ) ;
2026-07-20 16:05:17 +00:00
self . _requestedDisconnect = false ;
self . _requestedConnect = true ;
2026-07-23 10:11:24 +00:00
const promise = outer1_67 ( self . accountId , self . accessToken ) ;
outer1_67 ( self . accountId , self . accessToken ) . then ( ( ) = > {
2026-07-20 16:05:17 +00:00
let handleClose ;
let handleMessage ;
let handleOpen ;
let socket ;
let socket2 ;
let socket3 ;
let socket4 ;
self . _requestedConnect = false ;
const webSocket = new WebSocket ( "wss://dealer.spotify.com/?access_token=" + self . accessToken ) ;
self . socket = webSocket ;
( { handleOpen , socket } = self ) ;
socket . onopen = handleOpen . bind ( self ) ;
( { handleMessage , socket : socket2 } = self ) ;
socket2 . onmessage = handleMessage . bind ( self ) ;
( { handleClose , socket : socket3 , socket : socket4 } = self ) ;
const bindResult = handleClose . bind ( self ) ;
socket4 . onerror = bindResult ;
socket3 . onclose = bindResult ;
} ) . catch ( ( arg0 ) = > {
2026-07-23 10:11:24 +00:00
outer2_38 . error ( arg0 ) ;
2026-07-20 16:05:17 +00:00
self . _requestedConnect = false ;
self . handleClose ( ) ;
} ) ;
2026-07-23 10:11:24 +00:00
const nextPromise = outer1_67 ( self . accountId , self . accessToken ) . then ( ( ) = > {
2026-07-20 16:05:17 +00:00
let handleClose ;
let handleMessage ;
let handleOpen ;
let socket ;
let socket2 ;
let socket3 ;
let socket4 ;
self . _requestedConnect = false ;
const webSocket = new WebSocket ( "wss://dealer.spotify.com/?access_token=" + self . accessToken ) ;
self . socket = webSocket ;
( { handleOpen , socket } = self ) ;
socket . onopen = handleOpen . bind ( self ) ;
( { handleMessage , socket : socket2 } = self ) ;
socket2 . onmessage = handleMessage . bind ( self ) ;
( { handleClose , socket : socket3 , socket : socket4 } = self ) ;
const bindResult = handleClose . bind ( self ) ;
socket4 . onerror = bindResult ;
socket3 . onclose = bindResult ;
} ) ;
}
}
} ;
items [ 1 ] = obj ;
obj = {
key : "disconnect" ,
value() {
this . _requestedDisconnect = true ;
const backoff = this . backoff ;
backoff . cancel ( ) ;
const socket = this . socket ;
if ( null != socket ) {
socket . close ( ) ;
}
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "ping" ,
value() {
if ( this . connected ) {
const socket = this . socket ;
if ( null != socket ) {
const _JSON = JSON ;
2026-07-23 10:11:24 +00:00
const obj = { type : outer1_36 } ;
2026-07-20 16:05:17 +00:00
socket . send ( JSON . stringify ( obj ) ) ;
}
}
}
} ;
items [ 4 ] = {
key : "handleOpen" ,
value() {
2026-07-23 10:11:24 +00:00
const self = this ;
outer1_38 . info ( "WS Connected" ) ;
2026-07-20 16:05:17 +00:00
const backoff = this . backoff ;
backoff . succeed ( ) ;
const pingInterval = this . pingInterval ;
2026-07-23 10:11:24 +00:00
pingInterval . start ( outer1_27 , ( ) = > self . ping ( ) ) ;
const profile = SpotifySocket ( outer1_2 [ 20 ] ) . getProfile ( this . accountId , this . accessToken ) ;
const obj = SpotifySocket ( outer1_2 [ 20 ] ) ;
const devices = SpotifySocket ( outer1_2 [ 20 ] ) . getDevices ( this . accountId , this . accessToken ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 5 ] = {
key : "handleMessage" ,
value ( data ) {
2026-07-23 10:11:24 +00:00
let iter6 ;
2026-07-20 16:05:17 +00:00
let payloads ;
let uri ;
const self = this ;
data = data . data ;
if ( "string" === typeof data ) {
const _JSON = JSON ;
const parsed = JSON . parse ( data ) ;
( { uri , payloads } = parsed ) ;
2026-07-23 10:11:24 +00:00
if ( parsed . type === outer1_35 ) {
2026-07-20 16:05:17 +00:00
if ( "string" === typeof uri ) {
if ( uri . startsWith ( "hm://pusher/v1/connections/" ) ) {
const _decodeURIComponent = decodeURIComponent ;
self . connectionId = decodeURIComponent ( uri . split ( "hm://pusher/v1/connections/" ) [ 1 ] ) ;
2026-07-23 10:11:24 +00:00
const result = SpotifySocket ( outer1_2 [ 20 ] ) . subscribePlayerStateNotifications ( self . accountId , self . accessToken , self . connectionId ) ;
const obj = SpotifySocket ( outer1_2 [ 20 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
const _Array = Array ;
if ( Array . isArray ( payloads ) ) {
2026-07-23 10:11:24 +00:00
const tmp2 = outer1_53 ( payloads ) ;
2026-07-20 16:05:17 +00:00
const iter = tmp2 ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
2026-07-23 10:11:24 +00:00
do {
2026-07-20 16:05:17 +00:00
let events = iter2 . value . events ;
if ( null != events ) {
2026-07-23 10:11:24 +00:00
let tmp4 = outer1_53 ;
let tmp5 = outer1_53 ( events ) ;
2026-07-20 16:05:17 +00:00
let iter3 = tmp5 ( ) ;
let iter4 = iter3 ;
let tmp6 = iter3 ;
let tmp7 = tmp5 ;
if ( ! iter3 . done ) {
do {
let handleEventResult = self . handleEvent ( iter4 . value ) ;
let iter5 = tmp5 ( ) ;
iter4 = iter5 ;
let tmp9 = iter5 ;
let tmp10 = tmp5 ;
2026-07-23 10:11:24 +00:00
done = iter5 . done ;
2026-07-20 16:05:17 +00:00
} while ( ! done ) ;
}
}
2026-07-23 10:11:24 +00:00
iter6 = tmp2 ( ) ;
2026-07-20 16:05:17 +00:00
iter2 = iter6 ;
2026-07-23 10:11:24 +00:00
} while ( ! iter6 . done ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
} ;
items [ 6 ] = {
key : "handleClose" ,
value() {
2026-07-23 10:11:24 +00:00
const self = this ;
2026-07-20 16:05:17 +00:00
const pingInterval = this . pingInterval ;
pingInterval . stop ( ) ;
if ( ! this . _requestedDisconnect ) {
const backoff = this . backoff ;
const _Math = Math ;
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
outer1_38 . info ( "WS Disconnected. Next retry in " + Math . round ( backoff . fail ( ( ) = > {
2026-07-20 16:05:17 +00:00
if ( ! self . _requestedDisconnect ) {
self . connect ( ) ;
}
} ) ) + "ms" ) ;
}
}
} ;
items [ 7 ] = {
key : "handleEvent" ,
value ( arg0 ) {
let event ;
let type ;
const self = this ;
( { type , event } = arg0 ) ;
2026-07-23 10:11:24 +00:00
if ( outer1_34 . PLAYER_STATE_CHANGED === type ) {
2026-07-20 16:05:17 +00:00
if ( tmp4 ) {
2026-07-23 10:11:24 +00:00
outer1_66 ( self . accountId , self . accessToken , event . state ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
tmp4 = null != event && null != event . state ;
} else if ( outer1_34 . DEVICE_STATE_CHANGED === type ) {
2026-07-20 16:05:17 +00:00
const result = self . handleDeviceStateChange ( ) ;
}
}
} ;
return callback2 ( SpotifySocket , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
let closure_50 = tmp12 ;
let tmp13 = ( ( Store ) = > {
2026-07-20 16:05:17 +00:00
class SpotifyStore {
constructor ( ) {
self = this ;
2026-07-23 10:11:24 +00:00
tmp = outer1_6 ( this , SpotifyStore ) ;
obj = outer1_4 ( SpotifyStore ) ;
tmp2 = outer1_3 ;
if ( outer1_52 ( ) ) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis ;
_Reflect = Reflect ;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_4 ;
2026-07-20 16:05:17 +00:00
tmp8 = arguments ;
2026-07-23 10:11:24 +00:00
constructResult = Reflect . construct ( obj , arguments , outer1_4 ( self ) . constructor ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments ;
tmp4 = arguments ;
constructResult = obj ( . . . arguments ) ;
}
return tmp2 ( self , constructResult ) ;
}
}
callback ( SpotifyStore , Store ) ;
let obj = {
key : "initialize" ,
value() {
2026-07-23 10:11:24 +00:00
this . waitFor ( outer1_9 , outer1_10 , outer1_11 , outer1_12 , outer1_8 , outer1_13 , outer1_14 ) ;
const items = [ outer1_12 ] ;
this . syncWith ( items , ( ) = > ( function handlePresenceUpdate() {
2026-07-20 16:05:17 +00:00
let party ;
let sync_id ;
let timestamps ;
2026-07-23 10:11:24 +00:00
if ( null == outer3_24 ) {
2026-07-20 16:05:17 +00:00
return false ;
2026-07-23 10:11:24 +00:00
} else if ( null == outer3_55 ( ) ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
2026-07-23 10:11:24 +00:00
const userId = outer3_24 . userId ;
const tmp14 = outer3_58 ( userId ) ;
2026-07-20 16:05:17 +00:00
if ( null == tmp14 ) {
2026-07-23 10:11:24 +00:00
outer3_41 . start ( outer3_29 , ( ) = > {
let tmp = null != outer4_24 ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = outer4_24 . userId === userId ;
2026-07-20 16:05:17 +00:00
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
outer4_1 ( outer4_2 [ 24 ] ) ( ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
return false ;
} else {
2026-07-23 10:11:24 +00:00
outer3_41 . stop ( ) ;
2026-07-20 16:05:17 +00:00
( { sync_id , timestamps , party } = tmp14 ) ;
let tmp2 = null != sync_id ;
if ( tmp2 ) {
2026-07-23 10:11:24 +00:00
tmp2 = outer3_24 . trackId !== sync_id ;
2026-07-20 16:05:17 +00:00
}
let tmp3 = null != timestamps ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
tmp3 = outer3_24 . startTime !== timestamps . start ;
2026-07-20 16:05:17 +00:00
}
if ( ! tmp2 ) {
if ( ! tmp3 ) {
let flag = null != party ;
if ( flag ) {
2026-07-23 10:11:24 +00:00
flag = party . id !== outer3_24 . partyId ;
2026-07-20 16:05:17 +00:00
}
if ( flag ) {
2026-07-23 10:11:24 +00:00
outer3_24 . partyId = party . id ;
2026-07-20 16:05:17 +00:00
flag = true ;
}
}
return flag ;
}
2026-07-23 10:11:24 +00:00
flag = outer3_62 ( userId , tmp14 , false ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
} ) ( ) ) ;
const isSpotifyProtocolRegistered = SpotifyStore ( outer1_2 [ 20 ] ) . fetchIsSpotifyProtocolRegistered ( ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , , , , , , , , , , , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "hasConnectedAccount" ,
value() {
2026-07-23 10:11:24 +00:00
return Object . keys ( outer1_44 ) . length > 0 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 1 ] = obj ;
obj = {
key : "getActiveSocketAndDevice" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_55 ( ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "getPlayableComputerDevices" ,
value() {
const items = [ ] ;
2026-07-23 10:11:24 +00:00
for ( const key10005 in outer1_44 ) {
2026-07-20 16:05:17 +00:00
let tmp7 = key10005 ;
2026-07-23 10:11:24 +00:00
let tmp8 = outer1_44 ;
let tmp9 = outer1_44 [ key10005 ] ;
2026-07-20 16:05:17 +00:00
if ( ! tmp9 . connected ) {
continue ;
} else {
2026-07-23 10:11:24 +00:00
let tmp = outer1_45 ;
if ( null == outer1_45 [ key10005 ] ) {
2026-07-20 16:05:17 +00:00
continue ;
} else {
2026-07-23 10:11:24 +00:00
let tmp2 = outer1_45 ;
let arr2 = outer1_45 [ key10005 ] ;
2026-07-20 16:05:17 +00:00
let found = arr2 . find ( ( is_restricted ) = > {
let tmp = ! is_restricted . is_restricted ;
if ( tmp ) {
tmp = "Computer" === is_restricted . type ;
}
return tmp ;
} ) ;
let tmp4 = found ;
if ( null == found ) {
continue ;
} else {
let obj = { socket : tmp9 , device : found } ;
let arr = items . push ( obj ) ;
let tmp6 = found ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
continue ;
}
continue ;
}
continue ;
}
return items ;
}
} ;
items [ 4 ] = {
key : "canPlay" ,
value ( party ) {
party = party . party ;
2026-07-23 10:11:24 +00:00
let tmp = null != outer1_55 ( ) && null != party . sync_id && null != party && null != party . id ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_16 ( party . id ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
}
} ;
items [ 5 ] = {
key : "getSyncingWith" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_24 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 6 ] = {
key : "wasAutoPaused" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_47 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 7 ] = {
key : "getLastPlayedTrackId" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_25 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 8 ] = {
key : "getTrack" ,
value() {
let track = null ;
2026-07-23 10:11:24 +00:00
if ( null != outer1_23 ) {
track = outer1_23 . track ;
2026-07-20 16:05:17 +00:00
}
return track ;
}
} ;
items [ 9 ] = {
key : "getPlayerState" ,
value ( arg0 ) {
2026-07-23 10:11:24 +00:00
return outer1_46 [ arg0 ] ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 10 ] = {
key : "shouldShowActivity" ,
value() {
2026-07-23 10:11:24 +00:00
let showActivity = null != outer1_23 ;
2026-07-20 16:05:17 +00:00
if ( showActivity ) {
2026-07-23 10:11:24 +00:00
showActivity = outer1_23 . account . showActivity ;
2026-07-20 16:05:17 +00:00
}
if ( showActivity ) {
2026-07-23 10:11:24 +00:00
showActivity = ! outer1_11 . isIdle ( ) ;
2026-07-20 16:05:17 +00:00
}
return showActivity ;
}
} ;
items [ 11 ] = {
key : "getActivity" ,
value() {
let album ;
let artists ;
let context ;
let duration ;
let id ;
let isLocal ;
let name ;
let startTime ;
let type ;
2026-07-23 10:11:24 +00:00
if ( null == outer1_23 ) {
2026-07-20 16:05:17 +00:00
let tmp18 = null ;
2026-07-23 10:11:24 +00:00
if ( null != outer1_24 ) {
tmp18 = outer1_58 ( outer1_24 . userId ) ;
2026-07-20 16:05:17 +00:00
}
return tmp18 ;
} else {
2026-07-23 10:11:24 +00:00
const track = outer1_23 . track ;
2026-07-20 16:05:17 +00:00
( { artists , album , name } = track ) ;
2026-07-23 10:11:24 +00:00
( { startTime , context } = outer1_23 ) ;
2026-07-20 16:05:17 +00:00
( { id , duration , isLocal , type } = track ) ;
const substr = artists . slice ( 0 , 5 ) ;
if ( artists . length > 0 ) {
const mapped = substr . map ( ( name ) = > name . name . replace ( /;/g , "" ) ) ;
const joined = mapped . join ( "; " ) ;
}
let obj = { } ;
let assetFromImageURL = null ;
if ( null != album . image ) {
2026-07-23 10:11:24 +00:00
let obj2 = SpotifyStore ( outer1_2 [ 27 ] ) ;
assetFromImageURL = obj2 . getAssetFromImageURL ( outer1_20 . SPOTIFY , album . image . url ) ;
2026-07-20 16:05:17 +00:00
}
if ( tmp6 ) {
obj . large_image = assetFromImageURL ;
}
2026-07-23 10:11:24 +00:00
if ( album . type !== outer1_37 ) {
2026-07-20 16:05:17 +00:00
obj . large_text = album . name ;
}
if ( null != context ) {
const uri = context . uri ;
}
2026-07-23 10:11:24 +00:00
if ( null != outer1_24 ) {
if ( null != outer1_24 . partyId ) {
let partyId = outer1_24 . partyId ;
2026-07-20 16:05:17 +00:00
}
let text = name ;
if ( name . length > 128 ) {
text = ` ${ name . substring ( 0 , 125 ) } ... ` ;
}
obj = { context_uri : uri , album_id : album.id , artist_ids : substr.map ( ( id ) = > id . id ) , type , button_urls : [ ] } ;
2026-07-23 10:11:24 +00:00
const obj1 = { name : outer1_26.name , assets : obj , details : text , state : joined } ;
2026-07-20 16:05:17 +00:00
obj2 = { start : startTime , end : startTime + duration } ;
obj1 . timestamps = obj2 ;
const obj3 = { id : partyId } ;
obj1 . party = obj3 ;
if ( ! isLocal ) {
obj1 . sync_id = id ;
2026-07-23 10:11:24 +00:00
obj1 . flags = outer1_21 . PLAY | outer1_21 . SYNC ;
2026-07-20 16:05:17 +00:00
obj1 . metadata = obj ;
}
return obj1 ;
}
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
partyId = "" + outer1_17 + outer1_9 . getId ( ) ;
tmp6 = null != album . image && null != assetFromImageURL ;
2026-07-20 16:05:17 +00:00
}
}
} ;
return callback2 ( SpotifyStore , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( require ( "initialize" ) . Store ) ;
2026-07-20 16:05:17 +00:00
tmp13 . displayName = "SpotifyStore" ;
2026-07-23 10:11:24 +00:00
tmp13 = new tmp13 ( require ( "dispatcher" ) , {
2026-07-20 16:05:17 +00:00
USER_CONNECTIONS_UPDATE : handleUserConnectionsUpdate ,
CONNECTION_OPEN : handleUserConnectionsUpdate ,
SPOTIFY_ACCOUNT_ACCESS_TOKEN : function handleSpotifyAccountAccessToken ( accountId ) {
upsertAccount ( accountId . accountId , accountId . accessToken ) ;
return false ;
} ,
SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE : function handleSpotifyAccountAccessTokenRevoked ( accountId ) {
removeAccount ( accountId . accountId ) ;
} ,
SPOTIFY_PROFILE_UPDATE : function handleSpotifyProfileUpdate ( arg0 ) {
let accountId ;
let isPremium ;
( { accountId , isPremium } = arg0 ) ;
2026-07-23 10:11:24 +00:00
if ( null == dependencyMap [ accountId ] ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
tmp . isPremium = isPremium ;
const _HermesInternal = HermesInternal ;
importDefaultResult1 . info ( "Profile updated for " + accountId + ": isPremium = " + isPremium ) ;
}
} ,
SPOTIFY_PLAYER_STATE : function handleSpotifyPlayerState ( arg0 ) {
let accountId ;
let context ;
let device ;
let isPlaying ;
let position ;
let repeat ;
let track ;
( { accountId , isPlaying , track , position , device } = arg0 ) ;
2026-07-23 10:11:24 +00:00
let account ;
2026-07-20 16:05:17 +00:00
let flag = false ;
( { repeat , context } = arg0 ) ;
if ( null != device ) {
2026-07-23 10:11:24 +00:00
if ( null != dependencyMap2 [ accountId ] ) {
const found = dependencyMap2 [ accountId ] . find ( ( id ) = > id . id === device . id ) ;
2026-07-20 16:05:17 +00:00
if ( null == found ) {
2026-07-23 10:11:24 +00:00
dependencyMap2 [ accountId ] . push ( device ) ;
2026-07-20 16:05:17 +00:00
let flag2 = true ;
2026-07-23 10:11:24 +00:00
const arr3 = dependencyMap2 [ accountId ] ;
2026-07-20 16:05:17 +00:00
} else {
flag2 = false ;
2026-07-23 10:11:24 +00:00
if ( ! account ( 620 ) ( found , device ) ) {
2026-07-20 16:05:17 +00:00
const _Object = Object ;
const merged = Object . assign ( found , device ) ;
flag2 = true ;
}
}
setActiveDevice ( accountId , device . id ) ;
2026-07-23 10:11:24 +00:00
const arr2 = dependencyMap2 [ accountId ] ;
2026-07-20 16:05:17 +00:00
} else {
const items = [ device ] ;
2026-07-23 10:11:24 +00:00
dependencyMap2 [ accountId ] = items ;
2026-07-20 16:05:17 +00:00
flag = true ;
}
}
2026-07-23 10:11:24 +00:00
let obj = c48 ;
2026-07-20 16:05:17 +00:00
if ( isPlaying ) {
let tmp14 = track ;
if ( null != obj ) {
obj . start ( closure_28 , autoPause ) ;
tmp14 = track ;
}
} else {
tmp14 = null ;
if ( null != obj ) {
obj . stop ( ) ;
tmp14 = null ;
}
}
2026-07-23 10:11:24 +00:00
account = store2 . getAccount ( accountId , PlatformTypes . SPOTIFY ) ;
2026-07-20 16:05:17 +00:00
if ( null == account ) {
return flag ;
} else {
let tmp21 = null ;
if ( null != tmp14 ) {
obj = { account , track : tmp14 , startTime : calculateStartTime ( tmp59 , position ) , context , repeat } ;
tmp21 = obj ;
}
let tmp22 = null != device ;
if ( tmp22 ) {
tmp22 = null != closure_24 ;
}
if ( tmp22 ) {
tmp22 = 0 === position ;
}
if ( tmp22 ) {
tmp22 = ! isPlaying ;
}
if ( ! tmp22 ) {
2026-07-23 10:11:24 +00:00
dependencyMap3 [ accountId ] = tmp21 ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const values = account ( 22 ) . values ( dependencyMap3 ) ;
2026-07-20 16:05:17 +00:00
let closure_23 = values . find ( ( arg0 ) = > null != arg0 ) ;
setSpeaking ( store . getId ( ) ) ;
if ( null != tmp14 ) {
if ( ! tmp22 ) {
timeout3 . start ( tmp14 . duration - position + closure_30 , ( ) = > {
2026-07-23 10:11:24 +00:00
outer1_57 ( account . id ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
if ( null == closure_24 ) {
if ( timeout4 . isStarted ( ) ) {
importDefaultResult1 . info ( "Listen along stop cancelled as playback of track resumed" ) ;
timeout4 . stop ( ) ;
}
} else {
const _HermesInternal = HermesInternal ;
importDefaultResult1 . info ( "Listen along active but playback stopped or track changed. Stopping listen along in " + closure_30 + "ms" ) ;
timeout4 . start ( closure_30 , ( ) = > {
2026-07-23 10:11:24 +00:00
outer1_38 . info ( "Stopping listening along" ) ;
account ( outer1_2 [ 24 ] ) ( ) ;
outer1_57 ( account . id ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
let tmp51 = flag ;
if ( tmp25 !== closure_23 ) {
if ( null != tmp59 ) {
if ( null != tmp59 ) {
if ( null != tmp21 ) {
if ( tmp59 . track . id === tmp21 . track . id ) {
tmp51 = flag ;
}
}
}
if ( null != tmp14 ) {
obj = { type : "SPOTIFY_NEW_TRACK" , track : tmp14 , connectionId : accountId } ;
2026-07-23 10:11:24 +00:00
account ( 686 ) . dispatch ( obj ) ;
const obj4 = account ( 686 ) ;
2026-07-20 16:05:17 +00:00
const obj1 = { party_platform : PlatformTypes.SPOTIFY , track_id : tmp14.id , has_images : true , details : tmp14.album.name , state : tmp14.name , album_id : tmp14.album.id } ;
const artists = tmp14 . artists ;
obj1 . author_ids = artists . map ( ( id ) = > id . id ) ;
const artists1 = tmp14 . artists ;
obj1 . author_names = artists1 . map ( ( name ) = > name . name ) ;
2026-07-23 10:11:24 +00:00
account ( 675 ) . track ( constants3 . ACTIVITY_UPDATED , obj1 ) ;
const obj6 = account ( 675 ) ;
2026-07-20 16:05:17 +00:00
}
} else {
tmp51 = flag ;
}
}
return tmp51 ;
}
timeout3 . stop ( ) ;
2026-07-23 10:11:24 +00:00
const obj3 = account ( 22 ) ;
tmp25 = closure_23 ;
2026-07-20 16:05:17 +00:00
}
} ,
SPOTIFY_PLAYER_PLAY : function handleSpotifyPlayerPlay ( id ) {
id = id . id ;
} ,
ACTIVITY_PLAY : function handleUserActivityPlay ( arg0 ) {
let accessToken ;
let accountId ;
let activity ;
let device ;
let metadata ;
let party ;
let socket ;
let sync_id ;
( { activity , metadata } = arg0 ) ;
const tmp = _getActiveSocketAndDevice ( ) ;
if ( null == tmp ) {
return false ;
} else {
( { socket , device } = tmp ) ;
( { sync_id , party } = activity ) ;
let tmp2 = null == sync_id || null == party || null == party . id ;
if ( ! tmp2 ) {
tmp2 = ! callback3 ( party . id ) ;
}
let tmp4 = ! tmp2 ;
if ( ! tmp2 ) {
if ( null != metadata ) {
const context_uri = metadata . context_uri ;
}
if ( null != closure_24 ) {
handleUserActivitySyncStop ( ) ;
}
if ( null != metadata ) {
2026-07-24 07:16:23 +00:00
let obj = require ( 10930 ) /* apiRequest */ ;
2026-07-20 16:05:17 +00:00
( { accountId , accessToken } = socket ) ;
let TRACK = metadata . type ;
if ( null == TRACK ) {
TRACK = constants2 . TRACK ;
}
obj = { contextUri : context_uri , deviceId : device.id } ;
obj . play ( accountId , accessToken , sync_id , TRACK , obj ) ;
const _HermesInternal = HermesInternal ;
importDefaultResult1 . info ( "Play started: " + socket . accountId + " playing " + sync_id + " on " + device . name ) ;
}
tmp4 = tmp8 ;
}
return tmp4 ;
}
} ,
ACTIVITY_SYNC : function handleUserActivitySync ( userId ) {
return activitySync ( userId . userId , userId . activity , true ) ;
} ,
ACTIVITY_SYNC_STOP : handleUserActivitySyncStop ,
SPOTIFY_SET_DEVICES : function handleSpotifySetDevices ( arg0 ) {
let accountId ;
let devices ;
( { accountId , devices } = arg0 ) ;
closure_45 [ accountId ] = devices ;
importDefaultResult1 . info ( "Devices updated for " + accountId + ":" , devices ) ;
} ,
SPOTIFY_SET_ACTIVE_DEVICE : function handleSetActiveDevice ( accountId ) {
setActiveDevice ( accountId . accountId , accountId . deviceId ) ;
} ,
SPEAKING : function handleSpeaking ( userId ) {
setSpeaking ( userId . userId ) ;
return false ;
} ,
VOICE_STATE_UPDATES : function handleVoiceStateUpdates ( voiceStates ) {
voiceStates = voiceStates . voiceStates ;
return voiceStates . reduce ( ( arg0 , userId ) = > {
2026-07-23 10:11:24 +00:00
outer1_65 ( userId . userId ) ;
2026-07-20 16:05:17 +00:00
return arg0 ;
} , false ) ;
} ,
MEDIA_ENGINE_SET_GO_LIVE_SOURCE : function handleSetGoLiveSource ( settings ) {
settings = settings . settings ;
let desktopSettings ;
if ( null != settings ) {
desktopSettings = settings . desktopSettings ;
}
if ( null != desktopSettings ) {
2026-07-23 10:11:24 +00:00
if ( null != c48 ) {
2026-07-20 16:05:17 +00:00
obj . stop ( ) ;
}
let desktopSettings1 ;
if ( null != settings ) {
desktopSettings1 = settings . desktopSettings ;
}
const sourceId = desktopSettings1 . sourceId ;
if ( null != sourceId ) {
if ( observedAppNameForWindow . getObservedAppNameForWindow ( sourceId ) === name . name ) {
if ( tmp5 ) {
2026-07-23 10:11:24 +00:00
const Interval = require ( 4015 ) /* _createForOfIteratorHelperLoose */ . Interval ;
2026-07-20 16:05:17 +00:00
const prototype = Interval . prototype ;
const interval = new Interval ( ) ;
2026-07-23 10:11:24 +00:00
c48 = interval ;
2026-07-20 16:05:17 +00:00
interval . start ( closure_28 , autoPause ) ;
}
}
}
2026-07-23 10:11:24 +00:00
if ( null != c48 ) {
2026-07-20 16:05:17 +00:00
obj2 . stop ( ) ;
}
2026-07-23 10:11:24 +00:00
c48 = null ;
obj = c48 ;
obj2 = c48 ;
2026-07-20 16:05:17 +00:00
} else if ( null == settings ) {
2026-07-23 10:11:24 +00:00
if ( null != c48 ) {
2026-07-20 16:05:17 +00:00
obj4 . stop ( ) ;
}
2026-07-23 10:11:24 +00:00
c48 = null ;
obj4 = c48 ;
2026-07-20 16:05:17 +00:00
}
}
} ) ;
2026-07-23 10:11:24 +00:00
let closure_51 = tmp13 ;
let result = set . fileFinishedImporting ( "modules/spotify/SpotifyStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default tmp13 ;
export const SpotifySocket = tmp12 ;