@storybook/core
Version:
Storybook framework-agnostic API
1,859 lines (1,843 loc) • 108 kB
JavaScript
"use strict";
var Mr = Object.create;
var je = Object.defineProperty;
var kr = Object.getOwnPropertyDescriptor;
var Ir = Object.getOwnPropertyNames;
var Dr = Object.getPrototypeOf, Br = Object.prototype.hasOwnProperty;
var r = (e, t) => je(e, "name", { value: t, configurable: !0 });
var ne = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Wr = (e, t) => {
for (var a in t)
je(e, a, { get: t[a], enumerable: !0 });
}, ht = (e, t, a, n) => {
if (t && typeof t == "object" || typeof t == "function")
for (let s of Ir(t))
!Br.call(e, s) && s !== a && je(e, s, { get: () => t[s], enumerable: !(n = kr(t, s)) || n.enumerable });
return e;
};
var we = (e, t, a) => (a = e != null ? Mr(Dr(e)) : {}, ht(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
t || !e || !e.__esModule ? je(a, "default", { value: e, enumerable: !0 }) : a,
e
)), Hr = (e) => ht(je({}, "__esModule", { value: !0 }), e);
// ../node_modules/map-or-similar/src/similar.js
var Bt = ne((Gn, Dt) => {
function be() {
return this.list = [], this.lastItem = void 0, this.size = 0, this;
}
r(be, "Similar");
be.prototype.get = function(e) {
var t;
if (this.lastItem && this.isEqual(this.lastItem.key, e))
return this.lastItem.val;
if (t = this.indexOf(e), t >= 0)
return this.lastItem = this.list[t], this.list[t].val;
};
be.prototype.set = function(e, t) {
var a;
return this.lastItem && this.isEqual(this.lastItem.key, e) ? (this.lastItem.val = t, this) : (a = this.indexOf(e), a >= 0 ? (this.lastItem =
this.list[a], this.list[a].val = t, this) : (this.lastItem = { key: e, val: t }, this.list.push(this.lastItem), this.size++, this));
};
be.prototype.delete = function(e) {
var t;
if (this.lastItem && this.isEqual(this.lastItem.key, e) && (this.lastItem = void 0), t = this.indexOf(e), t >= 0)
return this.size--, this.list.splice(t, 1)[0];
};
be.prototype.has = function(e) {
var t;
return this.lastItem && this.isEqual(this.lastItem.key, e) ? !0 : (t = this.indexOf(e), t >= 0 ? (this.lastItem = this.list[t], !0) : !1);
};
be.prototype.forEach = function(e, t) {
var a;
for (a = 0; a < this.size; a++)
e.call(t || this, this.list[a].val, this.list[a].key, this);
};
be.prototype.indexOf = function(e) {
var t;
for (t = 0; t < this.size; t++)
if (this.isEqual(this.list[t].key, e))
return t;
return -1;
};
be.prototype.isEqual = function(e, t) {
return e === t || e !== e && t !== t;
};
Dt.exports = be;
});
// ../node_modules/map-or-similar/src/map-or-similar.js
var Ht = ne((ea, Wt) => {
Wt.exports = function(e) {
if (typeof Map != "function" || e) {
var t = Bt();
return new t();
} else
return /* @__PURE__ */ new Map();
};
});
// ../node_modules/memoizerific/src/memoizerific.js
var zt = ne((ta, $t) => {
var Ft = Ht();
$t.exports = function(e) {
var t = new Ft(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), a = [];
return function(n) {
var s = /* @__PURE__ */ r(function() {
var v = t, z, D, U = arguments.length - 1, J = Array(U + 1), F = !0, x;
if ((s.numArgs || s.numArgs === 0) && s.numArgs !== U + 1)
throw new Error("Memoizerific functions should always be called with the same number of arguments");
for (x = 0; x < U; x++) {
if (J[x] = {
cacheItem: v,
arg: arguments[x]
}, v.has(arguments[x])) {
v = v.get(arguments[x]);
continue;
}
F = !1, z = new Ft(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), v.set(arguments[x], z), v = z;
}
return F && (v.has(arguments[U]) ? D = v.get(arguments[U]) : F = !1), F || (D = n.apply(null, arguments), v.set(arguments[U], D)), e >
0 && (J[U] = {
cacheItem: v,
arg: arguments[U]
}, F ? Fr(a, J) : a.push(J), a.length > e && $r(a.shift())), s.wasMemoized = F, s.numArgs = U + 1, D;
}, "memoizerific");
return s.limit = e, s.wasMemoized = !1, s.cache = t, s.lru = a, s;
};
};
function Fr(e, t) {
var a = e.length, n = t.length, s, v, z;
for (v = 0; v < a; v++) {
for (s = !0, z = 0; z < n; z++)
if (!zr(e[v][z].arg, t[z].arg)) {
s = !1;
break;
}
if (s)
break;
}
e.push(e.splice(v, 1)[0]);
}
r(Fr, "moveToMostRecentLru");
function $r(e) {
var t = e.length, a = e[t - 1], n, s;
for (a.cacheItem.delete(a.arg), s = t - 2; s >= 0 && (a = e[s], n = a.cacheItem.get(a.arg), !n || !n.size); s--)
a.cacheItem.delete(a.arg);
}
r($r, "removeCachedResult");
function zr(e, t) {
return e === t || e !== e && t !== t;
}
r(zr, "isEqual");
});
// ../node_modules/picoquery/lib/string-util.js
var Je = ne((Ke) => {
"use strict";
Object.defineProperty(Ke, "__esModule", { value: !0 });
Ke.encodeString = Ur;
var he = Array.from({ length: 256 }, (e, t) => "%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase()), qr = new Int8Array([
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
1,
1,
1,
1,
0,
0,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
1,
0
]);
function Ur(e) {
let t = e.length;
if (t === 0)
return "";
let a = "", n = 0, s = 0;
e: for (; s < t; s++) {
let v = e.charCodeAt(s);
for (; v < 128; ) {
if (qr[v] !== 1 && (n < s && (a += e.slice(n, s)), n = s + 1, a += he[v]), ++s === t)
break e;
v = e.charCodeAt(s);
}
if (n < s && (a += e.slice(n, s)), v < 2048) {
n = s + 1, a += he[192 | v >> 6] + he[128 | v & 63];
continue;
}
if (v < 55296 || v >= 57344) {
n = s + 1, a += he[224 | v >> 12] + he[128 | v >> 6 & 63] + he[128 | v & 63];
continue;
}
if (++s, s >= t)
throw new Error("URI malformed");
let z = e.charCodeAt(s) & 1023;
n = s + 1, v = 65536 + ((v & 1023) << 10 | z), a += he[240 | v >> 18] + he[128 | v >> 12 & 63] + he[128 | v >> 6 & 63] + he[128 | v & 63];
}
return n === 0 ? e : n < t ? a + e.slice(n) : a;
}
r(Ur, "encodeString");
});
// ../node_modules/picoquery/lib/shared.js
var _e = ne((pe) => {
"use strict";
Object.defineProperty(pe, "__esModule", { value: !0 });
pe.defaultOptions = pe.defaultShouldSerializeObject = pe.defaultValueSerializer = void 0;
var Qe = Je(), Vr = /* @__PURE__ */ r((e) => {
switch (typeof e) {
case "string":
return (0, Qe.encodeString)(e);
case "bigint":
case "boolean":
return "" + e;
case "number":
if (Number.isFinite(e))
return e < 1e21 ? "" + e : (0, Qe.encodeString)("" + e);
break;
}
return e instanceof Date ? (0, Qe.encodeString)(e.toISOString()) : "";
}, "defaultValueSerializer");
pe.defaultValueSerializer = Vr;
var Kr = /* @__PURE__ */ r((e) => e instanceof Date, "defaultShouldSerializeObject");
pe.defaultShouldSerializeObject = Kr;
var qt = /* @__PURE__ */ r((e) => e, "identityFunc");
pe.defaultOptions = {
nesting: !0,
nestingSyntax: "dot",
arrayRepeat: !1,
arrayRepeatSyntax: "repeat",
delimiter: 38,
valueDeserializer: qt,
valueSerializer: pe.defaultValueSerializer,
keyDeserializer: qt,
shouldSerializeObject: pe.defaultShouldSerializeObject
};
});
// ../node_modules/picoquery/lib/object-util.js
var Ye = ne((Ne) => {
"use strict";
Object.defineProperty(Ne, "__esModule", { value: !0 });
Ne.getDeepObject = Yr;
Ne.stringifyObject = Ut;
var Pe = _e(), Jr = Je();
function Qr(e) {
return e === "__proto__" || e === "constructor" || e === "prototype";
}
r(Qr, "isPrototypeKey");
function Yr(e, t, a, n, s) {
if (Qr(t))
return e;
let v = e[t];
return typeof v == "object" && v !== null ? v : !n && (s || typeof a == "number" || typeof a == "string" && a * 0 === 0 && a.indexOf(".") ===
-1) ? e[t] = [] : e[t] = {};
}
r(Yr, "getDeepObject");
var Xr = 20, Gr = "[]", Zr = "[", en = "]", tn = ".";
function Ut(e, t, a = 0, n, s) {
let { nestingSyntax: v = Pe.defaultOptions.nestingSyntax, arrayRepeat: z = Pe.defaultOptions.arrayRepeat, arrayRepeatSyntax: D = Pe.defaultOptions.
arrayRepeatSyntax, nesting: U = Pe.defaultOptions.nesting, delimiter: J = Pe.defaultOptions.delimiter, valueSerializer: F = Pe.defaultOptions.
valueSerializer, shouldSerializeObject: x = Pe.defaultOptions.shouldSerializeObject } = t, O = typeof J == "number" ? String.fromCharCode(
J) : J, w = s === !0 && z, E = v === "dot" || v === "js" && !s;
if (a > Xr)
return "";
let N = "", u = !0, i = !1;
for (let h in e) {
let c = e[h], y;
n ? (y = n, w ? D === "bracket" && (y += Gr) : E ? (y += tn, y += h) : (y += Zr, y += h, y += en)) : y = h, u || (N += O), typeof c ==
"object" && c !== null && !x(c) ? (i = c.pop !== void 0, (U || z && i) && (N += Ut(c, t, a + 1, y, i))) : (N += (0, Jr.encodeString)(y),
N += "=", N += F(c, h)), u && (u = !1);
}
return N;
}
r(Ut, "stringifyObject");
});
// ../node_modules/fast-decode-uri-component/index.js
var Qt = ne((la, Jt) => {
"use strict";
var Vt = 12, rn = 0, Xe = [
// The first part of the table maps bytes to character to a transition.
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
4,
4,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
6,
7,
7,
7,
7,
7,
7,
7,
7,
7,
7,
7,
7,
8,
7,
7,
10,
9,
9,
9,
11,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
// The second part of the table maps a state to a new state when adding a
// transition.
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
12,
0,
0,
0,
0,
24,
36,
48,
60,
72,
84,
96,
0,
12,
12,
12,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
24,
24,
0,
0,
0,
0,
0,
0,
0,
0,
0,
24,
24,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
48,
48,
48,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
48,
48,
0,
0,
0,
0,
0,
0,
0,
0,
0,
48,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
// The third part maps the current transition to a mask that needs to apply
// to the byte.
127,
63,
63,
63,
0,
31,
15,
15,
15,
7,
7,
7
];
function nn(e) {
var t = e.indexOf("%");
if (t === -1) return e;
for (var a = e.length, n = "", s = 0, v = 0, z = t, D = Vt; t > -1 && t < a; ) {
var U = Kt(e[t + 1], 4), J = Kt(e[t + 2], 0), F = U | J, x = Xe[F];
if (D = Xe[256 + D + x], v = v << 6 | F & Xe[364 + x], D === Vt)
n += e.slice(s, z), n += v <= 65535 ? String.fromCharCode(v) : String.fromCharCode(
55232 + (v >> 10),
56320 + (v & 1023)
), v = 0, s = t + 3, t = z = e.indexOf("%", s);
else {
if (D === rn)
return null;
if (t += 3, t < a && e.charCodeAt(t) === 37) continue;
return null;
}
}
return n + e.slice(s);
}
r(nn, "decodeURIComponent");
var an = {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
a: 10,
A: 10,
b: 11,
B: 11,
c: 12,
C: 12,
d: 13,
D: 13,
e: 14,
E: 14,
f: 15,
F: 15
};
function Kt(e, t) {
var a = an[e];
return a === void 0 ? 255 : a << t;
}
r(Kt, "hexCodeToInt");
Jt.exports = nn;
});
// ../node_modules/picoquery/lib/parse.js
var Zt = ne((ye) => {
"use strict";
var on = ye && ye.__importDefault || function(e) {
return e && e.__esModule ? e : { default: e };
};
Object.defineProperty(ye, "__esModule", { value: !0 });
ye.numberValueDeserializer = ye.numberKeyDeserializer = void 0;
ye.parse = ln;
var Le = Ye(), Oe = _e(), Yt = on(Qt()), sn = /* @__PURE__ */ r((e) => {
let t = Number(e);
return Number.isNaN(t) ? e : t;
}, "numberKeyDeserializer");
ye.numberKeyDeserializer = sn;
var un = /* @__PURE__ */ r((e) => {
let t = Number(e);
return Number.isNaN(t) ? e : t;
}, "numberValueDeserializer");
ye.numberValueDeserializer = un;
var Xt = /\+/g, Gt = /* @__PURE__ */ r(function() {
}, "Empty");
Gt.prototype = /* @__PURE__ */ Object.create(null);
function Te(e, t, a, n, s) {
let v = e.substring(t, a);
return n && (v = v.replace(Xt, " ")), s && (v = (0, Yt.default)(v) || v), v;
}
r(Te, "computeKeySlice");
function ln(e, t) {
let { valueDeserializer: a = Oe.defaultOptions.valueDeserializer, keyDeserializer: n = Oe.defaultOptions.keyDeserializer, arrayRepeatSyntax: s = Oe.
defaultOptions.arrayRepeatSyntax, nesting: v = Oe.defaultOptions.nesting, arrayRepeat: z = Oe.defaultOptions.arrayRepeat, nestingSyntax: D = Oe.
defaultOptions.nestingSyntax, delimiter: U = Oe.defaultOptions.delimiter } = t ?? {}, J = typeof U == "string" ? U.charCodeAt(0) : U, F = D ===
"js", x = new Gt();
if (typeof e != "string")
return x;
let O = e.length, w = "", E = -1, N = -1, u = -1, i = x, h, c = "", y = "", S = !1, _ = !1, I = !1, W = !1, Y = !1, L = !1, V = !1, $ = 0,
j = -1, P = -1, H = -1;
for (let o = 0; o < O + 1; o++) {
if ($ = o !== O ? e.charCodeAt(o) : J, $ === J) {
if (V = N > E, V || (N = o), u !== N - 1 && (y = Te(e, u + 1, j > -1 ? j : N, I, S), c = n(y), h !== void 0 && (i = (0, Le.getDeepObject)(
i, h, c, F && Y, F && L))), V || c !== "") {
V && (w = e.slice(N + 1, o), W && (w = w.replace(Xt, " ")), _ && (w = (0, Yt.default)(w) || w));
let l = a(w, c);
if (z) {
let g = i[c];
g === void 0 ? j > -1 ? i[c] = [l] : i[c] = l : g.pop ? g.push(l) : i[c] = [g, l];
} else
i[c] = l;
}
w = "", E = o, N = o, S = !1, _ = !1, I = !1, W = !1, Y = !1, L = !1, j = -1, u = o, i = x, h = void 0, c = "";
} else $ === 93 ? (z && s === "bracket" && H === 91 && (j = P), v && (D === "index" || F) && N <= E && (u !== P && (y = Te(e, u + 1, o,
I, S), c = n(y), h !== void 0 && (i = (0, Le.getDeepObject)(i, h, c, void 0, F)), h = c, I = !1, S = !1), u = o, L = !0, Y = !1)) : $ ===
46 ? v && (D === "dot" || F) && N <= E && (u !== P && (y = Te(e, u + 1, o, I, S), c = n(y), h !== void 0 && (i = (0, Le.getDeepObject)(
i, h, c, F)), h = c, I = !1, S = !1), Y = !0, L = !1, u = o) : $ === 91 ? v && (D === "index" || F) && N <= E && (u !== P && (y = Te(e,
u + 1, o, I, S), c = n(y), F && h !== void 0 && (i = (0, Le.getDeepObject)(i, h, c, F)), h = c, I = !1, S = !1, Y = !1, L = !0), u = o) :
$ === 61 ? N <= E ? N = o : _ = !0 : $ === 43 ? N > E ? W = !0 : I = !0 : $ === 37 && (N > E ? _ = !0 : S = !0);
P = o, H = $;
}
return x;
}
r(ln, "parse");
});
// ../node_modules/picoquery/lib/stringify.js
var er = ne((Ge) => {
"use strict";
Object.defineProperty(Ge, "__esModule", { value: !0 });
Ge.stringify = fn;
var cn = Ye();
function fn(e, t) {
if (e === null || typeof e != "object")
return "";
let a = t ?? {};
return (0, cn.stringifyObject)(e, a);
}
r(fn, "stringify");
});
// ../node_modules/picoquery/lib/main.js
var tr = ne((fe) => {
"use strict";
var hn = fe && fe.__createBinding || (Object.create ? function(e, t, a, n) {
n === void 0 && (n = a);
var s = Object.getOwnPropertyDescriptor(t, a);
(!s || ("get" in s ? !t.__esModule : s.writable || s.configurable)) && (s = { enumerable: !0, get: /* @__PURE__ */ r(function() {
return t[a];
}, "get") }), Object.defineProperty(e, n, s);
} : function(e, t, a, n) {
n === void 0 && (n = a), e[n] = t[a];
}), pn = fe && fe.__exportStar || function(e, t) {
for (var a in e) a !== "default" && !Object.prototype.hasOwnProperty.call(t, a) && hn(t, e, a);
};
Object.defineProperty(fe, "__esModule", { value: !0 });
fe.stringify = fe.parse = void 0;
var dn = Zt();
Object.defineProperty(fe, "parse", { enumerable: !0, get: /* @__PURE__ */ r(function() {
return dn.parse;
}, "get") });
var mn = er();
Object.defineProperty(fe, "stringify", { enumerable: !0, get: /* @__PURE__ */ r(function() {
return mn.stringify;
}, "get") });
pn(_e(), fe);
});
// ../node_modules/ts-dedent/dist/index.js
var nr = ne((Se) => {
"use strict";
Object.defineProperty(Se, "__esModule", { value: !0 });
Se.dedent = void 0;
function rr(e) {
for (var t = [], a = 1; a < arguments.length; a++)
t[a - 1] = arguments[a];
var n = Array.from(typeof e == "string" ? [e] : e);
n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
var s = n.reduce(function(D, U) {
var J = U.match(/\n([\t ]+|(?!\s).)/g);
return J ? D.concat(J.map(function(F) {
var x, O;
return (O = (x = F.match(/[\t ]/g)) === null || x === void 0 ? void 0 : x.length) !== null && O !== void 0 ? O : 0;
})) : D;
}, []);
if (s.length) {
var v = new RegExp(`
[ ]{` + Math.min.apply(Math, s) + "}", "g");
n = n.map(function(D) {
return D.replace(v, `
`);
});
}
n[0] = n[0].replace(/^\r?\n/, "");
var z = n[0];
return t.forEach(function(D, U) {
var J = z.match(/(?:^|\n)( *)$/), F = J ? J[1] : "", x = D;
typeof D == "string" && D.includes(`
`) && (x = String(D).split(`
`).map(function(O, w) {
return w === 0 ? O : "" + F + O;
}).join(`
`)), z += x + n[U + 1];
}), z;
}
r(rr, "dedent");
Se.dedent = rr;
Se.default = rr;
});
// ../node_modules/@storybook/global/dist/index.js
var fr = ne((Oa, cr) => {
"use strict";
var at = Object.defineProperty, wn = Object.getOwnPropertyDescriptor, jn = Object.getOwnPropertyNames, Sn = Object.prototype.hasOwnProperty,
Rn = /* @__PURE__ */ r((e, t) => {
for (var a in t)
at(e, a, { get: t[a], enumerable: !0 });
}, "__export"), An = /* @__PURE__ */ r((e, t, a, n) => {
if (t && typeof t == "object" || typeof t == "function")
for (let s of jn(t))
!Sn.call(e, s) && s !== a && at(e, s, { get: /* @__PURE__ */ r(() => t[s], "get"), enumerable: !(n = wn(t, s)) || n.enumerable });
return e;
}, "__copyProps"), En = /* @__PURE__ */ r((e) => An(at({}, "__esModule", { value: !0 }), e), "__toCommonJS"), lr = {};
Rn(lr, {
global: /* @__PURE__ */ r(() => Cn, "global")
});
cr.exports = En(lr);
var Cn = (() => {
let e;
return typeof window < "u" ? e = window : typeof globalThis < "u" ? e = globalThis : typeof global < "u" ? e = global : typeof self < "u" ?
e = self : e = {}, e;
})();
});
// ../node_modules/history/umd/history.production.min.js
var pr = ne((Ie, hr) => {
(function(e, t) {
typeof Ie == "object" && typeof hr < "u" ? t(Ie) : typeof define == "function" && define.amd ? define(["exports"], t) : t((e = typeof globalThis <
"u" ? globalThis : e || self).HistoryLibrary = {});
})(Ie, function(e) {
"use strict";
function t() {
return (t = Object.assign || function(x) {
for (var O = 1; O < arguments.length; O++) {
var w = arguments[O];
for (var E in w) Object.prototype.hasOwnProperty.call(w, E) && (x[E] = w[E]);
}
return x;
}).apply(this, arguments);
}
r(t, "n");
var a;
e.Action = void 0, (a = e.Action || (e.Action = {})).Pop = "POP", a.Push = "PUSH", a.Replace = "REPLACE";
var n = "beforeunload", s = "popstate";
function v(x, O, w) {
return Math.min(Math.max(x, O), w);
}
r(v, "a");
function z(x) {
x.preventDefault(), x.returnValue = "";
}
r(z, "i");
function D() {
var x = [];
return { get length() {
return x.length;
}, push: /* @__PURE__ */ r(function(O) {
return x.push(O), function() {
x = x.filter(function(w) {
return w !== O;
});
};
}, "push"), call: /* @__PURE__ */ r(function(O) {
x.forEach(function(w) {
return w && w(O);
});
}, "call") };
}
r(D, "c");
function U() {
return Math.random().toString(36).substr(2, 8);
}
r(U, "u");
function J(x) {
var O = x.pathname, w = O === void 0 ? "/" : O, E = x.search, N = E === void 0 ? "" : E, u = x.hash, i = u === void 0 ? "" : u;
return N && N !== "?" && (w += N.charAt(0) === "?" ? N : "?" + N), i && i !== "#" && (w += i.charAt(0) === "#" ? i : "#" + i), w;
}
r(J, "l");
function F(x) {
var O = {};
if (x) {
var w = x.indexOf("#");
w >= 0 && (O.hash = x.substr(w), x = x.substr(0, w));
var E = x.indexOf("?");
E >= 0 && (O.search = x.substr(E), x = x.substr(0, E)), x && (O.pathname = x);
}
return O;
}
r(F, "f"), e.createBrowserHistory = function(x) {
x === void 0 && (x = {});
var O = x.window, w = O === void 0 ? document.defaultView : O, E = w.history;
function N() {
var j = w.location, P = j.pathname, H = j.search, o = j.hash, l = E.state || {};
return [l.idx, { pathname: P, search: H, hash: o, state: l.usr || null, key: l.key || "default" }];
}
r(N, "p");
var u = null;
w.addEventListener(s, function() {
if (u) _.call(u), u = null;
else {
var j = e.Action.Pop, P = N(), H = P[0], o = P[1];
if (_.length) {
if (H != null) {
var l = c - H;
l && (u = { action: j, location: o, retry: /* @__PURE__ */ r(function() {
$(-1 * l);
}, "retry") }, $(l));
}
} else V(j);
}
});
var i = e.Action.Pop, h = N(), c = h[0], y = h[1], S = D(), _ = D();
function I(j) {
return typeof j == "string" ? j : J(j);
}
r(I, "P");
function W(j, P) {
return P === void 0 && (P = null), t({ pathname: y.pathname, hash: "", search: "" }, typeof j == "string" ? F(j) : j, { state: P, key: U() });
}
r(W, "k");
function Y(j, P) {
return [{ usr: j.state, key: j.key, idx: P }, I(j)];
}
r(Y, "x");
function L(j, P, H) {
return !_.length || (_.call({ action: j, location: P, retry: H }), !1);
}
r(L, "w");
function V(j) {
i = j;
var P = N();
c = P[0], y = P[1], S.call({ action: i, location: y });
}
r(V, "E");
function $(j) {
E.go(j);
}
return r($, "H"), c == null && (c = 0, E.replaceState(t({}, E.state, { idx: c }), "")), { get action() {
return i;
}, get location() {
return y;
}, createHref: I, push: /* @__PURE__ */ r(function j(P, H) {
var o = e.Action.Push, l = W(P, H);
if (L(o, l, function() {
j(P, H);
})) {
var g = Y(l, c + 1), d = g[0], m = g[1];
try {
E.pushState(d, "", m);
} catch {
w.location.assign(m);
}
V(o);
}
}, "n"), replace: /* @__PURE__ */ r(function j(P, H) {
var o = e.Action.Replace, l = W(P, H);
if (L(o, l, function() {
j(P, H);
})) {
var g = Y(l, c), d = g[0], m = g[1];
E.replaceState(d, "", m), V(o);
}
}, "n"), go: $, back: /* @__PURE__ */ r(function() {
$(-1);
}, "back"), forward: /* @__PURE__ */ r(function() {
$(1);
}, "forward"), listen: /* @__PURE__ */ r(function(j) {
return S.push(j);
}, "listen"), block: /* @__PURE__ */ r(function(j) {
var P = _.push(j);
return _.length === 1 && w.addEventListener(n, z), function() {
P(), _.length || w.removeEventListener(n, z);
};
}, "block") };
}, e.createHashHistory = function(x) {
x === void 0 && (x = {});
var O = x.window, w = O === void 0 ? document.defaultView : O, E = w.history;
function N() {
var P = F(w.location.hash.substr(1)), H = P.pathname, o = H === void 0 ? "/" : H, l = P.search, g = l === void 0 ? "" : l, d = P.hash,
m = d === void 0 ? "" : d, M = E.state || {};
return [M.idx, { pathname: o, search: g, hash: m, state: M.usr || null, key: M.key || "default" }];
}
r(N, "p");
var u = null;
function i() {
if (u) I.call(u), u = null;
else {
var P = e.Action.Pop, H = N(), o = H[0], l = H[1];
if (I.length) {
if (o != null) {
var g = y - o;
g && (u = { action: P, location: l, retry: /* @__PURE__ */ r(function() {
j(-1 * g);
}, "retry") }, j(g));
}
} else $(P);
}
}
r(i, "d"), w.addEventListener(s, i), w.addEventListener("hashchange", function() {
J(N()[1]) !== J(S) && i();
});
var h = e.Action.Pop, c = N(), y = c[0], S = c[1], _ = D(), I = D();
function W(P) {
return function() {
var H = document.querySelector("base"), o = "";
if (H && H.getAttribute("href")) {
var l = w.location.href, g = l.indexOf("#");
o = g === -1 ? l : l.slice(0, g);
}
return o;
}() + "#" + (typeof P == "string" ? P : J(P));
}
r(W, "k");
function Y(P, H) {
return H === void 0 && (H = null), t({ pathname: S.pathname, hash: "", search: "" }, typeof P == "string" ? F(P) : P, { state: H, key: U() });
}
r(Y, "x");
function L(P, H) {
return [{ usr: P.state, key: P.key, idx: H }, W(P)];
}
r(L, "w");
function V(P, H, o) {
return !I.length || (I.call({ action: P, location: H, retry: o }), !1);
}
r(V, "E");
function $(P) {
h = P;
var H = N();
y = H[0], S = H[1], _.call({ action: h, location: S });
}
r($, "H");
function j(P) {
E.go(P);
}
return r(j, "L"), y == null && (y = 0, E.replaceState(t({}, E.state, { idx: y }), "")), { get action() {
return h;
}, get location() {
return S;
}, createHref: W, push: /* @__PURE__ */ r(function P(H, o) {
var l = e.Action.Push, g = Y(H, o);
if (V(l, g, function() {
P(H, o);
})) {
var d = L(g, y + 1), m = d[0], M = d[1];
try {
E.pushState(m, "", M);
} catch {
w.location.assign(M);
}
$(l);
}
}, "n"), replace: /* @__PURE__ */ r(function P(H, o) {
var l = e.Action.Replace, g = Y(H, o);
if (V(l, g, function() {
P(H, o);
})) {
var d = L(g, y), m = d[0], M = d[1];
E.replaceState(m, "", M), $(l);
}
}, "n"), go: j, back: /* @__PURE__ */ r(function() {
j(-1);
}, "back"), forward: /* @__PURE__ */ r(function() {
j(1);
}, "forward"), listen: /* @__PURE__ */ r(function(P) {
return _.push(P);
}, "listen"), block: /* @__PURE__ */ r(function(P) {
var H = I.push(P);
return I.length === 1 && w.addEventListener(n, z), function() {
H(), I.length || w.removeEventListener(n, z);
};
}, "block") };
}, e.createMemoryHistory = function(x) {
x === void 0 && (x = {});
var O = x, w = O.initialEntries, E = w === void 0 ? ["/"] : w, N = O.initialIndex, u = E.map(function(L) {
return t({ pathname: "/", search: "", hash: "", state: null, key: U() }, typeof L == "string" ? F(L) : L);
}), i = v(N ?? u.length - 1, 0, u.length - 1), h = e.Action.Pop, c = u[i], y = D(), S = D();
function _(L, V) {
return V === void 0 && (V = null), t({ pathname: c.pathname, search: "", hash: "" }, typeof L == "string" ? F(L) : L, { state: V, key: U() });
}
r(_, "m");
function I(L, V, $) {
return !S.length || (S.call({ action: L, location: V, retry: $ }), !1);
}
r(I, "b");
function W(L, V) {
h = L, c = V, y.call({ action: h, location: c });
}
r(W, "A");
function Y(L) {
var V = v(i + L, 0, u.length - 1), $ = e.Action.Pop, j = u[V];
I($, j, function() {
Y(L);
}) && (i = V, W($, j));
}
return r(Y, "P"), { get index() {
return i;
}, get action() {
return h;
}, get location() {
return c;
}, createHref: /* @__PURE__ */ r(function(L) {
return typeof L == "string" ? L : J(L);
}, "createHref"), push: /* @__PURE__ */ r(function L(V, $) {
var j = e.Action.Push, P = _(V, $);
I(j, P, function() {
L(V, $);
}) && (i += 1, u.splice(i, u.length, P), W(j, P));
}, "n"), replace: /* @__PURE__ */ r(function L(V, $) {
var j = e.Action.Replace, P = _(V, $);
I(j, P, function() {
L(V, $);
}) && (u[i] = P, W(j, P));
}, "n"), go: Y, back: /* @__PURE__ */ r(function() {
Y(-1);
}, "back"), forward: /* @__PURE__ */ r(function() {
Y(1);
}, "forward"), listen: /* @__PURE__ */ r(function(L) {
return y.push(L);
}, "listen"), block: /* @__PURE__ */ r(function(L) {
return S.push(L);
}, "block") };
}, e.createPath = J, e.parsePath = F, Object.defineProperty(e, "__esModule", { value: !0 });
});
});
// ../node_modules/history/umd/history.development.js
var mr = ne((De, dr) => {
(function(e, t) {
typeof De == "object" && typeof dr < "u" ? t(De) : typeof define == "function" && define.amd ? define(["exports"], t) : (e = typeof globalThis <
"u" ? globalThis : e || self, t(e.HistoryLibrary = {}));
})(De, function(e) {
"use strict";
function t() {
return t = Object.assign || function(u) {
for (var i = 1; i < arguments.length; i++) {
var h = arguments[i];
for (var c in h)
Object.prototype.hasOwnProperty.call(h, c) && (u[c] = h[c]);
}
return u;
}, t.apply(this, arguments);
}
r(t, "_extends"), e.Action = void 0, function(u) {
u.Pop = "POP", u.Push = "PUSH", u.Replace = "REPLACE";
}(e.Action || (e.Action = {}));
var a = /* @__PURE__ */ r(function(u) {
return Object.freeze(u);
}, "readOnly");
function n(u, i) {
if (!u) {
typeof console < "u" && console.warn(i);
try {
throw new Error(i);
} catch {
}
}
}
r(n, "warning");
var s = "beforeunload", v = "hashchange", z = "popstate";
function D(u) {
u === void 0 && (u = {});
var i = u, h = i.window, c = h === void 0 ? document.defaultView : h, y = c.history;
function S() {
var C = c.location, p = C.pathname, R = C.search, K = C.hash, q = y.state || {};
return [q.idx, a({
pathname: p,
search: R,
hash: K,
state: q.usr || null,
key: q.key || "default"
})];
}
r(S, "getIndexAndLocation");
var _ = null;
function I() {
if (_)
j.call(_), _ = null;
else {
var C = e.Action.Pop, p = S(), R = p[0], K = p[1];
if (j.length)
if (R != null) {
var q = L - R;
q && (_ = {
action: C,
location: K,
retry: /* @__PURE__ */ r(function() {
M(q * -1);
}, "retry")
}, M(q));
} else
n(
!1,
// TODO: Write up a doc that explains our blocking strategy in
// detail and link to it here so people can understand better what
// is going on and how to avoid it.
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail sil\
ently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directl\
y) to avoid this situation."
);
else
g(C);
}
}
r(I, "handlePop"), c.addEventListener(z, I);
var W = e.Action.Pop, Y = S(), L = Y[0], V = Y[1], $ = O(), j = O();
L == null && (L = 0, y.replaceState(t({}, y.state, {
idx: L
}), ""));
function P(C) {
return typeof C == "string" ? C : E(C);
}
r(P, "createHref");
function H(C, p) {
return p === void 0 && (p = null), a(t({
pathname: V.pathname,
hash: "",
search: ""
}, typeof C == "string" ? N(C) : C, {
state: p,
key: w()
}));
}
r(H, "getNextLocation");
function o(C, p) {
return [{
usr: C.state,
key: C.key,
idx: p
}, P(C)];
}
r(o, "getHistoryStateAndUrl");
function l(C, p, R) {
return !j.length || (j.call({
action: C,
location: p,
retry: R
}), !1);
}
r(l, "allowTx");
function g(C) {
W = C;
var p = S();
L = p[0], V = p[1], $.call({
action: W,
location: V
});
}
r(g, "applyTx");
function d(C, p) {
var R = e.Action.Push, K = H(C, p);
function q() {
d(C, p);
}
if (r(q, "retry"), l(R, K, q)) {
var Z = o(K, L + 1), re = Z[0], ae = Z[1];
try {
y.pushState(re, "", ae);
} catch {
c.location.assign(ae);
}
g(R);
}
}
r(d, "push");
function m(C, p) {
var R = e.Action.Replace, K = H(C, p);
function q() {
m(C, p);
}
if (r(q, "retry"), l(R, K, q)) {
var Z = o(K, L), re = Z[0], ae = Z[1];
y.replaceState(re, "", ae), g(R);
}
}
r(m, "replace");
function M(C) {
y.go(C);
}
r(M, "go");
var T = {
get action() {
return W;
},
get location() {
return V;
},
createHref: P,
push: d,
replace: m,
go: M,
back: /* @__PURE__ */ r(function() {
M(-1);
}, "back"),
forward: /* @__PURE__ */ r(function() {
M(1);
}, "forward"),
listen: /* @__PURE__ */ r(function(p) {
return $.push(p);
}, "listen"),
block: /* @__PURE__ */ r(function(p) {
var R = j.push(p);
return j.length === 1 && c.addEventListener(s, x), function() {
R(), j.length || c.removeEventListener(s, x);
};
}, "block")
};
return T;
}
r(D, "createBrowserHistory");
function U(u) {
u === void 0 && (u = {});
var i = u, h = i.window, c = h === void 0 ? document.defaultView : h, y = c.history;
function S() {
var p = N(c.location.hash.substr(1)), R = p.pathname, K = R === void 0 ? "/" : R, q = p.search, Z = q === void 0 ? "" : q, re = p.hash,
ae = re === void 0 ? "" : re, ie = y.state || {};
return [ie.idx, a({
pathname: K,
search: Z,
hash: ae,
state: ie.usr || null,
key: ie.key || "default"
})];
}
r(S, "getIndexAndLocation");
var _ = null;
function I() {
if (_)
j.call(_), _ = null;
else {
var p = e.Action.Pop, R = S(), K = R[0], q = R[1];
if (j.length)
if (K != null) {
var Z = L - K;
Z && (_ = {
action: p,
location: q,
retry: /* @__PURE__ */ r(function() {
T(Z * -1);
}, "retry")
}, T(Z));
} else
n(
!1,
// TODO: Write up a doc that explains our blocking strategy in
// detail and link to it here so people can understand better
// what is going on and how to avoid it.
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail sil\
ently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directl\
y) to avoid this situation."
);
else
d(p);
}
}
r(I, "handlePop"), c.addEventListener(z, I), c.addEventListener(v, function() {
var p = S(), R = p[1];
E(R) !== E(V) && I();
});
var W = e.Action.Pop, Y = S(), L = Y[0], V = Y[1], $ = O(), j = O();
L == null && (L = 0, y.replaceState(t({}, y.state, {
idx: L
}), ""));
function P() {
var p = document.querySelector("base"), R = "";
if (p && p.getAttribute("href")) {
var K = c.location.href, q = K.indexOf("#");
R = q === -1 ? K : K.slice(0, q);
}
return R;
}
r(P, "getBaseHref");
function H(p) {
return P() + "#" + (typeof p == "string" ? p : E(p));
}
r(H, "createHref");
function o(p, R) {
return R === void 0 && (R = null), a(t({
pathname: V.pathname,
hash: "",
search: ""
}, typeof p == "string" ? N(p) : p, {
state: R,
key: w()
}));
}
r(o, "getNextLocation");
function l(p, R) {
return [{
usr: p.state,
key: p.key,
idx: R
}, H(p)];
}
r(l, "getHistoryStateAndUrl");
function g(p, R, K) {
return !j.length || (j.call({
action: p,
location: R,
retry: K
}), !1);
}
r(g, "allowTx");
function d(p) {
W = p;
var R = S();
L = R[0], V = R[1], $.call({
action: W,
location: V
});
}
r(d, "applyTx");
function m(p, R) {
var K = e.Action.Push, q = o(p, R);
function Z() {
m(p, R);
}
if (r(Z, "retry"), n(q.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(p) +
")"), g(K, q, Z)) {
var re = l(q, L + 1), ae = re[0], ie = re[1];
try {
y.pushState(ae, "", ie);
} catch {
c.location.assign(ie);
}
d(K);
}
}
r(m, "push");
function M(p, R) {
var K = e.Action.Replace, q = o(p, R);
function Z() {
M(p, R);
}
if (r(Z, "retry"), n(q.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(
p) + ")"), g(K, q, Z)) {
var re = l(q, L), ae = re[0], ie = re[1];
y.replaceState(ae, "", ie), d(K);
}
}
r(M, "replace");
function T(p) {
y.go(p);
}
r(T, "go");
var C = {
get action() {
return W;
},
get location() {
return V;
},
createHref: H,
push: m,
replace: M,
go: T,
back: /* @__PURE__ */ r(function() {
T(-1);
}, "back"),
forward: /* @__PURE__ */ r(function() {
T(1);
}, "forward"),
listen: /* @__PURE__ */ r(function(R) {
return $.push(R);
}, "listen"),
block: /* @__PURE__ */ r(function(R) {
var K = j.push(R);
return j.length === 1 && c.addEventListener(s, x), function() {
K(), j.length || c.removeEventListener(s, x);
};
}, "block")
};
return C;
}
r(U, "createHashHistory");
function J(u) {
u === void 0 && (u = {});
var i = u, h = i.initialEntries, c = h === void 0 ? ["/"] : h, y = i.initialIndex, S = c.map(function(d) {
var m = a(t({
pathname: "/",
search: "",
hash: "",
state: null,
key: w()
}, typeof d == "string" ? N(d) : d));
return n(m.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid ent\
ry: " + JSON.stringify(d) + ")"), m;
}), _ = F(y ?? S.length - 1, 0, S.length - 1), I = e.Action.Pop, W = S[_], Y = O(), L = O();
function V(d) {
return typeof d == "string" ? d : E(d);
}
r(V, "createHref");
function $(d, m) {
return m === void 0 && (m = null), a(t({
pathname: W.pathname,
search: "",
hash: ""
}, typeof d == "string" ? N(d) : d, {
state: m,
key: w()
}));
}
r($, "getNextLocation");
function j(d, m, M) {
return !L.length || (L.call({
action: d,
location: m,
retry: M
}), !1);
}
r(j, "allowTx");
function P(d, m) {
I = d, W = m, Y.call({
action: I,
location: W
});
}
r(P, "applyTx");
function H(d, m) {
var M = e.Action.Push, T = $(d, m);
function C() {
H(d, m);
}
r(C, "retry"), n(W.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(d) + "\
)"), j(M, T, C) && (_ += 1, S.splice(_, S.length, T), P(M, T));
}
r(H, "push");
function o(d, m) {
var M = e.Action.Replace, T = $(d, m);
function C() {
o(d, m);
}
r(C, "retry"), n(W.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(d) +
")"), j(M, T, C) && (S[_] = T, P(M, T));
}
r(o, "replace");
function l(d) {
var m = F(_ + d, 0, S.length - 1), M = e.Action.Pop, T = S[m];
function C() {
l(d);
}
r(C, "retry"), j(M, T, C) && (_ = m, P(M, T));
}
r(l, "go");
var g = {
get index() {
return _;
},
get action() {
return I;
},
get location() {
return W;
},
createHref: V,
push: H,
replace: o,
go: l,
back: /* @__PURE__ */ r(function() {
l(-1);
}, "back"),
forward: /* @__PURE__ */ r(function() {
l(1);
}, "forward"),
listen: /* @__PURE__ */ r(function(m) {
return Y.push(m);
}, "listen"),
block: /* @__PURE__ */ r(function(m) {
return L.push(m);
}, "block")
};
return g;
}
r(J, "createMemoryHistory");
function F(u, i, h) {
return Math.min(Math.max(u, i), h);
}
r(F, "clamp");
function x(u) {
u.preventDefault(), u.returnValue = "";
}
r(x, "promptBeforeUnload");
function O() {
var u = [];
return {
get length() {
return u.length;
},
push: /* @__PURE__ */ r(function(h) {
return u.push(h), function() {
u = u.filter(function(c) {
return c !== h;
});
};
}, "push"),
call: /* @__PURE__ */ r(function(h) {
u.forEach(function(c) {
return c && c(h);
});
}, "call")
};
}
r(O, "createEvents");
function w() {
return Math.random().toString(36).substr(2, 8);
}
r(w, "createKey");
function E(u) {
var i = u.pathname, h = i === void 0 ? "/" : i, c = u.search, y = c === void 0 ? "" : c, S = u.hash, _ = S === void 0 ? "" : S;
return y && y !== "?" && (h += y.charAt(0) === "?" ? y : "?" + y), _ && _ !== "#" && (h += _.charAt(0) === "#" ? _ : "#" + _), h;
}
r(E, "createPath");
function N(u) {
var i = {};
if (u) {
var h = u.indexOf("#");
h >= 0 && (i.hash = u.substr(h), u = u.substr(0, h));
var c = u.indexOf("?");
c >= 0 && (i.search = u.substr(c), u = u.substr(0, c)), u && (i.pathname = u);
}
return i;
}
r(N, "parsePath"), e.createBrowserHistory = D, e.createHashHistory = U, e.createMemoryHistory = J, e.createPath = E, e.parsePath = N, Object.
defineProperty(e, "__esModule", { value: !0 });
});
});
// ../node_modules/history/main.js
var Ee = ne((Ra, ot) => {
"use strict";
process.env.NODE_ENV === "production" ? ot.exports = pr() : ot.exports = mr();
});
// ../node_modules/react-router/umd/react-router.production.min.js
var yr = ne((Be, gr) => {
(function(e, t) {
typeof Be == "object" && typeof gr < "u" ? t(Be, require("react"), Ee()) : typeof define == "function" && define.amd ? define(["exports",
"react", "history"], t) : t((e = e || self).ReactRouter = {}, e.React, e.HistoryLibrary);
})(Be, function(e, t, a) {
"use strict";
function n(o, l) {
if (!o) throw new Error(l);
}
r(n, "a");
let s = t.createContext(null), v = t.createContext(null), z = t.createContext({ outlet: null, matches: [] });
function D(o) {
return w();
}
r(D, "s");
function U(o) {
n(!1);
}
r(U, "o");
function J(o) {
let { basename: l = "/", children: g = null, location: d, navigationType: m = a.Action.Pop, navigator: M, static: T = !1 } = o;
F() && n(!1);
let C = j(l), p = t.useMemo(() => ({ basename: C, navigator: M, static: T }), [C, M, T]);
typeof d == "string" && (d = a.parsePath(d));
let { pathname: R = "/", search: K = "", hash: q = "", state: Z = null, key: re = "default" } = d, ae = t.useMemo(() => {
let ie = V(R, C);
return ie == null ? null : { pathname: ie, search: K, hash: q, state: Z, key: re };
}, [C, R, K, q, Z, re]);
return ae == null ? null : t.createElement(s.Provider, { value: p }, t.createElement(v.Provider, { children: g, value: { location: ae,
navigationType: m } }));
}
r(J, "u");
function F() {
return t.useContext(v) != null;
}
r(F, "c");
function x() {
return F() || n(!1), t.useContext(v).location;
}
r(x, "h");
function O() {
F() || n(!1);
let { basename: o, navigator: l } = t.useContext(s), { matches: g } = t.useContext(z), { pathname: d } = x(), m = JSON.stringify(g.map(
(T) => T.pathnameBase)), M = t.useRef(!1);
return t.useEffect(() => {
M.current = !0;
}), t.useCallback(function(T, C) {
if (C === void 0 && (C = {}), !M.current) return;
if (typeof T == "number") return void l.go(T);
let p = L(T, JSON.parse(m), d);
o !== "/" && (p.pathname = $([o, p.pathname])), (C.replace ? l.replace : l.push)(p, C.state);
}, [o, l, m, d]);
}
r(O, "p");
function w() {
return t.useContext(z).outlet;
}
r(w, "f");
function E(o) {
let { matches: l } = t.useContext(z), { pathname: g } = x(), d = JSON.stringify(l.map((m) => m.pathnameBase));
return t.useMemo(() => L(o, JSON.parse(d), g), [o, d, g]);
}
r(E, "m");
function N(o, l) {
F() || n(!1);
let g, { matches: d } = t.us