@devtable/settings-form 5.7.2 → 5.8.0

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.
@@ -1,34 +1,34 @@
1
- import { Modal as se, Button as x, Box as L, SegmentedControl as qr, TextInput as I, Divider as er, Group as j, NumberInput as Lr, PasswordInput as ce, Text as oe, LoadingOverlay as Re, Table as Pe, Stack as rr, Select as Nr, Switch as Ur } from "@mantine/core";
2
- import { showNotification as M, updateNotification as z } from "@mantine/notifications";
1
+ import { Modal as se, Button as x, Box as L, SegmentedControl as qr, TextInput as j, Divider as er, Group as I, NumberInput as Lr, PasswordInput as ce, useMantineTheme as Mr, Tooltip as Nr, Text as oe, LoadingOverlay as Re, Table as Pe, Stack as rr, Select as $r, Switch as Ur } from "@mantine/core";
2
+ import { showNotification as $, updateNotification as A } from "@mantine/notifications";
3
3
  import J, { forwardRef as tr, useMemo as nr } from "react";
4
4
  import { useForm as ee, Controller as E } from "react-hook-form";
5
- import { PlaylistAdd as Ee, Trash as Ce, Edit as Mr } from "tabler-icons-react";
6
- import $r from "axios";
7
- import Wr from "crypto-js";
5
+ import { PlaylistAdd as Ee, Trash as Ce, Edit as Wr } from "tabler-icons-react";
6
+ import Vr from "axios";
7
+ import Yr from "crypto-js";
8
8
  import { useRequest as G } from "ahooks";
