@attabot/complaint-app 1.0.32 → 1.0.34
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/complaint-app.js +799 -789
- package/dist/complaint-app.js.map +1 -1
- package/dist/complaint-app.umd.js +6 -6
- package/dist/complaint-app.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/complaint-app.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as l, jsxs as v, Fragment as me } from "react/jsx-runtime";
|
|
|
2
2
|
import * as k from "react";
|
|
3
3
|
import ea, { createContext as en, useMemo as oe, useContext as Qn, forwardRef as Ks, createElement as Dr, useState as q, useRef as Se, useEffect as se, useCallback as Be } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
import { useDispatch as Re, useSelector as
|
|
5
|
+
import { useDispatch as Re, useSelector as ne, Provider as ji } from "react-redux";
|
|
6
6
|
import { createAsyncThunk as be, createSlice as $e, combineReducers as Vi, configureStore as qi } from "@reduxjs/toolkit";
|
|
7
7
|
function Kt() {
|
|
8
8
|
return Kt = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -43,7 +43,7 @@ function Wi(e) {
|
|
|
43
43
|
}
|
|
44
44
|
return Hi(t, n, null, e);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function ee(e, t) {
|
|
47
47
|
if (e === !1 || e === null || typeof e > "u")
|
|
48
48
|
throw new Error(t);
|
|
49
49
|
}
|
|
@@ -114,16 +114,16 @@ function Hi(e, t, n, r) {
|
|
|
114
114
|
}
|
|
115
115
|
function p() {
|
|
116
116
|
i = Ke.Pop;
|
|
117
|
-
let
|
|
118
|
-
d =
|
|
117
|
+
let y = u(), h = y == null ? null : y - d;
|
|
118
|
+
d = y, c && c({
|
|
119
119
|
action: i,
|
|
120
120
|
location: S.location,
|
|
121
|
-
delta:
|
|
121
|
+
delta: h
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function f(
|
|
124
|
+
function f(y, h) {
|
|
125
125
|
i = Ke.Push;
|
|
126
|
-
let m = Pr(S.location,
|
|
126
|
+
let m = Pr(S.location, y, h);
|
|
127
127
|
d = u() + 1;
|
|
128
128
|
let N = Ta(m, d), _ = S.createHref(m);
|
|
129
129
|
try {
|
|
@@ -139,9 +139,9 @@ function Hi(e, t, n, r) {
|
|
|
139
139
|
delta: 1
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function w(
|
|
142
|
+
function w(y, h) {
|
|
143
143
|
i = Ke.Replace;
|
|
144
|
-
let m = Pr(S.location,
|
|
144
|
+
let m = Pr(S.location, y, h);
|
|
145
145
|
d = u();
|
|
146
146
|
let N = Ta(m, d), _ = S.createHref(m);
|
|
147
147
|
o.replaceState(N, "", _), s && c && c({
|
|
@@ -150,9 +150,9 @@ function Hi(e, t, n, r) {
|
|
|
150
150
|
delta: 0
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function C(
|
|
154
|
-
let
|
|
155
|
-
return m = m.replace(/ $/, "%20"),
|
|
153
|
+
function C(y) {
|
|
154
|
+
let h = a.location.origin !== "null" ? a.location.origin : a.location.href, m = typeof y == "string" ? y : Jt(y);
|
|
155
|
+
return m = m.replace(/ $/, "%20"), ee(h, "No window.location.(origin|href) available to create URL for href: " + m), new URL(m, h);
|
|
156
156
|
}
|
|
157
157
|
let S = {
|
|
158
158
|
get action() {
|
|
@@ -161,29 +161,29 @@ function Hi(e, t, n, r) {
|
|
|
161
161
|
get location() {
|
|
162
162
|
return e(a, o);
|
|
163
163
|
},
|
|
164
|
-
listen(
|
|
164
|
+
listen(y) {
|
|
165
165
|
if (c)
|
|
166
166
|
throw new Error("A history only accepts one active listener");
|
|
167
|
-
return a.addEventListener(La, p), c =
|
|
167
|
+
return a.addEventListener(La, p), c = y, () => {
|
|
168
168
|
a.removeEventListener(La, p), c = null;
|
|
169
169
|
};
|
|
170
170
|
},
|
|
171
|
-
createHref(
|
|
172
|
-
return t(a,
|
|
171
|
+
createHref(y) {
|
|
172
|
+
return t(a, y);
|
|
173
173
|
},
|
|
174
174
|
createURL: C,
|
|
175
|
-
encodeLocation(
|
|
176
|
-
let
|
|
175
|
+
encodeLocation(y) {
|
|
176
|
+
let h = C(y);
|
|
177
177
|
return {
|
|
178
|
-
pathname:
|
|
179
|
-
search:
|
|
180
|
-
hash:
|
|
178
|
+
pathname: h.pathname,
|
|
179
|
+
search: h.search,
|
|
180
|
+
hash: h.hash
|
|
181
181
|
};
|
|
182
182
|
},
|
|
183
183
|
push: f,
|
|
184
184
|
replace: w,
|
|
185
|
-
go(
|
|
186
|
-
return o.go(
|
|
185
|
+
go(y) {
|
|
186
|
+
return o.go(y);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return S;
|
|
@@ -215,9 +215,9 @@ function Js(e, t, n, r) {
|
|
|
215
215
|
childrenIndex: o,
|
|
216
216
|
route: s
|
|
217
217
|
};
|
|
218
|
-
c.relativePath.startsWith("/") && (
|
|
218
|
+
c.relativePath.startsWith("/") && (ee(c.relativePath.startsWith(r), 'Absolute route path "' + c.relativePath + '" nested under path ' + ('"' + r + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."), c.relativePath = c.relativePath.slice(r.length));
|
|
219
219
|
let d = qe([r, c.relativePath]), u = n.concat(c);
|
|
220
|
-
s.children && s.children.length > 0 && (
|
|
220
|
+
s.children && s.children.length > 0 && (ee(
|
|
221
221
|
// Our types know better, but runtime JS may not!
|
|
222
222
|
// @ts-expect-error
|
|
223
223
|
s.index !== !0,
|
|
@@ -385,7 +385,7 @@ function Gs(e, t) {
|
|
|
385
385
|
function Ys(e, t, n, r) {
|
|
386
386
|
r === void 0 && (r = !1);
|
|
387
387
|
let a;
|
|
388
|
-
typeof e == "string" ? a = Lt(e) : (a = Kt({}, e),
|
|
388
|
+
typeof e == "string" ? a = Lt(e) : (a = Kt({}, e), ee(!a.pathname || !a.pathname.includes("?"), cr("?", "pathname", "search", a)), ee(!a.pathname || !a.pathname.includes("#"), cr("#", "pathname", "hash", a)), ee(!a.search || !a.search.includes("#"), cr("#", "search", "hash", a)));
|
|
389
389
|
let s = e === "" || a.pathname === "", o = s ? "/" : a.pathname, i;
|
|
390
390
|
if (o == null)
|
|
391
391
|
i = n;
|
|
@@ -441,12 +441,12 @@ function yl(e, t) {
|
|
|
441
441
|
let {
|
|
442
442
|
relative: n
|
|
443
443
|
} = t === void 0 ? {} : t;
|
|
444
|
-
Tt() || (process.env.NODE_ENV !== "production" ?
|
|
444
|
+
Tt() || (process.env.NODE_ENV !== "production" ? ee(
|
|
445
445
|
!1,
|
|
446
446
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
447
447
|
// router loaded. We can help them understand how to avoid that.
|
|
448
448
|
"useHref() may be used only in the context of a <Router> component."
|
|
449
|
-
) :
|
|
449
|
+
) : ee(!1));
|
|
450
450
|
let {
|
|
451
451
|
basename: r,
|
|
452
452
|
navigator: a
|
|
@@ -467,12 +467,12 @@ function Tt() {
|
|
|
467
467
|
return k.useContext(nn) != null;
|
|
468
468
|
}
|
|
469
469
|
function lt() {
|
|
470
|
-
return Tt() || (process.env.NODE_ENV !== "production" ?
|
|
470
|
+
return Tt() || (process.env.NODE_ENV !== "production" ? ee(
|
|
471
471
|
!1,
|
|
472
472
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
473
473
|
// router loaded. We can help them understand how to avoid that.
|
|
474
474
|
"useLocation() may be used only in the context of a <Router> component."
|
|
475
|
-
) :
|
|
475
|
+
) : ee(!1)), k.useContext(nn).location;
|
|
476
476
|
}
|
|
477
477
|
const eo = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
478
478
|
function to(e) {
|
|
@@ -485,12 +485,12 @@ function et() {
|
|
|
485
485
|
return e ? Fl() : bl();
|
|
486
486
|
}
|
|
487
487
|
function bl() {
|
|
488
|
-
Tt() || (process.env.NODE_ENV !== "production" ?
|
|
488
|
+
Tt() || (process.env.NODE_ENV !== "production" ? ee(
|
|
489
489
|
!1,
|
|
490
490
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
491
491
|
// router loaded. We can help them understand how to avoid that.
|
|
492
492
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
493
|
-
) :
|
|
493
|
+
) : ee(!1));
|
|
494
494
|
let e = k.useContext(tn), {
|
|
495
495
|
basename: t,
|
|
496
496
|
future: n,
|
|
@@ -534,12 +534,12 @@ function wl(e, t) {
|
|
|
534
534
|
return vl(e, t);
|
|
535
535
|
}
|
|
536
536
|
function vl(e, t, n, r) {
|
|
537
|
-
Tt() || (process.env.NODE_ENV !== "production" ?
|
|
537
|
+
Tt() || (process.env.NODE_ENV !== "production" ? ee(
|
|
538
538
|
!1,
|
|
539
539
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
540
540
|
// router loaded. We can help them understand how to avoid that.
|
|
541
541
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
542
|
-
) :
|
|
542
|
+
) : ee(!1));
|
|
543
543
|
let {
|
|
544
544
|
navigator: a
|
|
545
545
|
} = k.useContext(De), {
|
|
@@ -555,7 +555,7 @@ function vl(e, t, n, r) {
|
|
|
555
555
|
if (t) {
|
|
556
556
|
var w;
|
|
557
557
|
let m = typeof t == "string" ? Lt(t) : t;
|
|
558
|
-
d === "/" || (w = m.pathname) != null && w.startsWith(d) || (process.env.NODE_ENV !== "production" ?
|
|
558
|
+
d === "/" || (w = m.pathname) != null && w.startsWith(d) || (process.env.NODE_ENV !== "production" ? ee(!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 "' + m.pathname + '" was given in the `location` prop.')) : ee(!1)), f = m;
|
|
559
559
|
} else
|
|
560
560
|
f = p;
|
|
561
561
|
let C = f.pathname || "/", S = C;
|
|
@@ -563,11 +563,11 @@ function vl(e, t, n, r) {
|
|
|
563
563
|
let m = d.replace(/^\//, "").split("/");
|
|
564
564
|
S = "/" + C.replace(/^\//, "").split("/").slice(m.length).join("/");
|
|
565
565
|
}
|
|
566
|
-
let
|
|
566
|
+
let y = Ki(e, {
|
|
567
567
|
pathname: S
|
|
568
568
|
});
|
|
569
|
-
process.env.NODE_ENV !== "production" && (process.env.NODE_ENV !== "production" && Te(u ||
|
|
570
|
-
let
|
|
569
|
+
process.env.NODE_ENV !== "production" && (process.env.NODE_ENV !== "production" && Te(u || y != null, 'No routes matched location "' + f.pathname + f.search + f.hash + '" '), process.env.NODE_ENV !== "production" && Te(y == null || y[y.length - 1].route.element !== void 0 || y[y.length - 1].route.Component !== void 0 || y[y.length - 1].route.lazy !== void 0, 'Matched leaf route at location "' + f.pathname + f.search + f.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 h = El(y && y.map((m) => Object.assign({}, m, {
|
|
571
571
|
params: Object.assign({}, i, m.params),
|
|
572
572
|
pathname: qe([
|
|
573
573
|
d,
|
|
@@ -580,7 +580,7 @@ function vl(e, t, n, r) {
|
|
|
580
580
|
a.encodeLocation ? a.encodeLocation(m.pathnameBase).pathname : m.pathnameBase
|
|
581
581
|
])
|
|
582
582
|
})), s, n, r);
|
|
583
|
-
return t &&
|
|
583
|
+
return t && h ? /* @__PURE__ */ k.createElement(nn.Provider, {
|
|
584
584
|
value: {
|
|
585
585
|
location: Zt({
|
|
586
586
|
pathname: "/",
|
|
@@ -591,7 +591,7 @@ function vl(e, t, n, r) {
|
|
|
591
591
|
}, f),
|
|
592
592
|
navigationType: Ke.Pop
|
|
593
593
|
}
|
|
594
|
-
},
|
|
594
|
+
}, h) : h;
|
|
595
595
|
}
|
|
596
596
|
function Sl() {
|
|
597
597
|
let e = Ol(), t = ml(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 = {
|
|
@@ -676,7 +676,7 @@ function El(e, t, n, r) {
|
|
|
676
676
|
let o = e, i = (a = n) == null ? void 0 : a.errors;
|
|
677
677
|
if (i != null) {
|
|
678
678
|
let u = o.findIndex((p) => p.route.id && i?.[p.route.id] !== void 0);
|
|
679
|
-
u >= 0 || (process.env.NODE_ENV !== "production" ?
|
|
679
|
+
u >= 0 || (process.env.NODE_ENV !== "production" ? ee(!1, "Could not find a matching route for errors on route IDs: " + Object.keys(i).join(",")) : ee(!1)), o = o.slice(0, Math.min(o.length, u + 1));
|
|
680
680
|
}
|
|
681
681
|
let c = !1, d = -1;
|
|
682
682
|
if (n && r && r.v7_partialHydration)
|
|
@@ -694,15 +694,15 @@ function El(e, t, n, r) {
|
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
return o.reduceRight((u, p, f) => {
|
|
697
|
-
let w, C = !1, S = null,
|
|
698
|
-
n && (w = i && p.route.id ? i[p.route.id] : void 0, S = p.route.errorElement || Cl, c && (d < 0 && f === 0 ? (ro("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), C = !0,
|
|
699
|
-
let
|
|
697
|
+
let w, C = !1, S = null, y = null;
|
|
698
|
+
n && (w = i && p.route.id ? i[p.route.id] : void 0, S = p.route.errorElement || Cl, c && (d < 0 && f === 0 ? (ro("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), C = !0, y = null) : d === f && (C = !0, y = p.route.hydrateFallbackElement || null)));
|
|
699
|
+
let h = t.concat(o.slice(0, f + 1)), m = () => {
|
|
700
700
|
let N;
|
|
701
|
-
return w ? N = S : C ? N =
|
|
701
|
+
return w ? N = S : C ? N = y : p.route.Component ? N = /* @__PURE__ */ k.createElement(p.route.Component, null) : p.route.element ? N = p.route.element : N = u, /* @__PURE__ */ k.createElement(_l, {
|
|
702
702
|
match: p,
|
|
703
703
|
routeContext: {
|
|
704
704
|
outlet: u,
|
|
705
|
-
matches:
|
|
705
|
+
matches: h,
|
|
706
706
|
isDataRoute: n != null
|
|
707
707
|
},
|
|
708
708
|
children: N
|
|
@@ -716,7 +716,7 @@ function El(e, t, n, r) {
|
|
|
716
716
|
children: m(),
|
|
717
717
|
routeContext: {
|
|
718
718
|
outlet: null,
|
|
719
|
-
matches:
|
|
719
|
+
matches: h,
|
|
720
720
|
isDataRoute: !0
|
|
721
721
|
}
|
|
722
722
|
}) : m();
|
|
@@ -732,19 +732,19 @@ function ra(e) {
|
|
|
732
732
|
}
|
|
733
733
|
function Al(e) {
|
|
734
734
|
let t = k.useContext(tn);
|
|
735
|
-
return t || (process.env.NODE_ENV !== "production" ?
|
|
735
|
+
return t || (process.env.NODE_ENV !== "production" ? ee(!1, ra(e)) : ee(!1)), t;
|
|
736
736
|
}
|
|
737
737
|
function Ll(e) {
|
|
738
738
|
let t = k.useContext(ta);
|
|
739
|
-
return t || (process.env.NODE_ENV !== "production" ?
|
|
739
|
+
return t || (process.env.NODE_ENV !== "production" ? ee(!1, ra(e)) : ee(!1)), t;
|
|
740
740
|
}
|
|
741
741
|
function Tl(e) {
|
|
742
742
|
let t = k.useContext(je);
|
|
743
|
-
return t || (process.env.NODE_ENV !== "production" ?
|
|
743
|
+
return t || (process.env.NODE_ENV !== "production" ? ee(!1, ra(e)) : ee(!1)), t;
|
|
744
744
|
}
|
|
745
745
|
function aa(e) {
|
|
746
746
|
let t = Tl(e), n = t.matches[t.matches.length - 1];
|
|
747
|
-
return n.route.id || (process.env.NODE_ENV !== "production" ?
|
|
747
|
+
return n.route.id || (process.env.NODE_ENV !== "production" ? ee(!1, e + ' can only be used on routes that contain a unique "id"') : ee(!1)), n.route.id;
|
|
748
748
|
}
|
|
749
749
|
function Rl() {
|
|
750
750
|
return aa(Gt.UseRouteId);
|
|
@@ -779,7 +779,7 @@ function xl(e, t) {
|
|
|
779
779
|
e?.v7_startTransition === void 0 && Ia("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 && Ia("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
|
|
780
780
|
}
|
|
781
781
|
function Pe(e) {
|
|
782
|
-
process.env.NODE_ENV !== "production" ?
|
|
782
|
+
process.env.NODE_ENV !== "production" ? ee(!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>.") : ee(!1);
|
|
783
783
|
}
|
|
784
784
|
function Il(e) {
|
|
785
785
|
let {
|
|
@@ -791,7 +791,7 @@ function Il(e) {
|
|
|
791
791
|
static: o = !1,
|
|
792
792
|
future: i
|
|
793
793
|
} = e;
|
|
794
|
-
Tt() && (process.env.NODE_ENV !== "production" ?
|
|
794
|
+
Tt() && (process.env.NODE_ENV !== "production" ? ee(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : ee(!1));
|
|
795
795
|
let c = t.replace(/^\/*/, "/"), d = k.useMemo(() => ({
|
|
796
796
|
basename: c,
|
|
797
797
|
navigator: s,
|
|
@@ -808,10 +808,10 @@ function Il(e) {
|
|
|
808
808
|
state: w = null,
|
|
809
809
|
key: C = "default"
|
|
810
810
|
} = r, S = k.useMemo(() => {
|
|
811
|
-
let
|
|
812
|
-
return
|
|
811
|
+
let y = Xe(u, c);
|
|
812
|
+
return y == null ? null : {
|
|
813
813
|
location: {
|
|
814
|
-
pathname:
|
|
814
|
+
pathname: y,
|
|
815
815
|
search: p,
|
|
816
816
|
hash: f,
|
|
817
817
|
state: w,
|
|
@@ -847,7 +847,7 @@ function Br(e, t) {
|
|
|
847
847
|
n.push.apply(n, Br(r.props.children, s));
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
|
-
r.type !== Pe && (process.env.NODE_ENV !== "production" ?
|
|
850
|
+
r.type !== Pe && (process.env.NODE_ENV !== "production" ? ee(!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>") : ee(!1)), !r.props.index || !r.props.children || (process.env.NODE_ENV !== "production" ? ee(!1, "An index route cannot have child routes.") : ee(!1));
|
|
851
851
|
let o = {
|
|
852
852
|
id: r.props.id || s.join("-"),
|
|
853
853
|
caseSensitive: r.props.caseSensitive,
|
|
@@ -1034,9 +1034,9 @@ const Xl = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
1034
1034
|
} catch {
|
|
1035
1035
|
process.env.NODE_ENV !== "production" && Te(!1, '<Link to="' + d + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
1036
1036
|
}
|
|
1037
|
-
let
|
|
1037
|
+
let y = yl(d, {
|
|
1038
1038
|
relative: a
|
|
1039
|
-
}),
|
|
1039
|
+
}), h = rc(d, {
|
|
1040
1040
|
replace: o,
|
|
1041
1041
|
state: i,
|
|
1042
1042
|
target: c,
|
|
@@ -1045,12 +1045,12 @@ const Xl = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
1045
1045
|
viewTransition: p
|
|
1046
1046
|
});
|
|
1047
1047
|
function m(N) {
|
|
1048
|
-
r && r(N), N.defaultPrevented ||
|
|
1048
|
+
r && r(N), N.defaultPrevented || h(N);
|
|
1049
1049
|
}
|
|
1050
1050
|
return (
|
|
1051
1051
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1052
1052
|
/* @__PURE__ */ k.createElement("a", Nt({}, f, {
|
|
1053
|
-
href: C ||
|
|
1053
|
+
href: C || y,
|
|
1054
1054
|
onClick: S || s ? r : m,
|
|
1055
1055
|
ref: n,
|
|
1056
1056
|
target: c
|
|
@@ -1072,18 +1072,18 @@ const ec = /* @__PURE__ */ k.forwardRef(function(t, n) {
|
|
|
1072
1072
|
relative: p.relative
|
|
1073
1073
|
}), w = lt(), C = k.useContext(ta), {
|
|
1074
1074
|
navigator: S,
|
|
1075
|
-
basename:
|
|
1076
|
-
} = k.useContext(De),
|
|
1075
|
+
basename: y
|
|
1076
|
+
} = k.useContext(De), h = C != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1077
1077
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1078
1078
|
cc(f) && d === !0, m = S.encodeLocation ? S.encodeLocation(f).pathname : f.pathname, N = w.pathname, _ = C && C.navigation && C.navigation.location ? C.navigation.location.pathname : null;
|
|
1079
|
-
a || (N = N.toLowerCase(), _ = _ ? _.toLowerCase() : null, m = m.toLowerCase()), _ &&
|
|
1079
|
+
a || (N = N.toLowerCase(), _ = _ ? _.toLowerCase() : null, m = m.toLowerCase()), _ && y && (_ = Xe(_, y) || _);
|
|
1080
1080
|
const x = m !== "/" && m.endsWith("/") ? m.length - 1 : m.length;
|
|
1081
|
-
let I = N === m || !o && N.startsWith(m) && N.charAt(x) === "/",
|
|
1081
|
+
let I = N === m || !o && N.startsWith(m) && N.charAt(x) === "/", K = _ != null && (_ === m || !o && _.startsWith(m) && _.charAt(m.length) === "/"), $ = {
|
|
1082
1082
|
isActive: I,
|
|
1083
|
-
isPending:
|
|
1084
|
-
isTransitioning:
|
|
1083
|
+
isPending: K,
|
|
1084
|
+
isTransitioning: h
|
|
1085
1085
|
}, b = I ? r : void 0, T;
|
|
1086
|
-
typeof s == "function" ? T = s($) : T = [s, I ? "active" : null,
|
|
1086
|
+
typeof s == "function" ? T = s($) : T = [s, I ? "active" : null, K ? "pending" : null, h ? "transitioning" : null].filter(Boolean).join(" ");
|
|
1087
1087
|
let A = typeof i == "function" ? i($) : i;
|
|
1088
1088
|
return /* @__PURE__ */ k.createElement(so, Nt({}, p, {
|
|
1089
1089
|
"aria-current": b,
|
|
@@ -1110,7 +1110,7 @@ const tc = /* @__PURE__ */ k.forwardRef((e, t) => {
|
|
|
1110
1110
|
viewTransition: f
|
|
1111
1111
|
} = e, w = sa(e, Kl), C = ic(), S = lc(c, {
|
|
1112
1112
|
relative: u
|
|
1113
|
-
}),
|
|
1113
|
+
}), y = i.toLowerCase() === "get" ? "get" : "post", h = (m) => {
|
|
1114
1114
|
if (d && d(m), m.defaultPrevented) return;
|
|
1115
1115
|
m.preventDefault();
|
|
1116
1116
|
let N = m.nativeEvent.submitter, _ = N?.getAttribute("formmethod") || i;
|
|
@@ -1127,9 +1127,9 @@ const tc = /* @__PURE__ */ k.forwardRef((e, t) => {
|
|
|
1127
1127
|
};
|
|
1128
1128
|
return /* @__PURE__ */ k.createElement("form", Nt({
|
|
1129
1129
|
ref: t,
|
|
1130
|
-
method:
|
|
1130
|
+
method: y,
|
|
1131
1131
|
action: S,
|
|
1132
|
-
onSubmit: a ? d :
|
|
1132
|
+
onSubmit: a ? d : h
|
|
1133
1133
|
}, w));
|
|
1134
1134
|
});
|
|
1135
1135
|
process.env.NODE_ENV !== "production" && (tc.displayName = "Form");
|
|
@@ -1147,7 +1147,7 @@ function nc(e) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
function oo(e) {
|
|
1149
1149
|
let t = k.useContext(tn);
|
|
1150
|
-
return t || (process.env.NODE_ENV !== "production" ?
|
|
1150
|
+
return t || (process.env.NODE_ENV !== "production" ? ee(!1, nc(e)) : ee(!1)), t;
|
|
1151
1151
|
}
|
|
1152
1152
|
function rc(e, t) {
|
|
1153
1153
|
let {
|
|
@@ -1238,7 +1238,7 @@ function lc(e, t) {
|
|
|
1238
1238
|
} = t === void 0 ? {} : t, {
|
|
1239
1239
|
basename: r
|
|
1240
1240
|
} = k.useContext(De), a = k.useContext(je);
|
|
1241
|
-
a || (process.env.NODE_ENV !== "production" ?
|
|
1241
|
+
a || (process.env.NODE_ENV !== "production" ? ee(!1, "useFormAction must be used inside a RouteContext") : ee(!1));
|
|
1242
1242
|
let [s] = a.matches.slice(-1), o = Nt({}, rn(e || ".", {
|
|
1243
1243
|
relative: n
|
|
1244
1244
|
})), i = lt();
|
|
@@ -1256,7 +1256,7 @@ function lc(e, t) {
|
|
|
1256
1256
|
function cc(e, t) {
|
|
1257
1257
|
t === void 0 && (t = {});
|
|
1258
1258
|
let n = k.useContext(ao);
|
|
1259
|
-
n == null && (process.env.NODE_ENV !== "production" ?
|
|
1259
|
+
n == null && (process.env.NODE_ENV !== "production" ? ee(!1, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : ee(!1));
|
|
1260
1260
|
let {
|
|
1261
1261
|
basename: r
|
|
1262
1262
|
} = oo(jn.useViewTransitionState), a = rn(e, {
|
|
@@ -1513,7 +1513,7 @@ const Gc = (e) => {
|
|
|
1513
1513
|
!1
|
|
1514
1514
|
), (a) => {
|
|
1515
1515
|
r.push(a), rt.postMessage(n, "*");
|
|
1516
|
-
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", Ce(rt.postMessage)), Qc = typeof queueMicrotask < "u" ? queueMicrotask.bind(rt) : typeof process < "u" && process.nextTick || go, yo = (e) => e != null && Ce(e[an]), ed = (e) => e != null && Yt(e, an) && yo(e),
|
|
1516
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", Ce(rt.postMessage)), Qc = typeof queueMicrotask < "u" ? queueMicrotask.bind(rt) : typeof process < "u" && process.nextTick || go, yo = (e) => e != null && Ce(e[an]), ed = (e) => e != null && Yt(e, an) && yo(e), g = {
|
|
1517
1517
|
isArray: st,
|
|
1518
1518
|
isArrayBuffer: uo,
|
|
1519
1519
|
isBuffer: Rt,
|
|
@@ -1577,7 +1577,7 @@ const Gc = (e) => {
|
|
|
1577
1577
|
asap: Qc,
|
|
1578
1578
|
isIterable: yo,
|
|
1579
1579
|
isSafeIterable: ed
|
|
1580
|
-
}, td =
|
|
1580
|
+
}, td = g.toObjectSet([
|
|
1581
1581
|
"age",
|
|
1582
1582
|
"authorization",
|
|
1583
1583
|
"content-length",
|
|
@@ -1601,8 +1601,8 @@ const Gc = (e) => {
|
|
|
1601
1601
|
return e && e.split(`
|
|
1602
1602
|
`).forEach(function(o) {
|
|
1603
1603
|
a = o.indexOf(":"), n = o.substring(0, a).trim().toLowerCase(), r = o.substring(a + 1).trim();
|
|
1604
|
-
const i =
|
|
1605
|
-
!n || i &&
|
|
1604
|
+
const i = g.hasOwnProp(t, n);
|
|
1605
|
+
!n || i && g.hasOwnProp(td, n) || (n === "set-cookie" ? i ? t[n].push(r) : t[n] = [r] : t[n] = i ? t[n] + ", " + r : r);
|
|
1606
1606
|
}), t;
|
|
1607
1607
|
};
|
|
1608
1608
|
function rd(e) {
|
|
@@ -1623,12 +1623,12 @@ function rd(e) {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
const ad = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), sd = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
|
|
1625
1625
|
function ia(e, t) {
|
|
1626
|
-
return
|
|
1626
|
+
return g.isArray(e) ? e.map((n) => ia(n, t)) : rd(String(e).replace(t, ""));
|
|
1627
1627
|
}
|
|
1628
1628
|
const od = (e) => ia(e, ad), id = (e) => ia(e, sd);
|
|
1629
1629
|
function bo(e) {
|
|
1630
1630
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1631
|
-
return
|
|
1631
|
+
return g.forEach(e.toJSON(), (n, r) => {
|
|
1632
1632
|
t[r] = id(n);
|
|
1633
1633
|
}), t;
|
|
1634
1634
|
}
|
|
@@ -1637,7 +1637,7 @@ function It(e) {
|
|
|
1637
1637
|
return e && String(e).trim().toLowerCase();
|
|
1638
1638
|
}
|
|
1639
1639
|
function Ln(e) {
|
|
1640
|
-
return e === !1 || e == null ? e :
|
|
1640
|
+
return e === !1 || e == null ? e : g.isArray(e) ? e.map(Ln) : od(String(e));
|
|
1641
1641
|
}
|
|
1642
1642
|
function ld(e) {
|
|
1643
1643
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -1700,12 +1700,12 @@ function ud(e) {
|
|
|
1700
1700
|
}
|
|
1701
1701
|
const pd = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1702
1702
|
function pr(e, t, n, r, a) {
|
|
1703
|
-
if (
|
|
1703
|
+
if (g.isFunction(r))
|
|
1704
1704
|
return r.call(this, t, n);
|
|
1705
|
-
if (a && (t = n), !!
|
|
1706
|
-
if (
|
|
1705
|
+
if (a && (t = n), !!g.isString(t)) {
|
|
1706
|
+
if (g.isString(r))
|
|
1707
1707
|
return t.indexOf(r) !== -1;
|
|
1708
|
-
if (
|
|
1708
|
+
if (g.isRegExp(r))
|
|
1709
1709
|
return r.test(t);
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
@@ -1713,7 +1713,7 @@ function fd(e) {
|
|
|
1713
1713
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
1714
1714
|
}
|
|
1715
1715
|
function md(e, t) {
|
|
1716
|
-
const n =
|
|
1716
|
+
const n = g.toCamelCase(" " + t);
|
|
1717
1717
|
["get", "set", "has"].forEach((r) => {
|
|
1718
1718
|
Object.defineProperty(e, r + n, {
|
|
1719
1719
|
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
@@ -1736,20 +1736,20 @@ let ye = class {
|
|
|
1736
1736
|
const u = It(c);
|
|
1737
1737
|
if (!u)
|
|
1738
1738
|
return;
|
|
1739
|
-
const p =
|
|
1739
|
+
const p = g.findKey(a, u);
|
|
1740
1740
|
(!p || a[p] === void 0 || d === !0 || d === void 0 && a[p] !== !1) && (a[p || c] = Ln(i));
|
|
1741
1741
|
}
|
|
1742
|
-
const o = (i, c) =>
|
|
1743
|
-
if (
|
|
1742
|
+
const o = (i, c) => g.forEach(i, (d, u) => s(d, u, c));
|
|
1743
|
+
if (g.isPlainObject(t) || t instanceof this.constructor)
|
|
1744
1744
|
o(t, n);
|
|
1745
|
-
else if (
|
|
1745
|
+
else if (g.isString(t) && (t = t.trim()) && !pd(t))
|
|
1746
1746
|
o(nd(t), n);
|
|
1747
|
-
else if (
|
|
1747
|
+
else if (g.isObject(t) && g.isSafeIterable(t)) {
|
|
1748
1748
|
let i = /* @__PURE__ */ Object.create(null), c, d;
|
|
1749
1749
|
for (const u of t) {
|
|
1750
|
-
if (!
|
|
1750
|
+
if (!g.isArray(u))
|
|
1751
1751
|
throw new TypeError("Object iterator must return a key-value pair");
|
|
1752
|
-
d = u[0],
|
|
1752
|
+
d = u[0], g.hasOwnProp(i, d) ? (c = i[d], i[d] = g.isArray(c) ? [...c, u[1]] : [c, u[1]]) : i[d] = u[1];
|
|
1753
1753
|
}
|
|
1754
1754
|
o(i, n);
|
|
1755
1755
|
} else
|
|
@@ -1758,16 +1758,16 @@ let ye = class {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
get(t, n) {
|
|
1760
1760
|
if (t = It(t), t) {
|
|
1761
|
-
const r =
|
|
1761
|
+
const r = g.findKey(this, t);
|
|
1762
1762
|
if (r) {
|
|
1763
1763
|
const a = this[r];
|
|
1764
1764
|
if (!n)
|
|
1765
1765
|
return a;
|
|
1766
1766
|
if (n === !0)
|
|
1767
1767
|
return ld(a);
|
|
1768
|
-
if (
|
|
1768
|
+
if (g.isFunction(n))
|
|
1769
1769
|
return n.call(this, a, r);
|
|
1770
|
-
if (
|
|
1770
|
+
if (g.isRegExp(n))
|
|
1771
1771
|
return n.exec(a);
|
|
1772
1772
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1773
1773
|
}
|
|
@@ -1775,7 +1775,7 @@ let ye = class {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
has(t, n) {
|
|
1777
1777
|
if (t = It(t), t) {
|
|
1778
|
-
const r =
|
|
1778
|
+
const r = g.findKey(this, t);
|
|
1779
1779
|
return !!(r && this[r] !== void 0 && (!n || pr(this, this[r], r, n)));
|
|
1780
1780
|
}
|
|
1781
1781
|
return !1;
|
|
@@ -1785,11 +1785,11 @@ let ye = class {
|
|
|
1785
1785
|
let a = !1;
|
|
1786
1786
|
function s(o) {
|
|
1787
1787
|
if (o = It(o), o) {
|
|
1788
|
-
const i =
|
|
1788
|
+
const i = g.findKey(r, o);
|
|
1789
1789
|
i && (!n || pr(r, r[i], i, n)) && (delete r[i], a = !0);
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
|
-
return
|
|
1792
|
+
return g.isArray(t) ? t.forEach(s) : s(t), a;
|
|
1793
1793
|
}
|
|
1794
1794
|
clear(t) {
|
|
1795
1795
|
const n = Object.keys(this);
|
|
@@ -1802,8 +1802,8 @@ let ye = class {
|
|
|
1802
1802
|
}
|
|
1803
1803
|
normalize(t) {
|
|
1804
1804
|
const n = this, r = {};
|
|
1805
|
-
return
|
|
1806
|
-
const o =
|
|
1805
|
+
return g.forEach(this, (a, s) => {
|
|
1806
|
+
const o = g.findKey(r, s);
|
|
1807
1807
|
if (o) {
|
|
1808
1808
|
n[o] = Ln(a), delete n[s];
|
|
1809
1809
|
return;
|
|
@@ -1817,8 +1817,8 @@ let ye = class {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
toJSON(t) {
|
|
1819
1819
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1820
|
-
return
|
|
1821
|
-
r != null && r !== !1 && (n[a] = t &&
|
|
1820
|
+
return g.forEach(this, (r, a) => {
|
|
1821
|
+
r != null && r !== !1 && (n[a] = t && g.isArray(r) ? r.join(", ") : r);
|
|
1822
1822
|
}), n;
|
|
1823
1823
|
}
|
|
1824
1824
|
[Symbol.iterator]() {
|
|
@@ -1830,7 +1830,7 @@ let ye = class {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
getSetCookie() {
|
|
1832
1832
|
const t = this.get("set-cookie");
|
|
1833
|
-
return
|
|
1833
|
+
return g.isArray(t) ? t : t == null || t === !1 ? [] : [t];
|
|
1834
1834
|
}
|
|
1835
1835
|
get [Symbol.toStringTag]() {
|
|
1836
1836
|
return "AxiosHeaders";
|
|
@@ -1853,7 +1853,7 @@ let ye = class {
|
|
|
1853
1853
|
const i = It(o);
|
|
1854
1854
|
r[i] || (md(a, o), r[i] = !0);
|
|
1855
1855
|
}
|
|
1856
|
-
return
|
|
1856
|
+
return g.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1857
1857
|
}
|
|
1858
1858
|
};
|
|
1859
1859
|
ye.accessor([
|
|
@@ -1864,7 +1864,7 @@ ye.accessor([
|
|
|
1864
1864
|
"User-Agent",
|
|
1865
1865
|
"Authorization"
|
|
1866
1866
|
]);
|
|
1867
|
-
|
|
1867
|
+
g.reduceDescriptors(ye.prototype, ({ value: e }, t) => {
|
|
1868
1868
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1869
1869
|
return {
|
|
1870
1870
|
get: () => e,
|
|
@@ -1873,14 +1873,14 @@ h.reduceDescriptors(ye.prototype, ({ value: e }, t) => {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
};
|
|
1875
1875
|
});
|
|
1876
|
-
|
|
1876
|
+
g.freezeMethods(ye);
|
|
1877
1877
|
const qn = "[REDACTED ****]";
|
|
1878
1878
|
function hd(e) {
|
|
1879
|
-
if (
|
|
1879
|
+
if (g.hasOwnProp(e, "toJSON"))
|
|
1880
1880
|
return !0;
|
|
1881
1881
|
let t = Object.getPrototypeOf(e);
|
|
1882
1882
|
for (; t && t !== Object.prototype; ) {
|
|
1883
|
-
if (
|
|
1883
|
+
if (g.hasOwnProp(t, "toJSON"))
|
|
1884
1884
|
return !0;
|
|
1885
1885
|
t = Object.getPrototypeOf(t);
|
|
1886
1886
|
}
|
|
@@ -1888,22 +1888,22 @@ function hd(e) {
|
|
|
1888
1888
|
}
|
|
1889
1889
|
function gd(e, t) {
|
|
1890
1890
|
const n = new Set(t.map((s) => String(s).toLowerCase())), r = [], a = (s) => {
|
|
1891
|
-
if (s === null || typeof s != "object" ||
|
|
1891
|
+
if (s === null || typeof s != "object" || g.isBuffer(s)) return s;
|
|
1892
1892
|
if (r.indexOf(s) !== -1) return;
|
|
1893
1893
|
s instanceof ye && (s = s.toJSON()), r.push(s);
|
|
1894
1894
|
let o;
|
|
1895
|
-
if (
|
|
1895
|
+
if (g.isArray(s))
|
|
1896
1896
|
o = [], s.forEach((i, c) => {
|
|
1897
1897
|
const d = a(i);
|
|
1898
|
-
|
|
1898
|
+
g.isUndefined(d) || (o[c] = d);
|
|
1899
1899
|
});
|
|
1900
1900
|
else {
|
|
1901
|
-
if (!
|
|
1901
|
+
if (!g.isPlainObject(s) && hd(s))
|
|
1902
1902
|
return r.pop(), s;
|
|
1903
1903
|
o = /* @__PURE__ */ Object.create(null);
|
|
1904
1904
|
for (const [i, c] of Object.entries(s)) {
|
|
1905
1905
|
const d = n.has(i.toLowerCase()) ? qn : a(c);
|
|
1906
|
-
|
|
1906
|
+
g.isUndefined(d) || (o[i] = d);
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
1909
1909
|
return r.pop(), o;
|
|
@@ -1929,7 +1929,7 @@ function yd(e) {
|
|
|
1929
1929
|
let M = class wo extends Error {
|
|
1930
1930
|
static from(t, n, r, a, s, o) {
|
|
1931
1931
|
let i = t.message;
|
|
1932
|
-
!i &&
|
|
1932
|
+
!i && g.isArray(t.errors) && t.errors.length && (i = yd(t));
|
|
1933
1933
|
const c = new wo(i, n || t.code, r, a, s);
|
|
1934
1934
|
return Object.defineProperty(c, "cause", {
|
|
1935
1935
|
__proto__: null,
|
|
@@ -1962,7 +1962,7 @@ let M = class wo extends Error {
|
|
|
1962
1962
|
}), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), a && (this.request = a), s && (this.response = s, this.status = s.status);
|
|
1963
1963
|
}
|
|
1964
1964
|
toJSON() {
|
|
1965
|
-
const t = this.config, n = t &&
|
|
1965
|
+
const t = this.config, n = t && g.hasOwnProp(t, "redact") ? t.redact : void 0, r = g.isArray(n) && n.length > 0 ? gd(t, n) : g.toJSONObject(t);
|
|
1966
1966
|
return {
|
|
1967
1967
|
// Standard
|
|
1968
1968
|
message: this.message,
|
|
@@ -1998,10 +1998,10 @@ M.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
|
1998
1998
|
M.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
1999
1999
|
const bd = null, vo = 100;
|
|
2000
2000
|
function jr(e) {
|
|
2001
|
-
return
|
|
2001
|
+
return g.isPlainObject(e) || g.isArray(e);
|
|
2002
2002
|
}
|
|
2003
2003
|
function So(e) {
|
|
2004
|
-
return
|
|
2004
|
+
return g.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
2005
2005
|
}
|
|
2006
2006
|
function fr(e, t, n) {
|
|
2007
2007
|
return e ? e.concat(t).map(function(a, s) {
|
|
@@ -2009,15 +2009,15 @@ function fr(e, t, n) {
|
|
|
2009
2009
|
}).join(n ? "." : "") : t;
|
|
2010
2010
|
}
|
|
2011
2011
|
function wd(e) {
|
|
2012
|
-
return
|
|
2012
|
+
return g.isArray(e) && !e.some(jr);
|
|
2013
2013
|
}
|
|
2014
|
-
const vd =
|
|
2014
|
+
const vd = g.toFlatObject(g, {}, null, function(t) {
|
|
2015
2015
|
return /^is[A-Z]/.test(t);
|
|
2016
2016
|
});
|
|
2017
2017
|
function rr(e, t, n) {
|
|
2018
|
-
if (!
|
|
2018
|
+
if (!g.isObject(e))
|
|
2019
2019
|
throw new TypeError("target must be an object");
|
|
2020
|
-
t = t || new FormData(), n =
|
|
2020
|
+
t = t || new FormData(), n = g.toFlatObject(
|
|
2021
2021
|
n,
|
|
2022
2022
|
{
|
|
2023
2023
|
metaTokens: !0,
|
|
@@ -2026,81 +2026,81 @@ function rr(e, t, n) {
|
|
|
2026
2026
|
},
|
|
2027
2027
|
!1,
|
|
2028
2028
|
function(m, N) {
|
|
2029
|
-
return !
|
|
2029
|
+
return !g.isUndefined(N[m]);
|
|
2030
2030
|
}
|
|
2031
2031
|
);
|
|
2032
|
-
const r = n.metaTokens, a = n.visitor || C, s = n.dots, o = n.indexes, i = n.Blob || typeof Blob < "u" && Blob, c = n.maxDepth === void 0 ? vo : n.maxDepth, d = i &&
|
|
2033
|
-
if (!
|
|
2032
|
+
const r = n.metaTokens, a = n.visitor || C, s = n.dots, o = n.indexes, i = n.Blob || typeof Blob < "u" && Blob, c = n.maxDepth === void 0 ? vo : n.maxDepth, d = i && g.isSpecCompliantForm(t), u = [];
|
|
2033
|
+
if (!g.isFunction(a))
|
|
2034
2034
|
throw new TypeError("visitor must be a function");
|
|
2035
|
-
function p(
|
|
2036
|
-
if (
|
|
2037
|
-
if (
|
|
2038
|
-
return
|
|
2039
|
-
if (
|
|
2040
|
-
return
|
|
2041
|
-
if (!d &&
|
|
2035
|
+
function p(h) {
|
|
2036
|
+
if (h === null) return "";
|
|
2037
|
+
if (g.isDate(h))
|
|
2038
|
+
return h.toISOString();
|
|
2039
|
+
if (g.isBoolean(h))
|
|
2040
|
+
return h.toString();
|
|
2041
|
+
if (!d && g.isBlob(h))
|
|
2042
2042
|
throw new M("Blob is not supported. Use a Buffer instead.");
|
|
2043
|
-
if (
|
|
2043
|
+
if (g.isArrayBuffer(h) || g.isTypedArray(h)) {
|
|
2044
2044
|
if (d && typeof i == "function")
|
|
2045
|
-
return new i([
|
|
2045
|
+
return new i([h]);
|
|
2046
2046
|
throw new M("Blob is not supported. Use a Buffer instead.", M.ERR_NOT_SUPPORT);
|
|
2047
2047
|
}
|
|
2048
|
-
return
|
|
2048
|
+
return h;
|
|
2049
2049
|
}
|
|
2050
|
-
function f(
|
|
2051
|
-
if (
|
|
2050
|
+
function f(h) {
|
|
2051
|
+
if (h > c)
|
|
2052
2052
|
throw new M(
|
|
2053
|
-
"Object is too deeply nested (" +
|
|
2053
|
+
"Object is too deeply nested (" + h + " levels). Max depth: " + c,
|
|
2054
2054
|
M.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
2055
2055
|
);
|
|
2056
2056
|
}
|
|
2057
|
-
function w(
|
|
2057
|
+
function w(h, m) {
|
|
2058
2058
|
if (c === 1 / 0)
|
|
2059
|
-
return JSON.stringify(
|
|
2059
|
+
return JSON.stringify(h);
|
|
2060
2060
|
const N = [];
|
|
2061
|
-
return JSON.stringify(
|
|
2062
|
-
if (!
|
|
2061
|
+
return JSON.stringify(h, function(x, I) {
|
|
2062
|
+
if (!g.isObject(I))
|
|
2063
2063
|
return I;
|
|
2064
2064
|
for (; N.length && N[N.length - 1] !== this; )
|
|
2065
2065
|
N.pop();
|
|
2066
2066
|
return N.push(I), f(m + N.length - 1), I;
|
|
2067
2067
|
});
|
|
2068
2068
|
}
|
|
2069
|
-
function C(
|
|
2070
|
-
let _ =
|
|
2071
|
-
if (
|
|
2072
|
-
return t.append(fr(N, m, s), p(
|
|
2073
|
-
if (
|
|
2074
|
-
if (
|
|
2075
|
-
m = r ? m : m.slice(0, -2),
|
|
2076
|
-
else if (
|
|
2077
|
-
return m = So(m), _.forEach(function(I,
|
|
2078
|
-
!(
|
|
2069
|
+
function C(h, m, N) {
|
|
2070
|
+
let _ = h;
|
|
2071
|
+
if (g.isReactNative(t) && g.isReactNativeBlob(h))
|
|
2072
|
+
return t.append(fr(N, m, s), p(h)), !1;
|
|
2073
|
+
if (h && !N && typeof h == "object") {
|
|
2074
|
+
if (g.endsWith(m, "{}"))
|
|
2075
|
+
m = r ? m : m.slice(0, -2), h = w(h, 1);
|
|
2076
|
+
else if (g.isArray(h) && wd(h) || (g.isFileList(h) || g.endsWith(m, "[]")) && (_ = g.toArray(h)))
|
|
2077
|
+
return m = So(m), _.forEach(function(I, K) {
|
|
2078
|
+
!(g.isUndefined(I) || I === null) && t.append(
|
|
2079
2079
|
// eslint-disable-next-line no-nested-ternary
|
|
2080
|
-
o === !0 ? fr([m],
|
|
2080
|
+
o === !0 ? fr([m], K, s) : o === null ? m : m + "[]",
|
|
2081
2081
|
p(I)
|
|
2082
2082
|
);
|
|
2083
2083
|
}), !1;
|
|
2084
2084
|
}
|
|
2085
|
-
return jr(
|
|
2085
|
+
return jr(h) ? !0 : (t.append(fr(N, m, s), p(h)), !1);
|
|
2086
2086
|
}
|
|
2087
2087
|
const S = Object.assign(vd, {
|
|
2088
2088
|
defaultVisitor: C,
|
|
2089
2089
|
convertValue: p,
|
|
2090
2090
|
isVisitable: jr
|
|
2091
2091
|
});
|
|
2092
|
-
function
|
|
2093
|
-
if (!
|
|
2094
|
-
if (f(N), u.indexOf(
|
|
2092
|
+
function y(h, m, N = 0) {
|
|
2093
|
+
if (!g.isUndefined(h)) {
|
|
2094
|
+
if (f(N), u.indexOf(h) !== -1)
|
|
2095
2095
|
throw new Error("Circular reference detected in " + m.join("."));
|
|
2096
|
-
u.push(
|
|
2097
|
-
(!(
|
|
2096
|
+
u.push(h), g.forEach(h, function(x, I) {
|
|
2097
|
+
(!(g.isUndefined(x) || x === null) && a.call(t, x, g.isString(I) ? I.trim() : I, m, S)) === !0 && y(x, m ? m.concat(I) : [I], N + 1);
|
|
2098
2098
|
}), u.pop();
|
|
2099
2099
|
}
|
|
2100
2100
|
}
|
|
2101
|
-
if (!
|
|
2101
|
+
if (!g.isObject(e))
|
|
2102
2102
|
throw new TypeError("data must be an object");
|
|
2103
|
-
return
|
|
2103
|
+
return y(e), t;
|
|
2104
2104
|
}
|
|
2105
2105
|
function ja(e) {
|
|
2106
2106
|
const t = {
|
|
@@ -2135,11 +2135,11 @@ function No(e, t, n) {
|
|
|
2135
2135
|
if (!t)
|
|
2136
2136
|
return e;
|
|
2137
2137
|
e = e || "";
|
|
2138
|
-
const r =
|
|
2138
|
+
const r = g.isFunction(n) ? {
|
|
2139
2139
|
serialize: n
|
|
2140
|
-
} : n, a =
|
|
2140
|
+
} : n, a = g.getSafeProp(r, "encode") || Sd, s = g.getSafeProp(r, "serialize");
|
|
2141
2141
|
let o;
|
|
2142
|
-
if (s ? o = s(t, r) : o =
|
|
2142
|
+
if (s ? o = s(t, r) : o = g.isURLSearchParams(t) ? t.toString() : new la(t, r).toString(a), o) {
|
|
2143
2143
|
const i = e.indexOf("#");
|
|
2144
2144
|
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
|
|
2145
2145
|
}
|
|
@@ -2195,7 +2195,7 @@ class Va {
|
|
|
2195
2195
|
* @returns {void}
|
|
2196
2196
|
*/
|
|
2197
2197
|
forEach(t) {
|
|
2198
|
-
|
|
2198
|
+
g.forEach(this.handlers, function(r) {
|
|
2199
2199
|
r !== null && t(r);
|
|
2200
2200
|
});
|
|
2201
2201
|
}
|
|
@@ -2230,7 +2230,7 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Td
|
|
|
2230
2230
|
function Od(e, t) {
|
|
2231
2231
|
return rr(e, new he.classes.URLSearchParams(), {
|
|
2232
2232
|
visitor: function(n, r, a, s) {
|
|
2233
|
-
return he.isNode &&
|
|
2233
|
+
return he.isNode && g.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
2234
2234
|
},
|
|
2235
2235
|
...t
|
|
2236
2236
|
});
|
|
@@ -2265,21 +2265,21 @@ function Eo(e) {
|
|
|
2265
2265
|
let o = n[s++];
|
|
2266
2266
|
if (o === "__proto__") return !0;
|
|
2267
2267
|
const i = Number.isFinite(+o), c = s >= n.length;
|
|
2268
|
-
return o = !o &&
|
|
2268
|
+
return o = !o && g.isArray(a) ? a.length : o, c ? (g.hasOwnProp(a, o) ? a[o] = g.isArray(a[o]) ? a[o].concat(r) : [a[o], r] : a[o] = r, !i) : ((!g.hasOwnProp(a, o) || !g.isObject(a[o])) && (a[o] = []), t(n, r, a[o], s) && g.isArray(a[o]) && (a[o] = kd(a[o])), !i);
|
|
2269
2269
|
}
|
|
2270
|
-
if (
|
|
2270
|
+
if (g.isFormData(e) && g.isFunction(e.entries)) {
|
|
2271
2271
|
const n = {};
|
|
2272
|
-
return
|
|
2272
|
+
return g.forEachEntry(e, (r, a) => {
|
|
2273
2273
|
t(Fd(r), a, n, 0);
|
|
2274
2274
|
}), n;
|
|
2275
2275
|
}
|
|
2276
2276
|
return null;
|
|
2277
2277
|
}
|
|
2278
|
-
const pt = (e, t) => e != null &&
|
|
2278
|
+
const pt = (e, t) => e != null && g.hasOwnProp(e, t) ? e[t] : void 0;
|
|
2279
2279
|
function xd(e, t, n) {
|
|
2280
|
-
if (
|
|
2280
|
+
if (g.isString(e))
|
|
2281
2281
|
try {
|
|
2282
|
-
return (t || JSON.parse)(e),
|
|
2282
|
+
return (t || JSON.parse)(e), g.trim(e);
|
|
2283
2283
|
} catch (r) {
|
|
2284
2284
|
if (r.name !== "SyntaxError")
|
|
2285
2285
|
throw r;
|
|
@@ -2291,21 +2291,21 @@ const on = {
|
|
|
2291
2291
|
adapter: ["xhr", "http", "fetch"],
|
|
2292
2292
|
transformRequest: [
|
|
2293
2293
|
function(t, n) {
|
|
2294
|
-
const r = n.getContentType() || "", a = r.indexOf("application/json") > -1, s =
|
|
2295
|
-
if (s &&
|
|
2294
|
+
const r = n.getContentType() || "", a = r.indexOf("application/json") > -1, s = g.isObject(t);
|
|
2295
|
+
if (s && g.isHTMLForm(t) && (t = new FormData(t)), g.isFormData(t))
|
|
2296
2296
|
return a ? JSON.stringify(Eo(t)) : t;
|
|
2297
|
-
if (
|
|
2297
|
+
if (g.isArrayBuffer(t) || g.isBuffer(t) || g.isStream(t) || g.isFile(t) || g.isBlob(t) || g.isReadableStream(t))
|
|
2298
2298
|
return t;
|
|
2299
|
-
if (
|
|
2299
|
+
if (g.isArrayBufferView(t))
|
|
2300
2300
|
return t.buffer;
|
|
2301
|
-
if (
|
|
2301
|
+
if (g.isURLSearchParams(t))
|
|
2302
2302
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
2303
2303
|
let i;
|
|
2304
2304
|
if (s) {
|
|
2305
2305
|
const c = pt(this, "formSerializer");
|
|
2306
2306
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
2307
2307
|
return Od(t, c).toString();
|
|
2308
|
-
if ((i =
|
|
2308
|
+
if ((i = g.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
2309
2309
|
const d = pt(this, "env"), u = d && d.FormData;
|
|
2310
2310
|
return rr(
|
|
2311
2311
|
i ? { "files[]": t } : t,
|
|
@@ -2320,9 +2320,9 @@ const on = {
|
|
|
2320
2320
|
transformResponse: [
|
|
2321
2321
|
function(t) {
|
|
2322
2322
|
const n = pt(this, "transitional") || on.transitional, r = n && n.forcedJSONParsing, a = pt(this, "responseType"), s = a === "json";
|
|
2323
|
-
if (
|
|
2323
|
+
if (g.isResponse(t) || g.isReadableStream(t))
|
|
2324
2324
|
return t;
|
|
2325
|
-
if (t &&
|
|
2325
|
+
if (t && g.isString(t) && (r && !a || s)) {
|
|
2326
2326
|
const i = !(n && n.silentJSONParsing) && s;
|
|
2327
2327
|
try {
|
|
2328
2328
|
return JSON.parse(t, pt(this, "parseReviver"));
|
|
@@ -2357,13 +2357,13 @@ const on = {
|
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
2359
|
};
|
|
2360
|
-
|
|
2360
|
+
g.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (e) => {
|
|
2361
2361
|
on.headers[e] = {};
|
|
2362
2362
|
});
|
|
2363
2363
|
function mr(e, t) {
|
|
2364
2364
|
const n = this || on, r = t || n, a = ye.from(r.headers);
|
|
2365
2365
|
let s = r.data;
|
|
2366
|
-
return
|
|
2366
|
+
return g.forEach(e, function(i) {
|
|
2367
2367
|
s = i.call(n, s, a.normalize(), t ? t.status : void 0);
|
|
2368
2368
|
}), a.normalize(), s;
|
|
2369
2369
|
}
|
|
@@ -2457,7 +2457,7 @@ const Wn = (e, t, n = 3) => {
|
|
|
2457
2457
|
}),
|
|
2458
2458
|
t[1]
|
|
2459
2459
|
];
|
|
2460
|
-
}, za = (e, t =
|
|
2460
|
+
}, za = (e, t = g.asap) => (...n) => t(() => e(...n)), Md = he.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, he.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
2461
2461
|
new URL(he.origin),
|
|
2462
2462
|
he.navigator && /(msie|trident)/i.test(he.navigator.userAgent)
|
|
2463
2463
|
) : () => !0, Bd = he.hasStandardBrowserEnv ? (
|
|
@@ -2466,7 +2466,7 @@ const Wn = (e, t, n = 3) => {
|
|
|
2466
2466
|
write(e, t, n, r, a, s, o) {
|
|
2467
2467
|
if (typeof document > "u") return;
|
|
2468
2468
|
const i = [`${e}=${encodeURIComponent(t)}`];
|
|
2469
|
-
|
|
2469
|
+
g.isNumber(n) && i.push(`expires=${new Date(n).toUTCString()}`), g.isString(r) && i.push(`path=${r}`), g.isString(a) && i.push(`domain=${a}`), s === !0 && i.push("secure"), g.isString(o) && i.push(`SameSite=${o}`), document.cookie = i.join("; ");
|
|
2470
2470
|
},
|
|
2471
2471
|
read(e) {
|
|
2472
2472
|
if (typeof document > "u") return null;
|
|
@@ -2563,40 +2563,40 @@ function it(e, t) {
|
|
|
2563
2563
|
configurable: !0
|
|
2564
2564
|
});
|
|
2565
2565
|
function r(u, p, f, w) {
|
|
2566
|
-
return
|
|
2566
|
+
return g.isPlainObject(u) && g.isPlainObject(p) ? g.merge.call({ caseless: w }, u, p) : g.isPlainObject(p) ? g.merge({}, p) : g.isArray(p) ? p.slice() : p;
|
|
2567
2567
|
}
|
|
2568
2568
|
function a(u, p, f, w) {
|
|
2569
|
-
if (
|
|
2570
|
-
if (!
|
|
2569
|
+
if (g.isUndefined(p)) {
|
|
2570
|
+
if (!g.isUndefined(u))
|
|
2571
2571
|
return r(void 0, u, f, w);
|
|
2572
2572
|
} else return r(u, p, f, w);
|
|
2573
2573
|
}
|
|
2574
2574
|
function s(u, p) {
|
|
2575
|
-
if (!
|
|
2575
|
+
if (!g.isUndefined(p))
|
|
2576
2576
|
return r(void 0, p);
|
|
2577
2577
|
}
|
|
2578
2578
|
function o(u, p) {
|
|
2579
|
-
if (
|
|
2580
|
-
if (!
|
|
2579
|
+
if (g.isUndefined(p)) {
|
|
2580
|
+
if (!g.isUndefined(u))
|
|
2581
2581
|
return r(void 0, u);
|
|
2582
2582
|
} else return r(void 0, p);
|
|
2583
2583
|
}
|
|
2584
2584
|
function i(u) {
|
|
2585
|
-
const p =
|
|
2586
|
-
if (!
|
|
2587
|
-
if (
|
|
2588
|
-
if (
|
|
2585
|
+
const p = g.hasOwnProp(t, "transitional") ? t.transitional : void 0;
|
|
2586
|
+
if (!g.isUndefined(p))
|
|
2587
|
+
if (g.isPlainObject(p)) {
|
|
2588
|
+
if (g.hasOwnProp(p, u))
|
|
2589
2589
|
return p[u];
|
|
2590
2590
|
} else
|
|
2591
2591
|
return;
|
|
2592
|
-
const f =
|
|
2593
|
-
if (
|
|
2592
|
+
const f = g.hasOwnProp(e, "transitional") ? e.transitional : void 0;
|
|
2593
|
+
if (g.isPlainObject(f) && g.hasOwnProp(f, u))
|
|
2594
2594
|
return f[u];
|
|
2595
2595
|
}
|
|
2596
2596
|
function c(u, p, f) {
|
|
2597
|
-
if (
|
|
2597
|
+
if (g.hasOwnProp(t, f))
|
|
2598
2598
|
return r(u, p);
|
|
2599
|
-
if (
|
|
2599
|
+
if (g.hasOwnProp(e, f))
|
|
2600
2600
|
return r(void 0, u);
|
|
2601
2601
|
}
|
|
2602
2602
|
const d = {
|
|
@@ -2631,11 +2631,11 @@ function it(e, t) {
|
|
|
2631
2631
|
validateStatus: c,
|
|
2632
2632
|
headers: (u, p, f) => a(Ka(u), Ka(p), f, !0)
|
|
2633
2633
|
};
|
|
2634
|
-
return
|
|
2634
|
+
return g.forEach(Kd({ ...e, ...t }), function(p) {
|
|
2635
2635
|
if (p === "__proto__" || p === "constructor" || p === "prototype") return;
|
|
2636
|
-
const f =
|
|
2637
|
-
|
|
2638
|
-
}),
|
|
2636
|
+
const f = g.hasOwnProp(d, p) ? d[p] : a, w = g.hasOwnProp(e, p) ? e[p] : void 0, C = g.hasOwnProp(t, p) ? t[p] : void 0, S = f(w, C, p);
|
|
2637
|
+
g.isUndefined(S) && f !== c || (n[p] = S);
|
|
2638
|
+
}), g.hasOwnProp(t, "validateStatus") && g.isUndefined(t.validateStatus) && i("validateStatusUndefinedResolves") === !1 && (g.hasOwnProp(e, "validateStatus") ? n.validateStatus = r(void 0, e.validateStatus) : delete n.validateStatus), n;
|
|
2639
2639
|
}
|
|
2640
2640
|
const Jd = ["content-type", "content-length"];
|
|
2641
2641
|
function Zd(e, t, n) {
|
|
@@ -2652,7 +2652,7 @@ const Gd = (e) => encodeURIComponent(e).replace(
|
|
|
2652
2652
|
(t, n) => String.fromCharCode(parseInt(n, 16))
|
|
2653
2653
|
);
|
|
2654
2654
|
function Ro(e) {
|
|
2655
|
-
const t = it({}, e), n = (f) =>
|
|
2655
|
+
const t = it({}, e), n = (f) => g.hasOwnProp(t, f) ? t[f] : void 0, r = n("data");
|
|
2656
2656
|
let a = n("withXSRFToken");
|
|
2657
2657
|
const s = n("xsrfHeaderName"), o = n("xsrfCookieName");
|
|
2658
2658
|
let i = n("headers");
|
|
@@ -2662,7 +2662,7 @@ function Ro(e) {
|
|
|
2662
2662
|
n("params"),
|
|
2663
2663
|
n("paramsSerializer")
|
|
2664
2664
|
), c) {
|
|
2665
|
-
const f =
|
|
2665
|
+
const f = g.getSafeProp(c, "username") || "", w = g.getSafeProp(c, "password") || "";
|
|
2666
2666
|
try {
|
|
2667
2667
|
i.set(
|
|
2668
2668
|
"Authorization",
|
|
@@ -2672,7 +2672,7 @@ function Ro(e) {
|
|
|
2672
2672
|
throw M.from(C, M.ERR_BAD_OPTION_VALUE, e);
|
|
2673
2673
|
}
|
|
2674
2674
|
}
|
|
2675
|
-
if (
|
|
2675
|
+
if (g.isFormData(r) && (he.hasStandardBrowserEnv || he.hasStandardBrowserWebWorkerEnv || g.isReactNative(r) ? i.setContentType(void 0) : g.isFunction(r.getHeaders) && Zd(i, r.getHeaders(), n("formDataHeaderPolicy"))), he.hasStandardBrowserEnv && (g.isFunction(a) && (a = a(t)), a === !0 || a == null && Md(t.url))) {
|
|
2676
2676
|
const w = s && o && Bd.read(o);
|
|
2677
2677
|
w && i.set(s, w);
|
|
2678
2678
|
}
|
|
@@ -2687,39 +2687,39 @@ const Yd = typeof XMLHttpRequest < "u", Xd = Yd && function(e) {
|
|
|
2687
2687
|
function S() {
|
|
2688
2688
|
w && w(), C && C(), a.cancelToken && a.cancelToken.unsubscribe(u), a.signal && a.signal.removeEventListener("abort", u);
|
|
2689
2689
|
}
|
|
2690
|
-
let
|
|
2691
|
-
|
|
2692
|
-
function
|
|
2693
|
-
if (!
|
|
2690
|
+
let y = new XMLHttpRequest();
|
|
2691
|
+
y.open(a.method.toUpperCase(), a.url, !0), y.timeout = a.timeout;
|
|
2692
|
+
function h() {
|
|
2693
|
+
if (!y)
|
|
2694
2694
|
return;
|
|
2695
2695
|
const N = ye.from(
|
|
2696
|
-
"getAllResponseHeaders" in
|
|
2696
|
+
"getAllResponseHeaders" in y && y.getAllResponseHeaders()
|
|
2697
2697
|
), x = {
|
|
2698
|
-
data: !i || i === "text" || i === "json" ?
|
|
2699
|
-
status:
|
|
2700
|
-
statusText:
|
|
2698
|
+
data: !i || i === "text" || i === "json" ? y.responseText : y.response,
|
|
2699
|
+
status: y.status,
|
|
2700
|
+
statusText: y.statusText,
|
|
2701
2701
|
headers: N,
|
|
2702
2702
|
config: e,
|
|
2703
|
-
request:
|
|
2703
|
+
request: y
|
|
2704
2704
|
};
|
|
2705
2705
|
Lo(
|
|
2706
|
-
function(
|
|
2707
|
-
n(
|
|
2706
|
+
function(K) {
|
|
2707
|
+
n(K), S();
|
|
2708
2708
|
},
|
|
2709
|
-
function(
|
|
2710
|
-
r(
|
|
2709
|
+
function(K) {
|
|
2710
|
+
r(K), S();
|
|
2711
2711
|
},
|
|
2712
2712
|
x
|
|
2713
|
-
),
|
|
2714
|
-
}
|
|
2715
|
-
"onloadend" in
|
|
2716
|
-
!
|
|
2717
|
-
},
|
|
2718
|
-
|
|
2719
|
-
},
|
|
2720
|
-
const x = _ && _.message ? _.message : "Network Error", I = new M(x, M.ERR_NETWORK, e,
|
|
2721
|
-
I.event = _ || null, r(I), S(),
|
|
2722
|
-
},
|
|
2713
|
+
), y = null;
|
|
2714
|
+
}
|
|
2715
|
+
"onloadend" in y ? y.onloadend = h : y.onreadystatechange = function() {
|
|
2716
|
+
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.startsWith("file:")) || setTimeout(h);
|
|
2717
|
+
}, y.onabort = function() {
|
|
2718
|
+
y && (r(new M("Request aborted", M.ECONNABORTED, e, y)), S(), y = null);
|
|
2719
|
+
}, y.onerror = function(_) {
|
|
2720
|
+
const x = _ && _.message ? _.message : "Network Error", I = new M(x, M.ERR_NETWORK, e, y);
|
|
2721
|
+
I.event = _ || null, r(I), S(), y = null;
|
|
2722
|
+
}, y.ontimeout = function() {
|
|
2723
2723
|
let _ = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded";
|
|
2724
2724
|
const x = a.transitional || ca;
|
|
2725
2725
|
a.timeoutErrorMessage && (_ = a.timeoutErrorMessage), r(
|
|
@@ -2727,13 +2727,13 @@ const Yd = typeof XMLHttpRequest < "u", Xd = Yd && function(e) {
|
|
|
2727
2727
|
_,
|
|
2728
2728
|
x.clarifyTimeoutError ? M.ETIMEDOUT : M.ECONNABORTED,
|
|
2729
2729
|
e,
|
|
2730
|
-
|
|
2730
|
+
y
|
|
2731
2731
|
)
|
|
2732
|
-
), S(),
|
|
2733
|
-
}, s === void 0 && o.setContentType(null), "setRequestHeader" in
|
|
2734
|
-
|
|
2735
|
-
}),
|
|
2736
|
-
|
|
2732
|
+
), S(), y = null;
|
|
2733
|
+
}, s === void 0 && o.setContentType(null), "setRequestHeader" in y && g.forEach(bo(o), function(_, x) {
|
|
2734
|
+
y.setRequestHeader(x, _);
|
|
2735
|
+
}), g.isUndefined(a.withCredentials) || (y.withCredentials = !!a.withCredentials), i && i !== "json" && (y.responseType = a.responseType), d && ([f, C] = Wn(d, !0), y.addEventListener("progress", f)), c && y.upload && ([p, w] = Wn(c), y.upload.addEventListener("progress", p), y.upload.addEventListener("loadend", w)), (a.cancelToken || a.signal) && (u = (N) => {
|
|
2736
|
+
y && (r(!N || N.type ? new ln(null, e, y) : N), y.abort(), S(), y = null);
|
|
2737
2737
|
}, a.cancelToken && a.cancelToken.subscribe(u), a.signal && (a.signal.aborted ? u() : a.signal.addEventListener("abort", u)));
|
|
2738
2738
|
const m = Id(a.url);
|
|
2739
2739
|
if (m && !he.protocols.includes(m)) {
|
|
@@ -2746,7 +2746,7 @@ const Yd = typeof XMLHttpRequest < "u", Xd = Yd && function(e) {
|
|
|
2746
2746
|
), S();
|
|
2747
2747
|
return;
|
|
2748
2748
|
}
|
|
2749
|
-
|
|
2749
|
+
y.send(s || null);
|
|
2750
2750
|
});
|
|
2751
2751
|
}, Qd = (e, t) => {
|
|
2752
2752
|
if (e = e ? e.filter(Boolean) : [], !t && !e.length)
|
|
@@ -2780,7 +2780,7 @@ const Yd = typeof XMLHttpRequest < "u", Xd = Yd && function(e) {
|
|
|
2780
2780
|
}
|
|
2781
2781
|
});
|
|
2782
2782
|
const { signal: i } = n;
|
|
2783
|
-
return i.unsubscribe = () =>
|
|
2783
|
+
return i.unsubscribe = () => g.asap(o), i;
|
|
2784
2784
|
}, eu = function* (e, t) {
|
|
2785
2785
|
let n = e.byteLength;
|
|
2786
2786
|
if (n < t) {
|
|
@@ -2903,11 +2903,11 @@ function cu(e) {
|
|
|
2903
2903
|
iu
|
|
2904
2904
|
);
|
|
2905
2905
|
}
|
|
2906
|
-
const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } =
|
|
2906
|
+
const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = g, du = (e) => encodeURIComponent(e).replace(
|
|
2907
2907
|
/%([0-9A-F]{2})/gi,
|
|
2908
2908
|
(t, n) => String.fromCharCode(parseInt(n, 16))
|
|
2909
2909
|
), Xa = (e) => {
|
|
2910
|
-
if (!
|
|
2910
|
+
if (!g.isString(e))
|
|
2911
2911
|
return e;
|
|
2912
2912
|
try {
|
|
2913
2913
|
return decodeURIComponent(e);
|
|
@@ -2925,8 +2925,8 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
2925
2925
|
let n = e;
|
|
2926
2926
|
return t !== -1 && (n = n.slice(t + 3)), n.includes("@") || n.includes(":");
|
|
2927
2927
|
}, pu = (e) => {
|
|
2928
|
-
const t =
|
|
2929
|
-
e =
|
|
2928
|
+
const t = g.global !== void 0 && g.global !== null ? g.global : globalThis, { ReadableStream: n, TextEncoder: r } = t;
|
|
2929
|
+
e = g.merge.call(
|
|
2930
2930
|
{
|
|
2931
2931
|
skipUndefined: !0
|
|
2932
2932
|
},
|
|
@@ -2939,57 +2939,57 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
2939
2939
|
const { fetch: a, Request: s, Response: o } = e, i = a ? gn(a) : typeof fetch == "function", c = gn(s), d = gn(o);
|
|
2940
2940
|
if (!i)
|
|
2941
2941
|
return !1;
|
|
2942
|
-
const u = i && gn(n), p = i && (typeof r == "function" ? /* @__PURE__ */ ((
|
|
2943
|
-
let
|
|
2942
|
+
const u = i && gn(n), p = i && (typeof r == "function" ? /* @__PURE__ */ ((h) => (m) => h.encode(m))(new r()) : async (h) => new Uint8Array(await new s(h).arrayBuffer())), f = c && u && Qa(() => {
|
|
2943
|
+
let h = !1;
|
|
2944
2944
|
const m = new s(he.origin, {
|
|
2945
2945
|
body: new n(),
|
|
2946
2946
|
method: "POST",
|
|
2947
2947
|
get duplex() {
|
|
2948
|
-
return
|
|
2948
|
+
return h = !0, "half";
|
|
2949
2949
|
}
|
|
2950
2950
|
}), N = m.headers.has("Content-Type");
|
|
2951
|
-
return m.body != null && m.body.cancel(),
|
|
2952
|
-
}), w = d && u && Qa(() =>
|
|
2953
|
-
stream: w && ((
|
|
2951
|
+
return m.body != null && m.body.cancel(), h && !N;
|
|
2952
|
+
}), w = d && u && Qa(() => g.isReadableStream(new o("").body)), C = {
|
|
2953
|
+
stream: w && ((h) => h.body)
|
|
2954
2954
|
};
|
|
2955
|
-
i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
2956
|
-
!C[
|
|
2957
|
-
let _ = m && m[
|
|
2955
|
+
i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((h) => {
|
|
2956
|
+
!C[h] && (C[h] = (m, N) => {
|
|
2957
|
+
let _ = m && m[h];
|
|
2958
2958
|
if (_)
|
|
2959
2959
|
return _.call(m);
|
|
2960
2960
|
throw new M(
|
|
2961
|
-
`Response type '${
|
|
2961
|
+
`Response type '${h}' is not supported`,
|
|
2962
2962
|
M.ERR_NOT_SUPPORT,
|
|
2963
2963
|
N
|
|
2964
2964
|
);
|
|
2965
2965
|
});
|
|
2966
2966
|
});
|
|
2967
|
-
const S = async (
|
|
2968
|
-
if (
|
|
2967
|
+
const S = async (h) => {
|
|
2968
|
+
if (h == null)
|
|
2969
2969
|
return 0;
|
|
2970
|
-
if (
|
|
2971
|
-
return
|
|
2972
|
-
if (
|
|
2970
|
+
if (g.isBlob(h))
|
|
2971
|
+
return h.size;
|
|
2972
|
+
if (g.isSpecCompliantForm(h))
|
|
2973
2973
|
return (await new s(he.origin, {
|
|
2974
2974
|
method: "POST",
|
|
2975
|
-
body:
|
|
2975
|
+
body: h
|
|
2976
2976
|
}).arrayBuffer()).byteLength;
|
|
2977
|
-
if (
|
|
2978
|
-
return
|
|
2979
|
-
if (
|
|
2980
|
-
return (await p(
|
|
2981
|
-
},
|
|
2982
|
-
const N =
|
|
2977
|
+
if (g.isArrayBufferView(h) || g.isArrayBuffer(h))
|
|
2978
|
+
return h.byteLength;
|
|
2979
|
+
if (g.isURLSearchParams(h) && (h = h + ""), g.isString(h))
|
|
2980
|
+
return (await p(h)).byteLength;
|
|
2981
|
+
}, y = async (h, m) => {
|
|
2982
|
+
const N = g.toFiniteNumber(h.getContentLength());
|
|
2983
2983
|
return N ?? S(m);
|
|
2984
2984
|
};
|
|
2985
|
-
return async (
|
|
2985
|
+
return async (h) => {
|
|
2986
2986
|
let {
|
|
2987
2987
|
url: m,
|
|
2988
2988
|
method: N,
|
|
2989
2989
|
data: _,
|
|
2990
2990
|
signal: x,
|
|
2991
2991
|
cancelToken: I,
|
|
2992
|
-
timeout:
|
|
2992
|
+
timeout: K,
|
|
2993
2993
|
onDownloadProgress: $,
|
|
2994
2994
|
onUploadProgress: b,
|
|
2995
2995
|
responseType: T,
|
|
@@ -2997,45 +2997,45 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
2997
2997
|
withCredentials: B = "same-origin",
|
|
2998
2998
|
fetchOptions: j,
|
|
2999
2999
|
maxContentLength: E,
|
|
3000
|
-
maxBodyLength:
|
|
3001
|
-
} = Ro(
|
|
3002
|
-
const U =
|
|
3003
|
-
let
|
|
3000
|
+
maxBodyLength: F
|
|
3001
|
+
} = Ro(h);
|
|
3002
|
+
const U = g.isNumber(E) && E > -1, H = g.isNumber(F) && F > -1, J = (z) => g.hasOwnProp(h, z) ? h[z] : void 0;
|
|
3003
|
+
let X = a || fetch;
|
|
3004
3004
|
T = T ? (T + "").toLowerCase() : "text";
|
|
3005
3005
|
let D = Qd(
|
|
3006
3006
|
[x, I && I.toAbortSignal()],
|
|
3007
|
-
|
|
3007
|
+
K
|
|
3008
3008
|
), P = null;
|
|
3009
|
-
const
|
|
3009
|
+
const R = D && D.unsubscribe && (() => {
|
|
3010
3010
|
D.unsubscribe();
|
|
3011
3011
|
});
|
|
3012
3012
|
let V, W = null;
|
|
3013
|
-
const
|
|
3013
|
+
const re = () => new M(
|
|
3014
3014
|
"Request body larger than maxBodyLength limit",
|
|
3015
3015
|
M.ERR_BAD_REQUEST,
|
|
3016
|
-
|
|
3016
|
+
h,
|
|
3017
3017
|
P
|
|
3018
3018
|
);
|
|
3019
3019
|
try {
|
|
3020
3020
|
let z;
|
|
3021
|
-
const L =
|
|
3021
|
+
const L = J("auth");
|
|
3022
3022
|
if (L) {
|
|
3023
|
-
const
|
|
3023
|
+
const Z = g.getSafeProp(L, "username") || "", we = g.getSafeProp(L, "password") || "";
|
|
3024
3024
|
z = {
|
|
3025
|
-
username:
|
|
3025
|
+
username: Z,
|
|
3026
3026
|
password: we
|
|
3027
3027
|
};
|
|
3028
3028
|
}
|
|
3029
3029
|
if (uu(m)) {
|
|
3030
|
-
const
|
|
3031
|
-
if (!z && (
|
|
3032
|
-
const we = Xa(
|
|
3030
|
+
const Z = new URL(m, he.origin);
|
|
3031
|
+
if (!z && (Z.username || Z.password)) {
|
|
3032
|
+
const we = Xa(Z.username), Ne = Xa(Z.password);
|
|
3033
3033
|
z = {
|
|
3034
3034
|
username: we,
|
|
3035
3035
|
password: Ne
|
|
3036
3036
|
};
|
|
3037
3037
|
}
|
|
3038
|
-
(
|
|
3038
|
+
(Z.username || Z.password) && (Z.username = "", Z.password = "", m = Z.href);
|
|
3039
3039
|
}
|
|
3040
3040
|
if (z && (A.delete("authorization"), A.set(
|
|
3041
3041
|
"Authorization",
|
|
@@ -3044,53 +3044,53 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
3044
3044
|
throw new M(
|
|
3045
3045
|
"maxContentLength size of " + E + " exceeded",
|
|
3046
3046
|
M.ERR_BAD_RESPONSE,
|
|
3047
|
-
|
|
3047
|
+
h,
|
|
3048
3048
|
P
|
|
3049
3049
|
);
|
|
3050
|
-
if (
|
|
3051
|
-
const
|
|
3052
|
-
if (typeof
|
|
3053
|
-
throw
|
|
3050
|
+
if (H && N !== "get" && N !== "head") {
|
|
3051
|
+
const Z = await S(_);
|
|
3052
|
+
if (typeof Z == "number" && isFinite(Z) && (V = Z, Z > F))
|
|
3053
|
+
throw re();
|
|
3054
3054
|
}
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3055
|
+
const Y = H && (g.isReadableStream(_) || g.isStream(_)), ie = (Z, we, Ne) => Ja(
|
|
3056
|
+
Z,
|
|
3057
3057
|
Ya,
|
|
3058
3058
|
(ke) => {
|
|
3059
|
-
if (
|
|
3060
|
-
throw W =
|
|
3059
|
+
if (H && ke > F)
|
|
3060
|
+
throw W = re();
|
|
3061
3061
|
we && we(ke);
|
|
3062
3062
|
},
|
|
3063
3063
|
Ne
|
|
3064
3064
|
);
|
|
3065
|
-
if (f && N !== "get" && N !== "head" && (b ||
|
|
3066
|
-
if (V = V ?? await
|
|
3067
|
-
let
|
|
3065
|
+
if (f && N !== "get" && N !== "head" && (b || Y)) {
|
|
3066
|
+
if (V = V ?? await y(A, _), V !== 0 || Y) {
|
|
3067
|
+
let Z = new s(m, {
|
|
3068
3068
|
method: "POST",
|
|
3069
3069
|
body: _,
|
|
3070
3070
|
duplex: "half"
|
|
3071
3071
|
}), we;
|
|
3072
|
-
if (
|
|
3072
|
+
if (g.isFormData(_) && (we = Z.headers.get("content-type")) && A.setContentType(we), Z.body) {
|
|
3073
3073
|
const [Ne, ke] = b && Wa(
|
|
3074
3074
|
V,
|
|
3075
3075
|
Wn(za(b))
|
|
3076
3076
|
) || [];
|
|
3077
|
-
_ = ie(
|
|
3077
|
+
_ = ie(Z.body, Ne, ke);
|
|
3078
3078
|
}
|
|
3079
3079
|
}
|
|
3080
|
-
} else if (
|
|
3080
|
+
} else if (Y && !c && u && N !== "get" && N !== "head")
|
|
3081
3081
|
_ = ie(_);
|
|
3082
|
-
else if (
|
|
3082
|
+
else if (Y && c && !f && N !== "get" && N !== "head")
|
|
3083
3083
|
throw new M(
|
|
3084
3084
|
"Stream request bodies are not supported by the current fetch implementation",
|
|
3085
3085
|
M.ERR_NOT_SUPPORT,
|
|
3086
|
-
|
|
3086
|
+
h,
|
|
3087
3087
|
P
|
|
3088
3088
|
);
|
|
3089
|
-
|
|
3090
|
-
const
|
|
3091
|
-
if (
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3089
|
+
g.isString(B) || (B = B ? "include" : "omit");
|
|
3090
|
+
const te = c && "credentials" in s.prototype;
|
|
3091
|
+
if (g.isFormData(_)) {
|
|
3092
|
+
const Z = A.getContentType();
|
|
3093
|
+
Z && /^multipart\/form-data/i.test(Z) && !/boundary=/i.test(Z) && A.delete("content-type");
|
|
3094
3094
|
}
|
|
3095
3095
|
A.set("User-Agent", "axios/" + ua, !1);
|
|
3096
3096
|
const le = {
|
|
@@ -3100,28 +3100,28 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
3100
3100
|
headers: bo(A.normalize()),
|
|
3101
3101
|
body: _,
|
|
3102
3102
|
duplex: "half",
|
|
3103
|
-
credentials:
|
|
3103
|
+
credentials: te ? B : void 0
|
|
3104
3104
|
};
|
|
3105
3105
|
P = c && new s(m, le);
|
|
3106
|
-
let pe = await (c ?
|
|
3106
|
+
let pe = await (c ? X(P, j) : X(m, le));
|
|
3107
3107
|
const Fe = ye.from(pe.headers);
|
|
3108
3108
|
if (U) {
|
|
3109
|
-
const
|
|
3110
|
-
if (
|
|
3109
|
+
const Z = g.toFiniteNumber(Fe.getContentLength());
|
|
3110
|
+
if (Z != null && Z > E)
|
|
3111
3111
|
throw new M(
|
|
3112
3112
|
"maxContentLength size of " + E + " exceeded",
|
|
3113
3113
|
M.ERR_BAD_RESPONSE,
|
|
3114
|
-
|
|
3114
|
+
h,
|
|
3115
3115
|
P
|
|
3116
3116
|
);
|
|
3117
3117
|
}
|
|
3118
3118
|
const Ae = w && (T === "stream" || T === "response");
|
|
3119
|
-
if (w && pe.body && ($ || U || Ae &&
|
|
3120
|
-
const
|
|
3119
|
+
if (w && pe.body && ($ || U || Ae && R)) {
|
|
3120
|
+
const Z = {};
|
|
3121
3121
|
["status", "statusText", "headers"].forEach((xe) => {
|
|
3122
|
-
|
|
3122
|
+
Z[xe] = pe[xe];
|
|
3123
3123
|
});
|
|
3124
|
-
const we =
|
|
3124
|
+
const we = g.toFiniteNumber(Fe.getContentLength()), [Ne, ke] = $ && Wa(
|
|
3125
3125
|
we,
|
|
3126
3126
|
Wn(za($), !0)
|
|
3127
3127
|
) || [];
|
|
@@ -3131,47 +3131,47 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
3131
3131
|
throw new M(
|
|
3132
3132
|
"maxContentLength size of " + E + " exceeded",
|
|
3133
3133
|
M.ERR_BAD_RESPONSE,
|
|
3134
|
-
|
|
3134
|
+
h,
|
|
3135
3135
|
P
|
|
3136
3136
|
);
|
|
3137
3137
|
Ne && Ne(xe);
|
|
3138
3138
|
};
|
|
3139
3139
|
pe = new o(
|
|
3140
3140
|
Ja(pe.body, Ya, xt, () => {
|
|
3141
|
-
ke && ke(),
|
|
3141
|
+
ke && ke(), R && R();
|
|
3142
3142
|
}),
|
|
3143
|
-
|
|
3143
|
+
Z
|
|
3144
3144
|
);
|
|
3145
3145
|
}
|
|
3146
3146
|
T = T || "text";
|
|
3147
|
-
let Le = await C[
|
|
3147
|
+
let Le = await C[g.findKey(C, T) || "text"](
|
|
3148
3148
|
pe,
|
|
3149
|
-
|
|
3149
|
+
h
|
|
3150
3150
|
);
|
|
3151
3151
|
if (U && !w && !Ae) {
|
|
3152
|
-
let
|
|
3153
|
-
if (Le != null && (typeof Le.byteLength == "number" ?
|
|
3152
|
+
let Z;
|
|
3153
|
+
if (Le != null && (typeof Le.byteLength == "number" ? Z = Le.byteLength : typeof Le.size == "number" ? Z = Le.size : typeof Le == "string" && (Z = typeof r == "function" ? new r().encode(Le).byteLength : Le.length)), typeof Z == "number" && Z > E)
|
|
3154
3154
|
throw new M(
|
|
3155
3155
|
"maxContentLength size of " + E + " exceeded",
|
|
3156
3156
|
M.ERR_BAD_RESPONSE,
|
|
3157
|
-
|
|
3157
|
+
h,
|
|
3158
3158
|
P
|
|
3159
3159
|
);
|
|
3160
3160
|
}
|
|
3161
|
-
return !Ae &&
|
|
3162
|
-
Lo(
|
|
3161
|
+
return !Ae && R && R(), await new Promise((Z, we) => {
|
|
3162
|
+
Lo(Z, we, {
|
|
3163
3163
|
data: Le,
|
|
3164
3164
|
headers: ye.from(pe.headers),
|
|
3165
3165
|
status: pe.status,
|
|
3166
3166
|
statusText: pe.statusText,
|
|
3167
|
-
config:
|
|
3167
|
+
config: h,
|
|
3168
3168
|
request: P
|
|
3169
3169
|
});
|
|
3170
3170
|
});
|
|
3171
3171
|
} catch (z) {
|
|
3172
|
-
if (
|
|
3172
|
+
if (R && R(), D && D.aborted && D.reason instanceof M) {
|
|
3173
3173
|
const L = D.reason;
|
|
3174
|
-
throw L.config =
|
|
3174
|
+
throw L.config = h, P && (L.request = P), z !== L && Object.defineProperty(L, "cause", {
|
|
3175
3175
|
__proto__: null,
|
|
3176
3176
|
value: z,
|
|
3177
3177
|
writable: !0,
|
|
@@ -3187,7 +3187,7 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
3187
3187
|
const L = new M(
|
|
3188
3188
|
"Network Error",
|
|
3189
3189
|
M.ERR_NETWORK,
|
|
3190
|
-
|
|
3190
|
+
h,
|
|
3191
3191
|
P,
|
|
3192
3192
|
z && z.response
|
|
3193
3193
|
);
|
|
@@ -3199,7 +3199,7 @@ const ua = "1.19.0", Ya = 64 * 1024, { isFunction: gn } = h, du = (e) => encodeU
|
|
|
3199
3199
|
configurable: !0
|
|
3200
3200
|
}), L;
|
|
3201
3201
|
}
|
|
3202
|
-
throw M.from(z, z && z.code,
|
|
3202
|
+
throw M.from(z, z && z.code, h, P, z && z.response);
|
|
3203
3203
|
}
|
|
3204
3204
|
};
|
|
3205
3205
|
}, fu = /* @__PURE__ */ new Map(), Fo = (e) => {
|
|
@@ -3218,7 +3218,7 @@ const pa = {
|
|
|
3218
3218
|
get: Fo
|
|
3219
3219
|
}
|
|
3220
3220
|
};
|
|
3221
|
-
|
|
3221
|
+
g.forEach(pa, (e, t) => {
|
|
3222
3222
|
if (e) {
|
|
3223
3223
|
try {
|
|
3224
3224
|
Object.defineProperty(e, "name", { __proto__: null, value: t });
|
|
@@ -3227,9 +3227,9 @@ h.forEach(pa, (e, t) => {
|
|
|
3227
3227
|
Object.defineProperty(e, "adapterName", { __proto__: null, value: t });
|
|
3228
3228
|
}
|
|
3229
3229
|
});
|
|
3230
|
-
const es = (e) => `- ${e}`, mu = (e) =>
|
|
3230
|
+
const es = (e) => `- ${e}`, mu = (e) => g.isFunction(e) || e === null || e === !1;
|
|
3231
3231
|
function hu(e, t) {
|
|
3232
|
-
e =
|
|
3232
|
+
e = g.isArray(e) ? e : [e];
|
|
3233
3233
|
const { length: n } = e;
|
|
3234
3234
|
let r, a;
|
|
3235
3235
|
const s = {};
|
|
@@ -3238,7 +3238,7 @@ function hu(e, t) {
|
|
|
3238
3238
|
let i;
|
|
3239
3239
|
if (a = r, !mu(r) && (a = pa[(i = String(r)).toLowerCase()], a === void 0))
|
|
3240
3240
|
throw new M(`Unknown adapter '${i}'`);
|
|
3241
|
-
if (a && (
|
|
3241
|
+
if (a && (g.isFunction(a) || (a = a.get(t))))
|
|
3242
3242
|
break;
|
|
3243
3243
|
s[i || "#" + o] = a;
|
|
3244
3244
|
}
|
|
@@ -3412,7 +3412,7 @@ let at = class {
|
|
|
3412
3412
|
validateStatusUndefinedResolves: ge.transitional(ge.boolean)
|
|
3413
3413
|
},
|
|
3414
3414
|
!1
|
|
3415
|
-
), a != null && (
|
|
3415
|
+
), a != null && (g.isFunction(a) ? n.paramsSerializer = {
|
|
3416
3416
|
serialize: a
|
|
3417
3417
|
} : Tn.assertOptions(
|
|
3418
3418
|
a,
|
|
@@ -3429,8 +3429,8 @@ let at = class {
|
|
|
3429
3429
|
},
|
|
3430
3430
|
!0
|
|
3431
3431
|
), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
3432
|
-
let o = s &&
|
|
3433
|
-
s &&
|
|
3432
|
+
let o = s && g.merge(s.common, s[n.method]);
|
|
3433
|
+
s && g.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (C) => {
|
|
3434
3434
|
delete s[C];
|
|
3435
3435
|
}), n.headers = ye.concat(o, s);
|
|
3436
3436
|
const i = [];
|
|
@@ -3439,8 +3439,8 @@ let at = class {
|
|
|
3439
3439
|
if (typeof S.runWhen == "function" && S.runWhen(n) === !1)
|
|
3440
3440
|
return;
|
|
3441
3441
|
c = c && S.synchronous;
|
|
3442
|
-
const
|
|
3443
|
-
|
|
3442
|
+
const y = n.transitional || ca;
|
|
3443
|
+
y && y.legacyInterceptorReqResOrdering ? i.unshift(S.fulfilled, S.rejected) : i.push(S.fulfilled, S.rejected);
|
|
3444
3444
|
});
|
|
3445
3445
|
const d = [];
|
|
3446
3446
|
this.interceptors.response.forEach(function(S) {
|
|
@@ -3459,18 +3459,18 @@ let at = class {
|
|
|
3459
3459
|
const C = i[p++], S = i[p++];
|
|
3460
3460
|
try {
|
|
3461
3461
|
w = C ? C(w) : w;
|
|
3462
|
-
} catch (
|
|
3462
|
+
} catch (y) {
|
|
3463
3463
|
if (!S) {
|
|
3464
|
-
u = Promise.reject(
|
|
3464
|
+
u = Promise.reject(y);
|
|
3465
3465
|
break;
|
|
3466
3466
|
}
|
|
3467
3467
|
try {
|
|
3468
|
-
const
|
|
3469
|
-
|
|
3468
|
+
const h = S.call(this, y);
|
|
3469
|
+
g.isThenable(h) && (u = Promise.resolve(h).then(
|
|
3470
3470
|
() => gr.call(this, w)
|
|
3471
3471
|
));
|
|
3472
|
-
} catch (
|
|
3473
|
-
u = Promise.reject(
|
|
3472
|
+
} catch (h) {
|
|
3473
|
+
u = Promise.reject(h);
|
|
3474
3474
|
}
|
|
3475
3475
|
break;
|
|
3476
3476
|
}
|
|
@@ -3491,18 +3491,18 @@ let at = class {
|
|
|
3491
3491
|
return No(n, t.params, t.paramsSerializer);
|
|
3492
3492
|
}
|
|
3493
3493
|
};
|
|
3494
|
-
|
|
3494
|
+
g.forEach(["delete", "get", "head", "options"], function(t) {
|
|
3495
3495
|
at.prototype[t] = function(n, r) {
|
|
3496
3496
|
return this.request(
|
|
3497
3497
|
it(r || {}, {
|
|
3498
3498
|
method: t,
|
|
3499
3499
|
url: n,
|
|
3500
|
-
data: r &&
|
|
3500
|
+
data: r && g.hasOwnProp(r, "data") ? r.data : void 0
|
|
3501
3501
|
})
|
|
3502
3502
|
);
|
|
3503
3503
|
};
|
|
3504
3504
|
});
|
|
3505
|
-
|
|
3505
|
+
g.forEach(["post", "put", "patch", "query"], function(t) {
|
|
3506
3506
|
function n(r) {
|
|
3507
3507
|
return function(s, o, i) {
|
|
3508
3508
|
return this.request(
|
|
@@ -3598,7 +3598,7 @@ function bu(e) {
|
|
|
3598
3598
|
};
|
|
3599
3599
|
}
|
|
3600
3600
|
function wu(e) {
|
|
3601
|
-
return
|
|
3601
|
+
return g.isObject(e) && e.isAxiosError === !0;
|
|
3602
3602
|
}
|
|
3603
3603
|
const qr = {
|
|
3604
3604
|
Continue: 100,
|
|
@@ -3677,7 +3677,7 @@ Object.entries(qr).forEach(([e, t]) => {
|
|
|
3677
3677
|
});
|
|
3678
3678
|
function Io(e) {
|
|
3679
3679
|
const t = new at(e), n = lo(at.prototype.request, t);
|
|
3680
|
-
return
|
|
3680
|
+
return g.extend(n, at.prototype, t, { allOwnKeys: !0 }), g.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(a) {
|
|
3681
3681
|
return Io(it(e, a));
|
|
3682
3682
|
}, n;
|
|
3683
3683
|
}
|
|
@@ -3697,7 +3697,7 @@ de.spread = bu;
|
|
|
3697
3697
|
de.isAxiosError = wu;
|
|
3698
3698
|
de.mergeConfig = it;
|
|
3699
3699
|
de.AxiosHeaders = ye;
|
|
3700
|
-
de.formToJSON = (e) => Eo(
|
|
3700
|
+
de.formToJSON = (e) => Eo(g.isHTMLForm(e) ? new FormData(e) : e);
|
|
3701
3701
|
de.getAdapter = ko.getAdapter;
|
|
3702
3702
|
de.HttpStatusCode = qr;
|
|
3703
3703
|
de.default = de;
|
|
@@ -5062,7 +5062,7 @@ const Hp = (e) => {
|
|
|
5062
5062
|
...i
|
|
5063
5063
|
},
|
|
5064
5064
|
[
|
|
5065
|
-
...o.map(([S,
|
|
5065
|
+
...o.map(([S, y]) => Dr(S, y)),
|
|
5066
5066
|
...Array.isArray(s) ? s : [s]
|
|
5067
5067
|
]
|
|
5068
5068
|
);
|
|
@@ -5317,39 +5317,41 @@ function Ef({
|
|
|
5317
5317
|
// onConfigure,
|
|
5318
5318
|
className: a = "",
|
|
5319
5319
|
id: s,
|
|
5320
|
-
title: o
|
|
5320
|
+
title: o,
|
|
5321
|
+
createdBy: i,
|
|
5322
|
+
createdByName: c
|
|
5321
5323
|
}) {
|
|
5322
|
-
const
|
|
5323
|
-
const
|
|
5324
|
-
if (
|
|
5325
|
-
const
|
|
5324
|
+
const d = et(), u = Re(), p = ne((h) => h.appDetails?.details?.currentUser), f = (Array.isArray(p?.roles) ? p.roles : []).some((h) => String(h?.name ?? h ?? "").trim().toLowerCase() === "admin"), w = p?.id != null && i != null && String(p.id) === String(i), C = f || w, S = s?.data ?? s?.id ?? s?._id ?? s, y = () => {
|
|
5325
|
+
const h = s?.data ?? s?.id ?? s?._id ?? s;
|
|
5326
|
+
if (h != null && h !== "") {
|
|
5327
|
+
const m = String(h);
|
|
5326
5328
|
try {
|
|
5327
|
-
sessionStorage.setItem(_f,
|
|
5329
|
+
sessionStorage.setItem(_f, m);
|
|
5328
5330
|
} catch {
|
|
5329
5331
|
}
|
|
5330
|
-
|
|
5332
|
+
u(At(m)), u(Jo()), u(Yo()), d(`/complaintmanagement/${m}`);
|
|
5331
5333
|
return;
|
|
5332
5334
|
}
|
|
5333
|
-
|
|
5335
|
+
d("/complaintmanagement");
|
|
5334
5336
|
};
|
|
5335
5337
|
return /* @__PURE__ */ v("div", { className: `ca-system-card__footer ${a}`.trim(), children: [
|
|
5336
5338
|
/* @__PURE__ */ l(ct, { variant: "small", as: "span", children: e ? `Updated on ${e}` : "" }),
|
|
5337
5339
|
/* @__PURE__ */ v("div", { className: "ca-system-card__footer-actions", children: [
|
|
5338
|
-
/* @__PURE__ */ l(Ee, { size: "sm", onClick:
|
|
5339
|
-
/* @__PURE__ */ l(
|
|
5340
|
+
/* @__PURE__ */ l(Ee, { size: "sm", onClick: y, children: t }),
|
|
5341
|
+
C ? /* @__PURE__ */ l(
|
|
5340
5342
|
Ee,
|
|
5341
5343
|
{
|
|
5342
5344
|
variant: "outline",
|
|
5343
5345
|
size: "sm",
|
|
5344
5346
|
onClick: () => {
|
|
5345
|
-
if (
|
|
5346
|
-
const
|
|
5347
|
-
|
|
5347
|
+
if (S == null || S === "") return;
|
|
5348
|
+
const h = String(S);
|
|
5349
|
+
u(zn({ data: !0 })), u(At(h)), d(`/settings/${h}?step=1`);
|
|
5348
5350
|
},
|
|
5349
5351
|
endIcon: /* @__PURE__ */ l(ci, { size: 14, color: "currentColor" }),
|
|
5350
5352
|
children: n
|
|
5351
5353
|
}
|
|
5352
|
-
)
|
|
5354
|
+
) : null
|
|
5353
5355
|
] })
|
|
5354
5356
|
] });
|
|
5355
5357
|
}
|
|
@@ -5399,8 +5401,8 @@ function xf({
|
|
|
5399
5401
|
onTitleClick: w,
|
|
5400
5402
|
onDescriptionClick: C,
|
|
5401
5403
|
onConfigure: S,
|
|
5402
|
-
onOpen:
|
|
5403
|
-
onDelete:
|
|
5404
|
+
onOpen: y,
|
|
5405
|
+
onDelete: h,
|
|
5404
5406
|
onToggleActive: m,
|
|
5405
5407
|
isTogglingActive: N = !1,
|
|
5406
5408
|
menuOptions: _ = [],
|
|
@@ -5417,7 +5419,7 @@ function xf({
|
|
|
5417
5419
|
formsFilled: u,
|
|
5418
5420
|
updatedOn: p
|
|
5419
5421
|
});
|
|
5420
|
-
},
|
|
5422
|
+
}, K = () => {
|
|
5421
5423
|
if (C) {
|
|
5422
5424
|
C({ id: e, title: t, descriptionHref: o });
|
|
5423
5425
|
return;
|
|
@@ -5443,12 +5445,12 @@ function xf({
|
|
|
5443
5445
|
})
|
|
5444
5446
|
}
|
|
5445
5447
|
}] : [],
|
|
5446
|
-
...
|
|
5448
|
+
...h ? [{
|
|
5447
5449
|
key: "delete",
|
|
5448
5450
|
label: "Delete",
|
|
5449
5451
|
icon: /* @__PURE__ */ l(ba, { size: 16, color: "currentColor" }),
|
|
5450
5452
|
danger: !0,
|
|
5451
|
-
onClick: () =>
|
|
5453
|
+
onClick: () => h({ id: e ?? n?.id ?? n?._id, title: t })
|
|
5452
5454
|
}] : [],
|
|
5453
5455
|
..._
|
|
5454
5456
|
];
|
|
@@ -5464,7 +5466,7 @@ function xf({
|
|
|
5464
5466
|
menuOptions: b
|
|
5465
5467
|
}
|
|
5466
5468
|
),
|
|
5467
|
-
s ? /* @__PURE__ */ l("p", { className: "ca-system-card__description", onClick:
|
|
5469
|
+
s ? /* @__PURE__ */ l("p", { className: "ca-system-card__description", onClick: K, children: s }) : null,
|
|
5468
5470
|
/* @__PURE__ */ l("div", { className: "ca-system-card__stats", children: $.map((T, A) => /* @__PURE__ */ v(ea.Fragment, { children: [
|
|
5469
5471
|
A > 0 ? /* @__PURE__ */ l(Lf, {}) : /* @__PURE__ */ l("div", { className: "ca-system-card__stats-spacer" }),
|
|
5470
5472
|
/* @__PURE__ */ l(Af, { label: T.label, value: T.value, icon: T.icon })
|
|
@@ -5472,10 +5474,12 @@ function xf({
|
|
|
5472
5474
|
/* @__PURE__ */ l(
|
|
5473
5475
|
Ef,
|
|
5474
5476
|
{
|
|
5475
|
-
updatedOn: p ?? kf(n?.createdAt),
|
|
5476
|
-
onOpen: () =>
|
|
5477
|
+
updatedOn: p ?? kf(n?.updatedAt ?? n?.createdAt),
|
|
5478
|
+
onOpen: () => y?.({ id: e, title: t }),
|
|
5477
5479
|
id: e ?? n?.id ?? n?._id,
|
|
5478
5480
|
title: t,
|
|
5481
|
+
createdBy: n?.createdByUserId ?? n?.createdBy,
|
|
5482
|
+
createdByName: n?.createdBy,
|
|
5479
5483
|
onConfigure: I
|
|
5480
5484
|
}
|
|
5481
5485
|
)
|
|
@@ -5667,9 +5671,9 @@ function Bf({
|
|
|
5667
5671
|
}) {
|
|
5668
5672
|
const d = et(), u = Re(), [p, f] = q(""), [w, C] = q(null), {
|
|
5669
5673
|
complaintList: S = [],
|
|
5670
|
-
loading:
|
|
5671
|
-
error:
|
|
5672
|
-
} =
|
|
5674
|
+
loading: y = !1,
|
|
5675
|
+
error: h = null
|
|
5676
|
+
} = ne(($) => $.complaintType ?? {});
|
|
5673
5677
|
se(() => {
|
|
5674
5678
|
u(zn({ data: !1 })), u($t());
|
|
5675
5679
|
}, [u]);
|
|
@@ -5711,7 +5715,7 @@ function Bf({
|
|
|
5711
5715
|
placeholder: "Search"
|
|
5712
5716
|
}
|
|
5713
5717
|
) }),
|
|
5714
|
-
|
|
5718
|
+
y ? /* @__PURE__ */ l(un, { text: "Loading systems" }) : h ? /* @__PURE__ */ l("div", { className: "ca-empty", children: /* @__PURE__ */ l("p", { className: "ca-body", children: typeof h == "string" ? h : "Failed to load complaint types." }) }) : /* @__PURE__ */ l(
|
|
5715
5719
|
If,
|
|
5716
5720
|
{
|
|
5717
5721
|
systems: m,
|
|
@@ -5972,16 +5976,16 @@ function Je({
|
|
|
5972
5976
|
allowClear: i = !1,
|
|
5973
5977
|
...c
|
|
5974
5978
|
}) {
|
|
5975
|
-
const [d, u] = q(!1), p = Se(null), f = e ?? "", w = n.find((
|
|
5979
|
+
const [d, u] = q(!1), p = Se(null), f = e ?? "", w = n.find((y) => String(_r(y)) === String(f)), C = w ? Er(w) : "";
|
|
5976
5980
|
se(() => {
|
|
5977
5981
|
if (!d) return;
|
|
5978
|
-
const
|
|
5979
|
-
p.current?.contains(
|
|
5982
|
+
const y = (h) => {
|
|
5983
|
+
p.current?.contains(h.target) || u(!1);
|
|
5980
5984
|
};
|
|
5981
|
-
return document.addEventListener("mousedown",
|
|
5985
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
5982
5986
|
}, [d]);
|
|
5983
|
-
const S = (
|
|
5984
|
-
t?.({ target: { value:
|
|
5987
|
+
const S = (y) => {
|
|
5988
|
+
t?.({ target: { value: y } });
|
|
5985
5989
|
};
|
|
5986
5990
|
return o ? /* @__PURE__ */ v("div", { className: `ca-select ca-select--menu ${a}`.trim(), ref: p, children: [
|
|
5987
5991
|
/* @__PURE__ */ l(
|
|
@@ -5993,7 +5997,7 @@ function Je({
|
|
|
5993
5997
|
disabled: s,
|
|
5994
5998
|
"aria-haspopup": "listbox",
|
|
5995
5999
|
"aria-expanded": d,
|
|
5996
|
-
onClick: () => u((
|
|
6000
|
+
onClick: () => u((y) => !y),
|
|
5997
6001
|
children: C || r
|
|
5998
6002
|
}
|
|
5999
6003
|
),
|
|
@@ -6004,8 +6008,8 @@ function Je({
|
|
|
6004
6008
|
className: "ca-select__menu",
|
|
6005
6009
|
role: "listbox",
|
|
6006
6010
|
style: { "--ca-select-max-visible": o },
|
|
6007
|
-
children: n.map((
|
|
6008
|
-
const
|
|
6011
|
+
children: n.map((y) => {
|
|
6012
|
+
const h = _r(y), m = String(h) === String(f);
|
|
6009
6013
|
return /* @__PURE__ */ l("li", { role: "none", children: /* @__PURE__ */ l(
|
|
6010
6014
|
"button",
|
|
6011
6015
|
{
|
|
@@ -6014,11 +6018,11 @@ function Je({
|
|
|
6014
6018
|
"aria-selected": m,
|
|
6015
6019
|
className: `ca-select__option${m ? " is-selected" : ""}`,
|
|
6016
6020
|
onClick: () => {
|
|
6017
|
-
S(
|
|
6021
|
+
S(h), u(!1);
|
|
6018
6022
|
},
|
|
6019
|
-
children: Er(
|
|
6023
|
+
children: Er(y)
|
|
6020
6024
|
}
|
|
6021
|
-
) },
|
|
6025
|
+
) }, h);
|
|
6022
6026
|
})
|
|
6023
6027
|
}
|
|
6024
6028
|
) : null
|
|
@@ -6033,9 +6037,9 @@ function Je({
|
|
|
6033
6037
|
...c,
|
|
6034
6038
|
children: [
|
|
6035
6039
|
/* @__PURE__ */ l("option", { value: "", disabled: !i, children: r }),
|
|
6036
|
-
n.map((
|
|
6037
|
-
const
|
|
6038
|
-
return /* @__PURE__ */ l("option", { value:
|
|
6040
|
+
n.map((y) => {
|
|
6041
|
+
const h = _r(y);
|
|
6042
|
+
return /* @__PURE__ */ l("option", { value: h, disabled: !!(y && typeof y == "object" && y.disabled), children: Er(y) }, h);
|
|
6039
6043
|
})
|
|
6040
6044
|
]
|
|
6041
6045
|
}
|
|
@@ -6130,11 +6134,11 @@ function Hr({
|
|
|
6130
6134
|
showAll: u = !0,
|
|
6131
6135
|
maxVisible: p = null
|
|
6132
6136
|
}) {
|
|
6133
|
-
const [f, w] = q(!1), C = Se(null), S = Se(null),
|
|
6134
|
-
|
|
6137
|
+
const [f, w] = q(!1), C = Se(null), S = Se(null), y = t.map((b) => typeof b == "string" ? { value: b, label: b } : { value: b.value, label: b.label }), h = new Map(
|
|
6138
|
+
y.map((b) => [String(b.value), b.label])
|
|
6135
6139
|
), m = (b) => n.some(
|
|
6136
6140
|
(T) => String(T) === String(b)
|
|
6137
|
-
), N =
|
|
6141
|
+
), N = y.map((b) => b.value), _ = N.length > 0 && N.every((b) => m(b)), x = () => {
|
|
6138
6142
|
if (_)
|
|
6139
6143
|
r?.(n.filter((b) => !N.some((T) => String(T) === String(b))));
|
|
6140
6144
|
else {
|
|
@@ -6157,7 +6161,7 @@ function Hr({
|
|
|
6157
6161
|
}, [f]);
|
|
6158
6162
|
const I = (b) => {
|
|
6159
6163
|
m(b) ? r?.(n.filter((T) => String(T) !== String(b))) : r?.([...n, b]);
|
|
6160
|
-
},
|
|
6164
|
+
}, K = (b) => {
|
|
6161
6165
|
r?.(n.filter((T) => String(T) !== String(b)));
|
|
6162
6166
|
}, $ = n.length ? `${n.length} selected` : a;
|
|
6163
6167
|
return /* @__PURE__ */ v(
|
|
@@ -6220,7 +6224,7 @@ function Hr({
|
|
|
6220
6224
|
overflowY: "auto"
|
|
6221
6225
|
},
|
|
6222
6226
|
children: [
|
|
6223
|
-
u &&
|
|
6227
|
+
u && y.length > 1 ? /* @__PURE__ */ l(
|
|
6224
6228
|
"li",
|
|
6225
6229
|
{
|
|
6226
6230
|
role: "option",
|
|
@@ -6239,7 +6243,7 @@ function Hr({
|
|
|
6239
6243
|
] })
|
|
6240
6244
|
}
|
|
6241
6245
|
) : null,
|
|
6242
|
-
|
|
6246
|
+
y.length ? y.map((b) => /* @__PURE__ */ l("li", { role: "option", "aria-selected": m(b.value), children: /* @__PURE__ */ v("label", { className: "ca-multi-select__option", children: [
|
|
6243
6247
|
/* @__PURE__ */ l(
|
|
6244
6248
|
"input",
|
|
6245
6249
|
{
|
|
@@ -6259,8 +6263,8 @@ function Hr({
|
|
|
6259
6263
|
n.length > 0 ? /* @__PURE__ */ l("div", { className: "ca-tag-list", children: [...new Set(n)].map((b) => /* @__PURE__ */ l(
|
|
6260
6264
|
Wf,
|
|
6261
6265
|
{
|
|
6262
|
-
label:
|
|
6263
|
-
onRemove: () =>
|
|
6266
|
+
label: h.get(String(b)) || String(b),
|
|
6267
|
+
onRemove: () => K(b)
|
|
6264
6268
|
},
|
|
6265
6269
|
String(b)
|
|
6266
6270
|
)) }) : null
|
|
@@ -6295,9 +6299,9 @@ function or({
|
|
|
6295
6299
|
S = S.parentElement;
|
|
6296
6300
|
}
|
|
6297
6301
|
if (!S || S === document.body) return;
|
|
6298
|
-
const
|
|
6299
|
-
if (
|
|
6300
|
-
const _ =
|
|
6302
|
+
const y = S.getBoundingClientRect(), h = w.getBoundingClientRect(), m = 12;
|
|
6303
|
+
if (h.left >= y.left + m && h.right <= y.right - m) return;
|
|
6304
|
+
const _ = h.left - y.left - (y.width - h.width) / 2;
|
|
6301
6305
|
S.scrollTo({
|
|
6302
6306
|
left: S.scrollLeft + _,
|
|
6303
6307
|
behavior: "smooth"
|
|
@@ -6306,7 +6310,7 @@ function or({
|
|
|
6306
6310
|
return () => cancelAnimationFrame(C);
|
|
6307
6311
|
}, [t]), /* @__PURE__ */ v("div", { className: `ca-stepper-wrap ca-stepper-wrap--${s} ${a}`.trim(), children: [
|
|
6308
6312
|
/* @__PURE__ */ l("nav", { className: `ca-stepper ca-stepper--${s}`, "aria-label": "Progress", children: e.map((w, C) => {
|
|
6309
|
-
const S = w.id ?? C + 1,
|
|
6313
|
+
const S = w.id ?? C + 1, y = S === t, h = S < t, m = !!r && (n || h || y);
|
|
6310
6314
|
return /* @__PURE__ */ v(
|
|
6311
6315
|
"button",
|
|
6312
6316
|
{
|
|
@@ -6316,15 +6320,15 @@ function or({
|
|
|
6316
6320
|
},
|
|
6317
6321
|
className: [
|
|
6318
6322
|
"ca-stepper__item",
|
|
6319
|
-
|
|
6320
|
-
|
|
6323
|
+
y ? "ca-stepper__item--active" : "",
|
|
6324
|
+
h ? "ca-stepper__item--done" : ""
|
|
6321
6325
|
].filter(Boolean).join(" "),
|
|
6322
6326
|
style: { zIndex: e.length - C },
|
|
6323
6327
|
onClick: () => {
|
|
6324
6328
|
f(zn({ data: !0 })), m && r?.(S);
|
|
6325
6329
|
},
|
|
6326
6330
|
disabled: !m,
|
|
6327
|
-
"aria-current":
|
|
6331
|
+
"aria-current": y ? "step" : void 0,
|
|
6328
6332
|
children: [
|
|
6329
6333
|
/* @__PURE__ */ v("span", { className: "ca-stepper__circle", children: [
|
|
6330
6334
|
S,
|
|
@@ -6381,9 +6385,9 @@ function Zf(e, t) {
|
|
|
6381
6385
|
return e.visibilityType && n.push("Please select a visibility type."), e.urlLink && n.push("Please enter a URL link."), e.roles && n.push("Please select roles for complaint filling."), n.join(" ");
|
|
6382
6386
|
}
|
|
6383
6387
|
function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
6384
|
-
const [r, a] = q(zf), [s, o] = q({}), i = Re(), { update: c } = wa(), { id: d } =
|
|
6388
|
+
const [r, a] = q(zf), [s, o] = q({}), i = Re(), { update: c } = wa(), { id: d } = ne((b) => b.appDetails || {}), { isEdit: u } = ne((b) => b.appDetails || {}), p = ne((b) => b.complaintType || {}), { complaintList: f = [], saving: w, loading: C, error: S } = p, y = Se(!1);
|
|
6385
6389
|
se(() => {
|
|
6386
|
-
!f.length && !C && !
|
|
6390
|
+
!f.length && !C && !y.current && (y.current = !0, i($t()));
|
|
6387
6391
|
}, [f.length, i, C]), se(() => {
|
|
6388
6392
|
!u || d === null || d === void 0 || i(yt(d)).unwrap().then((b) => {
|
|
6389
6393
|
const T = b?.data ?? b;
|
|
@@ -6394,7 +6398,7 @@ function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
|
6394
6398
|
console.log(" Fetch error:", b);
|
|
6395
6399
|
});
|
|
6396
6400
|
}, [i, d, u, c]);
|
|
6397
|
-
const
|
|
6401
|
+
const h = n.map((b) => ({
|
|
6398
6402
|
value: b.id,
|
|
6399
6403
|
label: b.name ?? b.label
|
|
6400
6404
|
})), m = f.map((b) => ({
|
|
@@ -6419,8 +6423,8 @@ function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
|
6419
6423
|
const [A, B] = await Promise.all([
|
|
6420
6424
|
i(Ye(T)).unwrap(),
|
|
6421
6425
|
i(Ue(T)).unwrap()
|
|
6422
|
-
]), j = (Array.isArray(A?.data) ? A.data : Array.isArray(A) ? A : []).map((
|
|
6423
|
-
...
|
|
6426
|
+
]), j = (Array.isArray(A?.data) ? A.data : Array.isArray(A) ? A : []).map((F) => ({
|
|
6427
|
+
...F,
|
|
6424
6428
|
roleIds: [],
|
|
6425
6429
|
role: [],
|
|
6426
6430
|
roleId: null
|
|
@@ -6471,9 +6475,9 @@ function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
|
6471
6475
|
const B = { ...A };
|
|
6472
6476
|
return delete B[b], B;
|
|
6473
6477
|
});
|
|
6474
|
-
},
|
|
6478
|
+
}, K = r.visibilityType === "PRIVATE_LINK" || r.visibilityType === "PUBLIC_LINK", $ = async () => {
|
|
6475
6479
|
const b = {};
|
|
6476
|
-
if (r.categoryName.trim() || (b.categoryName = !0), Gu(r.tatMinutes) || (b.tatMinutes = !0), r.visibilityType || (b.visibilityType = !0), r.roles.length || (b.roles = !0),
|
|
6480
|
+
if (r.categoryName.trim() || (b.categoryName = !0), Gu(r.tatMinutes) || (b.tatMinutes = !0), r.visibilityType || (b.visibilityType = !0), r.roles.length || (b.roles = !0), K && !r.urlLink.trim() && (b.urlLink = !0), Object.keys(b).length > 0) {
|
|
6477
6481
|
o(b);
|
|
6478
6482
|
return;
|
|
6479
6483
|
}
|
|
@@ -6486,7 +6490,7 @@ function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
|
6486
6490
|
tatMinutes: T,
|
|
6487
6491
|
description: r.description,
|
|
6488
6492
|
visibilityType: r.visibilityType,
|
|
6489
|
-
urlLink:
|
|
6493
|
+
urlLink: K ? r.urlLink : "",
|
|
6490
6494
|
active: r.active,
|
|
6491
6495
|
roles: r.roles
|
|
6492
6496
|
}, B = u ? Vt({
|
|
@@ -6606,7 +6610,7 @@ function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
|
6606
6610
|
placeholder: "Select visibility type"
|
|
6607
6611
|
}
|
|
6608
6612
|
),
|
|
6609
|
-
|
|
6613
|
+
K ? /* @__PURE__ */ l(
|
|
6610
6614
|
vn,
|
|
6611
6615
|
{
|
|
6612
6616
|
label: null,
|
|
@@ -6625,8 +6629,9 @@ function Gf({ stepMeta: e, stepperProps: t, roleList: n = [] }) {
|
|
|
6625
6629
|
label: "Select Roles for Complaint Filling",
|
|
6626
6630
|
required: !0,
|
|
6627
6631
|
hasError: !!s.roles,
|
|
6628
|
-
options:
|
|
6632
|
+
options: h,
|
|
6629
6633
|
value: r.roles,
|
|
6634
|
+
maxVisible: 4,
|
|
6630
6635
|
onChange: (b) => I("roles", b)
|
|
6631
6636
|
}
|
|
6632
6637
|
) }),
|
|
@@ -6666,21 +6671,26 @@ function Yf({ level: e, onAdd: t }) {
|
|
|
6666
6671
|
}
|
|
6667
6672
|
const Ar = ["Yes", "No"], ms = () => /* @__PURE__ */ l("span", { style: { color: "#dc2626" }, "aria-hidden": "true", children: " *" });
|
|
6668
6673
|
function Xf({ name: e, level: t, value: n, initialFormValues: r, setFormValues: a, onChange: s, selected: o = !1, onSelect: i, onDelete: c, subtitle: d, roleList: u = [], showRoleError: p = !1, showEscalationError: f = !1, userList: w = [], fieldErrors: C = {} }) {
|
|
6669
|
-
const S = n ?? r ?? {},
|
|
6674
|
+
const S = n ?? r ?? {}, y = Array.isArray(S.role) ? S.role : [], h = Array.isArray(S.users) ? S.users : [], m = S.workflowType === "user" ? "user" : "role", N = u.map((E) => ({
|
|
6670
6675
|
value: E.id ?? E.roleId ?? E.value,
|
|
6671
6676
|
label: E.name ?? E.label
|
|
6672
6677
|
})), _ = (E) => {
|
|
6673
|
-
const
|
|
6674
|
-
|
|
6678
|
+
const F = [E?.firstName, E?.lastName].map((J) => String(J ?? "").trim()).filter(Boolean).join(" "), U = String(E?.name ?? E?.userName ?? E?.label ?? "").trim() || F, H = [
|
|
6679
|
+
E?.roleName,
|
|
6680
|
+
E?.role?.name,
|
|
6681
|
+
typeof E?.role == "string" ? E.role : "",
|
|
6682
|
+
...Array.isArray(E?.roles) ? E.roles.map((J) => typeof J == "string" ? J : J?.name) : []
|
|
6683
|
+
].map((J) => String(J ?? "").trim()).filter(Boolean).filter((J, X, D) => D.indexOf(J) === X).join(", ");
|
|
6684
|
+
return H ? `${U} (${H})` : U;
|
|
6675
6685
|
}, x = w.map((E) => ({
|
|
6676
6686
|
value: E.id ?? E.userId ?? E.value,
|
|
6677
6687
|
label: _(E)
|
|
6678
|
-
})), I = (E,
|
|
6679
|
-
const U = { ...S, [E]:
|
|
6688
|
+
})), I = (E, F) => {
|
|
6689
|
+
const U = { ...S, [E]: F };
|
|
6680
6690
|
a ? a(U) : s?.(U);
|
|
6681
|
-
},
|
|
6682
|
-
{ value: "role", label: "Role", count:
|
|
6683
|
-
{ value: "user", label: "User", count:
|
|
6691
|
+
}, K = y.length === 0 && h.length === 0, $ = (p || !!C.role) && K, b = (E) => E ? "ca-control--invalid" : "", T = t === 1 ? "green" : t === 2 ? "orange" : "blue", A = (E) => `workflow-level-${t}-${E}`, B = d || (t === 1 ? "Initial Handler" : t === 2 ? "Escalation if L1 TAT exceeded" : "Escalation workflow"), j = [
|
|
6692
|
+
{ value: "role", label: "Role", count: y.length },
|
|
6693
|
+
{ value: "user", label: "User", count: h.length }
|
|
6684
6694
|
];
|
|
6685
6695
|
return /* @__PURE__ */ v(
|
|
6686
6696
|
"article",
|
|
@@ -6718,8 +6728,8 @@ function Xf({ name: e, level: t, value: n, initialFormValues: r, setFormValues:
|
|
|
6718
6728
|
{
|
|
6719
6729
|
type: "button",
|
|
6720
6730
|
className: `ca-type-toggle__btn${m === E.value ? " ca-type-toggle__btn--active" : ""}`,
|
|
6721
|
-
onClick: (
|
|
6722
|
-
|
|
6731
|
+
onClick: (F) => {
|
|
6732
|
+
F.stopPropagation(), m !== E.value && I("workflowType", E.value);
|
|
6723
6733
|
},
|
|
6724
6734
|
children: [
|
|
6725
6735
|
E.label,
|
|
@@ -6735,7 +6745,7 @@ function Xf({ name: e, level: t, value: n, initialFormValues: r, setFormValues:
|
|
|
6735
6745
|
Hr,
|
|
6736
6746
|
{
|
|
6737
6747
|
id: A("role"),
|
|
6738
|
-
value:
|
|
6748
|
+
value: y,
|
|
6739
6749
|
options: N,
|
|
6740
6750
|
placeholder: "Select role",
|
|
6741
6751
|
emptyText: "No roles available",
|
|
@@ -6753,7 +6763,7 @@ function Xf({ name: e, level: t, value: n, initialFormValues: r, setFormValues:
|
|
|
6753
6763
|
Hr,
|
|
6754
6764
|
{
|
|
6755
6765
|
id: A("user"),
|
|
6756
|
-
value:
|
|
6766
|
+
value: h,
|
|
6757
6767
|
options: x,
|
|
6758
6768
|
placeholder: "Select user",
|
|
6759
6769
|
emptyText: "No users available",
|
|
@@ -6849,21 +6859,21 @@ function ys(e) {
|
|
|
6849
6859
|
};
|
|
6850
6860
|
}
|
|
6851
6861
|
function om({ id: e, selectedTableId: t, onSelect: n, setUpdatePayload: r, roleList: a = [], prefillSteps: s = [], tatTotalMinutes: o = 0, showRoleError: i = !1, showEscalationError: c = !1, userList: d = [], onAddBlocked: u }) {
|
|
6852
|
-
const p = e != null, [, f] = q(Tr), [w, C] = q(Tr), [S,
|
|
6862
|
+
const p = e != null, [, f] = q(Tr), [w, C] = q(Tr), [S, y] = q([]), [h, m] = q(p), [N, _] = q(null), [x, I] = q(o), K = Se(null), $ = Se(o), [b, T] = q([]), A = Re(), B = oe(() => {
|
|
6853
6863
|
const D = hs(s);
|
|
6854
6864
|
return D.length ? D : Tr;
|
|
6855
6865
|
}, [s]), j = (() => {
|
|
6856
6866
|
const D = /* @__PURE__ */ new Set();
|
|
6857
6867
|
return [...a, ...S, ...gs(s)].filter((P) => {
|
|
6858
|
-
const
|
|
6859
|
-
return D.has(
|
|
6868
|
+
const R = String(P?.id ?? P?.roleId ?? P?.value);
|
|
6869
|
+
return D.has(R) ? !1 : (D.add(R), !0);
|
|
6860
6870
|
});
|
|
6861
6871
|
})();
|
|
6862
6872
|
if (!p && N !== B) {
|
|
6863
6873
|
const D = ft(B, o);
|
|
6864
6874
|
_(B), C(D), f(D);
|
|
6865
6875
|
}
|
|
6866
|
-
if (!
|
|
6876
|
+
if (!h && x !== o) {
|
|
6867
6877
|
I(o);
|
|
6868
6878
|
const D = ft(w, o);
|
|
6869
6879
|
D !== w && C(D);
|
|
@@ -6872,25 +6882,25 @@ function om({ id: e, selectedTableId: t, onSelect: n, setUpdatePayload: r, roleL
|
|
|
6872
6882
|
$.current = o;
|
|
6873
6883
|
}, [o]), se(() => {
|
|
6874
6884
|
if (!p) {
|
|
6875
|
-
const
|
|
6876
|
-
r({ id: e, tables:
|
|
6885
|
+
const R = ft(B, $.current);
|
|
6886
|
+
r({ id: e, tables: R });
|
|
6877
6887
|
return;
|
|
6878
6888
|
}
|
|
6879
6889
|
let D = !1;
|
|
6880
6890
|
return (async () => {
|
|
6881
6891
|
m(!0);
|
|
6882
6892
|
try {
|
|
6883
|
-
const
|
|
6884
|
-
|
|
6885
|
-
const W = hs(V),
|
|
6893
|
+
const R = await A(Ye(e)).unwrap(), V = Array.isArray(R?.data) ? R.data : Array.isArray(R) ? R : [];
|
|
6894
|
+
y(gs(V));
|
|
6895
|
+
const W = hs(V), re = ft(
|
|
6886
6896
|
W.length ? W : B,
|
|
6887
6897
|
$.current
|
|
6888
6898
|
);
|
|
6889
|
-
D || (f(
|
|
6890
|
-
} catch (
|
|
6899
|
+
D || (f(re), C(re), r({ id: e, tables: re }));
|
|
6900
|
+
} catch (R) {
|
|
6891
6901
|
if (!D) {
|
|
6892
6902
|
const V = ft(B, $.current);
|
|
6893
|
-
f(V), C(V), r({ id: e, tables: V }), console.error("Failed to load workflow steps:",
|
|
6903
|
+
f(V), C(V), r({ id: e, tables: V }), console.error("Failed to load workflow steps:", R);
|
|
6894
6904
|
}
|
|
6895
6905
|
} finally {
|
|
6896
6906
|
D || m(!1);
|
|
@@ -6899,48 +6909,48 @@ function om({ id: e, selectedTableId: t, onSelect: n, setUpdatePayload: r, roleL
|
|
|
6899
6909
|
D = !0;
|
|
6900
6910
|
};
|
|
6901
6911
|
}, [A, B, p, e, r]), se(() => {
|
|
6902
|
-
|
|
6903
|
-
}, [e,
|
|
6912
|
+
h || r?.({ id: e, tables: w });
|
|
6913
|
+
}, [e, h, r, w]);
|
|
6904
6914
|
const E = (D, { preserveLastLevel: P } = {}) => {
|
|
6905
|
-
const
|
|
6906
|
-
C(
|
|
6907
|
-
},
|
|
6915
|
+
const R = P ? D : ft(D, o), V = { id: e, tables: R };
|
|
6916
|
+
C(R), console.log("[TableCardGrid] updated form values:", R), console.log("[TableCardGrid] PUT payload:", V), r?.(V);
|
|
6917
|
+
}, F = (D) => {
|
|
6908
6918
|
const P = w[w.length - 1];
|
|
6909
6919
|
return P != null && P.id === D;
|
|
6910
6920
|
}, U = (D, P) => {
|
|
6911
6921
|
E(
|
|
6912
|
-
w.map((
|
|
6913
|
-
{ preserveLastLevel:
|
|
6922
|
+
w.map((R) => R.id === D ? { ...R, ...P } : R),
|
|
6923
|
+
{ preserveLastLevel: F(D) }
|
|
6914
6924
|
);
|
|
6915
|
-
},
|
|
6925
|
+
}, H = (D, P) => {
|
|
6916
6926
|
E(
|
|
6917
|
-
w.map((
|
|
6918
|
-
{ preserveLastLevel:
|
|
6927
|
+
w.map((R) => R.id !== D ? R : typeof P == "function" ? P(R) : P),
|
|
6928
|
+
{ preserveLastLevel: F(D) }
|
|
6919
6929
|
);
|
|
6920
|
-
},
|
|
6930
|
+
}, J = (D) => {
|
|
6921
6931
|
const P = w[w.length - 1];
|
|
6922
6932
|
if (P) {
|
|
6923
|
-
const
|
|
6924
|
-
if (Object.values(
|
|
6933
|
+
const re = ys(P);
|
|
6934
|
+
if (Object.values(re).some(Boolean)) {
|
|
6925
6935
|
T((z) => z.includes(P.id) ? z : [...z, P.id]), u?.(`Please fill all required fields of Level ${w.length} before adding a new level.`);
|
|
6926
6936
|
return;
|
|
6927
6937
|
}
|
|
6928
6938
|
}
|
|
6929
6939
|
u?.("");
|
|
6930
|
-
const
|
|
6940
|
+
const R = w.reduce((re, z) => Math.max(re, Number(z.id) || 0), 0) + 1, V = w.length + 1, W = Qu(w);
|
|
6931
6941
|
E([
|
|
6932
6942
|
...W,
|
|
6933
|
-
va(
|
|
6943
|
+
va(R, D || `Level ${V}`)
|
|
6934
6944
|
]), requestAnimationFrame(() => {
|
|
6935
6945
|
requestAnimationFrame(() => {
|
|
6936
|
-
const
|
|
6937
|
-
|
|
6946
|
+
const re = K.current;
|
|
6947
|
+
re && re.scrollTo({ left: re.scrollWidth, behavior: "smooth" });
|
|
6938
6948
|
});
|
|
6939
6949
|
});
|
|
6940
|
-
},
|
|
6950
|
+
}, X = (D) => {
|
|
6941
6951
|
E(w.filter((P) => P.id !== D));
|
|
6942
6952
|
};
|
|
6943
|
-
return
|
|
6953
|
+
return h && !w.length ? null : /* @__PURE__ */ l("div", { className: "ca-table-card-grid", "aria-label": "Escalation levels", ref: K, children: /* @__PURE__ */ v("div", { className: "ca-table-card-grid__track", children: [
|
|
6944
6954
|
w.map((D, P) => /* @__PURE__ */ v(ea.Fragment, { children: [
|
|
6945
6955
|
/* @__PURE__ */ l(
|
|
6946
6956
|
Xf,
|
|
@@ -6953,11 +6963,11 @@ function om({ id: e, selectedTableId: t, onSelect: n, setUpdatePayload: r, roleL
|
|
|
6953
6963
|
level: P + 1,
|
|
6954
6964
|
value: D,
|
|
6955
6965
|
initialFormValues: D,
|
|
6956
|
-
setFormValues: (
|
|
6966
|
+
setFormValues: (R) => H(D.id, R),
|
|
6957
6967
|
selected: D.id === t,
|
|
6958
6968
|
onSelect: () => n?.(D),
|
|
6959
|
-
onDelete: () =>
|
|
6960
|
-
onChange: (
|
|
6969
|
+
onDelete: () => X(D.id),
|
|
6970
|
+
onChange: (R) => U(D.id, R),
|
|
6961
6971
|
fieldErrors: b.includes(D.id) ? ys(D) : {}
|
|
6962
6972
|
}
|
|
6963
6973
|
),
|
|
@@ -6966,7 +6976,7 @@ function om({ id: e, selectedTableId: t, onSelect: n, setUpdatePayload: r, roleL
|
|
|
6966
6976
|
/* @__PURE__ */ l(sm, { accent: P === 0 ? "green" : P === 1 ? "orange" : "purple" })
|
|
6967
6977
|
] }) : null
|
|
6968
6978
|
] }, D.id)),
|
|
6969
|
-
/* @__PURE__ */ l(Yf, { level: w.length + 1, onAdd:
|
|
6979
|
+
/* @__PURE__ */ l(Yf, { level: w.length + 1, onAdd: J })
|
|
6970
6980
|
] }) });
|
|
6971
6981
|
}
|
|
6972
6982
|
function im({ totalMinutes: e = 0, usedMinutes: t = 0 }) {
|
|
@@ -7007,27 +7017,27 @@ function lm({
|
|
|
7007
7017
|
a.filter((E) => A.has(String(E.id ?? E.value))).map((E) => B(E.name ?? E.label))
|
|
7008
7018
|
);
|
|
7009
7019
|
return s.filter((E) => {
|
|
7010
|
-
const
|
|
7020
|
+
const F = [
|
|
7011
7021
|
E?.roleId,
|
|
7012
7022
|
E?.role?.id,
|
|
7013
7023
|
...Array.isArray(E?.roleIds) ? E.roleIds : [],
|
|
7014
|
-
...Array.isArray(E?.roles) ? E.roles.map((
|
|
7015
|
-
].filter((
|
|
7024
|
+
...Array.isArray(E?.roles) ? E.roles.map((H) => H?.id ?? H?.roleId ?? H) : []
|
|
7025
|
+
].filter((H) => H != null).map(String), U = [
|
|
7016
7026
|
E?.roleName,
|
|
7017
7027
|
typeof E?.role == "string" ? E.role : E?.role?.name,
|
|
7018
|
-
...Array.isArray(E?.roles) ? E.roles.map((
|
|
7028
|
+
...Array.isArray(E?.roles) ? E.roles.map((H) => H?.name) : []
|
|
7019
7029
|
].filter(Boolean).map(B);
|
|
7020
|
-
return !
|
|
7030
|
+
return !F.some((H) => A.has(H)) && !U.some((H) => j.has(H));
|
|
7021
7031
|
});
|
|
7022
|
-
}, [d, a, s]), [f, w] = q(null), [C, S] = q(""),
|
|
7032
|
+
}, [d, a, s]), [f, w] = q(null), [C, S] = q(""), y = Be((A) => {
|
|
7023
7033
|
w(A);
|
|
7024
|
-
}, []),
|
|
7025
|
-
let { id: m } =
|
|
7026
|
-
const N =
|
|
7034
|
+
}, []), h = Re();
|
|
7035
|
+
let { id: m } = ne((A) => A.appDetails || {});
|
|
7036
|
+
const N = ne((A) => A.complaintType?.selected), _ = bs(m), x = bs(N?.id ?? N?._id), I = Ie(N?.tatMinutes ?? o.tatMinutes);
|
|
7027
7037
|
se(() => {
|
|
7028
|
-
_ == null || _ === "" || x != null && String(x) === String(_) && N?.tatMinutes != null ||
|
|
7029
|
-
}, [
|
|
7030
|
-
const
|
|
7038
|
+
_ == null || _ === "" || x != null && String(x) === String(_) && N?.tatMinutes != null || h(yt(_));
|
|
7039
|
+
}, [h, N?.tatMinutes, x, _]);
|
|
7040
|
+
const K = oe(() => {
|
|
7031
7041
|
const A = Array.isArray(f?.tables) ? f.tables : [];
|
|
7032
7042
|
return Xu(A);
|
|
7033
7043
|
}, [f]), $ = r ?? c.selectedTableCard ?? null, b = Array.isArray(f?.tables) && f.tables.length ? f.tables.map((A, B) => `L${B + 1}`).join(" > ") : "";
|
|
@@ -7042,7 +7052,7 @@ function lm({
|
|
|
7042
7052
|
S("Workflow steps are not ready to save.");
|
|
7043
7053
|
return;
|
|
7044
7054
|
}
|
|
7045
|
-
|
|
7055
|
+
h(
|
|
7046
7056
|
xn({
|
|
7047
7057
|
id: f.id,
|
|
7048
7058
|
tables: f,
|
|
@@ -7052,8 +7062,8 @@ function lm({
|
|
|
7052
7062
|
onFail: (A) => {
|
|
7053
7063
|
const B = A?.response?.data ?? A?.payload ?? A, j = [...new Set(
|
|
7054
7064
|
Array.isArray(B?.errors) ? B.errors.map((U) => U?.message).filter(Boolean) : []
|
|
7055
|
-
)], E = (j.length ? j.join(" ") : null) ?? B?.message ?? B?.error ?? A?.message ?? "Failed to update workflow steps",
|
|
7056
|
-
S(Yu(
|
|
7065
|
+
)], E = (j.length ? j.join(" ") : null) ?? B?.message ?? B?.error ?? A?.message ?? "Failed to update workflow steps", F = String(E).replace(/roleIds must contain at least 1 elements?/gi, "Please select at least one role or user in every level.").replace(/userAssignments must contain at least 1 elements?/gi, "Please select at least one role or user in every level.");
|
|
7066
|
+
S(Yu(F));
|
|
7057
7067
|
}
|
|
7058
7068
|
})
|
|
7059
7069
|
);
|
|
@@ -7068,14 +7078,14 @@ function lm({
|
|
|
7068
7078
|
title: t.title,
|
|
7069
7079
|
description: b,
|
|
7070
7080
|
showNext: !1,
|
|
7071
|
-
headerExtra: /* @__PURE__ */ l(im, { totalMinutes: I, usedMinutes:
|
|
7081
|
+
headerExtra: /* @__PURE__ */ l(im, { totalMinutes: I, usedMinutes: K }),
|
|
7072
7082
|
children: /* @__PURE__ */ l("div", { className: "ca-workflow__main", children: /* @__PURE__ */ l(
|
|
7073
7083
|
om,
|
|
7074
7084
|
{
|
|
7075
7085
|
id: m,
|
|
7076
7086
|
selectedTableId: $?.id,
|
|
7077
7087
|
onSelect: (A) => i({ selectedTableCard: A }),
|
|
7078
|
-
setUpdatePayload:
|
|
7088
|
+
setUpdatePayload: y,
|
|
7079
7089
|
roleList: u,
|
|
7080
7090
|
userList: p,
|
|
7081
7091
|
onAddBlocked: S,
|
|
@@ -7213,16 +7223,16 @@ const um = [
|
|
|
7213
7223
|
function vs(e) {
|
|
7214
7224
|
return String(e || "").trim().toLowerCase();
|
|
7215
7225
|
}
|
|
7216
|
-
function
|
|
7226
|
+
function Q(e) {
|
|
7217
7227
|
const t = vs(e?.fieldKey), n = vs(e?.fieldLabel || e?.label);
|
|
7218
7228
|
return t === "status" || t === "statuses" || t === "statuscustom" || n === "status" || n === "statuses";
|
|
7219
7229
|
}
|
|
7220
7230
|
function pn(e) {
|
|
7221
|
-
return
|
|
7231
|
+
return Q(e) && (e?.lockMode === "options" || e?.lockMode === "all");
|
|
7222
7232
|
}
|
|
7223
7233
|
function hm(e, t = []) {
|
|
7224
|
-
if (!
|
|
7225
|
-
const n = t.length ? t : [e], r = n.filter((o) => !o?.isNew &&
|
|
7234
|
+
if (!Q(e)) return !1;
|
|
7235
|
+
const n = t.length ? t : [e], r = n.filter((o) => !o?.isNew && Q(o)), a = n.filter(pn), s = r[0] || a[0] || n.find((o) => Q(o) && !o?.isNew);
|
|
7226
7236
|
return s ? String(s.id) === String(e.id) : !e?.isNew;
|
|
7227
7237
|
}
|
|
7228
7238
|
function Kn(e) {
|
|
@@ -7253,7 +7263,7 @@ function Ss(e) {
|
|
|
7253
7263
|
return fi.has(e?.fieldType) || pn(e);
|
|
7254
7264
|
}
|
|
7255
7265
|
function Sa(e) {
|
|
7256
|
-
return !e ||
|
|
7266
|
+
return !e || Q(e) || Qe(e) || !fi.has(e.fieldType) ? !1 : !(e.options || []).some((t) => String(t || "").trim());
|
|
7257
7267
|
}
|
|
7258
7268
|
function St(e = []) {
|
|
7259
7269
|
return e.some(Sa);
|
|
@@ -7278,7 +7288,7 @@ function Bn(e = []) {
|
|
|
7278
7288
|
}
|
|
7279
7289
|
function Ca(e, t = {}, n = "") {
|
|
7280
7290
|
const r = String(n || "");
|
|
7281
|
-
if (
|
|
7291
|
+
if (Q({ fieldKey: r }) || Qe({ fieldKey: r }))
|
|
7282
7292
|
return t.CUSTOM ?? "Custom";
|
|
7283
7293
|
if (e === "MULTI_SELECT" || e === "MULTISELECT") return t.CHECKBOX ?? "Checkbox";
|
|
7284
7294
|
if (e === "PHONE" || e === "MOBILE") return t.NUMBER ?? "Number";
|
|
@@ -7296,12 +7306,12 @@ function bm(e) {
|
|
|
7296
7306
|
return Kn(e) ? "Priorities" : "Option";
|
|
7297
7307
|
}
|
|
7298
7308
|
function wm(e, t = !1) {
|
|
7299
|
-
return e ? t ? "Define options and set parent." :
|
|
7309
|
+
return e ? t ? "Define options and set parent." : Q(e) ? "Manage the status" : "Manage your fields." : "";
|
|
7300
7310
|
}
|
|
7301
7311
|
function Jn(e, t = []) {
|
|
7302
7312
|
if (String(e?.fieldType || "") === "MultiSelect")
|
|
7303
7313
|
return Jn({ ...e, fieldType: "Checkbox" }, t);
|
|
7304
|
-
if (
|
|
7314
|
+
if (Q(e)) {
|
|
7305
7315
|
if (e?.isNew || !hm(e, t))
|
|
7306
7316
|
return {
|
|
7307
7317
|
...e,
|
|
@@ -7338,7 +7348,7 @@ function Jn(e, t = []) {
|
|
|
7338
7348
|
}
|
|
7339
7349
|
function ht(e = []) {
|
|
7340
7350
|
const t = e.map((r) => Jn(r, e));
|
|
7341
|
-
if (t.some(
|
|
7351
|
+
if (t.some(Q)) return t;
|
|
7342
7352
|
const n = { ...Me };
|
|
7343
7353
|
return [Jn(n, [n, ...t]), ...t];
|
|
7344
7354
|
}
|
|
@@ -7379,11 +7389,11 @@ function Sm({
|
|
|
7379
7389
|
onDelete: w,
|
|
7380
7390
|
onSave: C,
|
|
7381
7391
|
cardRef: S,
|
|
7382
|
-
onOptionNotice:
|
|
7383
|
-
hasDuplicateIdentity:
|
|
7392
|
+
onOptionNotice: y,
|
|
7393
|
+
hasDuplicateIdentity: h = !1,
|
|
7384
7394
|
hasMissingOptions: m = !1
|
|
7385
7395
|
}) {
|
|
7386
|
-
const [N, _] = q(""), [x, I] = q(null),
|
|
7396
|
+
const [N, _] = q(""), [x, I] = q(null), K = Se(!1), { label: $, fieldLabel: b } = dt(), T = Cs(e), [A, B] = q(() => ({
|
|
7387
7397
|
id: e.id,
|
|
7388
7398
|
signature: e.isNew ? null : T
|
|
7389
7399
|
}));
|
|
@@ -7391,56 +7401,56 @@ function Sm({
|
|
|
7391
7401
|
id: e.id,
|
|
7392
7402
|
signature: e.isNew ? null : T
|
|
7393
7403
|
});
|
|
7394
|
-
const j = e.lockMode === "all", E = j || e.lockMode === "options",
|
|
7404
|
+
const j = e.lockMode === "all", E = j || e.lockMode === "options", F = Ss(e), U = j || !F, H = !!(String(e.fieldLabel || "").trim() && String(e.fieldType || "").trim()), J = A.signature !== T, X = !!s || !H, D = h || m ? "ca-control--invalid" : "", P = (L) => f?.({ ...e, ...L }), R = () => {
|
|
7395
7405
|
if (U) return;
|
|
7396
7406
|
const L = N.trim();
|
|
7397
7407
|
if (!L) return;
|
|
7398
|
-
if (
|
|
7408
|
+
if (Q(e) && Ze(L)) {
|
|
7399
7409
|
const ie = (e.options || []).find(
|
|
7400
|
-
(
|
|
7410
|
+
(te) => String(te).trim().toLowerCase() === L.toLowerCase()
|
|
7401
7411
|
);
|
|
7402
7412
|
if (ie) {
|
|
7403
|
-
|
|
7413
|
+
y?.(`${ie} already exists in options`), _("");
|
|
7404
7414
|
return;
|
|
7405
7415
|
}
|
|
7406
7416
|
}
|
|
7407
7417
|
if (e.options?.includes(L)) return;
|
|
7408
|
-
const
|
|
7418
|
+
const Y = Q(e) ? { ...e.optionColors || {}, [L]: e.optionColors?.[L] || vm } : e.optionColors;
|
|
7409
7419
|
P({
|
|
7410
|
-
options:
|
|
7411
|
-
...
|
|
7420
|
+
options: Q(e) ? vt([...e.options || [], L]) : [...e.options || [], L],
|
|
7421
|
+
...Q(e) ? { optionColors: Y } : {}
|
|
7412
7422
|
}), _("");
|
|
7413
7423
|
}, V = (L) => {
|
|
7414
|
-
if (U ||
|
|
7415
|
-
const
|
|
7416
|
-
delete
|
|
7424
|
+
if (U || Q(e) && Ze(L)) return;
|
|
7425
|
+
const Y = { ...e.optionColors || {} };
|
|
7426
|
+
delete Y[L];
|
|
7417
7427
|
const ie = { ...e.parentMappings || {} };
|
|
7418
7428
|
delete ie[L], P({
|
|
7419
|
-
options: e.options.filter((
|
|
7429
|
+
options: e.options.filter((te) => te !== L),
|
|
7420
7430
|
parentMappings: ie,
|
|
7421
|
-
...
|
|
7431
|
+
...Q(e) ? { optionColors: Y } : {}
|
|
7422
7432
|
});
|
|
7423
7433
|
}, W = (L) => {
|
|
7424
|
-
U ||
|
|
7425
|
-
},
|
|
7426
|
-
|
|
7434
|
+
U || Q(e) && Ze(L) || (K.current = !1, I({ original: L, draft: L }));
|
|
7435
|
+
}, re = () => {
|
|
7436
|
+
K.current = !0, I(null);
|
|
7427
7437
|
}, z = () => {
|
|
7428
|
-
if (
|
|
7429
|
-
|
|
7438
|
+
if (K.current) {
|
|
7439
|
+
K.current = !1;
|
|
7430
7440
|
return;
|
|
7431
7441
|
}
|
|
7432
7442
|
if (!x) return;
|
|
7433
|
-
const { original: L, draft:
|
|
7443
|
+
const { original: L, draft: Y } = x, ie = Y.trim();
|
|
7434
7444
|
if (I(null), !ie || ie === L) return;
|
|
7435
|
-
if ((e.options || []).some((Ae) => Ae !== L && (Ae === ie ||
|
|
7436
|
-
|
|
7445
|
+
if ((e.options || []).some((Ae) => Ae !== L && (Ae === ie || Q(e) && String(Ae).trim().toLowerCase() === ie.toLowerCase()))) {
|
|
7446
|
+
y?.(`${ie} already exists in options`);
|
|
7437
7447
|
return;
|
|
7438
7448
|
}
|
|
7439
7449
|
const le = (e.options || []).map((Ae) => Ae === L ? ie : Ae), pe = { ...e.parentMappings || {} };
|
|
7440
7450
|
Object.prototype.hasOwnProperty.call(pe, L) && (pe[ie] = pe[L], delete pe[L]);
|
|
7441
7451
|
const Fe = { ...e.optionColors || {} };
|
|
7442
7452
|
Object.prototype.hasOwnProperty.call(Fe, L) && (Fe[ie] = Fe[L], delete Fe[L]), P({
|
|
7443
|
-
options:
|
|
7453
|
+
options: Q(e) ? vt(le) : le,
|
|
7444
7454
|
parentMappings: pe,
|
|
7445
7455
|
optionColors: Fe
|
|
7446
7456
|
});
|
|
@@ -7456,8 +7466,8 @@ function Sm({
|
|
|
7456
7466
|
},
|
|
7457
7467
|
onDrop: (L) => {
|
|
7458
7468
|
L.preventDefault();
|
|
7459
|
-
const
|
|
7460
|
-
p?.(
|
|
7469
|
+
const Y = L.dataTransfer.getData("text/plain");
|
|
7470
|
+
p?.(Y, e.id), u?.();
|
|
7461
7471
|
},
|
|
7462
7472
|
children: [
|
|
7463
7473
|
/* @__PURE__ */ v("div", { className: "ca-form-card__row ca-form-card__row--order", children: [
|
|
@@ -7482,11 +7492,11 @@ function Sm({
|
|
|
7482
7492
|
type: "button",
|
|
7483
7493
|
className: "ca-form-card__save",
|
|
7484
7494
|
"aria-label": "Save form field",
|
|
7485
|
-
disabled:
|
|
7495
|
+
disabled: X || j || !J,
|
|
7486
7496
|
onClick: async (L) => {
|
|
7487
|
-
if (L.stopPropagation(),
|
|
7488
|
-
const
|
|
7489
|
-
|
|
7497
|
+
if (L.stopPropagation(), X || j || !J) return;
|
|
7498
|
+
const Y = await C?.(e);
|
|
7499
|
+
Y && B({ id: e.id, signature: Cs(Y) });
|
|
7490
7500
|
},
|
|
7491
7501
|
children: "Save"
|
|
7492
7502
|
}
|
|
@@ -7519,13 +7529,13 @@ function Sm({
|
|
|
7519
7529
|
disabled: E,
|
|
7520
7530
|
className: D,
|
|
7521
7531
|
onChange: (L) => {
|
|
7522
|
-
const
|
|
7523
|
-
if (Ss({ ...e, fieldType:
|
|
7524
|
-
P({ fieldType:
|
|
7532
|
+
const Y = L.target.value;
|
|
7533
|
+
if (Ss({ ...e, fieldType: Y })) {
|
|
7534
|
+
P({ fieldType: Y, dependsOn: "", parentMappings: {} });
|
|
7525
7535
|
return;
|
|
7526
7536
|
}
|
|
7527
7537
|
P({
|
|
7528
|
-
fieldType:
|
|
7538
|
+
fieldType: Y,
|
|
7529
7539
|
dependsOn: "",
|
|
7530
7540
|
options: [],
|
|
7531
7541
|
parentMappings: {},
|
|
@@ -7540,7 +7550,7 @@ function Sm({
|
|
|
7540
7550
|
/* @__PURE__ */ l(Je, { value: "", options: a.filter((L) => !e.hideFor?.includes(L)), placeholder: "Select level", disabled: E, onChange: (L) => P({ hideFor: [...e.hideFor || [], L.target.value] }) }),
|
|
7541
7551
|
e.hideFor?.length ? /* @__PURE__ */ l("div", { className: "ca-form-card__chips", children: e.hideFor.map((L) => /* @__PURE__ */ v("span", { className: "ca-form-card__chip", children: [
|
|
7542
7552
|
L,
|
|
7543
|
-
/* @__PURE__ */ l("button", { type: "button", "aria-label": `Remove ${L}`, disabled: E, onClick: () => P({ hideFor: e.hideFor.filter((
|
|
7553
|
+
/* @__PURE__ */ l("button", { type: "button", "aria-label": `Remove ${L}`, disabled: E, onClick: () => P({ hideFor: e.hideFor.filter((Y) => Y !== L) }), children: "×" })
|
|
7544
7554
|
] }, L)) }) : null
|
|
7545
7555
|
] }),
|
|
7546
7556
|
/* @__PURE__ */ l("div", { className: "ca-form-card__row", children: /* @__PURE__ */ l(
|
|
@@ -7549,38 +7559,38 @@ function Sm({
|
|
|
7549
7559
|
value: e.dependsOn,
|
|
7550
7560
|
options: Rr(t, e.dependsOn).map((L) => ({ value: L, label: $(L) })),
|
|
7551
7561
|
placeholder: "Select field label",
|
|
7552
|
-
disabled: E || !
|
|
7562
|
+
disabled: E || !F,
|
|
7553
7563
|
allowClear: !0,
|
|
7554
7564
|
onChange: (L) => {
|
|
7555
|
-
const
|
|
7556
|
-
if (!
|
|
7565
|
+
const Y = L.target.value;
|
|
7566
|
+
if (!Y) {
|
|
7557
7567
|
P({ dependsOn: "", parentMappings: {} });
|
|
7558
7568
|
return;
|
|
7559
7569
|
}
|
|
7560
|
-
P({ dependsOn:
|
|
7570
|
+
P({ dependsOn: Y });
|
|
7561
7571
|
}
|
|
7562
7572
|
}
|
|
7563
7573
|
) }),
|
|
7564
7574
|
/* @__PURE__ */ v("div", { className: "ca-form-card__row ca-form-card__row--options", children: [
|
|
7565
7575
|
/* @__PURE__ */ v("div", { className: "ca-form-card__option-entry", children: [
|
|
7566
7576
|
/* @__PURE__ */ l(Xt, { value: N, placeholder: "Enter option", disabled: U, className: m ? "ca-control--invalid" : "", onChange: (L) => _(L.target.value), onKeyDown: (L) => {
|
|
7567
|
-
L.key === "Enter" && (L.preventDefault(),
|
|
7577
|
+
L.key === "Enter" && (L.preventDefault(), R());
|
|
7568
7578
|
} }),
|
|
7569
|
-
/* @__PURE__ */ l("button", { type: "button", className: "ca-form-card__add-option", "aria-label": "Add option", disabled: U, onClick:
|
|
7579
|
+
/* @__PURE__ */ l("button", { type: "button", className: "ca-form-card__add-option", "aria-label": "Add option", disabled: U, onClick: R, children: "+" })
|
|
7570
7580
|
] }),
|
|
7571
|
-
/* @__PURE__ */ l("div", { className: "ca-form-card__chips", children: (
|
|
7572
|
-
const
|
|
7573
|
-
return /* @__PURE__ */ v("span", { className: `ca-form-card__chip${
|
|
7581
|
+
/* @__PURE__ */ l("div", { className: "ca-form-card__chips", children: (F ? Q(e) ? vt(e.options || []) : e.options || [] : []).map((L) => {
|
|
7582
|
+
const Y = Q(e) && Ze(L), ie = x?.original === L;
|
|
7583
|
+
return /* @__PURE__ */ v("span", { className: `ca-form-card__chip${Y ? " ca-form-card__chip--locked" : ""}`, children: [
|
|
7574
7584
|
ie ? /* @__PURE__ */ l(
|
|
7575
7585
|
"input",
|
|
7576
7586
|
{
|
|
7577
7587
|
autoFocus: !0,
|
|
7578
7588
|
value: x.draft,
|
|
7579
|
-
onChange: (
|
|
7589
|
+
onChange: (te) => I({ original: L, draft: te.target.value }),
|
|
7580
7590
|
onBlur: z,
|
|
7581
|
-
onClick: (
|
|
7582
|
-
onKeyDown: (
|
|
7583
|
-
|
|
7591
|
+
onClick: (te) => te.stopPropagation(),
|
|
7592
|
+
onKeyDown: (te) => {
|
|
7593
|
+
te.key === "Enter" ? (te.preventDefault(), z()) : te.key === "Escape" && (te.preventDefault(), re());
|
|
7584
7594
|
},
|
|
7585
7595
|
"aria-label": `Edit ${L}`,
|
|
7586
7596
|
style: {
|
|
@@ -7597,18 +7607,18 @@ function Sm({
|
|
|
7597
7607
|
) : /* @__PURE__ */ l(
|
|
7598
7608
|
"span",
|
|
7599
7609
|
{
|
|
7600
|
-
role:
|
|
7601
|
-
tabIndex:
|
|
7602
|
-
title:
|
|
7603
|
-
style:
|
|
7610
|
+
role: Y || U ? void 0 : "button",
|
|
7611
|
+
tabIndex: Y || U ? void 0 : 0,
|
|
7612
|
+
title: Y || U ? void 0 : "Click to edit",
|
|
7613
|
+
style: Y || U ? void 0 : { cursor: "text" },
|
|
7604
7614
|
onClick: () => W(L),
|
|
7605
|
-
onKeyDown: (
|
|
7606
|
-
|
|
7615
|
+
onKeyDown: (te) => {
|
|
7616
|
+
te.key === "Enter" && W(L);
|
|
7607
7617
|
},
|
|
7608
7618
|
children: L
|
|
7609
7619
|
}
|
|
7610
7620
|
),
|
|
7611
|
-
|
|
7621
|
+
Y ? null : /* @__PURE__ */ l("button", { type: "button", "aria-label": `Remove ${L}`, disabled: U, onClick: () => V(L), children: "×" })
|
|
7612
7622
|
] }, L);
|
|
7613
7623
|
}) })
|
|
7614
7624
|
] })
|
|
@@ -7634,7 +7644,7 @@ function Cm(e) {
|
|
|
7634
7644
|
return /^#[0-9A-Fa-f]{6}$/.test(t) ? t.toUpperCase() : /^#[0-9A-Fa-f]{3}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`.toUpperCase() : "#000000";
|
|
7635
7645
|
}
|
|
7636
7646
|
function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
7637
|
-
const r = t, a =
|
|
7647
|
+
const r = t, a = Q(r) ? r : null, s = oe(() => {
|
|
7638
7648
|
const m = String(r?.dependsOn || "").trim();
|
|
7639
7649
|
if (!m) return null;
|
|
7640
7650
|
const N = e.filter((_) => String(_.fieldLabel || "").trim() === m);
|
|
@@ -7652,7 +7662,7 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7652
7662
|
}
|
|
7653
7663
|
} : _));
|
|
7654
7664
|
}, f = (m) => {
|
|
7655
|
-
if (!r ||
|
|
7665
|
+
if (!r || Q(r) && Ze(m)) return;
|
|
7656
7666
|
const N = { ...r.optionColors || {} };
|
|
7657
7667
|
delete N[m];
|
|
7658
7668
|
const _ = { ...r.parentMappings || {} };
|
|
@@ -7660,17 +7670,17 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7660
7670
|
...x,
|
|
7661
7671
|
options: (x.options || []).filter((I) => I !== m),
|
|
7662
7672
|
parentMappings: _,
|
|
7663
|
-
...
|
|
7673
|
+
...Q(x) ? { optionColors: N } : {}
|
|
7664
7674
|
} : x));
|
|
7665
|
-
}, w = r?.fieldLabel || "Select field", C = wm(r, i), S =
|
|
7675
|
+
}, w = r?.fieldLabel || "Select field", C = wm(r, i), S = Q(r) ? vt(r?.options || []) : r?.options || [], y = (m, N) => /* @__PURE__ */ l("div", { className: "field-options-panel__table-wrap", children: /* @__PURE__ */ v("table", { className: "field-options-panel__table", children: [
|
|
7666
7676
|
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ v("tr", { children: [
|
|
7667
7677
|
m.map((_) => /* @__PURE__ */ l("th", { scope: "col", children: _ }, _)),
|
|
7668
7678
|
/* @__PURE__ */ l("th", { scope: "col", "aria-label": "Delete" })
|
|
7669
7679
|
] }) }),
|
|
7670
7680
|
/* @__PURE__ */ l("tbody", { children: N })
|
|
7671
7681
|
] }) });
|
|
7672
|
-
let
|
|
7673
|
-
return i ?
|
|
7682
|
+
let h = /* @__PURE__ */ l("p", { className: "field-options-panel__empty", children: r ? "No options added." : "Select a field to edit." });
|
|
7683
|
+
return i ? h = S.length ? y(
|
|
7674
7684
|
["Option label", s?.fieldLabel || "Parent"],
|
|
7675
7685
|
S.map((m) => /* @__PURE__ */ v("tr", { children: [
|
|
7676
7686
|
/* @__PURE__ */ l("td", { children: m }),
|
|
@@ -7692,12 +7702,12 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7692
7702
|
{
|
|
7693
7703
|
option: m,
|
|
7694
7704
|
onDelete: f,
|
|
7695
|
-
locked:
|
|
7705
|
+
locked: Q(r) && Ze(m)
|
|
7696
7706
|
}
|
|
7697
7707
|
)
|
|
7698
7708
|
] }, m))
|
|
7699
|
-
) : /* @__PURE__ */ l("p", { className: "field-options-panel__empty", children: "No options added." }) : a ?
|
|
7700
|
-
[
|
|
7709
|
+
) : /* @__PURE__ */ l("p", { className: "field-options-panel__empty", children: "No options added." }) : a ? h = S.length ? y(
|
|
7710
|
+
[Q(a) ? "Status" : "Option", "Colors"],
|
|
7701
7711
|
S.map((m) => {
|
|
7702
7712
|
const N = Cm(a.optionColors?.[m]);
|
|
7703
7713
|
return /* @__PURE__ */ v("tr", { children: [
|
|
@@ -7727,12 +7737,12 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7727
7737
|
{
|
|
7728
7738
|
option: m,
|
|
7729
7739
|
onDelete: f,
|
|
7730
|
-
locked:
|
|
7740
|
+
locked: Q(a) && Ze(m)
|
|
7731
7741
|
}
|
|
7732
7742
|
)
|
|
7733
7743
|
] }, m);
|
|
7734
7744
|
})
|
|
7735
|
-
) : /* @__PURE__ */ l("p", { className: "field-options-panel__empty", children: "No options added." }) : S.length && (
|
|
7745
|
+
) : /* @__PURE__ */ l("p", { className: "field-options-panel__empty", children: "No options added." }) : S.length && (h = y(
|
|
7736
7746
|
[bm(r)],
|
|
7737
7747
|
S.map((m) => /* @__PURE__ */ v("tr", { children: [
|
|
7738
7748
|
/* @__PURE__ */ l("td", { children: m }),
|
|
@@ -7741,7 +7751,7 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7741
7751
|
{
|
|
7742
7752
|
option: m,
|
|
7743
7753
|
onDelete: f,
|
|
7744
|
-
locked:
|
|
7754
|
+
locked: Q(r) && Ze(m)
|
|
7745
7755
|
}
|
|
7746
7756
|
)
|
|
7747
7757
|
] }, m))
|
|
@@ -7771,7 +7781,7 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7771
7781
|
]
|
|
7772
7782
|
}
|
|
7773
7783
|
),
|
|
7774
|
-
/* @__PURE__ */ l("div", { id: "field-options-panel-body", className: "field-options-panel__body", children:
|
|
7784
|
+
/* @__PURE__ */ l("div", { id: "field-options-panel-body", className: "field-options-panel__body", children: h })
|
|
7775
7785
|
]
|
|
7776
7786
|
}
|
|
7777
7787
|
);
|
|
@@ -7779,7 +7789,7 @@ function Nm({ formFields: e = [], selectedField: t = null, onChange: n }) {
|
|
|
7779
7789
|
function _m(e, t = []) {
|
|
7780
7790
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
7781
7791
|
return t.forEach((a) => {
|
|
7782
|
-
if (String(a.id) === String(e?.id) ||
|
|
7792
|
+
if (String(a.id) === String(e?.id) || Q(a)) return;
|
|
7783
7793
|
const s = String(a.fieldLabel || a.label || "").trim();
|
|
7784
7794
|
if (!s) return;
|
|
7785
7795
|
const o = s.toLowerCase();
|
|
@@ -7821,79 +7831,79 @@ function Lm({
|
|
|
7821
7831
|
onSave: o,
|
|
7822
7832
|
onDelete: i
|
|
7823
7833
|
}) {
|
|
7824
|
-
const [c, d] = q(() => mt(e ?? [])), [u, p] = q(null), [f, w] = q(null), [C, S] = q(""),
|
|
7825
|
-
const U = mt(
|
|
7834
|
+
const [c, d] = q(() => mt(e ?? [])), [u, p] = q(null), [f, w] = q(null), [C, S] = q(""), y = Se(""), h = Se(null), m = Se({}), N = (F) => {
|
|
7835
|
+
const U = mt(F);
|
|
7826
7836
|
d(U), t?.(U);
|
|
7827
|
-
}, _ = (e ?? []).map((
|
|
7837
|
+
}, _ = (e ?? []).map((F) => F.id).join(",");
|
|
7828
7838
|
se(() => {
|
|
7829
7839
|
if (!C) return;
|
|
7830
|
-
const
|
|
7831
|
-
return () => window.clearTimeout(
|
|
7840
|
+
const F = window.setTimeout(() => S(""), 3200);
|
|
7841
|
+
return () => window.clearTimeout(F);
|
|
7832
7842
|
}, [C]), se(() => {
|
|
7833
|
-
!_ || _ ===
|
|
7843
|
+
!_ || _ === y.current || (y.current = _, d(mt(e)));
|
|
7834
7844
|
}, [_, e]), se(() => {
|
|
7835
7845
|
if (n)
|
|
7836
|
-
return n.current = (
|
|
7837
|
-
|
|
7838
|
-
const
|
|
7839
|
-
if (Bn(U) ||
|
|
7840
|
-
return
|
|
7846
|
+
return n.current = (F) => {
|
|
7847
|
+
F && d((U) => {
|
|
7848
|
+
const H = U.find((D) => Mn(F, [D]));
|
|
7849
|
+
if (Bn(U) || H)
|
|
7850
|
+
return H && p(H.id), U;
|
|
7841
7851
|
if (St(U))
|
|
7842
7852
|
return U;
|
|
7843
|
-
const
|
|
7853
|
+
const J = mt([
|
|
7844
7854
|
...U,
|
|
7845
|
-
{ ...
|
|
7846
|
-
]),
|
|
7847
|
-
return p(
|
|
7855
|
+
{ ...F, id: `${F.id}-${Date.now()}`, isNew: !0 }
|
|
7856
|
+
]), X = J[J.length - 1];
|
|
7857
|
+
return p(X.id), t?.(J), J;
|
|
7848
7858
|
});
|
|
7849
7859
|
}, () => {
|
|
7850
7860
|
n.current = null;
|
|
7851
7861
|
};
|
|
7852
7862
|
}, [n, t]), se(() => {
|
|
7853
7863
|
if (u == null) return;
|
|
7854
|
-
const
|
|
7855
|
-
if (!
|
|
7856
|
-
const
|
|
7857
|
-
const
|
|
7858
|
-
|
|
7859
|
-
left:
|
|
7864
|
+
const F = h.current, U = m.current[u];
|
|
7865
|
+
if (!F || !U) return;
|
|
7866
|
+
const H = requestAnimationFrame(() => {
|
|
7867
|
+
const J = F.getBoundingClientRect(), X = U.getBoundingClientRect(), D = 12;
|
|
7868
|
+
X.left >= J.left + D && X.right <= J.right - D || F.scrollTo({
|
|
7869
|
+
left: F.scrollLeft + X.left - J.left - (J.width - X.width) / 2,
|
|
7860
7870
|
behavior: "smooth"
|
|
7861
7871
|
});
|
|
7862
7872
|
});
|
|
7863
|
-
return () => cancelAnimationFrame(
|
|
7873
|
+
return () => cancelAnimationFrame(H);
|
|
7864
7874
|
}, [u, c]);
|
|
7865
|
-
const x = (
|
|
7866
|
-
if (
|
|
7867
|
-
const
|
|
7868
|
-
if (
|
|
7869
|
-
const
|
|
7870
|
-
|
|
7871
|
-
}, I = (
|
|
7872
|
-
const U = c.find((W) => W.id ===
|
|
7873
|
-
|
|
7874
|
-
const
|
|
7875
|
+
const x = (F, U) => {
|
|
7876
|
+
if (F == null || U == null || String(F) === String(U)) return;
|
|
7877
|
+
const H = c.findIndex((P) => String(P.id) === String(F)), J = c.findIndex((P) => String(P.id) === String(U));
|
|
7878
|
+
if (H < 0 || J < 0) return;
|
|
7879
|
+
const X = [...c], [D] = X.splice(H, 1);
|
|
7880
|
+
X.splice(J, 0, D), N(X.map((P, R) => ({ ...P, order: R + 1 })));
|
|
7881
|
+
}, I = (F) => {
|
|
7882
|
+
const U = c.find((W) => W.id === F.id), H = U && U.fieldType !== F.fieldType;
|
|
7883
|
+
F.dependsOn && F.dependsOn !== U?.dependsOn && p(F.id);
|
|
7884
|
+
const J = String(U?.fieldLabel || "").trim(), X = U?.options || [], D = F.options || [], P = X.filter((W) => !D.includes(W)), R = D.filter((W) => !X.includes(W)), V = X.length === D.length && P.length === 1 && R.length === 1 ? { from: P[0], to: R[0] } : null;
|
|
7875
7885
|
N(c.map((W) => {
|
|
7876
|
-
if (W.id ===
|
|
7877
|
-
if (
|
|
7886
|
+
if (W.id === F.id) return F;
|
|
7887
|
+
if (H && J && String(W.dependsOn || "").trim() === J)
|
|
7878
7888
|
return { ...W, dependsOn: "", parentMappings: {} };
|
|
7879
|
-
if (V &&
|
|
7880
|
-
const
|
|
7889
|
+
if (V && J && String(W.dependsOn || "").trim() === J) {
|
|
7890
|
+
const re = Object.fromEntries(
|
|
7881
7891
|
Object.entries(W.parentMappings || {}).map(([z, L]) => [
|
|
7882
7892
|
z,
|
|
7883
7893
|
L === V.from ? V.to : L
|
|
7884
7894
|
])
|
|
7885
7895
|
);
|
|
7886
|
-
return { ...W, parentMappings:
|
|
7896
|
+
return { ...W, parentMappings: re };
|
|
7887
7897
|
}
|
|
7888
7898
|
return W;
|
|
7889
7899
|
}));
|
|
7890
|
-
},
|
|
7891
|
-
const U = c.find((
|
|
7900
|
+
}, K = async (F) => {
|
|
7901
|
+
const U = c.find((H) => H.id === F);
|
|
7892
7902
|
if (!(!U || pn(U)))
|
|
7893
7903
|
try {
|
|
7894
7904
|
if (await i?.(U) === !1) return;
|
|
7895
|
-
const
|
|
7896
|
-
N(c.filter((
|
|
7905
|
+
const J = String(U.fieldLabel || "").trim();
|
|
7906
|
+
N(c.filter((X) => X.id !== F).map((X, D) => J && String(X.dependsOn || "").trim() === J ? { ...X, dependsOn: "", parentMappings: {}, order: D + 1 } : { ...X, order: D + 1 }));
|
|
7897
7907
|
} catch {
|
|
7898
7908
|
}
|
|
7899
7909
|
}, $ = () => {
|
|
@@ -7901,50 +7911,50 @@ function Lm({
|
|
|
7901
7911
|
...c,
|
|
7902
7912
|
{ id: `${Date.now()}-${c.length}`, fieldLabel: "", fieldType: r[0] ?? "", options: [], isNew: !0 }
|
|
7903
7913
|
]));
|
|
7904
|
-
}, b = async (
|
|
7905
|
-
if (Mn(
|
|
7914
|
+
}, b = async (F) => {
|
|
7915
|
+
if (Mn(F, c))
|
|
7906
7916
|
return null;
|
|
7907
7917
|
try {
|
|
7908
|
-
const U = await o?.(
|
|
7909
|
-
return U ? (d((
|
|
7910
|
-
const
|
|
7911
|
-
return t?.(
|
|
7918
|
+
const U = await o?.(F);
|
|
7919
|
+
return U ? (d((H) => {
|
|
7920
|
+
const J = mt(H.map((X) => X.id === F.id ? { ...U, isNew: !1, order: X.order || 1 } : X));
|
|
7921
|
+
return t?.(J), J;
|
|
7912
7922
|
}), U) : null;
|
|
7913
7923
|
} catch {
|
|
7914
7924
|
return null;
|
|
7915
7925
|
}
|
|
7916
|
-
}, T = Bn(c), A = St(c), B = T ? "A field with this label and type already exists" : "", j = hi(c), E = c.find((
|
|
7926
|
+
}, T = Bn(c), A = St(c), B = T ? "A field with this label and type already exists" : "", j = hi(c), E = c.find((F) => F.id === u) || null;
|
|
7917
7927
|
return /* @__PURE__ */ v(me, { children: [
|
|
7918
7928
|
B || j || C ? /* @__PURE__ */ l("div", { className: "ca-validation-toast", role: "alert", children: B || j || C }) : null,
|
|
7919
7929
|
/* @__PURE__ */ v("div", { className: "ca-form-card-grid__container ", children: [
|
|
7920
7930
|
/* @__PURE__ */ v("div", { className: "ca-form-card-grid", children: [
|
|
7921
|
-
/* @__PURE__ */ l("div", { className: "ca-form-card-grid__labels", children: Em.map((
|
|
7922
|
-
/* @__PURE__ */ v("div", { className: "ca-form-card-grid__cards", ref:
|
|
7923
|
-
c.map((
|
|
7931
|
+
/* @__PURE__ */ l("div", { className: "ca-form-card-grid__labels", children: Em.map((F) => /* @__PURE__ */ l("div", { className: "ca-form-card-grid__label", children: F }, F)) }),
|
|
7932
|
+
/* @__PURE__ */ v("div", { className: "ca-form-card-grid__cards", ref: h, children: [
|
|
7933
|
+
c.map((F) => /* @__PURE__ */ l(
|
|
7924
7934
|
Sm,
|
|
7925
7935
|
{
|
|
7926
|
-
field:
|
|
7927
|
-
fieldOptions: _m(
|
|
7936
|
+
field: F,
|
|
7937
|
+
fieldOptions: _m(F, c),
|
|
7928
7938
|
fieldTypeOptions: r,
|
|
7929
7939
|
fieldAccessOptions: a,
|
|
7930
7940
|
hideForOptions: s,
|
|
7931
|
-
selected: E?.id ===
|
|
7932
|
-
isDragging: String(f) === String(
|
|
7941
|
+
selected: E?.id === F.id,
|
|
7942
|
+
isDragging: String(f) === String(F.id),
|
|
7933
7943
|
cardRef: (U) => {
|
|
7934
|
-
U ? m.current[
|
|
7944
|
+
U ? m.current[F.id] = U : delete m.current[F.id];
|
|
7935
7945
|
},
|
|
7936
|
-
onSelect: () => p(
|
|
7937
|
-
onDragStartField: () => w(
|
|
7946
|
+
onSelect: () => p(F.id),
|
|
7947
|
+
onDragStartField: () => w(F.id),
|
|
7938
7948
|
onDragEndField: () => w(null),
|
|
7939
7949
|
onReorder: x,
|
|
7940
7950
|
onChange: I,
|
|
7941
|
-
onDelete:
|
|
7951
|
+
onDelete: K,
|
|
7942
7952
|
onSave: b,
|
|
7943
7953
|
onOptionNotice: S,
|
|
7944
|
-
hasDuplicateIdentity: Mn(
|
|
7945
|
-
hasMissingOptions: Sa(
|
|
7954
|
+
hasDuplicateIdentity: Mn(F, c),
|
|
7955
|
+
hasMissingOptions: Sa(F)
|
|
7946
7956
|
},
|
|
7947
|
-
|
|
7957
|
+
F.id
|
|
7948
7958
|
)),
|
|
7949
7959
|
/* @__PURE__ */ l(cm, { onAdd: $, disabled: T || A })
|
|
7950
7960
|
] })
|
|
@@ -8064,7 +8074,7 @@ function Fm(e, t) {
|
|
|
8064
8074
|
return n ? r ? n + r.charAt(0).toUpperCase() + r.slice(1) : n : "";
|
|
8065
8075
|
}
|
|
8066
8076
|
function Zn(e, t) {
|
|
8067
|
-
return
|
|
8077
|
+
return Q({ ...e, fieldLabel: t }) ? Ct(t) || "status" : Qe({ ...e, fieldLabel: t }) ? "storeIdCustom" : Fm(t, e.fieldType);
|
|
8068
8078
|
}
|
|
8069
8079
|
function Dt(e) {
|
|
8070
8080
|
const t = e?.data ?? e?.id ?? e;
|
|
@@ -8079,10 +8089,10 @@ function Fr(e) {
|
|
|
8079
8089
|
return e ? typeof e.id == "number" || /^\d+$/.test(String(e.id)) : !1;
|
|
8080
8090
|
}
|
|
8081
8091
|
function xm(e = []) {
|
|
8082
|
-
const t =
|
|
8092
|
+
const t = Q(e) ? vt(e.options || []) : e.options || [];
|
|
8083
8093
|
if (!t.length) return null;
|
|
8084
8094
|
const n = e.parentMappings || {}, r = e.optionColors || {}, a = !!e.dependsOn || t.some((s) => n[s]);
|
|
8085
|
-
return
|
|
8095
|
+
return Q(e) ? {
|
|
8086
8096
|
values: t.map((s, o) => {
|
|
8087
8097
|
const i = {
|
|
8088
8098
|
name: s,
|
|
@@ -8214,45 +8224,45 @@ function nt(e = [], t = []) {
|
|
|
8214
8224
|
}));
|
|
8215
8225
|
}
|
|
8216
8226
|
function jm({ stepMeta: e, stepperProps: t }) {
|
|
8217
|
-
const n = Re(), { systemId: r } = er(), a =
|
|
8218
|
-
const V = String(
|
|
8227
|
+
const n = Re(), { systemId: r } = er(), a = ne((R) => R.appDetails?.id), s = Dt(a) ?? Dt(r), { state: o, update: i } = wa(), { formFields: c, prefillFormFields: d = [] } = o, u = Se(null), p = Be((R) => i({ formFields: R }), [i]), f = Be(async (R) => {
|
|
8228
|
+
const V = String(R.fieldLabel || "").trim();
|
|
8219
8229
|
return V ? {
|
|
8220
|
-
...
|
|
8230
|
+
...R,
|
|
8221
8231
|
fieldLabel: V,
|
|
8222
|
-
fieldKey: Zn(
|
|
8232
|
+
fieldKey: Zn(R, V),
|
|
8223
8233
|
originalFieldName: V,
|
|
8224
8234
|
isNew: !1
|
|
8225
8235
|
} : null;
|
|
8226
|
-
}, []), w = Be(async (
|
|
8236
|
+
}, []), w = Be(async (R) => pn(R) ? !1 : (Fr(R) && await n(Fn({
|
|
8227
8237
|
complaintTypeId: s,
|
|
8228
|
-
fieldId:
|
|
8229
|
-
})).unwrap(), !0), [s, n]), C =
|
|
8230
|
-
() => Pm(
|
|
8231
|
-
[
|
|
8238
|
+
fieldId: R.id
|
|
8239
|
+
})).unwrap(), !0), [s, n]), C = ne((R) => R.complaintAppComplaint?.formFields?.data), S = ne((R) => R.complaintAppComplaint?.formFields?.isLoading), y = ne((R) => R.complaintAppComplaint?.formFields?.error), h = ne((R) => R.workflow?.workflowSteps), m = oe(
|
|
8240
|
+
() => Pm(h),
|
|
8241
|
+
[h]
|
|
8232
8242
|
), N = Se(m), [_, x] = q(!1);
|
|
8233
8243
|
se(() => {
|
|
8234
8244
|
N.current = m;
|
|
8235
8245
|
}, [m]), se(() => {
|
|
8236
|
-
const
|
|
8237
|
-
|
|
8246
|
+
const R = Dt(s);
|
|
8247
|
+
R != null && n(Ye(R));
|
|
8238
8248
|
}, [s, n]), se(() => {
|
|
8239
|
-
const
|
|
8240
|
-
if (
|
|
8249
|
+
const R = Dt(s);
|
|
8250
|
+
if (R == null)
|
|
8241
8251
|
return;
|
|
8242
8252
|
let V = !1;
|
|
8243
|
-
return n(Ue(
|
|
8253
|
+
return n(Ue(R)).unwrap().then((W) => {
|
|
8244
8254
|
if (V) return;
|
|
8245
|
-
const
|
|
8246
|
-
if (!(Array.isArray(
|
|
8247
|
-
const L = nt(d, N.current).map((
|
|
8248
|
-
...
|
|
8255
|
+
const re = Array.isArray(W) ? W : W?.data;
|
|
8256
|
+
if (!(Array.isArray(re) && re.length > 0) && d.length) {
|
|
8257
|
+
const L = nt(d, N.current).map((Y, ie) => ({
|
|
8258
|
+
...Y,
|
|
8249
8259
|
id: `prefill-${ie}`,
|
|
8250
8260
|
isNew: !1
|
|
8251
8261
|
}));
|
|
8252
8262
|
i({ formFields: ht(L) });
|
|
8253
8263
|
} else {
|
|
8254
8264
|
const L = ht(
|
|
8255
|
-
nt(Array.isArray(
|
|
8265
|
+
nt(Array.isArray(re) ? re : [], N.current)
|
|
8256
8266
|
);
|
|
8257
8267
|
i({ formFields: L });
|
|
8258
8268
|
}
|
|
@@ -8260,8 +8270,8 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8260
8270
|
}).catch(() => {
|
|
8261
8271
|
if (!V) {
|
|
8262
8272
|
if (d.length) {
|
|
8263
|
-
const W = nt(d, N.current).map((
|
|
8264
|
-
...
|
|
8273
|
+
const W = nt(d, N.current).map((re, z) => ({
|
|
8274
|
+
...re,
|
|
8265
8275
|
id: `prefill-${z}`,
|
|
8266
8276
|
isNew: !1
|
|
8267
8277
|
}));
|
|
@@ -8276,57 +8286,57 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8276
8286
|
const I = oe(
|
|
8277
8287
|
() => ht(nt(C, m)),
|
|
8278
8288
|
[C, m]
|
|
8279
|
-
), $ = Dt(s) == null || _, b = $ ? c : I, T = oe(() => mm.filter((
|
|
8289
|
+
), $ = Dt(s) == null || _, b = $ ? c : I, T = oe(() => mm.filter((R) => !b.some((V) => R.fieldKey && V.fieldKey === R.fieldKey || Q(R) && Q(V) || Kn(R) && Kn(V) || Qe(R) && Qe(V))), [b]), A = oe(
|
|
8280
8290
|
() => Bn(b),
|
|
8281
8291
|
[b]
|
|
8282
8292
|
), B = oe(
|
|
8283
8293
|
() => St(b),
|
|
8284
8294
|
[b]
|
|
8285
|
-
), j = km(
|
|
8286
|
-
const
|
|
8287
|
-
return bi([...
|
|
8288
|
-
}, [I, m]),
|
|
8289
|
-
const
|
|
8295
|
+
), j = km(y), E = um, F = pm, U = oe(() => {
|
|
8296
|
+
const R = [...m].sort((W, re) => (W.levelNo ?? 0) - (re.levelNo ?? 0)).map((W) => Gn(W)).filter(Boolean), V = I.flatMap((W) => W.hideFor);
|
|
8297
|
+
return bi([...R, ...V]);
|
|
8298
|
+
}, [I, m]), H = oe(() => {
|
|
8299
|
+
const R = new Map(
|
|
8290
8300
|
nt(C, m).map((V) => [Number(V.id), V])
|
|
8291
8301
|
);
|
|
8292
8302
|
return b.filter((V) => {
|
|
8293
8303
|
if (V.isNew && String(V.fieldLabel || "").trim()) return !0;
|
|
8294
8304
|
if (!Fr(V)) return !1;
|
|
8295
|
-
const W =
|
|
8305
|
+
const W = R.get(Number(V.id));
|
|
8296
8306
|
return !W || Es(V, W);
|
|
8297
8307
|
});
|
|
8298
|
-
}, [C, b, m]), [
|
|
8308
|
+
}, [C, b, m]), [J, X] = q(!1), D = Be(async (R) => {
|
|
8299
8309
|
if (!St(b) && s)
|
|
8300
8310
|
try {
|
|
8301
|
-
const W = b.map((
|
|
8302
|
-
if (!
|
|
8303
|
-
const le = String(
|
|
8311
|
+
const W = b.map((te) => {
|
|
8312
|
+
if (!R || !te.isNew) return te;
|
|
8313
|
+
const le = String(te.fieldLabel || "").trim();
|
|
8304
8314
|
return le ? {
|
|
8305
|
-
...
|
|
8315
|
+
...te,
|
|
8306
8316
|
fieldLabel: le,
|
|
8307
|
-
fieldKey: Zn(
|
|
8317
|
+
fieldKey: Zn(te, le),
|
|
8308
8318
|
originalFieldName: le,
|
|
8309
8319
|
isNew: !1
|
|
8310
|
-
} :
|
|
8311
|
-
}).filter((
|
|
8312
|
-
nt(C, m).map((
|
|
8320
|
+
} : te;
|
|
8321
|
+
}).filter((te) => !te.isNew && String(te.fieldLabel || "").trim()), re = new Map(
|
|
8322
|
+
nt(C, m).map((te) => [Number(te.id), te])
|
|
8313
8323
|
);
|
|
8314
|
-
if (!W.some((
|
|
8315
|
-
if (!Fr(
|
|
8316
|
-
const le =
|
|
8317
|
-
return !le || Es(
|
|
8324
|
+
if (!W.some((te) => {
|
|
8325
|
+
if (!Fr(te)) return !0;
|
|
8326
|
+
const le = re.get(Number(te.id));
|
|
8327
|
+
return !le || Es(te, le);
|
|
8318
8328
|
})) {
|
|
8319
8329
|
t.onNext?.();
|
|
8320
8330
|
return;
|
|
8321
8331
|
}
|
|
8322
8332
|
const L = [...W].sort(
|
|
8323
|
-
(
|
|
8333
|
+
(te, le) => +!!te.dependsOn - +!!le.dependsOn
|
|
8324
8334
|
);
|
|
8325
8335
|
await n(On({
|
|
8326
8336
|
complaintTypeId: s,
|
|
8327
8337
|
data: Dm(L, L, m)
|
|
8328
8338
|
})).unwrap();
|
|
8329
|
-
const
|
|
8339
|
+
const Y = await n(Ue(s)).unwrap(), ie = Array.isArray(Y) ? Y : Y?.data;
|
|
8330
8340
|
i({
|
|
8331
8341
|
formFields: ht(
|
|
8332
8342
|
nt(Array.isArray(ie) ? ie : [], m)
|
|
@@ -8336,16 +8346,16 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8336
8346
|
}
|
|
8337
8347
|
}, [C, s, n, b, t, i, m]), P = Be(() => {
|
|
8338
8348
|
if (!St(b)) {
|
|
8339
|
-
if (
|
|
8340
|
-
|
|
8349
|
+
if (H.length) {
|
|
8350
|
+
X(!0);
|
|
8341
8351
|
return;
|
|
8342
8352
|
}
|
|
8343
8353
|
D(!1);
|
|
8344
8354
|
}
|
|
8345
|
-
}, [b,
|
|
8355
|
+
}, [b, H.length, D]);
|
|
8346
8356
|
return /* @__PURE__ */ v(me, { children: [
|
|
8347
8357
|
/* @__PURE__ */ l(or, { ...t, steps: We, onNext: P }),
|
|
8348
|
-
|
|
8358
|
+
J ? /* @__PURE__ */ l(
|
|
8349
8359
|
"div",
|
|
8350
8360
|
{
|
|
8351
8361
|
className: "ca-confirm-modal",
|
|
@@ -8360,7 +8370,7 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8360
8370
|
{
|
|
8361
8371
|
variant: "outline",
|
|
8362
8372
|
onClick: () => {
|
|
8363
|
-
|
|
8373
|
+
X(!1), D(!1);
|
|
8364
8374
|
},
|
|
8365
8375
|
children: "OK"
|
|
8366
8376
|
}
|
|
@@ -8369,7 +8379,7 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8369
8379
|
Ee,
|
|
8370
8380
|
{
|
|
8371
8381
|
onClick: () => {
|
|
8372
|
-
|
|
8382
|
+
X(!1), D(!0);
|
|
8373
8383
|
},
|
|
8374
8384
|
children: "Save"
|
|
8375
8385
|
}
|
|
@@ -8393,7 +8403,7 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8393
8403
|
fields: T,
|
|
8394
8404
|
disableAdd: A || B,
|
|
8395
8405
|
disableAddHint: A ? "Resolve duplicate field first" : B ? hi(b) : void 0,
|
|
8396
|
-
onAddField: (
|
|
8406
|
+
onAddField: (R) => u.current?.({ ...R })
|
|
8397
8407
|
}
|
|
8398
8408
|
),
|
|
8399
8409
|
/* @__PURE__ */ l(
|
|
@@ -8403,7 +8413,7 @@ function jm({ stepMeta: e, stepperProps: t }) {
|
|
|
8403
8413
|
addExternalFieldRef: u,
|
|
8404
8414
|
onChange: p,
|
|
8405
8415
|
fieldTypeOptions: E,
|
|
8406
|
-
fieldAccessOptions:
|
|
8416
|
+
fieldAccessOptions: F,
|
|
8407
8417
|
hideForOptions: U,
|
|
8408
8418
|
onSave: f,
|
|
8409
8419
|
onDelete: w
|
|
@@ -8722,8 +8732,8 @@ function Gm({ fields: e = [], storeList: t }) {
|
|
|
8722
8732
|
if (!f || Ut(f) !== c) return;
|
|
8723
8733
|
const w = Zr(p);
|
|
8724
8734
|
if (!Ts(w)) return;
|
|
8725
|
-
const C = Fs(p, e, u), S = Ut(p),
|
|
8726
|
-
Array.isArray(
|
|
8735
|
+
const C = Fs(p, e, u), S = Ut(p), y = u[S];
|
|
8736
|
+
Array.isArray(y) ? u[S] = y.filter((h) => C.includes(h)) : y && !C.includes(y) && (u[S] = "");
|
|
8727
8737
|
}), u;
|
|
8728
8738
|
});
|
|
8729
8739
|
};
|
|
@@ -8829,7 +8839,7 @@ function rh(e = []) {
|
|
|
8829
8839
|
});
|
|
8830
8840
|
}
|
|
8831
8841
|
function ah({ onPublish: e, stepMeta: t, stepperProps: n, storeList: r }) {
|
|
8832
|
-
const a = Re(), s =
|
|
8842
|
+
const a = Re(), s = ne((_) => _.appDetails?.id), o = ne((_) => _.complaintAppComplaint.formFields.data), i = ne((_) => _.complaintAppComplaint.formFields.isLoading), c = ne((_) => _.complaintAppComplaint.formFields.error), d = ne((_) => _.createComplaint?.isActive), u = ne((_) => _.createComplaint?.activeComplaintTypeId), p = ne((_) => _.createComplaint?.isUpdatingActive), f = ne((_) => _.createComplaint?.activeError), w = ne((_) => _.complaintType?.selected), C = ne((_) => _.complaintType?.complaintList ?? []), S = oe(() => rh(o), [o]), y = oe(() => s == null ? null : w && String(w.id ?? w._id) === String(s) ? w : C.find((_) => String(_?.id ?? _?._id) === String(s)) ?? null, [C, s, w]), h = y != null && (y.isActive != null || y.active != null) ? !!(y.isActive ?? y.active) : null, m = String(u) === String(s) ? !!d : h ?? !0;
|
|
8833
8843
|
return se(() => {
|
|
8834
8844
|
s && a(Ue(s));
|
|
8835
8845
|
}, [s, a]), /* @__PURE__ */ v(me, { children: [
|
|
@@ -8893,9 +8903,9 @@ function ih({
|
|
|
8893
8903
|
showSaveButton: i = !0,
|
|
8894
8904
|
showNextButton: c = !0
|
|
8895
8905
|
}) {
|
|
8896
|
-
const d = et(), u = Re(), { systemId: p } = er(), [f, w] = io(), C = sh(f.get("step") || 1), S = oh(f.get("substep") || 1),
|
|
8906
|
+
const d = et(), u = Re(), { systemId: p } = er(), [f, w] = io(), C = sh(f.get("step") || 1), S = oh(f.get("substep") || 1), y = !!p && p !== "new", [h, m] = q(!1);
|
|
8897
8907
|
se(() => {
|
|
8898
|
-
if (!
|
|
8908
|
+
if (!y) return;
|
|
8899
8909
|
let T = !1;
|
|
8900
8910
|
const A = (B) => {
|
|
8901
8911
|
const j = B?.data ?? B;
|
|
@@ -8911,8 +8921,8 @@ function ih({
|
|
|
8911
8921
|
}), () => {
|
|
8912
8922
|
T = !0;
|
|
8913
8923
|
};
|
|
8914
|
-
}, [u,
|
|
8915
|
-
const N =
|
|
8924
|
+
}, [u, y, p]);
|
|
8925
|
+
const N = y && h;
|
|
8916
8926
|
se(() => {
|
|
8917
8927
|
p && u(At(p));
|
|
8918
8928
|
}, [u, p]), se(() => {
|
|
@@ -8936,7 +8946,7 @@ function ih({
|
|
|
8936
8946
|
return;
|
|
8937
8947
|
}
|
|
8938
8948
|
d("/");
|
|
8939
|
-
},
|
|
8949
|
+
}, K = (T) => {
|
|
8940
8950
|
x(4, T);
|
|
8941
8951
|
}, $ = () => {
|
|
8942
8952
|
t?.({ systemId: p, step: C });
|
|
@@ -8982,7 +8992,7 @@ function ih({
|
|
|
8982
8992
|
roleList: a,
|
|
8983
8993
|
userList: s,
|
|
8984
8994
|
substep: S,
|
|
8985
|
-
onSubstepChange:
|
|
8995
|
+
onSubstepChange: K,
|
|
8986
8996
|
stepperProps: b
|
|
8987
8997
|
}
|
|
8988
8998
|
) : null,
|
|
@@ -9012,7 +9022,7 @@ function ch(e) {
|
|
|
9012
9022
|
return `${t.getDate()} ${lh[t.getMonth()]} ${t.getFullYear()}, ${n}:${r}`;
|
|
9013
9023
|
}
|
|
9014
9024
|
function dh() {
|
|
9015
|
-
const e = et(), t =
|
|
9025
|
+
const e = et(), t = ne((u) => u.status?.complaintSummary ?? null), n = t?.totalComplaints ?? 0, r = t?.totalComplaints ?? 0, a = ch(t?.lastSubmittedAt), s = ne((u) => u.appDetails?.id), o = ne((u) => u.complaintType?.selected ?? null), i = o?.id ?? o?._id, d = i == null || s == null || String(i) === String(s) ? o?.name ?? o?.complaintTypeName ?? o?.title ?? "" : "";
|
|
9016
9026
|
return /* @__PURE__ */ v("section", { className: "ca-query-details", "aria-labelledby": "query-management-title", children: [
|
|
9017
9027
|
/* @__PURE__ */ v("div", { className: "ca-query-details__heading", children: [
|
|
9018
9028
|
/* @__PURE__ */ v("div", { className: "ca-query-details__title-row", children: [
|
|
@@ -9705,7 +9715,7 @@ function Qh(e, t = [], n = [], r = null) {
|
|
|
9705
9715
|
};
|
|
9706
9716
|
}
|
|
9707
9717
|
function e0() {
|
|
9708
|
-
const { fieldLabel: e } = dt(), t = Re(), n = et(), { complaintTypeId: r } = er(), [a] = io(), s =
|
|
9718
|
+
const { fieldLabel: e } = dt(), t = Re(), n = et(), { complaintTypeId: r } = er(), [a] = io(), s = ne((O) => O.appDetails?.id), o = Bh(
|
|
9709
9719
|
r,
|
|
9710
9720
|
a.get("complaintTypeId"),
|
|
9711
9721
|
s,
|
|
@@ -9717,60 +9727,60 @@ function e0() {
|
|
|
9717
9727
|
hasLoaded: u = !1,
|
|
9718
9728
|
requestedComplaintTypeId: p = null,
|
|
9719
9729
|
meta: f = null
|
|
9720
|
-
} =
|
|
9721
|
-
const
|
|
9722
|
-
return ae.length ? ae.map(Number) : (Array.isArray(
|
|
9723
|
-
}), $ =
|
|
9724
|
-
const
|
|
9725
|
-
return
|
|
9726
|
-
}), [b, T] = q({ complaintTypeId: null, status: "all" }), [A, B] = q({ complaintTypeId: null, direction: Qt }), [j, E] = q(1), [
|
|
9730
|
+
} = ne((O) => O.complaintManagement ?? {}), w = ne((O) => O.status?.list ?? []), C = ne((O) => O.changeStatus?.error ?? null), S = ne((O) => O.changeStatus?.updatingId ?? null), y = ne((O) => O.workflow?.workflowSteps), h = ne((O) => O.appDetails?.details?.currentUser), m = oe(() => w.map((O) => O.name).filter(Boolean), [w]), N = oe(() => Array.isArray(y) ? y : [], [y]), _ = oe(() => Zh(h), [h]), x = h?.id ?? null, I = oe(() => Xh(N, _, x), [N, _, x]), K = ne((O) => {
|
|
9731
|
+
const G = O.complaintType?.selected, ae = Array.isArray(G?.accesses) ? G.accesses.map((_e) => _e?.role?.id).filter((_e) => _e != null) : [];
|
|
9732
|
+
return ae.length ? ae.map(Number) : (Array.isArray(G?.roleIds) ? G.roleIds : []).map(Number);
|
|
9733
|
+
}), $ = ne((O) => {
|
|
9734
|
+
const G = O.complaintType?.selected;
|
|
9735
|
+
return G?.isActive != null ? !!G.isActive : G?.active != null ? !!G.active : !0;
|
|
9736
|
+
}), [b, T] = q({ complaintTypeId: null, status: "all" }), [A, B] = q({ complaintTypeId: null, direction: Qt }), [j, E] = q(1), [F, U] = q(Th), [H, J] = q([]), [X, D] = q({}), [P, R] = q(!1), [V, W] = q(null), [re, z] = q(null), [L, Y] = q(""), [ie, te] = q([]), le = String(b.complaintTypeId) === String(o) ? b.status : "all", pe = String(A.complaintTypeId) === String(o) ? A.direction : Qt, Fe = (O, G = "success") => {
|
|
9727
9737
|
const ae = `${Date.now()}-${Math.random()}`;
|
|
9728
|
-
|
|
9729
|
-
}, Ae = (
|
|
9738
|
+
te((ue) => [...ue, { id: ae, message: O, type: G }]);
|
|
9739
|
+
}, Ae = (O) => te((G) => G.filter((ae) => ae.id !== O));
|
|
9730
9740
|
se(() => {
|
|
9731
9741
|
!o || r || (Bs(o), n(`/complaintmanagement/${o}`, { replace: !0 }));
|
|
9732
9742
|
}, [o, n, r]), se(() => {
|
|
9733
9743
|
if (!o || !r) return;
|
|
9734
9744
|
Bs(o), t(At(o)), t(Jo()), t(Yo()), t(Ap());
|
|
9735
|
-
const
|
|
9736
|
-
return ue.unwrap().then((tt) =>
|
|
9737
|
-
|
|
9745
|
+
const O = t(In(o)), G = t(Wt(o)), ae = t(Ye(o)), ue = t(Ue(o)), _e = t(yt(o));
|
|
9746
|
+
return ue.unwrap().then((tt) => J(Dh(tt))).catch(() => J([])), () => {
|
|
9747
|
+
O.abort?.(), G.abort?.(), ae.abort?.(), ue.abort?.(), _e.abort?.();
|
|
9738
9748
|
};
|
|
9739
9749
|
}, [o, t, r]), se(() => {
|
|
9740
9750
|
if (!o || !r) return;
|
|
9741
|
-
const
|
|
9751
|
+
const O = t(bt({
|
|
9742
9752
|
complaintTypeId: o,
|
|
9743
9753
|
page: j,
|
|
9744
|
-
limit:
|
|
9754
|
+
limit: F,
|
|
9745
9755
|
status: le === "all" ? void 0 : le
|
|
9746
9756
|
}));
|
|
9747
|
-
return () =>
|
|
9748
|
-
}, [o, t,
|
|
9757
|
+
return () => O.abort?.();
|
|
9758
|
+
}, [o, t, F, j, r, le]);
|
|
9749
9759
|
const Le = oe(
|
|
9750
|
-
() => new Map(
|
|
9751
|
-
[
|
|
9752
|
-
),
|
|
9753
|
-
{ hideForWorkflowStepId: Le.get(
|
|
9760
|
+
() => new Map(H.map((O) => [O.key, O.hideForWorkflowStepId])),
|
|
9761
|
+
[H]
|
|
9762
|
+
), Z = Be((O) => Gh(
|
|
9763
|
+
{ hideForWorkflowStepId: Le.get(O) },
|
|
9754
9764
|
N,
|
|
9755
9765
|
_
|
|
9756
|
-
), [Le, N, _]), we =
|
|
9757
|
-
...Us(
|
|
9758
|
-
_fields:
|
|
9766
|
+
), [Le, N, _]), we = K.length === 0 || K.some((O) => _.includes(O)), Ne = oe(() => p != null && o != null && String(p) !== String(o) ? [] : i.map((O) => ({
|
|
9767
|
+
...Us(O, w, N),
|
|
9768
|
+
_fields: O?.formField || []
|
|
9759
9769
|
})), [o, i, p, w, N]), ke = oe(
|
|
9760
|
-
() => $s(Ne,
|
|
9761
|
-
[Ne,
|
|
9770
|
+
() => $s(Ne, H).filter((O) => !Z(O.key)),
|
|
9771
|
+
[Ne, H, Z]
|
|
9762
9772
|
), fn = Ms(ke), xt = oe(
|
|
9763
9773
|
() => xh(Ne, pe),
|
|
9764
9774
|
[Ne, pe]
|
|
9765
|
-
), xe = xt.map(({ _fields:
|
|
9775
|
+
), xe = xt.map(({ _fields: O, ...G }) => G), lr = oe(
|
|
9766
9776
|
() => Ch(ke, xt),
|
|
9767
9777
|
[ke, xt]
|
|
9768
|
-
), Oi = lr.every((
|
|
9778
|
+
), Oi = lr.every((O) => Object.prototype.hasOwnProperty.call(X, O));
|
|
9769
9779
|
se(() => {
|
|
9770
|
-
const
|
|
9771
|
-
if (!
|
|
9772
|
-
let
|
|
9773
|
-
return Promise.all(
|
|
9780
|
+
const O = lr.filter((ae) => !Object.prototype.hasOwnProperty.call(X, ae));
|
|
9781
|
+
if (!O.length) return;
|
|
9782
|
+
let G = !1;
|
|
9783
|
+
return Promise.all(O.map(async (ae) => {
|
|
9774
9784
|
try {
|
|
9775
9785
|
const ue = await t(Pn({ params: { path: ae } })).unwrap();
|
|
9776
9786
|
return [ae, ue];
|
|
@@ -9778,53 +9788,53 @@ function e0() {
|
|
|
9778
9788
|
return [ae, ""];
|
|
9779
9789
|
}
|
|
9780
9790
|
})).then((ae) => {
|
|
9781
|
-
|
|
9791
|
+
G || D((ue) => ({ ...ue, ...Object.fromEntries(ae) }));
|
|
9782
9792
|
}), () => {
|
|
9783
|
-
|
|
9793
|
+
G = !0;
|
|
9784
9794
|
};
|
|
9785
|
-
}, [lr,
|
|
9786
|
-
const mn = Ph(f, j,
|
|
9787
|
-
E(1), T({ complaintTypeId: o, status:
|
|
9788
|
-
}, ki = (
|
|
9789
|
-
|
|
9790
|
-
}, xi = (
|
|
9791
|
-
const
|
|
9792
|
-
!Number.isFinite(
|
|
9795
|
+
}, [lr, X, t]);
|
|
9796
|
+
const mn = Ph(f, j, F, xe.length), Aa = !!(o && !d && (!xe.length && (c || !u) || xe.length > 0 && !Oi)), Fi = (O) => {
|
|
9797
|
+
E(1), T({ complaintTypeId: o, status: O }), o && t(bt({ complaintTypeId: o, page: 1, limit: F, status: O === "all" ? void 0 : O }));
|
|
9798
|
+
}, ki = (O) => {
|
|
9799
|
+
O >= 1 && O <= mn.totalPages && O !== j && E(O);
|
|
9800
|
+
}, xi = (O) => {
|
|
9801
|
+
const G = Number(O);
|
|
9802
|
+
!Number.isFinite(G) || G <= 0 || G === F || (U(G), E(1));
|
|
9793
9803
|
}, Ii = () => B({
|
|
9794
9804
|
complaintTypeId: o,
|
|
9795
9805
|
direction: Ih(pe)
|
|
9796
9806
|
}), Di = () => {
|
|
9797
9807
|
o && n(`/complaintmanagement/new/${o}`);
|
|
9798
|
-
}, Pi = (
|
|
9799
|
-
if (
|
|
9800
|
-
const ae = w.find((_e) => String(_e.id) === String(
|
|
9808
|
+
}, Pi = (O, G) => {
|
|
9809
|
+
if (O?.id == null || S != null && String(S) === String(O.id) || String(G) === String(O.statusId) || String(G) === String(O.status)) return;
|
|
9810
|
+
const ae = w.find((_e) => String(_e.id) === String(G) || String(_e.name) === String(G));
|
|
9801
9811
|
if (ae?.id == null) return;
|
|
9802
9812
|
const ue = Li(ae.name);
|
|
9803
|
-
ue && !I || ue && !
|
|
9813
|
+
ue && !I || ue && !O.canResolve || O.isFinalLevel && !ue || (Y(""), z({
|
|
9804
9814
|
type: "status",
|
|
9805
|
-
row:
|
|
9815
|
+
row: O,
|
|
9806
9816
|
statusId: ae.id,
|
|
9807
|
-
currentStepId:
|
|
9808
|
-
fromLabel:
|
|
9817
|
+
currentStepId: O.currentStepId,
|
|
9818
|
+
fromLabel: O.status || "—",
|
|
9809
9819
|
toLabel: ae.name
|
|
9810
9820
|
}));
|
|
9811
|
-
}, Mi = (
|
|
9812
|
-
if (
|
|
9813
|
-
const ae = N.find((ue) => String(ue.id) === String(
|
|
9814
|
-
ae?.id != null && (
|
|
9821
|
+
}, Mi = (O, G) => {
|
|
9822
|
+
if (O?.id == null || S != null && String(S) === String(O.id) || String(G) === String(O.currentStepId) || String(G) === String(O.escalationTo)) return;
|
|
9823
|
+
const ae = N.find((ue) => String(ue.id) === String(G) || `Level ${ue.levelNo}` === String(G));
|
|
9824
|
+
ae?.id != null && (Y(""), z({
|
|
9815
9825
|
type: "escalation",
|
|
9816
|
-
row:
|
|
9817
|
-
statusId:
|
|
9826
|
+
row: O,
|
|
9827
|
+
statusId: O.statusId,
|
|
9818
9828
|
currentStepId: ae.id,
|
|
9819
|
-
fromLabel:
|
|
9829
|
+
fromLabel: O.escalationTo || "—",
|
|
9820
9830
|
toLabel: ae.levelNo != null ? `Level ${ae.levelNo}` : String(ae.name || ae.id)
|
|
9821
9831
|
}));
|
|
9822
9832
|
}, Bi = () => {
|
|
9823
|
-
if (!
|
|
9824
|
-
const { row:
|
|
9833
|
+
if (!re) return;
|
|
9834
|
+
const { row: O, statusId: G, currentStepId: ae, type: ue, fromLabel: _e, toLabel: tt } = re;
|
|
9825
9835
|
t(qt({
|
|
9826
|
-
id:
|
|
9827
|
-
statusId:
|
|
9836
|
+
id: O.id,
|
|
9837
|
+
statusId: G,
|
|
9828
9838
|
currentStepId: ae,
|
|
9829
9839
|
remark: L,
|
|
9830
9840
|
onSuccess: () => {
|
|
@@ -9834,7 +9844,7 @@ function e0() {
|
|
|
9834
9844
|
), ue === "escalation" && o && (t(bt({
|
|
9835
9845
|
complaintTypeId: o,
|
|
9836
9846
|
page: j,
|
|
9837
|
-
limit:
|
|
9847
|
+
limit: F,
|
|
9838
9848
|
status: le === "all" ? void 0 : le
|
|
9839
9849
|
})), t(Wt(o)));
|
|
9840
9850
|
},
|
|
@@ -9842,16 +9852,16 @@ function e0() {
|
|
|
9842
9852
|
const He = ze?.response?.data?.message ?? ze?.message ?? "Failed to update complaint";
|
|
9843
9853
|
Fe(He, "error");
|
|
9844
9854
|
}
|
|
9845
|
-
})), z(null),
|
|
9855
|
+
})), z(null), Y("");
|
|
9846
9856
|
}, Ui = () => {
|
|
9847
|
-
z(null),
|
|
9848
|
-
}, $i = (
|
|
9849
|
-
...Qh(
|
|
9850
|
-
statusOptions: Hh(w,
|
|
9857
|
+
z(null), Y("");
|
|
9858
|
+
}, $i = (O) => ({
|
|
9859
|
+
...Qh(O, N, _, x),
|
|
9860
|
+
statusOptions: Hh(w, O, I),
|
|
9851
9861
|
escalationOptions: Kh(N),
|
|
9852
|
-
onStatusChange: (
|
|
9853
|
-
onEscalationChange: (
|
|
9854
|
-
attachmentUrlMap:
|
|
9862
|
+
onStatusChange: (G) => Pi(O, G),
|
|
9863
|
+
onEscalationChange: (G) => Mi(O, G),
|
|
9864
|
+
attachmentUrlMap: X
|
|
9855
9865
|
});
|
|
9856
9866
|
return {
|
|
9857
9867
|
complaintTypeId: o,
|
|
@@ -9866,17 +9876,17 @@ function e0() {
|
|
|
9866
9876
|
onNewComplaint: Di,
|
|
9867
9877
|
onDownloadReport: async () => {
|
|
9868
9878
|
if (!(!o || P)) {
|
|
9869
|
-
|
|
9879
|
+
R(!0), W(null);
|
|
9870
9880
|
try {
|
|
9871
|
-
const
|
|
9881
|
+
const G = (await Jh({ complaintTypeId: o, status: le })).map((He) => ({
|
|
9872
9882
|
...Us(He, w, N),
|
|
9873
9883
|
_fields: He?.formField || []
|
|
9874
|
-
})), ae = $s(
|
|
9884
|
+
})), ae = $s(G, H).filter((He) => !Z(He.key)), ue = Ms(ae).filter((He) => !qh(He, G, _a)), _e = new Blob([zh(ue, G)], { type: "text/csv;charset=utf-8;" }), tt = URL.createObjectURL(_e), ze = document.createElement("a");
|
|
9875
9885
|
ze.href = tt, ze.download = `complaints-report-${o}-${Date.now()}.csv`, document.body.appendChild(ze), ze.click(), document.body.removeChild(ze), URL.revokeObjectURL(tt);
|
|
9876
|
-
} catch (
|
|
9877
|
-
W(
|
|
9886
|
+
} catch (O) {
|
|
9887
|
+
W(O?.response?.data?.message ?? O?.message ?? "Failed to download report");
|
|
9878
9888
|
} finally {
|
|
9879
|
-
|
|
9889
|
+
R(!1);
|
|
9880
9890
|
}
|
|
9881
9891
|
}
|
|
9882
9892
|
},
|
|
@@ -9884,26 +9894,26 @@ function e0() {
|
|
|
9884
9894
|
downloadError: V,
|
|
9885
9895
|
statusUpdateError: C,
|
|
9886
9896
|
showLoading: Aa,
|
|
9887
|
-
pendingChange:
|
|
9897
|
+
pendingChange: re,
|
|
9888
9898
|
remarkDraft: L,
|
|
9889
|
-
onRemarkDraftChange:
|
|
9899
|
+
onRemarkDraftChange: Y,
|
|
9890
9900
|
onConfirmPendingChange: Bi,
|
|
9891
9901
|
onCancelPendingChange: Ui,
|
|
9892
9902
|
toasts: ie,
|
|
9893
9903
|
onDismissToast: Ae,
|
|
9894
9904
|
tableProps: {
|
|
9895
|
-
scrollFields: fn.filter((
|
|
9905
|
+
scrollFields: fn.filter((O) => O.key !== "status" && O.key !== "escalationTo"),
|
|
9896
9906
|
stickyFields: [_i, Ei],
|
|
9897
9907
|
tableRows: xe,
|
|
9898
9908
|
fieldLabel: e,
|
|
9899
9909
|
getCellContext: $i,
|
|
9900
9910
|
page: j,
|
|
9901
|
-
itemsPerPage:
|
|
9911
|
+
itemsPerPage: F
|
|
9902
9912
|
},
|
|
9903
9913
|
paginationProps: {
|
|
9904
9914
|
currentPage: j,
|
|
9905
9915
|
totalItems: mn.totalItems,
|
|
9906
|
-
itemsPerPage:
|
|
9916
|
+
itemsPerPage: F,
|
|
9907
9917
|
onPageChange: ki,
|
|
9908
9918
|
onItemsPerPageChange: xi,
|
|
9909
9919
|
selectOptions: Rh,
|
|
@@ -9995,7 +10005,7 @@ function r0(e = []) {
|
|
|
9995
10005
|
return {
|
|
9996
10006
|
id: n.id,
|
|
9997
10007
|
label: r,
|
|
9998
|
-
fieldKey:
|
|
10008
|
+
fieldKey: Q({ fieldKey: a, label: r }) ? "status" : a,
|
|
9999
10009
|
fieldType: Ca(n.fieldType, n0, n.fieldKey),
|
|
10000
10010
|
required: !!n.required,
|
|
10001
10011
|
dependsOn: n.dependsOnField?.fieldName ?? o?.fieldName ?? n.dependsOn ?? "",
|
|
@@ -10014,7 +10024,7 @@ function $n(e) {
|
|
|
10014
10024
|
return t.length ? t[0].toLowerCase() + t.slice(1).map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join("") : "";
|
|
10015
10025
|
}
|
|
10016
10026
|
function a0(e) {
|
|
10017
|
-
if (
|
|
10027
|
+
if (Q(e)) return "status";
|
|
10018
10028
|
const t = String(e.fieldKey || "").trim();
|
|
10019
10029
|
return t && !/\s/.test(t) ? t : $n(e.label || t);
|
|
10020
10030
|
}
|
|
@@ -10078,7 +10088,7 @@ function Ri(e) {
|
|
|
10078
10088
|
return `new-query-${e.id ?? fe(e)}`;
|
|
10079
10089
|
}
|
|
10080
10090
|
function qs(e) {
|
|
10081
|
-
if (
|
|
10091
|
+
if (Q(e))
|
|
10082
10092
|
return (e.options || []).find((r) => String(r).trim().toLowerCase() === "open") || "Open";
|
|
10083
10093
|
const t = kt(e);
|
|
10084
10094
|
return t === "checkbox" || t === "file" || t === "images" ? [] : "";
|
|
@@ -10136,7 +10146,7 @@ function h0(e = [], t = {}) {
|
|
|
10136
10146
|
return "";
|
|
10137
10147
|
}
|
|
10138
10148
|
function g0({ field: e, value: t, onChange: n, storeList: r, options: a = e.options }) {
|
|
10139
|
-
const { fieldLabel: s } = dt(), o = kt(e), i = Ri(e), c =
|
|
10149
|
+
const { fieldLabel: s } = dt(), o = kt(e), i = Ri(e), c = Q(e);
|
|
10140
10150
|
if (Qe(e) && Array.isArray(r))
|
|
10141
10151
|
return /* @__PURE__ */ l(wi, { id: i, name: fe(e), required: e.required, storeList: r, value: t, onChange: n });
|
|
10142
10152
|
if (o === "radio")
|
|
@@ -10234,7 +10244,7 @@ function g0({ field: e, value: t, onChange: n, storeList: r, options: a = e.opti
|
|
|
10234
10244
|
return /* @__PURE__ */ l("input", { id: i, name: fe(e), className: "review-control", type: o, value: t, onChange: (d) => n(d.target.value), required: e.required, disabled: c });
|
|
10235
10245
|
}
|
|
10236
10246
|
function zs({ storeList: e } = {}) {
|
|
10237
|
-
const { fieldLabel: t } = dt(), n = Re(), r = et(), { complaintTypeId: a } = er(), s = Number(a), o = Number.isFinite(s) && s > 0, [i, c] = q([]), [d, u] = q({}), [p, f] = q(!0), [w, C] = q(!1), [S,
|
|
10247
|
+
const { fieldLabel: t } = dt(), n = Re(), r = et(), { complaintTypeId: a } = er(), s = Number(a), o = Number.isFinite(s) && s > 0, [i, c] = q([]), [d, u] = q({}), [p, f] = q(!0), [w, C] = q(!1), [S, y] = q(""), [h, m] = q(""), [N, _] = q("");
|
|
10238
10248
|
se(() => {
|
|
10239
10249
|
if (!o)
|
|
10240
10250
|
return;
|
|
@@ -10244,7 +10254,7 @@ function zs({ storeList: e } = {}) {
|
|
|
10244
10254
|
const A = r0(Array.isArray(T?.data) ? T.data : T);
|
|
10245
10255
|
c(A), u(Object.fromEntries(A.map((B) => [fe(B), qs(B)])));
|
|
10246
10256
|
}).catch((T) => {
|
|
10247
|
-
b ||
|
|
10257
|
+
b || y(typeof T == "string" ? T : T?.message || "Failed to load form fields.");
|
|
10248
10258
|
}).finally(() => {
|
|
10249
10259
|
b || f(!1);
|
|
10250
10260
|
}), () => {
|
|
@@ -10253,16 +10263,16 @@ function zs({ storeList: e } = {}) {
|
|
|
10253
10263
|
}, [s, n, o]);
|
|
10254
10264
|
const x = oe(() => i.length > 0, [i]), I = async (b) => {
|
|
10255
10265
|
if (b.preventDefault(), !o) {
|
|
10256
|
-
|
|
10266
|
+
y("A valid complaint type is required.");
|
|
10257
10267
|
return;
|
|
10258
10268
|
}
|
|
10259
|
-
if (
|
|
10260
|
-
|
|
10269
|
+
if (y(""), m(""), C(!0), !N.trim()) {
|
|
10270
|
+
y("Complaint Name is required."), C(!1);
|
|
10261
10271
|
return;
|
|
10262
10272
|
}
|
|
10263
10273
|
const T = h0(i, d);
|
|
10264
10274
|
if (T) {
|
|
10265
|
-
|
|
10275
|
+
y(T), C(!1);
|
|
10266
10276
|
return;
|
|
10267
10277
|
}
|
|
10268
10278
|
try {
|
|
@@ -10273,11 +10283,11 @@ function zs({ storeList: e } = {}) {
|
|
|
10273
10283
|
};
|
|
10274
10284
|
await n(Dn(B)).unwrap(), m("Query submitted successfully."), r(`/complaintmanagement/${s}`);
|
|
10275
10285
|
} catch (A) {
|
|
10276
|
-
|
|
10286
|
+
y(typeof A == "string" ? A : A?.message || "Failed to submit query.");
|
|
10277
10287
|
} finally {
|
|
10278
10288
|
C(!1);
|
|
10279
10289
|
}
|
|
10280
|
-
},
|
|
10290
|
+
}, K = (b) => {
|
|
10281
10291
|
const T = i0(b, i, d);
|
|
10282
10292
|
return /* @__PURE__ */ v("div", { className: `review-question${["textarea", "radio", "checkbox"].includes(kt(b)) ? " review-question--wide" : ""}`, children: [
|
|
10283
10293
|
/* @__PURE__ */ v("label", { className: "review-label", htmlFor: Ri(b), children: [
|
|
@@ -10292,7 +10302,7 @@ function zs({ storeList: e } = {}) {
|
|
|
10292
10302
|
options: T,
|
|
10293
10303
|
value: d[fe(b)] ?? qs(b),
|
|
10294
10304
|
onChange: (A) => {
|
|
10295
|
-
|
|
10305
|
+
Q(b) || u((B) => {
|
|
10296
10306
|
const j = d0(b, A, i);
|
|
10297
10307
|
return { ...B, [fe(b)]: A, ...j };
|
|
10298
10308
|
});
|
|
@@ -10342,13 +10352,13 @@ function zs({ storeList: e } = {}) {
|
|
|
10342
10352
|
o && !p && x ? /* @__PURE__ */ v("form", { className: "review-form-card", onSubmit: I, children: [
|
|
10343
10353
|
/* @__PURE__ */ v("div", { className: "review-form-grid", children: [
|
|
10344
10354
|
i.map((b) => /* @__PURE__ */ v(ea.Fragment, { children: [
|
|
10345
|
-
|
|
10346
|
-
|
|
10355
|
+
K(b),
|
|
10356
|
+
Q(b) ? $() : null
|
|
10347
10357
|
] }, b.id ?? fe(b))),
|
|
10348
|
-
i.some(
|
|
10358
|
+
i.some(Q) ? null : $()
|
|
10349
10359
|
] }),
|
|
10350
10360
|
/* @__PURE__ */ l("div", { className: "ca-new-query__actions", children: /* @__PURE__ */ l(Ee, { type: "submit", disabled: w, children: w ? "Submitting..." : "Submit Complaint" }) }),
|
|
10351
|
-
|
|
10361
|
+
h ? /* @__PURE__ */ l("p", { className: "ca-body", children: h }) : null
|
|
10352
10362
|
] }) : null
|
|
10353
10363
|
] }) });
|
|
10354
10364
|
}
|
|
@@ -10439,14 +10449,14 @@ const Hs = [], ag = ({
|
|
|
10439
10449
|
company: w,
|
|
10440
10450
|
useDemoData: C = !0,
|
|
10441
10451
|
createLabel: S,
|
|
10442
|
-
onCreateForm:
|
|
10443
|
-
onConfigure:
|
|
10452
|
+
onCreateForm: y,
|
|
10453
|
+
onConfigure: h,
|
|
10444
10454
|
onOpen: m,
|
|
10445
10455
|
onTitleClick: N,
|
|
10446
10456
|
onDescriptionClick: _,
|
|
10447
10457
|
onSearch: x,
|
|
10448
10458
|
onPublish: I,
|
|
10449
|
-
onSaveDraft:
|
|
10459
|
+
onSaveDraft: K,
|
|
10450
10460
|
showSaveButton: $,
|
|
10451
10461
|
showNextButton: b,
|
|
10452
10462
|
onStepChange: T,
|
|
@@ -10457,8 +10467,8 @@ const Hs = [], ag = ({
|
|
|
10457
10467
|
description: i,
|
|
10458
10468
|
useDemoData: C,
|
|
10459
10469
|
createLabel: S,
|
|
10460
|
-
onCreateForm:
|
|
10461
|
-
onConfigure:
|
|
10470
|
+
onCreateForm: y,
|
|
10471
|
+
onConfigure: h,
|
|
10462
10472
|
onOpen: m,
|
|
10463
10473
|
roleList: d,
|
|
10464
10474
|
userList: u,
|
|
@@ -10467,7 +10477,7 @@ const Hs = [], ag = ({
|
|
|
10467
10477
|
onTitleClick: N,
|
|
10468
10478
|
onDescriptionClick: _,
|
|
10469
10479
|
onSearch: x,
|
|
10470
|
-
onSaveDraft:
|
|
10480
|
+
onSaveDraft: K,
|
|
10471
10481
|
showSaveButton: $,
|
|
10472
10482
|
showNextButton: b
|
|
10473
10483
|
}, j = oe(
|
|
@@ -10486,14 +10496,14 @@ const Hs = [], ag = ({
|
|
|
10486
10496
|
company: w,
|
|
10487
10497
|
useDemoData: C,
|
|
10488
10498
|
createLabel: S,
|
|
10489
|
-
onCreateForm:
|
|
10490
|
-
onConfigure:
|
|
10499
|
+
onCreateForm: y,
|
|
10500
|
+
onConfigure: h,
|
|
10491
10501
|
onOpen: m,
|
|
10492
10502
|
onTitleClick: N,
|
|
10493
10503
|
onDescriptionClick: _,
|
|
10494
10504
|
onSearch: x,
|
|
10495
10505
|
onPublish: I,
|
|
10496
|
-
onSaveDraft:
|
|
10506
|
+
onSaveDraft: K,
|
|
10497
10507
|
showSaveButton: $,
|
|
10498
10508
|
showNextButton: b,
|
|
10499
10509
|
onStepChange: T
|
|
@@ -10513,14 +10523,14 @@ const Hs = [], ag = ({
|
|
|
10513
10523
|
w,
|
|
10514
10524
|
C,
|
|
10515
10525
|
S,
|
|
10516
|
-
g,
|
|
10517
10526
|
y,
|
|
10527
|
+
h,
|
|
10518
10528
|
m,
|
|
10519
10529
|
N,
|
|
10520
10530
|
_,
|
|
10521
10531
|
x,
|
|
10522
10532
|
I,
|
|
10523
|
-
|
|
10533
|
+
K,
|
|
10524
10534
|
$,
|
|
10525
10535
|
b,
|
|
10526
10536
|
T
|