import {a as Ce} from "./chunk-A7FD2ZYK.js";
import {a as V} from "./chunk-IBRVAY6F.js";
import {b as Se} from "./chunk-QJMD2SGW.js";
import {t as _e} from "./chunk-Y4TQXMUD.js";
import {d as we, e as xe, f as Fe, i as D} from "./chunk-LICAV5XP.js";
import {D as ge, E as ye, c as ue, g as ve, l as be, y as fe} from "./chunk-EYGQBKHN.js";
import {Aa as ae, Da as le, Sb as me, Ua as ce, _a as de, bb as pe, eb as he, f as Z, ha as re, i as ee, l as te, m as ie, t as oe, xa as ne, za as se} from "./chunk-3H2Q52KW.js";
import {$c as J, Ab as K, Dd as N, Ec as l, Fc as S, Gc as H, Hb as m, Hd as Q, Kc as O, Lc as R, Mc as M, Qc as q, Rb as a, Sc as C, bc as r, cc as n, dc as f, eb as _, gb as $, hb as U, hc as w, lb as s, mb as v, nc as u, pc as d, rb as j, sa as g, sc as L, ta as y, td as W, ud as G, vd as X, zd as Y} from "./chunk-DF3EMM3Z.js";
import "./chunk-2AVGQ2MQ.js";
var A = i => ({
    display: i
})
  , Te = i => ({
    selected: i
});
function ke(i, c) {
    i & 1 && (r(0, "c-card")(1, "c-card-header", 21)(2, "h4"),
    l(3, "404 Not Found"),
    n()()())
}
function Pe(i, c) {
    i & 1 && (r(0, "th", 38),
    l(1, "Uploaded Time"),
    n())
}
function Ue(i, c) {
    if (i & 1 && (r(0, "td")(1, "div"),
    l(2),
    n()()),
    i & 2) {
        let e = d(2);
        s(2),
        S(e.getFormattedDate(e.modifiedTime))
    }
}
function Ne(i, c) {
    if (i & 1) {
        let e = w();
        r(0, "button", 41),
        u("click", function() {
            g(e);
            let t = d(2);
            return y(t.restore())
        }),
        l(1, "Restore"),
        n()
    }
}
function De(i, c) {
    if (i & 1) {
        let e = w();
        r(0, "c-card")(1, "c-card-header", 21)(2, "h4"),
        l(3, "This file has been archived by CrashPlan."),
        n()(),
        r(4, "c-card-body")(5, "c-row")(6, "table", 36)(7, "thead", 37)(8, "tr")(9, "th", 38),
        l(10, "File Name"),
        n(),
        r(11, "th", 38),
        l(12, "File Size"),
        n(),
        m(13, Pe, 2, 0, "th", 39),
        r(14, "th", 38),
        l(15, "Action(s)"),
        n()()(),
        r(16, "tbody")(17, "tr")(18, "td")(19, "div"),
        l(20),
        n()(),
        r(21, "td")(22, "div"),
        l(23),
        n()(),
        m(24, Ue, 3, 1, "td", 2),
        r(25, "td")(26, "button", 40),
        u("click", function() {
            g(e);
            let t = d();
            return y(t.viewFile())
        }),
        l(27, "View"),
        n(),
        r(28, "button", 41),
        u("click", function() {
            g(e);
            let t = d();
            return y(t.downloadFile())
        }),
        l(29, "Download"),
        n(),
        m(30, Ne, 2, 0, "button", 42),
        n()()()()()()()
    }
    if (i & 2) {
        let e = d();
        s(6),
        a("hover", !0)("responsive", !0)("striped", !0),
        s(7),
        a("ngIf", e.productType != "OUTLOOK"),
        s(7),
        S(e.fileName),
        s(3),
        S(e.size),
        s(),
        a("ngIf", e.productType != "OUTLOOK"),
        s(6),
        a("ngIf", e.productType != "BACKUP")
    }
}
function Ve(i, c) {
    if (i & 1) {
        let e = w();
        r(0, "button", 43),
        u("click", function() {
            g(e);
            let t = d();
            return y(t.restoreConfirm())
        }),
        l(1, "Restore"),
        n()
    }
}
function Ae(i, c) {
    if (i & 1) {
        let e = w();
        r(0, "button", 43),
        u("click", function() {
            g(e);
            let t = d();
            return y(t.restoreConfirmOneDriveSharePoint())
        }),
        l(1, "Restore"),
        n()
    }
}
function Ee(i, c) {
    i & 1 && (r(0, "span"),
    l(1, "/"),
    n())
}
function Be(i, c) {
    if (i & 1 && (r(0, "span"),
    l(1),
    n()),
    i & 2) {
        let e = d();
        s(),
        S(e.browsePath)
    }
}
function Oe(i, c) {
    if (i & 1) {
        let e = w();
        r(0, "button", 44),
        u("click", function() {
            g(e);
            let t = d();
            return y(t.backBrowse())
        }),
        f(1, "i", 45),
        l(2, " Back"),
        n()
    }
}
function Re(i, c) {
    i & 1 && (r(0, "tr")(1, "td", 46)(2, "div", 47)(3, "span", 48),
    l(4, "Loading..."),
    n()()()())
}
function Me(i, c) {
    if (i & 1) {
        let e = w();
        r(0, "tr", 49),
        u("click", function() {
            let t = g(e).$implicit
              , p = d();
            return y(p.onSingleClick(t))
        })("dblclick", function() {
            let t = g(e).$implicit
              , p = d();
            return y(p.onDoubleClick(t))
        }),
        r(1, "td")(2, "span", 50),
        l(3),
        n()()()
    }
    if (i & 2) {
        let e = c.$implicit
          , o = d();
        a("ngClass", C(3, Te, o.selectedBrowseItem === e)),
        s(2),
        L("title", e),
        s(),
        H(" ", e, " ")
    }
}
function ze(i, c) {
    if (i & 1 && f(0, "app-pdf-viewer", 59),
    i & 2) {
        let e = d(3);
        a("src", e.pdfFile)
    }
}
function $e(i, c) {
    if (i & 1 && f(0, "img", 60),
    i & 2) {
        let e = d(3);
        a("src", e.jpgFile, $)
    }
}
function je(i, c) {
    if (i & 1 && (r(0, "div", 56),
    m(1, ze, 1, 1, "app-pdf-viewer", 57)(2, $e, 1, 1, "img", 58),
    n()),
    i & 2) {
        let e = d(2);
        s(),
        a("ngIf", e.viewFileType == "pdfFile"),
        s(),
        a("ngIf", e.viewFileType == "imageFile")
    }
}
function Ke(i, c) {
    i & 1 && f(0, "div", 63)
}
function Le(i, c) {
    if (i & 1 && (r(0, "div", 61),
    m(1, Ke, 1, 0, "div", 62),
    n()),
    i & 2) {
        let e = d(2);
        s(),
        a("ngIf", e.viewFileType == "textFile")
    }
}
function He(i, c) {
    i & 1 && (r(0, "c-callout", 64),
    l(1, " Note: Please use arrow keys to navigate between slides. "),
    n())
}
function qe(i, c) {
    if (i & 1 && f(0, "iframe", 70),
    i & 2) {
        let e = d(4);
        a("src", e.xlsxFile, U)
    }
}
function Je(i, c) {
    if (i & 1 && f(0, "iframe", 70),
    i & 2) {
        let e = d(4);
        a("src", e.docxFile, U)
    }
}
function We(i, c) {
    if (i & 1 && f(0, "iframe", 70),
    i & 2) {
        let e = d(4);
        a("src", e.pptxFile, U)
    }
}
function Ge(i, c) {
    if (i & 1 && (r(0, "div", 67),
    f(1, "div", 68),
    m(2, qe, 1, 1, "iframe", 69)(3, Je, 1, 1, "iframe", 69)(4, We, 1, 1, "iframe", 69),
    n()),
    i & 2) {
        let e = d(3);
        s(2),
        a("ngIf", e.viewFileType == "excelFile"),
        s(),
        a("ngIf", e.viewFileType == "docFile"),
        s(),
        a("ngIf", e.viewFileType == "pptFile")
    }
}
function Xe(i, c) {
    if (i & 1 && (r(0, "div", 65),
    m(1, Ge, 5, 3, "div", 66),
    n()),
    i & 2) {
        let e = d(2);
        s(),
        a("ngIf", e.viewFileType == "excelFile" || e.viewFileType == "docFile" || e.viewFileType == "pptFile")
    }
}
function Ye(i, c) {
    if (i & 1 && (r(0, "div", 51),
    m(1, je, 3, 2, "div", 52)(2, Le, 2, 1, "div", 53)(3, He, 2, 0, "c-callout", 54)(4, Xe, 2, 1, "div", 55),
    n()),
    i & 2) {
        let e = d();
        s(),
        a("ngIf", e.viewFileType == "pdfFile" || e.viewFileType == "imageFile"),
        s(),
        a("ngIf", e.viewFileType == "textFile"),
        s(),
        a("ngIf", e.viewFileType == "pptFile"),
        s(),
        a("ngIf", e.viewFileType == "excelFile" || e.viewFileType == "docFile" || e.viewFileType == "pptFile")
    }
}
var xt = ( () => {
    class i {
        constructor(e, o, t, p, b, P, I, x, z, T, h, F, E) {
            this.http = e,
            this.datePipe = o,
            this.titleService = t,
            this.toastr = p,
            this.apiService = b,
            this.AuthService = P,
            this.globalConstantsService = I,
            this.cdr = x,
            this.router = z,
            this.sharedService = T,
            this.renderer = h,
            this.configService = F,
            this.sanitizer = E,
            this.parent = "File Archived View",
            this.child = "",
            this.subchild = "",
            this.stubbedUserName = "",
            this.stubbedDeviceUUID = "",
            this.stubbedOdItemId = "",
            this.stubbedAttachName = "",
            this.stubbedMailFoldPath = "",
            this.fileName = "",
            this.filePath = "",
            this.backupID = "",
            this.size = "",
            this.modifiedTime = 0,
            this.productType = "",
            this.gatewayName = "",
            this.displayRestoreStyle = "none",
            this.deviceUUID = "",
            this.destinationPath = "",
            this.browsePath = "",
            this.browseItems = [],
            this.displayBrowseStyle = "none",
            this.newFolder = "",
            this.selectedBrowseItem = null,
            this.combinedBrowseValue = "",
            this.loading = !1,
            this.linkExpired = !0,
            this.displayOverlayStyle = "none",
            this.jpgFile = "",
            this.pdfFile = "",
            this.txtFile = "",
            this.viewFileType = "",
            this.textContent = "",
            this.fileViewStyle = "none",
            this.clearLocalStorage = () => {
                this.sharedService.removeData("stubbedUserName"),
                this.sharedService.removeData("stubbedDeviceUUID"),
                this.sharedService.removeData("stubbedOdItemId"),
                this.sharedService.removeData("stubbedAttachName"),
                this.sharedService.removeData("stubbedMailFoldPath"),
                console.log("LocalStorage cleared on tab close or navigation")
            }
            ,
            this.viewFilePath = "",
            this.xlsxFile = "",
            this.docxFile = "",
            this.pptxFile = ""
        }
        ngOnInit() {
            this.stubbedUserName = this.sharedService.getDataByKey("stubbedUserName"),
            this.stubbedDeviceUUID = this.sharedService.getDataByKey("stubbedDeviceUUID"),
            this.stubbedOdItemId = this.sharedService.getDataByKey("stubbedOdItemId"),
            this.stubbedAttachName = this.sharedService.getDataByKey("stubbedAttachName"),
            this.stubbedMailFoldPath = this.sharedService.getDataByKey("stubbedMailFoldPath"),
            this.deviceUUID = atob(this.stubbedDeviceUUID),
            this.getFileInfoDetails()
        }
        ngOnDestroy() {
            window.removeEventListener("beforeunload", this.clearLocalStorage)
        }
        getFormattedDate(e) {
            return this.datePipe.transform(e, "dd-MMM-yyyy HH:mm:ss") || ""
        }
        sendMeTo(e) {
            this.router.navigate([e])
        }
        getFileInfoDetails() {
            this.apiService.getFileInfoDetails(this.stubbedUserName, this.stubbedDeviceUUID, this.stubbedOdItemId, this.stubbedAttachName, this.stubbedMailFoldPath).subscribe(e => {
                var o = JSON.stringify(e.body)
                  , t = JSON.parse(o);
                console.log("response : " + JSON.stringify(e)),
                console.log("response headers : " + JSON.stringify(e.headers)),
                e.status === 200 && (this.linkExpired = !1,
                this.size = this.getFileSize(e.headers.get("sizeInBytes")),
                this.productType = e.headers.get("productType"),
                this.modifiedTime = e.headers.get("lastServerModifiedTime"),
                this.productType == "ONEDRIVE" || this.productType == "SHAREPOINT" ? this.fileName = atob(e.headers.get("fileName")) : this.fileName = e.headers.get("attachName"),
                atob(this.stubbedAttachName) == "rapidRestore" && atob(this.stubbedMailFoldPath) == "noDevicePath" && (this.productType = "BACKUP",
                this.fileName = atob(e.headers.get("fileName"))),
                this.backupID = e.headers.get("backupID"),
                this.filePath = e.headers.get("filePath"),
                this.gatewayName = e.headers.get("gatewayName")),
                e.status === 204 && (this.linkExpired = !0),
                this.cdr.detectChanges()
            }
            , e => {
                switch (console.error("Error from getFileInfoDetails: ", e),
                e.status) {
                case 400:
                    console.error("Bad Request: ", e.message);
                    break;
                case 401:
                    console.error("Unauthorized: ", e.message),
                    this.toastr.error("Token expired, navigating to logout page.", "Error"),
                    setTimeout( () => {
                        this.router.navigate(["/logout"])
                    }
                    , 3e3);
                    break;
                case 403:
                    console.error("Forbidden: ", e.message);
                    break;
                case 404:
                    console.error("Not Found: ", e.message);
                    break;
                case 500:
                    console.error("Internal Server Error: ", e.message);
                    break;
                case 503:
                    console.error("Internal Server Error: ", e.message);
                    break;
                default:
                    console.error("Unknown Error: ", e.message);
                    break
                }
            }
            )
        }
        getFileSize(e) {
            let o = e;
            return o >= 1073741824 ? (o / 1073741824).toFixed(2) + " GB" : o >= 1048576 ? (o / 1048576).toFixed(2) + " MB" : o >= 1024 ? (o / 1024).toFixed(2) + " KB" : o > 1 ? o + " bytes" : o === 1 ? o + " byte" : "0 bytes"
        }
        viewFile() {
            let e = "";
            var o = this.fileName
              , t = this.backupID
              , p = atob(this.filePath)
              , b = "false"
              , P = this.stubbedUserName
              , I = atob(this.stubbedDeviceUUID);
            let x = o.substring(o.lastIndexOf(".") + 1);
            if (!["jpg", "jpeg", "png", "xlsx", "docx", "pptx", "xls", "doc", "ppt", "txt", "log", "pdf"].includes(x.toLowerCase())) {
                this.toastr.error("Selected file format is not supported yet.");
                return
            }
            let T = "";
            this.productType != "BACKUP" ? T = this.stubbedAttachName : T = "",
            this.apiService.viewFile(o, t, p, b, P, I, T).subscribe(h => {
                console.log("res : " + JSON.stringify(h));
                let F = h.headers.get("filepath");
                console.log("Specific Header:", F);
                let E = h.headers.get("filename");
                console.log("Specific Header1:", E);
                let Ie = /\/(?:chunk|decrypted)\/([^/]+)/;
                if (F) {
                    let k = F.match(Ie);
                    k && (console.log(k[1]),
                    e = k[1])
                }
                setTimeout( () => {
                    let k = `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/downloadHelper.php?function=moveForView&params=${F},${x}`;
                    this.http.post(k, {
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded"
                        },
                        observe: "response"
                    }).subscribe(B => {
                        console.log("File moved successfully:", B),
                        this.executeNextCode(x, e)
                    }
                    , B => {
                        console.error("Error moving file:", B),
                        this.executeNextCode(x, e)
                    }
                    )
                }
                , 1e3),
                this.cdr.detectChanges()
            }
            , h => {
                switch (h.status) {
                case 400:
                    console.error("Bad Request: ", h.message);
                    break;
                case 401:
                    console.error("Unauthorized: ", h.message),
                    this.toastr.error("Token expired, navigating to logout page.", "Error"),
                    setTimeout( () => {
                        this.router.navigate(["/logout"])
                    }
                    , 3e3);
                    break;
                case 403:
                    console.error("Forbidden: ", h.message);
                    break;
                case 404:
                    console.error("Not Found: ", h.message);
                    break;
                case 412:
                    console.error("Error code 412: ", h.message),
                    this.toastr.error("Cannot delete filter, already mapped to policy.");
                    break;
                case 447:
                    this.toastr.info("Changes were not saved.  The User is under Legal hold. Please contact your Administrator.", "Info");
                    break;
                case 500:
                    console.error("Internal Server Error: ", h.message);
                    break;
                case 503:
                    console.error("Internal Server Error: ", h.message);
                    break;
                default:
                    console.error("Unknown Error: ", h.message);
                    break
                }
            }
            )
        }
        showTextFile(e) {
            this.txtFile = "assets/document/" + e,
            this.http.get(this.txtFile, {
                responseType: "text"
            }).subscribe(o => {
                if (o.trim().length > 0) {
                    console.log("data : " + JSON.stringify(o));
                    let t = document.querySelector(".content");
                    if (t) {
                        let p = document.createElement("pre");
                        p.innerHTML = this.sanitizer.sanitize(_.HTML, o) || "",
                        t.appendChild(p),
                        t.style.textAlign = "left",
                        t.style.display = "block"
                    }
                }
            }
            , o => {
                console.error("File does not exist or could not be loaded:", o)
            }
            )
        }
        executeNextCode(e, o) {
            if (e == "txt" || e == "log" || e == "TXT" || e == "LOG" || e == "csv") {
                this.viewFileType = "textFile";
                let t = this.sanitizer.sanitize(_.URL, `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/document/${o}${this.productType !== "OUTLOOK" ? ("."+e) : ''}`);
                this.showTextFile(o + ".txt")
            } else if (this.isImageFile(e))
                this.viewFileType = "imageFile",
                this.jpgFile = this.sanitizer.sanitize(_.URL, `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/document/${o}${this.productType !== "OUTLOOK" ? ("."+e) : ''}`) || "";
            else if (e == "xlsx" || e == "xls") {
                this.viewFileType = "excelFile";
                let t = encodeURIComponent(this.sanitizer.sanitize(_.URL, `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/document/${o}${this.productType !== "OUTLOOK" ? ("."+e) : ''}`) || "");
                this.xlsxFile = this.sanitizer.bypassSecurityTrustResourceUrl(`https://view.officeapps.live.com/op/embed.aspx?src=${t}`),
                console.log("xlsxFile : " + this.xlsxFile)
            } else if (e == "docx" || e == "doc") {
                this.viewFileType = "docFile";
                let t = encodeURIComponent(this.sanitizer.sanitize(_.URL, `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/document/${o}${this.productType !== "OUTLOOK" ? ("."+e) : ''}`) || "");
                this.docxFile = this.sanitizer.bypassSecurityTrustResourceUrl(`https://view.officeapps.live.com/op/embed.aspx?src=${t}`)
            } else if (e == "pptx" || e == "ppt") {
                this.viewFileType = "pptFile";
                let t = encodeURIComponent(this.sanitizer.sanitize(_.URL, `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/document/${o}${this.productType !== "OUTLOOK" ? ("."+e) : ''}`) || "");
                this.pptxFile = this.sanitizer.bypassSecurityTrustResourceUrl(`https://view.officeapps.live.com/op/embed.aspx?src=${t}`)
            } else
                e == "pdf" ? (this.viewFileType = "pdfFile",
                this.pdfFile = this.sanitizer.sanitize(_.URL, `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/document/${o}${this.productType !== "OUTLOOK" ? ("."+e): ''}`) || "") : this.toastr.error("Selected file format is not supported yet.");
            this.fileViewStyle = "block"
        }
        isImageFile(e) {
            return ["jpg", "jpeg", "png"].includes(e)
        }
        closeViewModal() {
            this.fileViewStyle = "none",
            this.textContent = "";
            let e = `${this.configService.protocol}${this.configService.baseFolder}/portal/assets/downloadHelper.php?function=deleteRedundantFile`;
            this.http.post(e, {
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded"
                },
                observe: "response"
            }).subscribe(o => {
                console.log("File removing successfully:", o)
            }
            , o => {
                console.error("Error removing file:", o)
            }
            )
        }
        downloadFile() {
            let e, o;
            this.productType == "ONEDRIVE" || this.productType == "SHAREPOINT" || this.productType == "BACKUP" ? e = btoa(this.fileName) : e = this.fileName;
            let t = this.filePath
              , p = this.stubbedUserName;
            console.log("fileName : " + e);
            let b = this.backupID
              , P = this.filePath + "/" + this.fileName
              , I = atob(this.stubbedDeviceUUID);
            this.productType != "BACKUP" ? o = this.stubbedAttachName : o = "",
            window.open(this.configService.protocol + this.configService.baseFolder + "/BluKryptBuilder/cloud/" + this.configService.cloudName + "/portal/download/files/?fileName=" + e + "&filePath=" + t + "&token=" + this.sharedService.getDataByKey("authToken") + "&loginUserName=" + this.sharedService.getDataByKey("userName") + "&userName=" + p + "&backupID=" + b + "&path=" + t + "&deviceUUID=" + I + "&isSync=false&userId=" + p + "&attachName=" + o, "_self")
        }
        restore() {
            console.log("djfgbjfdbfbdbvfdjb"),
            this.displayRestoreStyle = "block",
            this.destinationPath = "/" + atob(this.stubbedMailFoldPath) + "/"
        }
        closeRestorePopup() {
            this.displayRestoreStyle = "none",
            this.browsePath = "",
            this.browseItems = [],
            this.newFolder = "",
            this.destinationPath = ""
        }
        browse() {
            this.displayBrowseStyle = "block",
            this.loading = !0,
            this.browseItems = [];
            let e, o = this.productType;
            switch (o) {
            case "ODB":
            case "ONEDRIVE":
                e = this.apiService.browseOneDrive(this.deviceUUID, this.browsePath);
                break;
            case "OUTLOOK":
                e = this.apiService.browseExchange(this.deviceUUID, this.browsePath);
                break;
            case "SHAREPOINT":
                e = this.apiService.browseSharepoint(this.deviceUUID, this.browsePath);
                break;
            default:
                console.error("Unknown device type:", o),
                this.loading = !1;
                return
            }
            e.subscribe(t => {
                this.loading = !1,
                t.body?.stringList ? this.browseItems = t.body.stringList : this.browseItems = ["No path available"],
                this.cdr.detectChanges()
            }
            , t => {
                switch (this.loading = !1,
                console.error("Error from browse API:", t),
                t.status) {
                case 400:
                    console.error("Bad Request: ", t.message);
                    break;
                case 401:
                    console.error("Unauthorized: ", t.message),
                    this.toastr.error("Token expired, navigating to logout page.", "Error"),
                    setTimeout( () => {
                        this.router.navigate(["/logout"])
                    }
                    , 3e3);
                    break;
                case 403:
                    console.error("Forbidden: ", t.message);
                    break;
                case 404:
                    console.error("Not Found: ", t.message);
                    break;
                case 500:
                case 503:
                    console.error("Internal Server Error: ", t.message);
                    break;
                default:
                    console.error("Unknown Error: ", t.message);
                    break
                }
            }
            )
        }
        closeBrowsePopup() {
            this.displayBrowseStyle = "none"
        }
        usePath() {
            this.newFolder = "",
            this.displayBrowseStyle = "none",
            this.selectedBrowseItem != "" ? this.destinationPath = this.browsePath + "/" + this.selectedBrowseItem + "/" : this.destinationPath = this.browsePath + "/"
        }
        addNewFolder(e) {
            e && e.trim() !== "" ? (this.browseItems.push(e),
            this.selectedBrowseItem = e,
            this.newFolder = "",
            this.cdr.detectChanges(),
            console.log("New folder added: ", e),
            console.log("Selected folder: ", this.selectedBrowseItem)) : this.toastr.info("Folder name cannot be empty.")
        }
        onSingleClick(e) {
            this.selectedBrowseItem = e,
            console.log("Selected item:", this.selectedBrowseItem)
        }
        onDoubleClick(e) {
            this.addToCombinedValue(e),
            this.selectedBrowseItem = ""
        }
        addToCombinedValue(e) {
            this.browsePath ? this.browsePath += `/${e}` : this.browsePath = e,
            console.log("Combined value:", this.browsePath),
            this.browse()
        }
        backBrowse() {
            let e = this.browsePath.split("/");
            e.length > 1 ? (e.pop(),
            this.browsePath = e.join("/")) : this.browsePath = "",
            console.log("Updated browsePath: ", this.browsePath),
            this.browse()
        }
        restoreConfirm() {
            this.displayRestoreStyle = "none",
            this.displayOverlayStyle = "block";
            let e = this.configService.protocol + this.configService.baseFolder + "/BluKryptBuilder/cloud/" + this.configService.cloudName + "/restore/mail/attach/?fileName=" + this.stubbedAttachName + "&filePath=" + this.stubbedMailFoldPath + "&token=" + this.sharedService.getDataByKey("authToken") + "&loginUserName=" + this.sharedService.getDataByKey("userName") + "&userName=" + this.stubbedUserName + "&backupID=" + this.backupID + "&path=" + this.stubbedMailFoldPath + "/" + this.stubbedAttachName + "&deviceUUID=" + this.deviceUUID + "&isSync=false&userId=" + this.stubbedUserName + "&attachName=" + this.stubbedAttachName + "&mailFoldPath=" + btoa(this.destinationPath);
            this.http.get(e, {
                observe: "response"
            }).subscribe(o => {
                this.toastr.success("Operation successfull.", "Success"),
                setTimeout( () => {
                    this.router.navigate(["/operationSuccess"])
                }
                , 3e3),
                this.displayOverlayStyle = "none"
            }
            , o => {
                this.toastr.error("Operation failed.", "Fail"),
                this.displayOverlayStyle = "none",
                setTimeout( () => {
                    this.router.navigate(["/operationFailed"])
                }
                , 3e3)
            }
            )
        }
        restoreConfirmOneDriveSharePoint() {
            let e = btoa(this.fileName);
            this.displayRestoreStyle = "none",
            this.displayOverlayStyle = "block";
            let o = this.configService.protocol + this.configService.baseFolder + "/BluKryptBuilder/cloud/" + this.configService.cloudName + "/restore/od/?fileName=" + this.stubbedAttachName + "&filePath=" + this.stubbedMailFoldPath + "&token=" + this.sharedService.getDataByKey("authToken") + "&loginUserName=" + this.sharedService.getDataByKey("userName") + "&userName=" + this.stubbedUserName + "&backupID=" + this.backupID + "&path=" + this.stubbedMailFoldPath + "/" + e + "&deviceUUID=" + this.deviceUUID + "&isSync=false&userId=" + this.stubbedUserName + "&attachName=&mailFoldPath=" + btoa(this.destinationPath);
            this.http.get(o, {
                observe: "response"
            }).subscribe(t => {
                this.toastr.success("Operation successfull.", "Success"),
                setTimeout( () => {
                    this.router.navigate(["/operationSuccess"])
                }
                , 3e3),
                this.displayOverlayStyle = "none"
            }
            , t => {
                this.toastr.error("Operation failed.", "Fail"),
                this.displayOverlayStyle = "none",
                setTimeout( () => {
                    this.router.navigate(["/operationFailed"])
                }
                , 3e3)
            }
            )
        }
        static{this.\u0275fac = function(o) {
            return new (o || i)(v(Z),v(N),v(te),v(Se),v(D),v(we),v(V),v(J),v(oe),v(xe),v(j),v(Fe),v(ie))
        }
        }static{this.\u0275cmp = K({
            type: i,
            selectors: [["app-fileArchivedView"]],
            features: [q([N, D, V])],
            decls: 78,
            vars: 25,
            consts: [[1, "bg-light", "dark:bg-transparent", "min-vh-100", "d-flex", "flex-row", "align-items-center"], ["breakpoint", "md"], [4, "ngIf"], ["tabindex", "-1", "role", "dialog", 1, "modal", 2, "--cui-modal-width", "90% !important", 3, "ngStyle"], ["role", "document", 1, "modal-dialog", "modal-lg"], [1, "modal-content"], [1, "modal-header"], [1, "modal-title"], [1, "modal-body"], [1, "form-group"], ["for", "policyName"], [1, "mb-3"], ["aria-describedby", "destinationPath", "name", "destinationPath", "id", "destinationPath", "aria-label", "Enter Destination Path", "cFormControl", "", "placeholder", "Enter Destination Path", 3, "ngModelChange", "ngModel"], ["cButton", "", "color", "secondary", "id", "destinationPathBrowseBtn", "type", "button", "variant", "outline", 3, "click"], [1, "modal-footer"], ["type", "button", "class", "btn btn-success", 3, "click", 4, "ngIf"], ["type", "button", 1, "btn", "btn-danger", 3, "click"], ["id", "browsemodal", "tabindex", "-1", "role", "dialog", 1, "modal", 2, "--cui-modal-width", "40% !important", 3, "ngStyle"], ["role", "document", 1, "modal-dialog"], [1, "col-lg-12"], [1, "col-lg-6"], [1, "header-container"], ["type", "button", "class", "btn btn-sm btn-primary", 3, "click", 4, "ngIf"], [2, "max-height", "400px", "overflow-y", "auto"], [1, "table", "table-hover", "table-bordered"], ["id", "left"], ["class", "text-left", 3, "ngClass", "click", "dblclick", 4, "ngFor", "ngForOf"], ["aria-describedby", "newFolder", "name", "newFolder", "id", "newFolder", "aria-label", "Enter folder name", "cFormControl", "", "placeholder", "Enter folder name", "required", "", 3, "ngModelChange", "ngModel"], ["cButton", "", "color", "secondary", "id", "addNewFolderBtn", "type", "button", "variant", "outline", 3, "click"], ["cButton", "", "color", "primary", "variant", "outline", 3, "click"], ["type", "button", 1, "btn", "btn-primary", 3, "click"], ["id", "overlayTextShare", 1, "text-center", 3, "ngStyle"], [2, "color", "white", "margin-top", "20%"], [2, "cursor", "pointer", 3, "click"], [1, "fa", "fa-close"], ["class", "modal-body text-center", 4, "ngIf"], ["bordered", "", "align", "middle", "cTable", "", 1, "mb-0", "border", 3, "hover", "responsive", "striped"], [1, "text-nowrap", "text-truncate"], [1, "bg-body-tertiary", "clickable-header"], ["class", "bg-body-tertiary clickable-header", 4, "ngIf"], ["cButton", "", "size", "sm", "color", "primary", 3, "click"], ["cButton", "", "size", "sm", "color", "primary", 2, "margin-left", "5px", 3, "click"], ["cButton", "", "size", "sm", "color", "primary", "style", "margin-left: 5px;", 3, "click", 4, "ngIf"], ["type", "button", 1, "btn", "btn-success", 3, "click"], ["type", "button", 1, "btn", "btn-sm", "btn-primary", 3, "click"], [1, "fa", "fa-arrow-left"], ["colspan", "1", 1, "text-center"], ["role", "status", 1, "spinner-border", "text-primary"], [1, "sr-only"], [1, "text-left", 3, "click", "dblclick", "ngClass"], [2, "cursor", "pointer", 3, "title"], [1, "modal-body", "text-center"], ["style", "height: 70vh;overflow: scroll;display: flex;justify-content: center;", 4, "ngIf"], ["style", "height: 70vh;overflow: scroll;display: flex;", 4, "ngIf"], ["color", "warning", 4, "ngIf"], ["style", "height: 70vh;overflow: scroll;justify-content: center;", 4, "ngIf"], [2, "height", "70vh", "overflow", "scroll", "display", "flex", "justify-content", "center"], [3, "src", 4, "ngIf"], ["style", "max-height: 500px;", 3, "src", 4, "ngIf"], [3, "src"], [2, "max-height", "500px", 3, "src"], [2, "height", "70vh", "overflow", "scroll", "display", "flex"], ["class", "content", "style", "text-align: left; display: none;overflow: auto;height: 70vh;", 4, "ngIf"], [1, "content", 2, "text-align", "left", "display", "none", "overflow", "auto", "height", "70vh"], ["color", "warning"], [2, "height", "70vh", "overflow", "scroll", "justify-content", "center"], ["style", "position:relative;overflow:hidden;", 4, "ngIf"], [2, "position", "relative", "overflow", "hidden"], [2, "border-bottom", "40px solid white", "position", "absolute", "width", "100%", "bottom", "0"], ["sandbox", "allow-same-origin allow-scripts allow-forms", "width", "962px", "height", "565px", "frameborder", "0", 3, "src", 4, "ngIf"], ["sandbox", "allow-same-origin allow-scripts allow-forms", "width", "962px", "height", "565px", "frameborder", "0", 3, "src"]],
            template: function(o, t) {
                o & 1 && (r(0, "div", 0)(1, "c-container", 1),
                m(2, ke, 4, 0, "c-card", 2)(3, De, 31, 8, "c-card", 2),
                n(),
                r(4, "div", 3)(5, "div", 4)(6, "div", 5)(7, "div", 6)(8, "h4", 7),
                l(9, "Restore"),
                n()(),
                r(10, "div", 8)(11, "c-row")(12, "div", 9)(13, "label", 10),
                l(14, "Select a Destination Path"),
                n(),
                r(15, "c-input-group", 11)(16, "input", 12),
                M("ngModelChange", function(b) {
                    return R(t.destinationPath, b) || (t.destinationPath = b),
                    b
                }),
                n(),
                r(17, "button", 13),
                u("click", function() {
                    return t.browse()
                }),
                l(18, "Browse"),
                n()()()()(),
                r(19, "div", 14),
                m(20, Ve, 2, 0, "button", 15)(21, Ae, 2, 0, "button", 15),
                r(22, "button", 16),
                u("click", function() {
                    return t.closeRestorePopup()
                }),
                l(23, "Close"),
                n()()()()(),
                r(24, "div", 17)(25, "div", 18)(26, "div", 5)(27, "div", 6)(28, "h4", 7),
                l(29, "Browse path"),
                n()(),
                r(30, "div", 8)(31, "c-row", 19)(32, "c-card", 20)(33, "c-card-header", 21)(34, "span"),
                l(35, "Current Path : "),
                m(36, Ee, 2, 0, "span", 2)(37, Be, 2, 1, "span", 2),
                n()(),
                r(38, "c-card-body"),
                m(39, Oe, 3, 0, "button", 22),
                r(40, "div", 23)(41, "table", 24)(42, "thead")(43, "tr", 25)(44, "th"),
                l(45, "Items"),
                n()()(),
                r(46, "tbody"),
                m(47, Re, 5, 0, "tr", 2)(48, Me, 4, 5, "tr", 26),
                n()()()()(),
                r(49, "c-card", 20)(50, "c-card-body")(51, "div", 9)(52, "label", 10),
                l(53, "Create new folder"),
                n(),
                r(54, "c-input-group", 11)(55, "input", 27),
                M("ngModelChange", function(b) {
                    return R(t.newFolder, b) || (t.newFolder = b),
                    b
                }),
                n(),
                r(56, "button", 28),
                u("click", function() {
                    return t.addNewFolder(t.newFolder)
                }),
                l(57, "Create"),
                n()()()()()()(),
                r(58, "div", 14)(59, "button", 29),
                u("click", function() {
                    return t.closeBrowsePopup()
                }),
                l(60, "Close"),
                n(),
                r(61, "button", 30),
                u("click", function() {
                    return t.usePath()
                }),
                l(62, "Use Path"),
                n()()()()(),
                r(63, "div", 31)(64, "h2", 32),
                l(65, "Your file is being Restored. This operation could take some time. Please be patient during this time and don\u2019t close this tab."),
                n()()(),
                r(66, "div", 3)(67, "div", 18)(68, "div", 5)(69, "div", 6)(70, "h4", 7),
                l(71),
                n(),
                r(72, "a", 33),
                u("click", function() {
                    return t.closeViewModal()
                }),
                f(73, "i", 34),
                n()(),
                m(74, Ye, 5, 4, "div", 35),
                r(75, "div", 14)(76, "button", 30),
                u("click", function() {
                    return t.closeViewModal()
                }),
                l(77, "Ok"),
                n()()()()()),
                o & 2 && (s(2),
                a("ngIf", t.linkExpired),
                s(),
                a("ngIf", !t.linkExpired),
                s(),
                a("ngStyle", C(17, A, t.displayRestoreStyle)),
                s(12),
                O("ngModel", t.destinationPath),
                s(4),
                a("ngIf", t.productType == "OUTLOOK"),
                s(),
                a("ngIf", t.productType != "OUTLOOK"),
                s(3),
                a("ngStyle", C(19, A, t.displayBrowseStyle)),
                s(12),
                a("ngIf", t.browsePath == ""),
                s(),
                a("ngIf", t.browsePath != ""),
                s(2),
                a("ngIf", t.browsePath != ""),
                s(8),
                a("ngIf", t.loading),
                s(),
                a("ngForOf", t.browseItems),
                s(7),
                O("ngModel", t.newFolder),
                s(8),
                a("ngStyle", C(21, A, t.displayOverlayStyle)),
                s(3),
                a("ngStyle", C(23, A, t.fileViewStyle)),
                s(5),
                S(t.fileName),
                s(3),
                a("ngIf", t.fileViewStyle !== "none"))
            },
            dependencies: [pe, se, ae, he, re, ye, ue, ve, fe, Y, le, me, _e, ee, Q, W, G, X, ge, be, de, ce, ne, Ce],
            styles: ["#overlayTextShare[_ngcontent-%COMP%]{position:fixed;display:none;width:100%;height:100%;inset:0;background-color:#00000080;z-index:1000000000000;cursor:pointer}.modal-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.selected td[_ngcontent-%COMP%]{background-color:#a8a8a8!important;color:black!important}.selected td a[_ngcontent-%COMP%]{color:white!important}.selected td span button[_ngcontent-%COMP%]{background-color:#a8a8a8!important;color:black!important}"]
        })
        }
    }
    return i
}
)();
export {xt as FileArchivedViewComponent};
