Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import DownloadIcon from 'icons/DownloadIcon'
import InfoIcon from 'icons/InfoIcon'
import AudioIcon from 'icons/AudioIcon'
import TranscriptsIcon from 'icons/TranscriptsIcon'
const tabs = {
InfoTab: () => import(/* webpackMode: "eager" */'./info/Info'),
ShareTab: () => import(/* webpackMode: "eager" */'./share/Share'),
ChaptersTab: () => import(/* webpackMode: "eager" */'./chapters/Chapters'),
TranscriptsTab: () => import(/* webpackMode: "eager" */'./transcripts/Transcripts'),
FilesTab: () => import(/* webpackMode: "eager" */'./files/Files'),
AudioTab: () => import(/* webpackMode: "eager" */'./audio/Audio')
}
export default {
data: mapState('theme', 'tabs', 'chapters', 'reference', 'visibleComponents', 'components', 'volume', 'muted'),
computed: {
containerStyle () {
return {
'background-color': this.theme.tabs.body.background
}
},
isVisibleTab () {
return {
info: this.components.tabs.info && this.visibleComponents.tabInfo,
chapters: this.components.tabs.chapters && this.visibleComponents.tabChapters,
share: this.components.tabs.share && this.visibleComponents.tabShare,
files: this.components.tabs.files && this.visibleComponents.tabFiles,
transcripts: this.components.tabs.transcripts && this.visibleComponents.tabTranscripts,
audio: this.components.tabs.audio && this.visibleComponents.tabAudio
}
},
}
const stateToSpeedSlider = (value = 0) => {
value = parseFloat(value)
if (value <= 1) {
value = value - 0.5
} else {
value = (value + 2) / 6
}
return value
}
export default {
data: mapState('rate', 'theme'),
computed: {
sliderRate () {
return this.toSliderRate(this.rate)
}
},
methods: {
...mapActions('setRate'),
toStateRate (value) {
compose(
this.setRate.bind(this),
round,
speedSliderToState,
normalizeSliderValue
)(value)
},
setStateRate (value) {