"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const w = (e, n) => u(e, "", n), U = (e) => "/remote.php/" + e, R = (e, n) => { var o; return ((o = n == null ? void 0 : n.baseURL) != null ? o : f()) + U(e); }, h = (e, n, o) => { var r; const c = Object.assign({ ocsVersion: 2 }, o || {}).ocsVersion === 1 ? 1 : 2; return ((r = o == null ? void 0 : o.baseURL) != null ? r : f()) + "/ocs/v" + c + ".php" + g(e, n, o); }, g = (e, n, o) => { const r = Object.assign({ escape: !0 }, o || {}), s = function(c, i) { return i = i || {}, c.replace( /{([^{}]*)}/g, function(l, t) { const a = i[t]; return r.escape ? encodeURIComponent(typeof a == "string" || typeof a == "number" ? a.toString() : l) : typeof a == "string" || typeof a == "number" ? a.toString() : l; } ); }; return e.charAt(0) !== "/" && (e = "/" + e), s(e, n || {}); }, v = (e, n, o) => { var r, s, c; const i = Object.assign({ noRewrite: !1 }, o || {}), l = (r = o == null ? void 0 : o.baseURL) != null ? r : d(); return ((c = (s = window == null ? void 0 : window.OC) == null ? void 0 : s.config) == null ? void 0 : c.modRewriteWorking) === !0 && !i.noRewrite ? l + g(e, n, o) : l + "/index.php" + g(e, n, o); }, _ = (e, n) => n.includes(".") ? u(e, "img", n) : u(e, "img", "".concat(n, ".svg")), u = (e, n, o) => { var r, s, c; const i = (c = (s = (r = window == null ? void 0 : window.OC) == null ? void 0 : r.coreApps) == null ? void 0 : s.includes(e)) != null ? c : !1, l = o.slice(-3) === "php"; let t = d(); return l && !i ? (t += "/index.php/apps/".concat(e), n && (t += "/".concat(encodeURI(n))), o !== "index.php" && (t += "/".concat(o))) : !l && !i ? (t = b(e), n && (t += "/".concat(n, "/")), t.at(-1) !== "/" && (t += "/"), t += o) : ((e === "settings" || e === "core" || e === "search") && n === "ajax" && (t += "/index.php"), e && (t += "/".concat(e)), n && (t += "/".concat(n)), t += "/".concat(o)), t; }, f = () => window.location.protocol + "//" + window.location.host + d(); function d() { let e = window._oc_webroot; if (typeof e > "u") { e = location.pathname; const n = e.indexOf("/index.php/"); if (n !== -1) e = e.slice(0, n); else { const o = e.indexOf("/", 1); e = e.slice(0, o > 0 ? o : void 0); } } return e; } function b(e) { var n, o; return (o = ((n = window._oc_appswebroots) != null ? n : {})[e]) != null ? o : ""; } exports.generateFilePath = u; exports.generateOcsUrl = h; exports.generateRemoteUrl = R; exports.generateUrl = v; exports.getAppRootUrl = b; exports.getBaseUrl = f; exports.getRootUrl = d; exports.imagePath = _; exports.linkTo = w;