9
- import { useModals as le, closeAllModals as Vr } from "@mantine/modals";
10
- function Yr(t) {
9
+ import { useModals as le, closeAllModals as Kr } from "@mantine/modals";
10
+ function Br(t) {
11
11
  t = t || {};
12
- const n = Object.keys(t).sort(), s = [];
13
- for (let c = 0; c < n.length; c++) {
14
- const u = n[c];
15
- if (u != "authentication" && t[u])
16
- s.push(n[c] + "=" + (typeof t[u] == "object" ? JSON.stringify(t[u]) : t[u]));
12
+ const n = Object.keys(t).sort(), o = [];
13
+ for (let s = 0; s < n.length; s++) {
14
+ const l = n[s];
15
+ if (l != "authentication" && t[l])
16
+ o.push(n[s] + "=" + (typeof t[l] == "object" ? JSON.stringify(t[l]) : t[l]));
17
17
  else {
18
- const i = Object.keys(t[u]).sort();
19
- for (let l = 0; l < i.length; l++) {
20
- const d = i[l];
21
- d != "sign" && t[u][d] && s.push(
22
- i[l] + "=" + (typeof t[u][d] == "object" ? JSON.stringify(t[u][d]) : t[u][d])
18
+ const i = Object.keys(t[l]).sort();
19
+ for (let u = 0; u < i.length; u++) {
20
+ const d = i[u];
21
+ d != "sign" && t[l][d] && o.push(
22
+ i[u] + "=" + (typeof t[l][d] == "object" ? JSON.stringify(t[l][d]) : t[l][d])
23
23
  );
24
24
  }
25
25
  }
26
26
  }
27
- return s.sort().join("&");
27
+ return o.sort().join("&");
28
28
  }
29
- function Kr(t, n) {
30
- let s = Yr(t);
31
- return s += "&key=" + n, Wr.MD5(s).toString().toUpperCase();
29
+ function Gr(t, n) {
30
+ let o = Br(t);
31
+ return o += "&key=" + n, Yr.MD5(o).toString().toUpperCase();
32
32
  }
33
33
  const C = {
34
34
  baseURL: "http://localhost:31200",
@@ -41,7 +41,7 @@ const C = {
41
41
  return {
42
42
  app_id: this.app_id,
43
43
  nonce_str: n,
44
- sign: Kr(
44
+ sign: Gr(
45
45
  {
46
46
  app_id: this.app_id,
47
47
  nonce_str: n,
@@ -52,33 +52,33 @@ const C = {
52
52
  };
53
53
  },
54
54
  getRequest(t) {
55
- return (n, s, c = {}) => {
56
- const u = window.localStorage.getItem("token"), i = {
55
+ return (n, o, s = {}) => {
56
+ const l = window.localStorage.getItem("token"), i = {
57
57
  "X-Requested-With": "XMLHttpRequest",
58
- "Content-Type": c.string ? "application/x-www-form-urlencoded" : "application/json",
59
- authorization: u ? `bearer ${u}` : "",
60
- ...c.headers
61
- }, l = {
58
+ "Content-Type": s.string ? "application/x-www-form-urlencoded" : "application/json",
59
+ authorization: l ? `bearer ${l}` : "",
60
+ ...s.headers
61
+ }, u = {
62
62
  baseURL: this.baseURL,
63
63
  method: t,
64
64
  url: n,
65
- params: t === "GET" ? s : c.params,
65
+ params: t === "GET" ? o : s.params,
66
66
  headers: i
67
67
  };
68
- return ["POST", "PUT"].includes(t) && (l.data = c.string ? JSON.stringify(s) : s, l.data.authentication = this.getAuthentication(l.data)), $r(l).then((d) => d.data).catch((d) => Promise.reject(d));
68
+ return ["POST", "PUT"].includes(t) && (u.data = s.string ? JSON.stringify(o) : o, u.data.authentication = this.getAuthentication(u.data)), Vr(u).then((d) => d.data).catch((d) => Promise.reject(d));
69
69
  };
70
70
  }
71
71
  };
72
72
  function ue(t) {
73
73
  C.baseURL !== t.apiBaseURL && (C.baseURL = t.apiBaseURL), t.app_id && (C.app_id = t.app_id), t.app_secret && (C.app_secret = t.app_secret);
74
74
  }
75
- const Br = {
75
+ const Jr = {
76
76
  login: async (t, n) => {
77
- const s = {
77
+ const o = {
78
78
  name: t,
79
79
  password: n
80
80
  };
81
- return await C.getRequest("POST")("/account/login", s);
81
+ return await C.getRequest("POST")("/account/login", o);
82
82
  },
83
83
  list: async () => await C.getRequest("POST")("/account/list", {
84
84
  filter: {
@@ -95,31 +95,31 @@ const Br = {
95
95
  }),
96
96
  get: async () => await C.getRequest("GET")("/account/get", {}),
97
97
  update: async (t, n) => {
98
- const s = {
98
+ const o = {
99
99
  name: t,
100
100
  email: n
101
101
  };
102
- return await C.getRequest("PUT")("/account/update", s);
102
+ return await C.getRequest("PUT")("/account/update", o);
103
103
  },
104
104
  changepassword: async (t, n) => {
105
- const s = {
105
+ const o = {
106
106
  old_password: t,
107
107
  new_password: n
108
108
  };
109
- return await C.getRequest("POST")("/account/changepassword", s);
109
+ return await C.getRequest("POST")("/account/changepassword", o);
110
110
  },
111
- create: async (t, n, s, c) => await C.getRequest("POST")("/account/create", {
111
+ create: async (t, n, o, s) => await C.getRequest("POST")("/account/create", {
112
112
  name: t,
113
113
  email: n,
114
- password: s,
115
- role_id: c
114
+ password: o,
115
+ role_id: s
116
116
  }),
117
117
  edit: async (t) => (t.reset_password || (t.new_password = void 0), await C.getRequest("PUT")("/account/edit", t)),
118
118
  delete: async (t) => {
119
119
  if (!!t)
120
120
  return C.getRequest("POST")("/account/delete", { id: t });
121
121
  }
122
- }, Gr = {
122
+ }, Hr = {
123
123
  list: async () => await C.getRequest("POST")("/api/key/list", {
124
124
  filter: {
125
125
  search: ""
@@ -141,7 +141,7 @@ const Br = {
141
141
  if (!!t)
142
142
  return C.getRequest("POST")("/api/key/delete", { id: t });
143
143
  }
144
- }, Jr = {
144
+ }, Xr = {
145
145
  list: async () => await C.getRequest("POST")("/datasource/list", {
146
146
  filter: {},
147
147
  sort: {
@@ -153,23 +153,23 @@ const Br = {
153
153
  pagesize: 100
154
154
  }
155
155
  }),
156
- create: async (t, n, s) => {
156
+ create: async (t, n, o) => {
157
157
  try {
158
- return await C.getRequest("POST")("/datasource/create", { type: t, key: n, config: s });
159
- } catch (c) {
160
- return console.error(c), !1;
158
+ return await C.getRequest("POST")("/datasource/create", { type: t, key: n, config: o });
159
+ } catch (s) {
160
+ return console.error(s), !1;
161
161
  }
162
162
  },
163
163
  delete: async (t) => {
164
164
  await C.getRequest("POST")("/datasource/delete", { id: t });
165
165
  }
166
- }, Hr = {
166
+ }, Qr = {
167
167
  list: async () => await C.getRequest("GET")("/role/list", {})
168
- }, D = {
169
- datasource: Jr,
170
- account: Br,
171
- role: Hr,
172
- api_key: Gr
168
+ }, k = {
169
+ datasource: Xr,
170
+ account: Jr,
171
+ role: Qr,
172
+ api_key: Hr
173
173
  }, de = {
174
174
  size: "sm",
175
175
  spacing: "md",
@@ -188,22 +188,22 @@ var fe = { exports: {} }, Q = {};
188
188
  * LICENSE file in the root directory of this source tree.
189
189
  */
190
190
  var Qe;
191
- function Xr() {
191
+ function Zr() {
192
192
  if (Qe)
193
193
  return Q;
194
194
  Qe = 1;
195
- var t = J, n = Symbol.for("react.element"), s = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
196
- function l(d, h, y) {
195
+ var t = J, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, l = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
196
+ function u(d, g, y) {
197
197
  var _, v = {}, f = null, O = null;
198
- y !== void 0 && (f = "" + y), h.key !== void 0 && (f = "" + h.key), h.ref !== void 0 && (O = h.ref);
199
- for (_ in h)
200
- c.call(h, _) && !i.hasOwnProperty(_) && (v[_] = h[_]);
198
+ y !== void 0 && (f = "" + y), g.key !== void 0 && (f = "" + g.key), g.ref !== void 0 && (O = g.ref);
199
+ for (_ in g)
200
+ s.call(g, _) && !i.hasOwnProperty(_) && (v[_] = g[_]);
201
201
  if (d && d.defaultProps)
202
- for (_ in h = d.defaultProps, h)
203
- v[_] === void 0 && (v[_] = h[_]);
204
- return { $$typeof: n, type: d, key: f, ref: O, props: v, _owner: u.current };
202
+ for (_ in g = d.defaultProps, g)
203
+ v[_] === void 0 && (v[_] = g[_]);
204
+ return { $$typeof: n, type: d, key: f, ref: O, props: v, _owner: l.current };
205
205
  }
206
- return Q.Fragment = s, Q.jsx = l, Q.jsxs = l, Q;
206
+ return Q.Fragment = o, Q.jsx = u, Q.jsxs = u, Q;
207
207
  }
208
208
  var Z = {};
209
209
  /**
@@ -216,46 +216,46 @@ var Z = {};
216
216
  * LICENSE file in the root directory of this source tree.
217
217
  */
218
218
  var Ze;
219
- function Qr() {
219
+ function et() {
220
220
  return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
221
- var t = J, n = Symbol.for("react.element"), s = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), d = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), N = Symbol.iterator, V = "@@iterator";
221
+ var t = J, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), M = Symbol.iterator, V = "@@iterator";
222
222
  function ge(e) {
223
223
  if (e === null || typeof e != "object")
224
224
  return null;
225
- var a = N && e[N] || e[V];
225
+ var a = M && e[M] || e[V];
226
226
  return typeof a == "function" ? a : null;
227
227
  }
228
- var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
228
+ var N = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
229
229
  function T(e) {
230
230
  {
231
- for (var a = arguments.length, o = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++)
232
- o[p - 1] = arguments[p];
233
- ar("error", e, o);
231
+ for (var a = arguments.length, c = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++)
232
+ c[p - 1] = arguments[p];
233
+ ar("error", e, c);
234
234
  }
235
235
  }
236
- function ar(e, a, o) {
236
+ function ar(e, a, c) {
237
237
  {
238
- var p = U.ReactDebugCurrentFrame, b = p.getStackAddendum();
239
- b !== "" && (a += "%s", o = o.concat([b]));
240
- var S = o.map(function(m) {
238
+ var p = N.ReactDebugCurrentFrame, b = p.getStackAddendum();
239
+ b !== "" && (a += "%s", c = c.concat([b]));
240
+ var S = c.map(function(m) {
241
241
  return String(m);
242
242
  });
243
243
  S.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, S);
244
244
  }
245
245
  }
246
- var ir = !1, or = !1, sr = !1, cr = !1, lr = !1, Ae;
247
- Ae = Symbol.for("react.module.reference");
246
+ var ir = !1, or = !1, sr = !1, cr = !1, lr = !1, ze;
247
+ ze = Symbol.for("react.module.reference");
248
248
  function ur(e) {
249
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === i || lr || e === u || e === y || e === _ || cr || e === O || ir || or || sr || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === v || e.$$typeof === l || e.$$typeof === d || e.$$typeof === h || e.$$typeof === Ae || e.getModuleId !== void 0));
249
+ return !!(typeof e == "string" || typeof e == "function" || e === s || e === i || lr || e === l || e === y || e === _ || cr || e === O || ir || or || sr || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === v || e.$$typeof === u || e.$$typeof === d || e.$$typeof === g || e.$$typeof === ze || e.getModuleId !== void 0));
250
250
  }
251
- function dr(e, a, o) {
251
+ function dr(e, a, c) {
252
252
  var p = e.displayName;
253
253
  if (p)
254
254
  return p;
255
255
  var b = a.displayName || a.name || "";
256
- return b !== "" ? o + "(" + b + ")" : o;
256
+ return b !== "" ? c + "(" + b + ")" : c;
257
257
  }
258
- function ze(e) {
258
+ function Ae(e) {
259
259
  return e.displayName || "Context";
260
260
  }
261
261
  function F(e) {
@@ -266,13 +266,13 @@ function Qr() {
266
266
  if (typeof e == "string")
267
267
  return e;
268
268
  switch (e) {
269
- case c:
270
- return "Fragment";
271
269
  case s:
270
+ return "Fragment";
271
+ case o:
272
272
  return "Portal";
273
273
  case i:
274
274
  return "Profiler";
275
- case u:
275
+ case l:
276
276
  return "StrictMode";
277
277
  case y:
278
278
  return "Suspense";
@@ -283,11 +283,11 @@ function Qr() {
283
283
  switch (e.$$typeof) {
284
284
  case d:
285
285
  var a = e;
286
- return ze(a) + ".Consumer";
287
- case l:
288
- var o = e;
289
- return ze(o._context) + ".Provider";
290
- case h:
286
+ return Ae(a) + ".Consumer";
287
+ case u:
288
+ var c = e;
289
+ return Ae(c._context) + ".Provider";
290
+ case g:
291
291
  return dr(e, e.render, "ForwardRef");
292
292
  case v:
293
293
  var p = e.displayName || null;
@@ -303,14 +303,14 @@ function Qr() {
303
303
  }
304
304
  return null;
305
305
  }
306
- var Y = Object.assign, H = 0, Oe, De, xe, ke, Ie, je, Fe;
306
+ var Y = Object.assign, H = 0, Oe, ke, xe, De, je, Ie, Fe;
307
307
  function qe() {
308
308
  }
309
309
  qe.__reactDisabledLog = !0;
310
310
  function fr() {
311
311
  {
312
312
  if (H === 0) {
313
- Oe = console.log, De = console.info, xe = console.warn, ke = console.error, Ie = console.group, je = console.groupCollapsed, Fe = console.groupEnd;
313
+ Oe = console.log, ke = console.info, xe = console.warn, De = console.error, je = console.group, Ie = console.groupCollapsed, Fe = console.groupEnd;
314
314
  var e = {
315
315
  configurable: !0,
316
316
  enumerable: !0,
@@ -343,19 +343,19 @@ function Qr() {
343
343
  value: Oe
344
344
  }),
345
345
  info: Y({}, e, {
346
- value: De
346
+ value: ke
347
347
  }),
348
348
  warn: Y({}, e, {
349
349
  value: xe
350
350
  }),
351
351
  error: Y({}, e, {
352
- value: ke
352
+ value: De
353
353
  }),
354
354
  group: Y({}, e, {
355
- value: Ie
355
+ value: je
356
356
  }),
357
357
  groupCollapsed: Y({}, e, {
358
- value: je
358
+ value: Ie
359
359
  }),
360
360
  groupEnd: Y({}, e, {
361
361
  value: Fe
@@ -365,18 +365,18 @@ function Qr() {
365
365
  H < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
366
366
  }
367
367
  }
368
- var me = U.ReactCurrentDispatcher, he;
369
- function re(e, a, o) {
368
+ var he = N.ReactCurrentDispatcher, me;
369
+ function re(e, a, c) {
370
370
  {
371
- if (he === void 0)
371
+ if (me === void 0)
372
372
  try {
373
373
  throw Error();
374
374
  } catch (b) {
375
375
  var p = b.stack.trim().match(/\n( *(at )?)/);
376
- he = p && p[1] || "";
376
+ me = p && p[1] || "";
377
377
  }
378
378
  return `
379
- ` + he + e;
379
+ ` + me + e;
380
380
  }
381
381
  }
382
382
  var ve = !1, te;
@@ -388,16 +388,16 @@ function Qr() {
388
388
  if (!e || ve)
389
389
  return "";
390
390
  {
391
- var o = te.get(e);
392
- if (o !== void 0)
393
- return o;
391
+ var c = te.get(e);
392
+ if (c !== void 0)
393
+ return c;
394
394
  }
395
395
  var p;
396
396
  ve = !0;
397
397
  var b = Error.prepareStackTrace;
398
398
  Error.prepareStackTrace = void 0;
399
399
  var S;
400
- S = me.current, me.current = null, fr();
400
+ S = he.current, he.current = null, fr();
401
401
  try {
402
402
  if (a) {
403
403
  var m = function() {
@@ -432,41 +432,41 @@ function Qr() {
432
432
  }
433
433
  } catch (q) {
434
434
  if (q && p && typeof q.stack == "string") {
435
- for (var g = q.stack.split(`
436
- `), A = p.stack.split(`
437
- `), R = g.length - 1, P = A.length - 1; R >= 1 && P >= 0 && g[R] !== A[P]; )
435
+ for (var h = q.stack.split(`
436
+ `), z = p.stack.split(`
437
+ `), R = h.length - 1, P = z.length - 1; R >= 1 && P >= 0 && h[R] !== z[P]; )
438
438
  P--;
439
439
  for (; R >= 1 && P >= 0; R--, P--)
440
- if (g[R] !== A[P]) {
440
+ if (h[R] !== z[P]) {
441
441
  if (R !== 1 || P !== 1)
442
442
  do
443
- if (R--, P--, P < 0 || g[R] !== A[P]) {
444
- var k = `
445
- ` + g[R].replace(" at new ", " at ");
446
- return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, k), k;
443
+ if (R--, P--, P < 0 || h[R] !== z[P]) {
444
+ var D = `
445
+ ` + h[R].replace(" at new ", " at ");
446
+ return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, D), D;
447
447
  }
448
448
  while (R >= 1 && P >= 0);
449
449
  break;
450
450
  }
451
451
  }
452
452
  } finally {
453
- ve = !1, me.current = S, pr(), Error.prepareStackTrace = b;
453
+ ve = !1, he.current = S, pr(), Error.prepareStackTrace = b;
454
454
  }
455
455
  var B = e ? e.displayName || e.name : "", Xe = B ? re(B) : "";
456
456
  return typeof e == "function" && te.set(e, Xe), Xe;
457
457
  }
458
- function mr(e, a, o) {
458
+ function hr(e, a, c) {
459
459
  return Le(e, !1);
460
460
  }
461
- function hr(e) {
461
+ function mr(e) {
462
462
  var a = e.prototype;
463
463
  return !!(a && a.isReactComponent);
464
464
  }
465
- function ne(e, a, o) {
465
+ function ne(e, a, c) {
466
466
  if (e == null)
467
467
  return "";
468
468
  if (typeof e == "function")
469
- return Le(e, hr(e));
469
+ return Le(e, mr(e));
470
470
  if (typeof e == "string")
471
471
  return re(e);
472
472
  switch (e) {
@@ -477,44 +477,44 @@ function Qr() {
477
477
  }
478
478
  if (typeof e == "object")
479
479
  switch (e.$$typeof) {
480
- case h:
481
- return mr(e.render);
480
+ case g:
481
+ return hr(e.render);
482
482
  case v:
483
- return ne(e.type, a, o);
483
+ return ne(e.type, a, c);
484
484
  case f: {
485
485
  var p = e, b = p._payload, S = p._init;
486
486
  try {
487
- return ne(S(b), a, o);
487
+ return ne(S(b), a, c);
488
488
  } catch {
489
489
  }
490
490
  }
491
491
  }
492
492
  return "";
493
493
  }
494
- var ae = Object.prototype.hasOwnProperty, Ne = {}, Ue = U.ReactDebugCurrentFrame;
494
+ var ae = Object.prototype.hasOwnProperty, Me = {}, Ne = N.ReactDebugCurrentFrame;
495
495
  function ie(e) {
496
496
  if (e) {
497
- var a = e._owner, o = ne(e.type, e._source, a ? a.type : null);
498
- Ue.setExtraStackFrame(o);
497
+ var a = e._owner, c = ne(e.type, e._source, a ? a.type : null);
498
+ Ne.setExtraStackFrame(c);
499
499
  } else
500
- Ue.setExtraStackFrame(null);
500
+ Ne.setExtraStackFrame(null);
501
501
  }
502
- function vr(e, a, o, p, b) {
502
+ function vr(e, a, c, p, b) {
503
503
  {
504
504
  var S = Function.call.bind(ae);
505
505
  for (var m in e)
506
506
  if (S(e, m)) {
507
- var g = void 0;
507
+ var h = void 0;
508
508
  try {
509
509
  if (typeof e[m] != "function") {
510
- var A = Error((p || "React class") + ": " + o + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
511
- throw A.name = "Invariant Violation", A;
510
+ var z = Error((p || "React class") + ": " + c + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
511
+ throw z.name = "Invariant Violation", z;
512
512
  }
513
- g = e[m](a, m, p, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
513
+ h = e[m](a, m, p, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
514
514
  } catch (R) {
515
- g = R;
515
+ h = R;
516
516
  }
517
- g && !(g instanceof Error) && (ie(b), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", o, m, typeof g), ie(null)), g instanceof Error && !(g.message in Ne) && (Ne[g.message] = !0, ie(b), T("Failed %s type: %s", o, g.message), ie(null));
517
+ h && !(h instanceof Error) && (ie(b), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", c, m, typeof h), ie(null)), h instanceof Error && !(h.message in Me) && (Me[h.message] = !0, ie(b), T("Failed %s type: %s", c, h.message), ie(null));
518
518
  }
519
519
  }
520
520
  }
@@ -524,25 +524,25 @@ function Qr() {
524
524
  }
525
525
  function wr(e) {
526
526
  {
527
- var a = typeof Symbol == "function" && Symbol.toStringTag, o = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
528
- return o;
527
+ var a = typeof Symbol == "function" && Symbol.toStringTag, c = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
528
+ return c;
529
529
  }
530
530
  }
531
531
  function Sr(e) {
532
532
  try {
533
- return Me(e), !1;
533
+ return $e(e), !1;
534
534
  } catch {
535
535
  return !0;
536
536
  }
537
537
  }
538
- function Me(e) {
538
+ function $e(e) {
539
539
  return "" + e;
540
540
  }
541
- function $e(e) {
541
+ function Ue(e) {
542
542
  if (Sr(e))
543
- return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wr(e)), Me(e);
543
+ return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wr(e)), $e(e);
544
544
  }
545
- var X = U.ReactCurrentOwner, _r = {
545
+ var X = N.ReactCurrentOwner, _r = {
546
546
  key: !0,
547
547
  ref: !0,
548
548
  __self: !0,
@@ -567,62 +567,62 @@ function Qr() {
567
567
  }
568
568
  function Pr(e, a) {
569
569
  if (typeof e.ref == "string" && X.current && a && X.current.stateNode !== a) {
570
- var o = F(X.current.type);
571
- we[o] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(X.current.type), e.ref), we[o] = !0);
570
+ var c = F(X.current.type);
571
+ we[c] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(X.current.type), e.ref), we[c] = !0);
572
572
  }
573
573
  }
574
574
  function Er(e, a) {
575
575
  {
576
- var o = function() {
576
+ var c = function() {
577
577
  We || (We = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
578
578
  };
579
- o.isReactWarning = !0, Object.defineProperty(e, "key", {
580
- get: o,
579
+ c.isReactWarning = !0, Object.defineProperty(e, "key", {
580
+ get: c,
581
581
  configurable: !0
582
582
  });
583
583
  }
584
584
  }
585
585
  function Cr(e, a) {
586
586
  {
587
- var o = function() {
587
+ var c = function() {
588
588
  Ve || (Ve = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
589
589
  };
590
- o.isReactWarning = !0, Object.defineProperty(e, "ref", {
591
- get: o,
590
+ c.isReactWarning = !0, Object.defineProperty(e, "ref", {
591
+ get: c,
592
592
  configurable: !0
593
593
  });
594
594
  }
595
595
  }
596
- var Tr = function(e, a, o, p, b, S, m) {
597
- var g = {
596
+ var Tr = function(e, a, c, p, b, S, m) {
597
+ var h = {
598
598
  $$typeof: n,
599
599
  type: e,
600
600
  key: a,
601
- ref: o,
601
+ ref: c,
602
602
  props: m,
603
603
  _owner: S
604
604
  };
605
- return g._store = {}, Object.defineProperty(g._store, "validated", {
605
+ return h._store = {}, Object.defineProperty(h._store, "validated", {
606
606
  configurable: !1,
607
607
  enumerable: !1,
608
608
  writable: !0,
609
609
  value: !1
610
- }), Object.defineProperty(g, "_self", {
610
+ }), Object.defineProperty(h, "_self", {
611
611
  configurable: !1,
612
612
  enumerable: !1,
613
613
  writable: !1,
614
614
  value: p
615
- }), Object.defineProperty(g, "_source", {
615
+ }), Object.defineProperty(h, "_source", {
616
616
  configurable: !1,
617
617
  enumerable: !1,
618
618
  writable: !1,
619
619
  value: b
620
- }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
620
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
621
621
  };
622
- function Ar(e, a, o, p, b) {
622
+ function zr(e, a, c, p, b) {
623
623
  {
624
- var S, m = {}, g = null, A = null;
625
- o !== void 0 && ($e(o), g = "" + o), Rr(a) && ($e(a.key), g = "" + a.key), yr(a) && (A = a.ref, Pr(a, b));
624
+ var S, m = {}, h = null, z = null;
625
+ c !== void 0 && (Ue(c), h = "" + c), Rr(a) && (Ue(a.key), h = "" + a.key), yr(a) && (z = a.ref, Pr(a, b));
626
626
  for (S in a)
627
627
  ae.call(a, S) && !_r.hasOwnProperty(S) && (m[S] = a[S]);
628
628
  if (e && e.defaultProps) {
@@ -630,18 +630,18 @@ function Qr() {
630
630
  for (S in R)
631
631
  m[S] === void 0 && (m[S] = R[S]);
632
632
  }
633
- if (g || A) {
633
+ if (h || z) {
634
634
  var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
635
- g && Er(m, P), A && Cr(m, P);
635
+ h && Er(m, P), z && Cr(m, P);
636
636
  }
637
- return Tr(e, g, A, b, p, X.current, m);
637
+ return Tr(e, h, z, b, p, X.current, m);
638
638
  }
639
639
  }
640
- var Se = U.ReactCurrentOwner, Ye = U.ReactDebugCurrentFrame;
640
+ var Se = N.ReactCurrentOwner, Ye = N.ReactDebugCurrentFrame;
641
641
  function K(e) {
642
642
  if (e) {
643
- var a = e._owner, o = ne(e.type, e._source, a ? a.type : null);
644
- Ye.setExtraStackFrame(o);
643
+ var a = e._owner, c = ne(e.type, e._source, a ? a.type : null);
644
+ Ye.setExtraStackFrame(c);
645
645
  } else
646
646
  Ye.setExtraStackFrame(null);
647
647
  }
@@ -662,13 +662,13 @@ Check the render method of \`` + e + "`.";
662
662
  return "";
663
663
  }
664
664
  }
665
- function zr(e) {
665
+ function Ar(e) {
666
666
  {
667
667
  if (e !== void 0) {
668
- var a = e.fileName.replace(/^.*[\\\/]/, ""), o = e.lineNumber;
668
+ var a = e.fileName.replace(/^.*[\\\/]/, ""), c = e.lineNumber;
669
669
  return `
670
670
 
671
- Check your code at ` + a + ":" + o + ".";
671
+ Check your code at ` + a + ":" + c + ".";
672
672
  }
673
673
  return "";
674
674
  }
@@ -678,10 +678,10 @@ Check your code at ` + a + ":" + o + ".";
678
678
  {
679
679
  var a = Ke();
680
680
  if (!a) {
681
- var o = typeof e == "string" ? e : e.displayName || e.name;
682
- o && (a = `
681
+ var c = typeof e == "string" ? e : e.displayName || e.name;
682
+ c && (a = `
683
683
 
684
- Check the top-level render call using <` + o + ">.");
684
+ Check the top-level render call using <` + c + ">.");
685
685
  }
686
686
  return a;
687
687
  }
@@ -691,12 +691,12 @@ Check the top-level render call using <` + o + ">.");
691
691
  if (!e._store || e._store.validated || e.key != null)
692
692
  return;
693
693
  e._store.validated = !0;
694
- var o = Or(a);
695
- if (Be[o])
694
+ var c = Or(a);
695
+ if (Be[c])
696
696
  return;
697
- Be[o] = !0;
697
+ Be[c] = !0;
698
698
  var p = "";
699
- e && e._owner && e._owner !== Se.current && (p = " It was passed a child from " + F(e._owner.type) + "."), K(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, p), K(null);
699
+ e && e._owner && e._owner !== Se.current && (p = " It was passed a child from " + F(e._owner.type) + "."), K(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, p), K(null);
700
700
  }
701
701
  }
702
702
  function Je(e, a) {
@@ -704,8 +704,8 @@ Check the top-level render call using <` + o + ">.");
704
704
  if (typeof e != "object")
705
705
  return;
706
706
  if (be(e))
707
- for (var o = 0; o < e.length; o++) {
708
- var p = e[o];
707
+ for (var c = 0; c < e.length; c++) {
708
+ var p = e[c];
709
709
  ye(p) && Ge(p, a);
710
710
  }
711
711
  else if (ye(e))
@@ -718,21 +718,21 @@ Check the top-level render call using <` + o + ">.");
718
718
  }
719
719
  }
720
720
  }
721
- function Dr(e) {
721
+ function kr(e) {
722
722
  {
723
723
  var a = e.type;
724
724
  if (a == null || typeof a == "string")
725
725
  return;
726
- var o;
726
+ var c;
727
727
  if (typeof a == "function")
728
- o = a.propTypes;
729
- else if (typeof a == "object" && (a.$$typeof === h || a.$$typeof === v))
730
- o = a.propTypes;
728
+ c = a.propTypes;
729
+ else if (typeof a == "object" && (a.$$typeof === g || a.$$typeof === v))
730
+ c = a.propTypes;
731
731
  else
732
732
  return;
733
- if (o) {
733
+ if (c) {
734
734
  var p = F(a);
735
- vr(o, e.props, "prop", p, e);
735
+ vr(c, e.props, "prop", p, e);
736
736
  } else if (a.PropTypes !== void 0 && !_e) {
737
737
  _e = !0;
738
738
  var b = F(a);
@@ -743,8 +743,8 @@ Check the top-level render call using <` + o + ">.");
743
743
  }
744
744
  function xr(e) {
745
745
  {
746
- for (var a = Object.keys(e.props), o = 0; o < a.length; o++) {
747
- var p = a[o];
746
+ for (var a = Object.keys(e.props), c = 0; c < a.length; c++) {
747
+ var p = a[c];
748
748
  if (p !== "children" && p !== "key") {
749
749
  K(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), K(null);
750
750
  break;
@@ -753,57 +753,57 @@ Check the top-level render call using <` + o + ">.");
753
753
  e.ref !== null && (K(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
754
754
  }
755
755
  }
756
- function He(e, a, o, p, b, S) {
756
+ function He(e, a, c, p, b, S) {
757
757
  {
758
758
  var m = ur(e);
759
759
  if (!m) {
760
- var g = "";
761
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
762
- var A = zr(b);
763
- A ? g += A : g += Ke();
760
+ var h = "";
761
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
762
+ var z = Ar(b);
763
+ z ? h += z : h += Ke();
764
764
  var R;
765
- e === null ? R = "null" : be(e) ? R = "array" : e !== void 0 && e.$$typeof === n ? (R = "<" + (F(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, g);
765
+ e === null ? R = "null" : be(e) ? R = "array" : e !== void 0 && e.$$typeof === n ? (R = "<" + (F(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, h);
766
766
  }
767
- var P = Ar(e, a, o, b, S);
767
+ var P = zr(e, a, c, b, S);
768
768
  if (P == null)
769
769
  return P;
770
770
  if (m) {
771
- var k = a.children;
772
- if (k !== void 0)
771
+ var D = a.children;
772
+ if (D !== void 0)
773
773
  if (p)
774
- if (be(k)) {
775
- for (var B = 0; B < k.length; B++)
776
- Je(k[B], e);
777
- Object.freeze && Object.freeze(k);
774
+ if (be(D)) {
775
+ for (var B = 0; B < D.length; B++)
776
+ Je(D[B], e);
777
+ Object.freeze && Object.freeze(D);
778
778
  } else
779
779
  T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
780
780
  else
781
- Je(k, e);
781
+ Je(D, e);
782
782
  }
783
- return e === c ? xr(P) : Dr(P), P;
783
+ return e === s ? xr(P) : kr(P), P;
784
784
  }
785
785
  }
786
- function kr(e, a, o) {
787
- return He(e, a, o, !0);
786
+ function Dr(e, a, c) {
787
+ return He(e, a, c, !0);
788
788
  }
789
- function Ir(e, a, o) {
790
- return He(e, a, o, !1);
789
+ function jr(e, a, c) {
790
+ return He(e, a, c, !1);
791
791
  }
792
- var jr = Ir, Fr = kr;
793
- Z.Fragment = c, Z.jsx = jr, Z.jsxs = Fr;
792
+ var Ir = jr, Fr = Dr;
793
+ Z.Fragment = s, Z.jsx = Ir, Z.jsxs = Fr;
794
794
  }()), Z;
795
795
  }
796
796
  (function(t) {
797
- process.env.NODE_ENV === "production" ? t.exports = Xr() : t.exports = Qr();
797
+ process.env.NODE_ENV === "production" ? t.exports = Zr() : t.exports = et();
798
798
  })(fe);
799
- const $ = fe.exports.Fragment, r = fe.exports.jsx, w = fe.exports.jsxs;
800
- function Zr({
799
+ const U = fe.exports.Fragment, r = fe.exports.jsx, w = fe.exports.jsxs;
800
+ function rt({
801
801
  postSubmit: t,
802
802
  styles: n = de
803
803
  }) {
804
804
  const {
805
- control: s,
806
- handleSubmit: c
805
+ control: o,
806
+ handleSubmit: s
807
807
  } = ee({
808
808
  defaultValues: {
809
809
  type: "postgresql",
@@ -820,18 +820,18 @@ function Zr({
820
820
  return /* @__PURE__ */ r(L, {
821
821
  mx: "auto",
822
822
  children: /* @__PURE__ */ w("form", {
823
- onSubmit: c(async ({
823
+ onSubmit: s(async ({
824
824
  type: i,
825
- key: l,
825
+ key: u,
826
826
  config: d
827
827
  }) => {
828
- if (M({
828
+ if ($({
829
829
  id: "for-creating",
830
830
  title: "Pending",
831
831
  message: "Adding data source...",
832
832
  loading: !0
833
- }), !await D.datasource.create(i, l, d)) {
834
- z({
833
+ }), !await k.datasource.create(i, u, d)) {
834
+ A({
835
835
  id: "for-creating",
836
836
  title: "Failed",
837
837
  message: "Test connection failed with given info",
@@ -839,7 +839,7 @@ function Zr({
839
839
  });
840
840
  return;
841
841
  }
842
- z({
842
+ A({
843
843
  id: "for-creating",
844
844
  title: "Successful",
845
845
  message: "Data source is added",
@@ -848,7 +848,7 @@ function Zr({
848
848
  }),
849
849
  children: [/* @__PURE__ */ r(E, {
850
850
  name: "type",
851
- control: s,
851
+ control: o,
852
852
  render: ({
853
853
  field: i
854
854
  }) => /* @__PURE__ */ r(qr, {
@@ -870,10 +870,10 @@ function Zr({
870
870
  })
871
871
  }), /* @__PURE__ */ r(E, {
872
872
  name: "key",
873
- control: s,
873
+ control: o,
874
874
  render: ({
875
875
  field: i
876
- }) => /* @__PURE__ */ r(I, {
876
+ }) => /* @__PURE__ */ r(j, {
877
877
  mb: n.spacing,
878
878
  size: n.size,
879
879
  required: !0,
@@ -884,14 +884,14 @@ function Zr({
884
884
  }), /* @__PURE__ */ r(er, {
885
885
  label: "Connection Info",
886
886
  labelPosition: "center"
887
- }), /* @__PURE__ */ w(j, {
887
+ }), /* @__PURE__ */ w(I, {
888
888
  grow: !0,
889
889
  children: [/* @__PURE__ */ r(E, {
890
890
  name: "config.host",
891
- control: s,
891
+ control: o,
892
892
  render: ({
893
893
  field: i
894
- }) => /* @__PURE__ */ r(I, {
894
+ }) => /* @__PURE__ */ r(j, {
895
895
  mb: n.spacing,
896
896
  size: n.size,
897
897
  required: !0,
@@ -903,7 +903,7 @@ function Zr({
903
903
  })
904
904
  }), /* @__PURE__ */ r(E, {
905
905
  name: "config.port",
906
- control: s,
906
+ control: o,
907
907
  render: ({
908
908
  field: i
909
909
  }) => /* @__PURE__ */ r(Lr, {
@@ -920,10 +920,10 @@ function Zr({
920
920
  })]
921
921
  }), /* @__PURE__ */ r(E, {
922
922
  name: "config.username",
923
- control: s,
923
+ control: o,
924
924
  render: ({
925
925
  field: i
926
- }) => /* @__PURE__ */ r(I, {
926
+ }) => /* @__PURE__ */ r(j, {
927
927
  mb: n.spacing,
928
928
  size: n.size,
929
929
  required: !0,
@@ -932,7 +932,7 @@ function Zr({
932
932
  })
933
933
  }), /* @__PURE__ */ r(E, {
934
934
  name: "config.password",
935
- control: s,
935
+ control: o,
936
936
  render: ({
937
937
  field: i
938
938
  }) => /* @__PURE__ */ r(ce, {
@@ -944,17 +944,17 @@ function Zr({
944
944
  })
945
945
  }), /* @__PURE__ */ r(E, {
946
946
  name: "config.database",
947
- control: s,
947
+ control: o,
948
948
  render: ({
949
949
  field: i
950
- }) => /* @__PURE__ */ r(I, {
950
+ }) => /* @__PURE__ */ r(j, {
951
951
  mb: n.spacing,
952
952
  size: n.size,
953
953
  required: !0,
954
954
  label: "Database",
955
955
  ...i
956
956
  })
957
- }), /* @__PURE__ */ r(j, {
957
+ }), /* @__PURE__ */ r(I, {
958
958
  position: "right",
959
959
  mt: n.spacing,
960
960
  children: /* @__PURE__ */ r(x, {
@@ -966,22 +966,22 @@ function Zr({
966
966
  })
967
967
  });
968
968
  }
969
- function et({
969
+ function tt({
970
970
  onSuccess: t,
971
971
  styles: n = de
972
972
  }) {
973
- const [s, c] = J.useState(!1), u = () => c(!0), i = () => c(!1);
974
- return /* @__PURE__ */ w($, {
973
+ const [o, s] = J.useState(!1), l = () => s(!0), i = () => s(!1);
974
+ return /* @__PURE__ */ w(U, {
975
975
  children: [/* @__PURE__ */ r(se, {
976
976
  overflow: "inside",
977
- opened: s,
978
- onClose: () => c(!1),
977
+ opened: o,
978
+ onClose: () => s(!1),
979
979
  title: "Add a data source",
980
980
  trapFocus: !0,
981
981
  onDragStart: (d) => {
982
982
  d.stopPropagation();
983
983
  },
984
- children: /* @__PURE__ */ r(Zr, {
984
+ children: /* @__PURE__ */ r(rt, {
985
985
  postSubmit: () => {
986
986
  t(), i();
987
987
  },
@@ -989,7 +989,7 @@ function et({
989
989
  })
990
990
  }), /* @__PURE__ */ r(x, {
991
991
  size: n.button.size,
992
- onClick: u,
992
+ onClick: l,
993
993
  leftIcon: /* @__PURE__ */ r(Ee, {
994
994
  size: 20
995
995
  }),
@@ -997,28 +997,53 @@ function et({
997
997
  })]
998
998
  });
999
999
  }
1000
- function rt({
1000
+ function nt(t, n) {
1001
+ if (t == null)
1002
+ return {};
1003
+ var o = {}, s = Object.keys(t), l, i;
1004
+ for (i = 0; i < s.length; i++)
1005
+ l = s[i], !(n.indexOf(l) >= 0) && (o[l] = t[l]);
1006
+ return o;
1007
+ }
1008
+ function at(t, n) {
1009
+ if (t == null)
1010
+ return {};
1011
+ var o = nt(t, n), s, l;
1012
+ if (Object.getOwnPropertySymbols) {
1013
+ var i = Object.getOwnPropertySymbols(t);
1014
+ for (l = 0; l < i.length; l++)
1015
+ s = i[l], !(n.indexOf(s) >= 0) && (!Object.prototype.propertyIsEnumerable.call(t, s) || (o[s] = t[s]));
1016
+ }
1017
+ return o;
1018
+ }
1019
+ var it = ["size", "color", "stroke"];
1020
+ function ot(t) {
1021
+ var n = t.size, o = n === void 0 ? 24 : n, s = t.color, l = s === void 0 ? "currentColor" : s, i = t.stroke, u = i === void 0 ? 2 : i, d = at(t, it);
1022
+ return /* @__PURE__ */ w("svg", { xmlns: "http://www.w3.org/2000/svg", className: "icon icon-tabler icon-tabler-lock", width: o, height: o, viewBox: "0 0 24 24", strokeWidth: u, stroke: l, fill: "none", strokeLinecap: "round", strokeLinejoin: "round", ...d, children: [/* @__PURE__ */ r("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ r("rect", { x: 5, y: 11, width: 14, height: 10, rx: 2 }), /* @__PURE__ */ r("circle", { cx: 12, cy: 16, r: 1 }), /* @__PURE__ */ r("path", { d: "M8 11v-4a4 4 0 0 1 8 0v4" })] });
1023
+ }
1024
+ function st({
1001
1025
  id: t,
1002
1026
  name: n,
1027
+ isProtected: o,
1003
1028
  onSuccess: s,
1004
- styles: c = de
1029
+ styles: l = de
1005
1030
  }) {
1006
- const u = le(), i = async () => {
1007
- !t || (M({
1031
+ const i = le(), u = async () => {
1032
+ !t || ($({
1008
1033
  id: "for-deleting",
1009
1034
  title: "Pending",
1010
1035
  message: "Deleting data source...",
1011
1036
  loading: !0
1012
- }), await D.datasource.delete(t), z({
1037
+ }), await k.datasource.delete(t), A({
1013
1038
  id: "for-deleting",
1014
1039
  title: "Successful",
1015
1040
  message: `Data source [${n}] is deleted`,
1016
1041
  color: "green"
1017
1042
  }), s());
1018
- }, l = () => u.openConfirmModal({
1043
+ }, d = () => i.openConfirmModal({
1019
1044
  title: "Delete this data source?",
1020
1045
  children: /* @__PURE__ */ r(oe, {
1021
- size: c.size,
1046
+ size: l.size,
1022
1047
  children: "This action won't affect your database."
1023
1048
  }),
1024
1049
  labels: {
@@ -1026,41 +1051,55 @@ function rt({
1026
1051
  cancel: "Cancel"
1027
1052
  },
1028
1053
  onCancel: () => console.log("Cancel"),
1029
- onConfirm: i
1030
- });
1031
- return /* @__PURE__ */ r(x, {
1032
- size: c.button.size,
1054
+ onConfirm: u
1055
+ }), g = Mr();
1056
+ return o ? /* @__PURE__ */ r(Nr, {
1057
+ withArrow: !0,
1058
+ events: {
1059
+ hover: !0,
1060
+ touch: !1,
1061
+ focus: !1
1062
+ },
1063
+ label: "This is a preset datasource, it can not be deleted",
1064
+ children: /* @__PURE__ */ r("span", {
1065
+ children: /* @__PURE__ */ r(ot, {
1066
+ size: 16,
1067
+ color: g.colors.gray[7]
1068
+ })
1069
+ })
1070
+ }) : /* @__PURE__ */ r(x, {
1071
+ size: l.button.size,
1033
1072
  color: "red",
1034
- onClick: l,
1073
+ onClick: d,
1035
1074
  leftIcon: /* @__PURE__ */ r(Ce, {
1036
1075
  size: 20
1037
1076
  }),
1038
1077
  children: "Delete"
1039
1078
  });
1040
1079
  }
1041
- function _t({
1080
+ function Tt({
1042
1081
  styles: t = de,
1043
1082
  config: n
1044
1083
  }) {
1045
1084
  ue(n);
1046
1085
  const {
1047
- data: s = [],
1048
- loading: c,
1049
- refresh: u
1086
+ data: o = [],
1087
+ loading: s,
1088
+ refresh: l
1050
1089
  } = G(async () => {
1051
1090
  const {
1052
1091
  data: i
1053
- } = await D.datasource.list();
1092
+ } = await k.datasource.list();
1054
1093
  return i;
1055
1094
  }, {
1056
1095
  refreshDeps: []
1057
1096
  });
1058
- return /* @__PURE__ */ w($, {
1059
- children: [/* @__PURE__ */ r(j, {
1097
+ return /* @__PURE__ */ w(U, {
1098
+ children: [/* @__PURE__ */ r(I, {
1060
1099
  pt: t.spacing,
1061
1100
  position: "right",
1062
- children: /* @__PURE__ */ r(et, {
1063
- onSuccess: u
1101
+ children: /* @__PURE__ */ r(tt, {
1102
+ onSuccess: l
1064
1103
  })
1065
1104
  }), /* @__PURE__ */ w(L, {
1066
1105
  mt: t.spacing,
@@ -1068,7 +1107,7 @@ function _t({
1068
1107
  position: "relative"
1069
1108
  },
1070
1109
  children: [/* @__PURE__ */ r(Re, {
1071
- visible: c
1110
+ visible: s
1072
1111
  }), /* @__PURE__ */ w(Pe, {
1073
1112
  horizontalSpacing: t.spacing,
1074
1113
  verticalSpacing: t.spacing,
@@ -1085,42 +1124,44 @@ function _t({
1085
1124
  })]
1086
1125
  })
1087
1126
  }), /* @__PURE__ */ r("tbody", {
1088
- children: s.map(({
1127
+ children: o.map(({
1089
1128
  id: i,
1090
- key: l,
1091
- type: d
1129
+ key: u,
1130
+ type: d,
1131
+ is_preset: g
1092
1132
  }) => /* @__PURE__ */ w("tr", {
1093
1133
  children: [/* @__PURE__ */ r("td", {
1094
1134
  width: 200,
1095
1135
  children: d
1096
1136
  }), /* @__PURE__ */ r("td", {
1097
- children: l
1137
+ children: u
1098
1138
  }), /* @__PURE__ */ r("td", {
1099
1139
  width: 200,
1100
- children: /* @__PURE__ */ r(j, {
1140
+ children: /* @__PURE__ */ r(I, {
1101
1141
  position: "left",
1102
- children: /* @__PURE__ */ r(rt, {
1142
+ children: /* @__PURE__ */ r(st, {
1143
+ isProtected: g,
1103
1144
  id: i,
1104
- name: l,
1105
- onSuccess: u
1145
+ name: u,
1146
+ onSuccess: l
1106
1147
  })
1107
1148
  })
1108
1149
  })]
1109
- }, l))
1150
+ }, u))
1110
1151
  })]
1111
1152
  })]
1112
1153
  })]
1113
1154
  });
1114
1155
  }
1115
- const tt = tr(({
1156
+ const ct = tr(({
1116
1157
  label: t,
1117
1158
  value: n,
1118
- description: s,
1119
- ...c
1120
- }, u) => /* @__PURE__ */ w(rr, {
1159
+ description: o,
1160
+ ...s
1161
+ }, l) => /* @__PURE__ */ w(rr, {
1121
1162
  spacing: 2,
1122
- ref: u,
1123
- ...c,
1163
+ ref: l,
1164
+ ...s,
1124
1165
  children: [/* @__PURE__ */ r(oe, {
1125
1166
  size: "sm",
1126
1167
  children: t
@@ -1128,17 +1169,17 @@ const tt = tr(({
1128
1169
  size: "xs",
1129
1170
  color: "dimmed",
1130
1171
  className: "role-description",
1131
- children: s
1172
+ children: o
1132
1173
  })]
1133
1174
  })), Te = tr(({
1134
1175
  styles: t,
1135
1176
  value: n,
1136
- onChange: s
1137
- }, c) => {
1177
+ onChange: o
1178
+ }, s) => {
1138
1179
  const {
1139
- data: u = [],
1180
+ data: l = [],
1140
1181
  loading: i
1141
- } = G(async () => (await D.role.list()).map((d) => ({
1182
+ } = G(async () => (await k.role.list()).map((d) => ({
1142
1183
  label: d.name,
1143
1184
  value: d.id,
1144
1185
  description: d.description,
@@ -1146,14 +1187,14 @@ const tt = tr(({
1146
1187
  })), {
1147
1188
  refreshDeps: []
1148
1189
  });
1149
- return /* @__PURE__ */ r(Nr, {
1150
- ref: c,
1190
+ return /* @__PURE__ */ r($r, {
1191
+ ref: s,
1151
1192
  mb: t.spacing,
1152
1193
  size: t.size,
1153
1194
  required: !0,
1154
1195
  label: "Role",
1155
- itemComponent: tt,
1156
- data: u,
1196
+ itemComponent: ct,
1197
+ data: l,
1157
1198
  disabled: i,
1158
1199
  styles: () => ({
1159
1200
  item: {
@@ -1167,7 +1208,7 @@ const tt = tr(({
1167
1208
  }
1168
1209
  }),
1169
1210
  value: n,
1170
- onChange: s
1211
+ onChange: o
1171
1212
  });
1172
1213
  }), W = {
1173
1214
  size: "sm",
@@ -1176,45 +1217,45 @@ const tt = tr(({
1176
1217
  size: "xs"
1177
1218
  }
1178
1219
  };
1179
- function nt({
1220
+ function lt({
1180
1221
  postSubmit: t,
1181
1222
  styles: n = W,
1182
- initialRoleID: s
1223
+ initialRoleID: o
1183
1224
  }) {
1184
1225
  const {
1185
- control: c,
1186
- handleSubmit: u
1226
+ control: s,
1227
+ handleSubmit: l
1187
1228
  } = ee({
1188
1229
  defaultValues: {
1189
1230
  name: "",
1190
1231
  email: "",
1191
- role_id: s,
1232
+ role_id: o,
1192
1233
  password: ""
1193
1234
  }
1194
1235
  });
1195
1236
  return /* @__PURE__ */ r(L, {
1196
1237
  mx: "auto",
1197
1238
  children: /* @__PURE__ */ w("form", {
1198
- onSubmit: u(async ({
1199
- name: l,
1239
+ onSubmit: l(async ({
1240
+ name: u,
1200
1241
  email: d,
1201
- password: h,
1242
+ password: g,
1202
1243
  role_id: y
1203
1244
  }) => {
1204
1245
  try {
1205
- M({
1246
+ $({
1206
1247
  id: "for-creating",
1207
1248
  title: "Pending",
1208
1249
  message: "Adding account...",
1209
1250
  loading: !0
1210
- }), await D.account.create(l, d, h, y), z({
1251
+ }), await k.account.create(u, d, g, y), A({
1211
1252
  id: "for-creating",
1212
1253
  title: "Successful",
1213
1254
  message: "Account is added",
1214
1255
  color: "green"
1215
1256
  }), t();
1216
1257
  } catch (_) {
1217
- z({
1258
+ A({
1218
1259
  id: "for-creating",
1219
1260
  title: "Failed",
1220
1261
  message: _.message,
@@ -1224,51 +1265,51 @@ function nt({
1224
1265
  }),
1225
1266
  children: [/* @__PURE__ */ r(E, {
1226
1267
  name: "name",
1227
- control: c,
1268
+ control: s,
1228
1269
  render: ({
1229
- field: l
1230
- }) => /* @__PURE__ */ r(I, {
1270
+ field: u
1271
+ }) => /* @__PURE__ */ r(j, {
1231
1272
  mb: n.spacing,
1232
1273
  size: n.size,
1233
1274
  required: !0,
1234
1275
  label: "Username",
1235
- ...l
1276
+ ...u
1236
1277
  })
1237
1278
  }), /* @__PURE__ */ r(E, {
1238
1279
  name: "email",
1239
- control: c,
1280
+ control: s,
1240
1281
  render: ({
1241
- field: l
1242
- }) => /* @__PURE__ */ r(I, {
1282
+ field: u
1283
+ }) => /* @__PURE__ */ r(j, {
1243
1284
  mb: n.spacing,
1244
1285
  size: n.size,
1245
1286
  required: !0,
1246
1287
  label: "Email",
1247
- ...l
1288
+ ...u
1248
1289
  })
1249
1290
  }), /* @__PURE__ */ r(E, {
1250
1291
  name: "password",
1251
- control: c,
1292
+ control: s,
1252
1293
  render: ({
1253
- field: l
1294
+ field: u
1254
1295
  }) => /* @__PURE__ */ r(ce, {
1255
1296
  mb: n.spacing,
1256
1297
  size: n.size,
1257
1298
  required: !0,
1258
1299
  label: "Password",
1259
1300
  description: "Password must be at least 8 characters long",
1260
- ...l
1301
+ ...u
1261
1302
  })
1262
1303
  }), /* @__PURE__ */ r(E, {
1263
1304
  name: "role_id",
1264
- control: c,
1305
+ control: s,
1265
1306
  render: ({
1266
- field: l
1307
+ field: u
1267
1308
  }) => /* @__PURE__ */ r(Te, {
1268
1309
  styles: n,
1269
- ...l
1310
+ ...u
1270
1311
  })
1271
- }), /* @__PURE__ */ r(j, {
1312
+ }), /* @__PURE__ */ r(I, {
1272
1313
  position: "right",
1273
1314
  mt: n.spacing,
1274
1315
  children: /* @__PURE__ */ r(x, {
@@ -1280,28 +1321,28 @@ function nt({
1280
1321
  })
1281
1322
  });
1282
1323
  }
1283
- function at({
1324
+ function ut({
1284
1325
  onSuccess: t,
1285
1326
  styles: n = W,
1286
- initialRoleID: s
1327
+ initialRoleID: o
1287
1328
  }) {
1288
- const [c, u] = J.useState(!1), i = () => u(!0), l = () => u(!1);
1289
- return /* @__PURE__ */ w($, {
1329
+ const [s, l] = J.useState(!1), i = () => l(!0), u = () => l(!1);
1330
+ return /* @__PURE__ */ w(U, {
1290
1331
  children: [/* @__PURE__ */ r(se, {
1291
1332
  overflow: "inside",
1292
- opened: c,
1293
- onClose: () => u(!1),
1333
+ opened: s,
1334
+ onClose: () => l(!1),
1294
1335
  title: "Add an Account",
1295
1336
  trapFocus: !0,
1296
- onDragStart: (h) => {
1297
- h.stopPropagation();
1337
+ onDragStart: (g) => {
1338
+ g.stopPropagation();
1298
1339
  },
1299
- children: /* @__PURE__ */ r(nt, {
1340
+ children: /* @__PURE__ */ r(lt, {
1300
1341
  postSubmit: () => {
1301
- t(), l();
1342
+ t(), u();
1302
1343
  },
1303
1344
  styles: n,
1304
- initialRoleID: s
1345
+ initialRoleID: o
1305
1346
  })
1306
1347
  }), /* @__PURE__ */ r(x, {
1307
1348
  size: n.button.size,
@@ -1313,29 +1354,29 @@ function at({
1313
1354
  })]
1314
1355
  });
1315
1356
  }
1316
- function it({
1357
+ function dt({
1317
1358
  id: t,
1318
1359
  name: n,
1319
- onSuccess: s,
1320
- styles: c = W
1360
+ onSuccess: o,
1361
+ styles: s = W
1321
1362
  }) {
1322
- const u = le(), i = async () => {
1363
+ const l = le(), i = async () => {
1323
1364
  if (!!t) {
1324
- M({
1365
+ $({
1325
1366
  id: "for-deleting",
1326
1367
  title: "Pending",
1327
1368
  message: "Deleting account...",
1328
1369
  loading: !0
1329
1370
  });
1330
1371
  try {
1331
- await D.account.delete(t), z({
1372
+ await k.account.delete(t), A({
1332
1373
  id: "for-deleting",
1333
1374
  title: "Successful",
1334
1375
  message: `Account [${n}] is deleted`,
1335
1376
  color: "green"
1336
- }), s();
1377
+ }), o();
1337
1378
  } catch (d) {
1338
- z({
1379
+ A({
1339
1380
  id: "for-deleting",
1340
1381
  title: "Failed",
1341
1382
  message: d.message,
@@ -1343,7 +1384,7 @@ function it({
1343
1384
  });
1344
1385
  }
1345
1386
  }
1346
- }, l = () => u.openConfirmModal({
1387
+ }, u = () => l.openConfirmModal({
1347
1388
  title: "Delete this account?",
1348
1389
  labels: {
1349
1390
  confirm: "Confirm",
@@ -1353,80 +1394,80 @@ function it({
1353
1394
  onConfirm: i
1354
1395
  });
1355
1396
  return /* @__PURE__ */ r(x, {
1356
- size: c.button.size,
1397
+ size: s.button.size,
1357
1398
  color: "red",
1358
- onClick: l,
1399
+ onClick: u,
1359
1400
  leftIcon: /* @__PURE__ */ r(Ce, {
1360
1401
  size: 20
1361
1402
  }),
1362
1403
  children: "Delete"
1363
1404
  });
1364
1405
  }
1365
- function ot({
1406
+ function ft({
1366
1407
  id: t,
1367
1408
  name: n,
1368
- email: s,
1369
- role_id: c,
1370
- postSubmit: u,
1409
+ email: o,
1410
+ role_id: s,
1411
+ postSubmit: l,
1371
1412
  styles: i = W
1372
1413
  }) {
1373
1414
  const {
1374
- control: l,
1415
+ control: u,
1375
1416
  handleSubmit: d,
1376
- watch: h
1417
+ watch: g
1377
1418
  } = ee({
1378
1419
  defaultValues: {
1379
1420
  name: n,
1380
- email: s,
1381
- role_id: c,
1421
+ email: o,
1422
+ role_id: s,
1382
1423
  reset_password: !1,
1383
1424
  new_password: ""
1384
1425
  }
1385
1426
  }), y = async ({
1386
1427
  name: f,
1387
1428
  email: O,
1388
- role_id: N,
1429
+ role_id: M,
1389
1430
  reset_password: V,
1390
1431
  new_password: ge
1391
1432
  }) => {
1392
1433
  try {
1393
- M({
1434
+ $({
1394
1435
  id: "for-updating",
1395
1436
  title: "Pending",
1396
1437
  message: "Updating account...",
1397
1438
  loading: !0
1398
- }), await D.account.edit({
1439
+ }), await k.account.edit({
1399
1440
  id: t,
1400
1441
  name: f,
1401
1442
  email: O,
1402
- role_id: N,
1443
+ role_id: M,
1403
1444
  reset_password: V,
1404
1445
  new_password: ge
1405
- }), z({
1446
+ }), A({
1406
1447
  id: "for-updating",
1407
1448
  title: "Successful",
1408
1449
  message: "Account is updated",
1409
1450
  color: "green"
1410
- }), u();
1411
- } catch (U) {
1412
- z({
1451
+ }), l();
1452
+ } catch (N) {
1453
+ A({
1413
1454
  id: "for-updating",
1414
1455
  title: "Failed",
1415
- message: U.message,
1456
+ message: N.message,
1416
1457
  color: "red"
1417
1458
  });
1418
1459
  }
1419
- }, [_, v] = h(["reset_password", "new_password"]);
1460
+ }, [_, v] = g(["reset_password", "new_password"]);
1420
1461
  return /* @__PURE__ */ r(L, {
1421
1462
  mx: "auto",
1422
1463
  children: /* @__PURE__ */ w("form", {
1423
1464
  onSubmit: d(y),
1424
1465
  children: [/* @__PURE__ */ r(E, {
1425
1466
  name: "name",
1426
- control: l,
1467
+ control: u,
1427
1468
  render: ({
1428
1469
  field: f
1429
- }) => /* @__PURE__ */ r(I, {
1470
+ }) => /* @__PURE__ */ r(j, {
1430
1471
  mb: i.spacing,
1431
1472
  size: i.size,
1432
1473
  required: !0,
@@ -1435,10 +1476,10 @@ function ot({
1435
1476
  })
1436
1477
  }), /* @__PURE__ */ r(E, {
1437
1478
  name: "email",
1438
- control: l,
1479
+ control: u,
1439
1480
  render: ({
1440
1481
  field: f
1441
- }) => /* @__PURE__ */ r(I, {
1482
+ }) => /* @__PURE__ */ r(j, {
1442
1483
  mb: i.spacing,
1443
1484
  size: i.size,
1444
1485
  required: !0,
@@ -1447,7 +1488,7 @@ function ot({
1447
1488
  })
1448
1489
  }), /* @__PURE__ */ r(E, {
1449
1490
  name: "role_id",
1450
- control: l,
1491
+ control: u,
1451
1492
  render: ({
1452
1493
  field: f
1453
1494
  }) => /* @__PURE__ */ r(Te, {
@@ -1461,7 +1502,7 @@ function ot({
1461
1502
  labelPosition: "center"
1462
1503
  }), /* @__PURE__ */ r(E, {
1463
1504
  name: "reset_password",
1464
- control: l,
1505
+ control: u,
1465
1506
  render: ({
1466
1507
  field: f
1467
1508
  }) => /* @__PURE__ */ r(Ur, {
@@ -1478,7 +1519,7 @@ function ot({
1478
1519
  })
1479
1520
  }), _ && /* @__PURE__ */ r(E, {
1480
1521
  name: "new_password",
1481
- control: l,
1522
+ control: u,
1482
1523
  render: ({
1483
1524
  field: f
1484
1525
  }) => /* @__PURE__ */ r(ce, {
@@ -1490,7 +1531,7 @@ function ot({
1490
1531
  label: "New Password",
1491
1532
  ...f
1492
1533
  })
1493
- }), /* @__PURE__ */ r(j, {
1534
+ }), /* @__PURE__ */ r(I, {
1494
1535
  position: "right",
1495
1536
  mt: i.spacing,
1496
1537
  children: /* @__PURE__ */ r(x, {
@@ -1502,76 +1543,76 @@ function ot({
1502
1543
  })
1503
1544
  });
1504
1545
  }
1505
- function st({
1546
+ function pt({
1506
1547
  account: t,
1507
1548
  onSuccess: n,
1508
- styles: s = W
1549
+ styles: o = W
1509
1550
  }) {
1510
- const [c, u] = J.useState(!1), i = () => u(!0), l = () => u(!1), d = () => {
1511
- n(), l();
1551
+ const [s, l] = J.useState(!1), i = () => l(!0), u = () => l(!1), d = () => {
1552
+ n(), u();
1512
1553
  };
1513
- return /* @__PURE__ */ w($, {
1554
+ return /* @__PURE__ */ w(U, {
1514
1555
  children: [/* @__PURE__ */ r(se, {
1515
1556
  overflow: "inside",
1516
- opened: c,
1517
- onClose: () => u(!1),
1557
+ opened: s,
1558
+ onClose: () => l(!1),
1518
1559
  title: `Editing ${t.name}`,
1519
1560
  trapFocus: !0,
1520
- onDragStart: (h) => {
1521
- h.stopPropagation();
1561
+ onDragStart: (g) => {
1562
+ g.stopPropagation();
1522
1563
  },
1523
- children: /* @__PURE__ */ r(ot, {
1564
+ children: /* @__PURE__ */ r(ft, {
1524
1565
  ...t,
1525
1566
  postSubmit: d,
1526
- styles: s
1567
+ styles: o
1527
1568
  })
1528
1569
  }), /* @__PURE__ */ r(x, {
1529
- size: s.button.size,
1570
+ size: o.button.size,
1530
1571
  onClick: i,
1531
- leftIcon: /* @__PURE__ */ r(Mr, {
1572
+ leftIcon: /* @__PURE__ */ r(Wr, {
1532
1573
  size: 20
1533
1574
  }),
1534
1575
  children: "Edit"
1535
1576
  })]
1536
1577
  });
1537
1578
  }
1538
- function yt({
1579
+ function zt({
1539
1580
  styles: t = W,
1540
1581
  config: n
1541
1582
  }) {
1542
1583
  var y, _;
1543
1584
  ue(n);
1544
1585
  const {
1545
- data: s = [],
1546
- loading: c,
1547
- refresh: u
1586
+ data: o = [],
1587
+ loading: s,
1588
+ refresh: l
1548
1589
  } = G(async () => {
1549
1590
  const {
1550
1591
  data: v
1551
- } = await D.account.list();
1592
+ } = await k.account.list();
1552
1593
  return v;
1553
1594
  }, {
1554
1595
  refreshDeps: []
1555
1596
  }), {
1556
1597
  data: i = [],
1557
- loading: l
1558
- } = G(async () => (await D.role.list()).map((f) => ({
1598
+ loading: u
1599
+ } = G(async () => (await k.role.list()).map((f) => ({
1559
1600
  label: f.name,
1560
1601
  value: f.id,
1561
1602
  description: f.description,
1562
1603
  disabled: f.id === 50
1563
1604
  })), {
1564
1605
  refreshDeps: []
1565
- }), d = nr(() => i.reduce((v, f) => (v.set(f.value, f.label), v), /* @__PURE__ */ new Map()), [i]), h = (v) => {
1606
+ }), d = nr(() => i.reduce((v, f) => (v.set(f.value, f.label), v), /* @__PURE__ */ new Map()), [i]), g = (v) => {
1566
1607
  var f;
1567
1608
  return (f = d.get(v)) != null ? f : v;
1568
1609
  };
1569
- return /* @__PURE__ */ w($, {
1570
- children: [/* @__PURE__ */ r(j, {
1610
+ return /* @__PURE__ */ w(U, {
1611
+ children: [/* @__PURE__ */ r(I, {
1571
1612
  pt: t.spacing,
1572
1613
  position: "right",
1573
- children: /* @__PURE__ */ r(at, {
1574
- onSuccess: u,
1614
+ children: /* @__PURE__ */ r(ut, {
1615
+ onSuccess: l,
1575
1616
  initialRoleID: (_ = (y = i == null ? void 0 : i[0]) == null ? void 0 : y.value) != null ? _ : 0
1576
1617
  })
1577
1618
  }), /* @__PURE__ */ w(L, {
@@ -1580,7 +1621,7 @@ function yt({
1580
1621
  position: "relative"
1581
1622
  },
1582
1623
  children: [/* @__PURE__ */ r(Re, {
1583
- visible: c || l
1624
+ visible: s || u
1584
1625
  }), /* @__PURE__ */ w(Pe, {
1585
1626
  horizontalSpacing: t.spacing,
1586
1627
  verticalSpacing: t.spacing,
@@ -1599,11 +1640,11 @@ function yt({
1599
1640
  })]
1600
1641
  })
1601
1642
  }), /* @__PURE__ */ r("tbody", {
1602
- children: s.map((v) => {
1643
+ children: o.map((v) => {
1603
1644
  const {
1604
1645
  id: f,
1605
1646
  name: O,
1606
- email: N,
1647
+ email: M,
1607
1648
  role_id: V
1608
1649
  } = v;
1609
1650
  return /* @__PURE__ */ w("tr", {
@@ -1612,21 +1653,21 @@ function yt({
1612
1653
  children: O
1613
1654
  }), /* @__PURE__ */ r("td", {
1614
1655
  width: 200,
1615
- children: N
1656
+ children: M
1616
1657
  }), /* @__PURE__ */ r("td", {
1617
1658
  width: 200,
1618
- children: h(V)
1659
+ children: g(V)
1619
1660
  }), /* @__PURE__ */ r("td", {
1620
1661
  width: 200,
1621
- children: /* @__PURE__ */ w(j, {
1662
+ children: /* @__PURE__ */ w(I, {
1622
1663
  position: "left",
1623
- children: [/* @__PURE__ */ r(st, {
1664
+ children: [/* @__PURE__ */ r(pt, {
1624
1665
  account: v,
1625
- onSuccess: u
1626
- }), /* @__PURE__ */ r(it, {
1666
+ onSuccess: l
1667
+ }), /* @__PURE__ */ r(dt, {
1627
1668
  id: f,
1628
1669
  name: O,
1629
- onSuccess: u
1670
+ onSuccess: l
1630
1671
  })]
1631
1672
  })
1632
1673
  })]
@@ -1637,13 +1678,13 @@ function yt({
1637
1678
  })]
1638
1679
  });
1639
1680
  }
1640
- function ct({
1681
+ function gt({
1641
1682
  postSubmit: t,
1642
1683
  styles: n = W
1643
1684
  }) {
1644
1685
  const {
1645
- control: s,
1646
- handleSubmit: c
1686
+ control: o,
1687
+ handleSubmit: s
1647
1688
  } = ee({
1648
1689
  defaultValues: {
1649
1690
  name: "",
@@ -1653,26 +1694,26 @@ function ct({
1653
1694
  return /* @__PURE__ */ r(L, {
1654
1695
  mx: "auto",
1655
1696
  children: /* @__PURE__ */ w("form", {
1656
- onSubmit: c(async ({
1697
+ onSubmit: s(async ({
1657
1698
  name: i,
1658
- password: l
1699
+ password: u
1659
1700
  }) => {
1660
1701
  try {
1661
- M({
1702
+ $({
1662
1703
  id: "for-login",
1663
1704
  title: "Pending",
1664
1705
  message: "Loggin in...",
1665
1706
  loading: !0
1666
1707
  });
1667
- const d = await D.account.login(i, l);
1668
- window.localStorage.setItem("token", d.token), z({
1708
+ const d = await k.account.login(i, u);
1709
+ window.localStorage.setItem("token", d.token), A({
1669
1710
  id: "for-login",
1670
1711
  title: "Successful",
1671
1712
  message: "Logged in",
1672
1713
  color: "green"
1673
1714
  }), t(d);
1674
1715
  } catch (d) {
1675
- z({
1716
+ A({
1676
1717
  id: "for-login",
1677
1718
  title: "Login Failed",
1678
1719
  message: d.message,
@@ -1682,10 +1723,10 @@ function ct({
1682
1723
  }),
1683
1724
  children: [/* @__PURE__ */ r(E, {
1684
1725
  name: "name",
1685
- control: s,
1726
+ control: o,
1686
1727
  render: ({
1687
1728
  field: i
1688
- }) => /* @__PURE__ */ r(I, {
1729
+ }) => /* @__PURE__ */ r(j, {
1689
1730
  mb: n.spacing,
1690
1731
  size: n.size,
1691
1732
  required: !0,
@@ -1694,7 +1735,7 @@ function ct({
1694
1735
  })
1695
1736
  }), /* @__PURE__ */ r(E, {
1696
1737
  name: "password",
1697
- control: s,
1738
+ control: o,
1698
1739
  render: ({
1699
1740
  field: i
1700
1741
  }) => /* @__PURE__ */ r(ce, {
@@ -1704,7 +1745,7 @@ function ct({
1704
1745
  label: "Password",
1705
1746
  ...i
1706
1747
  })
1707
- }), /* @__PURE__ */ r(j, {
1748
+ }), /* @__PURE__ */ r(I, {
1708
1749
  position: "right",
1709
1750
  mt: n.spacing,
1710
1751
  children: /* @__PURE__ */ r(x, {
@@ -1716,20 +1757,20 @@ function ct({
1716
1757
  })
1717
1758
  });
1718
1759
  }
1719
- function Rt({
1760
+ function At({
1720
1761
  styles: t = W,
1721
1762
  config: n,
1722
- onSuccess: s
1763
+ onSuccess: o
1723
1764
  }) {
1724
- return ue(n), /* @__PURE__ */ r($, {
1765
+ return ue(n), /* @__PURE__ */ r(U, {
1725
1766
  children: /* @__PURE__ */ r(L, {
1726
1767
  mt: t.spacing,
1727
1768
  sx: {
1728
1769
  position: "relative"
1729
1770
  },
1730
- children: /* @__PURE__ */ r(ct, {
1771
+ children: /* @__PURE__ */ r(gt, {
1731
1772
  styles: t,
1732
- postSubmit: s
1773
+ postSubmit: o
1733
1774
  })
1734
1775
  })
1735
1776
  });
@@ -1741,75 +1782,75 @@ const pe = {
1741
1782
  size: "xs"
1742
1783
  }
1743
1784
  };
1744
- function lt({
1785
+ function ht({
1745
1786
  postSubmit: t,
1746
1787
  styles: n = pe,
1747
- initialRoleID: s
1788
+ initialRoleID: o
1748
1789
  }) {
1749
1790
  const {
1750
- control: c,
1751
- handleSubmit: u
1791
+ control: s,
1792
+ handleSubmit: l
1752
1793
  } = ee({
1753
1794
  defaultValues: {
1754
1795
  name: "",
1755
- role_id: s
1796
+ role_id: o
1756
1797
  }
1757
1798
  });
1758
1799
  return /* @__PURE__ */ r(L, {
1759
1800
  mx: "auto",
1760
1801
  children: /* @__PURE__ */ w("form", {
1761
- onSubmit: u(async ({
1762
- name: l,
1802
+ onSubmit: l(async ({
1803
+ name: u,
1763
1804
  role_id: d
1764
1805
  }) => {
1765
1806
  try {
1766
- M({
1807
+ $({
1767
1808
  id: "for-creating",
1768
1809
  title: "Pending",
1769
1810
  message: "Adding API Key...",
1770
1811
  loading: !0
1771
1812
  });
1772
1813
  const {
1773
- app_id: h,
1814
+ app_id: g,
1774
1815
  app_secret: y
1775
- } = await D.api_key.create(l, d);
1776
- z({
1816
+ } = await k.api_key.create(u, d);
1817
+ A({
1777
1818
  id: "for-creating",
1778
1819
  title: "Successful",
1779
1820
  message: "API Key is added",
1780
1821
  color: "green"
1781
- }), t(h, y);
1782
- } catch (h) {
1783
- z({
1822
+ }), t(g, y);
1823
+ } catch (g) {
1824
+ A({
1784
1825
  id: "for-creating",
1785
1826
  title: "Failed",
1786
- message: h.message,
1827
+ message: g.message,
1787
1828
  color: "red"
1788
1829
  });
1789
1830
  }
1790
1831
  }),
1791
1832
  children: [/* @__PURE__ */ r(E, {
1792
1833
  name: "name",
1793
- control: c,
1834
+ control: s,
1794
1835
  render: ({
1795
- field: l
1796
- }) => /* @__PURE__ */ r(I, {
1836
+ field: u
1837
+ }) => /* @__PURE__ */ r(j, {
1797
1838
  mb: n.spacing,
1798
1839
  size: n.size,
1799
1840
  required: !0,
1800
1841
  label: "Name",
1801
- ...l
1842
+ ...u
1802
1843
  })
1803
1844
  }), /* @__PURE__ */ r(E, {
1804
1845
  name: "role_id",
1805
- control: c,
1846
+ control: s,
1806
1847
  render: ({
1807
- field: l
1848
+ field: u
1808
1849
  }) => /* @__PURE__ */ r(Te, {
1809
1850
  styles: n,
1810
- ...l
1851
+ ...u
1811
1852
  })
1812
- }), /* @__PURE__ */ r(j, {
1853
+ }), /* @__PURE__ */ r(I, {
1813
1854
  position: "right",
1814
1855
  mt: n.spacing,
1815
1856
  children: /* @__PURE__ */ r(x, {
@@ -1821,31 +1862,31 @@ function lt({
1821
1862
  })
1822
1863
  });
1823
1864
  }
1824
- function ut({
1865
+ function mt({
1825
1866
  onSuccess: t,
1826
1867
  styles: n = pe,
1827
- initialRoleID: s
1868
+ initialRoleID: o
1828
1869
  }) {
1829
- const c = le(), [u, i] = J.useState(!1), l = () => i(!0), d = () => i(!1);
1830
- return /* @__PURE__ */ w($, {
1870
+ const s = le(), [l, i] = J.useState(!1), u = () => i(!0), d = () => i(!1);
1871
+ return /* @__PURE__ */ w(U, {
1831
1872
  children: [/* @__PURE__ */ r(se, {
1832
1873
  overflow: "inside",
1833
- opened: u,
1874
+ opened: l,
1834
1875
  onClose: () => i(!1),
1835
1876
  title: "Add an API Key",
1836
1877
  trapFocus: !0,
1837
1878
  onDragStart: (y) => {
1838
1879
  y.stopPropagation();
1839
1880
  },
1840
- children: /* @__PURE__ */ r(lt, {
1881
+ children: /* @__PURE__ */ r(ht, {
1841
1882
  postSubmit: (y, _) => {
1842
- d(), c.openModal({
1883
+ d(), s.openModal({
1843
1884
  title: "API Key is generated",
1844
1885
  children: /* @__PURE__ */ w(rr, {
1845
1886
  children: [/* @__PURE__ */ r(oe, {
1846
1887
  color: "dimmed",
1847
1888
  children: "Make sure you save it - you won't be able to access it again."
1848
- }), /* @__PURE__ */ r(I, {
1889
+ }), /* @__PURE__ */ r(j, {
1849
1890
  defaultValue: y,
1850
1891
  disabled: !0,
1851
1892
  label: "APP ID",
@@ -1854,7 +1895,7 @@ function ut({
1854
1895
  cursor: "text !important"
1855
1896
  }
1856
1897
  }
1857
- }), /* @__PURE__ */ r(I, {
1898
+ }), /* @__PURE__ */ r(j, {
1858
1899
  defaultValue: _,
1859
1900
  disabled: !0,
1860
1901
  label: "APP Secret",
@@ -1866,7 +1907,7 @@ function ut({
1866
1907
  }), /* @__PURE__ */ r(x, {
1867
1908
  size: "sm",
1868
1909
  onClick: () => {
1869
- Vr();
1910
+ Kr();
1870
1911
  },
1871
1912
  children: "I've saved this API Key"
1872
1913
  })]
@@ -1877,11 +1918,11 @@ function ut({
1877
1918
  });
1878
1919
  },
1879
1920
  styles: n,
1880
- initialRoleID: s
1921
+ initialRoleID: o
1881
1922
  })
1882
1923
  }), /* @__PURE__ */ r(x, {
1883
1924
  size: n.button.size,
1884
- onClick: l,
1925
+ onClick: u,
1885
1926
  leftIcon: /* @__PURE__ */ r(Ee, {
1886
1927
  size: 20
1887
1928
  }),
@@ -1889,29 +1930,29 @@ function ut({
1889
1930
  })]
1890
1931
  });
1891
1932
  }
1892
- function dt({
1933
+ function vt({
1893
1934
  id: t,
1894
1935
  name: n,
1895
- onSuccess: s,
1896
- styles: c = pe
1936
+ onSuccess: o,
1937
+ styles: s = pe
1897
1938
  }) {
1898
- const u = le(), i = async () => {
1939
+ const l = le(), i = async () => {
1899
1940
  if (!!t) {
1900
- M({
1941
+ $({
1901
1942
  id: "for-deleting",
1902
1943
  title: "Pending",
1903
1944
  message: "Deleting API Key...",
1904
1945
  loading: !0
1905
1946
  });
1906
1947
  try {
1907
- await D.api_key.delete(t), z({
1948
+ await k.api_key.delete(t), A({
1908
1949
  id: "for-deleting",
1909
1950
  title: "Successful",
1910
1951
  message: `API Key [${n}] is deleted`,
1911
1952
  color: "green"
1912
- }), s();
1953
+ }), o();
1913
1954
  } catch (d) {
1914
- z({
1955
+ A({
1915
1956
  id: "for-deleting",
1916
1957
  title: "Failed",
1917
1958
  message: d.message,
@@ -1919,7 +1960,7 @@ function dt({
1919
1960
  });
1920
1961
  }
1921
1962
  }
1922
- }, l = () => u.openConfirmModal({
1963
+ }, u = () => l.openConfirmModal({
1923
1964
  title: "Delete this api-key?",
1924
1965
  labels: {
1925
1966
  confirm: "Confirm",
@@ -1929,52 +1970,52 @@ function dt({
1929
1970
  onConfirm: i
1930
1971
  });
1931
1972
  return /* @__PURE__ */ r(x, {
1932
- size: c.button.size,
1973
+ size: s.button.size,
1933
1974
  color: "red",
1934
- onClick: l,
1975
+ onClick: u,
1935
1976
  leftIcon: /* @__PURE__ */ r(Ce, {
1936
1977
  size: 20
1937
1978
  }),
1938
1979
  children: "Delete"
1939
1980
  });
1940
1981
  }
1941
- function Pt({
1982
+ function Ot({
1942
1983
  styles: t = pe,
1943
1984
  config: n
1944
1985
  }) {
1945
1986
  var y, _;
1946
1987
  ue(n);
1947
1988
  const {
1948
- data: s = [],
1949
- loading: c,
1950
- refresh: u
1989
+ data: o = [],
1990
+ loading: s,
1991
+ refresh: l
1951
1992
  } = G(async () => {
1952
1993
  const {
1953
1994
  data: v
1954
- } = await D.api_key.list();
1995
+ } = await k.api_key.list();
1955
1996
  return v;
1956
1997
  }, {
1957
1998
  refreshDeps: []
1958
1999
  }), {
1959
2000
  data: i = [],
1960
- loading: l
1961
- } = G(async () => (await D.role.list()).map((f) => ({
2001
+ loading: u
2002
+ } = G(async () => (await k.role.list()).map((f) => ({
1962
2003
  label: f.name,
1963
2004
  value: f.id,
1964
2005
  description: f.description,
1965
2006
  disabled: f.id === 50
1966
2007
  })), {
1967
2008
  refreshDeps: []
1968
- }), d = nr(() => i.reduce((v, f) => (v.set(f.value, f.label), v), /* @__PURE__ */ new Map()), [i]), h = (v) => {
2009
+ }), d = nr(() => i.reduce((v, f) => (v.set(f.value, f.label), v), /* @__PURE__ */ new Map()), [i]), g = (v) => {
1969
2010
  var f;
1970
2011
  return (f = d.get(v)) != null ? f : v;
1971
2012
  };
1972
- return /* @__PURE__ */ w($, {
1973
- children: [/* @__PURE__ */ r(j, {
2013
+ return /* @__PURE__ */ w(U, {
2014
+ children: [/* @__PURE__ */ r(I, {
1974
2015
  pt: t.spacing,
1975
2016
  position: "right",
1976
- children: /* @__PURE__ */ r(ut, {
1977
- onSuccess: u,
2017
+ children: /* @__PURE__ */ r(mt, {
2018
+ onSuccess: l,
1978
2019
  initialRoleID: (_ = (y = i == null ? void 0 : i[0]) == null ? void 0 : y.value) != null ? _ : 0
1979
2020
  })
1980
2021
  }), /* @__PURE__ */ w(L, {
@@ -1983,7 +2024,7 @@ function Pt({
1983
2024
  position: "relative"
1984
2025
  },
1985
2026
  children: [/* @__PURE__ */ r(Re, {
1986
- visible: c || l
2027
+ visible: s || u
1987
2028
  }), /* @__PURE__ */ w(Pe, {
1988
2029
  horizontalSpacing: t.spacing,
1989
2030
  verticalSpacing: t.spacing,
@@ -2002,11 +2043,11 @@ function Pt({
2002
2043
  })]
2003
2044
  })
2004
2045
  }), /* @__PURE__ */ r("tbody", {
2005
- children: s.map((v) => {
2046
+ children: o.map((v) => {
2006
2047
  const {
2007
2048
  id: f,
2008
2049
  name: O,
2009
- app_id: N,
2050
+ app_id: M,
2010
2051
  role_id: V
2011
2052
  } = v;
2012
2053
  return /* @__PURE__ */ w("tr", {
@@ -2015,18 +2056,18 @@ function Pt({
2015
2056
  children: O
2016
2057
  }), /* @__PURE__ */ r("td", {
2017
2058
  width: 200,
2018
- children: N
2059
+ children: M
2019
2060
  }), /* @__PURE__ */ r("td", {
2020
2061
  width: 200,
2021
- children: h(V)
2062
+ children: g(V)
2022
2063
  }), /* @__PURE__ */ r("td", {
2023
2064
  width: 200,
2024
- children: /* @__PURE__ */ r(j, {
2065
+ children: /* @__PURE__ */ r(I, {
2025
2066
  position: "left",
2026
- children: /* @__PURE__ */ r(dt, {
2067
+ children: /* @__PURE__ */ r(vt, {
2027
2068
  id: f,
2028
2069
  name: O,
2029
- onSuccess: u
2070
+ onSuccess: l
2030
2071
  })
2031
2072
  })
2032
2073
  })]
@@ -2038,14 +2079,14 @@ function Pt({
2038
2079
  });
2039
2080
  }
2040
2081
  export {
2041
- Pt as APIKeyList,
2042
- yt as AccountList,
2043
- ut as AddAPIKey,
2044
- at as AddAccount,
2045
- et as AddDataSource,
2046
- _t as DataSourceList,
2047
- dt as DeleteAPIKey,
2048
- it as DeleteAccount,
2049
- rt as DeleteDataSource,
2050
- Rt as Login
2082
+ Ot as APIKeyList,
2083
+ zt as AccountList,
2084
+ mt as AddAPIKey,
2085
+ ut as AddAccount,
2086
+ tt as AddDataSource,
2087
+ Tt as DataSourceList,
2088
+ vt as DeleteAPIKey,
2089
+ dt as DeleteAccount,
2090
+ st as DeleteDataSource,
2091
+ At as Login
2051
2092
  };