function _instanceof(left, right) {
    if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
        return !!right[Symbol.hasInstance](left);
    } else {
        return left instanceof right;
    }
}
import { Subject } from "rxjs";
export var modal$ = new Subject();
export var download = function download(rawData, fileName) {
    var data = _instanceof(rawData, Uint8Array) ? new Blob([
        rawData
    ]) : rawData;
    var link = document.createElement('a');
    if (link.download !== undefined) {
        var url = URL.createObjectURL(data);
        link.addEventListener('click', function(e) {
            return e.stopPropagation();
        });
        link.setAttribute('href', url);
        link.setAttribute('download', fileName);
        link.style.visibility = 'hidden';
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    }
};
