ng && (this.currentlyProcessing = null, this.nextFrag()) }, e.prototype.doTick = function () { var t = this; switch (this.state) { case d.IDLE: var e = this.tracks, r = this.currentTrackId, i = this.vttFragSNsProcessed[r], n = this.vttFragQueues[r], a = this.currentlyProcessing ? this.currentlyProcessing.sn : -1, l = function (t) { return i.indexOf(t.sn) > -1 }, u = function (t) { return n.some(function (e) { return e.sn === t.sn }) }; if (!e) break; var c; if (r < e.length && (c = e[r].details), void 0 === c) break; c.fragments.forEach(function (e) { l(e) || e.sn === a || u(e) || (e.encrypted ? (s.b.log("Loading key for " + e.sn), t.state = d.KEY_LOADING, t.hls.trigger(o.a.KEY_LOADING, { frag: e })) : (e.trackId = r, n.push(e), t.nextFrag())) }) } }, e.prototype.onSubtitleTracksUpdated = function (t) { var e = this; s.b.log("subtitle tracks updated"), this.tracks = t.subtitleTracks, this.clearVttFragQueues(), this.vttFragSNsProcessed = {}, this.tracks.forEach(function (t) { e.vttFragSNsProcessed[t.id] = [] }) }, e.prototype.onSubtitleTrackSwitch = function (t) { if (this.currentTrackId = t.id, this.tracks && -1 !== this.currentTrackId) { var e = this.tracks[this.currentTrackId]; e && e.details && this.tick() } }, e.prototype.onSubtitleTrackLoaded = function () { this.tick() }, e.prototype.onKeyLoaded = function () { this.state === d.KEY_LOADING && (this.state = d.IDLE, this.tick()) }, e.prototype.onFragLoaded = function (t) { var e = this.fragCurrent, r = t.frag.decryptdata, i = t.frag, n = this.hls; if (this.state === d.FRAG_LOADING && e && "subtitle" === t.frag.type && e.sn === t.frag.sn && t.payload.byteLength > 0 && null != r && null != r.key && "AES-128" ==Ñ