stone-kit 0.0.1028 → 0.0.1030
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +1 -1
- package/dist/FilterWithSave-BWA01WwU.js +2476 -0
- package/dist/{Menu-CdJTzN7T.js → Menu-CeBSiTyP.js} +176 -157
- package/dist/{Option-rFBMQAPk.js → Option-DU8cvBnA.js} +1 -1
- package/dist/Router.js +1 -1
- package/dist/components/Button/ui/Button.d.ts +1 -0
- package/dist/components/Button/ui/Button.js +1 -1
- package/dist/components/Button/ui/Button.types.d.ts +1 -0
- package/dist/components/CheckBox/CheckBox.d.ts +1 -0
- package/dist/components/CheckBox/CheckBox.js +1 -1
- package/dist/components/CheckBox/CheckBox.types.d.ts +1 -0
- package/dist/components/CheckBoxNew/CheckBox.types.d.ts +1 -0
- package/dist/components/CheckBoxNew/CheckBoxNew.d.ts +1 -0
- package/dist/components/CheckBoxNew/CheckBoxNew.js +17 -17
- package/dist/components/CheckboxSelect/ui/CheckboxSelect.d.ts +1 -0
- package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +34 -34
- package/dist/components/CommercialLotCard/CommercialLotCard.d.ts +1 -0
- package/dist/components/CommercialLotCard/CommercialLotCard.js +7 -50
- package/dist/components/CommercialLotCard/components/Price/Price.d.ts +1 -0
- package/dist/components/CommercialLotCard/components/Price/Price.js +24 -23
- package/dist/components/CommercialLotCard/components/Snippets/Snippets.d.ts +1 -0
- package/dist/components/CommercialLotCard/components/Snippets/Snippets.js +27 -98
- package/dist/components/CommercialLotCard/components/Tags/Tags.d.ts +1 -0
- package/dist/components/CommercialLotCard/components/Tags/Tags.js +17 -17
- package/dist/components/CommercialLotCard/types/CommercialLotCard.types.d.ts +1 -0
- package/dist/components/CommercialLotCard/types/LotCard.d.ts +1 -0
- package/dist/components/CommercialLotCard/utils/formatPrice.js +2 -1
- package/dist/components/CommercialLotCard/utils/getTagsFeatures.d.ts +2 -1
- package/dist/components/DestinationTab/ui/DestinationTab.d.ts +1 -0
- package/dist/components/DestinationTab/ui/DestinationTab.js +41 -41
- package/dist/components/DestinationTab/ui/DestinationTab.types.d.ts +1 -0
- package/dist/components/FieldInput/ui/FieldInput.d.ts +1 -0
- package/dist/components/FieldInput/ui/FieldInput.types.d.ts +1 -0
- package/dist/components/FilterWithSave/hooks/useFilterWithSave.d.ts +1 -0
- package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +26 -54
- package/dist/components/FilterWithSave/ui/FilterWithSave.d.ts +1 -0
- package/dist/components/FilterWithSave/ui/FilterWithSave.js +7 -328
- package/dist/components/Flex/ui/Flex.d.ts +1 -0
- package/dist/components/Flex/ui/Flex.js +1 -1
- package/dist/components/Flex/ui/Flex.types.d.ts +1 -0
- package/dist/components/FormModal/ui/ModalForm.js +28 -1430
- package/dist/components/GroupedInput/ui/GroupedInputs.d.ts +1 -0
- package/dist/components/GroupedInput/ui/GroupedInputs.js +1 -1
- package/dist/components/GroupedInput/ui/GroupedInputs.types.d.ts +1 -0
- package/dist/components/Input/ui/Input.d.ts +2 -1
- package/dist/components/Input/ui/Input.js +304 -234
- package/dist/components/Logo/ui/Logo.d.ts +1 -0
- package/dist/components/Logo/ui/Logo.js +6 -6
- package/dist/components/LotCard/hooks/useLotCard.d.ts +1 -0
- package/dist/components/LotCard/hooks/useLotCard.js +24 -6
- package/dist/components/LotCard/index.js +2 -2
- package/dist/components/LotCard/ui/LotCard.d.ts +1 -0
- package/dist/components/LotCard/ui/LotCard.js +10 -213
- package/dist/components/LotCard/ui/LotCard.types.d.ts +1 -0
- package/dist/components/LotCard/utils/formatPrice.js +2 -1
- package/dist/components/LotCard/utils/getTagsFeatures.d.ts +2 -1
- package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +1 -1
- package/dist/components/MetroLabel/ui/MetroLabel.d.ts +1 -0
- package/dist/components/MetroLabel/ui/MetroLabel.js +16 -16
- package/dist/components/MetroLabel/ui/MetroLabel.types.d.ts +1 -0
- package/dist/components/MetroTag/ui/MetroTag.d.ts +1 -0
- package/dist/components/MetroTag/ui/MetroTag.js +74 -74
- package/dist/components/MetroTag/ui/MetroTag.types.d.ts +1 -0
- package/dist/components/Modal/ui/Modal.d.ts +1 -0
- package/dist/components/Modal/ui/Modal.js +37 -34
- package/dist/components/Modal/ui/Modal.types.d.ts +1 -0
- package/dist/components/ModalSuccess/ModalSuccess.d.ts +1 -0
- package/dist/components/ModalSuccess/ModalSuccess.js +19 -18
- package/dist/components/ModalSuccess/ModalSuccess.types.d.ts +1 -0
- package/dist/components/NewIcon/icons/PinTrans.d.ts +1 -0
- package/dist/components/NewIcon/icons/SmallFilter.d.ts +1 -0
- package/dist/components/NewIcon/ui/NewIcon.d.ts +1 -0
- package/dist/components/NewIcon/ui/NewIcon.js +3 -3
- package/dist/components/NewIcon/ui/NewIcon.types.d.ts +1 -0
- package/dist/components/NewIcon/ui/iconTypes.d.ts +1 -0
- package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +11 -9
- package/dist/components/RoundButton/ui/RoundButton.d.ts +1 -0
- package/dist/components/RoundButton/ui/RoundButton.js +2 -2
- package/dist/components/RoundButton/ui/RoundButton.types.d.ts +1 -0
- package/dist/components/Select/model/selectMode.d.ts +1 -0
- package/dist/components/Select/model/selectMode.js +30 -30
- package/dist/components/Select/ui/Category.d.ts +1 -0
- package/dist/components/Select/ui/Category.js +3 -3
- package/dist/components/Select/ui/Option.d.ts +1 -0
- package/dist/components/Select/ui/Option.js +2 -2
- package/dist/components/Select/ui/Select.d.ts +1 -0
- package/dist/components/Select/ui/Select.js +115 -115
- package/dist/components/SliderNavigation/index.d.ts +1 -0
- package/dist/components/SliderNavigation/ui/SliderNavigation.d.ts +1 -0
- package/dist/components/SliderNavigation/ui/SliderNavigation.js +6 -6
- package/dist/components/SortSelect/hooks/useSortSelect.d.ts +2 -1
- package/dist/components/SortSelect/hooks/useSortSelect.js +2 -2
- package/dist/components/SortSelect/index.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.d.ts +1 -0
- package/dist/components/SortSelect/ui/SortSelect.js +26 -108
- package/dist/components/SortSelect/ui/SortSelect.types.d.ts +1 -0
- package/dist/components/SummarySelect/ui/SummarySelect.d.ts +1 -0
- package/dist/components/SummarySelect/ui/SummarySelect.js +65 -59
- package/dist/components/Switcher/ui/Switcher.d.ts +1 -0
- package/dist/components/Switcher/ui/Switcher.js +1 -1
- package/dist/components/Switcher/ui/Switcher.types.d.ts +1 -0
- package/dist/components/TabSelect/ui/TabSelect.d.ts +13 -7
- package/dist/components/TabSelect/ui/TabSelect.js +42 -37
- package/dist/components/TabSwitcher/index.js +2 -2
- package/dist/components/TabSwitcher/ui/TabSwitcher.d.ts +5 -3
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +26 -118
- package/dist/components/TabSwitcher/ui/TabSwitcher.types.d.ts +2 -1
- package/dist/components/Tag/ui/Tag.d.ts +1 -0
- package/dist/components/Tag/ui/Tag.js +91 -91
- package/dist/components/Tag/ui/Tag.types.d.ts +1 -0
- package/dist/components/Text/ui/Text.d.ts +1 -0
- package/dist/components/Text/ui/Text.js +1 -1
- package/dist/components/Text/ui/Text.types.d.ts +1 -0
- package/dist/components/TextArea/TextArea.d.ts +9 -0
- package/dist/components/TextArea/TextArea.js +18 -12
- package/dist/components/ZoomControls/ui/ZoomControls.d.ts +1 -0
- package/dist/components/ZoomControls/ui/ZoomControls.types.d.ts +1 -0
- package/dist/components/mobileButton/ui/MobileButton.d.ts +1 -0
- package/dist/components/mobileButton/ui/MobileButton.js +1 -1
- package/dist/components/mobileButton/ui/MobileButton.types.d.ts +1 -0
- package/dist/{index-CBdtKu-u.js → index-DmANy9jd.js} +271 -272
- package/dist/{index-3E04UaC2.js → index-DvCs2JPX.js} +9629 -9529
- package/dist/index-rKuIKazb.js +45 -0
- package/dist/layout/Layout.d.ts +1 -0
- package/dist/layout/components/Header/Header.js +71 -48
- package/dist/layout/components/Menu.js +24 -2
- package/dist/main.js +65 -70
- package/dist/pages/ButtonsPage/Buttons.js +63 -57
- package/dist/pages/FormsPage/FormsPage.js +50 -26
- package/dist/pages/IconsPage/IconsPage.js +31 -9
- package/dist/pages/InputPage/InputPage.js +32 -10
- package/dist/pages/LogoPage/LogoPage.js +35 -13
- package/dist/pages/LotsPage/LotsPage.js +17 -18
- package/dist/pages/LotsPage/const.d.ts +1 -0
- package/dist/pages/ModalsPage/ModalPage.js +66 -46
- package/dist/pages/SelectPage/SelectPage.js +58 -58
- package/dist/pages/TabsPage/TabsPage.js +20 -19
- package/dist/pages/TagsPage/TagsPage.js +44 -23
- package/dist/shared/checkLargeOffice.d.ts +1 -0
- package/dist/shared/checkLargeOffice.js +1 -1
- package/dist/shared/mlnRound.js +2 -1
- package/dist/stories/entities/CommercialLotCard/CommercialLotCard.stories.js +2 -2
- package/dist/stories/shared/ui/Button/Button.stories.js +5 -5
- package/dist/stories/shared/ui/CheckBox/CheckBox.stories.js +1 -1
- package/dist/stories/shared/ui/CheckBox/CheckBoxNew.stories.js +1 -1
- package/dist/stories/shared/ui/CheckboxSelect/CheckboxSelect.stories.js +1 -1
- package/dist/stories/shared/ui/DestinationTab/DestinationTab.stories.js +1 -1
- package/dist/stories/shared/ui/FieldInput/FieldInput.stories.js +1 -1
- package/dist/stories/shared/ui/FilterWithSave/FilterWithSave.stories.js +2 -2
- package/dist/stories/shared/ui/FormModal/FormModal.stories.js +8 -8
- package/dist/stories/shared/ui/GroupedInput/GroupedInput.stories.js +1 -1
- package/dist/stories/shared/ui/Logo/Logo.stories.js +1 -1
- package/dist/stories/shared/ui/MobileButton/MobileButton.stories.js +1 -1
- package/dist/stories/shared/ui/Modal/Modal.stories.js +1 -1
- package/dist/stories/shared/ui/ModalSuccess/ModalSuccess.stories.js +1 -1
- package/dist/stories/shared/ui/RoundButton/RoundButton.stories.js +1 -1
- package/dist/stories/shared/ui/Select/Select.stories.js +1 -1
- package/dist/stories/shared/ui/SliderNavigation/SliderNavigation.stories.js +1 -1
- package/dist/stories/shared/ui/SortSelect/SortSelect.stories.js +2 -2
- package/dist/stories/shared/ui/SummarySelect/SummarySelect.stories.js +1 -1
- package/dist/stories/shared/ui/Switcher/Switcher.stories.js +1 -1
- package/dist/stories/shared/ui/TabSelect/TabSelect.stories.js +1 -1
- package/dist/stories/shared/ui/TabSwitcher/TabSwitcher.stories.js +2 -2
- package/dist/stories/shared/ui/Tag/Tag.stories.js +4 -4
- package/dist/stories/shared/ui/ZoomControls/ZoomControls.stories.js +1 -1
- package/dist/style.css +1 -0
- package/dist/useSortSelect-BTCEVMVn.js +80 -0
- package/package.json +22 -31
- package/dist/ButtonState.module-DtW3aevR.js +0 -8
- package/dist/components/TextArea/TextArea.types.d.ts +0 -10
- package/dist/components/TextArea/TextArea.types.js +0 -1
- package/dist/index-B2JRaoNz.js +0 -48
- package/dist/pages/ButtonsPage/ButtonState/ButtonState.d.ts +0 -6
- package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +0 -121
- package/dist/stone-kit.css +0 -1
- package/dist/useLotCard-DG9doKCX.js +0 -186
- package/dist/useSortSelect-C72ddcYI.js +0 -80
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
2
|
/**
|
|
3
|
-
* @remix-run/router v1.
|
|
3
|
+
* @remix-run/router v1.19.0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -23,20 +23,20 @@ var R;
|
|
|
23
23
|
(function(e) {
|
|
24
24
|
e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
|
|
25
25
|
})(R || (R = {}));
|
|
26
|
-
const
|
|
27
|
-
function
|
|
26
|
+
const z = "popstate";
|
|
27
|
+
function Ye(e) {
|
|
28
28
|
e === void 0 && (e = {});
|
|
29
29
|
function t(r, a) {
|
|
30
30
|
let {
|
|
31
31
|
pathname: o,
|
|
32
|
-
search:
|
|
32
|
+
search: l,
|
|
33
33
|
hash: u
|
|
34
34
|
} = r.location;
|
|
35
|
-
return
|
|
35
|
+
return W(
|
|
36
36
|
"",
|
|
37
37
|
{
|
|
38
38
|
pathname: o,
|
|
39
|
-
search:
|
|
39
|
+
search: l,
|
|
40
40
|
hash: u
|
|
41
41
|
},
|
|
42
42
|
// state defaults to `null` because `window.history.state` does
|
|
@@ -45,9 +45,9 @@ function Ke(e) {
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
function n(r, a) {
|
|
48
|
-
return typeof a == "string" ? a :
|
|
48
|
+
return typeof a == "string" ? a : G(a);
|
|
49
49
|
}
|
|
50
|
-
return
|
|
50
|
+
return se(t, n, null, e);
|
|
51
51
|
}
|
|
52
52
|
function f(e, t) {
|
|
53
53
|
if (e === !1 || e === null || typeof e > "u")
|
|
@@ -62,17 +62,17 @@ function b(e, t) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function ie() {
|
|
66
66
|
return Math.random().toString(36).substr(2, 8);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function A(e, t) {
|
|
69
69
|
return {
|
|
70
70
|
usr: e.state,
|
|
71
71
|
key: e.key,
|
|
72
72
|
idx: t
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function W(e, t, n, r) {
|
|
76
76
|
return n === void 0 && (n = null), D({
|
|
77
77
|
pathname: typeof e == "string" ? e : e.pathname,
|
|
78
78
|
search: "",
|
|
@@ -83,10 +83,10 @@ function j(e, t, n, r) {
|
|
|
83
83
|
// full Locations now and avoid the need to run through this flow at all
|
|
84
84
|
// But that's a pretty big refactor to the current test suite so going to
|
|
85
85
|
// keep as is for the time being and just let any incoming keys take precedence
|
|
86
|
-
key: t && t.key || r ||
|
|
86
|
+
key: t && t.key || r || ie()
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function G(e) {
|
|
90
90
|
let {
|
|
91
91
|
pathname: t = "/",
|
|
92
92
|
search: n = "",
|
|
@@ -104,24 +104,24 @@ function O(e) {
|
|
|
104
104
|
}
|
|
105
105
|
return t;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function se(e, t, n, r) {
|
|
108
108
|
r === void 0 && (r = {});
|
|
109
109
|
let {
|
|
110
110
|
window: a = document.defaultView,
|
|
111
111
|
v5Compat: o = !1
|
|
112
|
-
} = r,
|
|
113
|
-
d == null && (d = 0,
|
|
112
|
+
} = r, l = a.history, u = R.Pop, i = null, d = h();
|
|
113
|
+
d == null && (d = 0, l.replaceState(D({}, l.state, {
|
|
114
114
|
idx: d
|
|
115
115
|
}), ""));
|
|
116
116
|
function h() {
|
|
117
|
-
return (
|
|
117
|
+
return (l.state || {
|
|
118
118
|
idx: null
|
|
119
119
|
}).idx;
|
|
120
120
|
}
|
|
121
121
|
function c() {
|
|
122
122
|
u = R.Pop;
|
|
123
123
|
let p = h(), E = p == null ? null : p - d;
|
|
124
|
-
d = p,
|
|
124
|
+
d = p, i && i({
|
|
125
125
|
action: u,
|
|
126
126
|
location: g.location,
|
|
127
127
|
delta: E
|
|
@@ -129,35 +129,35 @@ function ue(e, t, n, r) {
|
|
|
129
129
|
}
|
|
130
130
|
function m(p, E) {
|
|
131
131
|
u = R.Push;
|
|
132
|
-
let v =
|
|
132
|
+
let v = W(g.location, p, E);
|
|
133
133
|
d = h() + 1;
|
|
134
|
-
let
|
|
134
|
+
let N = A(v, d), L = g.createHref(v);
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
l.pushState(N, "", L);
|
|
137
137
|
} catch (I) {
|
|
138
138
|
if (I instanceof DOMException && I.name === "DataCloneError")
|
|
139
139
|
throw I;
|
|
140
140
|
a.location.assign(L);
|
|
141
141
|
}
|
|
142
|
-
o &&
|
|
142
|
+
o && i && i({
|
|
143
143
|
action: u,
|
|
144
144
|
location: g.location,
|
|
145
145
|
delta: 1
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function x(p, E) {
|
|
149
149
|
u = R.Replace;
|
|
150
|
-
let v =
|
|
150
|
+
let v = W(g.location, p, E);
|
|
151
151
|
d = h();
|
|
152
|
-
let
|
|
153
|
-
|
|
152
|
+
let N = A(v, d), L = g.createHref(v);
|
|
153
|
+
l.replaceState(N, "", L), o && i && i({
|
|
154
154
|
action: u,
|
|
155
155
|
location: g.location,
|
|
156
156
|
delta: 0
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
function y(p) {
|
|
160
|
-
let E = a.location.origin !== "null" ? a.location.origin : a.location.href, v = typeof p == "string" ? p :
|
|
160
|
+
let E = a.location.origin !== "null" ? a.location.origin : a.location.href, v = typeof p == "string" ? p : G(p);
|
|
161
161
|
return v = v.replace(/ $/, "%20"), f(E, "No window.location.(origin|href) available to create URL for href: " + v), new URL(v, E);
|
|
162
162
|
}
|
|
163
163
|
let g = {
|
|
@@ -165,13 +165,13 @@ function ue(e, t, n, r) {
|
|
|
165
165
|
return u;
|
|
166
166
|
},
|
|
167
167
|
get location() {
|
|
168
|
-
return e(a,
|
|
168
|
+
return e(a, l);
|
|
169
169
|
},
|
|
170
170
|
listen(p) {
|
|
171
|
-
if (
|
|
171
|
+
if (i)
|
|
172
172
|
throw new Error("A history only accepts one active listener");
|
|
173
|
-
return a.addEventListener(
|
|
174
|
-
a.removeEventListener(
|
|
173
|
+
return a.addEventListener(z, c), i = p, () => {
|
|
174
|
+
a.removeEventListener(z, c), i = null;
|
|
175
175
|
};
|
|
176
176
|
},
|
|
177
177
|
createHref(p) {
|
|
@@ -187,9 +187,9 @@ function ue(e, t, n, r) {
|
|
|
187
187
|
};
|
|
188
188
|
},
|
|
189
189
|
push: m,
|
|
190
|
-
replace:
|
|
190
|
+
replace: x,
|
|
191
191
|
go(p) {
|
|
192
|
-
return
|
|
192
|
+
return l.go(p);
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
return g;
|
|
@@ -198,71 +198,72 @@ var J;
|
|
|
198
198
|
(function(e) {
|
|
199
199
|
e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error";
|
|
200
200
|
})(J || (J = {}));
|
|
201
|
-
function
|
|
202
|
-
return n === void 0 && (n = "/"),
|
|
201
|
+
function ue(e, t, n) {
|
|
202
|
+
return n === void 0 && (n = "/"), ce(e, t, n, !1);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
let a = typeof t == "string" ? O(t) : t, o =
|
|
204
|
+
function ce(e, t, n, r) {
|
|
205
|
+
let a = typeof t == "string" ? O(t) : t, o = Q(a.pathname || "/", n);
|
|
206
206
|
if (o == null)
|
|
207
207
|
return null;
|
|
208
|
-
let
|
|
209
|
-
|
|
208
|
+
let l = K(e);
|
|
209
|
+
de(l);
|
|
210
210
|
let u = null;
|
|
211
|
-
for (let
|
|
212
|
-
let d =
|
|
213
|
-
u = xe(i
|
|
211
|
+
for (let i = 0; u == null && i < l.length; ++i) {
|
|
212
|
+
let d = Re(o);
|
|
213
|
+
u = xe(l[i], d, r);
|
|
214
214
|
}
|
|
215
215
|
return u;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function K(e, t, n, r) {
|
|
218
218
|
t === void 0 && (t = []), n === void 0 && (n = []), r === void 0 && (r = "");
|
|
219
|
-
let a = (o,
|
|
220
|
-
let
|
|
219
|
+
let a = (o, l, u) => {
|
|
220
|
+
let i = {
|
|
221
221
|
relativePath: u === void 0 ? o.path || "" : u,
|
|
222
222
|
caseSensitive: o.caseSensitive === !0,
|
|
223
|
-
childrenIndex:
|
|
223
|
+
childrenIndex: l,
|
|
224
224
|
route: o
|
|
225
225
|
};
|
|
226
|
-
|
|
227
|
-
let d = C([r,
|
|
226
|
+
i.relativePath.startsWith("/") && (f(i.relativePath.startsWith(r), 'Absolute route path "' + i.relativePath + '" nested under path ' + ('"' + r + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."), i.relativePath = i.relativePath.slice(r.length));
|
|
227
|
+
let d = C([r, i.relativePath]), h = n.concat(i);
|
|
228
228
|
o.children && o.children.length > 0 && (f(
|
|
229
229
|
// Our types know better, but runtime JS may not!
|
|
230
230
|
// @ts-expect-error
|
|
231
231
|
o.index !== !0,
|
|
232
232
|
"Index routes must not have child routes. Please remove " + ('all child routes from route path "' + d + '".')
|
|
233
|
-
),
|
|
233
|
+
), K(o.children, t, h, d)), !(o.path == null && !o.index) && t.push({
|
|
234
234
|
path: d,
|
|
235
|
-
score:
|
|
235
|
+
score: Ee(d, o.index),
|
|
236
236
|
routesMeta: h
|
|
237
237
|
});
|
|
238
238
|
};
|
|
239
|
-
return e.forEach((o,
|
|
239
|
+
return e.forEach((o, l) => {
|
|
240
240
|
var u;
|
|
241
241
|
if (o.path === "" || !((u = o.path) != null && u.includes("?")))
|
|
242
|
-
a(o,
|
|
242
|
+
a(o, l);
|
|
243
243
|
else
|
|
244
|
-
for (let
|
|
245
|
-
a(o,
|
|
244
|
+
for (let i of X(o.path))
|
|
245
|
+
a(o, l, i);
|
|
246
246
|
}), t;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function X(e) {
|
|
249
249
|
let t = e.split("/");
|
|
250
|
-
if (t.length === 0)
|
|
250
|
+
if (t.length === 0)
|
|
251
|
+
return [];
|
|
251
252
|
let [n, ...r] = t, a = n.endsWith("?"), o = n.replace(/\?$/, "");
|
|
252
253
|
if (r.length === 0)
|
|
253
254
|
return a ? [o, ""] : [o];
|
|
254
|
-
let
|
|
255
|
-
return u.push(...
|
|
255
|
+
let l = X(r.join("/")), u = [];
|
|
256
|
+
return u.push(...l.map((i) => i === "" ? o : [o, i].join("/"))), a && u.push(...l), u.map((i) => e.startsWith("/") && i === "" ? "/" : i);
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
-
e.sort((t, n) => t.score !== n.score ? n.score - t.score :
|
|
258
|
+
function de(e) {
|
|
259
|
+
e.sort((t, n) => t.score !== n.score ? n.score - t.score : ye(t.routesMeta.map((r) => r.childrenIndex), n.routesMeta.map((r) => r.childrenIndex)));
|
|
259
260
|
}
|
|
260
|
-
const
|
|
261
|
-
function
|
|
261
|
+
const he = /^:[\w-]+$/, pe = 3, fe = 2, me = 1, ve = 10, ge = -2, H = (e) => e === "*";
|
|
262
|
+
function Ee(e, t) {
|
|
262
263
|
let n = e.split("/"), r = n.length;
|
|
263
|
-
return n.some(
|
|
264
|
+
return n.some(H) && (r += ge), t && (r += fe), n.filter((a) => !H(a)).reduce((a, o) => a + (he.test(o) ? pe : o === "" ? me : ve), r);
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
+
function ye(e, t) {
|
|
266
267
|
return e.length === t.length && e.slice(0, -1).every((r, a) => r === t[a]) ? (
|
|
267
268
|
// If two routes are siblings, we should try to match the earlier sibling
|
|
268
269
|
// first. This allows people to have fine-grained control over the matching
|
|
@@ -278,77 +279,83 @@ function Ne(e, t) {
|
|
|
278
279
|
function xe(e, t, n) {
|
|
279
280
|
let {
|
|
280
281
|
routesMeta: r
|
|
281
|
-
} = e, a = {}, o = "/",
|
|
282
|
+
} = e, a = {}, o = "/", l = [];
|
|
282
283
|
for (let u = 0; u < r.length; ++u) {
|
|
283
|
-
let
|
|
284
|
-
path:
|
|
285
|
-
caseSensitive:
|
|
284
|
+
let i = r[u], d = u === r.length - 1, h = o === "/" ? t : t.slice(o.length) || "/", c = Y({
|
|
285
|
+
path: i.relativePath,
|
|
286
|
+
caseSensitive: i.caseSensitive,
|
|
286
287
|
end: d
|
|
287
|
-
}, h), m =
|
|
288
|
-
if (!c
|
|
288
|
+
}, h), m = i.route;
|
|
289
|
+
if (!c && d && n && !r[r.length - 1].route.index && (c = Y({
|
|
290
|
+
path: i.relativePath,
|
|
291
|
+
caseSensitive: i.caseSensitive,
|
|
292
|
+
end: !1
|
|
293
|
+
}, h)), !c)
|
|
289
294
|
return null;
|
|
290
|
-
Object.assign(a, c.params),
|
|
295
|
+
Object.assign(a, c.params), l.push({
|
|
291
296
|
// TODO: Can this as be avoided?
|
|
292
297
|
params: a,
|
|
293
298
|
pathname: C([o, c.pathname]),
|
|
294
|
-
pathnameBase:
|
|
299
|
+
pathnameBase: we(C([o, c.pathnameBase])),
|
|
295
300
|
route: m
|
|
296
301
|
}), c.pathnameBase !== "/" && (o = C([o, c.pathnameBase]));
|
|
297
302
|
}
|
|
298
|
-
return
|
|
303
|
+
return l;
|
|
299
304
|
}
|
|
300
|
-
function
|
|
305
|
+
function Y(e, t) {
|
|
301
306
|
typeof e == "string" && (e = {
|
|
302
307
|
path: e,
|
|
303
308
|
caseSensitive: !1,
|
|
304
309
|
end: !0
|
|
305
310
|
});
|
|
306
|
-
let [n, r] =
|
|
307
|
-
if (!a)
|
|
308
|
-
|
|
311
|
+
let [n, r] = Ne(e.path, e.caseSensitive, e.end), a = t.match(n);
|
|
312
|
+
if (!a)
|
|
313
|
+
return null;
|
|
314
|
+
let o = a[0], l = o.replace(/(.)\/+$/, "$1"), u = a.slice(1);
|
|
309
315
|
return {
|
|
310
316
|
params: r.reduce((d, h, c) => {
|
|
311
317
|
let {
|
|
312
318
|
paramName: m,
|
|
313
|
-
isOptional:
|
|
319
|
+
isOptional: x
|
|
314
320
|
} = h;
|
|
315
321
|
if (m === "*") {
|
|
316
322
|
let g = u[c] || "";
|
|
317
|
-
|
|
323
|
+
l = o.slice(0, o.length - g.length).replace(/(.)\/+$/, "$1");
|
|
318
324
|
}
|
|
319
325
|
const y = u[c];
|
|
320
|
-
return
|
|
326
|
+
return x && !y ? d[m] = void 0 : d[m] = (y || "").replace(/%2F/g, "/"), d;
|
|
321
327
|
}, {}),
|
|
322
328
|
pathname: o,
|
|
323
|
-
pathnameBase:
|
|
329
|
+
pathnameBase: l,
|
|
324
330
|
pattern: e
|
|
325
331
|
};
|
|
326
332
|
}
|
|
327
|
-
function
|
|
333
|
+
function Ne(e, t, n) {
|
|
328
334
|
t === void 0 && (t = !1), n === void 0 && (n = !0), b(e === "*" || !e.endsWith("*") || e.endsWith("/*"), 'Route path "' + e + '" will be treated as if it were ' + ('"' + e.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + e.replace(/\*$/, "/*") + '".'));
|
|
329
|
-
let r = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (
|
|
335
|
+
let r = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (l, u, i) => (r.push({
|
|
330
336
|
paramName: u,
|
|
331
|
-
isOptional:
|
|
332
|
-
}),
|
|
337
|
+
isOptional: i != null
|
|
338
|
+
}), i ? "/?([^\\/]+)?" : "/([^\\/]+)"));
|
|
333
339
|
return e.endsWith("*") ? (r.push({
|
|
334
340
|
paramName: "*"
|
|
335
341
|
}), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, t ? void 0 : "i"), r];
|
|
336
342
|
}
|
|
337
|
-
function
|
|
343
|
+
function Re(e) {
|
|
338
344
|
try {
|
|
339
345
|
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
340
346
|
} catch (t) {
|
|
341
347
|
return b(!1, 'The URL path "' + e + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + t + ").")), e;
|
|
342
348
|
}
|
|
343
349
|
}
|
|
344
|
-
function
|
|
345
|
-
if (t === "/")
|
|
350
|
+
function Q(e, t) {
|
|
351
|
+
if (t === "/")
|
|
352
|
+
return e;
|
|
346
353
|
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
347
354
|
return null;
|
|
348
355
|
let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
|
|
349
356
|
return r && r !== "/" ? null : e.slice(n) || "/";
|
|
350
357
|
}
|
|
351
|
-
function
|
|
358
|
+
function Ce(e, t) {
|
|
352
359
|
t === void 0 && (t = "/");
|
|
353
360
|
let {
|
|
354
361
|
pathname: n,
|
|
@@ -356,57 +363,57 @@ function we(e, t) {
|
|
|
356
363
|
hash: a = ""
|
|
357
364
|
} = typeof e == "string" ? O(e) : e;
|
|
358
365
|
return {
|
|
359
|
-
pathname: n ? n.startsWith("/") ? n :
|
|
360
|
-
search:
|
|
361
|
-
hash:
|
|
366
|
+
pathname: n ? n.startsWith("/") ? n : be(n, t) : t,
|
|
367
|
+
search: Oe(r),
|
|
368
|
+
hash: De(a)
|
|
362
369
|
};
|
|
363
370
|
}
|
|
364
|
-
function
|
|
371
|
+
function be(e, t) {
|
|
365
372
|
let n = t.replace(/\/+$/, "").split("/");
|
|
366
373
|
return e.split("/").forEach((a) => {
|
|
367
374
|
a === ".." ? n.length > 1 && n.pop() : a !== "." && n.push(a);
|
|
368
375
|
}), n.length > 1 ? n.join("/") : "/";
|
|
369
376
|
}
|
|
370
|
-
function
|
|
377
|
+
function j(e, t, n, r) {
|
|
371
378
|
return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(r) + "]. Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
|
|
372
379
|
}
|
|
373
|
-
function
|
|
380
|
+
function Pe(e) {
|
|
374
381
|
return e.filter((t, n) => n === 0 || t.route.path && t.route.path.length > 0);
|
|
375
382
|
}
|
|
376
|
-
function
|
|
377
|
-
let n =
|
|
383
|
+
function Z(e, t) {
|
|
384
|
+
let n = Pe(e);
|
|
378
385
|
return t ? n.map((r, a) => a === n.length - 1 ? r.pathname : r.pathnameBase) : n.map((r) => r.pathnameBase);
|
|
379
386
|
}
|
|
380
|
-
function
|
|
387
|
+
function ee(e, t, n, r) {
|
|
381
388
|
r === void 0 && (r = !1);
|
|
382
389
|
let a;
|
|
383
|
-
typeof e == "string" ? a = O(e) : (a = D({}, e), f(!a.pathname || !a.pathname.includes("?"),
|
|
384
|
-
let o = e === "" || a.pathname === "",
|
|
385
|
-
if (
|
|
390
|
+
typeof e == "string" ? a = O(e) : (a = D({}, e), f(!a.pathname || !a.pathname.includes("?"), j("?", "pathname", "search", a)), f(!a.pathname || !a.pathname.includes("#"), j("#", "pathname", "hash", a)), f(!a.search || !a.search.includes("#"), j("#", "search", "hash", a)));
|
|
391
|
+
let o = e === "" || a.pathname === "", l = o ? "/" : a.pathname, u;
|
|
392
|
+
if (l == null)
|
|
386
393
|
u = n;
|
|
387
394
|
else {
|
|
388
395
|
let c = t.length - 1;
|
|
389
|
-
if (!r &&
|
|
390
|
-
let m =
|
|
396
|
+
if (!r && l.startsWith("..")) {
|
|
397
|
+
let m = l.split("/");
|
|
391
398
|
for (; m[0] === ".."; )
|
|
392
399
|
m.shift(), c -= 1;
|
|
393
400
|
a.pathname = m.join("/");
|
|
394
401
|
}
|
|
395
402
|
u = c >= 0 ? t[c] : "/";
|
|
396
403
|
}
|
|
397
|
-
let
|
|
398
|
-
return !
|
|
404
|
+
let i = Ce(a, u), d = l && l !== "/" && l.endsWith("/"), h = (o || l === ".") && n.endsWith("/");
|
|
405
|
+
return !i.pathname.endsWith("/") && (d || h) && (i.pathname += "/"), i;
|
|
399
406
|
}
|
|
400
|
-
const C = (e) => e.join("/").replace(/\/\/+/g, "/"),
|
|
401
|
-
function
|
|
407
|
+
const C = (e) => e.join("/").replace(/\/\/+/g, "/"), we = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Oe = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, De = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
408
|
+
function _e(e) {
|
|
402
409
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
403
410
|
}
|
|
404
|
-
const
|
|
405
|
-
new Set(
|
|
406
|
-
const
|
|
407
|
-
new Set(
|
|
411
|
+
const te = ["post", "put", "patch", "delete"];
|
|
412
|
+
new Set(te);
|
|
413
|
+
const Ve = ["get", ...te];
|
|
414
|
+
new Set(Ve);
|
|
408
415
|
/**
|
|
409
|
-
* React Router v6.
|
|
416
|
+
* React Router v6.26.0
|
|
410
417
|
*
|
|
411
418
|
* Copyright (c) Remix Software Inc.
|
|
412
419
|
*
|
|
@@ -427,27 +434,27 @@ function _() {
|
|
|
427
434
|
}
|
|
428
435
|
const U = /* @__PURE__ */ s.createContext(null);
|
|
429
436
|
process.env.NODE_ENV !== "production" && (U.displayName = "DataRouter");
|
|
430
|
-
const
|
|
431
|
-
process.env.NODE_ENV !== "production" && (
|
|
432
|
-
const
|
|
433
|
-
process.env.NODE_ENV !== "production" && (
|
|
434
|
-
const
|
|
435
|
-
process.env.NODE_ENV !== "production" && (
|
|
436
|
-
const
|
|
437
|
-
process.env.NODE_ENV !== "production" && (
|
|
438
|
-
const
|
|
437
|
+
const ne = /* @__PURE__ */ s.createContext(null);
|
|
438
|
+
process.env.NODE_ENV !== "production" && (ne.displayName = "DataRouterState");
|
|
439
|
+
const Be = /* @__PURE__ */ s.createContext(null);
|
|
440
|
+
process.env.NODE_ENV !== "production" && (Be.displayName = "Await");
|
|
441
|
+
const w = /* @__PURE__ */ s.createContext(null);
|
|
442
|
+
process.env.NODE_ENV !== "production" && (w.displayName = "Navigation");
|
|
443
|
+
const B = /* @__PURE__ */ s.createContext(null);
|
|
444
|
+
process.env.NODE_ENV !== "production" && (B.displayName = "Location");
|
|
445
|
+
const P = /* @__PURE__ */ s.createContext({
|
|
439
446
|
outlet: null,
|
|
440
447
|
matches: [],
|
|
441
448
|
isDataRoute: !1
|
|
442
449
|
});
|
|
443
|
-
process.env.NODE_ENV !== "production" && (
|
|
444
|
-
const
|
|
445
|
-
process.env.NODE_ENV !== "production" && (
|
|
446
|
-
function
|
|
450
|
+
process.env.NODE_ENV !== "production" && (P.displayName = "Route");
|
|
451
|
+
const M = /* @__PURE__ */ s.createContext(null);
|
|
452
|
+
process.env.NODE_ENV !== "production" && (M.displayName = "RouteError");
|
|
453
|
+
function qe(e, t) {
|
|
447
454
|
let {
|
|
448
455
|
relative: n
|
|
449
456
|
} = t === void 0 ? {} : t;
|
|
450
|
-
|
|
457
|
+
S() || (process.env.NODE_ENV !== "production" ? f(
|
|
451
458
|
!1,
|
|
452
459
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
453
460
|
// router loaded. We can help them understand how to avoid that.
|
|
@@ -456,42 +463,42 @@ function Xe(e, t) {
|
|
|
456
463
|
let {
|
|
457
464
|
basename: r,
|
|
458
465
|
navigator: a
|
|
459
|
-
} = s.useContext(
|
|
466
|
+
} = s.useContext(w), {
|
|
460
467
|
hash: o,
|
|
461
|
-
pathname:
|
|
468
|
+
pathname: l,
|
|
462
469
|
search: u
|
|
463
|
-
} =
|
|
470
|
+
} = Le(e, {
|
|
464
471
|
relative: n
|
|
465
|
-
}),
|
|
466
|
-
return r !== "/" && (
|
|
467
|
-
pathname:
|
|
472
|
+
}), i = l;
|
|
473
|
+
return r !== "/" && (i = l === "/" ? r : C([r, l])), a.createHref({
|
|
474
|
+
pathname: i,
|
|
468
475
|
search: u,
|
|
469
476
|
hash: o
|
|
470
477
|
});
|
|
471
478
|
}
|
|
472
|
-
function
|
|
473
|
-
return s.useContext(
|
|
479
|
+
function S() {
|
|
480
|
+
return s.useContext(B) != null;
|
|
474
481
|
}
|
|
475
|
-
function
|
|
476
|
-
return
|
|
482
|
+
function F() {
|
|
483
|
+
return S() || (process.env.NODE_ENV !== "production" ? f(
|
|
477
484
|
!1,
|
|
478
485
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
479
486
|
// router loaded. We can help them understand how to avoid that.
|
|
480
487
|
"useLocation() may be used only in the context of a <Router> component."
|
|
481
|
-
) : f(!1)), s.useContext(
|
|
488
|
+
) : f(!1)), s.useContext(B).location;
|
|
482
489
|
}
|
|
483
|
-
const
|
|
484
|
-
function
|
|
485
|
-
s.useContext(
|
|
490
|
+
const re = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
491
|
+
function ae(e) {
|
|
492
|
+
s.useContext(w).static || s.useLayoutEffect(e);
|
|
486
493
|
}
|
|
487
|
-
function
|
|
494
|
+
function Ge() {
|
|
488
495
|
let {
|
|
489
496
|
isDataRoute: e
|
|
490
|
-
} = s.useContext(
|
|
491
|
-
return e ?
|
|
497
|
+
} = s.useContext(P);
|
|
498
|
+
return e ? Je() : Se();
|
|
492
499
|
}
|
|
493
|
-
function
|
|
494
|
-
|
|
500
|
+
function Se() {
|
|
501
|
+
S() || (process.env.NODE_ENV !== "production" ? f(
|
|
495
502
|
!1,
|
|
496
503
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
497
504
|
// router loaded. We can help them understand how to avoid that.
|
|
@@ -501,40 +508,41 @@ function Ue() {
|
|
|
501
508
|
basename: t,
|
|
502
509
|
future: n,
|
|
503
510
|
navigator: r
|
|
504
|
-
} = s.useContext(P), {
|
|
505
|
-
matches: a
|
|
506
511
|
} = s.useContext(w), {
|
|
512
|
+
matches: a
|
|
513
|
+
} = s.useContext(P), {
|
|
507
514
|
pathname: o
|
|
508
|
-
} =
|
|
509
|
-
return
|
|
515
|
+
} = F(), l = JSON.stringify(Z(a, n.v7_relativeSplatPath)), u = s.useRef(!1);
|
|
516
|
+
return ae(() => {
|
|
510
517
|
u.current = !0;
|
|
511
518
|
}), s.useCallback(function(d, h) {
|
|
512
|
-
if (h === void 0 && (h = {}), process.env.NODE_ENV !== "production" && b(u.current,
|
|
519
|
+
if (h === void 0 && (h = {}), process.env.NODE_ENV !== "production" && b(u.current, re), !u.current)
|
|
520
|
+
return;
|
|
513
521
|
if (typeof d == "number") {
|
|
514
522
|
r.go(d);
|
|
515
523
|
return;
|
|
516
524
|
}
|
|
517
|
-
let c =
|
|
525
|
+
let c = ee(d, JSON.parse(l), o, h.relative === "path");
|
|
518
526
|
e == null && t !== "/" && (c.pathname = c.pathname === "/" ? t : C([t, c.pathname])), (h.replace ? r.replace : r.push)(c, h.state, h);
|
|
519
|
-
}, [t, r,
|
|
527
|
+
}, [t, r, l, o, e]);
|
|
520
528
|
}
|
|
521
|
-
function
|
|
529
|
+
function Le(e, t) {
|
|
522
530
|
let {
|
|
523
531
|
relative: n
|
|
524
532
|
} = t === void 0 ? {} : t, {
|
|
525
533
|
future: r
|
|
526
|
-
} = s.useContext(P), {
|
|
527
|
-
matches: a
|
|
528
534
|
} = s.useContext(w), {
|
|
535
|
+
matches: a
|
|
536
|
+
} = s.useContext(P), {
|
|
529
537
|
pathname: o
|
|
530
|
-
} =
|
|
531
|
-
return s.useMemo(() =>
|
|
538
|
+
} = F(), l = JSON.stringify(Z(a, r.v7_relativeSplatPath));
|
|
539
|
+
return s.useMemo(() => ee(e, JSON.parse(l), o, n === "path"), [e, l, o, n]);
|
|
532
540
|
}
|
|
533
|
-
function
|
|
534
|
-
return
|
|
541
|
+
function Ue(e, t) {
|
|
542
|
+
return Ie(e, t);
|
|
535
543
|
}
|
|
536
|
-
function
|
|
537
|
-
|
|
544
|
+
function Ie(e, t, n, r) {
|
|
545
|
+
S() || (process.env.NODE_ENV !== "production" ? f(
|
|
538
546
|
!1,
|
|
539
547
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
540
548
|
// router loaded. We can help them understand how to avoid that.
|
|
@@ -542,20 +550,20 @@ function je(e, t, n, r) {
|
|
|
542
550
|
) : f(!1));
|
|
543
551
|
let {
|
|
544
552
|
navigator: a
|
|
545
|
-
} = s.useContext(
|
|
553
|
+
} = s.useContext(w), {
|
|
546
554
|
matches: o
|
|
547
|
-
} = s.useContext(
|
|
555
|
+
} = s.useContext(P), l = o[o.length - 1], u = l ? l.params : {}, i = l ? l.pathname : "/", d = l ? l.pathnameBase : "/", h = l && l.route;
|
|
548
556
|
if (process.env.NODE_ENV !== "production") {
|
|
549
557
|
let v = h && h.path || "";
|
|
550
|
-
le(
|
|
558
|
+
le(i, !h || v.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + i + '" (under <Route path="' + v + '">) 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.
|
|
551
559
|
|
|
552
560
|
` + ('Please change the parent <Route path="' + v + '"> to <Route ') + ('path="' + (v === "/" ? "*" : v + "/*") + '">.'));
|
|
553
561
|
}
|
|
554
|
-
let c =
|
|
562
|
+
let c = F(), m;
|
|
555
563
|
if (t) {
|
|
556
|
-
var
|
|
564
|
+
var x;
|
|
557
565
|
let v = typeof t == "string" ? O(t) : t;
|
|
558
|
-
d === "/" || (
|
|
566
|
+
d === "/" || (x = v.pathname) != null && x.startsWith(d) || (process.env.NODE_ENV !== "production" ? f(!1, "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 "' + d + '" ') + ('but pathname "' + v.pathname + '" was given in the `location` prop.')) : f(!1)), m = v;
|
|
559
567
|
} else
|
|
560
568
|
m = c;
|
|
561
569
|
let y = m.pathname || "/", g = y;
|
|
@@ -563,11 +571,11 @@ function je(e, t, n, r) {
|
|
|
563
571
|
let v = d.replace(/^\//, "").split("/");
|
|
564
572
|
g = "/" + y.replace(/^\//, "").split("/").slice(v.length).join("/");
|
|
565
573
|
}
|
|
566
|
-
let p =
|
|
574
|
+
let p = ue(e, {
|
|
567
575
|
pathname: g
|
|
568
576
|
});
|
|
569
577
|
process.env.NODE_ENV !== "production" && (process.env.NODE_ENV !== "production" && b(h || p != null, 'No routes matched location "' + m.pathname + m.search + m.hash + '" '), process.env.NODE_ENV !== "production" && b(p == null || p[p.length - 1].route.element !== void 0 || p[p.length - 1].route.Component !== void 0 || p[p.length - 1].route.lazy !== void 0, 'Matched leaf route at location "' + m.pathname + m.search + m.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.'));
|
|
570
|
-
let E =
|
|
578
|
+
let E = Fe(p && p.map((v) => Object.assign({}, v, {
|
|
571
579
|
params: Object.assign({}, u, v.params),
|
|
572
580
|
pathname: C([
|
|
573
581
|
d,
|
|
@@ -580,7 +588,7 @@ function je(e, t, n, r) {
|
|
|
580
588
|
a.encodeLocation ? a.encodeLocation(v.pathnameBase).pathname : v.pathnameBase
|
|
581
589
|
])
|
|
582
590
|
})), o, n, r);
|
|
583
|
-
return t && E ? /* @__PURE__ */ s.createElement(
|
|
591
|
+
return t && E ? /* @__PURE__ */ s.createElement(B.Provider, {
|
|
584
592
|
value: {
|
|
585
593
|
location: _({
|
|
586
594
|
pathname: "/",
|
|
@@ -593,15 +601,15 @@ function je(e, t, n, r) {
|
|
|
593
601
|
}
|
|
594
602
|
}, E) : E;
|
|
595
603
|
}
|
|
596
|
-
function
|
|
597
|
-
let e =
|
|
604
|
+
function je() {
|
|
605
|
+
let e = Ae(), t = _e(e) ? e.status + " " + e.statusText : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, r = "rgba(200,200,200, 0.5)", a = {
|
|
598
606
|
padding: "0.5rem",
|
|
599
607
|
backgroundColor: r
|
|
600
608
|
}, o = {
|
|
601
609
|
padding: "2px 4px",
|
|
602
610
|
backgroundColor: r
|
|
603
|
-
},
|
|
604
|
-
return process.env.NODE_ENV !== "production" && (console.error("Error handled by React Router default ErrorBoundary:", e),
|
|
611
|
+
}, l = null;
|
|
612
|
+
return process.env.NODE_ENV !== "production" && (console.error("Error handled by React Router default ErrorBoundary:", e), l = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ s.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ s.createElement("code", {
|
|
605
613
|
style: o
|
|
606
614
|
}, "ErrorBoundary"), " or", " ", /* @__PURE__ */ s.createElement("code", {
|
|
607
615
|
style: o
|
|
@@ -611,10 +619,10 @@ function Fe() {
|
|
|
611
619
|
}
|
|
612
620
|
}, t), n ? /* @__PURE__ */ s.createElement("pre", {
|
|
613
621
|
style: a
|
|
614
|
-
}, n) : null,
|
|
622
|
+
}, n) : null, l);
|
|
615
623
|
}
|
|
616
|
-
const
|
|
617
|
-
class
|
|
624
|
+
const We = /* @__PURE__ */ s.createElement(je, null);
|
|
625
|
+
class $e extends s.Component {
|
|
618
626
|
constructor(t) {
|
|
619
627
|
super(t), this.state = {
|
|
620
628
|
location: t.location,
|
|
@@ -642,25 +650,25 @@ class Me extends s.Component {
|
|
|
642
650
|
console.error("React Router caught the following error during render", t, n);
|
|
643
651
|
}
|
|
644
652
|
render() {
|
|
645
|
-
return this.state.error !== void 0 ? /* @__PURE__ */ s.createElement(
|
|
653
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ s.createElement(P.Provider, {
|
|
646
654
|
value: this.props.routeContext
|
|
647
|
-
}, /* @__PURE__ */ s.createElement(
|
|
655
|
+
}, /* @__PURE__ */ s.createElement(M.Provider, {
|
|
648
656
|
value: this.state.error,
|
|
649
657
|
children: this.props.component
|
|
650
658
|
})) : this.props.children;
|
|
651
659
|
}
|
|
652
660
|
}
|
|
653
|
-
function
|
|
661
|
+
function Me(e) {
|
|
654
662
|
let {
|
|
655
663
|
routeContext: t,
|
|
656
664
|
match: n,
|
|
657
665
|
children: r
|
|
658
666
|
} = e, a = s.useContext(U);
|
|
659
|
-
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ s.createElement(
|
|
667
|
+
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ s.createElement(P.Provider, {
|
|
660
668
|
value: t
|
|
661
669
|
}, r);
|
|
662
670
|
}
|
|
663
|
-
function
|
|
671
|
+
function Fe(e, t, n, r) {
|
|
664
672
|
var a;
|
|
665
673
|
if (t === void 0 && (t = []), n === void 0 && (n = null), r === void 0 && (r = null), e == null) {
|
|
666
674
|
var o;
|
|
@@ -673,46 +681,46 @@ function ke(e, t, n, r) {
|
|
|
673
681
|
else
|
|
674
682
|
return null;
|
|
675
683
|
}
|
|
676
|
-
let
|
|
684
|
+
let l = e, u = (a = n) == null ? void 0 : a.errors;
|
|
677
685
|
if (u != null) {
|
|
678
|
-
let h =
|
|
679
|
-
h >= 0 || (process.env.NODE_ENV !== "production" ? f(!1, "Could not find a matching route for errors on route IDs: " + Object.keys(u).join(",")) : f(!1)),
|
|
686
|
+
let h = l.findIndex((c) => c.route.id && (u == null ? void 0 : u[c.route.id]) !== void 0);
|
|
687
|
+
h >= 0 || (process.env.NODE_ENV !== "production" ? f(!1, "Could not find a matching route for errors on route IDs: " + Object.keys(u).join(",")) : f(!1)), l = l.slice(0, Math.min(l.length, h + 1));
|
|
680
688
|
}
|
|
681
|
-
let
|
|
689
|
+
let i = !1, d = -1;
|
|
682
690
|
if (n && r && r.v7_partialHydration)
|
|
683
|
-
for (let h = 0; h <
|
|
684
|
-
let c =
|
|
691
|
+
for (let h = 0; h < l.length; h++) {
|
|
692
|
+
let c = l[h];
|
|
685
693
|
if ((c.route.HydrateFallback || c.route.hydrateFallbackElement) && (d = h), c.route.id) {
|
|
686
694
|
let {
|
|
687
695
|
loaderData: m,
|
|
688
|
-
errors:
|
|
689
|
-
} = n, y = c.route.loader && m[c.route.id] === void 0 && (!
|
|
696
|
+
errors: x
|
|
697
|
+
} = n, y = c.route.loader && m[c.route.id] === void 0 && (!x || x[c.route.id] === void 0);
|
|
690
698
|
if (c.route.lazy || y) {
|
|
691
|
-
|
|
699
|
+
i = !0, d >= 0 ? l = l.slice(0, d + 1) : l = [l[0]];
|
|
692
700
|
break;
|
|
693
701
|
}
|
|
694
702
|
}
|
|
695
703
|
}
|
|
696
|
-
return
|
|
697
|
-
let
|
|
698
|
-
n && (
|
|
699
|
-
let E = t.concat(
|
|
700
|
-
let
|
|
701
|
-
return
|
|
704
|
+
return l.reduceRight((h, c, m) => {
|
|
705
|
+
let x, y = !1, g = null, p = null;
|
|
706
|
+
n && (x = u && c.route.id ? u[c.route.id] : void 0, g = c.route.errorElement || We, i && (d < 0 && m === 0 ? (le("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), y = !0, p = null) : d === m && (y = !0, p = c.route.hydrateFallbackElement || null)));
|
|
707
|
+
let E = t.concat(l.slice(0, m + 1)), v = () => {
|
|
708
|
+
let N;
|
|
709
|
+
return x ? N = g : y ? N = p : c.route.Component ? N = /* @__PURE__ */ s.createElement(c.route.Component, null) : c.route.element ? N = c.route.element : N = h, /* @__PURE__ */ s.createElement(Me, {
|
|
702
710
|
match: c,
|
|
703
711
|
routeContext: {
|
|
704
712
|
outlet: h,
|
|
705
713
|
matches: E,
|
|
706
714
|
isDataRoute: n != null
|
|
707
715
|
},
|
|
708
|
-
children:
|
|
716
|
+
children: N
|
|
709
717
|
});
|
|
710
718
|
};
|
|
711
|
-
return n && (c.route.ErrorBoundary || c.route.errorElement || m === 0) ? /* @__PURE__ */ s.createElement(
|
|
719
|
+
return n && (c.route.ErrorBoundary || c.route.errorElement || m === 0) ? /* @__PURE__ */ s.createElement($e, {
|
|
712
720
|
location: n.location,
|
|
713
721
|
revalidation: n.revalidation,
|
|
714
722
|
component: g,
|
|
715
|
-
error:
|
|
723
|
+
error: x,
|
|
716
724
|
children: v(),
|
|
717
725
|
routeContext: {
|
|
718
726
|
outlet: null,
|
|
@@ -722,121 +730,113 @@ function ke(e, t, n, r) {
|
|
|
722
730
|
}) : v();
|
|
723
731
|
}, null);
|
|
724
732
|
}
|
|
725
|
-
var
|
|
733
|
+
var oe = /* @__PURE__ */ function(e) {
|
|
726
734
|
return e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e;
|
|
727
|
-
}
|
|
735
|
+
}(oe || {}), V = /* @__PURE__ */ function(e) {
|
|
728
736
|
return e.UseBlocker = "useBlocker", e.UseLoaderData = "useLoaderData", e.UseActionData = "useActionData", e.UseRouteError = "useRouteError", e.UseNavigation = "useNavigation", e.UseRouteLoaderData = "useRouteLoaderData", e.UseMatches = "useMatches", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e.UseRouteId = "useRouteId", e;
|
|
729
|
-
}
|
|
730
|
-
function
|
|
731
|
-
return e + " must be used within a data router. See https://reactrouter.com/
|
|
737
|
+
}(V || {});
|
|
738
|
+
function k(e) {
|
|
739
|
+
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
732
740
|
}
|
|
733
|
-
function
|
|
741
|
+
function ke(e) {
|
|
734
742
|
let t = s.useContext(U);
|
|
735
|
-
return t || (process.env.NODE_ENV !== "production" ? f(!1,
|
|
743
|
+
return t || (process.env.NODE_ENV !== "production" ? f(!1, k(e)) : f(!1)), t;
|
|
736
744
|
}
|
|
737
|
-
function
|
|
738
|
-
let t = s.useContext(
|
|
739
|
-
return t || (process.env.NODE_ENV !== "production" ? f(!1,
|
|
745
|
+
function Te(e) {
|
|
746
|
+
let t = s.useContext(ne);
|
|
747
|
+
return t || (process.env.NODE_ENV !== "production" ? f(!1, k(e)) : f(!1)), t;
|
|
740
748
|
}
|
|
741
|
-
function
|
|
742
|
-
let t = s.useContext(
|
|
743
|
-
return t || (process.env.NODE_ENV !== "production" ? f(!1,
|
|
749
|
+
function ze(e) {
|
|
750
|
+
let t = s.useContext(P);
|
|
751
|
+
return t || (process.env.NODE_ENV !== "production" ? f(!1, k(e)) : f(!1)), t;
|
|
744
752
|
}
|
|
745
|
-
function
|
|
746
|
-
let t =
|
|
753
|
+
function T(e) {
|
|
754
|
+
let t = ze(e), n = t.matches[t.matches.length - 1];
|
|
747
755
|
return n.route.id || (process.env.NODE_ENV !== "production" ? f(!1, e + ' can only be used on routes that contain a unique "id"') : f(!1)), n.route.id;
|
|
748
756
|
}
|
|
749
|
-
function
|
|
750
|
-
return
|
|
757
|
+
function Ke() {
|
|
758
|
+
return T(V.UseRouteId);
|
|
751
759
|
}
|
|
752
|
-
function
|
|
760
|
+
function Ae() {
|
|
753
761
|
var e;
|
|
754
|
-
let t = s.useContext(
|
|
762
|
+
let t = s.useContext(M), n = Te(V.UseRouteError), r = T(V.UseRouteError);
|
|
755
763
|
return t !== void 0 ? t : (e = n.errors) == null ? void 0 : e[r];
|
|
756
764
|
}
|
|
757
|
-
function
|
|
765
|
+
function Je() {
|
|
758
766
|
let {
|
|
759
767
|
router: e
|
|
760
|
-
} =
|
|
761
|
-
return
|
|
768
|
+
} = ke(oe.UseNavigateStable), t = T(V.UseNavigateStable), n = s.useRef(!1);
|
|
769
|
+
return ae(() => {
|
|
762
770
|
n.current = !0;
|
|
763
771
|
}), s.useCallback(function(a, o) {
|
|
764
|
-
o === void 0 && (o = {}), process.env.NODE_ENV !== "production" && b(n.current,
|
|
772
|
+
o === void 0 && (o = {}), process.env.NODE_ENV !== "production" && b(n.current, re), n.current && (typeof a == "number" ? e.navigate(a) : e.navigate(a, _({
|
|
765
773
|
fromRouteId: t
|
|
766
774
|
}, o)));
|
|
767
775
|
}, [e, t]);
|
|
768
776
|
}
|
|
769
|
-
const H = {};
|
|
770
|
-
function le(e, t, n) {
|
|
771
|
-
!t && !H[e] && (H[e] = !0, process.env.NODE_ENV !== "production" && b(!1, n));
|
|
772
|
-
}
|
|
773
777
|
const q = {};
|
|
774
|
-
function
|
|
775
|
-
|
|
776
|
-
}
|
|
777
|
-
const G = (e, t, n) => qe(e, "⚠️ React Router Future Flag Warning: " + t + ". " + ("You can use the `" + e + "` future flag to opt-in early. ") + ("For more information, see " + n + "."));
|
|
778
|
-
function et(e, t) {
|
|
779
|
-
e?.v7_startTransition === void 0 && G("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition"), e?.v7_relativeSplatPath === void 0 && G("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
|
|
778
|
+
function le(e, t, n) {
|
|
779
|
+
!t && !q[e] && (q[e] = !0, process.env.NODE_ENV !== "production" && b(!1, n));
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function He(e) {
|
|
782
782
|
process.env.NODE_ENV !== "production" ? f(!1, "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.") : f(!1);
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function Xe(e) {
|
|
785
785
|
let {
|
|
786
786
|
basename: t = "/",
|
|
787
787
|
children: n = null,
|
|
788
788
|
location: r,
|
|
789
789
|
navigationType: a = R.Pop,
|
|
790
790
|
navigator: o,
|
|
791
|
-
static:
|
|
791
|
+
static: l = !1,
|
|
792
792
|
future: u
|
|
793
793
|
} = e;
|
|
794
|
-
|
|
795
|
-
let
|
|
796
|
-
basename:
|
|
794
|
+
S() && (process.env.NODE_ENV !== "production" ? f(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : f(!1));
|
|
795
|
+
let i = t.replace(/^\/*/, "/"), d = s.useMemo(() => ({
|
|
796
|
+
basename: i,
|
|
797
797
|
navigator: o,
|
|
798
|
-
static:
|
|
798
|
+
static: l,
|
|
799
799
|
future: _({
|
|
800
800
|
v7_relativeSplatPath: !1
|
|
801
801
|
}, u)
|
|
802
|
-
}), [
|
|
802
|
+
}), [i, u, o, l]);
|
|
803
803
|
typeof r == "string" && (r = O(r));
|
|
804
804
|
let {
|
|
805
805
|
pathname: h = "/",
|
|
806
806
|
search: c = "",
|
|
807
807
|
hash: m = "",
|
|
808
|
-
state:
|
|
808
|
+
state: x = null,
|
|
809
809
|
key: y = "default"
|
|
810
810
|
} = r, g = s.useMemo(() => {
|
|
811
|
-
let p =
|
|
811
|
+
let p = Q(h, i);
|
|
812
812
|
return p == null ? null : {
|
|
813
813
|
location: {
|
|
814
814
|
pathname: p,
|
|
815
815
|
search: c,
|
|
816
816
|
hash: m,
|
|
817
|
-
state:
|
|
817
|
+
state: x,
|
|
818
818
|
key: y
|
|
819
819
|
},
|
|
820
820
|
navigationType: a
|
|
821
821
|
};
|
|
822
|
-
}, [
|
|
823
|
-
return process.env.NODE_ENV !== "production" && b(g != null, '<Router basename="' +
|
|
822
|
+
}, [i, h, c, m, x, y, a]);
|
|
823
|
+
return process.env.NODE_ENV !== "production" && b(g != null, '<Router basename="' + i + '"> is not able to match the URL ' + ('"' + h + c + m + '" because it does not start with the ') + "basename, so the <Router> won't render anything."), g == null ? null : /* @__PURE__ */ s.createElement(w.Provider, {
|
|
824
824
|
value: d
|
|
825
|
-
}, /* @__PURE__ */ s.createElement(
|
|
825
|
+
}, /* @__PURE__ */ s.createElement(B.Provider, {
|
|
826
826
|
children: n,
|
|
827
827
|
value: g
|
|
828
828
|
}));
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function Qe(e) {
|
|
831
831
|
let {
|
|
832
832
|
children: t,
|
|
833
833
|
location: n
|
|
834
834
|
} = e;
|
|
835
|
-
return
|
|
835
|
+
return Ue($(t), n);
|
|
836
836
|
}
|
|
837
837
|
new Promise(() => {
|
|
838
838
|
});
|
|
839
|
-
function
|
|
839
|
+
function $(e, t) {
|
|
840
840
|
t === void 0 && (t = []);
|
|
841
841
|
let n = [];
|
|
842
842
|
return s.Children.forEach(e, (r, a) => {
|
|
@@ -844,11 +844,11 @@ function F(e, t) {
|
|
|
844
844
|
return;
|
|
845
845
|
let o = [...t, a];
|
|
846
846
|
if (r.type === s.Fragment) {
|
|
847
|
-
n.push.apply(n,
|
|
847
|
+
n.push.apply(n, $(r.props.children, o));
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
|
-
r.type !==
|
|
851
|
-
let
|
|
850
|
+
r.type !== He && (process.env.NODE_ENV !== "production" ? f(!1, "[" + (typeof r.type == "string" ? r.type : r.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : f(!1)), !r.props.index || !r.props.children || (process.env.NODE_ENV !== "production" ? f(!1, "An index route cannot have child routes.") : f(!1));
|
|
851
|
+
let l = {
|
|
852
852
|
id: r.props.id || o.join("-"),
|
|
853
853
|
caseSensitive: r.props.caseSensitive,
|
|
854
854
|
element: r.props.element,
|
|
@@ -864,28 +864,27 @@ function F(e, t) {
|
|
|
864
864
|
handle: r.props.handle,
|
|
865
865
|
lazy: r.props.lazy
|
|
866
866
|
};
|
|
867
|
-
r.props.children && (
|
|
867
|
+
r.props.children && (l.children = $(r.props.children, o)), n.push(l);
|
|
868
868
|
}), n;
|
|
869
869
|
}
|
|
870
870
|
export {
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
871
|
+
ne as D,
|
|
872
|
+
w as N,
|
|
873
|
+
Qe as R,
|
|
874
|
+
He as a,
|
|
875
|
+
Xe as b,
|
|
876
|
+
Ye as c,
|
|
877
|
+
Le as d,
|
|
878
|
+
F as e,
|
|
879
|
+
Ge as f,
|
|
880
|
+
G as g,
|
|
881
|
+
Ke as h,
|
|
882
|
+
P as i,
|
|
883
|
+
f as j,
|
|
884
884
|
C as k,
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
Xe as u,
|
|
885
|
+
U as l,
|
|
886
|
+
Y as m,
|
|
887
|
+
Q as s,
|
|
888
|
+
qe as u,
|
|
890
889
|
b as w
|
|
891
890
|
};
|