async function filterSequences(sequences) {
        const showsPano = context.photos().showsPanoramic();
        const showsFlat = context.photos().showsFlat();
        const fromDate = context.photos().fromDate();
        const toDate = context.photos().toDate();
        const username = context.photos().usernames();

        const service = getService();

        if (!showsPano || !showsFlat) {
            sequences = sequences.filter(function(sequence) {
                    if (sequence.properties.type === 'equirectangular') return showsPano;
                    return showsFlat;
            });
        }
        if (fromDate) {
            sequences = sequences.filter(function(sequence) {
                return new Date(sequence.properties.date).getTime() >= new Date(fromDate).getTime().toString();
            });
        }
        if (toDate) {
            sequences = sequences.filter(function(sequence) {
                return new Date(sequence.properties.date).getTime() <= new Date(toDate).getTime().toString();
            });
        }
        if (username && service) {
            if (_activeUsernameFilter !== username) {
                _activeUsernameFilter = username;

                const tempIds = await service.getUserIds(username);

                _activeIds = {};
                tempIds.forEach(id => {
                    _activeIds[id] = true;
                });
            }

            sequences = sequences.filter(function(sequence) {
                return _activeIds[sequence.properties.account_id];
            });
        }

        return sequences;
    }
Filters the sequences given the filters on the right panel
@param {*} sequences
@returns array of filtered sequences