@entur-partner/common 11.2.4 → 11.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,1940 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { assertIsDefined as r, hasAllPermissions as i, hasOneOfPermissions as a, isDate as o, isDateString as s, isFunction as c, isString as l, localeDate as u, localeDateTime as d, splitUrlPath as f } from "@entur-partner/util";
3
+ import * as p from "react";
4
+ import { Children as m, Component as h, useEffect as g, useRef as _, useState as v } from "react";
5
+ import { BreadcrumbItem as y, BreadcrumbNavigation as b, Pagination as x } from "@entur/menu";
6
+ import { Button as S, ButtonGroup as C, PrimaryButton as w, SecondaryButton as T } from "@entur/button";
7
+ import { Modal as E } from "@entur/modal";
8
+ import { Heading6 as ee, Link as D, Paragraph as O } from "@entur/typography";
9
+ import { BannerAlertBox as k } from "@entur/alert";
10
+ import { ExpandablePanel as te } from "@entur/expand";
11
+ import { SegmentedChoice as ne, SegmentedControl as re } from "@entur/form";
12
+ import { SearchableDropdown as ie } from "@entur/dropdown";
13
+ import { ChannelsIcon as ae, CookieIcon as oe, DownArrowIcon as se, LogOutIcon as ce, NorwayIcon as le, UKIcon as ue, UserIcon as de } from "@entur/icons";
14
+ //#region \0rolldown/runtime.js
15
+ var fe = Object.create, pe = Object.defineProperty, me = Object.getOwnPropertyDescriptor, he = Object.getOwnPropertyNames, ge = Object.getPrototypeOf, _e = Object.prototype.hasOwnProperty, ve = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), ye = (e, t, n, r) => {
16
+ if (t && typeof t == "object" || typeof t == "function") for (var i = he(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !_e.call(e, s) && s !== n && pe(e, s, {
17
+ get: ((e) => t[e]).bind(null, s),
18
+ enumerable: !(r = me(t, s)) || r.enumerable
19
+ });
20
+ return e;
21
+ }, be = (e, t, n) => (n = e == null ? {} : fe(ge(e)), ye(t || !e || !e.__esModule ? pe(n, "default", {
22
+ value: e,
23
+ enumerable: !0
24
+ }) : n, e)), xe = ({ children: e }) => /* @__PURE__ */ t("div", {
25
+ className: "eps-action-bar-left",
26
+ children: e
27
+ }), Se = ({ children: e }) => /* @__PURE__ */ t("div", {
28
+ className: "eps-action-bar-right",
29
+ children: e
30
+ }), Ce = ({ children: r }) => /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", { className: "eps-action-bar-padding" }), /* @__PURE__ */ t("div", {
31
+ className: "eps-action-bar",
32
+ children: r
33
+ })] }), A = /* @__PURE__ */ be((/* @__PURE__ */ ve(((e, t) => {
34
+ (function() {
35
+ var e = {}.hasOwnProperty;
36
+ function n() {
37
+ for (var e = "", t = 0; t < arguments.length; t++) {
38
+ var n = arguments[t];
39
+ n && (e = i(e, r(n)));
40
+ }
41
+ return e;
42
+ }
43
+ function r(t) {
44
+ if (typeof t == "string" || typeof t == "number") return t;
45
+ if (typeof t != "object") return "";
46
+ if (Array.isArray(t)) return n.apply(null, t);
47
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]")) return t.toString();
48
+ var r = "";
49
+ for (var a in t) e.call(t, a) && t[a] && (r = i(r, a));
50
+ return r;
51
+ }
52
+ function i(e, t) {
53
+ return t ? e ? e + " " + t : e + t : e;
54
+ }
55
+ t !== void 0 && t.exports ? (n.default = n, t.exports = n) : typeof define == "function" && typeof define.amd == "object" && define.amd ? define("classnames", [], function() {
56
+ return n;
57
+ }) : window.classNames = n;
58
+ })();
59
+ })))(), 1), we = ({ date: e, locale: n, as: r = "main", hideTime: i, ...a }) => /* @__PURE__ */ t(r, {
60
+ ...a,
61
+ children: i ? u(e, n) : d(e, n)
62
+ });
63
+ //#endregion
64
+ //#region src/Box.tsx
65
+ function j(e, t) {
66
+ if (Array.isArray(t)) {
67
+ let n = [];
68
+ return t[0] && n.push(e + t[0]), t[1] && n.push(`${e}${t[1]}-lg`), t[2] && n.push(`${e}${t[2]}-xl`), n;
69
+ }
70
+ return [e + t];
71
+ }
72
+ var M = ({ as: e = "div", children: n, contrast: r, paddingTop: i, paddingRight: a, paddingBottom: o, paddingLeft: s, paddingX: c, paddingY: l, padding: u, marginTop: d, marginRight: f, marginBottom: p, marginLeft: m, marginX: h, marginY: g, margin: _, display: v, justifyContent: y, alignItems: b, maxWidth: x, width: S, background: C, color: w, flexDirection: T, flexWrap: E, className: ee, ...D }) => {
73
+ let O = [], k = i || l || u, te = o || l || u, ne = s || c || u, re = a || c || u, ie = d || g || _, ae = p || g || _, oe = m || h || _, se = f || h || _;
74
+ return r && O.push("eds-contrast"), k && O.push(...j("eps-pt-", k)), te && O.push(...j("eps-pb-", te)), ne && O.push(...j("eps-pl-", ne)), re && O.push(...j("eps-pr-", re)), ie && O.push(...j("eps-mt-", ie)), ae && O.push(...j("eps-mb-", ae)), oe && O.push(...j("eps-ml-", oe)), se && O.push(...j("eps-mr-", se)), v && O.push(...j("eps-", v)), y && O.push(...j("eps-justify-", y)), b && O.push(...j("eps-items-", b)), x && O.push(...j("eps-max-w-", x)), S && O.push(...j("eps-w-", S)), w && O.push(`eps-color-${w}`), C && O.push(`eps-bg-${C}`), T && O.push(...j("eps-flex-", T)), E && O.push(...j("eps-flex-wrap-", E)), /* @__PURE__ */ t(e, {
75
+ className: (0, A.default)(O, ee),
76
+ ...D,
77
+ children: n
78
+ });
79
+ }, N = ({ children: n, space: r, className: i }) => {
80
+ let a = m.toArray(n);
81
+ return a.length <= 1 ? /* @__PURE__ */ t(e, { children: a }) : /* @__PURE__ */ t("div", {
82
+ className: i,
83
+ children: a.map((e, n) => n === a.length - 1 ? /* @__PURE__ */ t("div", { children: e }, n) : /* @__PURE__ */ t(M, {
84
+ paddingBottom: r,
85
+ children: e
86
+ }, n))
87
+ });
88
+ }, Te = ({ items: e, locale: r, className: i, ...a }) => /* @__PURE__ */ t("div", {
89
+ className: (0, A.default)("ep-audit-info", i),
90
+ ...a,
91
+ children: e.map(({ label: e, value: i }) => /* @__PURE__ */ n(N, {
92
+ space: "small",
93
+ children: [/* @__PURE__ */ t("div", {
94
+ className: "ep-audit-info-label",
95
+ children: e
96
+ }), /* @__PURE__ */ t("div", { children: o(i) || s(i) ? /* @__PURE__ */ t(we, {
97
+ date: i,
98
+ locale: r
99
+ }) : /* @__PURE__ */ t("span", { children: i }) })]
100
+ }, i.toString()))
101
+ });
102
+ //#endregion
103
+ //#region ../../node_modules/react-router/dist/development/chunk-QFMPRPBF.mjs
104
+ function P(e, t) {
105
+ if (e === !1 || e == null) throw Error(t);
106
+ }
107
+ function F(e, t) {
108
+ if (!e) {
109
+ typeof console < "u" && console.warn(t);
110
+ try {
111
+ throw Error(t);
112
+ } catch {}
113
+ }
114
+ }
115
+ function Ee({ pathname: e = "/", search: t = "", hash: n = "" }) {
116
+ return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
117
+ }
118
+ function I(e) {
119
+ let t = {};
120
+ if (e) {
121
+ let n = e.indexOf("#");
122
+ n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
123
+ let r = e.indexOf("?");
124
+ r >= 0 && (t.search = e.substring(r), e = e.substring(0, r)), e && (t.pathname = e);
125
+ }
126
+ return t;
127
+ }
128
+ function De(e, t, n = "/") {
129
+ return Oe(e, t, n, !1);
130
+ }
131
+ function Oe(e, t, n, r) {
132
+ let i = L((typeof t == "string" ? I(t) : t).pathname || "/", n);
133
+ if (i == null) return null;
134
+ let a = Ae(e);
135
+ Me(a);
136
+ let o = null;
137
+ for (let e = 0; o == null && e < a.length; ++e) {
138
+ let t = Ge(i);
139
+ o = He(a[e], t, r);
140
+ }
141
+ return o;
142
+ }
143
+ function ke(e, t) {
144
+ let { route: n, pathname: r, params: i } = e;
145
+ return {
146
+ id: n.id,
147
+ pathname: r,
148
+ params: i,
149
+ data: t[n.id],
150
+ loaderData: t[n.id],
151
+ handle: n.handle
152
+ };
153
+ }
154
+ function Ae(e, t = [], n = [], r = "", i = !1) {
155
+ let a = (e, a, o = i, s) => {
156
+ let c = {
157
+ relativePath: s === void 0 ? e.path || "" : s,
158
+ caseSensitive: e.caseSensitive === !0,
159
+ childrenIndex: a,
160
+ route: e
161
+ };
162
+ if (c.relativePath.startsWith("/")) {
163
+ if (!c.relativePath.startsWith(r) && o) return;
164
+ P(c.relativePath.startsWith(r), `Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`), c.relativePath = c.relativePath.slice(r.length);
165
+ }
166
+ let l = R([r, c.relativePath]), u = n.concat(c);
167
+ e.children && e.children.length > 0 && (P(e.index !== !0, `Index routes must not have child routes. Please remove all child routes from route path "${l}".`), Ae(e.children, t, u, l, o)), !(e.path == null && !e.index) && t.push({
168
+ path: l,
169
+ score: Be(l, e.index),
170
+ routesMeta: u
171
+ });
172
+ };
173
+ return e.forEach((e, t) => {
174
+ if (e.path === "" || !e.path?.includes("?")) a(e, t);
175
+ else for (let n of je(e.path)) a(e, t, !0, n);
176
+ }), t;
177
+ }
178
+ function je(e) {
179
+ let t = e.split("/");
180
+ if (t.length === 0) return [];
181
+ let [n, ...r] = t, i = n.endsWith("?"), a = n.replace(/\?$/, "");
182
+ if (r.length === 0) return i ? [a, ""] : [a];
183
+ let o = je(r.join("/")), s = [];
184
+ return s.push(...o.map((e) => e === "" ? a : [a, e].join("/"))), i && s.push(...o), s.map((t) => e.startsWith("/") && t === "" ? "/" : t);
185
+ }
186
+ function Me(e) {
187
+ e.sort((e, t) => e.score === t.score ? Ve(e.routesMeta.map((e) => e.childrenIndex), t.routesMeta.map((e) => e.childrenIndex)) : t.score - e.score);
188
+ }
189
+ var Ne = /^:[\w-]+$/, Pe = 3, Fe = 2, Ie = 1, Le = 10, Re = -2, ze = (e) => e === "*";
190
+ function Be(e, t) {
191
+ let n = e.split("/"), r = n.length;
192
+ return n.some(ze) && (r += Re), t && (r += Fe), n.filter((e) => !ze(e)).reduce((e, t) => e + (Ne.test(t) ? Pe : t === "" ? Ie : Le), r);
193
+ }
194
+ function Ve(e, t) {
195
+ return e.length === t.length && e.slice(0, -1).every((e, n) => e === t[n]) ? e[e.length - 1] - t[t.length - 1] : 0;
196
+ }
197
+ function He(e, t, n = !1) {
198
+ let { routesMeta: r } = e, i = {}, a = "/", o = [];
199
+ for (let e = 0; e < r.length; ++e) {
200
+ let s = r[e], c = e === r.length - 1, l = a === "/" ? t : t.slice(a.length) || "/", u = Ue({
201
+ path: s.relativePath,
202
+ caseSensitive: s.caseSensitive,
203
+ end: c
204
+ }, l), d = s.route;
205
+ if (!u && c && n && !r[r.length - 1].route.index && (u = Ue({
206
+ path: s.relativePath,
207
+ caseSensitive: s.caseSensitive,
208
+ end: !1
209
+ }, l)), !u) return null;
210
+ Object.assign(i, u.params), o.push({
211
+ params: i,
212
+ pathname: R([a, u.pathname]),
213
+ pathnameBase: $e(R([a, u.pathnameBase])),
214
+ route: d
215
+ }), u.pathnameBase !== "/" && (a = R([a, u.pathnameBase]));
216
+ }
217
+ return o;
218
+ }
219
+ function Ue(e, t) {
220
+ typeof e == "string" && (e = {
221
+ path: e,
222
+ caseSensitive: !1,
223
+ end: !0
224
+ });
225
+ let [n, r] = We(e.path, e.caseSensitive, e.end), i = t.match(n);
226
+ if (!i) return null;
227
+ let a = i[0], o = a.replace(/(.)\/+$/, "$1"), s = i.slice(1);
228
+ return {
229
+ params: r.reduce((e, { paramName: t, isOptional: n }, r) => {
230
+ if (t === "*") {
231
+ let e = s[r] || "";
232
+ o = a.slice(0, a.length - e.length).replace(/(.)\/+$/, "$1");
233
+ }
234
+ let i = s[r];
235
+ return n && !i ? e[t] = void 0 : e[t] = (i || "").replace(/%2F/g, "/"), e;
236
+ }, {}),
237
+ pathname: a,
238
+ pathnameBase: o,
239
+ pattern: e
240
+ };
241
+ }
242
+ function We(e, t = !1, n = !0) {
243
+ F(e === "*" || !e.endsWith("*") || e.endsWith("/*"), `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`);
244
+ let r = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (e, t, n, i, a) => {
245
+ if (r.push({
246
+ paramName: t,
247
+ isOptional: n != null
248
+ }), n) {
249
+ let t = a.charAt(i + e.length);
250
+ return t && t !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
251
+ }
252
+ return "/([^\\/]+)";
253
+ }).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
254
+ return e.endsWith("*") ? (r.push({ paramName: "*" }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r];
255
+ }
256
+ function Ge(e) {
257
+ try {
258
+ return e.split("/").map((e) => decodeURIComponent(e).replace(/\//g, "%2F")).join("/");
259
+ } catch (t) {
260
+ return F(!1, `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`), e;
261
+ }
262
+ }
263
+ function L(e, t) {
264
+ if (t === "/") return e;
265
+ if (!e.toLowerCase().startsWith(t.toLowerCase())) return null;
266
+ let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
267
+ return r && r !== "/" ? null : e.slice(n) || "/";
268
+ }
269
+ var Ke = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
270
+ function qe(e, t = "/") {
271
+ let { pathname: n, search: r = "", hash: i = "" } = typeof e == "string" ? I(e) : e, a;
272
+ return n ? (n = n.replace(/\/\/+/g, "/"), a = n.startsWith("/") ? Je(n.substring(1), "/") : Je(n, t)) : a = t, {
273
+ pathname: a,
274
+ search: et(r),
275
+ hash: tt(i)
276
+ };
277
+ }
278
+ function Je(e, t) {
279
+ let n = t.replace(/\/+$/, "").split("/");
280
+ return e.split("/").forEach((e) => {
281
+ e === ".." ? n.length > 1 && n.pop() : e !== "." && n.push(e);
282
+ }), n.length > 1 ? n.join("/") : "/";
283
+ }
284
+ function Ye(e, t, n, r) {
285
+ return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
286
+ }
287
+ function Xe(e) {
288
+ return e.filter((e, t) => t === 0 || e.route.path && e.route.path.length > 0);
289
+ }
290
+ function Ze(e) {
291
+ let t = Xe(e);
292
+ return t.map((e, n) => n === t.length - 1 ? e.pathname : e.pathnameBase);
293
+ }
294
+ function Qe(e, t, n, r = !1) {
295
+ let i;
296
+ typeof e == "string" ? i = I(e) : (i = { ...e }, P(!i.pathname || !i.pathname.includes("?"), Ye("?", "pathname", "search", i)), P(!i.pathname || !i.pathname.includes("#"), Ye("#", "pathname", "hash", i)), P(!i.search || !i.search.includes("#"), Ye("#", "search", "hash", i)));
297
+ let a = e === "" || i.pathname === "", o = a ? "/" : i.pathname, s;
298
+ if (o == null) s = n;
299
+ else {
300
+ let e = t.length - 1;
301
+ if (!r && o.startsWith("..")) {
302
+ let t = o.split("/");
303
+ for (; t[0] === "..";) t.shift(), --e;
304
+ i.pathname = t.join("/");
305
+ }
306
+ s = e >= 0 ? t[e] : "/";
307
+ }
308
+ let c = qe(i, s), l = o && o !== "/" && o.endsWith("/"), u = (a || o === ".") && n.endsWith("/");
309
+ return !c.pathname.endsWith("/") && (l || u) && (c.pathname += "/"), c;
310
+ }
311
+ var R = (e) => e.join("/").replace(/\/\/+/g, "/"), $e = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), et = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, tt = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, nt = class {
312
+ constructor(e, t, n, r = !1) {
313
+ this.status = e, this.statusText = t || "", this.internal = r, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
314
+ }
315
+ };
316
+ function rt(e) {
317
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
318
+ }
319
+ function it(e) {
320
+ return e.map((e) => e.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
321
+ }
322
+ var at = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
323
+ function ot(e, t) {
324
+ let n = e;
325
+ if (typeof n != "string" || !Ke.test(n)) return {
326
+ absoluteURL: void 0,
327
+ isExternal: !1,
328
+ to: n
329
+ };
330
+ let r = n, i = !1;
331
+ if (at) try {
332
+ let e = new URL(window.location.href), r = n.startsWith("//") ? new URL(e.protocol + n) : new URL(n), a = L(r.pathname, t);
333
+ r.origin === e.origin && a != null ? n = a + r.search + r.hash : i = !0;
334
+ } catch {
335
+ F(!1, `<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`);
336
+ }
337
+ return {
338
+ absoluteURL: r,
339
+ isExternal: i,
340
+ to: n
341
+ };
342
+ }
343
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
344
+ var st = [
345
+ "POST",
346
+ "PUT",
347
+ "PATCH",
348
+ "DELETE"
349
+ ];
350
+ new Set(st);
351
+ var ct = ["GET", ...st];
352
+ new Set(ct);
353
+ var lt = {
354
+ state: "unblocked",
355
+ proceed: void 0,
356
+ reset: void 0,
357
+ location: void 0
358
+ }, z = p.createContext(null);
359
+ z.displayName = "DataRouter";
360
+ var B = p.createContext(null);
361
+ B.displayName = "DataRouterState";
362
+ var ut = p.createContext(!1);
363
+ function dt() {
364
+ return p.useContext(ut);
365
+ }
366
+ var ft = p.createContext({ isTransitioning: !1 });
367
+ ft.displayName = "ViewTransition";
368
+ var pt = p.createContext(/* @__PURE__ */ new Map());
369
+ pt.displayName = "Fetchers";
370
+ var mt = p.createContext(null);
371
+ mt.displayName = "Await";
372
+ var V = p.createContext(null);
373
+ V.displayName = "Navigation";
374
+ var H = p.createContext(null);
375
+ H.displayName = "Location";
376
+ var U = p.createContext({
377
+ outlet: null,
378
+ matches: [],
379
+ isDataRoute: !1
380
+ });
381
+ U.displayName = "Route";
382
+ var ht = p.createContext(null);
383
+ ht.displayName = "RouteError";
384
+ var gt = "REACT_ROUTER_ERROR", _t = "REDIRECT", vt = "ROUTE_ERROR_RESPONSE";
385
+ function yt(e) {
386
+ if (e.startsWith(`${gt}:${_t}:{`)) try {
387
+ let t = JSON.parse(e.slice(28));
388
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean") return t;
389
+ } catch {}
390
+ }
391
+ function bt(e) {
392
+ if (e.startsWith(`${gt}:${vt}:{`)) try {
393
+ let t = JSON.parse(e.slice(40));
394
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string") return new nt(t.status, t.statusText, t.data);
395
+ } catch {}
396
+ }
397
+ function xt(e, { relative: t } = {}) {
398
+ P(W(), "useHref() may be used only in the context of a <Router> component.");
399
+ let { basename: n, navigator: r } = p.useContext(V), { hash: i, pathname: a, search: o } = K(e, { relative: t }), s = a;
400
+ return n !== "/" && (s = a === "/" ? n : R([n, a])), r.createHref({
401
+ pathname: s,
402
+ search: o,
403
+ hash: i
404
+ });
405
+ }
406
+ function W() {
407
+ return p.useContext(H) != null;
408
+ }
409
+ function G() {
410
+ return P(W(), "useLocation() may be used only in the context of a <Router> component."), p.useContext(H).location;
411
+ }
412
+ var St = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
413
+ function Ct(e) {
414
+ p.useContext(V).static || p.useLayoutEffect(e);
415
+ }
416
+ function wt() {
417
+ let { isDataRoute: e } = p.useContext(U);
418
+ return e ? Wt() : Tt();
419
+ }
420
+ function Tt() {
421
+ P(W(), "useNavigate() may be used only in the context of a <Router> component.");
422
+ let e = p.useContext(z), { basename: t, navigator: n } = p.useContext(V), { matches: r } = p.useContext(U), { pathname: i } = G(), a = JSON.stringify(Ze(r)), o = p.useRef(!1);
423
+ return Ct(() => {
424
+ o.current = !0;
425
+ }), p.useCallback((r, s = {}) => {
426
+ if (F(o.current, St), !o.current) return;
427
+ if (typeof r == "number") {
428
+ n.go(r);
429
+ return;
430
+ }
431
+ let c = Qe(r, JSON.parse(a), i, s.relative === "path");
432
+ e == null && t !== "/" && (c.pathname = c.pathname === "/" ? t : R([t, c.pathname])), (s.replace ? n.replace : n.push)(c, s.state, s);
433
+ }, [
434
+ t,
435
+ n,
436
+ a,
437
+ i,
438
+ e
439
+ ]);
440
+ }
441
+ p.createContext(null);
442
+ function K(e, { relative: t } = {}) {
443
+ let { matches: n } = p.useContext(U), { pathname: r } = G(), i = JSON.stringify(Ze(n));
444
+ return p.useMemo(() => Qe(e, JSON.parse(i), r, t === "path"), [
445
+ e,
446
+ i,
447
+ r,
448
+ t
449
+ ]);
450
+ }
451
+ function Et(e, t, n) {
452
+ P(W(), "useRoutes() may be used only in the context of a <Router> component.");
453
+ let { navigator: r } = p.useContext(V), { matches: i } = p.useContext(U), a = i[i.length - 1], o = a ? a.params : {}, s = a ? a.pathname : "/", c = a ? a.pathnameBase : "/", l = a && a.route;
454
+ {
455
+ let e = l && l.path || "";
456
+ Kt(s, !l || e.endsWith("*") || e.endsWith("*?"), `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
457
+
458
+ Please change the parent <Route path="${e}"> to <Route path="${e === "/" ? "*" : `${e}/*`}">.`);
459
+ }
460
+ let u = G(), d;
461
+ if (t) {
462
+ let e = typeof t == "string" ? I(t) : t;
463
+ P(c === "/" || e.pathname?.startsWith(c), `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`), d = e;
464
+ } else d = u;
465
+ let f = d.pathname || "/", m = f;
466
+ if (c !== "/") {
467
+ let e = c.replace(/^\//, "").split("/");
468
+ m = "/" + f.replace(/^\//, "").split("/").slice(e.length).join("/");
469
+ }
470
+ let h = De(e, { pathname: m });
471
+ F(l || h != null, `No routes matched location "${d.pathname}${d.search}${d.hash}" `), F(h == null || h[h.length - 1].route.element !== void 0 || h[h.length - 1].route.Component !== void 0 || h[h.length - 1].route.lazy !== void 0, `Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);
472
+ let g = Nt(h && h.map((e) => Object.assign({}, e, {
473
+ params: Object.assign({}, o, e.params),
474
+ pathname: R([c, r.encodeLocation ? r.encodeLocation(e.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathname]),
475
+ pathnameBase: e.pathnameBase === "/" ? c : R([c, r.encodeLocation ? r.encodeLocation(e.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathnameBase])
476
+ })), i, n);
477
+ return t && g ? /* @__PURE__ */ p.createElement(H.Provider, { value: {
478
+ location: {
479
+ pathname: "/",
480
+ search: "",
481
+ hash: "",
482
+ state: null,
483
+ key: "default",
484
+ unstable_mask: void 0,
485
+ ...d
486
+ },
487
+ navigationType: "POP"
488
+ } }, g) : g;
489
+ }
490
+ function Dt() {
491
+ let e = Vt(), t = rt(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, r = "rgba(200,200,200, 0.5)", i = {
492
+ padding: "0.5rem",
493
+ backgroundColor: r
494
+ }, a = {
495
+ padding: "2px 4px",
496
+ backgroundColor: r
497
+ }, o = null;
498
+ return console.error("Error handled by React Router default ErrorBoundary:", e), o = /* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ p.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ p.createElement("code", { style: a }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ p.createElement("code", { style: a }, "errorElement"), " prop on your route.")), /* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ p.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ p.createElement("pre", { style: i }, n) : null, o);
499
+ }
500
+ var Ot = /* @__PURE__ */ p.createElement(Dt, null), kt = class extends p.Component {
501
+ constructor(e) {
502
+ super(e), this.state = {
503
+ location: e.location,
504
+ revalidation: e.revalidation,
505
+ error: e.error
506
+ };
507
+ }
508
+ static getDerivedStateFromError(e) {
509
+ return { error: e };
510
+ }
511
+ static getDerivedStateFromProps(e, t) {
512
+ return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
513
+ error: e.error,
514
+ location: e.location,
515
+ revalidation: e.revalidation
516
+ } : {
517
+ error: e.error === void 0 ? t.error : e.error,
518
+ location: t.location,
519
+ revalidation: e.revalidation || t.revalidation
520
+ };
521
+ }
522
+ componentDidCatch(e, t) {
523
+ this.props.onError ? this.props.onError(e, t) : console.error("React Router caught the following error during render", e);
524
+ }
525
+ render() {
526
+ let e = this.state.error;
527
+ if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
528
+ let t = bt(e.digest);
529
+ t && (e = t);
530
+ }
531
+ let t = e === void 0 ? this.props.children : /* @__PURE__ */ p.createElement(U.Provider, { value: this.props.routeContext }, /* @__PURE__ */ p.createElement(ht.Provider, {
532
+ value: e,
533
+ children: this.props.component
534
+ }));
535
+ return this.context ? /* @__PURE__ */ p.createElement(jt, { error: e }, t) : t;
536
+ }
537
+ };
538
+ kt.contextType = ut;
539
+ var At = /* @__PURE__ */ new WeakMap();
540
+ function jt({ children: e, error: t }) {
541
+ let { basename: n } = p.useContext(V);
542
+ if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
543
+ let e = yt(t.digest);
544
+ if (e) {
545
+ let r = At.get(t);
546
+ if (r) throw r;
547
+ let i = ot(e.location, n);
548
+ if (at && !At.get(t)) if (i.isExternal || e.reloadDocument) window.location.href = i.absoluteURL || i.to;
549
+ else {
550
+ let n = Promise.resolve().then(() => window.__reactRouterDataRouter.navigate(i.to, { replace: e.replace }));
551
+ throw At.set(t, n), n;
552
+ }
553
+ return /* @__PURE__ */ p.createElement("meta", {
554
+ httpEquiv: "refresh",
555
+ content: `0;url=${i.absoluteURL || i.to}`
556
+ });
557
+ }
558
+ }
559
+ return e;
560
+ }
561
+ function Mt({ routeContext: e, match: t, children: n }) {
562
+ let r = p.useContext(z);
563
+ return r && r.static && r.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (r.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ p.createElement(U.Provider, { value: e }, n);
564
+ }
565
+ function Nt(e, t = [], n) {
566
+ let r = n?.state;
567
+ if (e == null) {
568
+ if (!r) return null;
569
+ if (r.errors) e = r.matches;
570
+ else if (t.length === 0 && !r.initialized && r.matches.length > 0) e = r.matches;
571
+ else return null;
572
+ }
573
+ let i = e, a = r?.errors;
574
+ if (a != null) {
575
+ let e = i.findIndex((e) => e.route.id && a?.[e.route.id] !== void 0);
576
+ P(e >= 0, `Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`), i = i.slice(0, Math.min(i.length, e + 1));
577
+ }
578
+ let o = !1, s = -1;
579
+ if (n && r) {
580
+ o = r.renderFallback;
581
+ for (let e = 0; e < i.length; e++) {
582
+ let t = i[e];
583
+ if ((t.route.HydrateFallback || t.route.hydrateFallbackElement) && (s = e), t.route.id) {
584
+ let { loaderData: e, errors: a } = r, c = t.route.loader && !e.hasOwnProperty(t.route.id) && (!a || a[t.route.id] === void 0);
585
+ if (t.route.lazy || c) {
586
+ n.isStatic && (o = !0), i = s >= 0 ? i.slice(0, s + 1) : [i[0]];
587
+ break;
588
+ }
589
+ }
590
+ }
591
+ }
592
+ let c = n?.onError, l = r && c ? (e, t) => {
593
+ c(e, {
594
+ location: r.location,
595
+ params: r.matches?.[0]?.params ?? {},
596
+ unstable_pattern: it(r.matches),
597
+ errorInfo: t
598
+ });
599
+ } : void 0;
600
+ return i.reduceRight((e, n, c) => {
601
+ let u, d = !1, f = null, m = null;
602
+ r && (u = a && n.route.id ? a[n.route.id] : void 0, f = n.route.errorElement || Ot, o && (s < 0 && c === 0 ? (Kt("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), d = !0, m = null) : s === c && (d = !0, m = n.route.hydrateFallbackElement || null)));
603
+ let h = t.concat(i.slice(0, c + 1)), g = () => {
604
+ let t;
605
+ return t = u ? f : d ? m : n.route.Component ? /* @__PURE__ */ p.createElement(n.route.Component, null) : n.route.element ? n.route.element : e, /* @__PURE__ */ p.createElement(Mt, {
606
+ match: n,
607
+ routeContext: {
608
+ outlet: e,
609
+ matches: h,
610
+ isDataRoute: r != null
611
+ },
612
+ children: t
613
+ });
614
+ };
615
+ return r && (n.route.ErrorBoundary || n.route.errorElement || c === 0) ? /* @__PURE__ */ p.createElement(kt, {
616
+ location: r.location,
617
+ revalidation: r.revalidation,
618
+ component: f,
619
+ error: u,
620
+ children: g(),
621
+ routeContext: {
622
+ outlet: null,
623
+ matches: h,
624
+ isDataRoute: !0
625
+ },
626
+ onError: l
627
+ }) : g();
628
+ }, null);
629
+ }
630
+ function Pt(e) {
631
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
632
+ }
633
+ function Ft(e) {
634
+ let t = p.useContext(z);
635
+ return P(t, Pt(e)), t;
636
+ }
637
+ function q(e) {
638
+ let t = p.useContext(B);
639
+ return P(t, Pt(e)), t;
640
+ }
641
+ function It(e) {
642
+ let t = p.useContext(U);
643
+ return P(t, Pt(e)), t;
644
+ }
645
+ function Lt(e) {
646
+ let t = It(e), n = t.matches[t.matches.length - 1];
647
+ return P(n.route.id, `${e} can only be used on routes that contain a unique "id"`), n.route.id;
648
+ }
649
+ function Rt() {
650
+ return Lt("useRouteId");
651
+ }
652
+ function zt() {
653
+ return q("useNavigation").navigation;
654
+ }
655
+ function Bt() {
656
+ let { matches: e, loaderData: t } = q("useMatches");
657
+ return p.useMemo(() => e.map((e) => ke(e, t)), [e, t]);
658
+ }
659
+ function Vt() {
660
+ let e = p.useContext(ht), t = q("useRouteError"), n = Lt("useRouteError");
661
+ return e === void 0 ? t.errors?.[n] : e;
662
+ }
663
+ var Ht = 0;
664
+ function Ut(e) {
665
+ let { router: t, basename: n } = Ft("useBlocker"), r = q("useBlocker"), [i, a] = p.useState(""), o = p.useCallback((t) => {
666
+ if (typeof e != "function") return !!e;
667
+ if (n === "/") return e(t);
668
+ let { currentLocation: r, nextLocation: i, historyAction: a } = t;
669
+ return e({
670
+ currentLocation: {
671
+ ...r,
672
+ pathname: L(r.pathname, n) || r.pathname
673
+ },
674
+ nextLocation: {
675
+ ...i,
676
+ pathname: L(i.pathname, n) || i.pathname
677
+ },
678
+ historyAction: a
679
+ });
680
+ }, [n, e]);
681
+ return p.useEffect(() => {
682
+ let e = String(++Ht);
683
+ return a(e), () => t.deleteBlocker(e);
684
+ }, [t]), p.useEffect(() => {
685
+ i !== "" && t.getBlocker(i, o);
686
+ }, [
687
+ t,
688
+ i,
689
+ o
690
+ ]), i && r.blockers.has(i) ? r.blockers.get(i) : lt;
691
+ }
692
+ function Wt() {
693
+ let { router: e } = Ft("useNavigate"), t = Lt("useNavigate"), n = p.useRef(!1);
694
+ return Ct(() => {
695
+ n.current = !0;
696
+ }), p.useCallback(async (r, i = {}) => {
697
+ F(n.current, St), n.current && (typeof r == "number" ? await e.navigate(r) : await e.navigate(r, {
698
+ fromRouteId: t,
699
+ ...i
700
+ }));
701
+ }, [e, t]);
702
+ }
703
+ var Gt = {};
704
+ function Kt(e, t, n) {
705
+ !t && !Gt[e] && (Gt[e] = !0, F(!1, n));
706
+ }
707
+ p.useOptimistic, p.memo(qt);
708
+ function qt({ routes: e, future: t, state: n, isStatic: r, onError: i }) {
709
+ return Et(e, void 0, {
710
+ state: n,
711
+ isStatic: r,
712
+ onError: i,
713
+ future: t
714
+ });
715
+ }
716
+ function Jt({ basename: e = "/", children: t = null, location: n, navigationType: r = "POP", navigator: i, static: a = !1, unstable_useTransitions: o }) {
717
+ P(!W(), "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");
718
+ let s = e.replace(/^\/*/, "/"), c = p.useMemo(() => ({
719
+ basename: s,
720
+ navigator: i,
721
+ static: a,
722
+ unstable_useTransitions: o,
723
+ future: {}
724
+ }), [
725
+ s,
726
+ i,
727
+ a,
728
+ o
729
+ ]);
730
+ typeof n == "string" && (n = I(n));
731
+ let { pathname: l = "/", search: u = "", hash: d = "", state: f = null, key: m = "default", unstable_mask: h } = n, g = p.useMemo(() => {
732
+ let e = L(l, s);
733
+ return e == null ? null : {
734
+ location: {
735
+ pathname: e,
736
+ search: u,
737
+ hash: d,
738
+ state: f,
739
+ key: m,
740
+ unstable_mask: h
741
+ },
742
+ navigationType: r
743
+ };
744
+ }, [
745
+ s,
746
+ l,
747
+ u,
748
+ d,
749
+ f,
750
+ m,
751
+ r,
752
+ h
753
+ ]);
754
+ return F(g != null, `<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`), g == null ? null : /* @__PURE__ */ p.createElement(V.Provider, { value: c }, /* @__PURE__ */ p.createElement(H.Provider, {
755
+ children: t,
756
+ value: g
757
+ }));
758
+ }
759
+ p.Component;
760
+ var J = "get", Y = "application/x-www-form-urlencoded";
761
+ function Yt(e) {
762
+ return typeof HTMLElement < "u" && e instanceof HTMLElement;
763
+ }
764
+ function Xt(e) {
765
+ return Yt(e) && e.tagName.toLowerCase() === "button";
766
+ }
767
+ function Zt(e) {
768
+ return Yt(e) && e.tagName.toLowerCase() === "form";
769
+ }
770
+ function Qt(e) {
771
+ return Yt(e) && e.tagName.toLowerCase() === "input";
772
+ }
773
+ function $t(e) {
774
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
775
+ }
776
+ function en(e, t) {
777
+ return e.button === 0 && (!t || t === "_self") && !$t(e);
778
+ }
779
+ var tn = null;
780
+ function nn() {
781
+ if (tn === null) try {
782
+ new FormData(document.createElement("form"), 0), tn = !1;
783
+ } catch {
784
+ tn = !0;
785
+ }
786
+ return tn;
787
+ }
788
+ var rn = /* @__PURE__ */ new Set([
789
+ "application/x-www-form-urlencoded",
790
+ "multipart/form-data",
791
+ "text/plain"
792
+ ]);
793
+ function an(e) {
794
+ return e != null && !rn.has(e) ? (F(!1, `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Y}"`), null) : e;
795
+ }
796
+ function on(e, t) {
797
+ let n, r, i, a, o;
798
+ if (Zt(e)) {
799
+ let o = e.getAttribute("action");
800
+ r = o ? L(o, t) : null, n = e.getAttribute("method") || J, i = an(e.getAttribute("enctype")) || Y, a = new FormData(e);
801
+ } else if (Xt(e) || Qt(e) && (e.type === "submit" || e.type === "image")) {
802
+ let o = e.form;
803
+ if (o == null) throw Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
804
+ let s = e.getAttribute("formaction") || o.getAttribute("action");
805
+ if (r = s ? L(s, t) : null, n = e.getAttribute("formmethod") || o.getAttribute("method") || J, i = an(e.getAttribute("formenctype")) || an(o.getAttribute("enctype")) || Y, a = new FormData(o, e), !nn()) {
806
+ let { name: t, type: n, value: r } = e;
807
+ if (n === "image") {
808
+ let e = t ? `${t}.` : "";
809
+ a.append(`${e}x`, "0"), a.append(`${e}y`, "0");
810
+ } else t && a.append(t, r);
811
+ }
812
+ } else if (Yt(e)) throw Error("Cannot submit element that is not <form>, <button>, or <input type=\"submit|image\">");
813
+ else n = J, r = null, i = Y, o = e;
814
+ return a && i === "text/plain" && (o = a, a = void 0), {
815
+ action: r,
816
+ method: n.toLowerCase(),
817
+ encType: i,
818
+ formData: a,
819
+ body: o
820
+ };
821
+ }
822
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
823
+ var sn = {
824
+ "&": "\\u0026",
825
+ ">": "\\u003e",
826
+ "<": "\\u003c",
827
+ "\u2028": "\\u2028",
828
+ "\u2029": "\\u2029"
829
+ }, cn = /[&><\u2028\u2029]/g;
830
+ function ln(e) {
831
+ return e.replace(cn, (e) => sn[e]);
832
+ }
833
+ function un(e, t) {
834
+ if (e === !1 || e == null) throw Error(t);
835
+ }
836
+ function dn(e, t, n, r) {
837
+ let i = typeof e == "string" ? new URL(e, typeof window > "u" ? "server://singlefetch/" : window.location.origin) : e;
838
+ return n ? i.pathname.endsWith("/") ? i.pathname = `${i.pathname}_.${r}` : i.pathname = `${i.pathname}.${r}` : i.pathname === "/" ? i.pathname = `_root.${r}` : t && L(i.pathname, t) === "/" ? i.pathname = `${t.replace(/\/$/, "")}/_root.${r}` : i.pathname = `${i.pathname.replace(/\/$/, "")}.${r}`, i;
839
+ }
840
+ async function fn(e, t) {
841
+ if (e.id in t) return t[e.id];
842
+ try {
843
+ let n = await import(
844
+ /* @vite-ignore */
845
+ /* webpackIgnore: true */
846
+ e.module
847
+ );
848
+ return t[e.id] = n, n;
849
+ } catch (t) {
850
+ return console.error(`Error loading route module \`${e.module}\`, reloading page...`), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {});
851
+ }
852
+ }
853
+ function pn(e) {
854
+ return e != null && typeof e.page == "string";
855
+ }
856
+ function mn(e) {
857
+ return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
858
+ }
859
+ async function hn(e, t, n) {
860
+ return bn((await Promise.all(e.map(async (e) => {
861
+ let r = t.routes[e.route.id];
862
+ if (r) {
863
+ let e = await fn(r, n);
864
+ return e.links ? e.links() : [];
865
+ }
866
+ return [];
867
+ }))).flat(1).filter(mn).filter((e) => e.rel === "stylesheet" || e.rel === "preload").map((e) => e.rel === "stylesheet" ? {
868
+ ...e,
869
+ rel: "prefetch",
870
+ as: "style"
871
+ } : {
872
+ ...e,
873
+ rel: "prefetch"
874
+ }));
875
+ }
876
+ function gn(e, t, n, r, i, a) {
877
+ let o = (e, t) => n[t] ? e.route.id !== n[t].route.id : !0, s = (e, t) => n[t].pathname !== e.pathname || n[t].route.path?.endsWith("*") && n[t].params["*"] !== e.params["*"];
878
+ return a === "assets" ? t.filter((e, t) => o(e, t) || s(e, t)) : a === "data" ? t.filter((t, a) => {
879
+ let c = r.routes[t.route.id];
880
+ if (!c || !c.hasLoader) return !1;
881
+ if (o(t, a) || s(t, a)) return !0;
882
+ if (t.route.shouldRevalidate) {
883
+ let r = t.route.shouldRevalidate({
884
+ currentUrl: new URL(i.pathname + i.search + i.hash, window.origin),
885
+ currentParams: n[0]?.params || {},
886
+ nextUrl: new URL(e, window.origin),
887
+ nextParams: t.params,
888
+ defaultShouldRevalidate: !0
889
+ });
890
+ if (typeof r == "boolean") return r;
891
+ }
892
+ return !0;
893
+ }) : [];
894
+ }
895
+ function _n(e, t, { includeHydrateFallback: n } = {}) {
896
+ return vn(e.map((e) => {
897
+ let r = t.routes[e.route.id];
898
+ if (!r) return [];
899
+ let i = [r.module];
900
+ return r.clientActionModule && (i = i.concat(r.clientActionModule)), r.clientLoaderModule && (i = i.concat(r.clientLoaderModule)), n && r.hydrateFallbackModule && (i = i.concat(r.hydrateFallbackModule)), r.imports && (i = i.concat(r.imports)), i;
901
+ }).flat(1));
902
+ }
903
+ function vn(e) {
904
+ return [...new Set(e)];
905
+ }
906
+ function yn(e) {
907
+ let t = {}, n = Object.keys(e).sort();
908
+ for (let r of n) t[r] = e[r];
909
+ return t;
910
+ }
911
+ function bn(e, t) {
912
+ let n = /* @__PURE__ */ new Set(), r = new Set(t);
913
+ return e.reduce((e, i) => {
914
+ if (t && !pn(i) && i.as === "script" && i.href && r.has(i.href)) return e;
915
+ let a = JSON.stringify(yn(i));
916
+ return n.has(a) || (n.add(a), e.push({
917
+ key: a,
918
+ link: i
919
+ })), e;
920
+ }, []);
921
+ }
922
+ function xn() {
923
+ let e = p.useContext(z);
924
+ return un(e, "You must render this element inside a <DataRouterContext.Provider> element"), e;
925
+ }
926
+ function Sn() {
927
+ let e = p.useContext(B);
928
+ return un(e, "You must render this element inside a <DataRouterStateContext.Provider> element"), e;
929
+ }
930
+ var Cn = p.createContext(void 0);
931
+ Cn.displayName = "FrameworkContext";
932
+ function wn() {
933
+ let e = p.useContext(Cn);
934
+ return un(e, "You must render this element inside a <HydratedRouter> element"), e;
935
+ }
936
+ function Tn(e, t) {
937
+ let n = p.useContext(Cn), [r, i] = p.useState(!1), [a, o] = p.useState(!1), { onFocus: s, onBlur: c, onMouseEnter: l, onMouseLeave: u, onTouchStart: d } = t, f = p.useRef(null);
938
+ p.useEffect(() => {
939
+ if (e === "render" && o(!0), e === "viewport") {
940
+ let e = new IntersectionObserver((e) => {
941
+ e.forEach((e) => {
942
+ o(e.isIntersecting);
943
+ });
944
+ }, { threshold: .5 });
945
+ return f.current && e.observe(f.current), () => {
946
+ e.disconnect();
947
+ };
948
+ }
949
+ }, [e]), p.useEffect(() => {
950
+ if (r) {
951
+ let e = setTimeout(() => {
952
+ o(!0);
953
+ }, 100);
954
+ return () => {
955
+ clearTimeout(e);
956
+ };
957
+ }
958
+ }, [r]);
959
+ let m = () => {
960
+ i(!0);
961
+ }, h = () => {
962
+ i(!1), o(!1);
963
+ };
964
+ return n ? e === "intent" ? [
965
+ a,
966
+ f,
967
+ {
968
+ onFocus: X(s, m),
969
+ onBlur: X(c, h),
970
+ onMouseEnter: X(l, m),
971
+ onMouseLeave: X(u, h),
972
+ onTouchStart: X(d, m)
973
+ }
974
+ ] : [
975
+ a,
976
+ f,
977
+ {}
978
+ ] : [
979
+ !1,
980
+ f,
981
+ {}
982
+ ];
983
+ }
984
+ function X(e, t) {
985
+ return (n) => {
986
+ e && e(n), n.defaultPrevented || t(n);
987
+ };
988
+ }
989
+ function En({ page: e, ...t }) {
990
+ let n = dt(), { router: r } = xn(), i = p.useMemo(() => De(r.routes, e, r.basename), [
991
+ r.routes,
992
+ e,
993
+ r.basename
994
+ ]);
995
+ return i ? n ? /* @__PURE__ */ p.createElement(On, {
996
+ page: e,
997
+ matches: i,
998
+ ...t
999
+ }) : /* @__PURE__ */ p.createElement(kn, {
1000
+ page: e,
1001
+ matches: i,
1002
+ ...t
1003
+ }) : null;
1004
+ }
1005
+ function Dn(e) {
1006
+ let { manifest: t, routeModules: n } = wn(), [r, i] = p.useState([]);
1007
+ return p.useEffect(() => {
1008
+ let r = !1;
1009
+ return hn(e, t, n).then((e) => {
1010
+ r || i(e);
1011
+ }), () => {
1012
+ r = !0;
1013
+ };
1014
+ }, [
1015
+ e,
1016
+ t,
1017
+ n
1018
+ ]), r;
1019
+ }
1020
+ function On({ page: e, matches: t, ...n }) {
1021
+ let r = G(), { future: i } = wn(), { basename: a } = xn(), o = p.useMemo(() => {
1022
+ if (e === r.pathname + r.search + r.hash) return [];
1023
+ let n = dn(e, a, i.unstable_trailingSlashAwareDataRequests, "rsc"), o = !1, s = [];
1024
+ for (let e of t) typeof e.route.shouldRevalidate == "function" ? o = !0 : s.push(e.route.id);
1025
+ return o && s.length > 0 && n.searchParams.set("_routes", s.join(",")), [n.pathname + n.search];
1026
+ }, [
1027
+ a,
1028
+ i.unstable_trailingSlashAwareDataRequests,
1029
+ e,
1030
+ r,
1031
+ t
1032
+ ]);
1033
+ return /* @__PURE__ */ p.createElement(p.Fragment, null, o.map((e) => /* @__PURE__ */ p.createElement("link", {
1034
+ key: e,
1035
+ rel: "prefetch",
1036
+ as: "fetch",
1037
+ href: e,
1038
+ ...n
1039
+ })));
1040
+ }
1041
+ function kn({ page: e, matches: t, ...n }) {
1042
+ let r = G(), { future: i, manifest: a, routeModules: o } = wn(), { basename: s } = xn(), { loaderData: c, matches: l } = Sn(), u = p.useMemo(() => gn(e, t, l, a, r, "data"), [
1043
+ e,
1044
+ t,
1045
+ l,
1046
+ a,
1047
+ r
1048
+ ]), d = p.useMemo(() => gn(e, t, l, a, r, "assets"), [
1049
+ e,
1050
+ t,
1051
+ l,
1052
+ a,
1053
+ r
1054
+ ]), f = p.useMemo(() => {
1055
+ if (e === r.pathname + r.search + r.hash) return [];
1056
+ let n = /* @__PURE__ */ new Set(), l = !1;
1057
+ if (t.forEach((e) => {
1058
+ let t = a.routes[e.route.id];
1059
+ !t || !t.hasLoader || (!u.some((t) => t.route.id === e.route.id) && e.route.id in c && o[e.route.id]?.shouldRevalidate || t.hasClientLoader ? l = !0 : n.add(e.route.id));
1060
+ }), n.size === 0) return [];
1061
+ let d = dn(e, s, i.unstable_trailingSlashAwareDataRequests, "data");
1062
+ return l && n.size > 0 && d.searchParams.set("_routes", t.filter((e) => n.has(e.route.id)).map((e) => e.route.id).join(",")), [d.pathname + d.search];
1063
+ }, [
1064
+ s,
1065
+ i.unstable_trailingSlashAwareDataRequests,
1066
+ c,
1067
+ r,
1068
+ a,
1069
+ u,
1070
+ t,
1071
+ e,
1072
+ o
1073
+ ]), m = p.useMemo(() => _n(d, a), [d, a]), h = Dn(d);
1074
+ return /* @__PURE__ */ p.createElement(p.Fragment, null, f.map((e) => /* @__PURE__ */ p.createElement("link", {
1075
+ key: e,
1076
+ rel: "prefetch",
1077
+ as: "fetch",
1078
+ href: e,
1079
+ ...n
1080
+ })), m.map((e) => /* @__PURE__ */ p.createElement("link", {
1081
+ key: e,
1082
+ rel: "modulepreload",
1083
+ href: e,
1084
+ ...n
1085
+ })), h.map(({ key: e, link: t }) => /* @__PURE__ */ p.createElement("link", {
1086
+ key: e,
1087
+ nonce: n.nonce,
1088
+ ...t,
1089
+ crossOrigin: t.crossOrigin ?? n.crossOrigin
1090
+ })));
1091
+ }
1092
+ function An(...e) {
1093
+ return (t) => {
1094
+ e.forEach((e) => {
1095
+ typeof e == "function" ? e(t) : e != null && (e.current = t);
1096
+ });
1097
+ };
1098
+ }
1099
+ p.Component;
1100
+ var jn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
1101
+ try {
1102
+ jn && (window.__reactRouterVersion = "7.14.0");
1103
+ } catch {}
1104
+ function Mn({ basename: e, children: t, history: n, unstable_useTransitions: r }) {
1105
+ let [i, a] = p.useState({
1106
+ action: n.action,
1107
+ location: n.location
1108
+ }), o = p.useCallback((e) => {
1109
+ r === !1 ? a(e) : p.startTransition(() => a(e));
1110
+ }, [r]);
1111
+ return p.useLayoutEffect(() => n.listen(o), [n, o]), /* @__PURE__ */ p.createElement(Jt, {
1112
+ basename: e,
1113
+ children: t,
1114
+ location: i.location,
1115
+ navigationType: i.action,
1116
+ navigator: n,
1117
+ unstable_useTransitions: r
1118
+ });
1119
+ }
1120
+ Mn.displayName = "unstable_HistoryRouter";
1121
+ var Nn = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Pn = p.forwardRef(function({ onClick: e, discover: t = "render", prefetch: n = "none", relative: r, reloadDocument: i, replace: a, unstable_mask: o, state: s, target: c, to: l, preventScrollReset: u, viewTransition: d, unstable_defaultShouldRevalidate: f, ...m }, h) {
1122
+ let { basename: g, navigator: _, unstable_useTransitions: v } = p.useContext(V), y = typeof l == "string" && Nn.test(l), b = ot(l, g);
1123
+ l = b.to;
1124
+ let x = xt(l, { relative: r }), S = G(), C = null;
1125
+ if (o) {
1126
+ let e = Qe(o, [], S.unstable_mask ? S.unstable_mask.pathname : "/", !0);
1127
+ g !== "/" && (e.pathname = e.pathname === "/" ? g : R([g, e.pathname])), C = _.createHref(e);
1128
+ }
1129
+ let [w, T, E] = Tn(n, m), ee = Vn(l, {
1130
+ replace: a,
1131
+ unstable_mask: o,
1132
+ state: s,
1133
+ target: c,
1134
+ preventScrollReset: u,
1135
+ relative: r,
1136
+ viewTransition: d,
1137
+ unstable_defaultShouldRevalidate: f,
1138
+ unstable_useTransitions: v
1139
+ });
1140
+ function D(t) {
1141
+ e && e(t), t.defaultPrevented || ee(t);
1142
+ }
1143
+ let O = !(b.isExternal || i), k = /* @__PURE__ */ p.createElement("a", {
1144
+ ...m,
1145
+ ...E,
1146
+ href: (O ? C : void 0) || b.absoluteURL || x,
1147
+ onClick: O ? D : e,
1148
+ ref: An(h, T),
1149
+ target: c,
1150
+ "data-discover": !y && t === "render" ? "true" : void 0
1151
+ });
1152
+ return w && !y ? /* @__PURE__ */ p.createElement(p.Fragment, null, k, /* @__PURE__ */ p.createElement(En, { page: x })) : k;
1153
+ });
1154
+ Pn.displayName = "Link";
1155
+ var Fn = p.forwardRef(function({ "aria-current": e = "page", caseSensitive: t = !1, className: n = "", end: r = !1, style: i, to: a, viewTransition: o, children: s, ...c }, l) {
1156
+ let u = K(a, { relative: c.relative }), d = G(), f = p.useContext(B), { navigator: m, basename: h } = p.useContext(V), g = f != null && Xn(u) && o === !0, _ = m.encodeLocation ? m.encodeLocation(u).pathname : u.pathname, v = d.pathname, y = f && f.navigation && f.navigation.location ? f.navigation.location.pathname : null;
1157
+ t || (v = v.toLowerCase(), y = y ? y.toLowerCase() : null, _ = _.toLowerCase()), y && h && (y = L(y, h) || y);
1158
+ let b = _ !== "/" && _.endsWith("/") ? _.length - 1 : _.length, x = v === _ || !r && v.startsWith(_) && v.charAt(b) === "/", S = y != null && (y === _ || !r && y.startsWith(_) && y.charAt(_.length) === "/"), C = {
1159
+ isActive: x,
1160
+ isPending: S,
1161
+ isTransitioning: g
1162
+ }, w = x ? e : void 0, T;
1163
+ T = typeof n == "function" ? n(C) : [
1164
+ n,
1165
+ x ? "active" : null,
1166
+ S ? "pending" : null,
1167
+ g ? "transitioning" : null
1168
+ ].filter(Boolean).join(" ");
1169
+ let E = typeof i == "function" ? i(C) : i;
1170
+ return /* @__PURE__ */ p.createElement(Pn, {
1171
+ ...c,
1172
+ "aria-current": w,
1173
+ className: T,
1174
+ ref: l,
1175
+ style: E,
1176
+ to: a,
1177
+ viewTransition: o
1178
+ }, typeof s == "function" ? s(C) : s);
1179
+ });
1180
+ Fn.displayName = "NavLink";
1181
+ var In = p.forwardRef(({ discover: e = "render", fetcherKey: t, navigate: n, reloadDocument: r, replace: i, state: a, method: o = J, action: s, onSubmit: c, relative: l, preventScrollReset: u, viewTransition: d, unstable_defaultShouldRevalidate: f, ...m }, h) => {
1182
+ let { unstable_useTransitions: g } = p.useContext(V), _ = Wn(), v = Gn(s, { relative: l }), y = o.toLowerCase() === "get" ? "get" : "post", b = typeof s == "string" && Nn.test(s);
1183
+ return /* @__PURE__ */ p.createElement("form", {
1184
+ ref: h,
1185
+ method: y,
1186
+ action: v,
1187
+ onSubmit: r ? c : (e) => {
1188
+ if (c && c(e), e.defaultPrevented) return;
1189
+ e.preventDefault();
1190
+ let r = e.nativeEvent.submitter, s = r?.getAttribute("formmethod") || o, m = () => _(r || e.currentTarget, {
1191
+ fetcherKey: t,
1192
+ method: s,
1193
+ navigate: n,
1194
+ replace: i,
1195
+ state: a,
1196
+ relative: l,
1197
+ preventScrollReset: u,
1198
+ viewTransition: d,
1199
+ unstable_defaultShouldRevalidate: f
1200
+ });
1201
+ g && n !== !1 ? p.startTransition(() => m()) : m();
1202
+ },
1203
+ ...m,
1204
+ "data-discover": !b && e === "render" ? "true" : void 0
1205
+ });
1206
+ });
1207
+ In.displayName = "Form";
1208
+ function Ln({ getKey: e, storageKey: t, ...n }) {
1209
+ let r = p.useContext(Cn), { basename: i } = p.useContext(V), a = G(), o = Bt();
1210
+ Jn({
1211
+ getKey: e,
1212
+ storageKey: t
1213
+ });
1214
+ let s = p.useMemo(() => {
1215
+ if (!r || !e) return null;
1216
+ let t = qn(a, o, i, e);
1217
+ return t === a.key ? null : t;
1218
+ }, []);
1219
+ if (!r || r.isSpaMode) return null;
1220
+ let c = ((e, t) => {
1221
+ if (!window.history.state || !window.history.state.key) {
1222
+ let e = Math.random().toString(32).slice(2);
1223
+ window.history.replaceState({ key: e }, "");
1224
+ }
1225
+ try {
1226
+ let n = JSON.parse(sessionStorage.getItem(e) || "{}")[t || window.history.state.key];
1227
+ typeof n == "number" && window.scrollTo(0, n);
1228
+ } catch (t) {
1229
+ console.error(t), sessionStorage.removeItem(e);
1230
+ }
1231
+ }).toString();
1232
+ return /* @__PURE__ */ p.createElement("script", {
1233
+ ...n,
1234
+ suppressHydrationWarning: !0,
1235
+ dangerouslySetInnerHTML: { __html: `(${c})(${ln(JSON.stringify(t || Kn))}, ${ln(JSON.stringify(s))})` }
1236
+ });
1237
+ }
1238
+ Ln.displayName = "ScrollRestoration";
1239
+ function Rn(e) {
1240
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1241
+ }
1242
+ function zn(e) {
1243
+ let t = p.useContext(z);
1244
+ return P(t, Rn(e)), t;
1245
+ }
1246
+ function Bn(e) {
1247
+ let t = p.useContext(B);
1248
+ return P(t, Rn(e)), t;
1249
+ }
1250
+ function Vn(e, { target: t, replace: n, unstable_mask: r, state: i, preventScrollReset: a, relative: o, viewTransition: s, unstable_defaultShouldRevalidate: c, unstable_useTransitions: l } = {}) {
1251
+ let u = wt(), d = G(), f = K(e, { relative: o });
1252
+ return p.useCallback((m) => {
1253
+ if (en(m, t)) {
1254
+ m.preventDefault();
1255
+ let t = n === void 0 ? Ee(d) === Ee(f) : n, h = () => u(e, {
1256
+ replace: t,
1257
+ unstable_mask: r,
1258
+ state: i,
1259
+ preventScrollReset: a,
1260
+ relative: o,
1261
+ viewTransition: s,
1262
+ unstable_defaultShouldRevalidate: c
1263
+ });
1264
+ l ? p.startTransition(() => h()) : h();
1265
+ }
1266
+ }, [
1267
+ d,
1268
+ u,
1269
+ f,
1270
+ n,
1271
+ r,
1272
+ i,
1273
+ t,
1274
+ e,
1275
+ a,
1276
+ o,
1277
+ s,
1278
+ c,
1279
+ l
1280
+ ]);
1281
+ }
1282
+ var Hn = 0, Un = () => `__${String(++Hn)}__`;
1283
+ function Wn() {
1284
+ let { router: e } = zn("useSubmit"), { basename: t } = p.useContext(V), n = Rt(), r = e.fetch, i = e.navigate;
1285
+ return p.useCallback(async (e, a = {}) => {
1286
+ let { action: o, method: s, encType: c, formData: l, body: u } = on(e, t);
1287
+ a.navigate === !1 ? await r(a.fetcherKey || Un(), n, a.action || o, {
1288
+ unstable_defaultShouldRevalidate: a.unstable_defaultShouldRevalidate,
1289
+ preventScrollReset: a.preventScrollReset,
1290
+ formData: l,
1291
+ body: u,
1292
+ formMethod: a.method || s,
1293
+ formEncType: a.encType || c,
1294
+ flushSync: a.flushSync
1295
+ }) : await i(a.action || o, {
1296
+ unstable_defaultShouldRevalidate: a.unstable_defaultShouldRevalidate,
1297
+ preventScrollReset: a.preventScrollReset,
1298
+ formData: l,
1299
+ body: u,
1300
+ formMethod: a.method || s,
1301
+ formEncType: a.encType || c,
1302
+ replace: a.replace,
1303
+ state: a.state,
1304
+ fromRouteId: n,
1305
+ flushSync: a.flushSync,
1306
+ viewTransition: a.viewTransition
1307
+ });
1308
+ }, [
1309
+ r,
1310
+ i,
1311
+ t,
1312
+ n
1313
+ ]);
1314
+ }
1315
+ function Gn(e, { relative: t } = {}) {
1316
+ let { basename: n } = p.useContext(V), r = p.useContext(U);
1317
+ P(r, "useFormAction must be used inside a RouteContext");
1318
+ let [i] = r.matches.slice(-1), a = { ...K(e || ".", { relative: t }) }, o = G();
1319
+ if (e == null) {
1320
+ a.search = o.search;
1321
+ let e = new URLSearchParams(a.search), t = e.getAll("index");
1322
+ if (t.some((e) => e === "")) {
1323
+ e.delete("index"), t.filter((e) => e).forEach((t) => e.append("index", t));
1324
+ let n = e.toString();
1325
+ a.search = n ? `?${n}` : "";
1326
+ }
1327
+ }
1328
+ return (!e || e === ".") && i.route.index && (a.search = a.search ? a.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (a.pathname = a.pathname === "/" ? n : R([n, a.pathname])), Ee(a);
1329
+ }
1330
+ var Kn = "react-router-scroll-positions", Z = {};
1331
+ function qn(e, t, n, r) {
1332
+ let i = null;
1333
+ return r && (i = r(n === "/" ? e : {
1334
+ ...e,
1335
+ pathname: L(e.pathname, n) || e.pathname
1336
+ }, t)), i ??= e.key, i;
1337
+ }
1338
+ function Jn({ getKey: e, storageKey: t } = {}) {
1339
+ let { router: n } = zn("useScrollRestoration"), { restoreScrollPosition: r, preventScrollReset: i } = Bn("useScrollRestoration"), { basename: a } = p.useContext(V), o = G(), s = Bt(), c = zt();
1340
+ p.useEffect(() => (window.history.scrollRestoration = "manual", () => {
1341
+ window.history.scrollRestoration = "auto";
1342
+ }), []), Yn(p.useCallback(() => {
1343
+ if (c.state === "idle") {
1344
+ let t = qn(o, s, a, e);
1345
+ Z[t] = window.scrollY;
1346
+ }
1347
+ try {
1348
+ sessionStorage.setItem(t || Kn, JSON.stringify(Z));
1349
+ } catch (e) {
1350
+ F(!1, `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`);
1351
+ }
1352
+ window.history.scrollRestoration = "auto";
1353
+ }, [
1354
+ c.state,
1355
+ e,
1356
+ a,
1357
+ o,
1358
+ s,
1359
+ t
1360
+ ])), typeof document < "u" && (p.useLayoutEffect(() => {
1361
+ try {
1362
+ let e = sessionStorage.getItem(t || Kn);
1363
+ e && (Z = JSON.parse(e));
1364
+ } catch {}
1365
+ }, [t]), p.useLayoutEffect(() => {
1366
+ let t = n?.enableScrollRestoration(Z, () => window.scrollY, e ? (t, n) => qn(t, n, a, e) : void 0);
1367
+ return () => t && t();
1368
+ }, [
1369
+ n,
1370
+ a,
1371
+ e
1372
+ ]), p.useLayoutEffect(() => {
1373
+ if (r !== !1) {
1374
+ if (typeof r == "number") {
1375
+ window.scrollTo(0, r);
1376
+ return;
1377
+ }
1378
+ try {
1379
+ if (o.hash) {
1380
+ let e = document.getElementById(decodeURIComponent(o.hash.slice(1)));
1381
+ if (e) {
1382
+ e.scrollIntoView();
1383
+ return;
1384
+ }
1385
+ }
1386
+ } catch {
1387
+ F(!1, `"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`);
1388
+ }
1389
+ i !== !0 && window.scrollTo(0, 0);
1390
+ }
1391
+ }, [
1392
+ o,
1393
+ r,
1394
+ i
1395
+ ]));
1396
+ }
1397
+ function Yn(e, t) {
1398
+ let { capture: n } = t || {};
1399
+ p.useEffect(() => {
1400
+ let t = n == null ? void 0 : { capture: n };
1401
+ return window.addEventListener("pagehide", e, t), () => {
1402
+ window.removeEventListener("pagehide", e, t);
1403
+ };
1404
+ }, [e, n]);
1405
+ }
1406
+ function Xn(e, { relative: t } = {}) {
1407
+ let n = p.useContext(ft);
1408
+ P(n != null, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");
1409
+ let { basename: r } = zn("useViewTransitionState"), i = K(e, { relative: t });
1410
+ if (!n.isTransitioning) return !1;
1411
+ let a = L(n.currentLocation.pathname, r) || n.currentLocation.pathname, o = L(n.nextLocation.pathname, r) || n.nextLocation.pathname;
1412
+ return Ue(i.pathname, o) != null || Ue(i.pathname, a) != null;
1413
+ }
1414
+ //#endregion
1415
+ //#region src/Breadcrumbs.tsx
1416
+ var Zn = ({ prependBreadcrumbItem: e, pathname: n, onBreadcrumbLookup: r }) => {
1417
+ let i = f(n).map((e) => ({
1418
+ title: r(e),
1419
+ path: e
1420
+ })).filter(({ title: e }) => e !== void 0), a = i.map(({ title: e, path: n }, r) => r === i.length - 1 ? /* @__PURE__ */ t(y, {
1421
+ as: "span",
1422
+ children: e
1423
+ }, n) : /* @__PURE__ */ t(y, {
1424
+ as: Pn,
1425
+ to: n,
1426
+ children: e
1427
+ }, n));
1428
+ return e ? /* @__PURE__ */ t(b, { children: [e, ...a] }) : /* @__PURE__ */ t(b, { children: a });
1429
+ }, Qn = ({ isOpen: r = !1, children: i, message: a, size: o = "medium", buttons: s, onConfirm: c, messages: u, onClose: d, onDismiss: f, ...p }) => {
1430
+ let m = i || a, h = d || f;
1431
+ return /* @__PURE__ */ n(E, {
1432
+ size: o,
1433
+ open: r,
1434
+ onDismiss: h,
1435
+ ...p,
1436
+ children: [l(m) ? /* @__PURE__ */ t(O, { children: m }) : /* @__PURE__ */ t(M, {
1437
+ paddingBottom: "medium",
1438
+ children: m
1439
+ }), /* @__PURE__ */ t(C, { children: c ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(T, {
1440
+ onClick: h,
1441
+ "data-testid": "cancel-modal-button",
1442
+ children: u.cancel
1443
+ }), /* @__PURE__ */ t(w, {
1444
+ onClick: c,
1445
+ "data-testid": "confirm-modal-button",
1446
+ children: u.confirm
1447
+ })] }) : s })]
1448
+ });
1449
+ }, $n = ({ as: e = "main", className: n, children: r }) => /* @__PURE__ */ t(e, {
1450
+ className: (0, A.default)(["eps-content", n]),
1451
+ children: r
1452
+ }), Q = /* @__PURE__ */ function(e) {
1453
+ return e.Local = "local", e.Development = "dev", e.Staging = "staging", e.Production = "prod", e;
1454
+ }({}), er = {
1455
+ [Q.Local]: "#B482FB",
1456
+ [Q.Development]: "#5AC39A",
1457
+ [Q.Staging]: "#FFCA28"
1458
+ }, tr = (e) => er[e], nr = {
1459
+ [Q.Local]: "Local",
1460
+ [Q.Development]: "Dev",
1461
+ [Q.Staging]: "Staging",
1462
+ [Q.Production]: "Prod"
1463
+ }, rr = (e) => nr[e], ir = ({ title: e, accentColor: r = "#FF5959", ...i }) => /* @__PURE__ */ n("svg", {
1464
+ width: 257,
1465
+ height: 37,
1466
+ viewBox: "0 0 257 37",
1467
+ ...i,
1468
+ children: [/* @__PURE__ */ t("title", { children: e }), /* @__PURE__ */ n("g", {
1469
+ fill: "none",
1470
+ fillRule: "evenodd",
1471
+ children: [
1472
+ /* @__PURE__ */ t("path", {
1473
+ fill: "#FFF",
1474
+ d: "M0 .231V25.72h18.745v-4.318H4.869v-6.163h12.31v-4.318H4.87V4.55h13.876V.231z"
1475
+ }),
1476
+ /* @__PURE__ */ t("path", {
1477
+ fill: r,
1478
+ d: "M0 36.408h45.253v-4.32H0z"
1479
+ }),
1480
+ /* @__PURE__ */ t("path", {
1481
+ fill: "#FFF",
1482
+ d: "M40.384.231v15.425L23.656.231h-.521V25.72h4.869V10.573L44.732 25.72h.521V.23zM69.25 15.238h-7.267v21.17h-4.87v-21.17H49.81V10.92h19.44zM83.863 36.86c-1.646 0-3.142-.255-4.486-.765-1.345-.51-2.493-1.23-3.443-2.159-.95-.928-1.687-2.054-2.208-3.378-.522-1.323-.783-2.797-.783-4.422V10.92h4.869v15.216c0 1.277.209 2.333.626 3.169.417.836.933 1.497 1.548 1.985a5.346 5.346 0 001.982 1.01c.707.186 1.339.278 1.895.278.557 0 1.188-.092 1.896-.279a5.35 5.35 0 001.982-1.01c.614-.487 1.13-1.148 1.548-1.984.417-.836.625-1.892.625-3.169V10.92h4.87v15.216c0 1.625-.256 3.1-.766 4.422-.51 1.324-1.24 2.45-2.19 3.378-.952.929-2.1 1.648-3.444 2.159-1.344.51-2.851.766-4.52.766M104.21 24.047h5.546c1.016 0 1.854-.127 2.513-.383.658-.255 1.179-.592 1.56-1.01.381-.418.641-.888.78-1.41.138-.522.208-1.05.208-1.584 0-.627-.099-1.207-.295-1.741a3.718 3.718 0 00-.901-1.393c-.405-.394-.924-.708-1.56-.94-.636-.232-1.404-.348-2.305-.348h-5.546v8.81zm0 4.248v8.113h-4.87V10.92h11.567c1.3 0 2.49.215 3.57.644 1.08.43 2.004 1.033 2.77 1.81a8.287 8.287 0 011.794 2.787c.43 1.079.645 2.257.645 3.534 0 .952-.128 1.874-.383 2.768-.256.894-.61 1.7-1.063 2.42a7.32 7.32 0 01-1.672 1.863 5.929 5.929 0 01-2.178 1.096l6.339 8.566h-5.808l-5.893-8.113h-4.818z"
1483
+ }),
1484
+ /* @__PURE__ */ t("g", {
1485
+ fill: r,
1486
+ children: /* @__PURE__ */ t("path", { d: "M141.051 23.448h5.628c4.185 0 5.989-1.984 5.989-4.942 0-2.742-1.515-4.618-5.989-4.618h-5.628v9.56zm0 3.067v9.776h-3.571V10.75h9.632c6.674 0 9.127 3.211 9.127 7.54 0 4.979-3.102 8.226-9.2 8.226h-5.988zM169.695 28.715c-1.371-.288-2.958-.505-4.401-.505-2.85 0-4.041 1.263-4.041 3.139s1.407 2.706 3.463 2.706c2.49 0 4.979-1.443 4.979-4.221v-1.119zm-4.293-2.958c1.551 0 3.174.253 4.293.469v-.83c0-2.525-1.154-3.896-4.33-3.896-2.164 0-3.824.866-4.942 2.092l-2.02-2.272c1.732-1.66 3.644-2.598 7.07-2.598 5.052 0 7.469 1.876 7.469 7.215v10.354h-3.211V34.02h-.108c-1.082 1.767-3.211 2.705-5.592 2.705-3.32 0-6.241-1.66-6.241-5.303 0-3.103 1.912-5.664 7.612-5.664zM178.965 19.191h3.211v2.886h.108c.938-1.984 2.922-3.355 5.231-3.355.47 0 .938.036 1.335.144l-.144 3.14a6.77 6.77 0 00-1.552-.181c-3.246 0-4.798 2.633-4.798 5.483v8.983h-3.39v-17.1zM199.961 36.291h-1.912c-4.004 0-5.988-.938-5.988-5.772v-8.55h-2.778V19.19h2.778v-4.654h3.355v4.654h4.473v2.778h-4.473v7.973c0 3.427 1.587 3.535 3.319 3.535h1.226v2.814zM219.767 36.291h-3.391V26.84c0-2.778-1.083-5.375-4.257-5.375-3.14 0-5.268 2.597-5.268 6.169v8.658h-3.391v-17.1h3.32v2.814h.143c.794-1.623 3.067-3.283 5.99-3.283 4.941 0 6.854 3.644 6.854 8.081v9.488zM227.847 26.262h10.57c0-2.597-2.272-4.726-5.087-4.726-2.922 0-5.014 1.948-5.483 4.726zm-.036 2.453c.397 3.355 2.633 5.195 5.844 5.195 2.778 0 4.618-1.623 5.484-2.67l2.164 1.804c-1.37 1.913-4.365 3.716-8.045 3.716-4.942 0-8.73-3.535-8.73-8.55 0-5.195 3.752-9.488 8.983-9.488 5.303 0 8.009 4.365 8.009 8.19 0 .649-.036 1.226-.072 1.803H227.81zM246.245 19.191h3.21v2.886h.109c.938-1.984 2.922-3.355 5.231-3.355.469 0 .938.036 1.335.144l-.145 3.14a6.77 6.77 0 00-1.551-.181c-3.247 0-4.798 2.633-4.798 5.483v8.983h-3.391v-17.1z" })
1487
+ })
1488
+ ]
1489
+ })]
1490
+ }), ar = ({ as: e = "nav", className: n, altText: r, environment: i }) => /* @__PURE__ */ t(e, {
1491
+ className: (0, A.default)(["eps-logo-wrapper", n]),
1492
+ children: /* @__PURE__ */ t(ir, {
1493
+ title: r,
1494
+ className: "logo",
1495
+ accentColor: i !== void 0 && i !== Q.Production ? tr(i) : void 0
1496
+ })
1497
+ }), or = "Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.", sr = class extends h {
1498
+ constructor(e) {
1499
+ super(e), this.state = { error: null };
1500
+ }
1501
+ static getDerivedStateFromError(e) {
1502
+ return { error: e };
1503
+ }
1504
+ componentDidCatch(e, t) {
1505
+ this.props.handleError?.(e, t);
1506
+ }
1507
+ render() {
1508
+ let { error: e } = this.state, { fallback: n, children: r } = this.props;
1509
+ return e ? c(n) ? n({
1510
+ retry: () => this.setState({ error: null }),
1511
+ error: e
1512
+ }) : e.name === "NotFoundError" && e.message === or ? /* @__PURE__ */ t(lr, {}) : n : r;
1513
+ }
1514
+ }, cr = "EP::locale";
1515
+ function lr() {
1516
+ let e = localStorage.getItem(cr), r = e === "nb" || e === "nb-NO";
1517
+ return /* @__PURE__ */ t(M, {
1518
+ maxWidth: "large",
1519
+ children: /* @__PURE__ */ n(k, {
1520
+ variant: "info",
1521
+ title: r ? "En ny versjon av nettsiden er tilgjengelig." : "A new version of the website is available.",
1522
+ children: [/* @__PURE__ */ t(M, {
1523
+ paddingBottom: "medium",
1524
+ children: /* @__PURE__ */ t(O, {
1525
+ margin: "none",
1526
+ children: r ? "Vennligst oppdater." : "Please refresh."
1527
+ })
1528
+ }), /* @__PURE__ */ t(w, {
1529
+ onClick: () => window.location.reload(),
1530
+ children: r ? "Oppdater" : "Refresh"
1531
+ })]
1532
+ })
1533
+ });
1534
+ }
1535
+ //#endregion
1536
+ //#region src/ExpandableMultiLanguageInput.tsx
1537
+ var ur = ({ title: e, inputComponent: n, languages: r, values: i, onChange: a, name: o, variant: s, feedback: c, ...l }) => {
1538
+ let u = (e, t) => {
1539
+ let n = { ...i };
1540
+ t === "" || !t ? delete n[e] : n[e] = t, a(n);
1541
+ };
1542
+ return /* @__PURE__ */ t(te, {
1543
+ title: e,
1544
+ defaultOpen: !0,
1545
+ contentStyle: {
1546
+ padding: "4px 4px 4px 4px",
1547
+ marginTop: "16px",
1548
+ marginBottom: "16px"
1549
+ },
1550
+ children: /* @__PURE__ */ t(N, {
1551
+ space: "medium",
1552
+ children: r.map(({ value: r, label: a, required: d }) => /* @__PURE__ */ t(n, {
1553
+ "data-testid": `multi-lang-input-${o}-${r}`,
1554
+ label: d ? `${a}*` : a,
1555
+ variant: s?.(r),
1556
+ feedback: c?.(r),
1557
+ name: o,
1558
+ onChange: (e) => {
1559
+ u(r, e.target.value);
1560
+ },
1561
+ value: i[r] || "",
1562
+ ...l
1563
+ }, e + r))
1564
+ })
1565
+ });
1566
+ };
1567
+ //#endregion
1568
+ //#region src/FeatureToggle.tsx
1569
+ function dr(e) {
1570
+ return {
1571
+ BASE_URL: "/",
1572
+ DEV: !1,
1573
+ MODE: "production",
1574
+ PROD: !0,
1575
+ SSR: !1
1576
+ }?.[`VITE_APP_${e}`] === "true" || window.localStorage?.getItem(e) === "true" || window.localStorage?.getItem(`VITE_APP_${e}`) === "true";
1577
+ }
1578
+ function fr(e) {
1579
+ return dr(e);
1580
+ }
1581
+ var pr = ({ children: n, flag: r }) => dr(r) ? /* @__PURE__ */ t(e, { children: n }) : null, mr = ({ amount: e, as: n = "span", ...r }) => {
1582
+ let i = Number(e) || 0, a = new Intl.NumberFormat("nb-NO", {
1583
+ maximumFractionDigits: 2,
1584
+ minimumFractionDigits: 2
1585
+ }).format(i);
1586
+ return /* @__PURE__ */ t(n, {
1587
+ ...r,
1588
+ children: a
1589
+ });
1590
+ }, hr = ({ language: e, options: i, className: a, onChange: o, ...s }) => {
1591
+ let c = (0, A.default)("eps-language-select", a);
1592
+ return /* @__PURE__ */ t("div", {
1593
+ ...s,
1594
+ className: c,
1595
+ children: /* @__PURE__ */ t(re, {
1596
+ onChange: (e) => {
1597
+ r(e), typeof e == "string" && o(e);
1598
+ },
1599
+ selectedValue: e,
1600
+ children: i.map((e) => /* @__PURE__ */ n(ne, {
1601
+ value: e.value,
1602
+ children: [e.label, e.required && /* @__PURE__ */ t("span", {
1603
+ className: "asterisk-margin",
1604
+ children: "*"
1605
+ })]
1606
+ }, e.value))
1607
+ })
1608
+ });
1609
+ }, gr = (e) => /* @__PURE__ */ t(D, {
1610
+ ...e,
1611
+ as: Pn,
1612
+ children: e.children
1613
+ }), _r = ({ children: e, className: n, ...r }) => /* @__PURE__ */ t(D, {
1614
+ ...r,
1615
+ as: "button",
1616
+ className: (0, A.default)("eps-link-button", n),
1617
+ children: e
1618
+ }), vr = ({ as: e = "nav", className: n, children: r }) => /* @__PURE__ */ t(e, {
1619
+ className: (0, A.default)([
1620
+ "eds-contrast",
1621
+ "eps-menu",
1622
+ n
1623
+ ]),
1624
+ children: r
1625
+ }), yr = ({ className: e, inputComponent: r, alertLabel: i, alertLevel: a, name: o, languages: s, values: c, onChange: l, defaultLanguage: u = "nob", label: d = "", onBlur: f = () => {}, ...p }) => {
1626
+ let [m, h] = v(u), g = (0, A.default)("multi-language-input", e), _ = c[m], y = (e) => {
1627
+ e.persist();
1628
+ let t = e.currentTarget;
1629
+ setTimeout(() => {
1630
+ t && !t.contains(document.activeElement) && f(e);
1631
+ }, 0);
1632
+ }, b = (e) => {
1633
+ h(e);
1634
+ }, x = (e) => {
1635
+ let t = Object.assign({}, c);
1636
+ e === "" || !e ? delete t[m] : t[m] = e, l(t);
1637
+ };
1638
+ return /* @__PURE__ */ t("div", {
1639
+ className: g,
1640
+ tabIndex: 0,
1641
+ onBlur: y,
1642
+ "data-testid": `multi-lang-input-${o}`,
1643
+ children: /* @__PURE__ */ n(N, {
1644
+ space: "extraSmall",
1645
+ children: [/* @__PURE__ */ t(hr, {
1646
+ language: m,
1647
+ options: s,
1648
+ onChange: (e) => b(e)
1649
+ }), /* @__PURE__ */ t(r, {
1650
+ label: d,
1651
+ variant: a,
1652
+ feedback: i,
1653
+ name: o,
1654
+ className: "language-item",
1655
+ onChange: (e) => x(e.target.value),
1656
+ value: _ || "",
1657
+ ...p
1658
+ })]
1659
+ })
1660
+ });
1661
+ }, br = ({ label: e, organisations: n, onChange: r, selectedOrganisationId: i, ...a }) => {
1662
+ let [o, s] = v();
1663
+ return g(() => {
1664
+ s(n.find((e) => e.organisationId === i));
1665
+ }, [i, n]), /* @__PURE__ */ t(ie, {
1666
+ label: e,
1667
+ items: [...n.sort((e, t) => e.tradingName.localeCompare(t.tradingName, "nb")).map((e) => ({
1668
+ value: e.organisationId,
1669
+ label: e.tradingName
1670
+ }))],
1671
+ selectedItem: o ? {
1672
+ value: o.organisationId,
1673
+ label: o.tradingName
1674
+ } : null,
1675
+ onChange: (e) => {
1676
+ e && r(e.value);
1677
+ },
1678
+ clearable: !1,
1679
+ ...a
1680
+ });
1681
+ }, xr = ({ collectionSize: e, pageSize: n, onPageChange: r, currentPage: i }) => /* @__PURE__ */ t(x, {
1682
+ pageCount: Math.ceil(e / n),
1683
+ currentPage: i,
1684
+ onPageChange: (e) => {
1685
+ r(e);
1686
+ }
1687
+ }), Sr = ({ title: e, suffix: t }) => {
1688
+ g(() => {
1689
+ t ? document.title = `${e}${t}` : document.title = e;
1690
+ }, [e, t]);
1691
+ }, Cr = ({ pathname: e, onBreadcrumbLookup: t, appTitle: n = "Entur Partner" }) => {
1692
+ let r = f(e).map((e) => ({
1693
+ title: t(e),
1694
+ path: e
1695
+ })).filter(({ title: e }) => e !== void 0).map(({ title: e }) => e).reverse().join(" | ");
1696
+ return Sr({ title: r ? `${r} | ${n}` : n }), null;
1697
+ }, wr = ({ children: n, fallback: r = null, permissions: o, oneOf: s = [], all: c = [] }) => {
1698
+ let l = i(c, o), u = a(s, o);
1699
+ return /* @__PURE__ */ t(e, { children: l && u ? n : r });
1700
+ }, Tr = ({ children: e, shouldBlockNavigation: n, ...i }) => {
1701
+ r(W() ? !0 : void 0, "RouteLeavingGuard must be used within a data router.");
1702
+ let a = Ut(({ currentLocation: e, nextLocation: t }) => e.pathname !== t.pathname && n(t));
1703
+ return /* @__PURE__ */ t(Qn, {
1704
+ onDismiss: () => {
1705
+ a.state === "blocked" && a.reset();
1706
+ },
1707
+ open: a.state === "blocked",
1708
+ onConfirm: () => {
1709
+ a.state === "blocked" && a.proceed();
1710
+ },
1711
+ ...i,
1712
+ children: e
1713
+ });
1714
+ }, Er = ({ active: e = !1, label: r = "", aggressiveInactive: i, showBullet: a, center: o }) => {
1715
+ let s = (0, A.default)("eps-status-label__bullet", {
1716
+ active: e,
1717
+ aggressive: i
1718
+ });
1719
+ return /* @__PURE__ */ n("div", {
1720
+ className: (0, A.default)("eps-status-label", { center: o }),
1721
+ children: [a && /* @__PURE__ */ t("div", { className: s }), /* @__PURE__ */ t("div", { children: r })]
1722
+ });
1723
+ }, Dr = ({ as: e = "span", children: n, fontSize: r, color: i, lineHeight: a, fontWeight: o, className: s, ...c }) => {
1724
+ let l = [];
1725
+ return r && l.push(...j("eps-font-size-", r)), a && l.push(...j("eps-line-height-", a)), o && l.push(`eps-font-weight-${o}`), /* @__PURE__ */ t(M, {
1726
+ as: e,
1727
+ color: i,
1728
+ className: (0, A.default)(l, s),
1729
+ ...c,
1730
+ children: n
1731
+ });
1732
+ }, Or = ({ children: e, className: n, ...r }) => /* @__PURE__ */ t(S, {
1733
+ variant: "primary",
1734
+ ...r,
1735
+ className: (0, A.default)("eps-unbutton", n),
1736
+ children: e
1737
+ });
1738
+ //#endregion
1739
+ //#region src/useEventListener.ts
1740
+ function kr(e, t, n = window) {
1741
+ let r = _(null);
1742
+ g(() => {
1743
+ r.current = t;
1744
+ }, [t]), g(() => {
1745
+ if (!n?.addEventListener) return;
1746
+ let t = ((e) => r.current?.(e));
1747
+ return n.addEventListener(e, t), () => {
1748
+ n.removeEventListener(e, t);
1749
+ };
1750
+ }, [e, n]);
1751
+ }
1752
+ //#endregion
1753
+ //#region src/user-menu/components/CustomOverflowMenuItem.tsx
1754
+ var $ = (e) => /* @__PURE__ */ t("button", {
1755
+ className: (0, A.default)(e.className, "eps-overflow-menu__item"),
1756
+ role: "menuitem",
1757
+ ...e
1758
+ }), Ar = ({ locale: e, onClick: r }) => /* @__PURE__ */ n($, {
1759
+ onClick: r,
1760
+ className: "eps-overflow-menu__item",
1761
+ children: [/* @__PURE__ */ t("span", {
1762
+ "aria-hidden": !0,
1763
+ children: /* @__PURE__ */ t(oe, {
1764
+ size: "1rem",
1765
+ inline: !0
1766
+ })
1767
+ }), e === "en-GB" ? "Cookie settings" : "Cookieinstillinger"]
1768
+ });
1769
+ //#endregion
1770
+ //#region src/user-menu/components/useOutsideClick.ts
1771
+ function jr(e, t, n) {
1772
+ g(() => {
1773
+ let r = (r) => {
1774
+ Mr(e.current, r) || Mr(t.current, r) || n();
1775
+ };
1776
+ return document.addEventListener("mousedown", r), document.addEventListener("touchstart", r), () => {
1777
+ document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r);
1778
+ };
1779
+ }, [
1780
+ e,
1781
+ t,
1782
+ n
1783
+ ]);
1784
+ }
1785
+ function Mr(e, t) {
1786
+ return e ? e.contains(t.target) ? !0 : t.composed && t.composedPath ? !!t.composedPath().find((t) => t === window ? !1 : e.contains(t)) : !1 : !1;
1787
+ }
1788
+ //#endregion
1789
+ //#region src/user-menu/components/CustomOverflowMenu.tsx
1790
+ var Nr = ({ className: e, children: r, userName: i, open: a, onOpenChange: o, environment: s, ...c }) => {
1791
+ let l = (0, A.default)("eps-overflow-menu__group", { "eps-overflow-menu__group--open": a }), u = _(null), d = _(null);
1792
+ return jr(u, d, () => o(!1)), /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t(T, {
1793
+ className: (0, A.default)("eps-overflow-menu__button", e),
1794
+ onClick: () => o(!a),
1795
+ "aria-haspopup": !0,
1796
+ "aria-expanded": a,
1797
+ ref: d,
1798
+ ...c,
1799
+ children: /* @__PURE__ */ n("div", {
1800
+ className: "eps-overflow-menu__button-contents",
1801
+ children: [
1802
+ /* @__PURE__ */ t("span", {
1803
+ className: "eds-overflow-menu__user-icon",
1804
+ children: /* @__PURE__ */ t(de, { inline: !0 })
1805
+ }),
1806
+ /* @__PURE__ */ n(ee, {
1807
+ margin: "none",
1808
+ as: "span",
1809
+ children: [i, s !== void 0 && s !== Q.Production && /* @__PURE__ */ n("span", {
1810
+ style: { color: tr(s) },
1811
+ children: [
1812
+ " ",
1813
+ "(",
1814
+ rr(s),
1815
+ ")"
1816
+ ]
1817
+ })]
1818
+ }),
1819
+ /* @__PURE__ */ t("span", {
1820
+ className: "eps-arrow-icon",
1821
+ children: /* @__PURE__ */ t(se, { inline: !0 })
1822
+ })
1823
+ ]
1824
+ })
1825
+ }), a && /* @__PURE__ */ t("div", {
1826
+ className: l,
1827
+ role: "menu",
1828
+ ref: u,
1829
+ children: r
1830
+ })] });
1831
+ }, Pr = ({ locale: r, onLocaleChange: i }) => /* @__PURE__ */ t(e, { children: r === "en-GB" ? /* @__PURE__ */ n($, {
1832
+ onClick: () => {
1833
+ i("nb-NO");
1834
+ },
1835
+ className: "eps-overflow-menu__item",
1836
+ children: [/* @__PURE__ */ t("span", {
1837
+ "aria-hidden": !0,
1838
+ className: "eps-overflow-menu__icon-margin",
1839
+ children: /* @__PURE__ */ t(le, {
1840
+ size: "1rem",
1841
+ inline: !0
1842
+ })
1843
+ }), "Bytt til norsk"]
1844
+ }) : /* @__PURE__ */ n($, {
1845
+ onClick: () => {
1846
+ i("en-GB");
1847
+ },
1848
+ className: "eps-overflow-menu__item",
1849
+ children: [/* @__PURE__ */ t("span", {
1850
+ "aria-hidden": !0,
1851
+ className: "eps-overflow-menu__icon-margin",
1852
+ children: /* @__PURE__ */ t(ue, {
1853
+ size: "1rem",
1854
+ inline: !0
1855
+ })
1856
+ }), "Switch to English"]
1857
+ }) }), Fr = ({ onClick: e, locale: r }) => /* @__PURE__ */ n($, {
1858
+ onClick: e,
1859
+ "data-testid": "user-menu-logout",
1860
+ className: "eps-overflow-menu__item",
1861
+ children: [/* @__PURE__ */ t("span", {
1862
+ "aria-hidden": !0,
1863
+ children: /* @__PURE__ */ t(ce, {
1864
+ size: "1rem",
1865
+ inline: !0
1866
+ })
1867
+ }), r === "en-GB" ? "Log out " : "Logg ut"]
1868
+ }), Ir = ({ locale: e, onClick: r }) => /* @__PURE__ */ n($, {
1869
+ onClick: r,
1870
+ className: "eps-overflow-menu__item",
1871
+ children: [/* @__PURE__ */ t("span", {
1872
+ "aria-hidden": !0,
1873
+ children: /* @__PURE__ */ t(de, {
1874
+ size: "1rem",
1875
+ inline: !0
1876
+ })
1877
+ }), e === "en-GB" ? "My profile" : "Min profil"]
1878
+ }), Lr = ({ locale: e, onClick: r }) => /* @__PURE__ */ n($, {
1879
+ onClick: r,
1880
+ className: "eps-overflow-menu__item",
1881
+ children: [/* @__PURE__ */ t("span", {
1882
+ "aria-hidden": !0,
1883
+ children: /* @__PURE__ */ t(ae, {
1884
+ className: "eps-version-icon",
1885
+ size: "1rem",
1886
+ inline: !0
1887
+ })
1888
+ }), e === "en-GB" ? "Version" : "Versjon"]
1889
+ }), Rr = ({ className: e, onLogout: r, onLocaleChange: i, userName: a, locale: o, environment: s, showVersionItem: c, showMyProfileItem: l, showCookieSettingsItem: u, onNavigateToMyProfile: d, onCookieSettingsOpen: f = () => {}, onVersionItemClick: p }) => {
1890
+ let [m, h] = v(!1);
1891
+ return /* @__PURE__ */ t("div", {
1892
+ id: "eps-user-menu",
1893
+ children: /* @__PURE__ */ t(Nr, {
1894
+ open: m,
1895
+ onOpenChange: h,
1896
+ className: (0, A.default)(["eps-user-menu__trigger-button", e]),
1897
+ userName: a,
1898
+ environment: s,
1899
+ children: /* @__PURE__ */ n("div", {
1900
+ id: "eps-overflow-menu",
1901
+ children: [
1902
+ /* @__PURE__ */ t(Pr, {
1903
+ locale: o,
1904
+ onLocaleChange: (e) => {
1905
+ i(e), h(!1);
1906
+ }
1907
+ }),
1908
+ c && /* @__PURE__ */ t(Lr, {
1909
+ locale: o,
1910
+ onClick: () => {
1911
+ p?.(), h(!1);
1912
+ }
1913
+ }),
1914
+ l && /* @__PURE__ */ t(Ir, {
1915
+ locale: o,
1916
+ onClick: () => {
1917
+ d(), h(!1);
1918
+ }
1919
+ }),
1920
+ u && /* @__PURE__ */ t(Ar, {
1921
+ locale: o,
1922
+ onClick: () => {
1923
+ f(), h(!1);
1924
+ }
1925
+ }),
1926
+ /* @__PURE__ */ t(Fr, {
1927
+ locale: o,
1928
+ onClick: () => {
1929
+ r(), h(!1);
1930
+ }
1931
+ })
1932
+ ]
1933
+ })
1934
+ })
1935
+ });
1936
+ };
1937
+ //#endregion
1938
+ export { Ce as ActionBar, xe as ActionBarLeft, Se as ActionBarRight, Te as AuditInfo, M as Box, Zn as Breadcrumbs, Qn as ConfirmModal, $n as Content, ar as EnturPartnerLogo, ir as EnturPartnerLogoSvg, Q as Environment, sr as ErrorBoundary, ur as ExpandableMultiLanguageInput, pr as FeatureToggle, mr as FormatCurrencyAmount, we as FormatDateTime, hr as LanguageSelect, gr as Link, _r as LinkButton, vr as Menu, yr as MultiLanguageInput, br as OrganisationDropDown, Cr as PageTitle, xr as Pager, wr as PermissionCheck, Tr as RouteLeavingGuard, N as Stack, Er as StatusLabel, Dr as Text, Or as Unbutton, Rr as UserMenu, dr as featureFlag, tr as getColorForEnvironment, rr as getHumanReadableEnvironment, j as responsiveProp, Sr as useDocumentTitle, kr as useEventListener, fr as useFeatureToggle };
1939
+
1940
+ //# sourceMappingURL=index.mjs.map