@fctc/interface-logic 1.7.1 → 1.7.2

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.
Files changed (38) hide show
  1. package/dist/{configs.mjs → configs.cjs} +161 -111
  2. package/dist/{configs.d.mts → configs.d.cts} +2 -1
  3. package/dist/configs.d.ts +1 -0
  4. package/dist/configs.js +124 -146
  5. package/dist/{constants.mjs → constants.cjs} +40 -2
  6. package/dist/constants.js +2 -41
  7. package/dist/{environment.mjs → environment.cjs} +2029 -1967
  8. package/dist/environment.d.cts +56 -0
  9. package/dist/environment.d.ts +24 -6
  10. package/dist/environment.js +2235 -2248
  11. package/dist/{hooks.mjs → hooks.cjs} +4021 -3773
  12. package/dist/{hooks.d.mts → hooks.d.cts} +2 -7
  13. package/dist/hooks.d.ts +1 -6
  14. package/dist/hooks.js +3916 -3873
  15. package/dist/{provider.mjs → provider.cjs} +688 -586
  16. package/dist/{provider.d.mts → provider.d.cts} +1 -1
  17. package/dist/provider.d.ts +1 -1
  18. package/dist/provider.js +648 -620
  19. package/dist/{services.mjs → services.cjs} +4186 -3980
  20. package/dist/{services.d.mts → services.d.cts} +1 -2
  21. package/dist/services.d.ts +0 -1
  22. package/dist/services.js +4141 -4021
  23. package/dist/{store.mjs → store.cjs} +149 -33
  24. package/dist/{store.d.mts → store.d.cts} +127 -155
  25. package/dist/store.d.ts +127 -155
  26. package/dist/store.js +44 -134
  27. package/dist/types.cjs +17 -0
  28. package/dist/{types.d.mts → types.d.cts} +1 -1
  29. package/dist/types.js +0 -18
  30. package/dist/{utils.mjs → utils.cjs} +202 -115
  31. package/dist/{utils.d.mts → utils.d.cts} +2 -2
  32. package/dist/utils.d.ts +2 -2
  33. package/dist/utils.js +135 -176
  34. package/package.json +82 -81
  35. package/dist/environment.d.mts +0 -38
  36. package/dist/types.mjs +0 -0
  37. /package/dist/{constants.d.mts → constants.d.cts} +0 -0
  38. /package/dist/{view-type-BGJfDe73.d.mts → view-type-BGJfDe73.d.cts} +0 -0
@@ -1,8 +1,83 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __pow = Math.pow;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ // If the importer is in node compatibility mode or this is not an ESM
39
+ // file that has been converted to a CommonJS file using a Babel-
40
+ // compatible transform (i.e. "__esModule" has not been set), then set
41
+ // "default" to the CommonJS "module.exports" for node compatibility.
42
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
+ mod
44
+ ));
45
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46
+ var __async = (__this, __arguments, generator) => {
47
+ return new Promise((resolve, reject) => {
48
+ var fulfilled = (value) => {
49
+ try {
50
+ step(generator.next(value));
51
+ } catch (e) {
52
+ reject(e);
53
+ }
54
+ };
55
+ var rejected = (value) => {
56
+ try {
57
+ step(generator.throw(value));
58
+ } catch (e) {
59
+ reject(e);
60
+ }
61
+ };
62
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
63
+ step((generator = generator.apply(__this, __arguments)).next());
64
+ });
65
+ };
66
+
67
+ // src/provider.ts
68
+ var provider_exports = {};
69
+ __export(provider_exports, {
70
+ MainProvider: () => MainProvider,
71
+ ReactQueryProvider: () => ReactQueryProvider,
72
+ VersionGate: () => VersionGate
73
+ });
74
+ module.exports = __toCommonJS(provider_exports);
75
+
1
76
  // src/provider/react-query-provider.tsx
