86 lines
2.8 KiB
JavaScript
86 lines
2.8 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
|
|
* Module id: 608334
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e, t, r) => {
|
|
"use strict";
|
|
Object.defineProperty(r, "__esModule", { value: !0 }),
|
|
Object.defineProperty(r, "resolveHref", {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return m;
|
|
},
|
|
});
|
|
let n = e.r(228167),
|
|
o = e.r(390063),
|
|
a = e.r(571864),
|
|
i = e.r(911861),
|
|
l = e.r(827142),
|
|
s = e.r(401636),
|
|
c = e.r(24983),
|
|
u = e.r(479682),
|
|
d = e.r(790237),
|
|
f = e.r(453636);
|
|
function m(e, t, r) {
|
|
let m,
|
|
p = "string" == typeof t ? t : (0, o.formatWithValidation)(t),
|
|
h = p.match(/^[a-z][a-z0-9+.-]*:\/\//i),
|
|
g = h ? p.slice(h[0].length) : p;
|
|
if ((g.split("?", 1)[0] || "").match(/(\/\/|\\)/)) {
|
|
console.error(
|
|
`Invalid href '${p}' passed to next/router in page: '${e.pathname}'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.`,
|
|
);
|
|
let t = (0, i.normalizeRepeatedSlashes)(g);
|
|
p = (h ? h[0] : "") + t;
|
|
}
|
|
if (!(0, s.isLocalURL)(p)) return r ? [p] : p;
|
|
try {
|
|
let t = p.startsWith("#") ? e.asPath : e.pathname;
|
|
if (
|
|
p.startsWith("?") &&
|
|
((t = e.asPath), (0, c.isDynamicRoute)(e.pathname))
|
|
) {
|
|
t = e.pathname;
|
|
let r = (0, d.getRouteRegex)(e.pathname);
|
|
(0, f.getRouteMatcher)(r)(e.asPath) || (t = e.asPath);
|
|
}
|
|
m = new URL(t, "http://n");
|
|
} catch (e) {
|
|
m = new URL("/", "http://n");
|
|
}
|
|
try {
|
|
let e = new URL(p, m);
|
|
e.pathname = (0, l.normalizePathTrailingSlash)(e.pathname);
|
|
let t = "";
|
|
if ((0, c.isDynamicRoute)(e.pathname) && e.searchParams && r) {
|
|
let r = (0, n.searchParamsToUrlQuery)(e.searchParams),
|
|
{ result: i, params: l } = (0, u.interpolateAs)(
|
|
e.pathname,
|
|
e.pathname,
|
|
r,
|
|
);
|
|
i &&
|
|
(t = (0, o.formatWithValidation)({
|
|
pathname: i,
|
|
hash: e.hash,
|
|
query: (0, a.omit)(r, l),
|
|
}));
|
|
}
|
|
let i = e.origin === m.origin ? e.href.slice(e.origin.length) : e.href;
|
|
return r ? [i, t || i] : i;
|
|
} catch (e) {
|
|
return r ? [p] : p;
|
|
}
|
|
}
|
|
("function" == typeof r.default ||
|
|
("object" == typeof r.default && null !== r.default)) &&
|
|
void 0 === r.default.__esModule &&
|
|
(Object.defineProperty(r.default, "__esModule", { value: !0 }),
|
|
Object.assign(r.default, r),
|
|
(t.exports = r.default));
|
|
};
|
|
|
|
export default moduleFactory;
|