@hadoku/jobplatform 3.42.63 → 3.42.65

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.
@@ -0,0 +1,3861 @@
1
+ import { jsxs as g, jsx as s, Fragment as Ae } from "react/jsx-runtime";
2
+ import { createRoot as ua } from "react-dom/client";
3
+ import { logger as Ct } from "@wolffm/logger/client";
4
+ import * as u from "react";
5
+ import { useState as E, useRef as Pe, useEffect as Q, useCallback as oe, useMemo as de, Suspense as St, lazy as $e } from "react";
6
+ import { LoadingSkeleton as da, AppHeader as pa } from "@wolffm/task-ui-components";
7
+ import { HadokuThemeRoot as ha, useHadokuTheme as fa } from "@wolffm/themes";
8
+ var pt = "popstate";
9
+ function ht(e) {
10
+ return typeof e == "object" && e != null && "pathname" in e && "search" in e && "hash" in e && "state" in e && "key" in e;
11
+ }
12
+ function ma(e = {}) {
13
+ function t(r, o) {
14
+ let {
15
+ pathname: i = "/",
16
+ search: l = "",
17
+ hash: c = ""
18
+ } = ge(r.location.hash.substring(1));
19
+ return !i.startsWith("/") && !i.startsWith(".") && (i = "/" + i), Xe(
20
+ "",
21
+ { pathname: i, search: l, hash: c },
22
+ // state defaults to `null` because `window.history.state` does
23
+ o.state && o.state.usr || null,
24
+ o.state && o.state.key || "default"
25
+ );
26
+ }
27
+ function a(r, o) {
28
+ let i = r.document.querySelector("base"), l = "";
29
+ if (i && i.getAttribute("href")) {
30
+ let c = r.location.href, d = c.indexOf("#");
31
+ l = d === -1 ? c : c.slice(0, d);
32
+ }
33
+ return l + "#" + (typeof o == "string" ? o : Se(o));
34
+ }
35
+ function n(r, o) {
36
+ X(
37
+ r.pathname.charAt(0) === "/",
38
+ `relative pathnames are not supported in hash history.push(${JSON.stringify(
39
+ o
40
+ )})`
41
+ );
42
+ }
43
+ return ga(
44
+ t,
45
+ a,
46
+ n,
47
+ e
48
+ );
49
+ }
50
+ function B(e, t) {
51
+ if (e === !1 || e === null || typeof e > "u")
52
+ throw new Error(t);
53
+ }
54
+ function X(e, t) {
55
+ if (!e) {
56
+ typeof console < "u" && console.warn(t);
57
+ try {
58
+ throw new Error(t);
59
+ } catch {
60
+ }
61
+ }
62
+ }
63
+ function ya() {
64
+ return Math.random().toString(36).substring(2, 10);
65
+ }
66
+ function ft(e, t) {
67
+ return {
68
+ usr: e.state,
69
+ key: e.key,
70
+ idx: t,
71
+ masked: e.unstable_mask ? {
72
+ pathname: e.pathname,
73
+ search: e.search,
74
+ hash: e.hash
75
+ } : void 0
76
+ };
77
+ }
78
+ function Xe(e, t, a = null, n, r) {
79
+ return {
80
+ pathname: typeof e == "string" ? e : e.pathname,
81
+ search: "",
82
+ hash: "",
83
+ ...typeof t == "string" ? ge(t) : t,
84
+ state: a,
85
+ // TODO: This could be cleaned up. push/replace should probably just take
86
+ // full Locations now and avoid the need to run through this flow at all
87
+ // But that's a pretty big refactor to the current test suite so going to
88
+ // keep as is for the time being and just let any incoming keys take precedence
89
+ key: t && t.key || n || ya(),
90
+ unstable_mask: r
91
+ };
92
+ }
93
+ function Se({
94
+ pathname: e = "/",
95
+ search: t = "",
96
+ hash: a = ""
97
+ }) {
98
+ return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), a && a !== "#" && (e += a.charAt(0) === "#" ? a : "#" + a), e;
99
+ }
100
+ function ge(e) {
101
+ let t = {};
102
+ if (e) {
103
+ let a = e.indexOf("#");
104
+ a >= 0 && (t.hash = e.substring(a), e = e.substring(0, a));
105
+ let n = e.indexOf("?");
106
+ n >= 0 && (t.search = e.substring(n), e = e.substring(0, n)), e && (t.pathname = e);
107
+ }
108
+ return t;
109
+ }
110
+ function ga(e, t, a, n = {}) {
111
+ let { window: r = document.defaultView, v5Compat: o = !1 } = n, i = r.history, l = "POP", c = null, d = h();
112
+ d == null && (d = 0, i.replaceState({ ...i.state, idx: d }, ""));
113
+ function h() {
114
+ return (i.state || { idx: null }).idx;
115
+ }
116
+ function p() {
117
+ l = "POP";
118
+ let f = h(), j = f == null ? null : f - d;
119
+ d = f, c && c({ action: l, location: m.location, delta: j });
120
+ }
121
+ function v(f, j) {
122
+ l = "PUSH";
123
+ let w = ht(f) ? f : Xe(m.location, f, j);
124
+ a && a(w, f), d = h() + 1;
125
+ let R = ft(w, d), P = m.createHref(w.unstable_mask || w);
126
+ try {
127
+ i.pushState(R, "", P);
128
+ } catch (L) {
129
+ if (L instanceof DOMException && L.name === "DataCloneError")
130
+ throw L;
131
+ r.location.assign(P);
132
+ }
133
+ o && c && c({ action: l, location: m.location, delta: 1 });
134
+ }
135
+ function _(f, j) {
136
+ l = "REPLACE";
137
+ let w = ht(f) ? f : Xe(m.location, f, j);
138
+ a && a(w, f), d = h();
139
+ let R = ft(w, d), P = m.createHref(w.unstable_mask || w);
140
+ i.replaceState(R, "", P), o && c && c({ action: l, location: m.location, delta: 0 });
141
+ }
142
+ function b(f) {
143
+ return va(f);
144
+ }
145
+ let m = {
146
+ get action() {
147
+ return l;
148
+ },
149
+ get location() {
150
+ return e(r, i);
151
+ },
152
+ listen(f) {
153
+ if (c)
154
+ throw new Error("A history only accepts one active listener");
155
+ return r.addEventListener(pt, p), c = f, () => {
156
+ r.removeEventListener(pt, p), c = null;
157
+ };
158
+ },
159
+ createHref(f) {
160
+ return t(r, f);
161
+ },
162
+ createURL: b,
163
+ encodeLocation(f) {
164
+ let j = b(f);
165
+ return {
166
+ pathname: j.pathname,
167
+ search: j.search,
168
+ hash: j.hash
169
+ };
170
+ },
171
+ push: v,
172
+ replace: _,
173
+ go(f) {
174
+ return i.go(f);
175
+ }
176
+ };
177
+ return m;
178
+ }
179
+ function va(e, t = !1) {
180
+ let a = "http://localhost";
181
+ typeof window < "u" && (a = window.location.origin !== "null" ? window.location.origin : window.location.href), B(a, "No window.location.(origin|href) available to create URL");
182
+ let n = typeof e == "string" ? e : Se(e);
183
+ return n = n.replace(/ $/, "%20"), !t && n.startsWith("//") && (n = a + n), new URL(n, a);
184
+ }
185
+ function Pt(e, t, a = "/") {
186
+ return wa(e, t, a, !1);
187
+ }
188
+ function wa(e, t, a, n) {
189
+ let r = typeof t == "string" ? ge(t) : t, o = ce(r.pathname || "/", a);
190
+ if (o == null)
191
+ return null;
192
+ let i = $t(e);
193
+ _a(i);
194
+ let l = null;
195
+ for (let c = 0; l == null && c < i.length; ++c) {
196
+ let d = xa(o);
197
+ l = Pa(
198
+ i[c],
199
+ d,
200
+ n
201
+ );
202
+ }
203
+ return l;
204
+ }
205
+ function $t(e, t = [], a = [], n = "", r = !1) {
206
+ let o = (i, l, c = r, d) => {
207
+ let h = {
208
+ relativePath: d === void 0 ? i.path || "" : d,
209
+ caseSensitive: i.caseSensitive === !0,
210
+ childrenIndex: l,
211
+ route: i
212
+ };
213
+ if (h.relativePath.startsWith("/")) {
214
+ if (!h.relativePath.startsWith(n) && c)
215
+ return;
216
+ B(
217
+ h.relativePath.startsWith(n),
218
+ `Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
219
+ ), h.relativePath = h.relativePath.slice(n.length);
220
+ }
221
+ let p = re([n, h.relativePath]), v = a.concat(h);
222
+ i.children && i.children.length > 0 && (B(
223
+ // Our types know better, but runtime JS may not!
224
+ // @ts-expect-error
225
+ i.index !== !0,
226
+ `Index routes must not have child routes. Please remove all child routes from route path "${p}".`
227
+ ), $t(
228
+ i.children,
229
+ t,
230
+ v,
231
+ p,
232
+ c
233
+ )), !(i.path == null && !i.index) && t.push({
234
+ path: p,
235
+ score: Ca(p, i.index),
236
+ routesMeta: v
237
+ });
238
+ };
239
+ return e.forEach((i, l) => {
240
+ if (i.path === "" || !i.path?.includes("?"))
241
+ o(i, l);
242
+ else
243
+ for (let c of xt(i.path))
244
+ o(i, l, !0, c);
245
+ }), t;
246
+ }
247
+ function xt(e) {
248
+ let t = e.split("/");
249
+ if (t.length === 0) return [];
250
+ let [a, ...n] = t, r = a.endsWith("?"), o = a.replace(/\?$/, "");
251
+ if (n.length === 0)
252
+ return r ? [o, ""] : [o];
253
+ let i = xt(n.join("/")), l = [];
254
+ return l.push(
255
+ ...i.map(
256
+ (c) => c === "" ? o : [o, c].join("/")
257
+ )
258
+ ), r && l.push(...i), l.map(
259
+ (c) => e.startsWith("/") && c === "" ? "/" : c
260
+ );
261
+ }
262
+ function _a(e) {
263
+ e.sort(
264
+ (t, a) => t.score !== a.score ? a.score - t.score : Sa(
265
+ t.routesMeta.map((n) => n.childrenIndex),
266
+ a.routesMeta.map((n) => n.childrenIndex)
267
+ )
268
+ );
269
+ }
270
+ var ba = /^:[\w-]+$/, ka = 3, Ra = 2, ja = 1, Ea = 10, Na = -2, mt = (e) => e === "*";
271
+ function Ca(e, t) {
272
+ let a = e.split("/"), n = a.length;
273
+ return a.some(mt) && (n += Na), t && (n += Ra), a.filter((r) => !mt(r)).reduce(
274
+ (r, o) => r + (ba.test(o) ? ka : o === "" ? ja : Ea),
275
+ n
276
+ );
277
+ }
278
+ function Sa(e, t) {
279
+ return e.length === t.length && e.slice(0, -1).every((n, r) => n === t[r]) ? (
280
+ // If two routes are siblings, we should try to match the earlier sibling
281
+ // first. This allows people to have fine-grained control over the matching
282
+ // behavior by simply putting routes with identical paths in the order they
283
+ // want them tried.
284
+ e[e.length - 1] - t[t.length - 1]
285
+ ) : (
286
+ // Otherwise, it doesn't really make sense to rank non-siblings by index,
287
+ // so they sort equally.
288
+ 0
289
+ );
290
+ }
291
+ function Pa(e, t, a = !1) {
292
+ let { routesMeta: n } = e, r = {}, o = "/", i = [];
293
+ for (let l = 0; l < n.length; ++l) {
294
+ let c = n[l], d = l === n.length - 1, h = o === "/" ? t : t.slice(o.length) || "/", p = Ue(
295
+ { path: c.relativePath, caseSensitive: c.caseSensitive, end: d },
296
+ h
297
+ ), v = c.route;
298
+ if (!p && d && a && !n[n.length - 1].route.index && (p = Ue(
299
+ {
300
+ path: c.relativePath,
301
+ caseSensitive: c.caseSensitive,
302
+ end: !1
303
+ },
304
+ h
305
+ )), !p)
306
+ return null;
307
+ Object.assign(r, p.params), i.push({
308
+ // TODO: Can this as be avoided?
309
+ params: r,
310
+ pathname: re([o, p.pathname]),
311
+ pathnameBase: Oa(
312
+ re([o, p.pathnameBase])
313
+ ),
314
+ route: v
315
+ }), p.pathnameBase !== "/" && (o = re([o, p.pathnameBase]));
316
+ }
317
+ return i;
318
+ }
319
+ function Ue(e, t) {
320
+ typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
321
+ let [a, n] = $a(
322
+ e.path,
323
+ e.caseSensitive,
324
+ e.end
325
+ ), r = t.match(a);
326
+ if (!r) return null;
327
+ let o = r[0], i = o.replace(/(.)\/+$/, "$1"), l = r.slice(1);
328
+ return {
329
+ params: n.reduce(
330
+ (d, { paramName: h, isOptional: p }, v) => {
331
+ if (h === "*") {
332
+ let b = l[v] || "";
333
+ i = o.slice(0, o.length - b.length).replace(/(.)\/+$/, "$1");
334
+ }
335
+ const _ = l[v];
336
+ return p && !_ ? d[h] = void 0 : d[h] = (_ || "").replace(/%2F/g, "/"), d;
337
+ },
338
+ {}
339
+ ),
340
+ pathname: o,
341
+ pathnameBase: i,
342
+ pattern: e
343
+ };
344
+ }
345
+ function $a(e, t = !1, a = !0) {
346
+ X(
347
+ e === "*" || !e.endsWith("*") || e.endsWith("/*"),
348
+ `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(/\*$/, "/*")}".`
349
+ );
350
+ let n = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
351
+ /\/:([\w-]+)(\?)?/g,
352
+ (i, l, c, d, h) => {
353
+ if (n.push({ paramName: l, isOptional: c != null }), c) {
354
+ let p = h.charAt(d + i.length);
355
+ return p && p !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
356
+ }
357
+ return "/([^\\/]+)";
358
+ }
359
+ ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
360
+ return e.endsWith("*") ? (n.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : a ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, t ? void 0 : "i"), n];
361
+ }
362
+ function xa(e) {
363
+ try {
364
+ return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
365
+ } catch (t) {
366
+ return X(
367
+ !1,
368
+ `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}).`
369
+ ), e;
370
+ }
371
+ }
372
+ function ce(e, t) {
373
+ if (t === "/") return e;
374
+ if (!e.toLowerCase().startsWith(t.toLowerCase()))
375
+ return null;
376
+ let a = t.endsWith("/") ? t.length - 1 : t.length, n = e.charAt(a);
377
+ return n && n !== "/" ? null : e.slice(a) || "/";
378
+ }
379
+ var La = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
380
+ function Ta(e, t = "/") {
381
+ let {
382
+ pathname: a,
383
+ search: n = "",
384
+ hash: r = ""
385
+ } = typeof e == "string" ? ge(e) : e, o;
386
+ return a ? (a = Lt(a), a.startsWith("/") ? o = yt(a.substring(1), "/") : o = yt(a, t)) : o = t, {
387
+ pathname: o,
388
+ search: Da(n),
389
+ hash: Fa(r)
390
+ };
391
+ }
392
+ function yt(e, t) {
393
+ let a = Ie(t).split("/");
394
+ return e.split("/").forEach((r) => {
395
+ r === ".." ? a.length > 1 && a.pop() : r !== "." && a.push(r);
396
+ }), a.length > 1 ? a.join("/") : "/";
397
+ }
398
+ function Ke(e, t, a, n) {
399
+ return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
400
+ n
401
+ )}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
402
+ }
403
+ function Aa(e) {
404
+ return e.filter(
405
+ (t, a) => a === 0 || t.route.path && t.route.path.length > 0
406
+ );
407
+ }
408
+ function nt(e) {
409
+ let t = Aa(e);
410
+ return t.map(
411
+ (a, n) => n === t.length - 1 ? a.pathname : a.pathnameBase
412
+ );
413
+ }
414
+ function Me(e, t, a, n = !1) {
415
+ let r;
416
+ typeof e == "string" ? r = ge(e) : (r = { ...e }, B(
417
+ !r.pathname || !r.pathname.includes("?"),
418
+ Ke("?", "pathname", "search", r)
419
+ ), B(
420
+ !r.pathname || !r.pathname.includes("#"),
421
+ Ke("#", "pathname", "hash", r)
422
+ ), B(
423
+ !r.search || !r.search.includes("#"),
424
+ Ke("#", "search", "hash", r)
425
+ ));
426
+ let o = e === "" || r.pathname === "", i = o ? "/" : r.pathname, l;
427
+ if (i == null)
428
+ l = a;
429
+ else {
430
+ let p = t.length - 1;
431
+ if (!n && i.startsWith("..")) {
432
+ let v = i.split("/");
433
+ for (; v[0] === ".."; )
434
+ v.shift(), p -= 1;
435
+ r.pathname = v.join("/");
436
+ }
437
+ l = p >= 0 ? t[p] : "/";
438
+ }
439
+ let c = Ta(r, l), d = i && i !== "/" && i.endsWith("/"), h = (o || i === ".") && a.endsWith("/");
440
+ return !c.pathname.endsWith("/") && (d || h) && (c.pathname += "/"), c;
441
+ }
442
+ var Lt = (e) => e.replace(/\/\/+/g, "/"), re = (e) => Lt(e.join("/")), Ie = (e) => e.replace(/\/+$/, ""), Oa = (e) => Ie(e).replace(/^\/*/, "/"), Da = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Fa = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, Ua = class {
443
+ constructor(e, t, a, n = !1) {
444
+ this.status = e, this.statusText = t || "", this.internal = n, a instanceof Error ? (this.data = a.toString(), this.error = a) : this.data = a;
445
+ }
446
+ };
447
+ function Ia(e) {
448
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
449
+ }
450
+ function Ma(e) {
451
+ let t = e.map((a) => a.route.path).filter(Boolean);
452
+ return re(t) || "/";
453
+ }
454
+ var Tt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
455
+ function At(e, t) {
456
+ let a = e;
457
+ if (typeof a != "string" || !La.test(a))
458
+ return {
459
+ absoluteURL: void 0,
460
+ isExternal: !1,
461
+ to: a
462
+ };
463
+ let n = a, r = !1;
464
+ if (Tt)
465
+ try {
466
+ let o = new URL(window.location.href), i = a.startsWith("//") ? new URL(o.protocol + a) : new URL(a), l = ce(i.pathname, t);
467
+ i.origin === o.origin && l != null ? a = l + i.search + i.hash : r = !0;
468
+ } catch {
469
+ X(
470
+ !1,
471
+ `<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
472
+ );
473
+ }
474
+ return {
475
+ absoluteURL: n,
476
+ isExternal: r,
477
+ to: a
478
+ };
479
+ }
480
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
481
+ var Ot = [
482
+ "POST",
483
+ "PUT",
484
+ "PATCH",
485
+ "DELETE"
486
+ ];
487
+ new Set(
488
+ Ot
489
+ );
490
+ var Ba = [
491
+ "GET",
492
+ ...Ot
493
+ ];
494
+ new Set(Ba);
495
+ var je = u.createContext(null);
496
+ je.displayName = "DataRouter";
497
+ var Be = u.createContext(null);
498
+ Be.displayName = "DataRouterState";
499
+ var Dt = u.createContext(!1);
500
+ function Ha() {
501
+ return u.useContext(Dt);
502
+ }
503
+ var Ft = u.createContext({
504
+ isTransitioning: !1
505
+ });
506
+ Ft.displayName = "ViewTransition";
507
+ var Wa = u.createContext(
508
+ /* @__PURE__ */ new Map()
509
+ );
510
+ Wa.displayName = "Fetchers";
511
+ var Ja = u.createContext(null);
512
+ Ja.displayName = "Await";
513
+ var Z = u.createContext(
514
+ null
515
+ );
516
+ Z.displayName = "Navigation";
517
+ var xe = u.createContext(
518
+ null
519
+ );
520
+ xe.displayName = "Location";
521
+ var ae = u.createContext({
522
+ outlet: null,
523
+ matches: [],
524
+ isDataRoute: !1
525
+ });
526
+ ae.displayName = "Route";
527
+ var rt = u.createContext(null);
528
+ rt.displayName = "RouteError";
529
+ var Ut = "REACT_ROUTER_ERROR", qa = "REDIRECT", Ka = "ROUTE_ERROR_RESPONSE";
530
+ function Va(e) {
531
+ if (e.startsWith(`${Ut}:${qa}:{`))
532
+ try {
533
+ let t = JSON.parse(e.slice(28));
534
+ 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")
535
+ return t;
536
+ } catch {
537
+ }
538
+ }
539
+ function Ga(e) {
540
+ if (e.startsWith(
541
+ `${Ut}:${Ka}:{`
542
+ ))
543
+ try {
544
+ let t = JSON.parse(e.slice(40));
545
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string")
546
+ return new Ua(
547
+ t.status,
548
+ t.statusText,
549
+ t.data
550
+ );
551
+ } catch {
552
+ }
553
+ }
554
+ function za(e, { relative: t } = {}) {
555
+ B(
556
+ Ee(),
557
+ // TODO: This error is probably because they somehow have 2 versions of the
558
+ // router loaded. We can help them understand how to avoid that.
559
+ "useHref() may be used only in the context of a <Router> component."
560
+ );
561
+ let { basename: a, navigator: n } = u.useContext(Z), { hash: r, pathname: o, search: i } = Le(e, { relative: t }), l = o;
562
+ return a !== "/" && (l = o === "/" ? a : re([a, o])), n.createHref({ pathname: l, search: i, hash: r });
563
+ }
564
+ function Ee() {
565
+ return u.useContext(xe) != null;
566
+ }
567
+ function ee() {
568
+ return B(
569
+ Ee(),
570
+ // TODO: This error is probably because they somehow have 2 versions of the
571
+ // router loaded. We can help them understand how to avoid that.
572
+ "useLocation() may be used only in the context of a <Router> component."
573
+ ), u.useContext(xe).location;
574
+ }
575
+ var It = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
576
+ function Mt(e) {
577
+ u.useContext(Z).static || u.useLayoutEffect(e);
578
+ }
579
+ function pe() {
580
+ let { isDataRoute: e } = u.useContext(ae);
581
+ return e ? dn() : Ya();
582
+ }
583
+ function Ya() {
584
+ B(
585
+ Ee(),
586
+ // TODO: This error is probably because they somehow have 2 versions of the
587
+ // router loaded. We can help them understand how to avoid that.
588
+ "useNavigate() may be used only in the context of a <Router> component."
589
+ );
590
+ let e = u.useContext(je), { basename: t, navigator: a } = u.useContext(Z), { matches: n } = u.useContext(ae), { pathname: r } = ee(), o = JSON.stringify(nt(n)), i = u.useRef(!1);
591
+ return Mt(() => {
592
+ i.current = !0;
593
+ }), u.useCallback(
594
+ (c, d = {}) => {
595
+ if (X(i.current, It), !i.current) return;
596
+ if (typeof c == "number") {
597
+ a.go(c);
598
+ return;
599
+ }
600
+ let h = Me(
601
+ c,
602
+ JSON.parse(o),
603
+ r,
604
+ d.relative === "path"
605
+ );
606
+ e == null && t !== "/" && (h.pathname = h.pathname === "/" ? t : re([t, h.pathname])), (d.replace ? a.replace : a.push)(
607
+ h,
608
+ d.state,
609
+ d
610
+ );
611
+ },
612
+ [
613
+ t,
614
+ a,
615
+ o,
616
+ r,
617
+ e
618
+ ]
619
+ );
620
+ }
621
+ var Bt = u.createContext(null);
622
+ function Qa() {
623
+ return u.useContext(Bt);
624
+ }
625
+ function Xa(e) {
626
+ let t = u.useContext(ae).outlet;
627
+ return u.useMemo(
628
+ () => t && /* @__PURE__ */ u.createElement(Bt.Provider, { value: e }, t),
629
+ [t, e]
630
+ );
631
+ }
632
+ function Ht() {
633
+ let { matches: e } = u.useContext(ae), t = e[e.length - 1];
634
+ return t ? t.params : {};
635
+ }
636
+ function Le(e, { relative: t } = {}) {
637
+ let { matches: a } = u.useContext(ae), { pathname: n } = ee(), r = JSON.stringify(nt(a));
638
+ return u.useMemo(
639
+ () => Me(
640
+ e,
641
+ JSON.parse(r),
642
+ n,
643
+ t === "path"
644
+ ),
645
+ [e, r, n, t]
646
+ );
647
+ }
648
+ function Za(e, t) {
649
+ return Wt(e, t);
650
+ }
651
+ function Wt(e, t, a) {
652
+ B(
653
+ Ee(),
654
+ // TODO: This error is probably because they somehow have 2 versions of the
655
+ // router loaded. We can help them understand how to avoid that.
656
+ "useRoutes() may be used only in the context of a <Router> component."
657
+ );
658
+ let { navigator: n } = u.useContext(Z), { matches: r } = u.useContext(ae), o = r[r.length - 1], i = o ? o.params : {}, l = o ? o.pathname : "/", c = o ? o.pathnameBase : "/", d = o && o.route;
659
+ {
660
+ let f = d && d.path || "";
661
+ qt(
662
+ l,
663
+ !d || f.endsWith("*") || f.endsWith("*?"),
664
+ `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) 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.
665
+
666
+ Please change the parent <Route path="${f}"> to <Route path="${f === "/" ? "*" : `${f}/*`}">.`
667
+ );
668
+ }
669
+ let h = ee(), p;
670
+ if (t) {
671
+ let f = typeof t == "string" ? ge(t) : t;
672
+ B(
673
+ c === "/" || f.pathname?.startsWith(c),
674
+ `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 "${f.pathname}" was given in the \`location\` prop.`
675
+ ), p = f;
676
+ } else
677
+ p = h;
678
+ let v = p.pathname || "/", _ = v;
679
+ if (c !== "/") {
680
+ let f = c.replace(/^\//, "").split("/");
681
+ _ = "/" + v.replace(/^\//, "").split("/").slice(f.length).join("/");
682
+ }
683
+ let b = Pt(e, { pathname: _ });
684
+ X(
685
+ d || b != null,
686
+ `No routes matched location "${p.pathname}${p.search}${p.hash}" `
687
+ ), X(
688
+ b == null || b[b.length - 1].route.element !== void 0 || b[b.length - 1].route.Component !== void 0 || b[b.length - 1].route.lazy !== void 0,
689
+ `Matched leaf route at location "${p.pathname}${p.search}${p.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.`
690
+ );
691
+ let m = rn(
692
+ b && b.map(
693
+ (f) => Object.assign({}, f, {
694
+ params: Object.assign({}, i, f.params),
695
+ pathname: re([
696
+ c,
697
+ // Re-encode pathnames that were decoded inside matchRoutes.
698
+ // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
699
+ // `new URL()` internally and we need to prevent it from treating
700
+ // them as separators
701
+ n.encodeLocation ? n.encodeLocation(
702
+ f.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
703
+ ).pathname : f.pathname
704
+ ]),
705
+ pathnameBase: f.pathnameBase === "/" ? c : re([
706
+ c,
707
+ // Re-encode pathnames that were decoded inside matchRoutes
708
+ // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
709
+ // `new URL()` internally and we need to prevent it from treating
710
+ // them as separators
711
+ n.encodeLocation ? n.encodeLocation(
712
+ f.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
713
+ ).pathname : f.pathnameBase
714
+ ])
715
+ })
716
+ ),
717
+ r,
718
+ a
719
+ );
720
+ return t && m ? /* @__PURE__ */ u.createElement(
721
+ xe.Provider,
722
+ {
723
+ value: {
724
+ location: {
725
+ pathname: "/",
726
+ search: "",
727
+ hash: "",
728
+ state: null,
729
+ key: "default",
730
+ unstable_mask: void 0,
731
+ ...p
732
+ },
733
+ navigationType: "POP"
734
+ /* Pop */
735
+ }
736
+ },
737
+ m
738
+ ) : m;
739
+ }
740
+ function en() {
741
+ let e = un(), t = Ia(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), a = e instanceof Error ? e.stack : null, n = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: n }, o = { padding: "2px 4px", backgroundColor: n }, i = null;
742
+ return console.error(
743
+ "Error handled by React Router default ErrorBoundary:",
744
+ e
745
+ ), i = /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ u.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ u.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ u.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ u.createElement("h3", { style: { fontStyle: "italic" } }, t), a ? /* @__PURE__ */ u.createElement("pre", { style: r }, a) : null, i);
746
+ }
747
+ var tn = /* @__PURE__ */ u.createElement(en, null), Jt = class extends u.Component {
748
+ constructor(e) {
749
+ super(e), this.state = {
750
+ location: e.location,
751
+ revalidation: e.revalidation,
752
+ error: e.error
753
+ };
754
+ }
755
+ static getDerivedStateFromError(e) {
756
+ return { error: e };
757
+ }
758
+ static getDerivedStateFromProps(e, t) {
759
+ return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
760
+ error: e.error,
761
+ location: e.location,
762
+ revalidation: e.revalidation
763
+ } : {
764
+ error: e.error !== void 0 ? e.error : t.error,
765
+ location: t.location,
766
+ revalidation: e.revalidation || t.revalidation
767
+ };
768
+ }
769
+ componentDidCatch(e, t) {
770
+ this.props.onError ? this.props.onError(e, t) : console.error(
771
+ "React Router caught the following error during render",
772
+ e
773
+ );
774
+ }
775
+ render() {
776
+ let e = this.state.error;
777
+ if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
778
+ const a = Ga(e.digest);
779
+ a && (e = a);
780
+ }
781
+ let t = e !== void 0 ? /* @__PURE__ */ u.createElement(ae.Provider, { value: this.props.routeContext }, /* @__PURE__ */ u.createElement(
782
+ rt.Provider,
783
+ {
784
+ value: e,
785
+ children: this.props.component
786
+ }
787
+ )) : this.props.children;
788
+ return this.context ? /* @__PURE__ */ u.createElement(an, { error: e }, t) : t;
789
+ }
790
+ };
791
+ Jt.contextType = Dt;
792
+ var Ve = /* @__PURE__ */ new WeakMap();
793
+ function an({
794
+ children: e,
795
+ error: t
796
+ }) {
797
+ let { basename: a } = u.useContext(Z);
798
+ if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
799
+ let n = Va(t.digest);
800
+ if (n) {
801
+ let r = Ve.get(t);
802
+ if (r) throw r;
803
+ let o = At(n.location, a);
804
+ if (Tt && !Ve.get(t))
805
+ if (o.isExternal || n.reloadDocument)
806
+ window.location.href = o.absoluteURL || o.to;
807
+ else {
808
+ const i = Promise.resolve().then(
809
+ () => window.__reactRouterDataRouter.navigate(o.to, {
810
+ replace: n.replace
811
+ })
812
+ );
813
+ throw Ve.set(t, i), i;
814
+ }
815
+ return /* @__PURE__ */ u.createElement(
816
+ "meta",
817
+ {
818
+ httpEquiv: "refresh",
819
+ content: `0;url=${o.absoluteURL || o.to}`
820
+ }
821
+ );
822
+ }
823
+ }
824
+ return e;
825
+ }
826
+ function nn({ routeContext: e, match: t, children: a }) {
827
+ let n = u.useContext(je);
828
+ return n && n.static && n.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (n.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ u.createElement(ae.Provider, { value: e }, a);
829
+ }
830
+ function rn(e, t = [], a) {
831
+ let n = a?.state;
832
+ if (e == null) {
833
+ if (!n)
834
+ return null;
835
+ if (n.errors)
836
+ e = n.matches;
837
+ else if (t.length === 0 && !n.initialized && n.matches.length > 0)
838
+ e = n.matches;
839
+ else
840
+ return null;
841
+ }
842
+ let r = e, o = n?.errors;
843
+ if (o != null) {
844
+ let h = r.findIndex(
845
+ (p) => p.route.id && o?.[p.route.id] !== void 0
846
+ );
847
+ B(
848
+ h >= 0,
849
+ `Could not find a matching route for errors on route IDs: ${Object.keys(
850
+ o
851
+ ).join(",")}`
852
+ ), r = r.slice(
853
+ 0,
854
+ Math.min(r.length, h + 1)
855
+ );
856
+ }
857
+ let i = !1, l = -1;
858
+ if (a && n) {
859
+ i = n.renderFallback;
860
+ for (let h = 0; h < r.length; h++) {
861
+ let p = r[h];
862
+ if ((p.route.HydrateFallback || p.route.hydrateFallbackElement) && (l = h), p.route.id) {
863
+ let { loaderData: v, errors: _ } = n, b = p.route.loader && !v.hasOwnProperty(p.route.id) && (!_ || _[p.route.id] === void 0);
864
+ if (p.route.lazy || b) {
865
+ a.isStatic && (i = !0), l >= 0 ? r = r.slice(0, l + 1) : r = [r[0]];
866
+ break;
867
+ }
868
+ }
869
+ }
870
+ }
871
+ let c = a?.onError, d = n && c ? (h, p) => {
872
+ c(h, {
873
+ location: n.location,
874
+ params: n.matches?.[0]?.params ?? {},
875
+ unstable_pattern: Ma(n.matches),
876
+ errorInfo: p
877
+ });
878
+ } : void 0;
879
+ return r.reduceRight(
880
+ (h, p, v) => {
881
+ let _, b = !1, m = null, f = null;
882
+ n && (_ = o && p.route.id ? o[p.route.id] : void 0, m = p.route.errorElement || tn, i && (l < 0 && v === 0 ? (qt(
883
+ "route-fallback",
884
+ !1,
885
+ "No `HydrateFallback` element provided to render during initial hydration"
886
+ ), b = !0, f = null) : l === v && (b = !0, f = p.route.hydrateFallbackElement || null)));
887
+ let j = t.concat(r.slice(0, v + 1)), w = () => {
888
+ let R;
889
+ return _ ? R = m : b ? R = f : p.route.Component ? R = /* @__PURE__ */ u.createElement(p.route.Component, null) : p.route.element ? R = p.route.element : R = h, /* @__PURE__ */ u.createElement(
890
+ nn,
891
+ {
892
+ match: p,
893
+ routeContext: {
894
+ outlet: h,
895
+ matches: j,
896
+ isDataRoute: n != null
897
+ },
898
+ children: R
899
+ }
900
+ );
901
+ };
902
+ return n && (p.route.ErrorBoundary || p.route.errorElement || v === 0) ? /* @__PURE__ */ u.createElement(
903
+ Jt,
904
+ {
905
+ location: n.location,
906
+ revalidation: n.revalidation,
907
+ component: m,
908
+ error: _,
909
+ children: w(),
910
+ routeContext: { outlet: null, matches: j, isDataRoute: !0 },
911
+ onError: d
912
+ }
913
+ ) : w();
914
+ },
915
+ null
916
+ );
917
+ }
918
+ function ot(e) {
919
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
920
+ }
921
+ function on(e) {
922
+ let t = u.useContext(je);
923
+ return B(t, ot(e)), t;
924
+ }
925
+ function sn(e) {
926
+ let t = u.useContext(Be);
927
+ return B(t, ot(e)), t;
928
+ }
929
+ function ln(e) {
930
+ let t = u.useContext(ae);
931
+ return B(t, ot(e)), t;
932
+ }
933
+ function st(e) {
934
+ let t = ln(e), a = t.matches[t.matches.length - 1];
935
+ return B(
936
+ a.route.id,
937
+ `${e} can only be used on routes that contain a unique "id"`
938
+ ), a.route.id;
939
+ }
940
+ function cn() {
941
+ return st(
942
+ "useRouteId"
943
+ /* UseRouteId */
944
+ );
945
+ }
946
+ function un() {
947
+ let e = u.useContext(rt), t = sn(
948
+ "useRouteError"
949
+ /* UseRouteError */
950
+ ), a = st(
951
+ "useRouteError"
952
+ /* UseRouteError */
953
+ );
954
+ return e !== void 0 ? e : t.errors?.[a];
955
+ }
956
+ function dn() {
957
+ let { router: e } = on(
958
+ "useNavigate"
959
+ /* UseNavigateStable */
960
+ ), t = st(
961
+ "useNavigate"
962
+ /* UseNavigateStable */
963
+ ), a = u.useRef(!1);
964
+ return Mt(() => {
965
+ a.current = !0;
966
+ }), u.useCallback(
967
+ async (r, o = {}) => {
968
+ X(a.current, It), a.current && (typeof r == "number" ? await e.navigate(r) : await e.navigate(r, { fromRouteId: t, ...o }));
969
+ },
970
+ [e, t]
971
+ );
972
+ }
973
+ var gt = {};
974
+ function qt(e, t, a) {
975
+ !t && !gt[e] && (gt[e] = !0, X(!1, a));
976
+ }
977
+ u.memo(pn);
978
+ function pn({
979
+ routes: e,
980
+ future: t,
981
+ state: a,
982
+ isStatic: n,
983
+ onError: r
984
+ }) {
985
+ return Wt(e, void 0, { state: a, isStatic: n, onError: r });
986
+ }
987
+ function Kt({
988
+ to: e,
989
+ replace: t,
990
+ state: a,
991
+ relative: n
992
+ }) {
993
+ B(
994
+ Ee(),
995
+ // TODO: This error is probably because they somehow have 2 versions of
996
+ // the router loaded. We can help them understand how to avoid that.
997
+ "<Navigate> may be used only in the context of a <Router> component."
998
+ );
999
+ let { static: r } = u.useContext(Z);
1000
+ X(
1001
+ !r,
1002
+ "<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change."
1003
+ );
1004
+ let { matches: o } = u.useContext(ae), { pathname: i } = ee(), l = pe(), c = Me(
1005
+ e,
1006
+ nt(o),
1007
+ i,
1008
+ n === "path"
1009
+ ), d = JSON.stringify(c);
1010
+ return u.useEffect(() => {
1011
+ l(JSON.parse(d), { replace: t, state: a, relative: n });
1012
+ }, [l, d, n, t, a]), null;
1013
+ }
1014
+ function Vt(e) {
1015
+ return Xa(e.context);
1016
+ }
1017
+ function ne(e) {
1018
+ B(
1019
+ !1,
1020
+ "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."
1021
+ );
1022
+ }
1023
+ function hn({
1024
+ basename: e = "/",
1025
+ children: t = null,
1026
+ location: a,
1027
+ navigationType: n = "POP",
1028
+ navigator: r,
1029
+ static: o = !1,
1030
+ unstable_useTransitions: i
1031
+ }) {
1032
+ B(
1033
+ !Ee(),
1034
+ "You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
1035
+ );
1036
+ let l = e.replace(/^\/*/, "/"), c = u.useMemo(
1037
+ () => ({
1038
+ basename: l,
1039
+ navigator: r,
1040
+ static: o,
1041
+ unstable_useTransitions: i,
1042
+ future: {}
1043
+ }),
1044
+ [l, r, o, i]
1045
+ );
1046
+ typeof a == "string" && (a = ge(a));
1047
+ let {
1048
+ pathname: d = "/",
1049
+ search: h = "",
1050
+ hash: p = "",
1051
+ state: v = null,
1052
+ key: _ = "default",
1053
+ unstable_mask: b
1054
+ } = a, m = u.useMemo(() => {
1055
+ let f = ce(d, l);
1056
+ return f == null ? null : {
1057
+ location: {
1058
+ pathname: f,
1059
+ search: h,
1060
+ hash: p,
1061
+ state: v,
1062
+ key: _,
1063
+ unstable_mask: b
1064
+ },
1065
+ navigationType: n
1066
+ };
1067
+ }, [
1068
+ l,
1069
+ d,
1070
+ h,
1071
+ p,
1072
+ v,
1073
+ _,
1074
+ n,
1075
+ b
1076
+ ]);
1077
+ return X(
1078
+ m != null,
1079
+ `<Router basename="${l}"> is not able to match the URL "${d}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`
1080
+ ), m == null ? null : /* @__PURE__ */ u.createElement(Z.Provider, { value: c }, /* @__PURE__ */ u.createElement(xe.Provider, { children: t, value: m }));
1081
+ }
1082
+ function fn({
1083
+ children: e,
1084
+ location: t
1085
+ }) {
1086
+ return Za(Ze(e), t);
1087
+ }
1088
+ function Ze(e, t = []) {
1089
+ let a = [];
1090
+ return u.Children.forEach(e, (n, r) => {
1091
+ if (!u.isValidElement(n))
1092
+ return;
1093
+ let o = [...t, r];
1094
+ if (n.type === u.Fragment) {
1095
+ a.push.apply(
1096
+ a,
1097
+ Ze(n.props.children, o)
1098
+ );
1099
+ return;
1100
+ }
1101
+ B(
1102
+ n.type === ne,
1103
+ `[${typeof n.type == "string" ? n.type : n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
1104
+ ), B(
1105
+ !n.props.index || !n.props.children,
1106
+ "An index route cannot have child routes."
1107
+ );
1108
+ let i = {
1109
+ id: n.props.id || o.join("-"),
1110
+ caseSensitive: n.props.caseSensitive,
1111
+ element: n.props.element,
1112
+ Component: n.props.Component,
1113
+ index: n.props.index,
1114
+ path: n.props.path,
1115
+ middleware: n.props.middleware,
1116
+ loader: n.props.loader,
1117
+ action: n.props.action,
1118
+ hydrateFallbackElement: n.props.hydrateFallbackElement,
1119
+ HydrateFallback: n.props.HydrateFallback,
1120
+ errorElement: n.props.errorElement,
1121
+ ErrorBoundary: n.props.ErrorBoundary,
1122
+ hasErrorBoundary: n.props.hasErrorBoundary === !0 || n.props.ErrorBoundary != null || n.props.errorElement != null,
1123
+ shouldRevalidate: n.props.shouldRevalidate,
1124
+ handle: n.props.handle,
1125
+ lazy: n.props.lazy
1126
+ };
1127
+ n.props.children && (i.children = Ze(
1128
+ n.props.children,
1129
+ o
1130
+ )), a.push(i);
1131
+ }), a;
1132
+ }
1133
+ var Oe = "get", De = "application/x-www-form-urlencoded";
1134
+ function He(e) {
1135
+ return typeof HTMLElement < "u" && e instanceof HTMLElement;
1136
+ }
1137
+ function mn(e) {
1138
+ return He(e) && e.tagName.toLowerCase() === "button";
1139
+ }
1140
+ function yn(e) {
1141
+ return He(e) && e.tagName.toLowerCase() === "form";
1142
+ }
1143
+ function gn(e) {
1144
+ return He(e) && e.tagName.toLowerCase() === "input";
1145
+ }
1146
+ function vn(e) {
1147
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
1148
+ }
1149
+ function wn(e, t) {
1150
+ return e.button === 0 && // Ignore everything but left clicks
1151
+ (!t || t === "_self") && // Let browser handle "target=_blank" etc.
1152
+ !vn(e);
1153
+ }
1154
+ function et(e = "") {
1155
+ return new URLSearchParams(
1156
+ typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, a) => {
1157
+ let n = e[a];
1158
+ return t.concat(
1159
+ Array.isArray(n) ? n.map((r) => [a, r]) : [[a, n]]
1160
+ );
1161
+ }, [])
1162
+ );
1163
+ }
1164
+ function _n(e, t) {
1165
+ let a = et(e);
1166
+ return t && t.forEach((n, r) => {
1167
+ a.has(r) || t.getAll(r).forEach((o) => {
1168
+ a.append(r, o);
1169
+ });
1170
+ }), a;
1171
+ }
1172
+ var Te = null;
1173
+ function bn() {
1174
+ if (Te === null)
1175
+ try {
1176
+ new FormData(
1177
+ document.createElement("form"),
1178
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
1179
+ 0
1180
+ ), Te = !1;
1181
+ } catch {
1182
+ Te = !0;
1183
+ }
1184
+ return Te;
1185
+ }
1186
+ var kn = /* @__PURE__ */ new Set([
1187
+ "application/x-www-form-urlencoded",
1188
+ "multipart/form-data",
1189
+ "text/plain"
1190
+ ]);
1191
+ function Ge(e) {
1192
+ return e != null && !kn.has(e) ? (X(
1193
+ !1,
1194
+ `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${De}"`
1195
+ ), null) : e;
1196
+ }
1197
+ function Rn(e, t) {
1198
+ let a, n, r, o, i;
1199
+ if (yn(e)) {
1200
+ let l = e.getAttribute("action");
1201
+ n = l ? ce(l, t) : null, a = e.getAttribute("method") || Oe, r = Ge(e.getAttribute("enctype")) || De, o = new FormData(e);
1202
+ } else if (mn(e) || gn(e) && (e.type === "submit" || e.type === "image")) {
1203
+ let l = e.form;
1204
+ if (l == null)
1205
+ throw new Error(
1206
+ 'Cannot submit a <button> or <input type="submit"> without a <form>'
1207
+ );
1208
+ let c = e.getAttribute("formaction") || l.getAttribute("action");
1209
+ if (n = c ? ce(c, t) : null, a = e.getAttribute("formmethod") || l.getAttribute("method") || Oe, r = Ge(e.getAttribute("formenctype")) || Ge(l.getAttribute("enctype")) || De, o = new FormData(l, e), !bn()) {
1210
+ let { name: d, type: h, value: p } = e;
1211
+ if (h === "image") {
1212
+ let v = d ? `${d}.` : "";
1213
+ o.append(`${v}x`, "0"), o.append(`${v}y`, "0");
1214
+ } else d && o.append(d, p);
1215
+ }
1216
+ } else {
1217
+ if (He(e))
1218
+ throw new Error(
1219
+ 'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
1220
+ );
1221
+ a = Oe, n = null, r = De, i = e;
1222
+ }
1223
+ return o && r === "text/plain" && (i = o, o = void 0), { action: n, method: a.toLowerCase(), encType: r, formData: o, body: i };
1224
+ }
1225
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1226
+ function it(e, t) {
1227
+ if (e === !1 || e === null || typeof e > "u")
1228
+ throw new Error(t);
1229
+ }
1230
+ function Gt(e, t, a, n) {
1231
+ let r = typeof e == "string" ? new URL(
1232
+ e,
1233
+ // This can be called during the SSR flow via PrefetchPageLinksImpl so
1234
+ // don't assume window is available
1235
+ typeof window > "u" ? "server://singlefetch/" : window.location.origin
1236
+ ) : e;
1237
+ return a ? r.pathname.endsWith("/") ? r.pathname = `${r.pathname}_.${n}` : r.pathname = `${r.pathname}.${n}` : r.pathname === "/" ? r.pathname = `_root.${n}` : t && ce(r.pathname, t) === "/" ? r.pathname = `${Ie(t)}/_root.${n}` : r.pathname = `${Ie(r.pathname)}.${n}`, r;
1238
+ }
1239
+ async function jn(e, t) {
1240
+ if (e.id in t)
1241
+ return t[e.id];
1242
+ try {
1243
+ let a = await import(
1244
+ /* @vite-ignore */
1245
+ /* webpackIgnore: true */
1246
+ e.module
1247
+ );
1248
+ return t[e.id] = a, a;
1249
+ } catch (a) {
1250
+ return console.error(
1251
+ `Error loading route module \`${e.module}\`, reloading page...`
1252
+ ), console.error(a), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
1253
+ });
1254
+ }
1255
+ }
1256
+ function En(e) {
1257
+ 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";
1258
+ }
1259
+ async function Nn(e, t, a) {
1260
+ let n = await Promise.all(
1261
+ e.map(async (r) => {
1262
+ let o = t.routes[r.route.id];
1263
+ if (o) {
1264
+ let i = await jn(o, a);
1265
+ return i.links ? i.links() : [];
1266
+ }
1267
+ return [];
1268
+ })
1269
+ );
1270
+ return $n(
1271
+ n.flat(1).filter(En).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
1272
+ (r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
1273
+ )
1274
+ );
1275
+ }
1276
+ function vt(e, t, a, n, r, o) {
1277
+ let i = (c, d) => a[d] ? c.route.id !== a[d].route.id : !0, l = (c, d) => (
1278
+ // param change, /users/123 -> /users/456
1279
+ a[d].pathname !== c.pathname || // splat param changed, which is not present in match.path
1280
+ // e.g. /files/images/avatar.jpg -> files/finances.xls
1281
+ a[d].route.path?.endsWith("*") && a[d].params["*"] !== c.params["*"]
1282
+ );
1283
+ return o === "assets" ? t.filter(
1284
+ (c, d) => i(c, d) || l(c, d)
1285
+ ) : o === "data" ? t.filter((c, d) => {
1286
+ let h = n.routes[c.route.id];
1287
+ if (!h || !h.hasLoader)
1288
+ return !1;
1289
+ if (i(c, d) || l(c, d))
1290
+ return !0;
1291
+ if (c.route.shouldRevalidate) {
1292
+ let p = c.route.shouldRevalidate({
1293
+ currentUrl: new URL(
1294
+ r.pathname + r.search + r.hash,
1295
+ window.origin
1296
+ ),
1297
+ currentParams: a[0]?.params || {},
1298
+ nextUrl: new URL(e, window.origin),
1299
+ nextParams: c.params,
1300
+ defaultShouldRevalidate: !0
1301
+ });
1302
+ if (typeof p == "boolean")
1303
+ return p;
1304
+ }
1305
+ return !0;
1306
+ }) : [];
1307
+ }
1308
+ function Cn(e, t, { includeHydrateFallback: a } = {}) {
1309
+ return Sn(
1310
+ e.map((n) => {
1311
+ let r = t.routes[n.route.id];
1312
+ if (!r) return [];
1313
+ let o = [r.module];
1314
+ return r.clientActionModule && (o = o.concat(r.clientActionModule)), r.clientLoaderModule && (o = o.concat(r.clientLoaderModule)), a && r.hydrateFallbackModule && (o = o.concat(r.hydrateFallbackModule)), r.imports && (o = o.concat(r.imports)), o;
1315
+ }).flat(1)
1316
+ );
1317
+ }
1318
+ function Sn(e) {
1319
+ return [...new Set(e)];
1320
+ }
1321
+ function Pn(e) {
1322
+ let t = {}, a = Object.keys(e).sort();
1323
+ for (let n of a)
1324
+ t[n] = e[n];
1325
+ return t;
1326
+ }
1327
+ function $n(e, t) {
1328
+ let a = /* @__PURE__ */ new Set();
1329
+ return new Set(t), e.reduce((n, r) => {
1330
+ let o = JSON.stringify(Pn(r));
1331
+ return a.has(o) || (a.add(o), n.push({ key: o, link: r })), n;
1332
+ }, []);
1333
+ }
1334
+ function lt() {
1335
+ let e = u.useContext(je);
1336
+ return it(
1337
+ e,
1338
+ "You must render this element inside a <DataRouterContext.Provider> element"
1339
+ ), e;
1340
+ }
1341
+ function xn() {
1342
+ let e = u.useContext(Be);
1343
+ return it(
1344
+ e,
1345
+ "You must render this element inside a <DataRouterStateContext.Provider> element"
1346
+ ), e;
1347
+ }
1348
+ var ct = u.createContext(void 0);
1349
+ ct.displayName = "FrameworkContext";
1350
+ function ut() {
1351
+ let e = u.useContext(ct);
1352
+ return it(
1353
+ e,
1354
+ "You must render this element inside a <HydratedRouter> element"
1355
+ ), e;
1356
+ }
1357
+ function Ln(e, t) {
1358
+ let a = u.useContext(ct), [n, r] = u.useState(!1), [o, i] = u.useState(!1), { onFocus: l, onBlur: c, onMouseEnter: d, onMouseLeave: h, onTouchStart: p } = t, v = u.useRef(null);
1359
+ u.useEffect(() => {
1360
+ if (e === "render" && i(!0), e === "viewport") {
1361
+ let m = (j) => {
1362
+ j.forEach((w) => {
1363
+ i(w.isIntersecting);
1364
+ });
1365
+ }, f = new IntersectionObserver(m, { threshold: 0.5 });
1366
+ return v.current && f.observe(v.current), () => {
1367
+ f.disconnect();
1368
+ };
1369
+ }
1370
+ }, [e]), u.useEffect(() => {
1371
+ if (n) {
1372
+ let m = setTimeout(() => {
1373
+ i(!0);
1374
+ }, 100);
1375
+ return () => {
1376
+ clearTimeout(m);
1377
+ };
1378
+ }
1379
+ }, [n]);
1380
+ let _ = () => {
1381
+ r(!0);
1382
+ }, b = () => {
1383
+ r(!1), i(!1);
1384
+ };
1385
+ return a ? e !== "intent" ? [o, v, {}] : [
1386
+ o,
1387
+ v,
1388
+ {
1389
+ onFocus: Ce(l, _),
1390
+ onBlur: Ce(c, b),
1391
+ onMouseEnter: Ce(d, _),
1392
+ onMouseLeave: Ce(h, b),
1393
+ onTouchStart: Ce(p, _)
1394
+ }
1395
+ ] : [!1, v, {}];
1396
+ }
1397
+ function Ce(e, t) {
1398
+ return (a) => {
1399
+ e && e(a), a.defaultPrevented || t(a);
1400
+ };
1401
+ }
1402
+ function Tn({ page: e, ...t }) {
1403
+ let a = Ha(), { router: n } = lt(), r = u.useMemo(
1404
+ () => Pt(n.routes, e, n.basename),
1405
+ [n.routes, e, n.basename]
1406
+ );
1407
+ return r ? a ? /* @__PURE__ */ u.createElement(On, { page: e, matches: r, ...t }) : /* @__PURE__ */ u.createElement(Dn, { page: e, matches: r, ...t }) : null;
1408
+ }
1409
+ function An(e) {
1410
+ let { manifest: t, routeModules: a } = ut(), [n, r] = u.useState([]);
1411
+ return u.useEffect(() => {
1412
+ let o = !1;
1413
+ return Nn(e, t, a).then(
1414
+ (i) => {
1415
+ o || r(i);
1416
+ }
1417
+ ), () => {
1418
+ o = !0;
1419
+ };
1420
+ }, [e, t, a]), n;
1421
+ }
1422
+ function On({
1423
+ page: e,
1424
+ matches: t,
1425
+ ...a
1426
+ }) {
1427
+ let n = ee(), { future: r } = ut(), { basename: o } = lt(), i = u.useMemo(() => {
1428
+ if (e === n.pathname + n.search + n.hash)
1429
+ return [];
1430
+ let l = Gt(
1431
+ e,
1432
+ o,
1433
+ r.unstable_trailingSlashAwareDataRequests,
1434
+ "rsc"
1435
+ ), c = !1, d = [];
1436
+ for (let h of t)
1437
+ typeof h.route.shouldRevalidate == "function" ? c = !0 : d.push(h.route.id);
1438
+ return c && d.length > 0 && l.searchParams.set("_routes", d.join(",")), [l.pathname + l.search];
1439
+ }, [
1440
+ o,
1441
+ r.unstable_trailingSlashAwareDataRequests,
1442
+ e,
1443
+ n,
1444
+ t
1445
+ ]);
1446
+ return /* @__PURE__ */ u.createElement(u.Fragment, null, i.map((l) => /* @__PURE__ */ u.createElement("link", { key: l, rel: "prefetch", as: "fetch", href: l, ...a })));
1447
+ }
1448
+ function Dn({
1449
+ page: e,
1450
+ matches: t,
1451
+ ...a
1452
+ }) {
1453
+ let n = ee(), { future: r, manifest: o, routeModules: i } = ut(), { basename: l } = lt(), { loaderData: c, matches: d } = xn(), h = u.useMemo(
1454
+ () => vt(
1455
+ e,
1456
+ t,
1457
+ d,
1458
+ o,
1459
+ n,
1460
+ "data"
1461
+ ),
1462
+ [e, t, d, o, n]
1463
+ ), p = u.useMemo(
1464
+ () => vt(
1465
+ e,
1466
+ t,
1467
+ d,
1468
+ o,
1469
+ n,
1470
+ "assets"
1471
+ ),
1472
+ [e, t, d, o, n]
1473
+ ), v = u.useMemo(() => {
1474
+ if (e === n.pathname + n.search + n.hash)
1475
+ return [];
1476
+ let m = /* @__PURE__ */ new Set(), f = !1;
1477
+ if (t.forEach((w) => {
1478
+ let R = o.routes[w.route.id];
1479
+ !R || !R.hasLoader || (!h.some((P) => P.route.id === w.route.id) && w.route.id in c && i[w.route.id]?.shouldRevalidate || R.hasClientLoader ? f = !0 : m.add(w.route.id));
1480
+ }), m.size === 0)
1481
+ return [];
1482
+ let j = Gt(
1483
+ e,
1484
+ l,
1485
+ r.unstable_trailingSlashAwareDataRequests,
1486
+ "data"
1487
+ );
1488
+ return f && m.size > 0 && j.searchParams.set(
1489
+ "_routes",
1490
+ t.filter((w) => m.has(w.route.id)).map((w) => w.route.id).join(",")
1491
+ ), [j.pathname + j.search];
1492
+ }, [
1493
+ l,
1494
+ r.unstable_trailingSlashAwareDataRequests,
1495
+ c,
1496
+ n,
1497
+ o,
1498
+ h,
1499
+ t,
1500
+ e,
1501
+ i
1502
+ ]), _ = u.useMemo(
1503
+ () => Cn(p, o),
1504
+ [p, o]
1505
+ ), b = An(p);
1506
+ return /* @__PURE__ */ u.createElement(u.Fragment, null, v.map((m) => /* @__PURE__ */ u.createElement("link", { key: m, rel: "prefetch", as: "fetch", href: m, ...a })), _.map((m) => /* @__PURE__ */ u.createElement("link", { key: m, rel: "modulepreload", href: m, ...a })), b.map(({ key: m, link: f }) => (
1507
+ // these don't spread `linkProps` because they are full link descriptors
1508
+ // already with their own props
1509
+ /* @__PURE__ */ u.createElement(
1510
+ "link",
1511
+ {
1512
+ key: m,
1513
+ nonce: a.nonce,
1514
+ ...f,
1515
+ crossOrigin: f.crossOrigin ?? a.crossOrigin
1516
+ }
1517
+ )
1518
+ )));
1519
+ }
1520
+ function Fn(...e) {
1521
+ return (t) => {
1522
+ e.forEach((a) => {
1523
+ typeof a == "function" ? a(t) : a != null && (a.current = t);
1524
+ });
1525
+ };
1526
+ }
1527
+ var Un = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1528
+ try {
1529
+ Un && (window.__reactRouterVersion = // @ts-expect-error
1530
+ "7.14.1");
1531
+ } catch {
1532
+ }
1533
+ function In({
1534
+ basename: e,
1535
+ children: t,
1536
+ unstable_useTransitions: a,
1537
+ window: n
1538
+ }) {
1539
+ let r = u.useRef();
1540
+ r.current == null && (r.current = ma({ window: n, v5Compat: !0 }));
1541
+ let o = r.current, [i, l] = u.useState({
1542
+ action: o.action,
1543
+ location: o.location
1544
+ }), c = u.useCallback(
1545
+ (d) => {
1546
+ a === !1 ? l(d) : u.startTransition(() => l(d));
1547
+ },
1548
+ [a]
1549
+ );
1550
+ return u.useLayoutEffect(() => o.listen(c), [o, c]), /* @__PURE__ */ u.createElement(
1551
+ hn,
1552
+ {
1553
+ basename: e,
1554
+ children: t,
1555
+ location: i.location,
1556
+ navigationType: i.action,
1557
+ navigator: o,
1558
+ unstable_useTransitions: a
1559
+ }
1560
+ );
1561
+ }
1562
+ var zt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Re = u.forwardRef(
1563
+ function({
1564
+ onClick: t,
1565
+ discover: a = "render",
1566
+ prefetch: n = "none",
1567
+ relative: r,
1568
+ reloadDocument: o,
1569
+ replace: i,
1570
+ unstable_mask: l,
1571
+ state: c,
1572
+ target: d,
1573
+ to: h,
1574
+ preventScrollReset: p,
1575
+ viewTransition: v,
1576
+ unstable_defaultShouldRevalidate: _,
1577
+ ...b
1578
+ }, m) {
1579
+ let { basename: f, navigator: j, unstable_useTransitions: w } = u.useContext(Z), R = typeof h == "string" && zt.test(h), P = At(h, f);
1580
+ h = P.to;
1581
+ let L = za(h, { relative: r }), U = ee(), W = null;
1582
+ if (l) {
1583
+ let T = Me(
1584
+ l,
1585
+ [],
1586
+ U.unstable_mask ? U.unstable_mask.pathname : "/",
1587
+ !0
1588
+ );
1589
+ f !== "/" && (T.pathname = T.pathname === "/" ? f : re([f, T.pathname])), W = j.createHref(T);
1590
+ }
1591
+ let [A, x, F] = Ln(
1592
+ n,
1593
+ b
1594
+ ), H = Wn(h, {
1595
+ replace: i,
1596
+ unstable_mask: l,
1597
+ state: c,
1598
+ target: d,
1599
+ preventScrollReset: p,
1600
+ relative: r,
1601
+ viewTransition: v,
1602
+ unstable_defaultShouldRevalidate: _,
1603
+ unstable_useTransitions: w
1604
+ });
1605
+ function k(T) {
1606
+ t && t(T), T.defaultPrevented || H(T);
1607
+ }
1608
+ let O = !(P.isExternal || o), I = (
1609
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1610
+ /* @__PURE__ */ u.createElement(
1611
+ "a",
1612
+ {
1613
+ ...b,
1614
+ ...F,
1615
+ href: (O ? W : void 0) || P.absoluteURL || L,
1616
+ onClick: O ? k : t,
1617
+ ref: Fn(m, x),
1618
+ target: d,
1619
+ "data-discover": !R && a === "render" ? "true" : void 0
1620
+ }
1621
+ )
1622
+ );
1623
+ return A && !R ? /* @__PURE__ */ u.createElement(u.Fragment, null, I, /* @__PURE__ */ u.createElement(Tn, { page: L })) : I;
1624
+ }
1625
+ );
1626
+ Re.displayName = "Link";
1627
+ var Mn = u.forwardRef(
1628
+ function({
1629
+ "aria-current": t = "page",
1630
+ caseSensitive: a = !1,
1631
+ className: n = "",
1632
+ end: r = !1,
1633
+ style: o,
1634
+ to: i,
1635
+ viewTransition: l,
1636
+ children: c,
1637
+ ...d
1638
+ }, h) {
1639
+ let p = Le(i, { relative: d.relative }), v = ee(), _ = u.useContext(Be), { navigator: b, basename: m } = u.useContext(Z), f = _ != null && // Conditional usage is OK here because the usage of a data router is static
1640
+ // eslint-disable-next-line react-hooks/rules-of-hooks
1641
+ Gn(p) && l === !0, j = b.encodeLocation ? b.encodeLocation(p).pathname : p.pathname, w = v.pathname, R = _ && _.navigation && _.navigation.location ? _.navigation.location.pathname : null;
1642
+ a || (w = w.toLowerCase(), R = R ? R.toLowerCase() : null, j = j.toLowerCase()), R && m && (R = ce(R, m) || R);
1643
+ const P = j !== "/" && j.endsWith("/") ? j.length - 1 : j.length;
1644
+ let L = w === j || !r && w.startsWith(j) && w.charAt(P) === "/", U = R != null && (R === j || !r && R.startsWith(j) && R.charAt(j.length) === "/"), W = {
1645
+ isActive: L,
1646
+ isPending: U,
1647
+ isTransitioning: f
1648
+ }, A = L ? t : void 0, x;
1649
+ typeof n == "function" ? x = n(W) : x = [
1650
+ n,
1651
+ L ? "active" : null,
1652
+ U ? "pending" : null,
1653
+ f ? "transitioning" : null
1654
+ ].filter(Boolean).join(" ");
1655
+ let F = typeof o == "function" ? o(W) : o;
1656
+ return /* @__PURE__ */ u.createElement(
1657
+ Re,
1658
+ {
1659
+ ...d,
1660
+ "aria-current": A,
1661
+ className: x,
1662
+ ref: h,
1663
+ style: F,
1664
+ to: i,
1665
+ viewTransition: l
1666
+ },
1667
+ typeof c == "function" ? c(W) : c
1668
+ );
1669
+ }
1670
+ );
1671
+ Mn.displayName = "NavLink";
1672
+ var Bn = u.forwardRef(
1673
+ ({
1674
+ discover: e = "render",
1675
+ fetcherKey: t,
1676
+ navigate: a,
1677
+ reloadDocument: n,
1678
+ replace: r,
1679
+ state: o,
1680
+ method: i = Oe,
1681
+ action: l,
1682
+ onSubmit: c,
1683
+ relative: d,
1684
+ preventScrollReset: h,
1685
+ viewTransition: p,
1686
+ unstable_defaultShouldRevalidate: v,
1687
+ ..._
1688
+ }, b) => {
1689
+ let { unstable_useTransitions: m } = u.useContext(Z), f = Kn(), j = Vn(l, { relative: d }), w = i.toLowerCase() === "get" ? "get" : "post", R = typeof l == "string" && zt.test(l), P = (L) => {
1690
+ if (c && c(L), L.defaultPrevented) return;
1691
+ L.preventDefault();
1692
+ let U = L.nativeEvent.submitter, W = U?.getAttribute("formmethod") || i, A = () => f(U || L.currentTarget, {
1693
+ fetcherKey: t,
1694
+ method: W,
1695
+ navigate: a,
1696
+ replace: r,
1697
+ state: o,
1698
+ relative: d,
1699
+ preventScrollReset: h,
1700
+ viewTransition: p,
1701
+ unstable_defaultShouldRevalidate: v
1702
+ });
1703
+ m && a !== !1 ? u.startTransition(() => A()) : A();
1704
+ };
1705
+ return /* @__PURE__ */ u.createElement(
1706
+ "form",
1707
+ {
1708
+ ref: b,
1709
+ method: w,
1710
+ action: j,
1711
+ onSubmit: n ? c : P,
1712
+ ..._,
1713
+ "data-discover": !R && e === "render" ? "true" : void 0
1714
+ }
1715
+ );
1716
+ }
1717
+ );
1718
+ Bn.displayName = "Form";
1719
+ function Hn(e) {
1720
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1721
+ }
1722
+ function Yt(e) {
1723
+ let t = u.useContext(je);
1724
+ return B(t, Hn(e)), t;
1725
+ }
1726
+ function Wn(e, {
1727
+ target: t,
1728
+ replace: a,
1729
+ unstable_mask: n,
1730
+ state: r,
1731
+ preventScrollReset: o,
1732
+ relative: i,
1733
+ viewTransition: l,
1734
+ unstable_defaultShouldRevalidate: c,
1735
+ unstable_useTransitions: d
1736
+ } = {}) {
1737
+ let h = pe(), p = ee(), v = Le(e, { relative: i });
1738
+ return u.useCallback(
1739
+ (_) => {
1740
+ if (wn(_, t)) {
1741
+ _.preventDefault();
1742
+ let b = a !== void 0 ? a : Se(p) === Se(v), m = () => h(e, {
1743
+ replace: b,
1744
+ unstable_mask: n,
1745
+ state: r,
1746
+ preventScrollReset: o,
1747
+ relative: i,
1748
+ viewTransition: l,
1749
+ unstable_defaultShouldRevalidate: c
1750
+ });
1751
+ d ? u.startTransition(() => m()) : m();
1752
+ }
1753
+ },
1754
+ [
1755
+ p,
1756
+ h,
1757
+ v,
1758
+ a,
1759
+ n,
1760
+ r,
1761
+ t,
1762
+ e,
1763
+ o,
1764
+ i,
1765
+ l,
1766
+ c,
1767
+ d
1768
+ ]
1769
+ );
1770
+ }
1771
+ function Qt(e) {
1772
+ X(
1773
+ typeof URLSearchParams < "u",
1774
+ "You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params."
1775
+ );
1776
+ let t = u.useRef(et(e)), a = u.useRef(!1), n = ee(), r = u.useMemo(
1777
+ () => (
1778
+ // Only merge in the defaults if we haven't yet called setSearchParams.
1779
+ // Once we call that we want those to take precedence, otherwise you can't
1780
+ // remove a param with setSearchParams({}) if it has an initial value
1781
+ _n(
1782
+ n.search,
1783
+ a.current ? null : t.current
1784
+ )
1785
+ ),
1786
+ [n.search]
1787
+ ), o = pe(), i = u.useCallback(
1788
+ (l, c) => {
1789
+ const d = et(
1790
+ typeof l == "function" ? l(new URLSearchParams(r)) : l
1791
+ );
1792
+ a.current = !0, o("?" + d, c);
1793
+ },
1794
+ [o, r]
1795
+ );
1796
+ return [r, i];
1797
+ }
1798
+ var Jn = 0, qn = () => `__${String(++Jn)}__`;
1799
+ function Kn() {
1800
+ let { router: e } = Yt(
1801
+ "useSubmit"
1802
+ /* UseSubmit */
1803
+ ), { basename: t } = u.useContext(Z), a = cn(), n = e.fetch, r = e.navigate;
1804
+ return u.useCallback(
1805
+ async (o, i = {}) => {
1806
+ let { action: l, method: c, encType: d, formData: h, body: p } = Rn(
1807
+ o,
1808
+ t
1809
+ );
1810
+ if (i.navigate === !1) {
1811
+ let v = i.fetcherKey || qn();
1812
+ await n(v, a, i.action || l, {
1813
+ unstable_defaultShouldRevalidate: i.unstable_defaultShouldRevalidate,
1814
+ preventScrollReset: i.preventScrollReset,
1815
+ formData: h,
1816
+ body: p,
1817
+ formMethod: i.method || c,
1818
+ formEncType: i.encType || d,
1819
+ flushSync: i.flushSync
1820
+ });
1821
+ } else
1822
+ await r(i.action || l, {
1823
+ unstable_defaultShouldRevalidate: i.unstable_defaultShouldRevalidate,
1824
+ preventScrollReset: i.preventScrollReset,
1825
+ formData: h,
1826
+ body: p,
1827
+ formMethod: i.method || c,
1828
+ formEncType: i.encType || d,
1829
+ replace: i.replace,
1830
+ state: i.state,
1831
+ fromRouteId: a,
1832
+ flushSync: i.flushSync,
1833
+ viewTransition: i.viewTransition
1834
+ });
1835
+ },
1836
+ [n, r, t, a]
1837
+ );
1838
+ }
1839
+ function Vn(e, { relative: t } = {}) {
1840
+ let { basename: a } = u.useContext(Z), n = u.useContext(ae);
1841
+ B(n, "useFormAction must be used inside a RouteContext");
1842
+ let [r] = n.matches.slice(-1), o = { ...Le(e || ".", { relative: t }) }, i = ee();
1843
+ if (e == null) {
1844
+ o.search = i.search;
1845
+ let l = new URLSearchParams(o.search), c = l.getAll("index");
1846
+ if (c.some((h) => h === "")) {
1847
+ l.delete("index"), c.filter((p) => p).forEach((p) => l.append("index", p));
1848
+ let h = l.toString();
1849
+ o.search = h ? `?${h}` : "";
1850
+ }
1851
+ }
1852
+ return (!e || e === ".") && r.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (o.pathname = o.pathname === "/" ? a : re([a, o.pathname])), Se(o);
1853
+ }
1854
+ function Gn(e, { relative: t } = {}) {
1855
+ let a = u.useContext(Ft);
1856
+ B(
1857
+ a != null,
1858
+ "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1859
+ );
1860
+ let { basename: n } = Yt(
1861
+ "useViewTransitionState"
1862
+ /* useViewTransitionState */
1863
+ ), r = Le(e, { relative: t });
1864
+ if (!a.isTransitioning)
1865
+ return !1;
1866
+ let o = ce(a.currentLocation.pathname, n) || a.currentLocation.pathname, i = ce(a.nextLocation.pathname, n) || a.nextLocation.pathname;
1867
+ return Ue(r.pathname, i) != null || Ue(r.pathname, o) != null;
1868
+ }
1869
+ function D(e, t = !1) {
1870
+ const a = { Accept: "application/json" };
1871
+ return t && (a["Content-Type"] = "application/json"), a;
1872
+ }
1873
+ const ve = "/jobplatform/api", wt = ["junior", "mid", "senior", "staff", "principal", "fellow"], _t = ["manager", "senior_manager", "director", "vp", "cxo"], zn = {
1874
+ junior: "Junior",
1875
+ mid: "Mid",
1876
+ senior: "Senior",
1877
+ staff: "Staff",
1878
+ principal: "Principal",
1879
+ fellow: "Distinguished / Fellow",
1880
+ manager: "Manager",
1881
+ senior_manager: "Senior Manager",
1882
+ director: "Director",
1883
+ vp: "VP / Head of",
1884
+ cxo: "C-level"
1885
+ };
1886
+ class ye extends Error {
1887
+ constructor(t, a) {
1888
+ super(t), this.status = a, this.name = "ProfilesApiError";
1889
+ }
1890
+ }
1891
+ async function we(e) {
1892
+ const t = await e.json();
1893
+ if (!e.ok || !t.success || !t.data)
1894
+ throw new ye(
1895
+ t.message ?? t.error ?? `HTTP ${e.status}`,
1896
+ e.status
1897
+ );
1898
+ return t.data;
1899
+ }
1900
+ async function Yn(e) {
1901
+ const t = await fetch(`${ve}/profiles`, {
1902
+ method: "GET",
1903
+ headers: D(),
1904
+ credentials: "include"
1905
+ });
1906
+ return (await we(t)).profiles;
1907
+ }
1908
+ async function Qn(e, t) {
1909
+ const a = await fetch(`${ve}/profiles`, {
1910
+ method: "POST",
1911
+ headers: D(t, !0),
1912
+ credentials: "include",
1913
+ body: JSON.stringify(e)
1914
+ });
1915
+ return (await we(a)).profile;
1916
+ }
1917
+ async function Xn(e, t, a) {
1918
+ const n = await fetch(`${ve}/profiles/${encodeURIComponent(e)}`, {
1919
+ method: "PUT",
1920
+ headers: D(a, !0),
1921
+ credentials: "include",
1922
+ body: JSON.stringify(t)
1923
+ });
1924
+ return (await we(n)).profile;
1925
+ }
1926
+ async function Zn(e, t) {
1927
+ const a = await fetch(`${ve}/profiles/${encodeURIComponent(e)}`, {
1928
+ method: "DELETE",
1929
+ headers: D(),
1930
+ credentials: "include"
1931
+ });
1932
+ await we(a);
1933
+ }
1934
+ async function er(e, t) {
1935
+ const a = await fetch(`${ve}/profiles/${encodeURIComponent(e)}/companies`, {
1936
+ method: "GET",
1937
+ headers: D(),
1938
+ credentials: "include"
1939
+ });
1940
+ return (await we(a)).companies;
1941
+ }
1942
+ async function tr(e, t, a) {
1943
+ const n = await fetch(`${ve}/profiles/${encodeURIComponent(e)}/companies`, {
1944
+ method: "POST",
1945
+ headers: D(a, !0),
1946
+ credentials: "include",
1947
+ body: JSON.stringify(t)
1948
+ });
1949
+ return we(n);
1950
+ }
1951
+ async function ar(e, t, a) {
1952
+ const n = await fetch(
1953
+ `${ve}/profiles/${encodeURIComponent(e)}/companies/${encodeURIComponent(t)}`,
1954
+ { method: "DELETE", headers: D(), credentials: "include" }
1955
+ );
1956
+ await we(n);
1957
+ }
1958
+ const Y = /* @__PURE__ */ new Map(), nr = 120;
1959
+ function rr() {
1960
+ for (; Y.size > nr; ) {
1961
+ const e = Y.keys().next();
1962
+ if (e.done) return;
1963
+ Y.delete(e.value);
1964
+ }
1965
+ }
1966
+ const or = 3e4;
1967
+ function Fe(e, t, { onStale: a, maxAgeMs: n = or } = {}) {
1968
+ const r = Y.get(e);
1969
+ if (r && "value" in r) {
1970
+ const i = Date.now() - r.at < n;
1971
+ if (a?.(r.value, i), i) return Promise.resolve(r.value);
1972
+ }
1973
+ if (r?.inflight) return r.inflight;
1974
+ const o = t().then((i) => (Y.delete(e), Y.set(e, { value: i, at: Date.now() }), rr(), i)).catch((i) => {
1975
+ const l = Y.get(e);
1976
+ throw l ? Y.set(e, { value: l.value, at: l.at }) : Y.delete(e), i;
1977
+ });
1978
+ return Y.set(e, r ? { ...r, inflight: o } : { inflight: o }), o;
1979
+ }
1980
+ function bt(e) {
1981
+ const t = Y.get(e);
1982
+ return t && "value" in t ? t.value : void 0;
1983
+ }
1984
+ function We(e) {
1985
+ for (const t of [...Y.keys()])
1986
+ t.startsWith(e) && Y.delete(t);
1987
+ }
1988
+ function Je(e, t, { enabled: a = !0, maxAgeMs: n } = {}) {
1989
+ const [r, o] = E(
1990
+ () => a ? bt(e) : void 0
1991
+ ), [i, l] = E(!1), [c, d] = E(null), [h, p] = E(0), v = Pe(t);
1992
+ return v.current = t, Q(() => {
1993
+ if (!a) {
1994
+ l(!1);
1995
+ return;
1996
+ }
1997
+ let _ = !1;
1998
+ d(null);
1999
+ const b = bt(e);
2000
+ return b !== void 0 && o(b), l(!0), Fe(e, () => v.current(), {
2001
+ maxAgeMs: n,
2002
+ onStale: (m, f) => {
2003
+ _ || (o(m), f && l(!1));
2004
+ }
2005
+ }).then((m) => {
2006
+ _ || o(m);
2007
+ }).catch((m) => {
2008
+ _ || d(m);
2009
+ }).finally(() => {
2010
+ _ || l(!1);
2011
+ }), () => {
2012
+ _ = !0;
2013
+ };
2014
+ }, [e, a, n, h]), {
2015
+ data: r,
2016
+ loading: a && r === void 0 && c === null,
2017
+ refreshing: i,
2018
+ error: c,
2019
+ reload: () => p((_) => _ + 1)
2020
+ };
2021
+ }
2022
+ function sr() {
2023
+ const e = window.location.pathname + window.location.search + window.location.hash;
2024
+ return `/auth?return=${encodeURIComponent(e)}`;
2025
+ }
2026
+ function ir({
2027
+ auth: e,
2028
+ selectedId: t,
2029
+ onSelect: a,
2030
+ onNew: n,
2031
+ onEdit: r,
2032
+ reloadKey: o,
2033
+ onResolved: i
2034
+ }) {
2035
+ const [l, c] = E(null), d = e.signedIn, {
2036
+ data: h,
2037
+ loading: p,
2038
+ error: v,
2039
+ reload: _
2040
+ } = Je(`profiles:${o ?? 0}`, () => Yn(), { enabled: d }), b = h ?? [], m = l ?? (v ? v instanceof ye ? v.message : "Failed to load profiles" : null), f = !d || !p;
2041
+ Q(() => {
2042
+ f && i?.(b.length);
2043
+ }, [f, b.length, i]), Q(() => {
2044
+ if (!p) {
2045
+ if (b.length === 0) {
2046
+ t !== null && a(null);
2047
+ return;
2048
+ }
2049
+ b.find((w) => w.id === t) || a(b[0].id);
2050
+ }
2051
+ }, [p, b, t, a]);
2052
+ const j = async (w) => {
2053
+ const R = w.is_default ? "Hide the default profile? It won’t come back (your edits/deletion are remembered)." : "Delete this profile?";
2054
+ if (window.confirm(R)) {
2055
+ c(null);
2056
+ try {
2057
+ await Zn(w.id, e), We("profiles:"), _();
2058
+ } catch (P) {
2059
+ c(P instanceof ye ? P.message : "Failed to delete profile");
2060
+ }
2061
+ }
2062
+ };
2063
+ return d ? /* @__PURE__ */ g("aside", { className: "jp-sidebar", children: [
2064
+ /* @__PURE__ */ g("div", { className: "jp-sidebar__header", children: [
2065
+ /* @__PURE__ */ s("h2", { children: "Profiles" }),
2066
+ /* @__PURE__ */ s("button", { type: "button", className: "jp-sidebar__new", onClick: n, children: "+ New" })
2067
+ ] }),
2068
+ m && /* @__PURE__ */ s("p", { className: "jp-error", children: m }),
2069
+ p ? /* @__PURE__ */ s("p", { className: "jp-muted", children: "Loading…" }) : b.length === 0 ? /* @__PURE__ */ s("p", { className: "jp-muted", children: "No profiles yet. Create one to start scoring jobs." }) : /* @__PURE__ */ s("ul", { className: "jp-sidebar__list", children: b.map((w) => {
2070
+ const R = w.id === t;
2071
+ return /* @__PURE__ */ g(
2072
+ "li",
2073
+ {
2074
+ className: R ? "jp-sidebar__item jp-sidebar__item--active" : "jp-sidebar__item",
2075
+ children: [
2076
+ /* @__PURE__ */ g(
2077
+ "button",
2078
+ {
2079
+ type: "button",
2080
+ className: "jp-sidebar__item-main",
2081
+ onClick: () => a(w.id),
2082
+ children: [
2083
+ /* @__PURE__ */ g("span", { className: "jp-sidebar__item-name", children: [
2084
+ w.name,
2085
+ w.is_default && /* @__PURE__ */ s("span", { className: "jp-sidebar__badge", children: "default" })
2086
+ ] }),
2087
+ /* @__PURE__ */ g("span", { className: "jp-sidebar__item-meta", children: [
2088
+ w.keywords.length,
2089
+ " kw · ",
2090
+ w.remote_pref
2091
+ ] })
2092
+ ]
2093
+ }
2094
+ ),
2095
+ /* @__PURE__ */ g("div", { className: "jp-sidebar__item-actions", children: [
2096
+ /* @__PURE__ */ s(
2097
+ "button",
2098
+ {
2099
+ type: "button",
2100
+ className: "jp-sidebar__item-edit",
2101
+ onClick: () => r(w),
2102
+ "aria-label": `Edit ${w.name}`,
2103
+ children: "✎"
2104
+ }
2105
+ ),
2106
+ /* @__PURE__ */ s(
2107
+ "button",
2108
+ {
2109
+ type: "button",
2110
+ className: "jp-sidebar__item-remove",
2111
+ onClick: () => {
2112
+ j(w);
2113
+ },
2114
+ "aria-label": w.is_default ? `Hide ${w.name}` : `Delete ${w.name}`,
2115
+ children: "×"
2116
+ }
2117
+ )
2118
+ ] })
2119
+ ]
2120
+ },
2121
+ w.id
2122
+ );
2123
+ }) })
2124
+ ] }) : /* @__PURE__ */ g("aside", { className: "jp-sidebar", children: [
2125
+ /* @__PURE__ */ s("div", { className: "jp-sidebar__header", children: /* @__PURE__ */ s("h2", { children: "Profiles" }) }),
2126
+ /* @__PURE__ */ s("p", { className: "jp-muted", children: "The feed to the right is the whole public corpus, newest first. Sign in to rank it against your own profile — keywords, IC or manager track, level and remote preference — and to track which jobs you’ve looked at." }),
2127
+ /* @__PURE__ */ s("a", { className: "jp-sidebar__signin", href: sr(), children: "Sign in" })
2128
+ ] });
2129
+ }
2130
+ const K = "/jobplatform/api";
2131
+ class le extends Error {
2132
+ constructor(t, a) {
2133
+ super(t), this.status = a, this.name = "JobsApiError";
2134
+ }
2135
+ }
2136
+ async function V(e) {
2137
+ const t = await e.json();
2138
+ if (!e.ok || !t.success || !t.data)
2139
+ throw new le(t.message ?? t.error ?? `HTTP ${e.status}`, e.status);
2140
+ return t.data;
2141
+ }
2142
+ async function lr(e, t) {
2143
+ const a = new URLSearchParams();
2144
+ e.profile_id && a.set("profile_id", e.profile_id), e.state && a.set("state", e.state), e.hide_dismissed && a.set("hide_dismissed", "true"), e.hide_queued && a.set("hide_queued", "true"), e.page && a.set("page", String(e.page)), e.limit && a.set("limit", String(e.limit)), e.sort && a.set("sort", e.sort), e.min_score !== void 0 && a.set("min_score", String(e.min_score)), e.min_salary !== void 0 && a.set("min_salary", String(e.min_salary));
2145
+ const n = `${K}/jobs${a.toString() ? `?${a}` : ""}`, r = await fetch(n, {
2146
+ method: "GET",
2147
+ headers: D(),
2148
+ credentials: "include"
2149
+ });
2150
+ return V(r);
2151
+ }
2152
+ async function ze(e, t) {
2153
+ const a = new URLSearchParams();
2154
+ e.keyword && a.set("keyword", e.keyword), e.track && a.set("track", e.track), e.level && a.set("level", e.level);
2155
+ const n = await fetch(`${K}/jobs/preflight?${a}`, {
2156
+ method: "GET",
2157
+ headers: D(),
2158
+ credentials: "include"
2159
+ });
2160
+ return (await V(n)).count;
2161
+ }
2162
+ async function cr(e, t, a) {
2163
+ const n = t ? `?profile_id=${encodeURIComponent(t)}` : "", r = await fetch(`${K}/jobs/${encodeURIComponent(e)}${n}`, {
2164
+ method: "GET",
2165
+ headers: D(),
2166
+ credentials: "include"
2167
+ });
2168
+ return (await V(r)).job;
2169
+ }
2170
+ async function ur(e, t, a, n) {
2171
+ const r = await fetch(`${K}/jobs/${encodeURIComponent(e)}/state`, {
2172
+ method: "PUT",
2173
+ headers: D(a, !0),
2174
+ credentials: "include",
2175
+ body: JSON.stringify(n ? { state: t, variant_slug: n } : { state: t })
2176
+ });
2177
+ return V(r);
2178
+ }
2179
+ async function kt(e, t, a, n) {
2180
+ const r = await fetch(`${K}/jobs/${encodeURIComponent(e)}/feedback`, {
2181
+ method: "PUT",
2182
+ headers: D(n, !0),
2183
+ credentials: "include",
2184
+ body: JSON.stringify({ vote: t, reasons: a })
2185
+ });
2186
+ return V(r);
2187
+ }
2188
+ async function dr(e, t) {
2189
+ const a = await fetch(`${K}/jobs/${encodeURIComponent(e)}/feedback`, {
2190
+ method: "DELETE",
2191
+ headers: D(),
2192
+ credentials: "include"
2193
+ });
2194
+ return V(a);
2195
+ }
2196
+ async function pr(e, t, a) {
2197
+ const n = await fetch(`${K}/jobs/${encodeURIComponent(e)}/resume`, {
2198
+ method: "POST",
2199
+ headers: D(t, !0),
2200
+ credentials: "include",
2201
+ body: JSON.stringify({})
2202
+ });
2203
+ return V(n);
2204
+ }
2205
+ async function hr(e, t, a) {
2206
+ const n = await fetch(`${K}/jobs/${encodeURIComponent(e)}/cover-letter`, {
2207
+ method: "POST",
2208
+ headers: D(t, !0),
2209
+ credentials: "include",
2210
+ body: JSON.stringify({})
2211
+ });
2212
+ return V(n);
2213
+ }
2214
+ async function Xt(e, t, a) {
2215
+ const n = await fetch(`${K}/jobs/${encodeURIComponent(e)}/packet-link`, {
2216
+ method: "POST",
2217
+ headers: D(a, !0),
2218
+ credentials: "include",
2219
+ body: JSON.stringify(t)
2220
+ });
2221
+ return V(n);
2222
+ }
2223
+ async function Zt(e, t, a) {
2224
+ const n = await fetch(`${K}/jobs/${encodeURIComponent(e)}/application-extras`, {
2225
+ method: "POST",
2226
+ headers: D(a, !0),
2227
+ credentials: "include",
2228
+ body: JSON.stringify(t)
2229
+ });
2230
+ return V(n);
2231
+ }
2232
+ async function ro(e) {
2233
+ const t = await fetch(`${K}/jobs/packets`, {
2234
+ method: "GET",
2235
+ headers: D(),
2236
+ credentials: "include"
2237
+ });
2238
+ return (await V(t)).packets;
2239
+ }
2240
+ async function ea(e, t = "review", a) {
2241
+ const n = await fetch(`${K}/jobs/${encodeURIComponent(e)}/apply`, {
2242
+ method: "POST",
2243
+ headers: { "Content-Type": "application/json", ...D() },
2244
+ credentials: "include",
2245
+ body: JSON.stringify({ mode: t })
2246
+ });
2247
+ return (await V(n)).application;
2248
+ }
2249
+ async function oo(e, t) {
2250
+ const n = await fetch(`${K}/applications`, {
2251
+ method: "GET",
2252
+ headers: D(),
2253
+ credentials: "include"
2254
+ });
2255
+ return (await V(n)).applications;
2256
+ }
2257
+ async function so(e, t) {
2258
+ const a = await fetch(`${K}/applications/${encodeURIComponent(e)}/approve`, {
2259
+ method: "POST",
2260
+ headers: D(),
2261
+ credentials: "include"
2262
+ });
2263
+ return (await V(a)).application;
2264
+ }
2265
+ async function io(e) {
2266
+ const t = await fetch(`${K}/unanswered-questions`, {
2267
+ method: "GET",
2268
+ headers: D(),
2269
+ credentials: "include"
2270
+ });
2271
+ return (await V(t)).questions;
2272
+ }
2273
+ async function lo(e) {
2274
+ const t = await fetch(`${K}/application-answers`, {
2275
+ method: "GET",
2276
+ headers: D(),
2277
+ credentials: "include"
2278
+ });
2279
+ return (await V(t)).answers;
2280
+ }
2281
+ async function co(e, t, a) {
2282
+ const n = await fetch(`${K}/application-answers`, {
2283
+ method: "PUT",
2284
+ headers: { ...D(), "Content-Type": "application/json" },
2285
+ credentials: "include",
2286
+ body: JSON.stringify({ question: e, answer: t })
2287
+ });
2288
+ return (await V(n)).answer;
2289
+ }
2290
+ async function uo(e, t) {
2291
+ const a = await fetch(
2292
+ `${K}/application-answers/${encodeURIComponent(e)}`,
2293
+ { method: "DELETE", headers: D(), credentials: "include" }
2294
+ );
2295
+ return (await V(a)).answers;
2296
+ }
2297
+ async function po(e) {
2298
+ const t = await fetch(`${K}/verification-codes`, {
2299
+ method: "GET",
2300
+ headers: D(),
2301
+ credentials: "include"
2302
+ });
2303
+ return (await V(t)).codes;
2304
+ }
2305
+ const fr = "/jobplatform/api";
2306
+ class tt extends Error {
2307
+ constructor(t, a) {
2308
+ super(t), this.status = a, this.name = "CompaniesApiError";
2309
+ }
2310
+ }
2311
+ async function mr(e) {
2312
+ const t = await e.json();
2313
+ if (!e.ok || !t.success || !t.data)
2314
+ throw new tt(
2315
+ t.message ?? t.error ?? `HTTP ${e.status}`,
2316
+ e.status
2317
+ );
2318
+ return t.data;
2319
+ }
2320
+ async function yr(e, t) {
2321
+ const a = await fetch(`${fr}/companies/match`, {
2322
+ method: "POST",
2323
+ headers: D(t, !0),
2324
+ credentials: "include",
2325
+ body: JSON.stringify({ names: e })
2326
+ });
2327
+ return (await mr(a)).results;
2328
+ }
2329
+ function Rt(e) {
2330
+ const t = /* @__PURE__ */ new Set(), a = [];
2331
+ for (const n of e.split(/[,\n]+/)) {
2332
+ const r = n.trim();
2333
+ r && !t.has(r.toLowerCase()) && (t.add(r.toLowerCase()), a.push(r));
2334
+ }
2335
+ return a;
2336
+ }
2337
+ function gr(e) {
2338
+ return e ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64` : null;
2339
+ }
2340
+ function vr({ auth: e, profileId: t, onCompaniesChanged: a }) {
2341
+ const [n, r] = E(null), [o, i] = E(""), [l, c] = E(!1), [d, h] = E(null), [p, v] = E(null), [_, b] = E(null), {
2342
+ data: m,
2343
+ loading: f,
2344
+ error: j,
2345
+ reload: w
2346
+ } = Je(
2347
+ `profile-companies:${t ?? ""}`,
2348
+ () => er(t ?? ""),
2349
+ { enabled: !!t }
2350
+ ), R = t ? m ?? [] : [], P = n ?? (j ? j instanceof ye ? j.message : "Failed to load companies" : null), L = oe(() => {
2351
+ We(`profile-companies:${t ?? ""}`), w();
2352
+ }, [t, w]);
2353
+ Q(() => {
2354
+ h(null);
2355
+ }, [t]);
2356
+ const U = (k, O) => `${k}:${O}`, W = new Set(R.map((k) => U(k.ats, k.slug))), A = async (k, O, I) => {
2357
+ if (!(!t || _)) {
2358
+ r(null), v(null);
2359
+ try {
2360
+ await tr(
2361
+ t,
2362
+ { ats: k, slug: O, display_name: I.trim() || O },
2363
+ e
2364
+ ), L(), a?.();
2365
+ } catch (T) {
2366
+ const G = T instanceof tt || T instanceof ye ? T.message : "Failed to add company";
2367
+ throw v(G), T;
2368
+ }
2369
+ }
2370
+ }, x = async (k) => {
2371
+ k.preventDefault();
2372
+ const O = Rt(o);
2373
+ if (!(O.length === 0 || l)) {
2374
+ c(!0), v(null), h(null);
2375
+ try {
2376
+ h(await yr(O, e));
2377
+ } catch (I) {
2378
+ v(I instanceof tt ? I.message : "Failed to look up company");
2379
+ } finally {
2380
+ c(!1);
2381
+ }
2382
+ }
2383
+ }, F = async (k) => {
2384
+ if (!k.matched || !k.ats || !k.slug) return;
2385
+ const O = U(k.ats, k.slug);
2386
+ b(O);
2387
+ try {
2388
+ await A(k.ats, k.slug, k.company_name ?? k.query);
2389
+ } catch {
2390
+ } finally {
2391
+ b(null);
2392
+ }
2393
+ }, H = async (k) => {
2394
+ if (t) {
2395
+ r(null);
2396
+ try {
2397
+ await ar(t, k, e), L(), a?.();
2398
+ } catch (O) {
2399
+ r(O instanceof ye ? O.message : "Failed to remove company");
2400
+ }
2401
+ }
2402
+ };
2403
+ return t ? /* @__PURE__ */ g("div", { className: "job-platform__companies", children: [
2404
+ /* @__PURE__ */ g("form", { className: "job-platform__companies-form", onSubmit: (k) => {
2405
+ x(k);
2406
+ }, children: [
2407
+ /* @__PURE__ */ s(
2408
+ "input",
2409
+ {
2410
+ type: "text",
2411
+ placeholder: "Add a company by name (e.g. Scale AI, OpenAI, Ramp)",
2412
+ value: o,
2413
+ onChange: (k) => i(k.target.value),
2414
+ disabled: l,
2415
+ "aria-label": "Company name"
2416
+ }
2417
+ ),
2418
+ /* @__PURE__ */ s("button", { type: "submit", disabled: l || Rt(o).length === 0, children: l ? "Finding…" : "Find" })
2419
+ ] }),
2420
+ p && /* @__PURE__ */ s("p", { className: "job-platform__companies-error", children: p }),
2421
+ d && /* @__PURE__ */ s("div", { className: "job-platform__match-results", children: d.map((k) => {
2422
+ const O = k.ats && k.slug ? U(k.ats, k.slug) : k.query, I = k.ats && k.slug ? W.has(O) : !1, T = gr(k.domain), G = k.matched && k.n_jobs === 0;
2423
+ return k.matched ? /* @__PURE__ */ g(
2424
+ "div",
2425
+ {
2426
+ className: G ? "job-platform__match-card job-platform__match-card--warn" : "job-platform__match-card",
2427
+ children: [
2428
+ /* @__PURE__ */ g("div", { className: "job-platform__match-head", children: [
2429
+ T && /* @__PURE__ */ s(
2430
+ "img",
2431
+ {
2432
+ className: "job-platform__match-favicon",
2433
+ src: T,
2434
+ alt: "",
2435
+ width: 20,
2436
+ height: 20,
2437
+ onError: (z) => {
2438
+ z.currentTarget.style.display = "none";
2439
+ }
2440
+ }
2441
+ ),
2442
+ /* @__PURE__ */ s("strong", { className: "job-platform__match-name", children: k.company_name }),
2443
+ /* @__PURE__ */ s("span", { className: "job-platform__probe-ats", children: k.ats }),
2444
+ /* @__PURE__ */ g("span", { className: "job-platform__match-meta", children: [
2445
+ k.slug,
2446
+ " · ",
2447
+ k.n_jobs,
2448
+ " job",
2449
+ k.n_jobs === 1 ? "" : "s"
2450
+ ] })
2451
+ ] }),
2452
+ k.sample_titles.length > 0 && /* @__PURE__ */ s("p", { className: "job-platform__probe-titles", children: k.sample_titles.slice(0, 5).join(" · ") }),
2453
+ G && /* @__PURE__ */ g("p", { className: "job-platform__match-warn", children: [
2454
+ "⚠ 0 open roles — can’t confirm this is the right company (the board may be stale or a different one on ",
2455
+ k.ats,
2456
+ "). Add anyway if you’re sure."
2457
+ ] }),
2458
+ /* @__PURE__ */ s(
2459
+ "button",
2460
+ {
2461
+ type: "button",
2462
+ className: "job-platform__match-confirm",
2463
+ onClick: () => {
2464
+ F(k);
2465
+ },
2466
+ disabled: I || _ !== null,
2467
+ children: I ? "Added ✓" : _ === O ? "Adding…" : G ? "Add anyway" : "Confirm & add"
2468
+ }
2469
+ )
2470
+ ]
2471
+ },
2472
+ O
2473
+ ) : /* @__PURE__ */ g(
2474
+ "div",
2475
+ {
2476
+ className: "job-platform__match-card job-platform__match-card--empty",
2477
+ children: [
2478
+ "No board found for ",
2479
+ /* @__PURE__ */ s("strong", { children: k.query }),
2480
+ " on greenhouse, lever, or ashby — it may use an ATS we don’t scrape yet (e.g. Workday) or a different slug."
2481
+ ]
2482
+ },
2483
+ k.query
2484
+ );
2485
+ }) }),
2486
+ f ? /* @__PURE__ */ s("p", { className: "job-platform__companies-empty", children: "Loading…" }) : R.length === 0 ? /* @__PURE__ */ s("p", { className: "job-platform__companies-empty", children: "No companies yet. This profile scores the whole corpus until you add some." }) : /* @__PURE__ */ s("ul", { className: "job-platform__companies-list", children: R.map((k) => /* @__PURE__ */ g("li", { className: "job-platform__companies-item", children: [
2487
+ /* @__PURE__ */ g("div", { className: "job-platform__companies-item-main", children: [
2488
+ /* @__PURE__ */ s("strong", { children: k.display_name }),
2489
+ /* @__PURE__ */ g("span", { className: "job-platform__companies-item-meta", children: [
2490
+ k.ats,
2491
+ " · ",
2492
+ k.slug
2493
+ ] })
2494
+ ] }),
2495
+ /* @__PURE__ */ s(
2496
+ "button",
2497
+ {
2498
+ type: "button",
2499
+ className: "job-platform__companies-item-remove",
2500
+ onClick: () => {
2501
+ H(k.id);
2502
+ },
2503
+ "aria-label": `Remove ${k.display_name}`,
2504
+ children: "Remove"
2505
+ }
2506
+ )
2507
+ ] }, k.id)) }),
2508
+ P && /* @__PURE__ */ s("p", { className: "job-platform__companies-error", children: P })
2509
+ ] }) : /* @__PURE__ */ s("p", { className: "job-platform__companies-empty", children: "Save the profile first, then add the companies it should track." });
2510
+ }
2511
+ const Ye = 15 * 6e4, wr = [
2512
+ { value: "either", label: "Either", hint: "No constraint — both tracks in the feed" },
2513
+ { value: "ic", label: "IC", hint: "No direct reports" },
2514
+ { value: "manager", label: "Manager", hint: "Has direct reports" }
2515
+ ];
2516
+ function jt(e) {
2517
+ return e === "ic" ? wt : e === "manager" ? _t : [...wt, ..._t];
2518
+ }
2519
+ function Qe({ count: e }) {
2520
+ return e === null ? null : e === "loading" ? /* @__PURE__ */ s("span", { className: "jp-editor__count jp-editor__count--loading", children: "…" }) : /* @__PURE__ */ g("span", { className: e === 0 ? "jp-editor__count jp-editor__count--zero" : "jp-editor__count", children: [
2521
+ e,
2522
+ " job",
2523
+ e === 1 ? "" : "s"
2524
+ ] });
2525
+ }
2526
+ function _r({ auth: e, initial: t, onClose: a, onSaved: n, onCompaniesChanged: r }) {
2527
+ const [o, i] = E(t?.id ?? null), [l, c] = E(t?.name ?? ""), [d, h] = E(t?.keywords ?? []), [p, v] = E(""), [_, b] = E(t?.track ?? "either"), [m, f] = E(t?.levels ?? []), [j, w] = E(t?.remote_pref ?? "any"), [R, P] = E(!1), [L, U] = E(null), [W, A] = E(!1), [x, F] = E({}), [H, k] = E({}), [O, I] = E(null), T = oe(
2528
+ async (y) => {
2529
+ F((C) => ({ ...C, [y]: "loading" }));
2530
+ try {
2531
+ const C = await Fe(
2532
+ `preflight:kw:${y}`,
2533
+ () => ze({ keyword: y }, e),
2534
+ { maxAgeMs: Ye }
2535
+ );
2536
+ F((S) => ({ ...S, [y]: C }));
2537
+ } catch {
2538
+ F((C) => ({ ...C, [y]: null }));
2539
+ }
2540
+ },
2541
+ [e]
2542
+ ), G = oe(
2543
+ async (y) => {
2544
+ k((C) => ({ ...C, [y]: "loading" }));
2545
+ try {
2546
+ const C = await Fe(
2547
+ `preflight:level:${y}`,
2548
+ () => ze({ level: y }, e),
2549
+ { maxAgeMs: Ye }
2550
+ );
2551
+ k((S) => ({ ...S, [y]: C }));
2552
+ } catch {
2553
+ k((C) => ({ ...C, [y]: null }));
2554
+ }
2555
+ },
2556
+ [e]
2557
+ ), z = Pe(!1);
2558
+ Q(() => {
2559
+ if (!z.current) {
2560
+ z.current = !0;
2561
+ for (const y of d) T(y);
2562
+ for (const y of m) G(y);
2563
+ }
2564
+ }, [d, m, T, G]), Q(() => {
2565
+ if (_ === "either") {
2566
+ I(null);
2567
+ return;
2568
+ }
2569
+ let y = !1;
2570
+ return I("loading"), Fe(`preflight:track:${_}`, () => ze({ track: _ }), {
2571
+ maxAgeMs: Ye
2572
+ }).then((C) => !y && I(C)).catch(() => !y && I(null)), () => {
2573
+ y = !0;
2574
+ };
2575
+ }, [_, e]), Q(() => {
2576
+ const y = (C) => {
2577
+ C.key === "Escape" && a();
2578
+ };
2579
+ return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
2580
+ }, [a]);
2581
+ const ue = (y) => {
2582
+ const C = y.split(",").map((S) => S.trim()).filter(Boolean);
2583
+ C.length && (h((S) => {
2584
+ const be = new Set(S.map((se) => se.toLowerCase())), ke = [...S];
2585
+ for (const se of C)
2586
+ be.has(se.toLowerCase()) || (be.add(se.toLowerCase()), ke.push(se), T(se));
2587
+ return ke;
2588
+ }), v(""));
2589
+ }, _e = (y) => {
2590
+ y.key === "Enter" || y.key === "," ? (y.preventDefault(), ue(p)) : y.key === "Backspace" && !p && d.length && h((C) => C.slice(0, -1));
2591
+ }, he = (y) => h((C) => C.filter((S) => S !== y)), fe = (y) => f((C) => C.includes(y) ? C.filter((S) => S !== y) : (H[y] === void 0 && G(y), [...C, y])), me = (y) => {
2592
+ b(y);
2593
+ const C = jt(y);
2594
+ f((S) => S.filter((be) => C.includes(be)));
2595
+ }, N = () => {
2596
+ const y = p.trim() ? [
2597
+ ...d,
2598
+ ...p.split(",").map((C) => C.trim()).filter(Boolean)
2599
+ ] : d;
2600
+ return {
2601
+ name: l.trim(),
2602
+ keywords: y,
2603
+ track: _,
2604
+ levels: m,
2605
+ remote_pref: j
2606
+ };
2607
+ }, J = async () => {
2608
+ if (!(!l.trim() || R)) {
2609
+ P(!0), U(null);
2610
+ try {
2611
+ const y = N();
2612
+ if (o) {
2613
+ const C = await Xn(o, y, e);
2614
+ n(C), a();
2615
+ } else {
2616
+ const C = await Qn(y, e);
2617
+ i(C.id), h(C.keywords), n(C), A(!0);
2618
+ }
2619
+ } catch (y) {
2620
+ U(y instanceof ye ? y.message : "Failed to save profile");
2621
+ } finally {
2622
+ P(!1);
2623
+ }
2624
+ }
2625
+ };
2626
+ return /* @__PURE__ */ s("div", { className: "jp-editor-backdrop", onClick: (y) => {
2627
+ y.target === y.currentTarget && a();
2628
+ }, children: /* @__PURE__ */ g(
2629
+ "div",
2630
+ {
2631
+ className: "jp-editor",
2632
+ role: "dialog",
2633
+ "aria-modal": "true",
2634
+ "aria-label": o ? "Edit profile" : "New profile",
2635
+ children: [
2636
+ /* @__PURE__ */ g("div", { className: "jp-editor__header", children: [
2637
+ /* @__PURE__ */ s("h2", { className: "jp-editor__title", children: t ? "Edit profile" : "New profile" }),
2638
+ /* @__PURE__ */ s(
2639
+ "button",
2640
+ {
2641
+ type: "button",
2642
+ className: "jp-editor__close",
2643
+ onClick: a,
2644
+ "aria-label": "Close editor",
2645
+ children: "×"
2646
+ }
2647
+ )
2648
+ ] }),
2649
+ /* @__PURE__ */ g("div", { className: "jp-editor__body", children: [
2650
+ /* @__PURE__ */ g("section", { className: "jp-editor__section", children: [
2651
+ /* @__PURE__ */ s("label", { className: "jp-editor__field-label", htmlFor: "jp-editor-name", children: "Name" }),
2652
+ /* @__PURE__ */ s(
2653
+ "input",
2654
+ {
2655
+ id: "jp-editor-name",
2656
+ type: "text",
2657
+ className: "jp-editor__text",
2658
+ value: l,
2659
+ onChange: (y) => c(y.target.value),
2660
+ placeholder: "Senior SWE — AI/ML"
2661
+ }
2662
+ )
2663
+ ] }),
2664
+ /* @__PURE__ */ g("section", { className: "jp-editor__section", children: [
2665
+ /* @__PURE__ */ g("div", { className: "jp-editor__section-head", children: [
2666
+ /* @__PURE__ */ s("span", { className: "jp-editor__field-label", children: "Keywords" }),
2667
+ /* @__PURE__ */ s("span", { className: "jp-editor__hint", children: "Each keyword is scraped and scored — the count is live corpus matches." })
2668
+ ] }),
2669
+ /* @__PURE__ */ g("div", { className: "jp-chips", children: [
2670
+ d.map((y) => /* @__PURE__ */ g("span", { className: "jp-chip", children: [
2671
+ y,
2672
+ /* @__PURE__ */ s(Qe, { count: x[y] ?? null }),
2673
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => he(y), "aria-label": `Remove ${y}`, children: "×" })
2674
+ ] }, y)),
2675
+ /* @__PURE__ */ s(
2676
+ "input",
2677
+ {
2678
+ className: "jp-chips__input",
2679
+ value: p,
2680
+ onChange: (y) => v(y.target.value),
2681
+ onKeyDown: _e,
2682
+ onBlur: () => ue(p),
2683
+ placeholder: d.length ? "Add…" : "python, llm, distributed systems"
2684
+ }
2685
+ )
2686
+ ] })
2687
+ ] }),
2688
+ /* @__PURE__ */ g("section", { className: "jp-editor__section", children: [
2689
+ /* @__PURE__ */ g("div", { className: "jp-editor__section-head", children: [
2690
+ /* @__PURE__ */ s("span", { className: "jp-editor__field-label", children: "Track" }),
2691
+ /* @__PURE__ */ s("span", { className: "jp-editor__hint", children: "Does the role have direct reports? A hard filter — jobs on the other track don’t appear in this profile’s feed at all." })
2692
+ ] }),
2693
+ /* @__PURE__ */ s("div", { className: "jp-role-picker", role: "radiogroup", "aria-label": "Track", children: wr.map((y) => {
2694
+ const C = _ === y.value;
2695
+ return /* @__PURE__ */ g(
2696
+ "button",
2697
+ {
2698
+ type: "button",
2699
+ role: "radio",
2700
+ "aria-checked": C,
2701
+ title: y.hint,
2702
+ className: C ? "jp-role-opt jp-role-opt--on" : "jp-role-opt",
2703
+ onClick: () => me(y.value),
2704
+ children: [
2705
+ y.label,
2706
+ C && y.value !== "either" && /* @__PURE__ */ s(Qe, { count: O })
2707
+ ]
2708
+ },
2709
+ y.value
2710
+ );
2711
+ }) })
2712
+ ] }),
2713
+ /* @__PURE__ */ g("section", { className: "jp-editor__section", children: [
2714
+ /* @__PURE__ */ g("div", { className: "jp-editor__section-head", children: [
2715
+ /* @__PURE__ */ s("span", { className: "jp-editor__field-label", children: "Levels" }),
2716
+ /* @__PURE__ */ s("span", { className: "jp-editor__hint", children: "Rungs on the ladder. Scored by distance — one rung off still counts, two doesn’t. Pick none to ignore level entirely." })
2717
+ ] }),
2718
+ /* @__PURE__ */ s("div", { className: "jp-role-picker", children: jt(_).map((y) => {
2719
+ const C = m.includes(y);
2720
+ return /* @__PURE__ */ g(
2721
+ "button",
2722
+ {
2723
+ type: "button",
2724
+ className: C ? "jp-role-opt jp-role-opt--on" : "jp-role-opt",
2725
+ onClick: () => fe(y),
2726
+ "aria-pressed": C,
2727
+ children: [
2728
+ zn[y],
2729
+ C && /* @__PURE__ */ s(Qe, { count: H[y] ?? null })
2730
+ ]
2731
+ },
2732
+ y
2733
+ );
2734
+ }) })
2735
+ ] }),
2736
+ /* @__PURE__ */ g("section", { className: "jp-editor__section", children: [
2737
+ /* @__PURE__ */ s("label", { className: "jp-editor__field-label", htmlFor: "jp-editor-remote", children: "Remote preference" }),
2738
+ /* @__PURE__ */ g(
2739
+ "select",
2740
+ {
2741
+ id: "jp-editor-remote",
2742
+ className: "jp-editor__text",
2743
+ value: j,
2744
+ onChange: (y) => w(y.target.value),
2745
+ children: [
2746
+ /* @__PURE__ */ s("option", { value: "any", children: "Any" }),
2747
+ /* @__PURE__ */ s("option", { value: "remote", children: "Remote" }),
2748
+ /* @__PURE__ */ s("option", { value: "hybrid", children: "Hybrid" }),
2749
+ /* @__PURE__ */ s("option", { value: "onsite", children: "Onsite" })
2750
+ ]
2751
+ }
2752
+ )
2753
+ ] }),
2754
+ /* @__PURE__ */ g("section", { className: "jp-editor__section", children: [
2755
+ /* @__PURE__ */ g("div", { className: "jp-editor__section-head", children: [
2756
+ /* @__PURE__ */ s("span", { className: "jp-editor__field-label", children: "Companies" }),
2757
+ /* @__PURE__ */ s("span", { className: "jp-editor__hint", children: "Optional. Empty = score the whole corpus; add companies to scope the feed." })
2758
+ ] }),
2759
+ o ? /* @__PURE__ */ s(
2760
+ vr,
2761
+ {
2762
+ auth: e,
2763
+ profileId: o,
2764
+ onCompaniesChanged: r
2765
+ }
2766
+ ) : /* @__PURE__ */ s("p", { className: "job-platform__companies-empty", children: "Create the profile first (below), then add the companies it should track." })
2767
+ ] })
2768
+ ] }),
2769
+ L && /* @__PURE__ */ s("p", { className: "jp-editor__error", children: L }),
2770
+ /* @__PURE__ */ g("div", { className: "jp-editor__footer", children: [
2771
+ W && !L && /* @__PURE__ */ s("span", { className: "jp-editor__saved", children: "Saved — add companies above, or close." }),
2772
+ /* @__PURE__ */ s("button", { type: "button", className: "jp-editor__cancel", onClick: a, children: o ? "Close" : "Cancel" }),
2773
+ /* @__PURE__ */ s(
2774
+ "button",
2775
+ {
2776
+ type: "button",
2777
+ className: "jp-editor__save",
2778
+ onClick: () => {
2779
+ J();
2780
+ },
2781
+ disabled: R || !l.trim(),
2782
+ children: R ? "Saving…" : o ? "Save changes" : "Create profile"
2783
+ }
2784
+ )
2785
+ ] })
2786
+ ]
2787
+ }
2788
+ ) });
2789
+ }
2790
+ async function br(e, t, a) {
2791
+ const n = await pr(e, t);
2792
+ let r = "";
2793
+ try {
2794
+ r = (await Zt(
2795
+ e,
2796
+ { resume_markdown: n.resume_markdown },
2797
+ t
2798
+ )).cover_letter_markdown || (await hr(e, t)).cover_letter_markdown;
2799
+ } catch {
2800
+ }
2801
+ const { url: o, slug: i } = await Xt(
2802
+ e,
2803
+ {
2804
+ resume_markdown: n.resume_markdown,
2805
+ ...r ? { cover_letter_markdown: r } : {}
2806
+ },
2807
+ t
2808
+ );
2809
+ return { slug: i, url: o, resume: n.resume_markdown, coverLetter: r };
2810
+ }
2811
+ async function kr(e, t, a) {
2812
+ a({ phase: "queueing" });
2813
+ try {
2814
+ await ea(e, "review", t), a({ phase: "queued" });
2815
+ } catch (n) {
2816
+ a({
2817
+ phase: "error",
2818
+ error: n instanceof le || n instanceof Error ? n.message : "Failed to hand this to the runner"
2819
+ });
2820
+ }
2821
+ }
2822
+ const Rr = [
2823
+ { reason: "pay", label: "Pay too low" },
2824
+ { reason: "location", label: "Wrong location" },
2825
+ { reason: "stack", label: "Wrong stack" },
2826
+ { reason: "domain", label: "Boring domain" },
2827
+ { reason: "level", label: "Wrong level" },
2828
+ { reason: "company", label: "Company" },
2829
+ { reason: "other", label: "Other" }
2830
+ ], jr = [
2831
+ { reason: "domain", label: "Exciting domain" },
2832
+ { reason: "comp", label: "Great comp" },
2833
+ { reason: "fit", label: "Great fit" },
2834
+ { reason: "company", label: "Dream company" },
2835
+ { reason: "other", label: "Other" }
2836
+ ];
2837
+ function ta({
2838
+ jobId: e,
2839
+ auth: t,
2840
+ vote: a,
2841
+ reasons: n,
2842
+ onVoteChange: r,
2843
+ disabled: o,
2844
+ align: i = "end"
2845
+ }) {
2846
+ const [l, c] = E(null), d = Pe(null), h = (m) => {
2847
+ if (a === m) {
2848
+ const w = n;
2849
+ c(null), r(e, null, []), dr(e).catch(() => r(e, m, w));
2850
+ return;
2851
+ }
2852
+ const f = a, j = n;
2853
+ r(e, m, []), kt(e, m, [], t).catch(() => r(e, f, j)), c(m);
2854
+ }, p = (m, f) => {
2855
+ const j = n, w = j.includes(f) ? j.filter((R) => R !== f) : [...j, f];
2856
+ r(e, m, w), kt(e, m, w, t).catch(() => r(e, m, j));
2857
+ };
2858
+ return /* @__PURE__ */ g(
2859
+ "div",
2860
+ {
2861
+ ref: d,
2862
+ className: `jp-vote${i === "start" ? " jp-vote--start" : ""}`,
2863
+ onBlur: (m) => {
2864
+ d.current?.contains(m.relatedTarget) || c(null);
2865
+ },
2866
+ onKeyDown: (m) => {
2867
+ m.key === "Escape" && l !== null && (m.stopPropagation(), c(null));
2868
+ },
2869
+ onClick: (m) => m.stopPropagation(),
2870
+ children: [
2871
+ /* @__PURE__ */ s(
2872
+ "button",
2873
+ {
2874
+ type: "button",
2875
+ className: `jp-vote__thumb jp-vote__thumb--up${a === 1 ? " jp-vote__thumb--active" : ""}`,
2876
+ disabled: o,
2877
+ onClick: () => h(1),
2878
+ "aria-pressed": a === 1,
2879
+ "aria-label": a === 1 ? "Clear upvote" : "Upvote",
2880
+ title: a === 1 ? "Clear upvote" : "Upvote",
2881
+ "data-testid": "vote-up",
2882
+ children: "👍"
2883
+ }
2884
+ ),
2885
+ /* @__PURE__ */ s(
2886
+ "button",
2887
+ {
2888
+ type: "button",
2889
+ className: `jp-vote__thumb jp-vote__thumb--down${a === -1 ? " jp-vote__thumb--active" : ""}`,
2890
+ disabled: o,
2891
+ onClick: () => h(-1),
2892
+ "aria-pressed": a === -1,
2893
+ "aria-label": a === -1 ? "Clear downvote" : "Downvote",
2894
+ title: a === -1 ? "Clear downvote" : "Downvote",
2895
+ "data-testid": "vote-down",
2896
+ children: "👎"
2897
+ }
2898
+ ),
2899
+ l !== null && /* @__PURE__ */ s("div", { className: "jp-vote__reasons", role: "menu", "aria-label": "Why?", "data-testid": "vote-reasons", children: (l === -1 ? Rr : jr).map(({ reason: m, label: f }) => /* @__PURE__ */ s(
2900
+ "button",
2901
+ {
2902
+ type: "button",
2903
+ role: "menuitemcheckbox",
2904
+ "aria-checked": n.includes(m),
2905
+ className: `jp-vote__reason${n.includes(m) ? " jp-vote__reason--active" : ""}`,
2906
+ onClick: () => p(l, m),
2907
+ "data-testid": `vote-reason-${m}`,
2908
+ children: f
2909
+ },
2910
+ m
2911
+ )) })
2912
+ ]
2913
+ }
2914
+ );
2915
+ }
2916
+ function Er(e, t) {
2917
+ if (e === null && t === null) return null;
2918
+ const a = (n) => n >= 1e3 ? `$${Math.round(n / 1e3)}k` : `$${n}`;
2919
+ return e && t ? `${a(e)}–${a(t)}` : a(e ?? t);
2920
+ }
2921
+ function Nr(e) {
2922
+ if (!e) return null;
2923
+ const t = new Date(e), a = Math.floor((Date.now() - t.getTime()) / 864e5);
2924
+ return a === 0 ? "today" : a === 1 ? "yesterday" : a < 30 ? `${a}d ago` : t.toLocaleDateString();
2925
+ }
2926
+ const Cr = {
2927
+ queued: "Queued",
2928
+ filled: "Filled",
2929
+ approved: "Approved",
2930
+ submitted: "Submitted",
2931
+ needs_manual: "Needs you",
2932
+ failed: "Failed",
2933
+ job_closed: "Closed"
2934
+ }, Sr = {
2935
+ idle: "Apply",
2936
+ waiting: "…",
2937
+ preparing: "…",
2938
+ queueing: "…",
2939
+ queued: "Queued",
2940
+ error: "Retry"
2941
+ };
2942
+ function Pr(e) {
2943
+ return e >= 0.75 ? "high" : e >= 0.5 ? "mid" : "low";
2944
+ }
2945
+ function $r({
2946
+ job: e,
2947
+ showScore: t,
2948
+ auth: a,
2949
+ vote: n,
2950
+ voteReasons: r,
2951
+ onClick: o,
2952
+ onVote: i,
2953
+ onApply: l,
2954
+ applyStatus: c
2955
+ }) {
2956
+ const d = Er(e.salary_min, e.salary_max), h = Nr(e.posted_date ?? e.scraped_at), p = t ? Pr(e.score) : null, v = e.state && e.state !== "new", _ = e.state !== null && e.state !== void 0, b = _, m = e.application_status ? "queued" : c?.phase ?? "idle", f = m === "waiting" || m === "preparing" || m === "queueing", j = ["jp-jobcard"];
2957
+ p && j.push(`jp-jobcard--score-${p}`), v && j.push(`jp-jobcard--state-${e.state}`), n === -1 && j.push("jp-jobcard--downvoted");
2958
+ const w = p ? `jp-jobcard__score jp-jobcard__score--${p}` : "jp-jobcard__score";
2959
+ return (
2960
+ // Not a <button>: the vote thumbs live inside the card, and buttons can't
2961
+ // nest. role+tabIndex+keydown keep it clickable and keyboard-activatable.
2962
+ /* @__PURE__ */ g(
2963
+ "div",
2964
+ {
2965
+ role: "button",
2966
+ tabIndex: 0,
2967
+ className: j.join(" "),
2968
+ onClick: o,
2969
+ onKeyDown: (R) => {
2970
+ R.target === R.currentTarget && (R.key === "Enter" || R.key === " ") && (R.preventDefault(), o());
2971
+ },
2972
+ children: [
2973
+ /* @__PURE__ */ g("div", { className: "jp-jobcard__top", children: [
2974
+ /* @__PURE__ */ s("span", { className: "jp-jobcard__title", children: e.title }),
2975
+ /* @__PURE__ */ g("div", { className: "jp-jobcard__top-right", children: [
2976
+ v && /* @__PURE__ */ s(
2977
+ "span",
2978
+ {
2979
+ className: `jp-jobcard__state jp-jobcard__state--${e.state}`,
2980
+ "data-testid": "card-state-badge",
2981
+ children: e.state
2982
+ }
2983
+ ),
2984
+ t && /* @__PURE__ */ s("span", { className: w, children: e.score.toFixed(2) }),
2985
+ _ && /* @__PURE__ */ s(
2986
+ ta,
2987
+ {
2988
+ jobId: e.id,
2989
+ auth: a,
2990
+ vote: n,
2991
+ reasons: r,
2992
+ onVoteChange: i
2993
+ }
2994
+ )
2995
+ ] })
2996
+ ] }),
2997
+ /* @__PURE__ */ g("div", { className: "jp-jobcard__meta", children: [
2998
+ /* @__PURE__ */ s("span", { className: "jp-jobcard__company", children: e.company }),
2999
+ /* @__PURE__ */ s("span", { className: "jp-jobcard__sep", children: "·" }),
3000
+ /* @__PURE__ */ s("span", { children: e.location || "location unknown" }),
3001
+ e.workplace_type && e.workplace_type !== "unknown" && /* @__PURE__ */ g(Ae, { children: [
3002
+ /* @__PURE__ */ s("span", { className: "jp-jobcard__sep", children: "·" }),
3003
+ /* @__PURE__ */ s("span", { children: e.workplace_type })
3004
+ ] })
3005
+ ] }),
3006
+ /* @__PURE__ */ g("div", { className: "jp-jobcard__footer", children: [
3007
+ d && /* @__PURE__ */ s("span", { className: "jp-jobcard__salary", children: d }),
3008
+ /* @__PURE__ */ g(
3009
+ "a",
3010
+ {
3011
+ className: "jp-jobcard__source jp-jobcard__source--link",
3012
+ href: e.url,
3013
+ target: "_blank",
3014
+ rel: "noopener noreferrer",
3015
+ onClick: (R) => R.stopPropagation(),
3016
+ title: "Open the original posting",
3017
+ children: [
3018
+ e.source_site,
3019
+ " ↗"
3020
+ ]
3021
+ }
3022
+ ),
3023
+ h && /* @__PURE__ */ s("span", { children: h }),
3024
+ /* @__PURE__ */ s(
3025
+ "button",
3026
+ {
3027
+ type: "button",
3028
+ className: `jp-jobcard__apply jp-jobcard__apply--${m}`,
3029
+ "data-testid": "card-apply",
3030
+ disabled: !b || f || m === "queued",
3031
+ title: b ? "Build the application packet and hand it to the form runner" : "Sign in to hand postings to the runner",
3032
+ onClick: (R) => {
3033
+ R.stopPropagation(), b && l(e.id);
3034
+ },
3035
+ children: e.application_status ? Cr[e.application_status] : Sr[m]
3036
+ }
3037
+ )
3038
+ ] })
3039
+ ]
3040
+ }
3041
+ )
3042
+ );
3043
+ }
3044
+ const xr = [
3045
+ { value: "", label: "All" },
3046
+ { value: "new", label: "New" },
3047
+ { value: "interested", label: "Interested" },
3048
+ { value: "saved", label: "Saved" },
3049
+ { value: "applied", label: "Applied" },
3050
+ { value: "interviewing", label: "Interviewing" },
3051
+ { value: "offered", label: "Offered" },
3052
+ { value: "rejected", label: "Rejected" },
3053
+ { value: "dismissed", label: "Dismissed" }
3054
+ ];
3055
+ function Lr({
3056
+ auth: e,
3057
+ profileId: t,
3058
+ onSelect: a,
3059
+ refreshKey: n,
3060
+ voteOverrides: r,
3061
+ onVote: o,
3062
+ stateOverrides: i,
3063
+ awaitingProfile: l
3064
+ }) {
3065
+ const [c, d] = E(1), [h, p] = E({}), [v, _] = E("score"), [b, m] = E(""), [f, j] = E(""), [w, R] = E(!0), [P, L] = E(""), U = 25, W = w && f === "", A = !t && v === "score" ? "date" : v, x = de(
3066
+ () => ({
3067
+ profile_id: t ?? void 0,
3068
+ state: f || void 0,
3069
+ page: c,
3070
+ limit: U,
3071
+ sort: A,
3072
+ workplace: P || void 0,
3073
+ // A posting handed to the runner belongs under Applications and Packets
3074
+ // from that point on. Leaving it in the feed offered an Apply button that
3075
+ // would queue it a second time.
3076
+ hide_queued: !0
3077
+ }),
3078
+ [t, f, c, U, A, P]
3079
+ ), {
3080
+ data: F,
3081
+ loading: H,
3082
+ refreshing: k,
3083
+ error: O
3084
+ } = Je(`jobs:${n ?? 0}:${JSON.stringify(x)}`, () => lr(x), {
3085
+ enabled: !l
3086
+ }), I = de(() => F?.jobs ?? [], [F]), T = F?.total ?? 0, G = O ? O instanceof le ? O.message : "Failed to load jobs" : null;
3087
+ Q(() => {
3088
+ d(1);
3089
+ }, [t, A, f, P]);
3090
+ const z = de(
3091
+ () => I.map((N) => i[N.id] ? { ...N, state: i[N.id] } : N),
3092
+ [I, i]
3093
+ ), ue = de(() => {
3094
+ const N = new Set(
3095
+ Object.entries(h).filter(([, M]) => M.phase === "queued").map(([M]) => M)
3096
+ );
3097
+ let J = W ? z.filter((M) => M.state !== "dismissed") : z;
3098
+ if (J = J.filter((M) => !N.has(M.id) && !M.application_status), b.trim()) {
3099
+ const M = b.toLowerCase();
3100
+ J = J.filter(
3101
+ (y) => y.title.toLowerCase().includes(M) || y.company.toLowerCase().includes(M) || y.location.toLowerCase().includes(M)
3102
+ );
3103
+ }
3104
+ return J;
3105
+ }, [z, b, W, h]), _e = oe(
3106
+ (N) => {
3107
+ kr(
3108
+ N,
3109
+ e,
3110
+ (J) => p((M) => ({ ...M, [N]: J }))
3111
+ );
3112
+ },
3113
+ [e]
3114
+ ), he = de(() => {
3115
+ const N = Object.values(h).filter((J) => J.phase === "error");
3116
+ return N.length === 0 ? null : /* @__PURE__ */ s("p", { className: "jp-error", children: N.length === 1 ? N[0].error : `${N.length} postings failed — press Retry.` });
3117
+ }, [h]), fe = Math.max(1, Math.ceil(T / U)), me = z.some((N) => N.state !== null && N.state !== void 0);
3118
+ return /* @__PURE__ */ g("div", { className: "jp-jobs", children: [
3119
+ /* @__PURE__ */ g("div", { className: "jp-jobs__filters", children: [
3120
+ /* @__PURE__ */ s(
3121
+ "input",
3122
+ {
3123
+ type: "search",
3124
+ placeholder: "Search title / company / location",
3125
+ value: b,
3126
+ onChange: (N) => m(N.target.value),
3127
+ className: "jp-jobs__search"
3128
+ }
3129
+ ),
3130
+ /* @__PURE__ */ g("label", { className: "jp-jobs__filter", children: [
3131
+ "Sort",
3132
+ /* @__PURE__ */ g("select", { value: A, onChange: (N) => _(N.target.value), children: [
3133
+ t && /* @__PURE__ */ s("option", { value: "score", children: "Score" }),
3134
+ t && /* @__PURE__ */ s("option", { value: "comp", children: "Comp lens" }),
3135
+ t && /* @__PURE__ */ s("option", { value: "interest", children: "Interest lens" }),
3136
+ t && /* @__PURE__ */ s("option", { value: "relevance", children: "Relevance lens" }),
3137
+ /* @__PURE__ */ s("option", { value: "date", children: "Date" }),
3138
+ /* @__PURE__ */ s("option", { value: "salary", children: "Salary" })
3139
+ ] })
3140
+ ] }),
3141
+ /* @__PURE__ */ g("label", { className: "jp-jobs__filter", children: [
3142
+ "Workplace",
3143
+ /* @__PURE__ */ g(
3144
+ "select",
3145
+ {
3146
+ value: P,
3147
+ onChange: (N) => L(N.target.value),
3148
+ children: [
3149
+ /* @__PURE__ */ s("option", { value: "", children: "All" }),
3150
+ /* @__PURE__ */ s("option", { value: "remote", children: "Remote" }),
3151
+ /* @__PURE__ */ s("option", { value: "hybrid", children: "Hybrid" }),
3152
+ /* @__PURE__ */ s("option", { value: "onsite", children: "Onsite" })
3153
+ ]
3154
+ }
3155
+ )
3156
+ ] }),
3157
+ me && /* @__PURE__ */ g("label", { className: "jp-jobs__filter", children: [
3158
+ "State",
3159
+ /* @__PURE__ */ s(
3160
+ "select",
3161
+ {
3162
+ value: f,
3163
+ onChange: (N) => j(N.target.value),
3164
+ children: xr.map((N) => /* @__PURE__ */ s("option", { value: N.value, children: N.label }, N.value || "all"))
3165
+ }
3166
+ )
3167
+ ] }),
3168
+ me && f === "" && /* @__PURE__ */ g("label", { className: "jp-jobs__filter", children: [
3169
+ /* @__PURE__ */ s(
3170
+ "input",
3171
+ {
3172
+ type: "checkbox",
3173
+ checked: w,
3174
+ onChange: (N) => R(N.target.checked)
3175
+ }
3176
+ ),
3177
+ "Hide dismissed"
3178
+ ] })
3179
+ ] }),
3180
+ !t && /* @__PURE__ */ s("p", { className: "jp-muted", children: e.signedIn ? "No profile selected. Showing all jobs, unscored. Pick or create a profile to see its companies’ jobs, scored and ranked." : "Showing every job in the corpus, newest first. Scoring and ranking need a profile, which needs an account." }),
3181
+ G && /* @__PURE__ */ s("p", { className: "jp-error", children: G }),
3182
+ he,
3183
+ H ? /* @__PURE__ */ s("p", { className: "jp-muted", children: "Loading jobs…" }) : ue.length === 0 ? /* @__PURE__ */ s("p", { className: "jp-muted", children: T === 0 ? "No jobs match your filters." : "No matches for the current search." }) : /* @__PURE__ */ s("ul", { className: "jp-jobs__list", "data-refreshing": k ? "true" : void 0, children: ue.map((N) => {
3184
+ const J = r[N.id], M = J ? J.vote : N.vote ?? null, y = J ? J.reasons : N.vote_reasons ?? [];
3185
+ return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
3186
+ $r,
3187
+ {
3188
+ job: N,
3189
+ showScore: !!t,
3190
+ auth: e,
3191
+ vote: M,
3192
+ voteReasons: y,
3193
+ onClick: () => a(N.id, M),
3194
+ onVote: o,
3195
+ onApply: _e,
3196
+ applyStatus: h[N.id]
3197
+ }
3198
+ ) }, N.id);
3199
+ }) }),
3200
+ T > U && /* @__PURE__ */ g("div", { className: "jp-jobs__pagination", children: [
3201
+ /* @__PURE__ */ s("button", { type: "button", disabled: c <= 1, onClick: () => d((N) => N - 1), children: "← Prev" }),
3202
+ /* @__PURE__ */ g("span", { children: [
3203
+ "Page ",
3204
+ c,
3205
+ " / ",
3206
+ fe,
3207
+ " · ",
3208
+ T,
3209
+ " total"
3210
+ ] }),
3211
+ /* @__PURE__ */ s("button", { type: "button", disabled: c >= fe, onClick: () => d((N) => N + 1), children: "Next →" })
3212
+ ] })
3213
+ ] });
3214
+ }
3215
+ const Tr = $e(
3216
+ () => import("./ApplicationTracking-BhpParbe.js").then((e) => ({ default: e.ApplicationTracking }))
3217
+ ), Et = {
3218
+ relevance: "Relevance",
3219
+ level_match: "Level",
3220
+ geo_fit: "Geo/Remote",
3221
+ comp_fit: "Comp",
3222
+ stack_fit: "Stack",
3223
+ domain_interest: "Interest",
3224
+ discipline_factor: "Discipline"
3225
+ }, Ar = [
3226
+ [
3227
+ { state: "interested", label: "Interested", verb: "Mark interested" },
3228
+ { state: "saved", label: "Saved", verb: "Save" },
3229
+ { state: "dismissed", label: "Dismissed", verb: "Dismiss" }
3230
+ ],
3231
+ [
3232
+ { state: "applied", label: "Applied", verb: "Mark applied" },
3233
+ { state: "interviewing", label: "Interviewing", verb: "Interviewing" },
3234
+ { state: "offered", label: "Offered", verb: "Offer" },
3235
+ { state: "rejected", label: "Rejected", verb: "Rejected" }
3236
+ ]
3237
+ ];
3238
+ function Or({ text: e }) {
3239
+ return e ? /<(p|br|div|li|ul|ol|h[1-6])\b/i.test(e) ? /* @__PURE__ */ s("div", { className: "jp-drawer__description", dangerouslySetInnerHTML: { __html: e } }) : /* @__PURE__ */ s("div", { className: "jp-drawer__description jp-drawer__description--plain", children: e }) : /* @__PURE__ */ s("p", { className: "jp-drawer__description jp-muted", children: /* @__PURE__ */ s("em", { children: "No description" }) });
3240
+ }
3241
+ function ie({
3242
+ label: e,
3243
+ value: t,
3244
+ rows: a = 4,
3245
+ hint: n
3246
+ }) {
3247
+ const [r, o] = E(!1), i = Pe(null);
3248
+ return Q(
3249
+ () => () => {
3250
+ i.current && clearTimeout(i.current);
3251
+ },
3252
+ []
3253
+ ), /* @__PURE__ */ g("div", { className: "jp-drawer__kit-field", children: [
3254
+ /* @__PURE__ */ g("div", { className: "jp-drawer__kit-field-head", children: [
3255
+ /* @__PURE__ */ s("span", { className: "jp-drawer__kit-field-label", children: e }),
3256
+ n && /* @__PURE__ */ s("span", { className: "jp-muted jp-drawer__kit-field-hint", children: n }),
3257
+ /* @__PURE__ */ s("button", { type: "button", className: "jp-drawer__kit-copy", onClick: () => {
3258
+ navigator.clipboard?.writeText(t).then(() => {
3259
+ o(!0), i.current && clearTimeout(i.current), i.current = setTimeout(() => o(!1), 2e3);
3260
+ });
3261
+ }, children: r ? "Copied ✓" : "Copy" })
3262
+ ] }),
3263
+ /* @__PURE__ */ s(
3264
+ "textarea",
3265
+ {
3266
+ className: "jp-drawer__packet-text",
3267
+ readOnly: !0,
3268
+ rows: a,
3269
+ value: t,
3270
+ onFocus: (c) => c.currentTarget.select()
3271
+ }
3272
+ )
3273
+ ] });
3274
+ }
3275
+ function Dr({ tier: e, verified: t }) {
3276
+ if (t)
3277
+ return /* @__PURE__ */ s("p", { className: "jp-apply-tier jp-apply-tier--verified", children: "Auto-apply verified — the runner has filled a form on this board before." });
3278
+ const n = {
3279
+ supported: "The runner should be able to fill this form; it has not driven this board yet.",
3280
+ embedded: "This employer hosts its own careers page, but the form underneath is one the runner knows. Not tried on this board yet.",
3281
+ unsupported: "No adapter for this ATS — this one is by hand.",
3282
+ unknown: null
3283
+ }[e];
3284
+ return n ? /* @__PURE__ */ s("p", { className: `jp-apply-tier jp-apply-tier--${e}`, children: n }) : null;
3285
+ }
3286
+ function Fr({
3287
+ auth: e,
3288
+ jobId: t,
3289
+ profileId: a,
3290
+ initialVote: n,
3291
+ onClose: r,
3292
+ onStateChange: o,
3293
+ onVoteChange: i,
3294
+ onTrackingChange: l
3295
+ }) {
3296
+ const [c, d] = E(null), [h, p] = E(null), [v, _] = E(null), [b, m] = E(n ?? null), [f, j] = E([]), [w, R] = E(!1), [P, L] = E(null), [U, W] = E(null), [A, x] = E(null), [F, H] = E(null), [k, O] = E(!1), [I, T] = E(null), [G, z] = E(null), [ue, _e] = E(!1), [he, fe] = E(!1), [me, N] = E(null), [J, M] = E(null), [y, C] = E(!1), {
3297
+ data: S,
3298
+ loading: be,
3299
+ error: ke
3300
+ } = Je(
3301
+ `job:${t}:${a ?? ""}`,
3302
+ () => cr(t, a ?? void 0)
3303
+ ), se = c ?? (ke ? ke instanceof le ? ke.message : "Failed to load job" : null);
3304
+ Q(() => {
3305
+ d(null), p(null), m(n ?? null), L(null), W(null), x(null), H(null), T(null), z(null), fe(!1), N(null), M(null), C(!1);
3306
+ }, [t, a, n]), Q(() => {
3307
+ S && p(S.state);
3308
+ }, [S]), Q(() => {
3309
+ const $ = (q) => {
3310
+ q.key === "Escape" && r();
3311
+ };
3312
+ return window.addEventListener("keydown", $), () => window.removeEventListener("keydown", $);
3313
+ }, [r]);
3314
+ const aa = async ($) => {
3315
+ if (!v) {
3316
+ _($), d(null);
3317
+ try {
3318
+ const te = await ur(t, $, e, $ === "applied" ? G ?? void 0 : void 0);
3319
+ p(te.state), We(`job:${t}:`), o?.(t, te.state);
3320
+ } catch (q) {
3321
+ d(q instanceof le ? q.message : "Failed to update state");
3322
+ } finally {
3323
+ _(null);
3324
+ }
3325
+ }
3326
+ }, dt = async () => {
3327
+ if (w) return null;
3328
+ R(!0), W(null), H(null), x(null), T(null), z(null), M(null), C(!1);
3329
+ try {
3330
+ const $ = await br(t, e, () => {
3331
+ });
3332
+ L({ resume: $.resume, coverLetter: $.coverLetter }), T($.url), z($.slug);
3333
+ try {
3334
+ const q = await Zt(t, { resume_markdown: $.resume }, e);
3335
+ x(q);
3336
+ } catch (q) {
3337
+ H(
3338
+ q instanceof le ? q.message : "Failed to generate the application kit"
3339
+ );
3340
+ }
3341
+ return $.slug;
3342
+ } catch ($) {
3343
+ return W($ instanceof le ? $.message : "Failed to generate résumé"), null;
3344
+ } finally {
3345
+ R(!1);
3346
+ }
3347
+ }, na = () => {
3348
+ dt();
3349
+ }, ra = async () => {
3350
+ if (!(!P || k)) {
3351
+ O(!0), M(null);
3352
+ try {
3353
+ const { url: $, slug: q } = await Xt(
3354
+ t,
3355
+ { resume_markdown: P.resume, cover_letter_markdown: P.coverLetter },
3356
+ e
3357
+ );
3358
+ T($), z(q);
3359
+ } catch ($) {
3360
+ M($ instanceof le ? $.message : "Failed to create link");
3361
+ } finally {
3362
+ O(!1);
3363
+ }
3364
+ }
3365
+ };
3366
+ async function oa() {
3367
+ _e(!0), N(null);
3368
+ try {
3369
+ if (!(G ?? await dt())) {
3370
+ N(
3371
+ "The application packet could not be built, so there is nothing to queue — see the error above."
3372
+ );
3373
+ return;
3374
+ }
3375
+ await ea(t, "review", e), fe(!0);
3376
+ } catch ($) {
3377
+ N($ instanceof le ? $.message : "Failed to queue the application");
3378
+ } finally {
3379
+ _e(!1);
3380
+ }
3381
+ }
3382
+ const sa = () => {
3383
+ I && navigator.clipboard?.writeText(I).then(
3384
+ () => {
3385
+ C(!0), setTimeout(() => C(!1), 2e3);
3386
+ },
3387
+ () => M("Copy failed — select the link and copy manually")
3388
+ );
3389
+ }, Ne = h !== null;
3390
+ return /* @__PURE__ */ g(Ae, { children: [
3391
+ /* @__PURE__ */ s("div", { className: "jp-drawer-backdrop", onClick: r }),
3392
+ /* @__PURE__ */ g("aside", { className: "jp-drawer", role: "dialog", "aria-labelledby": "jp-drawer-title", children: [
3393
+ /* @__PURE__ */ s("div", { className: "jp-drawer__header", children: /* @__PURE__ */ s("button", { type: "button", className: "jp-drawer__close", onClick: r, "aria-label": "Close", children: "×" }) }),
3394
+ be && /* @__PURE__ */ s("p", { className: "jp-muted", children: "Loading…" }),
3395
+ se && /* @__PURE__ */ s("p", { className: "jp-error", children: se }),
3396
+ S && /* @__PURE__ */ g(Ae, { children: [
3397
+ /* @__PURE__ */ s("h2", { id: "jp-drawer-title", className: "jp-drawer__title", children: S.title }),
3398
+ /* @__PURE__ */ g("p", { className: "jp-drawer__company", children: [
3399
+ S.company,
3400
+ " · ",
3401
+ S.location || "location unknown",
3402
+ S.workplace_type && S.workplace_type !== "unknown" && ` · ${S.workplace_type}`
3403
+ ] }),
3404
+ /* @__PURE__ */ g("div", { className: "jp-drawer__facts", children: [
3405
+ /* @__PURE__ */ s("span", { children: S.source_site }),
3406
+ S.job_type && S.job_type !== "unknown" && /* @__PURE__ */ s("span", { children: S.job_type }),
3407
+ (S.salary_min || S.salary_max) && /* @__PURE__ */ g("span", { children: [
3408
+ "$",
3409
+ S.salary_min ?? "?",
3410
+ " – $",
3411
+ S.salary_max ?? "?"
3412
+ ] }),
3413
+ S.posted_date && /* @__PURE__ */ g("span", { children: [
3414
+ "Posted ",
3415
+ S.posted_date
3416
+ ] }),
3417
+ h && h !== "new" && /* @__PURE__ */ s(
3418
+ "span",
3419
+ {
3420
+ className: `jp-drawer__facts-state jp-drawer__facts-state--${h}`,
3421
+ "data-testid": "drawer-state-badge",
3422
+ children: h
3423
+ }
3424
+ )
3425
+ ] }),
3426
+ a && /* @__PURE__ */ g("section", { className: "jp-drawer__section", children: [
3427
+ /* @__PURE__ */ s("h3", { children: "Score breakdown" }),
3428
+ /* @__PURE__ */ g("div", { className: "jp-drawer__score-total", children: [
3429
+ "Total: ",
3430
+ /* @__PURE__ */ s("strong", { children: S.score.toFixed(2) })
3431
+ ] }),
3432
+ /* @__PURE__ */ s("ul", { className: "jp-drawer__breakdown", children: Object.keys(Et).map(($) => /* @__PURE__ */ g("li", { children: [
3433
+ /* @__PURE__ */ s("span", { className: "jp-drawer__breakdown-label", children: Et[$] }),
3434
+ /* @__PURE__ */ s("div", { className: "jp-drawer__breakdown-bar", children: /* @__PURE__ */ s(
3435
+ "div",
3436
+ {
3437
+ className: "jp-drawer__breakdown-fill",
3438
+ style: { width: `${Math.min(100, S.score_breakdown[$] * 100)}%` }
3439
+ }
3440
+ ) }),
3441
+ /* @__PURE__ */ s("span", { className: "jp-drawer__breakdown-value", children: S.score_breakdown[$].toFixed(2) })
3442
+ ] }, $)) })
3443
+ ] }),
3444
+ /* @__PURE__ */ g("section", { className: "jp-drawer__section", children: [
3445
+ /* @__PURE__ */ s("h3", { children: "Description" }),
3446
+ /* @__PURE__ */ s(Or, { text: S.description })
3447
+ ] }),
3448
+ /* @__PURE__ */ g("section", { className: "jp-drawer__section", children: [
3449
+ /* @__PURE__ */ s("h3", { children: "Triage" }),
3450
+ !Ne && /* @__PURE__ */ s("p", { className: "jp-muted", children: "Sign in to track your interest in this job." }),
3451
+ /* @__PURE__ */ s("div", { className: "jp-drawer__vote", children: /* @__PURE__ */ s(
3452
+ ta,
3453
+ {
3454
+ jobId: t,
3455
+ auth: e,
3456
+ vote: b,
3457
+ reasons: f,
3458
+ disabled: !Ne,
3459
+ align: "start",
3460
+ onVoteChange: ($, q, te) => {
3461
+ m(q), j(te), i?.($, q, te);
3462
+ }
3463
+ }
3464
+ ) }),
3465
+ Ar.map(($, q) => /* @__PURE__ */ s("div", { className: "jp-drawer__actions jp-drawer__actions--states", children: $.map(({ state: te, label: ia, verb: la }) => {
3466
+ const qe = h === te, ca = v === te;
3467
+ return /* @__PURE__ */ s(
3468
+ "button",
3469
+ {
3470
+ type: "button",
3471
+ className: `jp-drawer__cta jp-drawer__cta--state-${te}${qe ? " jp-drawer__cta--active" : ""}`,
3472
+ disabled: !Ne || v !== null,
3473
+ onClick: () => {
3474
+ aa(te);
3475
+ },
3476
+ "aria-pressed": qe,
3477
+ "data-testid": `state-action-${te}`,
3478
+ children: ca ? "…" : qe ? ia : la
3479
+ },
3480
+ te
3481
+ );
3482
+ }) }, q))
3483
+ ] }),
3484
+ h && h !== "new" && /* @__PURE__ */ s(St, { fallback: /* @__PURE__ */ s("p", { className: "jp-muted", children: "Loading tracking…" }), children: /* @__PURE__ */ s(
3485
+ Tr,
3486
+ {
3487
+ auth: e,
3488
+ jobId: t,
3489
+ state: h,
3490
+ tracking: S.tracking,
3491
+ onChanged: () => l?.()
3492
+ },
3493
+ t
3494
+ ) }),
3495
+ /* @__PURE__ */ g("section", { className: "jp-drawer__section", children: [
3496
+ /* @__PURE__ */ s("h3", { children: "Apply" }),
3497
+ /* @__PURE__ */ s(Dr, { tier: S.apply_tier, verified: S.apply_verified }),
3498
+ /* @__PURE__ */ g("div", { className: "jp-drawer__actions", children: [
3499
+ /* @__PURE__ */ g(
3500
+ "a",
3501
+ {
3502
+ className: "jp-drawer__cta jp-drawer__cta--primary",
3503
+ href: S.application_url ?? S.url,
3504
+ target: "_blank",
3505
+ rel: "noopener noreferrer",
3506
+ children: [
3507
+ "Apply on ",
3508
+ S.source_site
3509
+ ]
3510
+ }
3511
+ ),
3512
+ /* @__PURE__ */ s(
3513
+ "button",
3514
+ {
3515
+ type: "button",
3516
+ className: "jp-drawer__cta",
3517
+ onClick: na,
3518
+ disabled: !Ne || w,
3519
+ "data-testid": "prepare-application",
3520
+ children: w ? "Preparing…" : P ? "Regenerate application" : "Prepare application"
3521
+ }
3522
+ )
3523
+ ] }),
3524
+ U && /* @__PURE__ */ s("p", { className: "jp-error", children: U }),
3525
+ /* @__PURE__ */ g("div", { className: "jp-drawer__apply", children: [
3526
+ /* @__PURE__ */ s(
3527
+ "button",
3528
+ {
3529
+ type: "button",
3530
+ className: "jp-drawer__cta jp-drawer__cta--primary",
3531
+ onClick: () => {
3532
+ oa();
3533
+ },
3534
+ disabled: !Ne || ue || he || w,
3535
+ "data-testid": "queue-application",
3536
+ title: G ? "Queue this application for the form runner" : "Builds the application packet, then queues it for the form runner",
3537
+ children: he ? "Queued ✓" : ue ? G ? "Queueing…" : "Preparing, then queueing…" : "Hand to runner"
3538
+ }
3539
+ ),
3540
+ /* @__PURE__ */ s("span", { className: "jp-muted", children: he ? "Fills, then waits for your approval." : "Review mode — nothing is sent without your approval." })
3541
+ ] }),
3542
+ me && /* @__PURE__ */ s("p", { className: "jp-error", children: me }),
3543
+ P && /* @__PURE__ */ g("div", { className: "jp-drawer__packet", children: [
3544
+ /* @__PURE__ */ s(ie, { label: "Tailored résumé", value: P.resume, rows: 12 }),
3545
+ P.coverLetter && /* @__PURE__ */ s(ie, { label: "Cover letter", value: P.coverLetter, rows: 12 }),
3546
+ /* @__PURE__ */ s("div", { className: "jp-drawer__packet-link", children: I ? /* @__PURE__ */ g(Ae, { children: [
3547
+ /* @__PURE__ */ s(
3548
+ "input",
3549
+ {
3550
+ className: "jp-drawer__packet-link-input",
3551
+ readOnly: !0,
3552
+ value: I,
3553
+ onFocus: ($) => $.currentTarget.select(),
3554
+ "aria-label": "Shareable packet link"
3555
+ }
3556
+ ),
3557
+ /* @__PURE__ */ s("button", { type: "button", className: "jp-drawer__cta", onClick: sa, children: y ? "Copied ✓" : "Copy" }),
3558
+ /* @__PURE__ */ s(
3559
+ "a",
3560
+ {
3561
+ className: "jp-drawer__cta",
3562
+ href: I,
3563
+ target: "_blank",
3564
+ rel: "noopener noreferrer",
3565
+ children: "Open"
3566
+ }
3567
+ )
3568
+ ] }) : /* @__PURE__ */ s(
3569
+ "button",
3570
+ {
3571
+ type: "button",
3572
+ className: "jp-drawer__cta jp-drawer__cta--primary",
3573
+ onClick: () => {
3574
+ ra();
3575
+ },
3576
+ disabled: k || !P.coverLetter,
3577
+ children: k ? "Creating link…" : "Create shareable link"
3578
+ }
3579
+ ) }),
3580
+ J && /* @__PURE__ */ s("p", { className: "jp-error", children: J }),
3581
+ w && !A && /* @__PURE__ */ s("p", { className: "jp-muted", children: "Preparing the rest of the kit…" }),
3582
+ F && /* @__PURE__ */ s("p", { className: "jp-error", children: F }),
3583
+ A && /* @__PURE__ */ g("div", { className: "jp-drawer__kit", children: [
3584
+ /* @__PURE__ */ s(ie, { label: "Intro email", value: A.intro_email, rows: 8 }),
3585
+ /* @__PURE__ */ s(ie, { label: "Why this role", value: A.why_hook, rows: 3 }),
3586
+ A.screening_answers.map(($, q) => /* @__PURE__ */ s(ie, { label: $.q, value: $.a, rows: 4 }, q)),
3587
+ /* @__PURE__ */ s(
3588
+ ie,
3589
+ {
3590
+ label: "Expected compensation",
3591
+ value: A.salary_line,
3592
+ rows: 2
3593
+ }
3594
+ ),
3595
+ /* @__PURE__ */ s(
3596
+ ie,
3597
+ {
3598
+ label: "LinkedIn note",
3599
+ value: A.linkedin_note,
3600
+ rows: 3,
3601
+ hint: `${A.linkedin_note.length}/300`
3602
+ }
3603
+ ),
3604
+ /* @__PURE__ */ s(
3605
+ ie,
3606
+ {
3607
+ label: "Phone-screen talking points",
3608
+ value: A.talking_points.map(($) => `• ${$}`).join(`
3609
+ `),
3610
+ rows: Math.max(3, A.talking_points.length)
3611
+ }
3612
+ ),
3613
+ /* @__PURE__ */ s(
3614
+ ie,
3615
+ {
3616
+ label: "Standard fields",
3617
+ value: A.standard_fields,
3618
+ rows: 8,
3619
+ hint: "name · contact · work auth"
3620
+ }
3621
+ )
3622
+ ] })
3623
+ ] })
3624
+ ] })
3625
+ ] })
3626
+ ] })
3627
+ ] });
3628
+ }
3629
+ const Ur = $e(
3630
+ () => import("./ApplicationsList-DDjncd7P.js").then((e) => ({ default: e.ApplicationsList }))
3631
+ ), Ir = $e(
3632
+ () => import("./PacketsList-llRBP10u.js").then((e) => ({ default: e.PacketsList }))
3633
+ ), Mr = $e(
3634
+ () => import("./PacketDetail-KOXrbMqc.js").then((e) => ({ default: e.PacketDetail }))
3635
+ ), Br = $e(
3636
+ () => import("./PipelineBoard-BLmNwNaq.js").then((e) => ({ default: e.PipelineBoard }))
3637
+ ), Hr = /* @__PURE__ */ s("p", { className: "jp-muted", children: "Loading…" });
3638
+ function Wr(e = {}) {
3639
+ const t = Pe(null);
3640
+ return /* @__PURE__ */ s(ha, { theme: e.theme, containerRef: t, children: /* @__PURE__ */ s(Jr, { ...e, containerRef: t }) });
3641
+ }
3642
+ function Jr(e) {
3643
+ const { containerRef: t } = e, a = !!e.userType && e.userType !== "public", n = de(() => ({ signedIn: a }), [a]), [r] = E(() => window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)").matches : !1), { theme: o, isDarkTheme: i, isThemeReady: l, isInitialThemeLoad: c } = fa();
3644
+ return c && !l ? /* @__PURE__ */ s(da, { isDarkTheme: r }) : /* @__PURE__ */ s(
3645
+ "main",
3646
+ {
3647
+ ref: t,
3648
+ className: "job-platform-container",
3649
+ "data-theme": o,
3650
+ "data-dark-theme": i ? "true" : "false",
3651
+ children: /* @__PURE__ */ s(In, { children: /* @__PURE__ */ g("div", { className: "job-platform", children: [
3652
+ /* @__PURE__ */ s(pa, { title: e.appName ?? "Job Platform" }),
3653
+ /* @__PURE__ */ s(qr, {}),
3654
+ /* @__PURE__ */ s(St, { fallback: Hr, children: /* @__PURE__ */ g(fn, { children: [
3655
+ /* @__PURE__ */ g(ne, { element: /* @__PURE__ */ s(Qr, { auth: n }), children: [
3656
+ /* @__PURE__ */ s(ne, { index: !0, element: null }),
3657
+ /* @__PURE__ */ s(ne, { path: "jobs/:jobId", element: /* @__PURE__ */ s(Nt, { auth: n, base: "/" }) })
3658
+ ] }),
3659
+ /* @__PURE__ */ g(ne, { path: "pipeline", element: /* @__PURE__ */ s(Kr, { auth: n }), children: [
3660
+ /* @__PURE__ */ s(ne, { index: !0, element: null }),
3661
+ /* @__PURE__ */ s(
3662
+ ne,
3663
+ {
3664
+ path: "jobs/:jobId",
3665
+ element: /* @__PURE__ */ s(Nt, { auth: n, base: "/pipeline" })
3666
+ }
3667
+ )
3668
+ ] }),
3669
+ /* @__PURE__ */ s(ne, { path: "applications", element: /* @__PURE__ */ s(Vr, { auth: n }) }),
3670
+ /* @__PURE__ */ s(ne, { path: "packets", element: /* @__PURE__ */ s(Gr, { auth: n }) }),
3671
+ /* @__PURE__ */ s(ne, { path: "packets/:jobId/:slug", element: /* @__PURE__ */ s(zr, { auth: n }) }),
3672
+ /* @__PURE__ */ s(ne, { path: "*", element: /* @__PURE__ */ s(Kt, { to: "/", replace: !0 }) })
3673
+ ] }) })
3674
+ ] }) })
3675
+ }
3676
+ );
3677
+ }
3678
+ function qr() {
3679
+ const { pathname: e } = ee(), t = e.startsWith("/packets") ? "packets" : e.startsWith("/applications") ? "applications" : e.startsWith("/pipeline") ? "pipeline" : "feed";
3680
+ return /* @__PURE__ */ g("nav", { className: "job-platform__nav", children: [
3681
+ /* @__PURE__ */ s(Re, { to: "/", className: t === "feed" ? "active" : void 0, children: "Feed" }),
3682
+ /* @__PURE__ */ s(Re, { to: "/pipeline", className: t === "pipeline" ? "active" : void 0, children: "Pipeline" }),
3683
+ /* @__PURE__ */ s(Re, { to: "/applications", className: t === "applications" ? "active" : void 0, children: "Applications" }),
3684
+ /* @__PURE__ */ s(Re, { to: "/packets", className: t === "packets" ? "active" : void 0, children: "Packets" })
3685
+ ] });
3686
+ }
3687
+ function Kr({ auth: e }) {
3688
+ const t = pe(), [a, n] = E(0), r = oe(() => n((i) => i + 1), []), o = de(
3689
+ () => ({ onJobStateChanged: r, onTrackingChanged: r }),
3690
+ [r]
3691
+ );
3692
+ return /* @__PURE__ */ g("section", { className: "jp-main", children: [
3693
+ /* @__PURE__ */ s(
3694
+ Br,
3695
+ {
3696
+ auth: e,
3697
+ reloadKey: a,
3698
+ onSelect: (i) => {
3699
+ t(`/pipeline/jobs/${encodeURIComponent(i)}`);
3700
+ }
3701
+ }
3702
+ ),
3703
+ /* @__PURE__ */ s(Vt, { context: o })
3704
+ ] });
3705
+ }
3706
+ function Vr({ auth: e }) {
3707
+ return /* @__PURE__ */ s("section", { className: "jp-main", children: /* @__PURE__ */ s(Ur, { auth: e }) });
3708
+ }
3709
+ function Gr({ auth: e }) {
3710
+ const t = pe();
3711
+ return /* @__PURE__ */ s("section", { className: "jp-main", children: /* @__PURE__ */ s(
3712
+ Ir,
3713
+ {
3714
+ auth: e,
3715
+ onSelect: (a) => {
3716
+ t(
3717
+ `/packets/${encodeURIComponent(a.job_id)}/${encodeURIComponent(a.variant_slug)}`
3718
+ );
3719
+ }
3720
+ }
3721
+ ) });
3722
+ }
3723
+ function zr({ auth: e }) {
3724
+ const { jobId: t, slug: a } = Ht(), n = pe();
3725
+ return !t || !a ? /* @__PURE__ */ s(Kt, { to: "/packets", replace: !0 }) : /* @__PURE__ */ s(Mr, { auth: e, jobId: t, slug: a, onClose: () => {
3726
+ n("/packets");
3727
+ } });
3728
+ }
3729
+ const at = "jobplatform:last-profile";
3730
+ function Yr() {
3731
+ try {
3732
+ return window.localStorage.getItem(at);
3733
+ } catch {
3734
+ return null;
3735
+ }
3736
+ }
3737
+ function Qr({ auth: e }) {
3738
+ const [t, a] = Qt(), n = pe(), r = oe(
3739
+ (x) => {
3740
+ try {
3741
+ x ? window.localStorage.setItem(at, x) : window.localStorage.removeItem(at);
3742
+ } catch {
3743
+ }
3744
+ a(
3745
+ (F) => {
3746
+ const H = new URLSearchParams(F);
3747
+ return x ? H.set("profile", x) : H.delete("profile"), H;
3748
+ },
3749
+ { replace: !0 }
3750
+ );
3751
+ },
3752
+ [a]
3753
+ ), [o] = E(() => t.get("profile") ? null : Yr());
3754
+ Q(() => {
3755
+ o && !t.get("profile") && r(o);
3756
+ }, [o, t, r]);
3757
+ const i = t.get("profile") ?? o, [l, c] = E(!1), d = oe((x) => c(x === 0), []), h = e.signedIn && !i && !l, [p, v] = E(0), _ = oe(() => {
3758
+ We("jobs:"), v((x) => x + 1);
3759
+ }, []), [b, m] = E({}), f = oe(
3760
+ (x, F) => m((H) => ({ ...H, [x]: F })),
3761
+ []
3762
+ ), [j, w] = E({}), R = oe(
3763
+ (x, F, H) => {
3764
+ w((k) => ({ ...k, [x]: { vote: F, reasons: H } }));
3765
+ },
3766
+ []
3767
+ ), [P, L] = E(null), [U, W] = E(0), A = de(
3768
+ () => ({ onJobStateChanged: f, onJobVoted: R }),
3769
+ [f, R]
3770
+ );
3771
+ return /* @__PURE__ */ g("div", { className: "jp-dashboard", children: [
3772
+ /* @__PURE__ */ s(
3773
+ ir,
3774
+ {
3775
+ auth: e,
3776
+ selectedId: i,
3777
+ onSelect: r,
3778
+ onNew: () => L({ mode: "new" }),
3779
+ onEdit: (x) => L({ mode: "edit", profile: x }),
3780
+ reloadKey: U,
3781
+ onResolved: d
3782
+ }
3783
+ ),
3784
+ /* @__PURE__ */ s("section", { className: "jp-main", children: /* @__PURE__ */ s(
3785
+ Lr,
3786
+ {
3787
+ auth: e,
3788
+ profileId: i,
3789
+ refreshKey: p,
3790
+ voteOverrides: j,
3791
+ onVote: R,
3792
+ stateOverrides: b,
3793
+ awaitingProfile: h,
3794
+ onSelect: (x, F) => {
3795
+ const H = i ? `?profile=${encodeURIComponent(i)}` : "";
3796
+ n(`/jobs/${encodeURIComponent(x)}${H}`, { state: { vote: F } });
3797
+ }
3798
+ }
3799
+ ) }),
3800
+ /* @__PURE__ */ s(Vt, { context: A }),
3801
+ P && /* @__PURE__ */ s(
3802
+ _r,
3803
+ {
3804
+ auth: e,
3805
+ initial: P.mode === "edit" ? P.profile : null,
3806
+ onClose: () => L(null),
3807
+ onSaved: (x) => {
3808
+ W((F) => F + 1), r(x.id), _();
3809
+ },
3810
+ onCompaniesChanged: _
3811
+ }
3812
+ )
3813
+ ] });
3814
+ }
3815
+ function Nt({ auth: e, base: t }) {
3816
+ const { jobId: a } = Ht(), [n] = Qt(), r = n.get("profile"), o = pe(), i = ee(), l = Qa();
3817
+ if (!a) return null;
3818
+ const c = i.state?.vote ?? null;
3819
+ return /* @__PURE__ */ s(
3820
+ Fr,
3821
+ {
3822
+ auth: e,
3823
+ jobId: a,
3824
+ profileId: r,
3825
+ initialVote: c,
3826
+ onClose: () => {
3827
+ const h = r ? `?profile=${encodeURIComponent(r)}` : "";
3828
+ o(`${t}${h}`);
3829
+ },
3830
+ onStateChange: (h, p) => l.onJobStateChanged(h, p),
3831
+ onVoteChange: l.onJobVoted,
3832
+ onTrackingChange: l.onTrackingChanged
3833
+ }
3834
+ );
3835
+ }
3836
+ function ho(e, t = {}) {
3837
+ const a = ua(e);
3838
+ a.render(/* @__PURE__ */ s(Wr, { ...t })), e.__root = a, Ct.info("[job-platform] Mounted successfully", { theme: t.theme });
3839
+ }
3840
+ function fo(e) {
3841
+ e.__root?.unmount(), Ct.info("[job-platform] Unmounted successfully");
3842
+ }
3843
+ export {
3844
+ Or as D,
3845
+ le as J,
3846
+ lo as a,
3847
+ po as b,
3848
+ oo as c,
3849
+ so as d,
3850
+ ro as e,
3851
+ uo as f,
3852
+ cr as g,
3853
+ ur as h,
3854
+ We as i,
3855
+ D as j,
3856
+ fo as k,
3857
+ io as l,
3858
+ ho as m,
3859
+ co as s,
3860
+ Je as u
3861
+ };