2
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
- import { jsx } from "react/jsx-runtime";
77
+ var import_react_query = require("@tanstack/react-query");
78
+ var import_jsx_runtime = require("react/jsx-runtime");
4
79
  var ReactQueryProvider = ({ children }) => {
5
- const queryClient = new QueryClient({
80
+ const queryClient = new import_react_query.QueryClient({
6
81
  defaultOptions: {
7
82
  queries: {
8
83
  // placeholderData: keepPreviousData,
@@ -13,21 +88,21 @@ var ReactQueryProvider = ({ children }) => {
13
88
  }
14
89
  }
15
90
  });
16
- return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children });
17
92
  };
18
93
 
19
94
  // src/provider/redux-provider.tsx
20
- import { Provider } from "react-redux";
95
+ var import_react_redux2 = require("react-redux");
21
96
 
22
97
  // src/store/index.ts
23
- import { useDispatch, useSelector } from "react-redux";
98
+ var import_react_redux = require("react-redux");
24
99
 
25
100
  // src/store/reducers/breadcrums-slice/index.ts
26
- import { createSlice } from "@reduxjs/toolkit";
101
+ var import_toolkit = require("@reduxjs/toolkit");
27
102
  var initialState = {
28
103
  breadCrumbs: []
29
104
  };
30
- var breadcrumbsSlice = createSlice({
105
+ var breadcrumbsSlice = (0, import_toolkit.createSlice)({
31
106
  name: "breadcrumbs",
32
107
  initialState,
33
108
  reducers: {
@@ -40,16 +115,14 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
40
115
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
41
116
 
42
117
  // src/store/reducers/env-slice/index.ts
43
- import { createSlice as createSlice2 } from "@reduxjs/toolkit";
118
+ var import_toolkit2 = require("@reduxjs/toolkit");
44
119
  var initialState2 = {
45
120
  baseUrl: "",
121
+ requests: null,
46
122
  companies: [],
47
123
  user: {},
48
- db: "",
49
- refreshTokenEndpoint: "",
50
124
  config: null,
51
125
  envFile: null,
52
- requests: null,
53
126
  defaultCompany: {
54
127
  id: null,
55
128
  logo: "",
@@ -63,7 +136,7 @@ var initialState2 = {
63
136
  tz: "Asia/Saigon"
64
137
  }
65
138
  };
66
- var envSlice = createSlice2({
139
+ var envSlice = (0, import_toolkit2.createSlice)({
67
140
  name: "env",
68
141
  initialState: initialState2,
69
142
  reducers: {
@@ -110,7 +183,7 @@ var {
110
183
  var env_slice_default = envSlice.reducer;
111
184
 
112
185
  // src/store/reducers/excel-slice/index.ts
113
- import { createSlice as createSlice3 } from "@reduxjs/toolkit";
186
+ var import_toolkit3 = require("@reduxjs/toolkit");
114
187
  var initialState3 = {
115
188
  dataParse: null,
116
189
  idFile: null,
@@ -119,7 +192,7 @@ var initialState3 = {
119
192
  selectedFile: null,
120
193
  errorData: null
121
194
  };
122
- var excelSlice = createSlice3({
195
+ var excelSlice = (0, import_toolkit3.createSlice)({
123
196
  name: "excel",
124
197
  initialState: initialState3,
125
198
  reducers: {
@@ -154,7 +227,7 @@ var {
154
227
  var excel_slice_default = excelSlice.reducer;
155
228
 
156
229
  // src/store/reducers/form-slice/index.ts
157
- import { createSlice as createSlice4 } from "@reduxjs/toolkit";
230
+ var import_toolkit4 = require("@reduxjs/toolkit");
158
231
  var initialState4 = {
159
232
  viewDataStore: {},
160
233
  isShowingModalDetail: false,
@@ -164,7 +237,7 @@ var initialState4 = {
164
237
  listSubject: {},
165
238
  dataUser: {}
166
239
  };
167
- var formSlice = createSlice4({
240
+ var formSlice = (0, import_toolkit4.createSlice)({
168
241
  name: "form",
169
242
  initialState: initialState4,
170
243
  reducers: {
@@ -203,15 +276,15 @@ var {
203
276
  var form_slice_default = formSlice.reducer;
204
277
 
205
278
  // src/store/reducers/header-slice/index.ts
206
- import { createSlice as createSlice5 } from "@reduxjs/toolkit";
207
- var headerSlice = createSlice5({
279
+ var import_toolkit5 = require("@reduxjs/toolkit");
280
+ var headerSlice = (0, import_toolkit5.createSlice)({
208
281
  name: "header",
209
282
  initialState: {
210
283
  value: { allowedCompanyIds: [] }
211
284
  },
212
285
  reducers: {
213
286
  setHeader: (state, action) => {
214
- state.value = { ...state.value, ...action.payload };
287
+ state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
215
288
  },
216
289
  setAllowedCompanyIds: (state, action) => {
217
290
  state.value.allowedCompanyIds = action.payload;
@@ -222,7 +295,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
222
295
  var header_slice_default = headerSlice.reducer;
223
296
 
224
297
  // src/store/reducers/list-slice/index.ts
225
- import { createSlice as createSlice6 } from "@reduxjs/toolkit";
298
+ var import_toolkit6 = require("@reduxjs/toolkit");
226
299
  var initialState5 = {
227
300
  pageLimit: 10,
228
301
  fields: {},
@@ -236,7 +309,7 @@ var initialState5 = {
236
309
  page: 0,
237
310
  domainTable: []
238
311
  };
239
- var listSlice = createSlice6({
312
+ var listSlice = (0, import_toolkit6.createSlice)({
240
313
  name: "list",
241
314
  initialState: initialState5,
242
315
  reducers: {
@@ -287,13 +360,13 @@ var {
287
360
  var list_slice_default = listSlice.reducer;
288
361
 
289
362
  // src/store/reducers/login-slice/index.ts
290
- import { createSlice as createSlice7 } from "@reduxjs/toolkit";
363
+ var import_toolkit7 = require("@reduxjs/toolkit");
291
364
  var initialState6 = {
292
365
  db: "",
293
366
  redirectTo: "/",
294
367
  forgotPasswordUrl: "/"
295
368
  };
296
- var loginSlice = createSlice7({
369
+ var loginSlice = (0, import_toolkit7.createSlice)({
297
370
  name: "login",
298
371
  initialState: initialState6,
299
372
  reducers: {
@@ -312,14 +385,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
312
385
  var login_slice_default = loginSlice.reducer;
313
386
 
314
387
  // src/store/reducers/navbar-slice/index.ts
315
- import { createSlice as createSlice8 } from "@reduxjs/toolkit";
388
+ var import_toolkit8 = require("@reduxjs/toolkit");
316
389
  var initialState7 = {
317
390
  menuFocus: {},
318
391
  menuAction: {},
319
392
  navbarWidth: 250,
320
393
  menuList: []
321
394
  };
322
- var navbarSlice = createSlice8({
395
+ var navbarSlice = (0, import_toolkit8.createSlice)({
323
396
  name: "navbar",
324
397
  initialState: initialState7,
325
398
  reducers: {
@@ -341,11 +414,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
341
414
  var navbar_slice_default = navbarSlice.reducer;
342
415
 
343
416
  // src/store/reducers/profile-slice/index.ts
344
- import { createSlice as createSlice9 } from "@reduxjs/toolkit";
417
+ var import_toolkit9 = require("@reduxjs/toolkit");
345
418
  var initialState8 = {
346
419
  profile: {}
347
420
  };
348
- var profileSlice = createSlice9({
421
+ var profileSlice = (0, import_toolkit9.createSlice)({
349
422
  name: "profile",
350
423
  initialState: initialState8,
351
424
  reducers: {
@@ -358,7 +431,7 @@ var { setProfile } = profileSlice.actions;
358
431
  var profile_slice_default = profileSlice.reducer;
359
432
 
360
433
  // src/store/reducers/search-slice/index.ts
361
- import { createSlice as createSlice10 } from "@reduxjs/toolkit";
434
+ var import_toolkit10 = require("@reduxjs/toolkit");
362
435
  var initialState9 = {
363
436
  groupByDomain: null,
364
437
  searchBy: [],
@@ -370,7 +443,7 @@ var initialState9 = {
370
443
  filterBy: [],
371
444
  groupBy: []
372
445
  };
373
- var searchSlice = createSlice10({
446
+ var searchSlice = (0, import_toolkit10.createSlice)({
374
447
  name: "search",
375
448
  initialState: initialState9,
376
449
  reducers: {
@@ -444,7 +517,7 @@ var {
444
517
  var search_slice_default = searchSlice.reducer;
445
518
 
446
519
  // src/store/store.ts
447
- import { configureStore } from "@reduxjs/toolkit";
520
+ var import_toolkit11 = require("@reduxjs/toolkit");
448
521
 
449
522
  // node_modules/redux/dist/redux.mjs
450
523
  function formatProdErrorMessage(code) {
@@ -628,7 +701,7 @@ var rootReducer = combineReducers({
628
701
  excel: excel_slice_default,
629
702
  profile: profile_slice_default
630
703
  });
631
- var envStore = configureStore({
704
+ var envStore = (0, import_toolkit11.configureStore)({
632
705
  reducer: rootReducer,
633
706
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
634
707
  serializableCheck: false
@@ -636,26 +709,26 @@ var envStore = configureStore({
636
709
  });
637
710
 
638
711
  // src/provider/redux-provider.tsx
639
- import { jsx as jsx2 } from "react/jsx-runtime";
712
+ var import_jsx_runtime2 = require("react/jsx-runtime");
640
713
  var ReduxProvider = ({ children }) => {
641
- return /* @__PURE__ */ jsx2(Provider, { store: envStore, children });
714
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_redux2.Provider, { store: envStore, children });
642
715
  };
643
716
 
644
717
  // src/provider/main-provider.tsx
645
- import { jsx as jsx3 } from "react/jsx-runtime";
718
+ var import_jsx_runtime3 = require("react/jsx-runtime");
646
719
  var MainProvider = ({ children }) => {
647
- return /* @__PURE__ */ jsx3(ReduxProvider, { children: /* @__PURE__ */ jsx3(ReactQueryProvider, { children }) });
720
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReduxProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReactQueryProvider, { children }) });
648
721
  };
649
722
 
650
723
  // src/provider/version-gate-provider.tsx
651
- import { useEffect as useEffect2, useState as useState2 } from "react";
652
- import { useQueryClient } from "@tanstack/react-query";
724
+ var import_react2 = require("react");
725
+ var import_react_query2 = require("@tanstack/react-query");
653
726
 
654
727
  // src/configs/axios-client.ts
655
- import axios from "axios";
728
+ var import_axios = __toESM(require("axios"), 1);
656
729
 
657
730
  // src/utils/format.ts
658
- import moment from "moment";
731
+ var import_moment = __toESM(require("moment"), 1);
659
732
 
660
733
  // src/utils/domain/py_tokenizer.ts
661
734
  var TokenizerError = class extends Error {
@@ -1735,22 +1808,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
1735
1808
  this.microsecond = params.microsecond;
1736
1809
  this.weekday = params.weekday;
1737
1810
  }
1738
- years;
1739
- months;
1740
- days;
1741
- hours;
1742
- minutes;
1743
- seconds;
1744
- microseconds;
1745
- leapDays;
1746
- year;
1747
- month;
1748
- day;
1749
- hour;
1750
- minute;
1751
- second;
1752
- microsecond;
1753
- weekday;
1754
1811
  negate() {
1755
1812
  return new _PyRelativeDelta(this, -1);
1756
1813
  }
@@ -1865,7 +1922,7 @@ function execOnIterable(iterable, func) {
1865
1922
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1866
1923
  iterable = Object.keys(iterable);
1867
1924
  }
1868
- if (typeof iterable?.[Symbol.iterator] !== "function") {
1925
+ if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1869
1926
  throw new EvaluationError("value not iterable");
1870
1927
  }
1871
1928
  return func(iterable);
@@ -2188,7 +2245,7 @@ function applyBinaryOp(ast, context) {
2188
2245
  }
2189
2246
  return Math.floor(left / right);
2190
2247
  case "**":
2191
- return left ** right;
2248
+ return __pow(left, right);
2192
2249
  case "==":
2193
2250
  return isEqual(left, right);
2194
2251
  case "<>":
@@ -2310,7 +2367,7 @@ function evaluate(ast, context = {}) {
2310
2367
  const dicts = /* @__PURE__ */ new Set();
2311
2368
  let pyContext;
2312
2369
  const evalContext = Object.create(context);
2313
- if (!evalContext?.context) {
2370
+ if (!(evalContext == null ? void 0 : evalContext.context)) {
2314
2371
  Object.defineProperty(evalContext, "context", {
2315
2372
  get() {
2316
2373
  if (!pyContext) {
@@ -2321,17 +2378,18 @@ function evaluate(ast, context = {}) {
2321
2378
  });
2322
2379
  }
2323
2380
  function _innerEvaluate(ast2) {
2324
- switch (ast2?.type) {
2381
+ var _a, _b, _c;
2382
+ switch (ast2 == null ? void 0 : ast2.type) {
2325
2383
  case 0:
2326
2384
  // Number
2327
2385
  case 1:
2328
2386
  return ast2.value;
2329
2387
  case 5:
2330
2388
  if (ast2.value in evalContext) {
2331
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2332
- return evalContext[ast2.value]?.id;
2389
+ if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
2390
+ return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
2333
2391
  }
2334
- return evalContext[ast2.value] ?? false;
2392
+ return (_c = evalContext[ast2.value]) != null ? _c : false;
2335
2393
  } else if (ast2.value in BUILTINS) {
2336
2394
  return BUILTINS[ast2.value];
2337
2395
  } else {
@@ -2368,7 +2426,7 @@ function evaluate(ast, context = {}) {
2368
2426
  const args = ast2.args.map(_evaluate);
2369
2427
  const kwargs = {};
2370
2428
  for (const kwarg in ast2.kwargs) {
2371
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2429
+ kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
2372
2430
  }
2373
2431
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2374
2432
  return fnValue.create(...args, kwargs);
@@ -2447,9 +2505,25 @@ function escapeRegExp(str) {
2447
2505
  var InvalidDomainError = class extends Error {
2448
2506
  };
2449
2507
  var Domain = class _Domain {
2450
- ast = { type: -1, value: null };
2451
- static TRUE;
2452
- static FALSE;
2508
+ constructor(descr = []) {
2509
+ this.ast = { type: -1, value: null };
2510
+ if (descr instanceof _Domain) {
2511
+ return new _Domain(descr.toString());
2512
+ } else {
2513
+ let rawAST;
2514
+ try {
2515
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2516
+ } catch (error) {
2517
+ throw new InvalidDomainError(
2518
+ `Invalid domain representation: ${descr}`,
2519
+ {
2520
+ cause: error
2521
+ }
2522
+ );
2523
+ }
2524
+ this.ast = normalizeDomainAST(rawAST);
2525
+ }
2526
+ }
2453
2527
  static combine(domains, operator) {
2454
2528
  if (domains.length === 0) {
2455
2529
  return new _Domain([]);
@@ -2528,24 +2602,6 @@ var Domain = class _Domain {
2528
2602
  processLeaf(d.ast.value, 0, "&", newDomain);
2529
2603
  return newDomain;
2530
2604
  }
2531
- constructor(descr = []) {
2532
- if (descr instanceof _Domain) {
2533
- return new _Domain(descr.toString());
2534
- } else {
2535
- let rawAST;
2536
- try {
2537
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2538
- } catch (error) {
2539
- throw new InvalidDomainError(
2540
- `Invalid domain representation: ${descr}`,
2541
- {
2542
- cause: error
2543
- }
2544
- );
2545
- }
2546
- this.ast = normalizeDomainAST(rawAST);
2547
- }
2548
- }
2549
2605
  contains(record) {
2550
2606
  const expr = evaluate(this.ast, record);
2551
2607
  return matchDomain(record, expr);
@@ -2564,7 +2620,7 @@ var Domain = class _Domain {
2564
2620
  return evaluatedAsList;
2565
2621
  }
2566
2622
  return this.toString();
2567
- } catch {
2623
+ } catch (e) {
2568
2624
  return this.toString();
2569
2625
  }
2570
2626
  }
@@ -2764,7 +2820,7 @@ function matchDomain(record, domain) {
2764
2820
  }
2765
2821
 
2766
2822
  // src/utils/function.ts
2767
- import { useEffect, useState } from "react";
2823
+ var import_react = require("react");
2768
2824
  var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2769
2825
  if (!originalRequest.data) return originalRequest.data;
2770
2826
  if (typeof originalRequest.data === "string") {
@@ -2787,22 +2843,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2787
2843
 
2788
2844
  // src/utils/storage/local-storage.ts
2789
2845
  var localStorageUtils = () => {
2790
- const setToken = async (access_token) => {
2846
+ const setToken = (access_token) => __async(null, null, function* () {
2791
2847
  localStorage.setItem("accessToken", access_token);
2792
- };
2793
- const setRefreshToken = async (refresh_token) => {
2848
+ });
2849
+ const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2794
2850
  localStorage.setItem("refreshToken", refresh_token);
2795
- };
2796
- const getAccessToken = async () => {
2851
+ });
2852
+ const getAccessToken = () => __async(null, null, function* () {
2797
2853
  return localStorage.getItem("accessToken");
2798
- };
2799
- const getRefreshToken = async () => {
2854
+ });
2855
+ const getRefreshToken = () => __async(null, null, function* () {
2800
2856
  return localStorage.getItem("refreshToken");
2801
- };
2802
- const clearToken = async () => {
2857
+ });
2858
+ const clearToken = () => __async(null, null, function* () {
2803
2859
  localStorage.removeItem("accessToken");
2804
2860
  localStorage.removeItem("refreshToken");
2805
- };
2861
+ });
2806
2862
  return {
2807
2863
  setToken,
2808
2864
  setRefreshToken,
@@ -2814,9 +2870,9 @@ var localStorageUtils = () => {
2814
2870
 
2815
2871
  // src/utils/storage/session-storage.ts
2816
2872
  var sessionStorageUtils = () => {
2817
- const getBrowserSession = async () => {
2873
+ const getBrowserSession = () => __async(null, null, function* () {
2818
2874
  return sessionStorage.getItem("browserSession");
2819
- };
2875
+ });
2820
2876
  return {
2821
2877
  getBrowserSession
2822
2878
  };
@@ -2825,13 +2881,14 @@ var sessionStorageUtils = () => {
2825
2881
  // src/configs/axios-client.ts
2826
2882
  var axiosClient = {
2827
2883
  init(config) {
2828
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2829
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2884
+ var _a, _b;
2885
+ const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2886
+ const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2830
2887
  const db = config.db;
2831
2888
  let isRefreshing = false;
2832
2889
  let failedQueue = [];
2833
2890
  const processQueue = (error, token = null) => {
2834
- failedQueue?.forEach((prom) => {
2891
+ failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2835
2892
  if (error) {
2836
2893
  prom.reject(error);
2837
2894
  } else {
@@ -2840,39 +2897,44 @@ var axiosClient = {
2840
2897
  });
2841
2898
  failedQueue = [];
2842
2899
  };
2843
- const instance = axios.create({
2844
- adapter: axios.defaults.adapter,
2900
+ const instance = import_axios.default.create({
2901
+ adapter: import_axios.default.defaults.adapter,
2845
2902
  baseURL: config.baseUrl,
2846
2903
  timeout: 5e4,
2847
2904
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2848
2905
  });
2849
- instance.interceptors.request.use(async (config2) => {
2850
- const { useRefreshToken, useActionToken, actionToken } = config2;
2851
- if (useActionToken && actionToken) {
2852
- config2.headers["Action-Token"] = actionToken;
2906
+ instance.interceptors.request.use(
2907
+ (config2) => __async(null, null, function* () {
2908
+ const useRefreshToken = config2.useRefreshToken;
2909
+ const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2910
+ if (token) {
2911
+ config2.headers["Authorization"] = "Bearer " + token;
2912
+ }
2913
+ return config2;
2914
+ }),
2915
+ (error) => {
2916
+ Promise.reject(error);
2853
2917
  }
2854
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2855
- const token = await getToken?.();
2856
- if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2857
- return config2;
2858
- }, Promise.reject);
2918
+ );
2859
2919
  instance.interceptors.response.use(
2860
2920
  (response) => {
2861
2921
  return handleResponse(response);
2862
2922
  },
2863
- async (error) => {
2864
- const handleError3 = async (error2) => {
2923
+ (error) => __async(null, null, function* () {
2924
+ var _a2, _b2, _c;
2925
+ const handleError3 = (error2) => __async(null, null, function* () {
2926
+ var _a3;
2865
2927
  if (!error2.response) {
2866
2928
  return error2;
2867
2929
  }
2868
2930
  const { data } = error2.response;
2869
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2870
- await clearAuthToken();
2931
+ if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2932
+ yield clearAuthToken();
2871
2933
  }
2872
2934
  return data;
2873
- };
2935
+ });
2874
2936
  const originalRequest = error.config;
2875
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2937
+ if ((((_a2 = error.response) == null ? void 0 : _a2.status) === 403 || ((_b2 = error.response) == null ? void 0 : _b2.status) === 401 || ((_c = error.response) == null ? void 0 : _c.status) === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2876
2938
  error.response.data.code
2877
2939
  )) {
2878
2940
  if (isRefreshing) {
@@ -2885,18 +2947,19 @@ var axiosClient = {
2885
2947
  token
2886
2948
  );
2887
2949
  return instance.request(originalRequest);
2888
- }).catch(async (err) => {
2889
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2890
- await clearAuthToken();
2950
+ }).catch((err) => __async(null, null, function* () {
2951
+ var _a3, _b3;
2952
+ if ((((_a3 = err.response) == null ? void 0 : _a3.status) === 400 || ((_b3 = err.response) == null ? void 0 : _b3.status) === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2953
+ yield clearAuthToken();
2891
2954
  }
2892
- });
2955
+ }));
2893
2956
  }
2894
- const browserSession = await sessionStorage2.getBrowserSession();
2895
- const refreshToken = await localStorage2.getRefreshToken();
2896
- const accessTokenExp = await localStorage2.getAccessToken();
2957
+ const browserSession = yield sessionStorage2.getBrowserSession();
2958
+ const refreshToken = yield localStorage2.getRefreshToken();
2959
+ const accessTokenExp = yield localStorage2.getAccessToken();
2897
2960
  isRefreshing = true;
2898
2961
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2899
- await clearAuthToken();
2962
+ yield clearAuthToken();
2900
2963
  } else {
2901
2964
  const payload = Object.fromEntries(
2902
2965
  Object.entries({
@@ -2907,8 +2970,9 @@ var axiosClient = {
2907
2970
  }).filter(([_, value]) => !!value)
2908
2971
  );
2909
2972
  return new Promise(function(resolve) {
2910
- axios.post(
2911
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2973
+ var _a3;
2974
+ import_axios.default.post(
2975
+ `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2912
2976
  payload,
2913
2977
  {
2914
2978
  headers: {
@@ -2916,11 +2980,11 @@ var axiosClient = {
2916
2980
  Authorization: `Bearer ${accessTokenExp}`
2917
2981
  }
2918
2982
  }
2919
- ).then(async (res) => {
2983
+ ).then((res) => __async(null, null, function* () {
2920
2984
  const data = res.data;
2921
- await localStorage2.setToken(data.access_token);
2922
- await localStorage2.setRefreshToken(data.refresh_token);
2923
- axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2985
+ yield localStorage2.setToken(data.access_token);
2986
+ yield localStorage2.setRefreshToken(data.refresh_token);
2987
+ import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2924
2988
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2925
2989
  originalRequest.data = updateTokenParamInOriginalRequest(
2926
2990
  originalRequest,
@@ -2928,25 +2992,26 @@ var axiosClient = {
2928
2992
  );
2929
2993
  processQueue(null, data.access_token);
2930
2994
  resolve(instance.request(originalRequest));
2931
- }).catch(async (err) => {
2932
- if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
2933
- await clearAuthToken();
2995
+ })).catch((err) => __async(null, null, function* () {
2996
+ var _a4;
2997
+ if (err && ((err == null ? void 0 : err.error_code) === "AUTHEN_FAIL" || (err == null ? void 0 : err.error_code) === "TOKEN_EXPIRED" || (err == null ? void 0 : err.error_code) === "TOKEN_INCORRECT" || (err == null ? void 0 : err.code) === "ERR_BAD_REQUEST") || (err == null ? void 0 : err.error_code) === "ERR_2FA_006") {
2998
+ yield clearAuthToken();
2934
2999
  }
2935
3000
  if (err && err.response) {
2936
- const { error_code } = err.response?.data || {};
3001
+ const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2937
3002
  if (error_code === "AUTHEN_FAIL") {
2938
- await clearAuthToken();
3003
+ yield clearAuthToken();
2939
3004
  }
2940
3005
  }
2941
3006
  processQueue(err, null);
2942
- }).finally(() => {
3007
+ })).finally(() => {
2943
3008
  isRefreshing = false;
2944
3009
  });
2945
3010
  });
2946
3011
  }
2947
3012
  }
2948
- return Promise.reject(await handleError3(error));
2949
- }
3013
+ return Promise.reject(yield handleError3(error));
3014
+ })
2950
3015
  );
2951
3016
  const handleResponse = (res) => {
2952
3017
  if (res && res.data) {
@@ -2955,6 +3020,7 @@ var axiosClient = {
2955
3020
  return res;
2956
3021
  };
2957
3022
  const handleError2 = (error) => {
3023
+ var _a2, _b2, _c;
2958
3024
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2959
3025
  console.error("Request Timeout Error:", error);
2960
3026
  return "Request Timeout Error";
@@ -2962,17 +3028,17 @@ var axiosClient = {
2962
3028
  console.error("Network Error:", error);
2963
3029
  return "Network Error";
2964
3030
  } else {
2965
- console.error("Other Error:", error?.response);
2966
- const errorMessage = error?.response?.data?.message || "An error occurred";
2967
- return { message: errorMessage, status: error?.response?.status };
3031
+ console.error("Other Error:", error == null ? void 0 : error.response);
3032
+ const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
3033
+ return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
2968
3034
  }
2969
3035
  };
2970
- const clearAuthToken = async () => {
2971
- await localStorage2.clearToken();
3036
+ const clearAuthToken = () => __async(null, null, function* () {
3037
+ yield localStorage2.clearToken();
2972
3038
  if (typeof window !== "undefined") {
2973
3039
  window.location.href = `/login`;
2974
3040
  }
2975
- };
3041
+ });
2976
3042
  function formatUrl(url, db2) {
2977
3043
  return url + (db2 ? "?db=" + db2 : "");
2978
3044
  }
@@ -2996,557 +3062,592 @@ var axiosClient = {
2996
3062
  };
2997
3063
 
2998
3064
  // src/environment/EnvStore.ts
2999
- var EnvStore = class {
3000
- baseUrl;
3001
- requests;
3002
- context;
3003
- defaultCompany;
3004
- config;
3005
- companies;
3006
- user;
3007
- db;
3008
- localStorageUtils;
3009
- sessionStorageUtils;
3010
- refreshTokenEndpoint;
3011
- constructor(localStorageUtils2, sessionStorageUtils2) {
3065
+ var _EnvStore = class _EnvStore {
3066
+ constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3067
+ this.envStore = envStore2;
3012
3068
  this.localStorageUtils = localStorageUtils2;
3013
3069
  this.sessionStorageUtils = sessionStorageUtils2;
3014
3070
  this.setup();
3015
3071
  }
3072
+ static getInstance(envStore2, localStorageUtils2, sessionStorageUtils2) {
3073
+ if (!_EnvStore.instance) {
3074
+ _EnvStore.instance = new _EnvStore(
3075
+ envStore2,
3076
+ localStorageUtils2,
3077
+ sessionStorageUtils2
3078
+ );
3079
+ }
3080
+ return _EnvStore.instance;
3081
+ }
3016
3082
  setup() {
3017
- const env2 = envStore.getState().env;
3018
- this.baseUrl = env2?.baseUrl;
3019
- this.context = env2?.context;
3020
- this.defaultCompany = env2?.defaultCompany;
3021
- this.config = env2?.config;
3022
- this.companies = env2?.companies || [];
3023
- this.user = env2?.user;
3024
- this.db = env2?.db;
3025
- this.requests = env2?.requests;
3026
- this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3083
+ const env = this.envStore.getState().env;
3084
+ this.baseUrl = env == null ? void 0 : env.baseUrl;
3085
+ this.requests = env == null ? void 0 : env.requests;
3086
+ this.context = env == null ? void 0 : env.context;
3087
+ this.defaultCompany = env == null ? void 0 : env.defaultCompany;
3088
+ this.config = env == null ? void 0 : env.config;
3089
+ this.companies = (env == null ? void 0 : env.companies) || [];
3090
+ this.user = env == null ? void 0 : env.user;
3091
+ this.db = env == null ? void 0 : env.db;
3092
+ this.refreshTokenEndpoint = env == null ? void 0 : env.refreshTokenEndpoint;
3093
+ console.log("Env setup:", this);
3027
3094
  }
3028
3095
  setupEnv(envConfig) {
3029
- let env2 = {
3030
- ...envConfig,
3096
+ const dispatch = this.envStore.dispatch;
3097
+ const env = __spreadProps(__spreadValues({}, envConfig), {
3031
3098
  localStorageUtils: this.localStorageUtils,
3032
3099
  sessionStorageUtils: this.sessionStorageUtils
3033
- };
3034
- const requests = axiosClient.init(env2);
3035
- this.requests = requests;
3036
- const dispatch = envStore.dispatch;
3037
- dispatch(
3038
- setEnv({
3039
- ...env2,
3040
- requests
3041
- })
3042
- );
3100
+ });
3101
+ const requests = axiosClient.init(env);
3102
+ dispatch(setEnv(__spreadProps(__spreadValues({}, env), { requests })));
3043
3103
  this.setup();
3044
- return { ...env2, requests };
3045
3104
  }
3046
3105
  setUid(uid) {
3047
- const dispatch = envStore.dispatch;
3106
+ const dispatch = this.envStore.dispatch;
3048
3107
  dispatch(setUid(uid));
3049
3108
  this.setup();
3050
3109
  }
3051
3110
  setLang(lang) {
3052
- const dispatch = envStore.dispatch;
3111
+ const dispatch = this.envStore.dispatch;
3053
3112
  dispatch(setLang(lang));
3054
3113
  this.setup();
3055
3114
  }
3056
3115
  setAllowCompanies(allowCompanies) {
3057
- const dispatch = envStore.dispatch;
3116
+ const dispatch = this.envStore.dispatch;
3058
3117
  dispatch(setAllowCompanies(allowCompanies));
3059
3118
  this.setup();
3060
3119
  }
3061
3120
  setCompanies(companies) {
3062
- const dispatch = envStore.dispatch;
3121
+ const dispatch = this.envStore.dispatch;
3063
3122
  dispatch(setCompanies(companies));
3064
3123
  this.setup();
3065
3124
  }
3066
3125
  setDefaultCompany(company) {
3067
- const dispatch = envStore.dispatch;
3126
+ const dispatch = this.envStore.dispatch;
3068
3127
  dispatch(setDefaultCompany(company));
3069
3128
  this.setup();
3070
3129
  }
3071
3130
  setUserInfo(userInfo) {
3072
- const dispatch = envStore.dispatch;
3131
+ const dispatch = this.envStore.dispatch;
3073
3132
  dispatch(setUser(userInfo));
3074
3133
  this.setup();
3075
3134
  }
3076
3135
  };
3077
- var env = null;
3136
+ _EnvStore.instance = null;
3137
+ var EnvStore = _EnvStore;
3078
3138
  function getEnv() {
3079
- if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
3080
- return env;
3139
+ const instance = EnvStore.getInstance(envStore);
3140
+ if (!instance) {
3141
+ throw new Error("EnvStore has not been initialized \u2014 call initEnv() first");
3142
+ }
3143
+ return instance;
3081
3144
  }
3082
3145
 
3083
3146
  // src/services/view-service/index.ts
3084
3147
  var ViewService = {
3085
- async getView({
3086
- model,
3087
- views,
3088
- context = {},
3089
- options = {},
3090
- aid
3091
- }) {
3092
- const env2 = getEnv();
3093
- const defaultOptions = {
3094
- load_filters: true,
3095
- toolbar: true,
3096
- action_id: aid
3097
- };
3098
- const jsonDataView = {
3148
+ getView(_0) {
3149
+ return __async(this, arguments, function* ({
3099
3150
  model,
3100
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3101
- kwargs: {
3102
- views,
3103
- options: { ...options, ...defaultOptions }
3104
- },
3105
- with_context: context
3106
- };
3107
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
3108
- headers: {
3109
- "Content-Type": "application/json"
3110
- }
3151
+ views,
3152
+ context = {},
3153
+ options = {},
3154
+ aid
3155
+ }) {
3156
+ var _a;
3157
+ const env = getEnv();
3158
+ const defaultOptions = {
3159
+ load_filters: true,
3160
+ toolbar: true,
3161
+ action_id: aid
3162
+ };
3163
+ const jsonDataView = {
3164
+ model,
3165
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3166
+ kwargs: {
3167
+ views,
3168
+ options: __spreadValues(__spreadValues({}, options), defaultOptions)
3169
+ },
3170
+ with_context: context
3171
+ };
3172
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
3173
+ headers: {
3174
+ "Content-Type": "application/json"
3175
+ }
3176
+ });
3111
3177
  });
3112
3178
  },
3113
- async getMenu(context) {
3114
- const env2 = getEnv();
3115
- const jsonData = {
3116
- model: "ir.ui.menu" /* MENU */,
3117
- method: "web_search_read" /* WEB_SEARCH_READ */,
3118
- ids: [],
3119
- with_context: context,
3120
- kwargs: {
3121
- specification: {
3122
- active: {},
3123
- name: {},
3124
- is_display: {},
3125
- sequence: {},
3126
- complete_name: {},
3127
- action: {
3128
- fields: {
3129
- display_name: {},
3130
- type: {},
3131
- binding_view_types: {}
3132
- // res_model: {},
3133
- }
3134
- },
3135
- url_icon: {},
3136
- web_icon: {},
3137
- web_icon_data: {},
3138
- groups_id: {
3139
- fields: {
3140
- full_name: {}
3179
+ getMenu(context) {
3180
+ return __async(this, null, function* () {
3181
+ var _a;
3182
+ const env = getEnv();
3183
+ const jsonData = {
3184
+ model: "ir.ui.menu" /* MENU */,
3185
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3186
+ ids: [],
3187
+ with_context: context,
3188
+ kwargs: {
3189
+ specification: {
3190
+ active: {},
3191
+ name: {},
3192
+ is_display: {},
3193
+ sequence: {},
3194
+ complete_name: {},
3195
+ action: {
3196
+ fields: {
3197
+ display_name: {},
3198
+ type: {},
3199
+ binding_view_types: {}
3200
+ // res_model: {},
3201
+ }
3141
3202
  },
3142
- limit: 40,
3143
- order: ""
3144
- },
3145
- display_name: {},
3146
- child_id: {
3147
- fields: {
3148
- active: {},
3149
- name: {},
3150
- is_display: {},
3151
- sequence: {},
3152
- complete_name: {},
3153
- action: {
3154
- fields: {
3155
- display_name: {},
3156
- type: {},
3157
- binding_view_types: {}
3158
- // res_model: {},
3159
- }
3203
+ url_icon: {},
3204
+ web_icon: {},
3205
+ web_icon_data: {},
3206
+ groups_id: {
3207
+ fields: {
3208
+ full_name: {}
3160
3209
  },
3161
- url_icon: {},
3162
- web_icon: {},
3163
- web_icon_data: {},
3164
- groups_id: {
3165
- fields: {
3166
- full_name: {}
3210
+ limit: 40,
3211
+ order: ""
3212
+ },
3213
+ display_name: {},
3214
+ child_id: {
3215
+ fields: {
3216
+ active: {},
3217
+ name: {},
3218
+ is_display: {},
3219
+ sequence: {},
3220
+ complete_name: {},
3221
+ action: {
3222
+ fields: {
3223
+ display_name: {},
3224
+ type: {},
3225
+ binding_view_types: {}
3226
+ // res_model: {},
3227
+ }
3167
3228
  },
3168
- limit: 40,
3169
- order: ""
3170
- },
3171
- display_name: {},
3172
- child_id: {
3173
- fields: {
3174
- active: {},
3175
- name: {},
3176
- is_display: {},
3177
- sequence: {},
3178
- complete_name: {},
3179
- action: {
3180
- fields: {
3181
- display_name: {},
3182
- type: {},
3183
- binding_view_types: {}
3184
- // res_model: {},
3185
- }
3229
+ url_icon: {},
3230
+ web_icon: {},
3231
+ web_icon_data: {},
3232
+ groups_id: {
3233
+ fields: {
3234
+ full_name: {}
3186
3235
  },
3187
- url_icon: {},
3188
- web_icon: {},
3189
- web_icon_data: {},
3190
- groups_id: {
3191
- fields: {
3192
- full_name: {}
3236
+ limit: 40,
3237
+ order: ""
3238
+ },
3239
+ display_name: {},
3240
+ child_id: {
3241
+ fields: {
3242
+ active: {},
3243
+ name: {},
3244
+ is_display: {},
3245
+ sequence: {},
3246
+ complete_name: {},
3247
+ action: {
3248
+ fields: {
3249
+ display_name: {},
3250
+ type: {},
3251
+ binding_view_types: {}
3252
+ // res_model: {},
3253
+ }
3193
3254
  },
3194
- limit: 40,
3195
- order: ""
3196
- },
3197
- display_name: {},
3198
- child_id: {
3199
- fields: {
3200
- active: {},
3201
- name: {},
3202
- is_display: {},
3203
- sequence: {},
3204
- complete_name: {},
3205
- action: {
3206
- fields: {
3207
- display_name: {},
3208
- type: {},
3209
- binding_view_types: {}
3210
- // res_model: {},
3211
- }
3255
+ url_icon: {},
3256
+ web_icon: {},
3257
+ web_icon_data: {},
3258
+ groups_id: {
3259
+ fields: {
3260
+ full_name: {}
3212
3261
  },
3213
- url_icon: {},
3214
- web_icon: {},
3215
- web_icon_data: {},
3216
- groups_id: {
3217
- fields: {
3218
- full_name: {}
3262
+ limit: 40,
3263
+ order: ""
3264
+ },
3265
+ display_name: {},
3266
+ child_id: {
3267
+ fields: {
3268
+ active: {},
3269
+ name: {},
3270
+ is_display: {},
3271
+ sequence: {},
3272
+ complete_name: {},
3273
+ action: {
3274
+ fields: {
3275
+ display_name: {},
3276
+ type: {},
3277
+ binding_view_types: {}
3278
+ // res_model: {},
3279
+ }
3219
3280
  },
3220
- limit: 40,
3221
- order: ""
3281
+ url_icon: {},
3282
+ web_icon: {},
3283
+ web_icon_data: {},
3284
+ groups_id: {
3285
+ fields: {
3286
+ full_name: {}
3287
+ },
3288
+ limit: 40,
3289
+ order: ""
3290
+ },
3291
+ display_name: {},
3292
+ child_id: {
3293
+ fields: {},
3294
+ limit: 40,
3295
+ order: ""
3296
+ }
3222
3297
  },
3223
- display_name: {},
3224
- child_id: {
3225
- fields: {},
3226
- limit: 40,
3227
- order: ""
3228
- }
3229
- },
3230
- limit: 40,
3231
- order: ""
3232
- }
3233
- },
3234
- limit: 40,
3235
- order: ""
3236
- }
3237
- },
3238
- limit: 40,
3239
- order: ""
3240
- }
3241
- },
3242
- domain: [
3243
- "&",
3244
- ["is_display", "=", true],
3245
- "&",
3246
- ["active", "=", true],
3247
- ["parent_id", "=", false]
3248
- ]
3249
- }
3250
- };
3251
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3252
- headers: {
3253
- "Content-Type": "application/json"
3254
- }
3298
+ limit: 40,
3299
+ order: ""
3300
+ }
3301
+ },
3302
+ limit: 40,
3303
+ order: ""
3304
+ }
3305
+ },
3306
+ limit: 40,
3307
+ order: ""
3308
+ }
3309
+ },
3310
+ domain: [
3311
+ "&",
3312
+ ["is_display", "=", true],
3313
+ "&",
3314
+ ["active", "=", true],
3315
+ ["parent_id", "=", false]
3316
+ ]
3317
+ }
3318
+ };
3319
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3320
+ headers: {
3321
+ "Content-Type": "application/json"
3322
+ }
3323
+ });
3255
3324
  });
3256
3325
  },
3257
- async getActionDetail(aid, context) {
3258
- const env2 = getEnv();
3259
- const jsonData = {
3260
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
3261
- method: "web_read" /* WEB_READ */,
3262
- ids: [aid],
3263
- with_context: context,
3264
- kwargs: {
3265
- specification: {
3266
- id: {},
3267
- name: {},
3268
- res_model: {},
3269
- views: {},
3270
- view_mode: {},
3271
- mobile_view_mode: {},
3272
- domain: {},
3273
- context: {},
3274
- groups_id: {},
3275
- search_view_id: {}
3326
+ getActionDetail(aid, context) {
3327
+ return __async(this, null, function* () {
3328
+ var _a;
3329
+ const env = getEnv();
3330
+ const jsonData = {
3331
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
3332
+ method: "web_read" /* WEB_READ */,
3333
+ ids: [aid],
3334
+ with_context: context,
3335
+ kwargs: {
3336
+ specification: {
3337
+ id: {},
3338
+ name: {},
3339
+ res_model: {},
3340
+ views: {},
3341
+ view_mode: {},
3342
+ mobile_view_mode: {},
3343
+ domain: {},
3344
+ context: {},
3345
+ groups_id: {},
3346
+ search_view_id: {}
3347
+ }
3276
3348
  }
3277
- }
3278
- };
3279
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3280
- headers: {
3281
- "Content-Type": "application/json"
3282
- }
3349
+ };
3350
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3351
+ headers: {
3352
+ "Content-Type": "application/json"
3353
+ }
3354
+ });
3283
3355
  });
3284
3356
  },
3285
- async getResequence({
3286
- model,
3287
- ids,
3288
- context,
3289
- offset
3290
- }) {
3291
- const env2 = getEnv();
3292
- const jsonData = {
3357
+ getResequence(_0) {
3358
+ return __async(this, arguments, function* ({
3293
3359
  model,
3294
- with_context: context,
3295
3360
  ids,
3296
- field: "sequence",
3297
- ...offset > 0 ? { offset } : {}
3298
- };
3299
- return env2?.requests.post("/web/dataset/resequence", jsonData, {
3300
- headers: {
3301
- "Content-Type": "application/json"
3302
- }
3361
+ context,
3362
+ offset
3363
+ }) {
3364
+ const env = getEnv();
3365
+ const jsonData = __spreadValues({
3366
+ model,
3367
+ with_context: context,
3368
+ ids,
3369
+ field: "sequence"
3370
+ }, offset > 0 ? { offset } : {});
3371
+ return env == null ? void 0 : env.requests.post("/web/dataset/resequence", jsonData, {
3372
+ headers: {
3373
+ "Content-Type": "application/json"
3374
+ }
3375
+ });
3303
3376
  });
3304
3377
  },
3305
- async getSelectionItem({ data }) {
3306
- const env2 = getEnv();
3307
- const jsonData = {
3308
- model: data.model,
3309
- ids: [],
3310
- method: "get_data_select",
3311
- with_context: data.context,
3312
- kwargs: {
3313
- count_limit: 10001,
3314
- domain: data.domain ? data.domain : [],
3315
- offset: 0,
3316
- order: "",
3317
- specification: data?.specification ?? {
3318
- id: {},
3319
- name: {},
3320
- display_name: {}
3378
+ getSelectionItem(_0) {
3379
+ return __async(this, arguments, function* ({ data }) {
3380
+ var _a;
3381
+ const env = getEnv();
3382
+ const jsonData = {
3383
+ model: data.model,
3384
+ ids: [],
3385
+ method: "get_data_select",
3386
+ with_context: data.context,
3387
+ kwargs: {
3388
+ count_limit: 10001,
3389
+ domain: data.domain ? data.domain : [],
3390
+ offset: 0,
3391
+ order: "",
3392
+ specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
3393
+ id: {},
3394
+ name: {},
3395
+ display_name: {}
3396
+ }
3321
3397
  }
3322
- }
3323
- };
3324
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3325
- headers: {
3326
- "Content-Type": "application/json"
3327
- }
3398
+ };
3399
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3400
+ headers: {
3401
+ "Content-Type": "application/json"
3402
+ }
3403
+ });
3404
+ });
3405
+ },
3406
+ loadMessages() {
3407
+ return __async(this, null, function* () {
3408
+ const env = getEnv();
3409
+ return env.requests.post(
3410
+ "/load_message_failures" /* LOAD_MESSAGE */,
3411
+ {},
3412
+ {
3413
+ headers: {
3414
+ "Content-Type": "application/json"
3415
+ }
3416
+ }
3417
+ );
3328
3418
  });
3329
3419
  },
3330
- async loadMessages() {
3331
- const env2 = getEnv();
3332
- return env2.requests.post(
3333
- "/load_message_failures" /* LOAD_MESSAGE */,
3334
- {},
3335
- {
3420
+ getVersion() {
3421
+ return __async(this, null, function* () {
3422
+ var _a;
3423
+ const env = getEnv();
3424
+ console.log("env?.requests", env, env == null ? void 0 : env.requests);
3425
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.get("", {
3336
3426
  headers: {
3337
3427
  "Content-Type": "application/json"
3338
3428
  }
3339
- }
3340
- );
3341
- },
3342
- async getVersion() {
3343
- const env2 = getEnv();
3344
- return env2?.requests.get("", {
3345
- headers: {
3346
- "Content-Type": "application/json"
3347
- }
3429
+ });
3348
3430
  });
3349
3431
  },
3350
- async get2FAMethods({
3351
- method,
3352
- with_context
3353
- }) {
3354
- const env2 = getEnv();
3355
- const jsonData = {
3432
+ get2FAMethods(_0) {
3433
+ return __async(this, arguments, function* ({
3356
3434
  method,
3357
3435
  with_context
3358
- };
3359
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3360
- headers: {
3361
- "Content-Type": "application/json"
3362
- }
3436
+ }) {
3437
+ const env = getEnv();
3438
+ const jsonData = {
3439
+ method,
3440
+ with_context
3441
+ };
3442
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3443
+ headers: {
3444
+ "Content-Type": "application/json"
3445
+ }
3446
+ });
3363
3447
  });
3364
3448
  },
3365
- async verify2FA({
3366
- method,
3367
- with_context,
3368
- code,
3369
- device,
3370
- location
3371
- }) {
3372
- const env2 = getEnv();
3373
- const jsonData = {
3449
+ verify2FA(_0) {
3450
+ return __async(this, arguments, function* ({
3374
3451
  method,
3375
- kwargs: {
3376
- vals: {
3377
- code,
3378
- device,
3379
- location
3380
- }
3381
- },
3382
- with_context
3383
- };
3384
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3385
- headers: {
3386
- "Content-Type": "application/json"
3387
- },
3388
- withCredentials: true
3452
+ with_context,
3453
+ code,
3454
+ device,
3455
+ location
3456
+ }) {
3457
+ const env = getEnv();
3458
+ const jsonData = {
3459
+ method,
3460
+ kwargs: {
3461
+ vals: {
3462
+ code,
3463
+ device,
3464
+ location
3465
+ }
3466
+ },
3467
+ with_context
3468
+ };
3469
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3470
+ headers: {
3471
+ "Content-Type": "application/json"
3472
+ },
3473
+ withCredentials: true
3474
+ });
3389
3475
  });
3390
3476
  },
3391
- async signInSSO({
3392
- redirect_uri,
3393
- state,
3394
- client_id,
3395
- response_type,
3396
- path
3397
- }) {
3398
- const env2 = getEnv();
3399
- const params = new URLSearchParams({
3400
- response_type,
3401
- client_id,
3477
+ signInSSO(_0) {
3478
+ return __async(this, arguments, function* ({
3402
3479
  redirect_uri,
3403
- state
3404
- });
3405
- const url = `${path}?${params.toString()}`;
3406
- return env2?.requests.get(url, {
3407
- headers: {
3408
- "Content-Type": "application/json"
3409
- },
3410
- withCredentials: true
3480
+ state,
3481
+ client_id,
3482
+ response_type,
3483
+ path
3484
+ }) {
3485
+ const env = getEnv();
3486
+ const params = new URLSearchParams({
3487
+ response_type,
3488
+ client_id,
3489
+ redirect_uri,
3490
+ state
3491
+ });
3492
+ const url = `${path}?${params.toString()}`;
3493
+ return env == null ? void 0 : env.requests.get(url, {
3494
+ headers: {
3495
+ "Content-Type": "application/json"
3496
+ },
3497
+ withCredentials: true
3498
+ });
3411
3499
  });
3412
3500
  },
3413
- async grantAccess({
3414
- redirect_uri,
3415
- state,
3416
- client_id,
3417
- scopes
3418
- }) {
3419
- const env2 = getEnv();
3420
- const jsonData = {
3501
+ grantAccess(_0) {
3502
+ return __async(this, arguments, function* ({
3421
3503
  redirect_uri,
3422
3504
  state,
3423
3505
  client_id,
3424
3506
  scopes
3425
- };
3426
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3427
- headers: {
3428
- "Content-Type": "application/json"
3429
- },
3430
- withCredentials: true
3507
+ }) {
3508
+ const env = getEnv();
3509
+ const jsonData = {
3510
+ redirect_uri,
3511
+ state,
3512
+ client_id,
3513
+ scopes
3514
+ };
3515
+ return env == null ? void 0 : env.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3516
+ headers: {
3517
+ "Content-Type": "application/json"
3518
+ },
3519
+ withCredentials: true
3520
+ });
3431
3521
  });
3432
3522
  },
3433
- async getFieldsViewSecurity({
3434
- method,
3435
- token,
3436
- views
3437
- }) {
3438
- const env2 = getEnv();
3439
- const jsonData = {
3523
+ getFieldsViewSecurity(_0) {
3524
+ return __async(this, arguments, function* ({
3440
3525
  method,
3441
- kwargs: {
3442
- views
3443
- },
3444
- with_context: {
3445
- token
3446
- }
3447
- };
3448
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3449
- headers: {
3450
- "Content-Type": "application/json"
3451
- }
3526
+ token,
3527
+ views
3528
+ }) {
3529
+ const env = getEnv();
3530
+ const jsonData = {
3531
+ method,
3532
+ kwargs: {
3533
+ views
3534
+ },
3535
+ with_context: {
3536
+ token
3537
+ }
3538
+ };
3539
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3540
+ headers: {
3541
+ "Content-Type": "application/json"
3542
+ }
3543
+ });
3452
3544
  });
3453
3545
  },
3454
- async settingsWebRead2fa({
3455
- method,
3456
- model,
3457
- kwargs,
3458
- token
3459
- }) {
3460
- const env2 = getEnv();
3461
- const jsonData = {
3546
+ settingsWebRead2fa(_0) {
3547
+ return __async(this, arguments, function* ({
3462
3548
  method,
3463
3549
  model,
3464
3550
  kwargs,
3465
- with_context: {
3466
- token
3467
- }
3468
- };
3469
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3470
- headers: {
3471
- "Content-Type": "application/json"
3472
- }
3551
+ token
3552
+ }) {
3553
+ const env = getEnv();
3554
+ const jsonData = {
3555
+ method,
3556
+ model,
3557
+ kwargs,
3558
+ with_context: {
3559
+ token
3560
+ }
3561
+ };
3562
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3563
+ headers: {
3564
+ "Content-Type": "application/json"
3565
+ }
3566
+ });
3473
3567
  });
3474
3568
  },
3475
- async requestSetupTotp({ method, token }) {
3476
- const env2 = getEnv();
3477
- const jsonData = {
3478
- method,
3479
- with_context: {
3480
- token
3481
- }
3482
- };
3483
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3484
- headers: {
3485
- "Content-Type": "application/json"
3486
- }
3569
+ requestSetupTotp(_0) {
3570
+ return __async(this, arguments, function* ({ method, token }) {
3571
+ const env = getEnv();
3572
+ const jsonData = {
3573
+ method,
3574
+ with_context: {
3575
+ token
3576
+ }
3577
+ };
3578
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3579
+ headers: {
3580
+ "Content-Type": "application/json"
3581
+ }
3582
+ });
3487
3583
  });
3488
3584
  },
3489
- async verifyTotp({
3490
- method,
3491
- action_token,
3492
- code
3493
- }) {
3494
- const env2 = getEnv();
3495
- const jsonData = {
3585
+ verifyTotp(_0) {
3586
+ return __async(this, arguments, function* ({
3496
3587
  method,
3497
- kwargs: {
3498
- vals: {
3499
- code
3588
+ action_token,
3589
+ code
3590
+ }) {
3591
+ const env = getEnv();
3592
+ const jsonData = {
3593
+ method,
3594
+ kwargs: {
3595
+ vals: {
3596
+ code
3597
+ }
3598
+ },
3599
+ with_context: {
3600
+ action_token
3500
3601
  }
3501
- },
3502
- with_context: {
3503
- action_token
3504
- }
3505
- };
3506
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3507
- headers: {
3508
- "Content-Type": "application/json"
3509
- }
3602
+ };
3603
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3604
+ headers: {
3605
+ "Content-Type": "application/json"
3606
+ }
3607
+ });
3510
3608
  });
3511
3609
  },
3512
- async removeTotpSetUp({ method, token }) {
3513
- const env2 = getEnv();
3514
- const jsonData = {
3515
- method,
3516
- with_context: {
3517
- token
3518
- }
3519
- };
3520
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3521
- headers: {
3522
- "Content-Type": "application/json"
3523
- }
3610
+ removeTotpSetUp(_0) {
3611
+ return __async(this, arguments, function* ({ method, token }) {
3612
+ const env = getEnv();
3613
+ const jsonData = {
3614
+ method,
3615
+ with_context: {
3616
+ token
3617
+ }
3618
+ };
3619
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3620
+ headers: {
3621
+ "Content-Type": "application/json"
3622
+ }
3623
+ });
3524
3624
  });
3525
3625
  }
3526
3626
  };
3527
3627
  var view_service_default = ViewService;
3528
3628
 
3529
3629
  // src/provider/version-gate-provider.tsx
3530
- import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
3630
+ var import_jsx_runtime4 = require("react/jsx-runtime");
3531
3631
  var VersionGate = ({ children }) => {
3532
- const queryClient = useQueryClient();
3533
- const [ready, setReady] = useState2(false);
3534
- useEffect2(() => {
3632
+ const queryClient = (0, import_react_query2.useQueryClient)();
3633
+ const [ready, setReady] = (0, import_react2.useState)(false);
3634
+ (0, import_react2.useEffect)(() => {
3535
3635
  const clearVersion = () => {
3536
3636
  queryClient.clear();
3537
3637
  localStorage.removeItem("__api_version__");
3538
3638
  };
3539
- const validateVersion = async () => {
3540
- const serverVersion = await view_service_default.getVersion();
3639
+ const validateVersion = () => __async(null, null, function* () {
3640
+ const serverVersion = yield view_service_default.getVersion();
3641
+ console.log("serverVersion", serverVersion);
3541
3642
  const cached = localStorage.getItem("__api_version__");
3542
- if (cached !== serverVersion?.api_version) {
3643
+ if (cached !== (serverVersion == null ? void 0 : serverVersion.api_version)) {
3543
3644
  clearVersion();
3544
- localStorage.setItem("__api_version__", serverVersion?.api_version);
3645
+ localStorage.setItem("__api_version__", serverVersion == null ? void 0 : serverVersion.api_version);
3545
3646
  } else {
3546
- console.log("Api version:", serverVersion?.api_version);
3647
+ console.log("Api version:", serverVersion == null ? void 0 : serverVersion.api_version);
3547
3648
  }
3548
3649
  setReady(true);
3549
- };
3650
+ });
3550
3651
  validateVersion();
3551
3652
  if (typeof window !== "undefined") {
3552
3653
  const onKey = (e) => {
@@ -3558,10 +3659,11 @@ var VersionGate = ({ children }) => {
3558
3659
  return () => window.removeEventListener("keydown", onKey);
3559
3660
  }
3560
3661
  }, [queryClient]);
3561
- return ready ? /* @__PURE__ */ jsx4(Fragment, { children }) : null;
3662
+ return ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children }) : null;
3562
3663
  };
3563
- export {
3664
+ // Annotate the CommonJS export names for ESM import in node:
3665
+ 0 && (module.exports = {
3564
3666
  MainProvider,
3565
3667
  ReactQueryProvider,
3566
3668
  VersionGate
3567
- };
3669
+ });