@fctc/interface-logic 1.7.1 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.mjs CHANGED
@@ -31,619 +31,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
31
31
  return UriConstants2;
32
32
  })(UriConstants || {});
33
33
 
34
- // src/store/store.ts
35
- import { configureStore } from "@reduxjs/toolkit";
36
-
37
- // node_modules/redux/dist/redux.mjs
38
- function formatProdErrorMessage(code) {
39
- return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
40
- }
41
- var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
42
- var ActionTypes = {
43
- INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
44
- REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
45
- PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
46
- };
47
- var actionTypes_default = ActionTypes;
48
- function isPlainObject(obj) {
49
- if (typeof obj !== "object" || obj === null)
50
- return false;
51
- let proto = obj;
52
- while (Object.getPrototypeOf(proto) !== null) {
53
- proto = Object.getPrototypeOf(proto);
54
- }
55
- return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
56
- }
57
- function miniKindOf(val) {
58
- if (val === void 0)
59
- return "undefined";
60
- if (val === null)
61
- return "null";
62
- const type = typeof val;
63
- switch (type) {
64
- case "boolean":
65
- case "string":
66
- case "number":
67
- case "symbol":
68
- case "function": {
69
- return type;
70
- }
71
- }
72
- if (Array.isArray(val))
73
- return "array";
74
- if (isDate(val))
75
- return "date";
76
- if (isError(val))
77
- return "error";
78
- const constructorName = ctorName(val);
79
- switch (constructorName) {
80
- case "Symbol":
81
- case "Promise":
82
- case "WeakMap":
83
- case "WeakSet":
84
- case "Map":
85
- case "Set":
86
- return constructorName;
87
- }
88
- return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
89
- }
90
- function ctorName(val) {
91
- return typeof val.constructor === "function" ? val.constructor.name : null;
92
- }
93
- function isError(val) {
94
- return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
95
- }
96
- function isDate(val) {
97
- if (val instanceof Date)
98
- return true;
99
- return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
100
- }
101
- function kindOf(val) {
102
- let typeOfVal = typeof val;
103
- if (process.env.NODE_ENV !== "production") {
104
- typeOfVal = miniKindOf(val);
105
- }
106
- return typeOfVal;
107
- }
108
- function warning(message) {
109
- if (typeof console !== "undefined" && typeof console.error === "function") {
110
- console.error(message);
111
- }
112
- try {
113
- throw new Error(message);
114
- } catch (e) {
115
- }
116
- }
117
- function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
118
- const reducerKeys = Object.keys(reducers);
119
- const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
120
- if (reducerKeys.length === 0) {
121
- return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
122
- }
123
- if (!isPlainObject(inputState)) {
124
- return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
125
- }
126
- const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
127
- unexpectedKeys.forEach((key) => {
128
- unexpectedKeyCache[key] = true;
129
- });
130
- if (action && action.type === actionTypes_default.REPLACE)
131
- return;
132
- if (unexpectedKeys.length > 0) {
133
- return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
134
- }
135
- }
136
- function assertReducerShape(reducers) {
137
- Object.keys(reducers).forEach((key) => {
138
- const reducer = reducers[key];
139
- const initialState10 = reducer(void 0, {
140
- type: actionTypes_default.INIT
141
- });
142
- if (typeof initialState10 === "undefined") {
143
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
144
- }
145
- if (typeof reducer(void 0, {
146
- type: actionTypes_default.PROBE_UNKNOWN_ACTION()
147
- }) === "undefined") {
148
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
149
- }
150
- });
151
- }
152
- function combineReducers(reducers) {
153
- const reducerKeys = Object.keys(reducers);
154
- const finalReducers = {};
155
- for (let i = 0; i < reducerKeys.length; i++) {
156
- const key = reducerKeys[i];
157
- if (process.env.NODE_ENV !== "production") {
158
- if (typeof reducers[key] === "undefined") {
159
- warning(`No reducer provided for key "${key}"`);
160
- }
161
- }
162
- if (typeof reducers[key] === "function") {
163
- finalReducers[key] = reducers[key];
164
- }
165
- }
166
- const finalReducerKeys = Object.keys(finalReducers);
167
- let unexpectedKeyCache;
168
- if (process.env.NODE_ENV !== "production") {
169
- unexpectedKeyCache = {};
170
- }
171
- let shapeAssertionError;
172
- try {
173
- assertReducerShape(finalReducers);
174
- } catch (e) {
175
- shapeAssertionError = e;
176
- }
177
- return function combination(state = {}, action) {
178
- if (shapeAssertionError) {
179
- throw shapeAssertionError;
180
- }
181
- if (process.env.NODE_ENV !== "production") {
182
- const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
183
- if (warningMessage) {
184
- warning(warningMessage);
185
- }
186
- }
187
- let hasChanged = false;
188
- const nextState = {};
189
- for (let i = 0; i < finalReducerKeys.length; i++) {
190
- const key = finalReducerKeys[i];
191
- const reducer = finalReducers[key];
192
- const previousStateForKey = state[key];
193
- const nextStateForKey = reducer(previousStateForKey, action);
194
- if (typeof nextStateForKey === "undefined") {
195
- const actionType = action && action.type;
196
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `"${String(actionType)}"` : "(unknown type)"}, the slice reducer for key "${key}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
197
- }
198
- nextState[key] = nextStateForKey;
199
- hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
200
- }
201
- hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
202
- return hasChanged ? nextState : state;
203
- };
204
- }
205
-
206
- // src/store/reducers/breadcrums-slice/index.ts
207
- import { createSlice } from "@reduxjs/toolkit";
208
- var initialState = {
209
- breadCrumbs: []
210
- };
211
- var breadcrumbsSlice = createSlice({
212
- name: "breadcrumbs",
213
- initialState,
214
- reducers: {
215
- setBreadCrumbs: (state, action) => {
216
- state.breadCrumbs = [...state.breadCrumbs, action.payload];
217
- }
218
- }
219
- });
220
- var { setBreadCrumbs } = breadcrumbsSlice.actions;
221
- var breadcrums_slice_default = breadcrumbsSlice.reducer;
222
-
223
- // src/store/reducers/env-slice/index.ts
224
- import { createSlice as createSlice2 } from "@reduxjs/toolkit";
225
- var initialState2 = {
226
- baseUrl: "",
227
- companies: [],
228
- user: {},
229
- db: "",
230
- refreshTokenEndpoint: "",
231
- config: null,
232
- envFile: null,
233
- requests: null,
234
- defaultCompany: {
235
- id: null,
236
- logo: "",
237
- secondary_color: "",
238
- primary_color: ""
239
- },
240
- context: {
241
- uid: null,
242
- allowed_company_ids: [],
243
- lang: "vi_VN",
244
- tz: "Asia/Saigon"
245
- }
246
- };
247
- var envSlice = createSlice2({
248
- name: "env",
249
- initialState: initialState2,
250
- reducers: {
251
- setEnv: (state, action) => {
252
- Object.assign(state, action.payload);
253
- },
254
- setUid: (state, action) => {
255
- state.context.uid = action.payload;
256
- },
257
- setAllowCompanies: (state, action) => {
258
- state.context.allowed_company_ids = action.payload;
259
- },
260
- setCompanies: (state, action) => {
261
- state.companies = action.payload;
262
- },
263
- setDefaultCompany: (state, action) => {
264
- state.defaultCompany = action.payload;
265
- },
266
- setLang: (state, action) => {
267
- state.context.lang = action.payload;
268
- },
269
- setUser: (state, action) => {
270
- state.user = action.payload;
271
- },
272
- setConfig: (state, action) => {
273
- state.config = action.payload;
274
- },
275
- setEnvFile: (state, action) => {
276
- state.envFile = action.payload;
277
- }
278
- }
279
- });
280
- var {
281
- setEnv,
282
- setUid,
283
- setLang,
284
- setAllowCompanies,
285
- setCompanies,
286
- setDefaultCompany,
287
- setUser,
288
- setConfig,
289
- setEnvFile
290
- } = envSlice.actions;
291
- var env_slice_default = envSlice.reducer;
292
-
293
- // src/store/reducers/excel-slice/index.ts
294
- import { createSlice as createSlice3 } from "@reduxjs/toolkit";
295
- var initialState3 = {
296
- dataParse: null,
297
- idFile: null,
298
- isFileLoaded: false,
299
- loadingImport: false,
300
- selectedFile: null,
301
- errorData: null
302
- };
303
- var excelSlice = createSlice3({
304
- name: "excel",
305
- initialState: initialState3,
306
- reducers: {
307
- setDataParse: (state, action) => {
308
- state.dataParse = action.payload;
309
- },
310
- setIdFile: (state, action) => {
311
- state.idFile = action.payload;
312
- },
313
- setIsFileLoaded: (state, action) => {
314
- state.isFileLoaded = action.payload;
315
- },
316
- setLoadingImport: (state, action) => {
317
- state.loadingImport = action.payload;
318
- },
319
- setSelectedFile: (state, action) => {
320
- state.selectedFile = action.payload;
321
- },
322
- setErrorData: (state, action) => {
323
- state.errorData = action.payload;
324
- }
325
- }
326
- });
327
- var {
328
- setDataParse,
329
- setIdFile,
330
- setIsFileLoaded,
331
- setLoadingImport,
332
- setSelectedFile,
333
- setErrorData
334
- } = excelSlice.actions;
335
- var excel_slice_default = excelSlice.reducer;
336
-
337
- // src/store/reducers/form-slice/index.ts
338
- import { createSlice as createSlice4 } from "@reduxjs/toolkit";
339
- var initialState4 = {
340
- viewDataStore: {},
341
- isShowingModalDetail: false,
342
- isShowModalTranslate: false,
343
- formSubmitComponent: {},
344
- fieldTranslation: null,
345
- listSubject: {},
346
- dataUser: {}
347
- };
348
- var formSlice = createSlice4({
349
- name: "form",
350
- initialState: initialState4,
351
- reducers: {
352
- setViewDataStore: (state, action) => {
353
- state.viewDataStore = action.payload;
354
- },
355
- setIsShowingModalDetail: (state, action) => {
356
- state.isShowingModalDetail = action.payload;
357
- },
358
- setIsShowModalTranslate: (state, action) => {
359
- state.isShowModalTranslate = action.payload;
360
- },
361
- setFormSubmitComponent: (state, action) => {
362
- state.formSubmitComponent[action.payload.key] = action.payload.component;
363
- },
364
- setFieldTranslate: (state, action) => {
365
- state.fieldTranslation = action.payload;
366
- },
367
- setListSubject: (state, action) => {
368
- state.listSubject = action.payload;
369
- },
370
- setDataUser: (state, action) => {
371
- state.dataUser = action.payload;
372
- }
373
- }
374
- });
375
- var {
376
- setViewDataStore,
377
- setIsShowingModalDetail,
378
- setIsShowModalTranslate,
379
- setFormSubmitComponent,
380
- setFieldTranslate,
381
- setListSubject,
382
- setDataUser
383
- } = formSlice.actions;
384
- var form_slice_default = formSlice.reducer;
385
-
386
- // src/store/reducers/header-slice/index.ts
387
- import { createSlice as createSlice5 } from "@reduxjs/toolkit";
388
- var headerSlice = createSlice5({
389
- name: "header",
390
- initialState: {
391
- value: { allowedCompanyIds: [] }
392
- },
393
- reducers: {
394
- setHeader: (state, action) => {
395
- state.value = { ...state.value, ...action.payload };
396
- },
397
- setAllowedCompanyIds: (state, action) => {
398
- state.value.allowedCompanyIds = action.payload;
399
- }
400
- }
401
- });
402
- var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
403
- var header_slice_default = headerSlice.reducer;
404
-
405
- // src/store/reducers/list-slice/index.ts
406
- import { createSlice as createSlice6 } from "@reduxjs/toolkit";
407
- var initialState5 = {
408
- pageLimit: 10,
409
- fields: {},
410
- order: "",
411
- selectedRowKeys: [],
412
- selectedRadioKey: 0,
413
- indexRowTableModal: -2,
414
- isUpdateTableModal: false,
415
- footerGroupTable: {},
416
- transferDetail: null,
417
- page: 0,
418
- domainTable: []
419
- };
420
- var listSlice = createSlice6({
421
- name: "list",
422
- initialState: initialState5,
423
- reducers: {
424
- setPageLimit: (state, action) => {
425
- state.pageLimit = action.payload;
426
- },
427
- setFields: (state, action) => {
428
- state.fields = action.payload;
429
- },
430
- setOrder: (state, action) => {
431
- state.order = action.payload;
432
- },
433
- setSelectedRowKeys: (state, action) => {
434
- state.selectedRowKeys = action.payload;
435
- },
436
- setSelectedRadioKey: (state, action) => {
437
- state.selectedRadioKey = action.payload;
438
- },
439
- setIndexRowTableModal: (state, action) => {
440
- state.indexRowTableModal = action.payload;
441
- },
442
- setTransferDetail: (state, action) => {
443
- state.transferDetail = action.payload;
444
- },
445
- setIsUpdateTableModal: (state, action) => {
446
- state.isUpdateTableModal = action.payload;
447
- },
448
- setPage: (state, action) => {
449
- state.page = action.payload;
450
- },
451
- setDomainTable: (state, action) => {
452
- state.domainTable = action.payload;
453
- }
454
- }
455
- });
456
- var {
457
- setPageLimit,
458
- setFields,
459
- setOrder,
460
- setSelectedRowKeys,
461
- setIndexRowTableModal,
462
- setIsUpdateTableModal,
463
- setPage,
464
- setSelectedRadioKey,
465
- setTransferDetail,
466
- setDomainTable
467
- } = listSlice.actions;
468
- var list_slice_default = listSlice.reducer;
469
-
470
- // src/store/reducers/login-slice/index.ts
471
- import { createSlice as createSlice7 } from "@reduxjs/toolkit";
472
- var initialState6 = {
473
- db: "",
474
- redirectTo: "/",
475
- forgotPasswordUrl: "/"
476
- };
477
- var loginSlice = createSlice7({
478
- name: "login",
479
- initialState: initialState6,
480
- reducers: {
481
- setDb: (state, action) => {
482
- state.db = action.payload;
483
- },
484
- setRedirectTo: (state, action) => {
485
- state.redirectTo = action.payload;
486
- },
487
- setForgotPasswordUrl: (state, action) => {
488
- state.forgotPasswordUrl = action.payload;
489
- }
490
- }
491
- });
492
- var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
493
- var login_slice_default = loginSlice.reducer;
494
-
495
- // src/store/reducers/navbar-slice/index.ts
496
- import { createSlice as createSlice8 } from "@reduxjs/toolkit";
497
- var initialState7 = {
498
- menuFocus: {},
499
- menuAction: {},
500
- navbarWidth: 250,
501
- menuList: []
502
- };
503
- var navbarSlice = createSlice8({
504
- name: "navbar",
505
- initialState: initialState7,
506
- reducers: {
507
- setMenuFocus: (state, action) => {
508
- state.menuFocus = action.payload;
509
- },
510
- setMenuFocusAction: (state, action) => {
511
- state.menuAction = action.payload;
512
- },
513
- setNavbarWidth: (state, action) => {
514
- state.navbarWidth = action.payload;
515
- },
516
- setMenuList: (state, action) => {
517
- state.menuList = action.payload;
518
- }
519
- }
520
- });
521
- var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
522
- var navbar_slice_default = navbarSlice.reducer;
523
-
524
- // src/store/reducers/profile-slice/index.ts
525
- import { createSlice as createSlice9 } from "@reduxjs/toolkit";
526
- var initialState8 = {
527
- profile: {}
528
- };
529
- var profileSlice = createSlice9({
530
- name: "profile",
531
- initialState: initialState8,
532
- reducers: {
533
- setProfile: (state, action) => {
534
- state.profile = action.payload;
535
- }
536
- }
537
- });
538
- var { setProfile } = profileSlice.actions;
539
- var profile_slice_default = profileSlice.reducer;
540
-
541
- // src/store/reducers/search-slice/index.ts
542
- import { createSlice as createSlice10 } from "@reduxjs/toolkit";
543
- var initialState9 = {
544
- groupByDomain: null,
545
- searchBy: [],
546
- searchString: "",
547
- hoveredIndexSearchList: null,
548
- selectedTags: [],
549
- firstDomain: null,
550
- searchMap: {},
551
- filterBy: [],
552
- groupBy: []
553
- };
554
- var searchSlice = createSlice10({
555
- name: "search",
556
- initialState: initialState9,
557
- reducers: {
558
- setGroupByDomain: (state, action) => {
559
- state.groupByDomain = action.payload;
560
- },
561
- setSearchBy: (state, action) => {
562
- state.searchBy = action.payload;
563
- },
564
- setSearchString: (state, action) => {
565
- state.searchString = action.payload;
566
- },
567
- setHoveredIndexSearchList: (state, action) => {
568
- state.hoveredIndexSearchList = action.payload;
569
- },
570
- setSelectedTags: (state, action) => {
571
- state.selectedTags = action.payload;
572
- },
573
- setFirstDomain: (state, action) => {
574
- state.firstDomain = action.payload;
575
- },
576
- setFilterBy: (state, action) => {
577
- state.filterBy = action.payload;
578
- },
579
- setGroupBy: (state, action) => {
580
- state.groupBy = action.payload;
581
- },
582
- setSearchMap: (state, action) => {
583
- state.searchMap = action.payload;
584
- },
585
- updateSearchMap: (state, action) => {
586
- if (!state.searchMap[action.payload.key]) {
587
- state.searchMap[action.payload.key] = [];
588
- }
589
- state.searchMap[action.payload.key].push(action.payload.value);
590
- },
591
- removeKeyFromSearchMap: (state, action) => {
592
- const { key, item } = action.payload;
593
- const values = state.searchMap[key];
594
- if (!values) return;
595
- if (item) {
596
- const filtered = values.filter((value) => value.name !== item.name);
597
- if (filtered.length > 0) {
598
- state.searchMap[key] = filtered;
599
- } else {
600
- delete state.searchMap[key];
601
- }
602
- } else {
603
- delete state.searchMap[key];
604
- }
605
- },
606
- clearSearchMap: (state) => {
607
- state.searchMap = {};
608
- }
609
- }
610
- });
611
- var {
612
- setGroupByDomain,
613
- setSelectedTags,
614
- setSearchString,
615
- setHoveredIndexSearchList,
616
- setFirstDomain,
617
- setSearchBy,
618
- setFilterBy,
619
- setSearchMap,
620
- updateSearchMap,
621
- removeKeyFromSearchMap,
622
- setGroupBy,
623
- clearSearchMap
624
- } = searchSlice.actions;
625
- var search_slice_default = searchSlice.reducer;
626
-
627
- // src/store/store.ts
628
- var rootReducer = combineReducers({
629
- env: env_slice_default,
630
- header: header_slice_default,
631
- navbar: navbar_slice_default,
632
- list: list_slice_default,
633
- search: search_slice_default,
634
- form: form_slice_default,
635
- breadcrumbs: breadcrums_slice_default,
636
- login: login_slice_default,
637
- excel: excel_slice_default,
638
- profile: profile_slice_default
639
- });
640
- var envStore = configureStore({
641
- reducer: rootReducer,
642
- middleware: (getDefaultMiddleware) => getDefaultMiddleware({
643
- serializableCheck: false
644
- })
645
- });
646
-
647
34
  // src/configs/axios-client.ts
648
35
  import axios from "axios";
649
36
 
@@ -2318,708 +1705,1324 @@ function evaluate(ast, context = {}) {
2318
1705
  }
2319
1706
  return pyContext;
2320
1707
  }
2321
- });
1708
+ });
1709
+ }
1710
+ function _innerEvaluate(ast2) {
1711
+ switch (ast2?.type) {
1712
+ case 0:
1713
+ // Number
1714
+ case 1:
1715
+ return ast2.value;
1716
+ case 5:
1717
+ if (ast2.value in evalContext) {
1718
+ if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
1719
+ return evalContext[ast2.value]?.id;
1720
+ }
1721
+ return evalContext[ast2.value] ?? false;
1722
+ } else if (ast2.value in BUILTINS) {
1723
+ return BUILTINS[ast2.value];
1724
+ } else {
1725
+ return false;
1726
+ }
1727
+ case 3:
1728
+ return null;
1729
+ case 2:
1730
+ return ast2.value;
1731
+ case 6:
1732
+ return applyUnaryOp(ast2, evalContext);
1733
+ case 7:
1734
+ return applyBinaryOp(ast2, evalContext);
1735
+ case 14:
1736
+ const left = _evaluate(ast2.left);
1737
+ if (ast2.op === "and") {
1738
+ return isTrue(left) ? _evaluate(ast2.right) : left;
1739
+ } else {
1740
+ return isTrue(left) ? left : _evaluate(ast2.right);
1741
+ }
1742
+ case 4:
1743
+ // List
1744
+ case 10:
1745
+ return ast2.value.map(_evaluate);
1746
+ case 11:
1747
+ const dict = {};
1748
+ for (const key2 in ast2.value) {
1749
+ dict[key2] = _evaluate(ast2.value[key2]);
1750
+ }
1751
+ dicts.add(dict);
1752
+ return dict;
1753
+ case 8:
1754
+ const fnValue = _evaluate(ast2.fn);
1755
+ const args = ast2.args.map(_evaluate);
1756
+ const kwargs = {};
1757
+ for (const kwarg in ast2.kwargs) {
1758
+ kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
1759
+ }
1760
+ if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
1761
+ return fnValue.create(...args, kwargs);
1762
+ }
1763
+ return fnValue(...args, kwargs);
1764
+ case 12:
1765
+ const dictVal = _evaluate(ast2.target);
1766
+ const key = _evaluate(ast2.key);
1767
+ return dictVal[key];
1768
+ case 13:
1769
+ if (isTrue(_evaluate(ast2.condition))) {
1770
+ return _evaluate(ast2.ifTrue);
1771
+ } else {
1772
+ return _evaluate(ast2.ifFalse);
1773
+ }
1774
+ case 15:
1775
+ let leftVal = _evaluate(ast2.obj);
1776
+ let result;
1777
+ if (dicts.has(leftVal) || Object.isPrototypeOf.call(PY_DICT, leftVal)) {
1778
+ result = DICT[ast2.key];
1779
+ } else if (typeof leftVal === "string") {
1780
+ result = STRING[ast2.key];
1781
+ } else if (leftVal instanceof Set) {
1782
+ result = SET[ast2.key];
1783
+ } else if (ast2.key === "get" && typeof leftVal === "object") {
1784
+ result = DICT[ast2.key];
1785
+ leftVal = toPyDict(leftVal);
1786
+ } else {
1787
+ result = leftVal[ast2.key];
1788
+ }
1789
+ if (typeof result === "function") {
1790
+ const bound = result.bind(leftVal);
1791
+ bound[unboundFn] = result;
1792
+ return bound;
1793
+ }
1794
+ return result;
1795
+ default:
1796
+ throw new EvaluationError(`AST of type ${ast2.type} cannot be evaluated`);
1797
+ }
1798
+ }
1799
+ function _evaluate(ast2) {
1800
+ const val = _innerEvaluate(ast2);
1801
+ if (typeof val === "function" && !allowedFns.has(val) && !allowedFns.has(val[unboundFn])) {
1802
+ throw new Error("Invalid Function Call");
1803
+ }
1804
+ return val;
1805
+ }
1806
+ return _evaluate(ast);
1807
+ }
1808
+
1809
+ // src/utils/domain/py.ts
1810
+ function parseExpr(expr) {
1811
+ const tokens = tokenize(expr);
1812
+ return parse(tokens);
1813
+ }
1814
+
1815
+ // src/utils/domain/objects.ts
1816
+ function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
1817
+ if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") {
1818
+ return obj1 === obj2;
1819
+ }
1820
+ const obj1Keys = Object.keys(obj1);
1821
+ return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every((key) => comparisonFn(obj1[key], obj2[key]));
1822
+ }
1823
+
1824
+ // src/utils/domain/arrays.ts
1825
+ var shallowEqual2 = shallowEqual;
1826
+
1827
+ // src/utils/domain/strings.ts
1828
+ var escapeMethod = Symbol("html");
1829
+ function escapeRegExp(str) {
1830
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1831
+ }
1832
+
1833
+ // src/utils/domain/domain.ts
1834
+ var InvalidDomainError = class extends Error {
1835
+ };
1836
+ var Domain = class _Domain {
1837
+ ast = { type: -1, value: null };
1838
+ static TRUE;
1839
+ static FALSE;
1840
+ static combine(domains, operator) {
1841
+ if (domains.length === 0) {
1842
+ return new _Domain([]);
1843
+ }
1844
+ const domain1 = domains[0] instanceof _Domain ? domains[0] : new _Domain(domains[0]);
1845
+ if (domains.length === 1) {
1846
+ return domain1;
1847
+ }
1848
+ const domain2 = _Domain.combine(domains.slice(1), operator);
1849
+ const result = new _Domain([]);
1850
+ const astValues1 = domain1.ast.value;
1851
+ const astValues2 = domain2.ast.value;
1852
+ const op = operator === "AND" ? "&" : "|";
1853
+ const combinedAST = {
1854
+ type: 4,
1855
+ value: astValues1.concat(astValues2)
1856
+ };
1857
+ result.ast = normalizeDomainAST(combinedAST, op);
1858
+ return result;
1859
+ }
1860
+ static and(domains) {
1861
+ return _Domain.combine(domains, "AND");
1862
+ }
1863
+ static or(domains) {
1864
+ return _Domain.combine(domains, "OR");
1865
+ }
1866
+ static not(domain) {
1867
+ const result = new _Domain(domain);
1868
+ result.ast.value.unshift({ type: 1, value: "!" });
1869
+ return result;
1870
+ }
1871
+ static removeDomainLeaves(domain, keysToRemove) {
1872
+ function processLeaf(elements, idx, operatorCtx, newDomain2) {
1873
+ const leaf = elements[idx];
1874
+ if (leaf.type === 10) {
1875
+ if (keysToRemove.includes(leaf.value[0].value)) {
1876
+ if (operatorCtx === "&") {
1877
+ newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
1878
+ } else if (operatorCtx === "|") {
1879
+ newDomain2.ast.value.push(..._Domain.FALSE.ast.value);
1880
+ }
1881
+ } else {
1882
+ newDomain2.ast.value.push(leaf);
1883
+ }
1884
+ return 1;
1885
+ } else if (leaf.type === 1) {
1886
+ if (leaf.value === "|" && elements[idx + 1].type === 10 && elements[idx + 2].type === 10 && keysToRemove.includes(elements[idx + 1].value[0].value) && keysToRemove.includes(elements[idx + 2].value[0].value)) {
1887
+ newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
1888
+ return 3;
1889
+ }
1890
+ newDomain2.ast.value.push(leaf);
1891
+ if (leaf.value === "!") {
1892
+ return 1 + processLeaf(elements, idx + 1, "&", newDomain2);
1893
+ }
1894
+ const firstLeafSkip = processLeaf(
1895
+ elements,
1896
+ idx + 1,
1897
+ leaf.value,
1898
+ newDomain2
1899
+ );
1900
+ const secondLeafSkip = processLeaf(
1901
+ elements,
1902
+ idx + 1 + firstLeafSkip,
1903
+ leaf.value,
1904
+ newDomain2
1905
+ );
1906
+ return 1 + firstLeafSkip + secondLeafSkip;
1907
+ }
1908
+ return 0;
1909
+ }
1910
+ const d = new _Domain(domain);
1911
+ if (d.ast.value.length === 0) {
1912
+ return d;
1913
+ }
1914
+ const newDomain = new _Domain([]);
1915
+ processLeaf(d.ast.value, 0, "&", newDomain);
1916
+ return newDomain;
1917
+ }
1918
+ constructor(descr = []) {
1919
+ if (descr instanceof _Domain) {
1920
+ return new _Domain(descr.toString());
1921
+ } else {
1922
+ let rawAST;
1923
+ try {
1924
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1925
+ } catch (error) {
1926
+ throw new InvalidDomainError(
1927
+ `Invalid domain representation: ${descr}`,
1928
+ {
1929
+ cause: error
1930
+ }
1931
+ );
1932
+ }
1933
+ this.ast = normalizeDomainAST(rawAST);
1934
+ }
1935
+ }
1936
+ contains(record) {
1937
+ const expr = evaluate(this.ast, record);
1938
+ return matchDomain(record, expr);
1939
+ }
1940
+ toString() {
1941
+ return formatAST(this.ast);
1942
+ }
1943
+ toList(context) {
1944
+ return evaluate(this.ast, context);
1945
+ }
1946
+ toJson() {
1947
+ try {
1948
+ const evaluatedAsList = this.toList({});
1949
+ const evaluatedDomain = new _Domain(evaluatedAsList);
1950
+ if (evaluatedDomain.toString() === this.toString()) {
1951
+ return evaluatedAsList;
1952
+ }
1953
+ return this.toString();
1954
+ } catch {
1955
+ return this.toString();
1956
+ }
1957
+ }
1958
+ };
1959
+ var TRUE_LEAF = [1, "=", 1];
1960
+ var FALSE_LEAF = [0, "=", 1];
1961
+ var TRUE_DOMAIN = new Domain([TRUE_LEAF]);
1962
+ var FALSE_DOMAIN = new Domain([FALSE_LEAF]);
1963
+ Domain.TRUE = TRUE_DOMAIN;
1964
+ Domain.FALSE = FALSE_DOMAIN;
1965
+ function toAST(domain) {
1966
+ const elems = domain.map((elem) => {
1967
+ switch (elem) {
1968
+ case "!":
1969
+ case "&":
1970
+ case "|":
1971
+ return { type: 1, value: elem };
1972
+ default:
1973
+ return {
1974
+ type: 10,
1975
+ value: elem.map(toPyValue)
1976
+ };
1977
+ }
1978
+ });
1979
+ return { type: 4, value: elems };
1980
+ }
1981
+ function normalizeDomainAST(domain, op = "&") {
1982
+ if (domain.type !== 4) {
1983
+ if (domain.type === 10) {
1984
+ const value = domain.value;
1985
+ if (value.findIndex((e) => e.type === 10) === -1 || !value.every((e) => e.type === 10 || e.type === 1)) {
1986
+ throw new InvalidDomainError("Invalid domain AST");
1987
+ }
1988
+ } else {
1989
+ throw new InvalidDomainError("Invalid domain AST");
1990
+ }
2322
1991
  }
2323
- function _innerEvaluate(ast2) {
2324
- switch (ast2?.type) {
2325
- case 0:
2326
- // Number
1992
+ if (domain.value.length === 0) {
1993
+ return domain;
1994
+ }
1995
+ let expected = 1;
1996
+ for (const child of domain.value) {
1997
+ switch (child.type) {
2327
1998
  case 1:
2328
- return ast2.value;
2329
- case 5:
2330
- if (ast2.value in evalContext) {
2331
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2332
- return evalContext[ast2.value]?.id;
2333
- }
2334
- return evalContext[ast2.value] ?? false;
2335
- } else if (ast2.value in BUILTINS) {
2336
- return BUILTINS[ast2.value];
2337
- } else {
2338
- return false;
2339
- }
2340
- case 3:
2341
- return null;
2342
- case 2:
2343
- return ast2.value;
2344
- case 6:
2345
- return applyUnaryOp(ast2, evalContext);
2346
- case 7:
2347
- return applyBinaryOp(ast2, evalContext);
2348
- case 14:
2349
- const left = _evaluate(ast2.left);
2350
- if (ast2.op === "and") {
2351
- return isTrue(left) ? _evaluate(ast2.right) : left;
2352
- } else {
2353
- return isTrue(left) ? left : _evaluate(ast2.right);
1999
+ if (child.value === "&" || child.value === "|") {
2000
+ expected++;
2001
+ } else if (child.value !== "!") {
2002
+ throw new InvalidDomainError("Invalid domain AST");
2354
2003
  }
2004
+ break;
2355
2005
  case 4:
2356
- // List
2006
+ /* list */
2357
2007
  case 10:
2358
- return ast2.value.map(_evaluate);
2359
- case 11:
2360
- const dict = {};
2361
- for (const key2 in ast2.value) {
2362
- dict[key2] = _evaluate(ast2.value[key2]);
2363
- }
2364
- dicts.add(dict);
2365
- return dict;
2366
- case 8:
2367
- const fnValue = _evaluate(ast2.fn);
2368
- const args = ast2.args.map(_evaluate);
2369
- const kwargs = {};
2370
- for (const kwarg in ast2.kwargs) {
2371
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2372
- }
2373
- if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2374
- return fnValue.create(...args, kwargs);
2375
- }
2376
- return fnValue(...args, kwargs);
2377
- case 12:
2378
- const dictVal = _evaluate(ast2.target);
2379
- const key = _evaluate(ast2.key);
2380
- return dictVal[key];
2381
- case 13:
2382
- if (isTrue(_evaluate(ast2.condition))) {
2383
- return _evaluate(ast2.ifTrue);
2384
- } else {
2385
- return _evaluate(ast2.ifFalse);
2386
- }
2387
- case 15:
2388
- let leftVal = _evaluate(ast2.obj);
2389
- let result;
2390
- if (dicts.has(leftVal) || Object.isPrototypeOf.call(PY_DICT, leftVal)) {
2391
- result = DICT[ast2.key];
2392
- } else if (typeof leftVal === "string") {
2393
- result = STRING[ast2.key];
2394
- } else if (leftVal instanceof Set) {
2395
- result = SET[ast2.key];
2396
- } else if (ast2.key === "get" && typeof leftVal === "object") {
2397
- result = DICT[ast2.key];
2398
- leftVal = toPyDict(leftVal);
2399
- } else {
2400
- result = leftVal[ast2.key];
2401
- }
2402
- if (typeof result === "function") {
2403
- const bound = result.bind(leftVal);
2404
- bound[unboundFn] = result;
2405
- return bound;
2008
+ if (child.value.length === 3) {
2009
+ expected--;
2010
+ break;
2406
2011
  }
2407
- return result;
2012
+ throw new InvalidDomainError("Invalid domain AST");
2408
2013
  default:
2409
- throw new EvaluationError(`AST of type ${ast2.type} cannot be evaluated`);
2014
+ throw new InvalidDomainError("Invalid domain AST");
2015
+ }
2016
+ }
2017
+ const values = domain.value.slice();
2018
+ while (expected < 0) {
2019
+ expected++;
2020
+ values.unshift({ type: 1, value: op });
2021
+ }
2022
+ if (expected > 0) {
2023
+ throw new InvalidDomainError(
2024
+ `invalid domain ${formatAST(domain)} (missing ${expected} segment(s))`
2025
+ );
2026
+ }
2027
+ return { type: 4, value: values };
2028
+ }
2029
+ function matchCondition(record, condition) {
2030
+ if (typeof condition === "boolean") {
2031
+ return condition;
2032
+ }
2033
+ const [field, operator, value] = condition;
2034
+ if (typeof field === "string") {
2035
+ const names = field.split(".");
2036
+ if (names.length >= 2) {
2037
+ return matchCondition(record[names[0]], [
2038
+ names.slice(1).join("."),
2039
+ operator,
2040
+ value
2041
+ ]);
2042
+ }
2043
+ }
2044
+ let likeRegexp, ilikeRegexp;
2045
+ if (["like", "not like", "ilike", "not ilike"].includes(operator)) {
2046
+ likeRegexp = new RegExp(
2047
+ `(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
2048
+ "g"
2049
+ );
2050
+ ilikeRegexp = new RegExp(
2051
+ `(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
2052
+ "gi"
2053
+ );
2054
+ }
2055
+ const fieldValue = typeof field === "number" ? field : record[field];
2056
+ switch (operator) {
2057
+ case "=?":
2058
+ if ([false, null].includes(value)) {
2059
+ return true;
2060
+ }
2061
+ // eslint-disable-next-line no-fallthrough
2062
+ case "=":
2063
+ case "==":
2064
+ if (Array.isArray(fieldValue) && Array.isArray(value)) {
2065
+ return shallowEqual2(fieldValue, value);
2066
+ }
2067
+ return fieldValue === value;
2068
+ case "!=":
2069
+ case "<>":
2070
+ return !matchCondition(record, [field, "==", value]);
2071
+ case "<":
2072
+ return fieldValue < value;
2073
+ case "<=":
2074
+ return fieldValue <= value;
2075
+ case ">":
2076
+ return fieldValue > value;
2077
+ case ">=":
2078
+ return fieldValue >= value;
2079
+ case "in": {
2080
+ const val = Array.isArray(value) ? value : [value];
2081
+ const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
2082
+ return fieldVal.some((fv) => val.includes(fv));
2083
+ }
2084
+ case "not in": {
2085
+ const val = Array.isArray(value) ? value : [value];
2086
+ const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
2087
+ return !fieldVal.some((fv) => val.includes(fv));
2088
+ }
2089
+ case "like":
2090
+ if (fieldValue === false) {
2091
+ return false;
2092
+ }
2093
+ return Boolean(fieldValue.match(likeRegexp));
2094
+ case "not like":
2095
+ if (fieldValue === false) {
2096
+ return false;
2097
+ }
2098
+ return Boolean(!fieldValue.match(likeRegexp));
2099
+ case "=like":
2100
+ if (fieldValue === false) {
2101
+ return false;
2102
+ }
2103
+ return new RegExp(escapeRegExp(value).replace(/%/g, ".*")).test(
2104
+ fieldValue
2105
+ );
2106
+ case "ilike":
2107
+ if (fieldValue === false) {
2108
+ return false;
2109
+ }
2110
+ return Boolean(fieldValue.match(ilikeRegexp));
2111
+ case "not ilike":
2112
+ if (fieldValue === false) {
2113
+ return false;
2114
+ }
2115
+ return Boolean(!fieldValue.match(ilikeRegexp));
2116
+ case "=ilike":
2117
+ if (fieldValue === false) {
2118
+ return false;
2119
+ }
2120
+ return new RegExp(escapeRegExp(value).replace(/%/g, ".*"), "i").test(
2121
+ fieldValue
2122
+ );
2123
+ }
2124
+ throw new InvalidDomainError("could not match domain");
2125
+ }
2126
+ function makeOperators(record) {
2127
+ const match = matchCondition.bind(null, record);
2128
+ return {
2129
+ "!": (x) => !match(x),
2130
+ "&": (a, b) => match(a) && match(b),
2131
+ "|": (a, b) => match(a) || match(b)
2132
+ };
2133
+ }
2134
+ function matchDomain(record, domain) {
2135
+ if (domain.length === 0) {
2136
+ return true;
2137
+ }
2138
+ const operators = makeOperators(record);
2139
+ const reversedDomain = Array.from(domain).reverse();
2140
+ const condStack = [];
2141
+ for (const item of reversedDomain) {
2142
+ const operator = typeof item === "string" && operators[item];
2143
+ if (operator) {
2144
+ const operands = condStack.splice(-operator.length);
2145
+ condStack.push(operator(...operands));
2146
+ } else {
2147
+ condStack.push(item);
2410
2148
  }
2411
2149
  }
2412
- function _evaluate(ast2) {
2413
- const val = _innerEvaluate(ast2);
2414
- if (typeof val === "function" && !allowedFns.has(val) && !allowedFns.has(val[unboundFn])) {
2415
- throw new Error("Invalid Function Call");
2150
+ return matchCondition(record, condStack.pop());
2151
+ }
2152
+
2153
+ // src/utils/function.ts
2154
+ import { useEffect, useState } from "react";
2155
+ var toQueryString = (params) => {
2156
+ return Object.keys(params).map(
2157
+ (key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
2158
+ ).join("&");
2159
+ };
2160
+ var isBase64File = (str) => {
2161
+ try {
2162
+ const dataUriPattern = /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/;
2163
+ if (dataUriPattern.test(str)) {
2164
+ return true;
2416
2165
  }
2417
- return val;
2166
+ const base64Pattern = (
2167
+ // eslint-disable-next-line no-useless-escape
2168
+ /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$/
2169
+ );
2170
+ return base64Pattern.test(str);
2171
+ } catch (e) {
2172
+ return false;
2418
2173
  }
2419
- return _evaluate(ast);
2420
- }
2174
+ };
2175
+ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2176
+ if (!originalRequest.data) return originalRequest.data;
2177
+ if (typeof originalRequest.data === "string") {
2178
+ try {
2179
+ const parsedData = JSON.parse(originalRequest.data);
2180
+ if (parsedData.with_context && typeof parsedData.with_context === "object") {
2181
+ parsedData.with_context.token = newAccessToken;
2182
+ }
2183
+ return JSON.stringify(parsedData);
2184
+ } catch (e) {
2185
+ console.warn("Failed to parse originalRequest.data", e);
2186
+ return originalRequest.data;
2187
+ }
2188
+ }
2189
+ if (typeof originalRequest.data === "object" && originalRequest.data.with_context) {
2190
+ originalRequest.data.with_context.token = newAccessToken;
2191
+ }
2192
+ return originalRequest.data;
2193
+ };
2421
2194
 
2422
- // src/utils/domain/py.ts
2423
- function parseExpr(expr) {
2424
- const tokens = tokenize(expr);
2425
- return parse(tokens);
2426
- }
2195
+ // src/utils/storage/local-storage.ts
2196
+ var localStorageUtils = () => {
2197
+ const setToken = async (access_token) => {
2198
+ localStorage.setItem("accessToken", access_token);
2199
+ };
2200
+ const setRefreshToken = async (refresh_token) => {
2201
+ localStorage.setItem("refreshToken", refresh_token);
2202
+ };
2203
+ const getAccessToken = async () => {
2204
+ return localStorage.getItem("accessToken");
2205
+ };
2206
+ const getRefreshToken = async () => {
2207
+ return localStorage.getItem("refreshToken");
2208
+ };
2209
+ const clearToken = async () => {
2210
+ localStorage.removeItem("accessToken");
2211
+ localStorage.removeItem("refreshToken");
2212
+ };
2213
+ return {
2214
+ setToken,
2215
+ setRefreshToken,
2216
+ getAccessToken,
2217
+ getRefreshToken,
2218
+ clearToken
2219
+ };
2220
+ };
2427
2221
 
2428
- // src/utils/domain/objects.ts
2429
- function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
2430
- if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") {
2431
- return obj1 === obj2;
2222
+ // src/utils/storage/session-storage.ts
2223
+ var sessionStorageUtils = () => {
2224
+ const getBrowserSession = async () => {
2225
+ return sessionStorage.getItem("browserSession");
2226
+ };
2227
+ return {
2228
+ getBrowserSession
2229
+ };
2230
+ };
2231
+
2232
+ // src/configs/axios-client.ts
2233
+ var axiosClient = {
2234
+ init(config) {
2235
+ const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2236
+ const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2237
+ const db = config.db;
2238
+ let isRefreshing = false;
2239
+ let failedQueue = [];
2240
+ const processQueue = (error, token = null) => {
2241
+ failedQueue?.forEach((prom) => {
2242
+ if (error) {
2243
+ prom.reject(error);
2244
+ } else {
2245
+ prom.resolve(token);
2246
+ }
2247
+ });
2248
+ failedQueue = [];
2249
+ };
2250
+ const instance = axios.create({
2251
+ adapter: axios.defaults.adapter,
2252
+ baseURL: config.baseUrl,
2253
+ timeout: 5e4,
2254
+ paramsSerializer: (params) => new URLSearchParams(params).toString()
2255
+ });
2256
+ instance.interceptors.request.use(
2257
+ async (config2) => {
2258
+ const useRefreshToken = config2.useRefreshToken;
2259
+ const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2260
+ if (token) {
2261
+ config2.headers["Authorization"] = "Bearer " + token;
2262
+ }
2263
+ return config2;
2264
+ },
2265
+ (error) => {
2266
+ Promise.reject(error);
2267
+ }
2268
+ );
2269
+ instance.interceptors.response.use(
2270
+ (response) => {
2271
+ return handleResponse(response);
2272
+ },
2273
+ async (error) => {
2274
+ const handleError3 = async (error2) => {
2275
+ if (!error2.response) {
2276
+ return error2;
2277
+ }
2278
+ const { data } = error2.response;
2279
+ if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2280
+ await clearAuthToken();
2281
+ }
2282
+ return data;
2283
+ };
2284
+ const originalRequest = error.config;
2285
+ if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2286
+ error.response.data.code
2287
+ )) {
2288
+ if (isRefreshing) {
2289
+ return new Promise(function(resolve, reject) {
2290
+ failedQueue.push({ resolve, reject });
2291
+ }).then((token) => {
2292
+ originalRequest.headers["Authorization"] = "Bearer " + token;
2293
+ originalRequest.data = updateTokenParamInOriginalRequest(
2294
+ originalRequest,
2295
+ token
2296
+ );
2297
+ return instance.request(originalRequest);
2298
+ }).catch(async (err) => {
2299
+ if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2300
+ await clearAuthToken();
2301
+ }
2302
+ });
2303
+ }
2304
+ const browserSession = await sessionStorage2.getBrowserSession();
2305
+ const refreshToken = await localStorage2.getRefreshToken();
2306
+ const accessTokenExp = await localStorage2.getAccessToken();
2307
+ isRefreshing = true;
2308
+ if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2309
+ await clearAuthToken();
2310
+ } else {
2311
+ const payload = Object.fromEntries(
2312
+ Object.entries({
2313
+ refresh_token: refreshToken,
2314
+ grant_type: "refresh_token",
2315
+ client_id: config.config.clientId,
2316
+ client_secret: config.config.clientSecret
2317
+ }).filter(([_, value]) => !!value)
2318
+ );
2319
+ return new Promise(function(resolve) {
2320
+ axios.post(
2321
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2322
+ payload,
2323
+ {
2324
+ headers: {
2325
+ "Content-Type": config.refreshTokenEndpoint ? "application/x-www-form-urlencoded" : "multipart/form-data",
2326
+ Authorization: `Bearer ${accessTokenExp}`
2327
+ }
2328
+ }
2329
+ ).then(async (res) => {
2330
+ const data = res.data;
2331
+ await localStorage2.setToken(data.access_token);
2332
+ await localStorage2.setRefreshToken(data.refresh_token);
2333
+ axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2334
+ originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2335
+ originalRequest.data = updateTokenParamInOriginalRequest(
2336
+ originalRequest,
2337
+ data.access_token
2338
+ );
2339
+ processQueue(null, data.access_token);
2340
+ resolve(instance.request(originalRequest));
2341
+ }).catch(async (err) => {
2342
+ 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") {
2343
+ await clearAuthToken();
2344
+ }
2345
+ if (err && err.response) {
2346
+ const { error_code } = err.response?.data || {};
2347
+ if (error_code === "AUTHEN_FAIL") {
2348
+ await clearAuthToken();
2349
+ }
2350
+ }
2351
+ processQueue(err, null);
2352
+ }).finally(() => {
2353
+ isRefreshing = false;
2354
+ });
2355
+ });
2356
+ }
2357
+ }
2358
+ return Promise.reject(await handleError3(error));
2359
+ }
2360
+ );
2361
+ const handleResponse = (res) => {
2362
+ if (res && res.data) {
2363
+ return res.data;
2364
+ }
2365
+ return res;
2366
+ };
2367
+ const handleError2 = (error) => {
2368
+ if (error.isAxiosError && error.code === "ECONNABORTED") {
2369
+ console.error("Request Timeout Error:", error);
2370
+ return "Request Timeout Error";
2371
+ } else if (error.isAxiosError && !error.response) {
2372
+ console.error("Network Error:", error);
2373
+ return "Network Error";
2374
+ } else {
2375
+ console.error("Other Error:", error?.response);
2376
+ const errorMessage = error?.response?.data?.message || "An error occurred";
2377
+ return { message: errorMessage, status: error?.response?.status };
2378
+ }
2379
+ };
2380
+ const clearAuthToken = async () => {
2381
+ await localStorage2.clearToken();
2382
+ if (typeof window !== "undefined") {
2383
+ window.location.href = `/login`;
2384
+ }
2385
+ };
2386
+ function formatUrl(url, db2) {
2387
+ return url + (db2 ? "?db=" + db2 : "");
2388
+ }
2389
+ const responseBody = (response) => response;
2390
+ const requests = {
2391
+ get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
2392
+ post: (url, body, headers) => instance.post(formatUrl(url, db), body, headers).then(responseBody),
2393
+ post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
2394
+ responseType: "arraybuffer",
2395
+ headers: {
2396
+ "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
2397
+ Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
2398
+ }
2399
+ }).then(responseBody),
2400
+ put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
2401
+ patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
2402
+ delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
2403
+ };
2404
+ return requests;
2432
2405
  }
2433
- const obj1Keys = Object.keys(obj1);
2434
- return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every((key) => comparisonFn(obj1[key], obj2[key]));
2435
- }
2436
-
2437
- // src/utils/domain/arrays.ts
2438
- var shallowEqual2 = shallowEqual;
2406
+ };
2439
2407
 
2440
- // src/utils/domain/strings.ts
2441
- var escapeMethod = Symbol("html");
2442
- function escapeRegExp(str) {
2443
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2444
- }
2408
+ // src/store/index.ts
2409
+ import { useDispatch, useSelector } from "react-redux";
2445
2410
 
2446
- // src/utils/domain/domain.ts
2447
- var InvalidDomainError = class extends Error {
2411
+ // src/store/reducers/breadcrums-slice/index.ts
2412
+ import { createSlice } from "@reduxjs/toolkit";
2413
+ var initialState = {
2414
+ breadCrumbs: []
2448
2415
  };
2449
- var Domain = class _Domain {
2450
- ast = { type: -1, value: null };
2451
- static TRUE;
2452
- static FALSE;
2453
- static combine(domains, operator) {
2454
- if (domains.length === 0) {
2455
- return new _Domain([]);
2456
- }
2457
- const domain1 = domains[0] instanceof _Domain ? domains[0] : new _Domain(domains[0]);
2458
- if (domains.length === 1) {
2459
- return domain1;
2416
+ var breadcrumbsSlice = createSlice({
2417
+ name: "breadcrumbs",
2418
+ initialState,
2419
+ reducers: {
2420
+ setBreadCrumbs: (state, action) => {
2421
+ state.breadCrumbs = [...state.breadCrumbs, action.payload];
2460
2422
  }
2461
- const domain2 = _Domain.combine(domains.slice(1), operator);
2462
- const result = new _Domain([]);
2463
- const astValues1 = domain1.ast.value;
2464
- const astValues2 = domain2.ast.value;
2465
- const op = operator === "AND" ? "&" : "|";
2466
- const combinedAST = {
2467
- type: 4,
2468
- value: astValues1.concat(astValues2)
2469
- };
2470
- result.ast = normalizeDomainAST(combinedAST, op);
2471
- return result;
2472
- }
2473
- static and(domains) {
2474
- return _Domain.combine(domains, "AND");
2475
2423
  }
2476
- static or(domains) {
2477
- return _Domain.combine(domains, "OR");
2478
- }
2479
- static not(domain) {
2480
- const result = new _Domain(domain);
2481
- result.ast.value.unshift({ type: 1, value: "!" });
2482
- return result;
2424
+ });
2425
+ var { setBreadCrumbs } = breadcrumbsSlice.actions;
2426
+ var breadcrums_slice_default = breadcrumbsSlice.reducer;
2427
+
2428
+ // src/store/reducers/env-slice/index.ts
2429
+ import { createSlice as createSlice2 } from "@reduxjs/toolkit";
2430
+ var initialState2 = {
2431
+ baseUrl: "",
2432
+ requests: null,
2433
+ companies: [],
2434
+ user: {},
2435
+ config: null,
2436
+ envFile: null,
2437
+ defaultCompany: {
2438
+ id: null,
2439
+ logo: "",
2440
+ secondary_color: "",
2441
+ primary_color: ""
2442
+ },
2443
+ context: {
2444
+ uid: null,
2445
+ allowed_company_ids: [],
2446
+ lang: "vi_VN",
2447
+ tz: "Asia/Saigon"
2483
2448
  }
2484
- static removeDomainLeaves(domain, keysToRemove) {
2485
- function processLeaf(elements, idx, operatorCtx, newDomain2) {
2486
- const leaf = elements[idx];
2487
- if (leaf.type === 10) {
2488
- if (keysToRemove.includes(leaf.value[0].value)) {
2489
- if (operatorCtx === "&") {
2490
- newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
2491
- } else if (operatorCtx === "|") {
2492
- newDomain2.ast.value.push(..._Domain.FALSE.ast.value);
2493
- }
2494
- } else {
2495
- newDomain2.ast.value.push(leaf);
2496
- }
2497
- return 1;
2498
- } else if (leaf.type === 1) {
2499
- if (leaf.value === "|" && elements[idx + 1].type === 10 && elements[idx + 2].type === 10 && keysToRemove.includes(elements[idx + 1].value[0].value) && keysToRemove.includes(elements[idx + 2].value[0].value)) {
2500
- newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
2501
- return 3;
2502
- }
2503
- newDomain2.ast.value.push(leaf);
2504
- if (leaf.value === "!") {
2505
- return 1 + processLeaf(elements, idx + 1, "&", newDomain2);
2506
- }
2507
- const firstLeafSkip = processLeaf(
2508
- elements,
2509
- idx + 1,
2510
- leaf.value,
2511
- newDomain2
2512
- );
2513
- const secondLeafSkip = processLeaf(
2514
- elements,
2515
- idx + 1 + firstLeafSkip,
2516
- leaf.value,
2517
- newDomain2
2518
- );
2519
- return 1 + firstLeafSkip + secondLeafSkip;
2520
- }
2521
- return 0;
2449
+ };
2450
+ var envSlice = createSlice2({
2451
+ name: "env",
2452
+ initialState: initialState2,
2453
+ reducers: {
2454
+ setEnv: (state, action) => {
2455
+ Object.assign(state, action.payload);
2456
+ },
2457
+ setUid: (state, action) => {
2458
+ state.context.uid = action.payload;
2459
+ },
2460
+ setAllowCompanies: (state, action) => {
2461
+ state.context.allowed_company_ids = action.payload;
2462
+ },
2463
+ setCompanies: (state, action) => {
2464
+ state.companies = action.payload;
2465
+ },
2466
+ setDefaultCompany: (state, action) => {
2467
+ state.defaultCompany = action.payload;
2468
+ },
2469
+ setLang: (state, action) => {
2470
+ state.context.lang = action.payload;
2471
+ },
2472
+ setUser: (state, action) => {
2473
+ state.user = action.payload;
2474
+ },
2475
+ setConfig: (state, action) => {
2476
+ state.config = action.payload;
2477
+ },
2478
+ setEnvFile: (state, action) => {
2479
+ state.envFile = action.payload;
2522
2480
  }
2523
- const d = new _Domain(domain);
2524
- if (d.ast.value.length === 0) {
2525
- return d;
2481
+ }
2482
+ });
2483
+ var {
2484
+ setEnv,
2485
+ setUid,
2486
+ setLang,
2487
+ setAllowCompanies,
2488
+ setCompanies,
2489
+ setDefaultCompany,
2490
+ setUser,
2491
+ setConfig,
2492
+ setEnvFile
2493
+ } = envSlice.actions;
2494
+ var env_slice_default = envSlice.reducer;
2495
+
2496
+ // src/store/reducers/excel-slice/index.ts
2497
+ import { createSlice as createSlice3 } from "@reduxjs/toolkit";
2498
+ var initialState3 = {
2499
+ dataParse: null,
2500
+ idFile: null,
2501
+ isFileLoaded: false,
2502
+ loadingImport: false,
2503
+ selectedFile: null,
2504
+ errorData: null
2505
+ };
2506
+ var excelSlice = createSlice3({
2507
+ name: "excel",
2508
+ initialState: initialState3,
2509
+ reducers: {
2510
+ setDataParse: (state, action) => {
2511
+ state.dataParse = action.payload;
2512
+ },
2513
+ setIdFile: (state, action) => {
2514
+ state.idFile = action.payload;
2515
+ },
2516
+ setIsFileLoaded: (state, action) => {
2517
+ state.isFileLoaded = action.payload;
2518
+ },
2519
+ setLoadingImport: (state, action) => {
2520
+ state.loadingImport = action.payload;
2521
+ },
2522
+ setSelectedFile: (state, action) => {
2523
+ state.selectedFile = action.payload;
2524
+ },
2525
+ setErrorData: (state, action) => {
2526
+ state.errorData = action.payload;
2526
2527
  }
2527
- const newDomain = new _Domain([]);
2528
- processLeaf(d.ast.value, 0, "&", newDomain);
2529
- return newDomain;
2530
2528
  }
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);
2529
+ });
2530
+ var {
2531
+ setDataParse,
2532
+ setIdFile,
2533
+ setIsFileLoaded,
2534
+ setLoadingImport,
2535
+ setSelectedFile,
2536
+ setErrorData
2537
+ } = excelSlice.actions;
2538
+ var excel_slice_default = excelSlice.reducer;
2539
+
2540
+ // src/store/reducers/form-slice/index.ts
2541
+ import { createSlice as createSlice4 } from "@reduxjs/toolkit";
2542
+ var initialState4 = {
2543
+ viewDataStore: {},
2544
+ isShowingModalDetail: false,
2545
+ isShowModalTranslate: false,
2546
+ formSubmitComponent: {},
2547
+ fieldTranslation: null,
2548
+ listSubject: {},
2549
+ dataUser: {}
2550
+ };
2551
+ var formSlice = createSlice4({
2552
+ name: "form",
2553
+ initialState: initialState4,
2554
+ reducers: {
2555
+ setViewDataStore: (state, action) => {
2556
+ state.viewDataStore = action.payload;
2557
+ },
2558
+ setIsShowingModalDetail: (state, action) => {
2559
+ state.isShowingModalDetail = action.payload;
2560
+ },
2561
+ setIsShowModalTranslate: (state, action) => {
2562
+ state.isShowModalTranslate = action.payload;
2563
+ },
2564
+ setFormSubmitComponent: (state, action) => {
2565
+ state.formSubmitComponent[action.payload.key] = action.payload.component;
2566
+ },
2567
+ setFieldTranslate: (state, action) => {
2568
+ state.fieldTranslation = action.payload;
2569
+ },
2570
+ setListSubject: (state, action) => {
2571
+ state.listSubject = action.payload;
2572
+ },
2573
+ setDataUser: (state, action) => {
2574
+ state.dataUser = action.payload;
2547
2575
  }
2548
2576
  }
2549
- contains(record) {
2550
- const expr = evaluate(this.ast, record);
2551
- return matchDomain(record, expr);
2577
+ });
2578
+ var {
2579
+ setViewDataStore,
2580
+ setIsShowingModalDetail,
2581
+ setIsShowModalTranslate,
2582
+ setFormSubmitComponent,
2583
+ setFieldTranslate,
2584
+ setListSubject,
2585
+ setDataUser
2586
+ } = formSlice.actions;
2587
+ var form_slice_default = formSlice.reducer;
2588
+
2589
+ // src/store/reducers/header-slice/index.ts
2590
+ import { createSlice as createSlice5 } from "@reduxjs/toolkit";
2591
+ var headerSlice = createSlice5({
2592
+ name: "header",
2593
+ initialState: {
2594
+ value: { allowedCompanyIds: [] }
2595
+ },
2596
+ reducers: {
2597
+ setHeader: (state, action) => {
2598
+ state.value = { ...state.value, ...action.payload };
2599
+ },
2600
+ setAllowedCompanyIds: (state, action) => {
2601
+ state.value.allowedCompanyIds = action.payload;
2602
+ }
2552
2603
  }
2553
- toString() {
2554
- return formatAST(this.ast);
2604
+ });
2605
+ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
2606
+ var header_slice_default = headerSlice.reducer;
2607
+
2608
+ // src/store/reducers/list-slice/index.ts
2609
+ import { createSlice as createSlice6 } from "@reduxjs/toolkit";
2610
+ var initialState5 = {
2611
+ pageLimit: 10,
2612
+ fields: {},
2613
+ order: "",
2614
+ selectedRowKeys: [],
2615
+ selectedRadioKey: 0,
2616
+ indexRowTableModal: -2,
2617
+ isUpdateTableModal: false,
2618
+ footerGroupTable: {},
2619
+ transferDetail: null,
2620
+ page: 0,
2621
+ domainTable: []
2622
+ };
2623
+ var listSlice = createSlice6({
2624
+ name: "list",
2625
+ initialState: initialState5,
2626
+ reducers: {
2627
+ setPageLimit: (state, action) => {
2628
+ state.pageLimit = action.payload;
2629
+ },
2630
+ setFields: (state, action) => {
2631
+ state.fields = action.payload;
2632
+ },
2633
+ setOrder: (state, action) => {
2634
+ state.order = action.payload;
2635
+ },
2636
+ setSelectedRowKeys: (state, action) => {
2637
+ state.selectedRowKeys = action.payload;
2638
+ },
2639
+ setSelectedRadioKey: (state, action) => {
2640
+ state.selectedRadioKey = action.payload;
2641
+ },
2642
+ setIndexRowTableModal: (state, action) => {
2643
+ state.indexRowTableModal = action.payload;
2644
+ },
2645
+ setTransferDetail: (state, action) => {
2646
+ state.transferDetail = action.payload;
2647
+ },
2648
+ setIsUpdateTableModal: (state, action) => {
2649
+ state.isUpdateTableModal = action.payload;
2650
+ },
2651
+ setPage: (state, action) => {
2652
+ state.page = action.payload;
2653
+ },
2654
+ setDomainTable: (state, action) => {
2655
+ state.domainTable = action.payload;
2656
+ }
2555
2657
  }
2556
- toList(context) {
2557
- return evaluate(this.ast, context);
2658
+ });
2659
+ var {
2660
+ setPageLimit,
2661
+ setFields,
2662
+ setOrder,
2663
+ setSelectedRowKeys,
2664
+ setIndexRowTableModal,
2665
+ setIsUpdateTableModal,
2666
+ setPage,
2667
+ setSelectedRadioKey,
2668
+ setTransferDetail,
2669
+ setDomainTable
2670
+ } = listSlice.actions;
2671
+ var list_slice_default = listSlice.reducer;
2672
+
2673
+ // src/store/reducers/login-slice/index.ts
2674
+ import { createSlice as createSlice7 } from "@reduxjs/toolkit";
2675
+ var initialState6 = {
2676
+ db: "",
2677
+ redirectTo: "/",
2678
+ forgotPasswordUrl: "/"
2679
+ };
2680
+ var loginSlice = createSlice7({
2681
+ name: "login",
2682
+ initialState: initialState6,
2683
+ reducers: {
2684
+ setDb: (state, action) => {
2685
+ state.db = action.payload;
2686
+ },
2687
+ setRedirectTo: (state, action) => {
2688
+ state.redirectTo = action.payload;
2689
+ },
2690
+ setForgotPasswordUrl: (state, action) => {
2691
+ state.forgotPasswordUrl = action.payload;
2692
+ }
2558
2693
  }
2559
- toJson() {
2560
- try {
2561
- const evaluatedAsList = this.toList({});
2562
- const evaluatedDomain = new _Domain(evaluatedAsList);
2563
- if (evaluatedDomain.toString() === this.toString()) {
2564
- return evaluatedAsList;
2565
- }
2566
- return this.toString();
2567
- } catch {
2568
- return this.toString();
2694
+ });
2695
+ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
2696
+ var login_slice_default = loginSlice.reducer;
2697
+
2698
+ // src/store/reducers/navbar-slice/index.ts
2699
+ import { createSlice as createSlice8 } from "@reduxjs/toolkit";
2700
+ var initialState7 = {
2701
+ menuFocus: {},
2702
+ menuAction: {},
2703
+ navbarWidth: 250,
2704
+ menuList: []
2705
+ };
2706
+ var navbarSlice = createSlice8({
2707
+ name: "navbar",
2708
+ initialState: initialState7,
2709
+ reducers: {
2710
+ setMenuFocus: (state, action) => {
2711
+ state.menuFocus = action.payload;
2712
+ },
2713
+ setMenuFocusAction: (state, action) => {
2714
+ state.menuAction = action.payload;
2715
+ },
2716
+ setNavbarWidth: (state, action) => {
2717
+ state.navbarWidth = action.payload;
2718
+ },
2719
+ setMenuList: (state, action) => {
2720
+ state.menuList = action.payload;
2569
2721
  }
2570
2722
  }
2723
+ });
2724
+ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
2725
+ var navbar_slice_default = navbarSlice.reducer;
2726
+
2727
+ // src/store/reducers/profile-slice/index.ts
2728
+ import { createSlice as createSlice9 } from "@reduxjs/toolkit";
2729
+ var initialState8 = {
2730
+ profile: {}
2571
2731
  };
2572
- var TRUE_LEAF = [1, "=", 1];
2573
- var FALSE_LEAF = [0, "=", 1];
2574
- var TRUE_DOMAIN = new Domain([TRUE_LEAF]);
2575
- var FALSE_DOMAIN = new Domain([FALSE_LEAF]);
2576
- Domain.TRUE = TRUE_DOMAIN;
2577
- Domain.FALSE = FALSE_DOMAIN;
2578
- function toAST(domain) {
2579
- const elems = domain.map((elem) => {
2580
- switch (elem) {
2581
- case "!":
2582
- case "&":
2583
- case "|":
2584
- return { type: 1, value: elem };
2585
- default:
2586
- return {
2587
- type: 10,
2588
- value: elem.map(toPyValue)
2589
- };
2732
+ var profileSlice = createSlice9({
2733
+ name: "profile",
2734
+ initialState: initialState8,
2735
+ reducers: {
2736
+ setProfile: (state, action) => {
2737
+ state.profile = action.payload;
2590
2738
  }
2591
- });
2592
- return { type: 4, value: elems };
2593
- }
2594
- function normalizeDomainAST(domain, op = "&") {
2595
- if (domain.type !== 4) {
2596
- if (domain.type === 10) {
2597
- const value = domain.value;
2598
- if (value.findIndex((e) => e.type === 10) === -1 || !value.every((e) => e.type === 10 || e.type === 1)) {
2599
- throw new InvalidDomainError("Invalid domain AST");
2739
+ }
2740
+ });
2741
+ var { setProfile } = profileSlice.actions;
2742
+ var profile_slice_default = profileSlice.reducer;
2743
+
2744
+ // src/store/reducers/search-slice/index.ts
2745
+ import { createSlice as createSlice10 } from "@reduxjs/toolkit";
2746
+ var initialState9 = {
2747
+ groupByDomain: null,
2748
+ searchBy: [],
2749
+ searchString: "",
2750
+ hoveredIndexSearchList: null,
2751
+ selectedTags: [],
2752
+ firstDomain: null,
2753
+ searchMap: {},
2754
+ filterBy: [],
2755
+ groupBy: []
2756
+ };
2757
+ var searchSlice = createSlice10({
2758
+ name: "search",
2759
+ initialState: initialState9,
2760
+ reducers: {
2761
+ setGroupByDomain: (state, action) => {
2762
+ state.groupByDomain = action.payload;
2763
+ },
2764
+ setSearchBy: (state, action) => {
2765
+ state.searchBy = action.payload;
2766
+ },
2767
+ setSearchString: (state, action) => {
2768
+ state.searchString = action.payload;
2769
+ },
2770
+ setHoveredIndexSearchList: (state, action) => {
2771
+ state.hoveredIndexSearchList = action.payload;
2772
+ },
2773
+ setSelectedTags: (state, action) => {
2774
+ state.selectedTags = action.payload;
2775
+ },
2776
+ setFirstDomain: (state, action) => {
2777
+ state.firstDomain = action.payload;
2778
+ },
2779
+ setFilterBy: (state, action) => {
2780
+ state.filterBy = action.payload;
2781
+ },
2782
+ setGroupBy: (state, action) => {
2783
+ state.groupBy = action.payload;
2784
+ },
2785
+ setSearchMap: (state, action) => {
2786
+ state.searchMap = action.payload;
2787
+ },
2788
+ updateSearchMap: (state, action) => {
2789
+ if (!state.searchMap[action.payload.key]) {
2790
+ state.searchMap[action.payload.key] = [];
2600
2791
  }
2601
- } else {
2602
- throw new InvalidDomainError("Invalid domain AST");
2603
- }
2604
- }
2605
- if (domain.value.length === 0) {
2606
- return domain;
2607
- }
2608
- let expected = 1;
2609
- for (const child of domain.value) {
2610
- switch (child.type) {
2611
- case 1:
2612
- if (child.value === "&" || child.value === "|") {
2613
- expected++;
2614
- } else if (child.value !== "!") {
2615
- throw new InvalidDomainError("Invalid domain AST");
2616
- }
2617
- break;
2618
- case 4:
2619
- /* list */
2620
- case 10:
2621
- if (child.value.length === 3) {
2622
- expected--;
2623
- break;
2792
+ state.searchMap[action.payload.key].push(action.payload.value);
2793
+ },
2794
+ removeKeyFromSearchMap: (state, action) => {
2795
+ const { key, item } = action.payload;
2796
+ const values = state.searchMap[key];
2797
+ if (!values) return;
2798
+ if (item) {
2799
+ const filtered = values.filter((value) => value.name !== item.name);
2800
+ if (filtered.length > 0) {
2801
+ state.searchMap[key] = filtered;
2802
+ } else {
2803
+ delete state.searchMap[key];
2624
2804
  }
2625
- throw new InvalidDomainError("Invalid domain AST");
2626
- default:
2627
- throw new InvalidDomainError("Invalid domain AST");
2805
+ } else {
2806
+ delete state.searchMap[key];
2807
+ }
2808
+ },
2809
+ clearSearchMap: (state) => {
2810
+ state.searchMap = {};
2628
2811
  }
2629
2812
  }
2630
- const values = domain.value.slice();
2631
- while (expected < 0) {
2632
- expected++;
2633
- values.unshift({ type: 1, value: op });
2634
- }
2635
- if (expected > 0) {
2636
- throw new InvalidDomainError(
2637
- `invalid domain ${formatAST(domain)} (missing ${expected} segment(s))`
2638
- );
2639
- }
2640
- return { type: 4, value: values };
2813
+ });
2814
+ var {
2815
+ setGroupByDomain,
2816
+ setSelectedTags,
2817
+ setSearchString,
2818
+ setHoveredIndexSearchList,
2819
+ setFirstDomain,
2820
+ setSearchBy,
2821
+ setFilterBy,
2822
+ setSearchMap,
2823
+ updateSearchMap,
2824
+ removeKeyFromSearchMap,
2825
+ setGroupBy,
2826
+ clearSearchMap
2827
+ } = searchSlice.actions;
2828
+ var search_slice_default = searchSlice.reducer;
2829
+
2830
+ // src/store/store.ts
2831
+ import { configureStore } from "@reduxjs/toolkit";
2832
+
2833
+ // node_modules/redux/dist/redux.mjs
2834
+ function formatProdErrorMessage(code) {
2835
+ return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
2641
2836
  }
2642
- function matchCondition(record, condition) {
2643
- if (typeof condition === "boolean") {
2644
- return condition;
2837
+ var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
2838
+ var ActionTypes = {
2839
+ INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
2840
+ REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
2841
+ PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
2842
+ };
2843
+ var actionTypes_default = ActionTypes;
2844
+ function isPlainObject(obj) {
2845
+ if (typeof obj !== "object" || obj === null)
2846
+ return false;
2847
+ let proto = obj;
2848
+ while (Object.getPrototypeOf(proto) !== null) {
2849
+ proto = Object.getPrototypeOf(proto);
2645
2850
  }
2646
- const [field, operator, value] = condition;
2647
- if (typeof field === "string") {
2648
- const names = field.split(".");
2649
- if (names.length >= 2) {
2650
- return matchCondition(record[names[0]], [
2651
- names.slice(1).join("."),
2652
- operator,
2653
- value
2654
- ]);
2851
+ return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
2852
+ }
2853
+ function miniKindOf(val) {
2854
+ if (val === void 0)
2855
+ return "undefined";
2856
+ if (val === null)
2857
+ return "null";
2858
+ const type = typeof val;
2859
+ switch (type) {
2860
+ case "boolean":
2861
+ case "string":
2862
+ case "number":
2863
+ case "symbol":
2864
+ case "function": {
2865
+ return type;
2655
2866
  }
2656
2867
  }
2657
- let likeRegexp, ilikeRegexp;
2658
- if (["like", "not like", "ilike", "not ilike"].includes(operator)) {
2659
- likeRegexp = new RegExp(
2660
- `(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
2661
- "g"
2662
- );
2663
- ilikeRegexp = new RegExp(
2664
- `(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
2665
- "gi"
2666
- );
2667
- }
2668
- const fieldValue = typeof field === "number" ? field : record[field];
2669
- switch (operator) {
2670
- case "=?":
2671
- if ([false, null].includes(value)) {
2672
- return true;
2673
- }
2674
- // eslint-disable-next-line no-fallthrough
2675
- case "=":
2676
- case "==":
2677
- if (Array.isArray(fieldValue) && Array.isArray(value)) {
2678
- return shallowEqual2(fieldValue, value);
2679
- }
2680
- return fieldValue === value;
2681
- case "!=":
2682
- case "<>":
2683
- return !matchCondition(record, [field, "==", value]);
2684
- case "<":
2685
- return fieldValue < value;
2686
- case "<=":
2687
- return fieldValue <= value;
2688
- case ">":
2689
- return fieldValue > value;
2690
- case ">=":
2691
- return fieldValue >= value;
2692
- case "in": {
2693
- const val = Array.isArray(value) ? value : [value];
2694
- const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
2695
- return fieldVal.some((fv) => val.includes(fv));
2696
- }
2697
- case "not in": {
2698
- const val = Array.isArray(value) ? value : [value];
2699
- const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
2700
- return !fieldVal.some((fv) => val.includes(fv));
2701
- }
2702
- case "like":
2703
- if (fieldValue === false) {
2704
- return false;
2705
- }
2706
- return Boolean(fieldValue.match(likeRegexp));
2707
- case "not like":
2708
- if (fieldValue === false) {
2709
- return false;
2710
- }
2711
- return Boolean(!fieldValue.match(likeRegexp));
2712
- case "=like":
2713
- if (fieldValue === false) {
2714
- return false;
2715
- }
2716
- return new RegExp(escapeRegExp(value).replace(/%/g, ".*")).test(
2717
- fieldValue
2718
- );
2719
- case "ilike":
2720
- if (fieldValue === false) {
2721
- return false;
2722
- }
2723
- return Boolean(fieldValue.match(ilikeRegexp));
2724
- case "not ilike":
2725
- if (fieldValue === false) {
2726
- return false;
2727
- }
2728
- return Boolean(!fieldValue.match(ilikeRegexp));
2729
- case "=ilike":
2730
- if (fieldValue === false) {
2731
- return false;
2732
- }
2733
- return new RegExp(escapeRegExp(value).replace(/%/g, ".*"), "i").test(
2734
- fieldValue
2735
- );
2868
+ if (Array.isArray(val))
2869
+ return "array";
2870
+ if (isDate(val))
2871
+ return "date";
2872
+ if (isError(val))
2873
+ return "error";
2874
+ const constructorName = ctorName(val);
2875
+ switch (constructorName) {
2876
+ case "Symbol":
2877
+ case "Promise":
2878
+ case "WeakMap":
2879
+ case "WeakSet":
2880
+ case "Map":
2881
+ case "Set":
2882
+ return constructorName;
2736
2883
  }
2737
- throw new InvalidDomainError("could not match domain");
2884
+ return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
2738
2885
  }
2739
- function makeOperators(record) {
2740
- const match = matchCondition.bind(null, record);
2741
- return {
2742
- "!": (x) => !match(x),
2743
- "&": (a, b) => match(a) && match(b),
2744
- "|": (a, b) => match(a) || match(b)
2745
- };
2886
+ function ctorName(val) {
2887
+ return typeof val.constructor === "function" ? val.constructor.name : null;
2746
2888
  }
2747
- function matchDomain(record, domain) {
2748
- if (domain.length === 0) {
2749
- return true;
2750
- }
2751
- const operators = makeOperators(record);
2752
- const reversedDomain = Array.from(domain).reverse();
2753
- const condStack = [];
2754
- for (const item of reversedDomain) {
2755
- const operator = typeof item === "string" && operators[item];
2756
- if (operator) {
2757
- const operands = condStack.splice(-operator.length);
2758
- condStack.push(operator(...operands));
2759
- } else {
2760
- condStack.push(item);
2761
- }
2889
+ function isError(val) {
2890
+ return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
2891
+ }
2892
+ function isDate(val) {
2893
+ if (val instanceof Date)
2894
+ return true;
2895
+ return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
2896
+ }
2897
+ function kindOf(val) {
2898
+ let typeOfVal = typeof val;
2899
+ if (process.env.NODE_ENV !== "production") {
2900
+ typeOfVal = miniKindOf(val);
2762
2901
  }
2763
- return matchCondition(record, condStack.pop());
2902
+ return typeOfVal;
2764
2903
  }
2765
-
2766
- // src/utils/function.ts
2767
- import { useEffect, useState } from "react";
2768
- var toQueryString = (params) => {
2769
- return Object.keys(params).map(
2770
- (key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
2771
- ).join("&");
2772
- };
2773
- var isBase64File = (str) => {
2904
+ function warning(message) {
2905
+ if (typeof console !== "undefined" && typeof console.error === "function") {
2906
+ console.error(message);
2907
+ }
2774
2908
  try {
2775
- const dataUriPattern = /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/;
2776
- if (dataUriPattern.test(str)) {
2777
- return true;
2778
- }
2779
- const base64Pattern = (
2780
- // eslint-disable-next-line no-useless-escape
2781
- /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$/
2782
- );
2783
- return base64Pattern.test(str);
2909
+ throw new Error(message);
2784
2910
  } catch (e) {
2785
- return false;
2786
2911
  }
2787
- };
2788
- var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2789
- if (!originalRequest.data) return originalRequest.data;
2790
- if (typeof originalRequest.data === "string") {
2791
- try {
2792
- const parsedData = JSON.parse(originalRequest.data);
2793
- if (parsedData.with_context && typeof parsedData.with_context === "object") {
2794
- parsedData.with_context.token = newAccessToken;
2795
- }
2796
- return JSON.stringify(parsedData);
2797
- } catch (e) {
2798
- console.warn("Failed to parse originalRequest.data", e);
2799
- return originalRequest.data;
2800
- }
2912
+ }
2913
+ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
2914
+ const reducerKeys = Object.keys(reducers);
2915
+ const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
2916
+ if (reducerKeys.length === 0) {
2917
+ return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
2801
2918
  }
2802
- if (typeof originalRequest.data === "object" && originalRequest.data.with_context) {
2803
- originalRequest.data.with_context.token = newAccessToken;
2919
+ if (!isPlainObject(inputState)) {
2920
+ return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
2804
2921
  }
2805
- return originalRequest.data;
2806
- };
2807
-
2808
- // src/utils/storage/local-storage.ts
2809
- var localStorageUtils = () => {
2810
- const setToken = async (access_token) => {
2811
- localStorage.setItem("accessToken", access_token);
2812
- };
2813
- const setRefreshToken = async (refresh_token) => {
2814
- localStorage.setItem("refreshToken", refresh_token);
2815
- };
2816
- const getAccessToken = async () => {
2817
- return localStorage.getItem("accessToken");
2818
- };
2819
- const getRefreshToken = async () => {
2820
- return localStorage.getItem("refreshToken");
2821
- };
2822
- const clearToken = async () => {
2823
- localStorage.removeItem("accessToken");
2824
- localStorage.removeItem("refreshToken");
2825
- };
2826
- return {
2827
- setToken,
2828
- setRefreshToken,
2829
- getAccessToken,
2830
- getRefreshToken,
2831
- clearToken
2832
- };
2833
- };
2834
-
2835
- // src/utils/storage/session-storage.ts
2836
- var sessionStorageUtils = () => {
2837
- const getBrowserSession = async () => {
2838
- return sessionStorage.getItem("browserSession");
2839
- };
2840
- return {
2841
- getBrowserSession
2842
- };
2843
- };
2844
-
2845
- // src/configs/axios-client.ts
2846
- var axiosClient = {
2847
- init(config) {
2848
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2849
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2850
- const db = config.db;
2851
- let isRefreshing = false;
2852
- let failedQueue = [];
2853
- const processQueue = (error, token = null) => {
2854
- failedQueue?.forEach((prom) => {
2855
- if (error) {
2856
- prom.reject(error);
2857
- } else {
2858
- prom.resolve(token);
2859
- }
2860
- });
2861
- failedQueue = [];
2862
- };
2863
- const instance = axios.create({
2864
- adapter: axios.defaults.adapter,
2865
- baseURL: config.baseUrl,
2866
- timeout: 5e4,
2867
- paramsSerializer: (params) => new URLSearchParams(params).toString()
2922
+ const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
2923
+ unexpectedKeys.forEach((key) => {
2924
+ unexpectedKeyCache[key] = true;
2925
+ });
2926
+ if (action && action.type === actionTypes_default.REPLACE)
2927
+ return;
2928
+ if (unexpectedKeys.length > 0) {
2929
+ return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
2930
+ }
2931
+ }
2932
+ function assertReducerShape(reducers) {
2933
+ Object.keys(reducers).forEach((key) => {
2934
+ const reducer = reducers[key];
2935
+ const initialState10 = reducer(void 0, {
2936
+ type: actionTypes_default.INIT
2868
2937
  });
2869
- instance.interceptors.request.use(async (config2) => {
2870
- const { useRefreshToken, useActionToken, actionToken } = config2;
2871
- if (useActionToken && actionToken) {
2872
- config2.headers["Action-Token"] = actionToken;
2873
- }
2874
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2875
- const token = await getToken?.();
2876
- if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2877
- return config2;
2878
- }, Promise.reject);
2879
- instance.interceptors.response.use(
2880
- (response) => {
2881
- return handleResponse(response);
2882
- },
2883
- async (error) => {
2884
- const handleError3 = async (error2) => {
2885
- if (!error2.response) {
2886
- return error2;
2887
- }
2888
- const { data } = error2.response;
2889
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2890
- await clearAuthToken();
2891
- }
2892
- return data;
2893
- };
2894
- const originalRequest = error.config;
2895
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2896
- error.response.data.code
2897
- )) {
2898
- if (isRefreshing) {
2899
- return new Promise(function(resolve, reject) {
2900
- failedQueue.push({ resolve, reject });
2901
- }).then((token) => {
2902
- originalRequest.headers["Authorization"] = "Bearer " + token;
2903
- originalRequest.data = updateTokenParamInOriginalRequest(
2904
- originalRequest,
2905
- token
2906
- );
2907
- return instance.request(originalRequest);
2908
- }).catch(async (err) => {
2909
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2910
- await clearAuthToken();
2911
- }
2912
- });
2913
- }
2914
- const browserSession = await sessionStorage2.getBrowserSession();
2915
- const refreshToken = await localStorage2.getRefreshToken();
2916
- const accessTokenExp = await localStorage2.getAccessToken();
2917
- isRefreshing = true;
2918
- if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2919
- await clearAuthToken();
2920
- } else {
2921
- const payload = Object.fromEntries(
2922
- Object.entries({
2923
- refresh_token: refreshToken,
2924
- grant_type: "refresh_token",
2925
- client_id: config.config.clientId,
2926
- client_secret: config.config.clientSecret
2927
- }).filter(([_, value]) => !!value)
2928
- );
2929
- return new Promise(function(resolve) {
2930
- axios.post(
2931
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2932
- payload,
2933
- {
2934
- headers: {
2935
- "Content-Type": config.refreshTokenEndpoint ? "application/x-www-form-urlencoded" : "multipart/form-data",
2936
- Authorization: `Bearer ${accessTokenExp}`
2937
- }
2938
- }
2939
- ).then(async (res) => {
2940
- const data = res.data;
2941
- await localStorage2.setToken(data.access_token);
2942
- await localStorage2.setRefreshToken(data.refresh_token);
2943
- axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2944
- originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2945
- originalRequest.data = updateTokenParamInOriginalRequest(
2946
- originalRequest,
2947
- data.access_token
2948
- );
2949
- processQueue(null, data.access_token);
2950
- resolve(instance.request(originalRequest));
2951
- }).catch(async (err) => {
2952
- 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") {
2953
- await clearAuthToken();
2954
- }
2955
- if (err && err.response) {
2956
- const { error_code } = err.response?.data || {};
2957
- if (error_code === "AUTHEN_FAIL") {
2958
- await clearAuthToken();
2959
- }
2960
- }
2961
- processQueue(err, null);
2962
- }).finally(() => {
2963
- isRefreshing = false;
2964
- });
2965
- });
2966
- }
2967
- }
2968
- return Promise.reject(await handleError3(error));
2969
- }
2970
- );
2971
- const handleResponse = (res) => {
2972
- if (res && res.data) {
2973
- return res.data;
2974
- }
2975
- return res;
2976
- };
2977
- const handleError2 = (error) => {
2978
- if (error.isAxiosError && error.code === "ECONNABORTED") {
2979
- console.error("Request Timeout Error:", error);
2980
- return "Request Timeout Error";
2981
- } else if (error.isAxiosError && !error.response) {
2982
- console.error("Network Error:", error);
2983
- return "Network Error";
2984
- } else {
2985
- console.error("Other Error:", error?.response);
2986
- const errorMessage = error?.response?.data?.message || "An error occurred";
2987
- return { message: errorMessage, status: error?.response?.status };
2988
- }
2989
- };
2990
- const clearAuthToken = async () => {
2991
- await localStorage2.clearToken();
2992
- if (typeof window !== "undefined") {
2993
- window.location.href = `/login`;
2938
+ if (typeof initialState10 === "undefined") {
2939
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
2940
+ }
2941
+ if (typeof reducer(void 0, {
2942
+ type: actionTypes_default.PROBE_UNKNOWN_ACTION()
2943
+ }) === "undefined") {
2944
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
2945
+ }
2946
+ });
2947
+ }
2948
+ function combineReducers(reducers) {
2949
+ const reducerKeys = Object.keys(reducers);
2950
+ const finalReducers = {};
2951
+ for (let i = 0; i < reducerKeys.length; i++) {
2952
+ const key = reducerKeys[i];
2953
+ if (process.env.NODE_ENV !== "production") {
2954
+ if (typeof reducers[key] === "undefined") {
2955
+ warning(`No reducer provided for key "${key}"`);
2994
2956
  }
2995
- };
2996
- function formatUrl(url, db2) {
2997
- return url + (db2 ? "?db=" + db2 : "");
2998
2957
  }
2999
- const responseBody = (response) => response;
3000
- const requests = {
3001
- get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
3002
- post: (url, body, headers) => instance.post(formatUrl(url, db), body, headers).then(responseBody),
3003
- post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
3004
- responseType: "arraybuffer",
3005
- headers: {
3006
- "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
3007
- Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
3008
- }
3009
- }).then(responseBody),
3010
- put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
3011
- patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
3012
- delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
3013
- };
3014
- return requests;
2958
+ if (typeof reducers[key] === "function") {
2959
+ finalReducers[key] = reducers[key];
2960
+ }
3015
2961
  }
3016
- };
2962
+ const finalReducerKeys = Object.keys(finalReducers);
2963
+ let unexpectedKeyCache;
2964
+ if (process.env.NODE_ENV !== "production") {
2965
+ unexpectedKeyCache = {};
2966
+ }
2967
+ let shapeAssertionError;
2968
+ try {
2969
+ assertReducerShape(finalReducers);
2970
+ } catch (e) {
2971
+ shapeAssertionError = e;
2972
+ }
2973
+ return function combination(state = {}, action) {
2974
+ if (shapeAssertionError) {
2975
+ throw shapeAssertionError;
2976
+ }
2977
+ if (process.env.NODE_ENV !== "production") {
2978
+ const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
2979
+ if (warningMessage) {
2980
+ warning(warningMessage);
2981
+ }
2982
+ }
2983
+ let hasChanged = false;
2984
+ const nextState = {};
2985
+ for (let i = 0; i < finalReducerKeys.length; i++) {
2986
+ const key = finalReducerKeys[i];
2987
+ const reducer = finalReducers[key];
2988
+ const previousStateForKey = state[key];
2989
+ const nextStateForKey = reducer(previousStateForKey, action);
2990
+ if (typeof nextStateForKey === "undefined") {
2991
+ const actionType = action && action.type;
2992
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `"${String(actionType)}"` : "(unknown type)"}, the slice reducer for key "${key}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
2993
+ }
2994
+ nextState[key] = nextStateForKey;
2995
+ hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
2996
+ }
2997
+ hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
2998
+ return hasChanged ? nextState : state;
2999
+ };
3000
+ }
3017
3001
 
3018
- // src/store/index.ts
3019
- import { useDispatch, useSelector } from "react-redux";
3002
+ // src/store/store.ts
3003
+ var rootReducer = combineReducers({
3004
+ env: env_slice_default,
3005
+ header: header_slice_default,
3006
+ navbar: navbar_slice_default,
3007
+ list: list_slice_default,
3008
+ search: search_slice_default,
3009
+ form: form_slice_default,
3010
+ breadcrumbs: breadcrums_slice_default,
3011
+ login: login_slice_default,
3012
+ excel: excel_slice_default,
3013
+ profile: profile_slice_default
3014
+ });
3015
+ var envStore = configureStore({
3016
+ reducer: rootReducer,
3017
+ middleware: (getDefaultMiddleware) => getDefaultMiddleware({
3018
+ serializableCheck: false
3019
+ })
3020
+ });
3020
3021
 
3021
3022
  // src/environment/EnvStore.ts
3022
- var EnvStore = class {
3023
+ var EnvStore = class _EnvStore {
3024
+ static instance = null;
3025
+ envStore;
3023
3026
  baseUrl;
3024
3027
  requests;
3025
3028
  context;
@@ -3031,76 +3034,83 @@ var EnvStore = class {
3031
3034
  localStorageUtils;
3032
3035
  sessionStorageUtils;
3033
3036
  refreshTokenEndpoint;
3034
- constructor(localStorageUtils2, sessionStorageUtils2) {
3037
+ constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3038
+ this.envStore = envStore2;
3035
3039
  this.localStorageUtils = localStorageUtils2;
3036
3040
  this.sessionStorageUtils = sessionStorageUtils2;
3037
3041
  this.setup();
3038
3042
  }
3043
+ static getInstance(envStore2, localStorageUtils2, sessionStorageUtils2) {
3044
+ if (!_EnvStore.instance) {
3045
+ _EnvStore.instance = new _EnvStore(
3046
+ envStore2,
3047
+ localStorageUtils2,
3048
+ sessionStorageUtils2
3049
+ );
3050
+ }
3051
+ return _EnvStore.instance;
3052
+ }
3039
3053
  setup() {
3040
- const env2 = envStore.getState().env;
3041
- this.baseUrl = env2?.baseUrl;
3042
- this.context = env2?.context;
3043
- this.defaultCompany = env2?.defaultCompany;
3044
- this.config = env2?.config;
3045
- this.companies = env2?.companies || [];
3046
- this.user = env2?.user;
3047
- this.db = env2?.db;
3048
- this.requests = env2?.requests;
3049
- this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3054
+ const env = this.envStore.getState().env;
3055
+ this.baseUrl = env?.baseUrl;
3056
+ this.requests = env?.requests;
3057
+ this.context = env?.context;
3058
+ this.defaultCompany = env?.defaultCompany;
3059
+ this.config = env?.config;
3060
+ this.companies = env?.companies || [];
3061
+ this.user = env?.user;
3062
+ this.db = env?.db;
3063
+ this.refreshTokenEndpoint = env?.refreshTokenEndpoint;
3064
+ console.log("Env setup:", this);
3050
3065
  }
3051
3066
  setupEnv(envConfig) {
3052
- let env2 = {
3067
+ const dispatch = this.envStore.dispatch;
3068
+ const env = {
3053
3069
  ...envConfig,
3054
3070
  localStorageUtils: this.localStorageUtils,
3055
3071
  sessionStorageUtils: this.sessionStorageUtils
3056
3072
  };
3057
- const requests = axiosClient.init(env2);
3058
- this.requests = requests;
3059
- const dispatch = envStore.dispatch;
3060
- dispatch(
3061
- setEnv({
3062
- ...env2,
3063
- requests
3064
- })
3065
- );
3073
+ const requests = axiosClient.init(env);
3074
+ dispatch(setEnv({ ...env, requests }));
3066
3075
  this.setup();
3067
- return { ...env2, requests };
3068
3076
  }
3069
3077
  setUid(uid) {
3070
- const dispatch = envStore.dispatch;
3078
+ const dispatch = this.envStore.dispatch;
3071
3079
  dispatch(setUid(uid));
3072
3080
  this.setup();
3073
3081
  }
3074
3082
  setLang(lang) {
3075
- const dispatch = envStore.dispatch;
3083
+ const dispatch = this.envStore.dispatch;
3076
3084
  dispatch(setLang(lang));
3077
3085
  this.setup();
3078
3086
  }
3079
3087
  setAllowCompanies(allowCompanies) {
3080
- const dispatch = envStore.dispatch;
3088
+ const dispatch = this.envStore.dispatch;
3081
3089
  dispatch(setAllowCompanies(allowCompanies));
3082
3090
  this.setup();
3083
3091
  }
3084
3092
  setCompanies(companies) {
3085
- const dispatch = envStore.dispatch;
3093
+ const dispatch = this.envStore.dispatch;
3086
3094
  dispatch(setCompanies(companies));
3087
3095
  this.setup();
3088
3096
  }
3089
3097
  setDefaultCompany(company) {
3090
- const dispatch = envStore.dispatch;
3098
+ const dispatch = this.envStore.dispatch;
3091
3099
  dispatch(setDefaultCompany(company));
3092
3100
  this.setup();
3093
3101
  }
3094
3102
  setUserInfo(userInfo) {
3095
- const dispatch = envStore.dispatch;
3103
+ const dispatch = this.envStore.dispatch;
3096
3104
  dispatch(setUser(userInfo));
3097
3105
  this.setup();
3098
3106
  }
3099
3107
  };
3100
- var env = null;
3101
3108
  function getEnv() {
3102
- if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
3103
- return env;
3109
+ const instance = EnvStore.getInstance(envStore);
3110
+ if (!instance) {
3111
+ throw new Error("EnvStore has not been initialized \u2014 call initEnv() first");
3112
+ }
3113
+ return instance;
3104
3114
  }
3105
3115
 
3106
3116
  // src/services/action-service/index.ts
@@ -3110,14 +3120,14 @@ var ActionService = {
3110
3120
  idAction,
3111
3121
  context
3112
3122
  }) {
3113
- const env2 = getEnv();
3123
+ const env = getEnv();
3114
3124
  const jsonData = {
3115
3125
  action_id: idAction,
3116
3126
  with_context: {
3117
3127
  ...context
3118
3128
  }
3119
3129
  };
3120
- return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3130
+ return env.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3121
3131
  headers: {
3122
3132
  "Content-Type": "application/json"
3123
3133
  }
@@ -3131,14 +3141,14 @@ var ActionService = {
3131
3141
  method
3132
3142
  }) {
3133
3143
  try {
3134
- const env2 = getEnv();
3144
+ const env = getEnv();
3135
3145
  const jsonData = {
3136
3146
  model,
3137
3147
  method,
3138
3148
  ids,
3139
3149
  with_context: context
3140
3150
  };
3141
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3151
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3142
3152
  headers: {
3143
3153
  "Content-Type": "application/json"
3144
3154
  }
@@ -3154,14 +3164,14 @@ var ActionService = {
3154
3164
  ids,
3155
3165
  context
3156
3166
  }) {
3157
- const env2 = getEnv();
3167
+ const env = getEnv();
3158
3168
  const jsonData = {
3159
3169
  model,
3160
3170
  method: "unlink",
3161
3171
  ids,
3162
3172
  with_context: context
3163
3173
  };
3164
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3174
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3165
3175
  headers: {
3166
3176
  "Content-Type": "application/json"
3167
3177
  }
@@ -3173,14 +3183,14 @@ var ActionService = {
3173
3183
  id,
3174
3184
  context
3175
3185
  }) {
3176
- const env2 = getEnv();
3186
+ const env = getEnv();
3177
3187
  const jsonData = {
3178
3188
  model,
3179
3189
  method: "copy",
3180
3190
  ids: id,
3181
3191
  with_context: context
3182
3192
  };
3183
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3193
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3184
3194
  headers: {
3185
3195
  "Content-Type": "application/json"
3186
3196
  }
@@ -3188,7 +3198,7 @@ var ActionService = {
3188
3198
  },
3189
3199
  // Get Print Report
3190
3200
  async getPrintReportName({ id }) {
3191
- const env2 = getEnv();
3201
+ const env = getEnv();
3192
3202
  const jsonData = {
3193
3203
  model: "ir.actions.report",
3194
3204
  method: "web_read",
@@ -3199,7 +3209,7 @@ var ActionService = {
3199
3209
  }
3200
3210
  }
3201
3211
  };
3202
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3212
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3203
3213
  headers: {
3204
3214
  "Content-Type": "application/json"
3205
3215
  }
@@ -3207,7 +3217,7 @@ var ActionService = {
3207
3217
  },
3208
3218
  //Save Print Invoice
3209
3219
  async print({ id, report, db }) {
3210
- const env2 = getEnv();
3220
+ const env = getEnv();
3211
3221
  const jsonData = {
3212
3222
  report,
3213
3223
  id,
@@ -3217,7 +3227,7 @@ var ActionService = {
3217
3227
  };
3218
3228
  const queryString = toQueryString(jsonData);
3219
3229
  const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3220
- return env2.requests.get(urlWithParams, {
3230
+ return env.requests.get(urlWithParams, {
3221
3231
  headers: {
3222
3232
  "Content-Type": "application/json"
3223
3233
  },
@@ -3229,7 +3239,7 @@ var ActionService = {
3229
3239
  idAction,
3230
3240
  context
3231
3241
  }) {
3232
- const env2 = getEnv();
3242
+ const env = getEnv();
3233
3243
  const jsonData = {
3234
3244
  action_id: idAction,
3235
3245
  with_context: {
@@ -3245,7 +3255,7 @@ var ActionService = {
3245
3255
  // active_model: model,
3246
3256
  // },
3247
3257
  };
3248
- return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3258
+ return env.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3249
3259
  headers: {
3250
3260
  "Content-Type": "application/json"
3251
3261
  }
@@ -3257,30 +3267,30 @@ var action_service_default = ActionService;
3257
3267
  // src/services/auth-service/index.ts
3258
3268
  var AuthService = {
3259
3269
  async login(body) {
3260
- const env2 = getEnv();
3270
+ const env = getEnv();
3261
3271
  const payload = Object.fromEntries(
3262
3272
  Object.entries({
3263
3273
  username: body.email,
3264
3274
  password: body.password,
3265
- grant_type: env2?.config?.grantType || "",
3266
- client_id: env2?.config?.clientId || "",
3267
- client_secret: env2?.config?.clientSecret || ""
3275
+ grant_type: env?.config?.grantType || "",
3276
+ client_id: env?.config?.clientId || "",
3277
+ client_secret: env?.config?.clientSecret || ""
3268
3278
  }).filter(([_, value]) => !!value)
3269
3279
  );
3270
3280
  const encodedData = new URLSearchParams(payload).toString();
3271
- return env2?.requests?.post(body.path, encodedData, {
3281
+ return env?.requests?.post(body.path, encodedData, {
3272
3282
  headers: {
3273
3283
  "Content-Type": "application/x-www-form-urlencoded"
3274
3284
  }
3275
3285
  });
3276
3286
  },
3277
3287
  async forgotPassword(email) {
3278
- const env2 = getEnv();
3288
+ const env = getEnv();
3279
3289
  const bodyData = {
3280
3290
  login: email,
3281
3291
  url: `${window.location.origin}/reset-password`
3282
3292
  };
3283
- return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3293
+ return env?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3284
3294
  headers: {
3285
3295
  "Content-Type": "application/json"
3286
3296
  }
@@ -3291,7 +3301,7 @@ var AuthService = {
3291
3301
  with_context,
3292
3302
  method
3293
3303
  }) {
3294
- const env2 = getEnv();
3304
+ const env = getEnv();
3295
3305
  const body = {
3296
3306
  method,
3297
3307
  kwargs: {
@@ -3301,20 +3311,20 @@ var AuthService = {
3301
3311
  },
3302
3312
  with_context
3303
3313
  };
3304
- return env2?.requests?.post("/call" /* CALL_PATH */, body, {
3314
+ return env?.requests?.post("/call" /* CALL_PATH */, body, {
3305
3315
  headers: {
3306
3316
  "Content-Type": "application/json"
3307
3317
  }
3308
3318
  });
3309
3319
  },
3310
3320
  async resetPassword(data, token) {
3311
- const env2 = getEnv();
3321
+ const env = getEnv();
3312
3322
  const bodyData = {
3313
3323
  token,
3314
3324
  password: data.password,
3315
3325
  new_password: data.confirmPassword
3316
3326
  };
3317
- return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3327
+ return env?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3318
3328
  headers: {
3319
3329
  "Content-Type": "application/json"
3320
3330
  }
@@ -3325,7 +3335,7 @@ var AuthService = {
3325
3335
  password,
3326
3336
  with_context
3327
3337
  }) {
3328
- const env2 = getEnv();
3338
+ const env = getEnv();
3329
3339
  const bodyData = {
3330
3340
  method,
3331
3341
  kwargs: {
@@ -3335,57 +3345,43 @@ var AuthService = {
3335
3345
  },
3336
3346
  with_context
3337
3347
  };
3338
- return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3348
+ return env?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3339
3349
  headers: {
3340
3350
  "Content-Type": "application/json"
3341
3351
  }
3342
3352
  });
3343
3353
  },
3344
3354
  async updatePassword(data, token) {
3345
- const env2 = getEnv();
3355
+ const env = getEnv();
3346
3356
  const bodyData = {
3347
3357
  token,
3348
3358
  old_password: data.oldPassword,
3349
3359
  new_password: data.newPassword
3350
3360
  };
3351
- return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3361
+ return env?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3352
3362
  headers: {
3353
3363
  "Content-Type": "application/json"
3354
3364
  }
3355
3365
  });
3356
3366
  },
3357
3367
  async isValidToken(token) {
3358
- const env2 = getEnv();
3368
+ const env = getEnv();
3359
3369
  const bodyData = {
3360
3370
  token
3361
3371
  };
3362
- return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
3372
+ return env?.requests?.post("/check_token" /* TOKEN */, bodyData, {
3363
3373
  headers: {
3364
3374
  "Content-Type": "application/json"
3365
3375
  }
3366
3376
  });
3367
3377
  },
3368
- async isValidActionToken(actionToken, path) {
3369
- const env2 = getEnv();
3370
- return env2?.requests?.post(
3371
- path,
3372
- {},
3373
- {
3374
- headers: {
3375
- "Content-Type": "application/json"
3376
- },
3377
- useActionToken: true,
3378
- actionToken
3379
- }
3380
- );
3381
- },
3382
3378
  async loginSocial({
3383
3379
  db,
3384
3380
  state,
3385
3381
  access_token
3386
3382
  }) {
3387
- const env2 = getEnv();
3388
- return env2?.requests?.post(
3383
+ const env = getEnv();
3384
+ return env?.requests?.post(
3389
3385
  "/token/generate" /* GENTOKEN_SOCIAL */,
3390
3386
  { state, access_token },
3391
3387
  {
@@ -3396,18 +3392,18 @@ var AuthService = {
3396
3392
  );
3397
3393
  },
3398
3394
  async getProviders(db) {
3399
- const env2 = getEnv();
3400
- return env2?.requests?.get("/oauth/providers", { params: { db } });
3395
+ const env = getEnv();
3396
+ return env?.requests?.get("/oauth/providers", { params: { db } });
3401
3397
  },
3402
3398
  async getAccessByCode(code) {
3403
- const env2 = getEnv();
3399
+ const env = getEnv();
3404
3400
  const data = new URLSearchParams();
3405
3401
  data.append("code", code);
3406
3402
  data.append("grant_type", "authorization_code");
3407
- data.append("client_id", env2?.config?.clientId || "");
3408
- data.append("redirect_uri", env2?.config?.redirectUri || "");
3409
- return env2?.requests?.post(
3410
- `${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3403
+ data.append("client_id", env?.config?.clientId || "");
3404
+ data.append("redirect_uri", env?.config?.redirectUri || "");
3405
+ return env?.requests?.post(
3406
+ `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3411
3407
  data,
3412
3408
  {
3413
3409
  headers: {
@@ -3417,9 +3413,9 @@ var AuthService = {
3417
3413
  );
3418
3414
  },
3419
3415
  async logout(data) {
3420
- const env2 = getEnv();
3416
+ const env = getEnv();
3421
3417
  console.log(data);
3422
- return env2?.requests?.post(
3418
+ return env?.requests?.post(
3423
3419
  "/logout" /* LOGOUT */,
3424
3420
  {},
3425
3421
  {
@@ -3437,15 +3433,15 @@ var auth_service_default = AuthService;
3437
3433
  // src/services/company-service/index.ts
3438
3434
  var CompanyService = {
3439
3435
  async getCurrentCompany() {
3440
- const env2 = getEnv();
3441
- return await env2.requests.get("/company" /* COMPANY_PATH */, {
3436
+ const env = getEnv();
3437
+ return await env.requests.get("/company" /* COMPANY_PATH */, {
3442
3438
  headers: {
3443
3439
  "Content-Type": "application/json"
3444
3440
  }
3445
3441
  });
3446
3442
  },
3447
3443
  async getInfoCompany(id) {
3448
- const env2 = getEnv();
3444
+ const env = getEnv();
3449
3445
  const jsonData = {
3450
3446
  ids: [id],
3451
3447
  model: "res.company" /* COMPANY */,
@@ -3460,7 +3456,7 @@ var CompanyService = {
3460
3456
  }
3461
3457
  }
3462
3458
  };
3463
- return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3459
+ return await env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3464
3460
  headers: {
3465
3461
  "Content-Type": "application/json"
3466
3462
  }
@@ -3472,16 +3468,16 @@ var company_service_default = CompanyService;
3472
3468
  // src/services/excel-service/index.ts
3473
3469
  var ExcelService = {
3474
3470
  async uploadFile({ formData }) {
3475
- const env2 = getEnv();
3476
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3471
+ const env = getEnv();
3472
+ return env.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3477
3473
  headers: {
3478
3474
  "Content-Type": "multipart/form-data"
3479
3475
  }
3480
3476
  });
3481
3477
  },
3482
3478
  async uploadIdFile({ formData }) {
3483
- const env2 = getEnv();
3484
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3479
+ const env = getEnv();
3480
+ return env.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3485
3481
  headers: {
3486
3482
  "Content-Type": "multipart/form-data"
3487
3483
  }
@@ -3493,7 +3489,7 @@ var ExcelService = {
3493
3489
  isHeader,
3494
3490
  context
3495
3491
  }) {
3496
- const env2 = getEnv();
3492
+ const env = getEnv();
3497
3493
  const jsonData = {
3498
3494
  model: "base_import.import" /* BASE_IMPORT */,
3499
3495
  method: "parse_preview",
@@ -3523,7 +3519,7 @@ var ExcelService = {
3523
3519
  },
3524
3520
  with_context: context
3525
3521
  };
3526
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3522
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3527
3523
  headers: {
3528
3524
  "Content-Type": "multipart/form-data"
3529
3525
  }
@@ -3537,7 +3533,7 @@ var ExcelService = {
3537
3533
  dryrun,
3538
3534
  context
3539
3535
  }) {
3540
- const env2 = getEnv();
3536
+ const env = getEnv();
3541
3537
  const jsonData = {
3542
3538
  model: "base_import.import" /* BASE_IMPORT */,
3543
3539
  method: "execute_import",
@@ -3550,20 +3546,20 @@ var ExcelService = {
3550
3546
  },
3551
3547
  with_context: context
3552
3548
  };
3553
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3549
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3554
3550
  headers: {
3555
3551
  "Content-Type": "multipart/form-data"
3556
3552
  }
3557
3553
  });
3558
3554
  },
3559
3555
  async getFileExcel({ model }) {
3560
- const env2 = getEnv();
3556
+ const env = getEnv();
3561
3557
  const jsonData = {
3562
3558
  model,
3563
3559
  method: "get_import_templates" /* GET_IMPORT */,
3564
3560
  args: []
3565
3561
  };
3566
- return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3562
+ return env.requests.post("/call" /* CALL_PATH */, jsonData);
3567
3563
  },
3568
3564
  async getFieldExport({
3569
3565
  ids,
@@ -3577,7 +3573,7 @@ var ExcelService = {
3577
3573
  context,
3578
3574
  importCompat
3579
3575
  }) {
3580
- const env2 = getEnv();
3576
+ const env = getEnv();
3581
3577
  const jsonData = {
3582
3578
  model,
3583
3579
  import_compat: importCompat,
@@ -3592,7 +3588,7 @@ var ExcelService = {
3592
3588
  jsonData.prefix = prefix;
3593
3589
  jsonData.exclude = [null];
3594
3590
  }
3595
- return env2.requests.post("/export/get_fields", jsonData);
3591
+ return env.requests.post("/export/get_fields", jsonData);
3596
3592
  },
3597
3593
  async exportExcel({
3598
3594
  model,
@@ -3604,7 +3600,7 @@ var ExcelService = {
3604
3600
  context,
3605
3601
  groupby
3606
3602
  }) {
3607
- const env2 = getEnv();
3603
+ const env = getEnv();
3608
3604
  const jsonData = {
3609
3605
  model,
3610
3606
  domain,
@@ -3614,7 +3610,7 @@ var ExcelService = {
3614
3610
  with_context: context,
3615
3611
  groupby: groupby ?? []
3616
3612
  };
3617
- return env2.requests.post_excel(`/export/${type}`, jsonData);
3613
+ return env.requests.post_excel(`/export/${type}`, jsonData);
3618
3614
  }
3619
3615
  };
3620
3616
  var excel_service_default = ExcelService;
@@ -3623,7 +3619,7 @@ var excel_service_default = ExcelService;
3623
3619
  var FormService = {
3624
3620
  async getComment({ data }) {
3625
3621
  try {
3626
- const env2 = getEnv();
3622
+ const env = getEnv();
3627
3623
  const jsonData = {
3628
3624
  thread_id: data.thread_id,
3629
3625
  thread_model: data.thread_model,
@@ -3632,7 +3628,7 @@ var FormService = {
3632
3628
  lang: data.lang
3633
3629
  }
3634
3630
  };
3635
- return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3631
+ return env.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3636
3632
  headers: {
3637
3633
  "Content-Type": "application/json"
3638
3634
  }
@@ -3644,7 +3640,7 @@ var FormService = {
3644
3640
  },
3645
3641
  async sentComment({ data }) {
3646
3642
  try {
3647
- const env2 = getEnv();
3643
+ const env = getEnv();
3648
3644
  const jsonData = {
3649
3645
  context: {
3650
3646
  tz: "Asia/Saigon",
@@ -3663,7 +3659,7 @@ var FormService = {
3663
3659
  thread_id: Number(data.thread_id),
3664
3660
  thread_model: data.thread_model
3665
3661
  };
3666
- return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3662
+ return env.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3667
3663
  headers: {
3668
3664
  "Content-Type": "application/json"
3669
3665
  }
@@ -3675,14 +3671,14 @@ var FormService = {
3675
3671
  },
3676
3672
  async deleteComment({ data }) {
3677
3673
  try {
3678
- const env2 = getEnv();
3674
+ const env = getEnv();
3679
3675
  const jsonData = {
3680
3676
  attachment_ids: [],
3681
3677
  attachment_tokens: [],
3682
3678
  body: "",
3683
3679
  message_id: data.message_id
3684
3680
  };
3685
- return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3681
+ return env.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3686
3682
  headers: {
3687
3683
  "Content-Type": "application/json"
3688
3684
  }
@@ -3694,8 +3690,8 @@ var FormService = {
3694
3690
  },
3695
3691
  async getImage({ data }) {
3696
3692
  try {
3697
- const env2 = getEnv();
3698
- return env2.requests.get(
3693
+ const env = getEnv();
3694
+ return env.requests.get(
3699
3695
  `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3700
3696
  {
3701
3697
  headers: {
@@ -3710,8 +3706,8 @@ var FormService = {
3710
3706
  },
3711
3707
  async uploadImage({ data }) {
3712
3708
  try {
3713
- const env2 = getEnv();
3714
- return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3709
+ const env = getEnv();
3710
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3715
3711
  headers: {
3716
3712
  "Content-Type": "multipart/form-data"
3717
3713
  }
@@ -3723,14 +3719,14 @@ var FormService = {
3723
3719
  },
3724
3720
  async getFormView({ data }) {
3725
3721
  try {
3726
- const env2 = getEnv();
3722
+ const env = getEnv();
3727
3723
  const jsonData = {
3728
3724
  model: data.model,
3729
3725
  method: "get_formview_action",
3730
3726
  ids: data.id ? [data.id] : [],
3731
3727
  with_context: data.context
3732
3728
  };
3733
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3729
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3734
3730
  headers: {
3735
3731
  "Content-Type": "application/json"
3736
3732
  }
@@ -3741,7 +3737,7 @@ var FormService = {
3741
3737
  }
3742
3738
  },
3743
3739
  async changeStatus({ data }) {
3744
- const env2 = getEnv();
3740
+ const env = getEnv();
3745
3741
  const vals = {
3746
3742
  [data.name]: data.stage_id
3747
3743
  };
@@ -3761,7 +3757,7 @@ var FormService = {
3761
3757
  specification: {}
3762
3758
  }
3763
3759
  };
3764
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3760
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3765
3761
  headers: {
3766
3762
  "Content-Type": "application/json"
3767
3763
  }
@@ -3776,7 +3772,7 @@ var KanbanServices = {
3776
3772
  model,
3777
3773
  width_context
3778
3774
  }) {
3779
- const env2 = getEnv();
3775
+ const env = getEnv();
3780
3776
  const jsonDataView = {
3781
3777
  model,
3782
3778
  method: "web_read_group",
@@ -3787,7 +3783,7 @@ var KanbanServices = {
3787
3783
  },
3788
3784
  width_context
3789
3785
  };
3790
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3786
+ return env.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3791
3787
  headers: {
3792
3788
  "Content-Type": "application/json"
3793
3789
  }
@@ -3799,7 +3795,7 @@ var KanbanServices = {
3799
3795
  model,
3800
3796
  width_context
3801
3797
  }) {
3802
- const env2 = getEnv();
3798
+ const env = getEnv();
3803
3799
  const jsonDataView = {
3804
3800
  model,
3805
3801
  method: "read_progress_bar",
@@ -3813,7 +3809,7 @@ var KanbanServices = {
3813
3809
  },
3814
3810
  width_context
3815
3811
  };
3816
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3812
+ return env.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3817
3813
  headers: {
3818
3814
  "Content-Type": "application/json"
3819
3815
  }
@@ -3830,7 +3826,7 @@ var ModelService = {
3830
3826
  spectification,
3831
3827
  model
3832
3828
  }) {
3833
- const env2 = getEnv();
3829
+ const env = getEnv();
3834
3830
  const jsonData = {
3835
3831
  model,
3836
3832
  method: "web_search_read",
@@ -3841,14 +3837,14 @@ var ModelService = {
3841
3837
  offset: 0
3842
3838
  }
3843
3839
  };
3844
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3840
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3845
3841
  headers: {
3846
3842
  "Content-Type": "application/json"
3847
3843
  }
3848
3844
  });
3849
3845
  },
3850
3846
  async getCurrency() {
3851
- const env2 = getEnv();
3847
+ const env = getEnv();
3852
3848
  const jsonData = {
3853
3849
  model: "res.currency",
3854
3850
  method: "web_search_read",
@@ -3862,14 +3858,14 @@ var ModelService = {
3862
3858
  offset: 0
3863
3859
  }
3864
3860
  };
3865
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3861
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3866
3862
  headers: {
3867
3863
  "Content-Type": "application/json"
3868
3864
  }
3869
3865
  });
3870
3866
  },
3871
3867
  async getConversionRate() {
3872
- const env2 = getEnv();
3868
+ const env = getEnv();
3873
3869
  const jsonData = {
3874
3870
  model: "res.currency",
3875
3871
  method: "web_search_read",
@@ -3889,14 +3885,14 @@ var ModelService = {
3889
3885
  offset: 0
3890
3886
  }
3891
3887
  };
3892
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3888
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3893
3889
  headers: {
3894
3890
  "Content-Type": "application/json"
3895
3891
  }
3896
3892
  });
3897
3893
  },
3898
3894
  async getAll({ data }) {
3899
- const env2 = getEnv();
3895
+ const env = getEnv();
3900
3896
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3901
3897
  fields: data.fields,
3902
3898
  groupby: data.groupby
@@ -3917,14 +3913,14 @@ var ModelService = {
3917
3913
  ...jsonReadGroup
3918
3914
  }
3919
3915
  };
3920
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3916
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3921
3917
  headers: {
3922
3918
  "Content-Type": "application/json"
3923
3919
  }
3924
3920
  });
3925
3921
  },
3926
3922
  async getListCalendar({ data }) {
3927
- const env2 = getEnv();
3923
+ const env = getEnv();
3928
3924
  const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3929
3925
  fields: data.fields,
3930
3926
  groupby: data.groupby
@@ -3946,7 +3942,7 @@ var ModelService = {
3946
3942
  ...jsonReadGroup
3947
3943
  }
3948
3944
  };
3949
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3945
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3950
3946
  headers: {
3951
3947
  "Content-Type": "application/json"
3952
3948
  }
@@ -3962,7 +3958,7 @@ var ModelService = {
3962
3958
  context = {},
3963
3959
  limit = 10
3964
3960
  }) {
3965
- const env2 = getEnv();
3961
+ const env = getEnv();
3966
3962
  const jsonData = {
3967
3963
  model,
3968
3964
  method: "web_search_read" /* WEB_SEARCH_READ */,
@@ -3976,7 +3972,7 @@ var ModelService = {
3976
3972
  order
3977
3973
  }
3978
3974
  };
3979
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3975
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3980
3976
  headers: {
3981
3977
  "Content-Type": "application/json"
3982
3978
  }
@@ -3988,7 +3984,7 @@ var ModelService = {
3988
3984
  specification,
3989
3985
  context
3990
3986
  }) {
3991
- const env2 = getEnv();
3987
+ const env = getEnv();
3992
3988
  const jsonData = {
3993
3989
  model,
3994
3990
  method: "web_read" /* WEB_READ */,
@@ -3998,7 +3994,7 @@ var ModelService = {
3998
3994
  specification
3999
3995
  }
4000
3996
  };
4001
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3997
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4002
3998
  headers: {
4003
3999
  "Content-Type": "application/json"
4004
4000
  }
@@ -4012,7 +4008,7 @@ var ModelService = {
4012
4008
  context = {},
4013
4009
  path
4014
4010
  }) {
4015
- const env2 = getEnv();
4011
+ const env = getEnv();
4016
4012
  const jsonData = {
4017
4013
  model,
4018
4014
  method: "web_save" /* WEB_SAVE */,
@@ -4023,20 +4019,20 @@ var ModelService = {
4023
4019
  specification
4024
4020
  }
4025
4021
  };
4026
- return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
4022
+ return env?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
4027
4023
  headers: {
4028
4024
  "Content-Type": "application/json"
4029
4025
  }
4030
4026
  });
4031
4027
  },
4032
4028
  async delete({ ids = [], model }) {
4033
- const env2 = getEnv();
4029
+ const env = getEnv();
4034
4030
  const jsonData = {
4035
4031
  model,
4036
4032
  method: "unlink" /* UNLINK */,
4037
4033
  ids
4038
4034
  };
4039
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4035
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4040
4036
  headers: {
4041
4037
  "Content-Type": "application/json"
4042
4038
  }
@@ -4050,7 +4046,7 @@ var ModelService = {
4050
4046
  context,
4051
4047
  fieldChange
4052
4048
  }) {
4053
- const env2 = getEnv();
4049
+ const env = getEnv();
4054
4050
  const jsonData = {
4055
4051
  model,
4056
4052
  method: "onchange" /* ONCHANGE */,
@@ -4062,19 +4058,19 @@ var ModelService = {
4062
4058
  specification
4063
4059
  ]
4064
4060
  };
4065
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4061
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4066
4062
  headers: {
4067
4063
  "Content-Type": "application/json"
4068
4064
  }
4069
4065
  });
4070
4066
  },
4071
4067
  async getListFieldsOnchange({ model }) {
4072
- const env2 = getEnv();
4068
+ const env = getEnv();
4073
4069
  const jsonData = {
4074
4070
  model,
4075
4071
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4076
4072
  };
4077
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4073
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4078
4074
  headers: {
4079
4075
  "Content-Type": "application/json"
4080
4076
  }
@@ -4142,15 +4138,15 @@ var model_service_default = ModelService;
4142
4138
  // src/services/user-service/index.ts
4143
4139
  var UserService = {
4144
4140
  async getProfile(path) {
4145
- const env2 = getEnv();
4146
- return env2?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4141
+ const env = getEnv();
4142
+ return env.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4147
4143
  headers: {
4148
4144
  "Content-Type": "application/x-www-form-urlencoded"
4149
4145
  }
4150
4146
  });
4151
4147
  },
4152
4148
  async getUser({ context, id }) {
4153
- const env2 = getEnv();
4149
+ const env = getEnv();
4154
4150
  const jsonData = {
4155
4151
  model: "res.users",
4156
4152
  method: "web_read",
@@ -4179,20 +4175,20 @@ var UserService = {
4179
4175
  }
4180
4176
  }
4181
4177
  };
4182
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4178
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4183
4179
  headers: {
4184
4180
  "Content-Type": "application/json"
4185
4181
  }
4186
4182
  });
4187
4183
  },
4188
4184
  switchUserLocale: async ({ id, values }) => {
4189
- const env2 = getEnv();
4185
+ const env = getEnv();
4190
4186
  const jsonData = {
4191
4187
  model: "res.users",
4192
4188
  domain: [["id", "=", id]],
4193
4189
  values
4194
4190
  };
4195
- return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4191
+ return env?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4196
4192
  headers: {
4197
4193
  "Content-Type": "application/json"
4198
4194
  }
@@ -4210,7 +4206,7 @@ var ViewService = {
4210
4206
  options = {},
4211
4207
  aid
4212
4208
  }) {
4213
- const env2 = getEnv();
4209
+ const env = getEnv();
4214
4210
  const defaultOptions = {
4215
4211
  load_filters: true,
4216
4212
  toolbar: true,
@@ -4225,14 +4221,14 @@ var ViewService = {
4225
4221
  },
4226
4222
  with_context: context
4227
4223
  };
4228
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4224
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4229
4225
  headers: {
4230
4226
  "Content-Type": "application/json"
4231
4227
  }
4232
4228
  });
4233
4229
  },
4234
4230
  async getMenu(context) {
4235
- const env2 = getEnv();
4231
+ const env = getEnv();
4236
4232
  const jsonData = {
4237
4233
  model: "ir.ui.menu" /* MENU */,
4238
4234
  method: "web_search_read" /* WEB_SEARCH_READ */,
@@ -4369,14 +4365,14 @@ var ViewService = {
4369
4365
  ]
4370
4366
  }
4371
4367
  };
4372
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4368
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4373
4369
  headers: {
4374
4370
  "Content-Type": "application/json"
4375
4371
  }
4376
4372
  });
4377
4373
  },
4378
4374
  async getActionDetail(aid, context) {
4379
- const env2 = getEnv();
4375
+ const env = getEnv();
4380
4376
  const jsonData = {
4381
4377
  model: "ir.actions.act_window" /* WINDOW_ACTION */,
4382
4378
  method: "web_read" /* WEB_READ */,
@@ -4397,7 +4393,7 @@ var ViewService = {
4397
4393
  }
4398
4394
  }
4399
4395
  };
4400
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4396
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4401
4397
  headers: {
4402
4398
  "Content-Type": "application/json"
4403
4399
  }
@@ -4409,7 +4405,7 @@ var ViewService = {
4409
4405
  context,
4410
4406
  offset
4411
4407
  }) {
4412
- const env2 = getEnv();
4408
+ const env = getEnv();
4413
4409
  const jsonData = {
4414
4410
  model,
4415
4411
  with_context: context,
@@ -4417,14 +4413,14 @@ var ViewService = {
4417
4413
  field: "sequence",
4418
4414
  ...offset > 0 ? { offset } : {}
4419
4415
  };
4420
- return env2?.requests.post("/web/dataset/resequence", jsonData, {
4416
+ return env?.requests.post("/web/dataset/resequence", jsonData, {
4421
4417
  headers: {
4422
4418
  "Content-Type": "application/json"
4423
4419
  }
4424
4420
  });
4425
4421
  },
4426
4422
  async getSelectionItem({ data }) {
4427
- const env2 = getEnv();
4423
+ const env = getEnv();
4428
4424
  const jsonData = {
4429
4425
  model: data.model,
4430
4426
  ids: [],
@@ -4442,15 +4438,15 @@ var ViewService = {
4442
4438
  }
4443
4439
  }
4444
4440
  };
4445
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4441
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4446
4442
  headers: {
4447
4443
  "Content-Type": "application/json"
4448
4444
  }
4449
4445
  });
4450
4446
  },
4451
4447
  async loadMessages() {
4452
- const env2 = getEnv();
4453
- return env2.requests.post(
4448
+ const env = getEnv();
4449
+ return env.requests.post(
4454
4450
  "/load_message_failures" /* LOAD_MESSAGE */,
4455
4451
  {},
4456
4452
  {
@@ -4461,8 +4457,9 @@ var ViewService = {
4461
4457
  );
4462
4458
  },
4463
4459
  async getVersion() {
4464
- const env2 = getEnv();
4465
- return env2?.requests.get("", {
4460
+ const env = getEnv();
4461
+ console.log("env?.requests", env, env?.requests);
4462
+ return env?.requests?.get("", {
4466
4463
  headers: {
4467
4464
  "Content-Type": "application/json"
4468
4465
  }
@@ -4472,12 +4469,12 @@ var ViewService = {
4472
4469
  method,
4473
4470
  with_context
4474
4471
  }) {
4475
- const env2 = getEnv();
4472
+ const env = getEnv();
4476
4473
  const jsonData = {
4477
4474
  method,
4478
4475
  with_context
4479
4476
  };
4480
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4477
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4481
4478
  headers: {
4482
4479
  "Content-Type": "application/json"
4483
4480
  }
@@ -4490,7 +4487,7 @@ var ViewService = {
4490
4487
  device,
4491
4488
  location
4492
4489
  }) {
4493
- const env2 = getEnv();
4490
+ const env = getEnv();
4494
4491
  const jsonData = {
4495
4492
  method,
4496
4493
  kwargs: {
@@ -4502,7 +4499,7 @@ var ViewService = {
4502
4499
  },
4503
4500
  with_context
4504
4501
  };
4505
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4502
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4506
4503
  headers: {
4507
4504
  "Content-Type": "application/json"
4508
4505
  },
@@ -4516,7 +4513,7 @@ var ViewService = {
4516
4513
  response_type,
4517
4514
  path
4518
4515
  }) {
4519
- const env2 = getEnv();
4516
+ const env = getEnv();
4520
4517
  const params = new URLSearchParams({
4521
4518
  response_type,
4522
4519
  client_id,
@@ -4524,7 +4521,7 @@ var ViewService = {
4524
4521
  state
4525
4522
  });
4526
4523
  const url = `${path}?${params.toString()}`;
4527
- return env2?.requests.get(url, {
4524
+ return env?.requests.get(url, {
4528
4525
  headers: {
4529
4526
  "Content-Type": "application/json"
4530
4527
  },
@@ -4537,14 +4534,14 @@ var ViewService = {
4537
4534
  client_id,
4538
4535
  scopes
4539
4536
  }) {
4540
- const env2 = getEnv();
4537
+ const env = getEnv();
4541
4538
  const jsonData = {
4542
4539
  redirect_uri,
4543
4540
  state,
4544
4541
  client_id,
4545
4542
  scopes
4546
4543
  };
4547
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4544
+ return env?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4548
4545
  headers: {
4549
4546
  "Content-Type": "application/json"
4550
4547
  },
@@ -4556,7 +4553,7 @@ var ViewService = {
4556
4553
  token,
4557
4554
  views
4558
4555
  }) {
4559
- const env2 = getEnv();
4556
+ const env = getEnv();
4560
4557
  const jsonData = {
4561
4558
  method,
4562
4559
  kwargs: {
@@ -4566,7 +4563,7 @@ var ViewService = {
4566
4563
  token
4567
4564
  }
4568
4565
  };
4569
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4566
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4570
4567
  headers: {
4571
4568
  "Content-Type": "application/json"
4572
4569
  }
@@ -4578,7 +4575,7 @@ var ViewService = {
4578
4575
  kwargs,
4579
4576
  token
4580
4577
  }) {
4581
- const env2 = getEnv();
4578
+ const env = getEnv();
4582
4579
  const jsonData = {
4583
4580
  method,
4584
4581
  model,
@@ -4587,21 +4584,21 @@ var ViewService = {
4587
4584
  token
4588
4585
  }
4589
4586
  };
4590
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4587
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4591
4588
  headers: {
4592
4589
  "Content-Type": "application/json"
4593
4590
  }
4594
4591
  });
4595
4592
  },
4596
4593
  async requestSetupTotp({ method, token }) {
4597
- const env2 = getEnv();
4594
+ const env = getEnv();
4598
4595
  const jsonData = {
4599
4596
  method,
4600
4597
  with_context: {
4601
4598
  token
4602
4599
  }
4603
4600
  };
4604
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4601
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4605
4602
  headers: {
4606
4603
  "Content-Type": "application/json"
4607
4604
  }
@@ -4612,7 +4609,7 @@ var ViewService = {
4612
4609
  action_token,
4613
4610
  code
4614
4611
  }) {
4615
- const env2 = getEnv();
4612
+ const env = getEnv();
4616
4613
  const jsonData = {
4617
4614
  method,
4618
4615
  kwargs: {
@@ -4624,21 +4621,21 @@ var ViewService = {
4624
4621
  action_token
4625
4622
  }
4626
4623
  };
4627
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4624
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4628
4625
  headers: {
4629
4626
  "Content-Type": "application/json"
4630
4627
  }
4631
4628
  });
4632
4629
  },
4633
4630
  async removeTotpSetUp({ method, token }) {
4634
- const env2 = getEnv();
4631
+ const env = getEnv();
4635
4632
  const jsonData = {
4636
4633
  method,
4637
4634
  with_context: {
4638
4635
  token
4639
4636
  }
4640
4637
  };
4641
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4638
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4642
4639
  headers: {
4643
4640
  "Content-Type": "application/json"
4644
4641
  }
@@ -4779,33 +4776,19 @@ var useGetAccessByCode = () => {
4779
4776
  };
4780
4777
  var use_get_access_by_code_default = useGetAccessByCode;
4781
4778
 
4782
- // src/hooks/auth/use-validate-action-token.ts
4783
- import { useMutation as useMutation12 } from "@tanstack/react-query";
4784
- var useValidateActionToken = () => {
4785
- return useMutation12({
4786
- mutationFn: ({
4787
- actionToken,
4788
- path
4789
- }) => {
4790
- return auth_service_default.isValidActionToken(actionToken, path);
4791
- }
4792
- });
4793
- };
4794
- var use_validate_action_token_default = useValidateActionToken;
4795
-
4796
4779
  // src/hooks/company/use-get-company-info.ts
4797
- import { useMutation as useMutation13 } from "@tanstack/react-query";
4780
+ import { useMutation as useMutation12 } from "@tanstack/react-query";
4798
4781
  var useGetCompanyInfo = () => {
4799
- return useMutation13({
4782
+ return useMutation12({
4800
4783
  mutationFn: (id) => company_service_default.getInfoCompany(id)
4801
4784
  });
4802
4785
  };
4803
4786
  var use_get_company_info_default = useGetCompanyInfo;
4804
4787
 
4805
4788
  // src/hooks/company/use-get-current-company.ts
4806
- import { useMutation as useMutation14 } from "@tanstack/react-query";
4789
+ import { useMutation as useMutation13 } from "@tanstack/react-query";
4807
4790
  var useGetCurrentCompany = () => {
4808
- return useMutation14({
4791
+ return useMutation13({
4809
4792
  mutationFn: () => company_service_default.getCurrentCompany()
4810
4793
  });
4811
4794
  };
@@ -4832,9 +4815,9 @@ var useGetListCompany = (companyIDs = []) => {
4832
4815
  var use_get_list_company_default = useGetListCompany;
4833
4816
 
4834
4817
  // src/hooks/excel/use-export-excel.ts
4835
- import { useMutation as useMutation15 } from "@tanstack/react-query";
4818
+ import { useMutation as useMutation14 } from "@tanstack/react-query";
4836
4819
  var useExportExcel = () => {
4837
- return useMutation15({
4820
+ return useMutation14({
4838
4821
  mutationFn: ({
4839
4822
  model,
4840
4823
  domain,
@@ -4859,9 +4842,9 @@ var useExportExcel = () => {
4859
4842
  var use_export_excel_default = useExportExcel;
4860
4843
 
4861
4844
  // src/hooks/excel/use-get-field-export.ts
4862
- import { useMutation as useMutation16 } from "@tanstack/react-query";
4845
+ import { useMutation as useMutation15 } from "@tanstack/react-query";
4863
4846
  var useGetFieldExport = () => {
4864
- return useMutation16({
4847
+ return useMutation15({
4865
4848
  mutationFn: ({
4866
4849
  ids,
4867
4850
  model,
@@ -4908,9 +4891,9 @@ var useGetFileExcel = ({ model }) => {
4908
4891
  var use_get_file_excel_default = useGetFileExcel;
4909
4892
 
4910
4893
  // src/hooks/excel/use-parse-preview.ts
4911
- import { useMutation as useMutation17 } from "@tanstack/react-query";
4894
+ import { useMutation as useMutation16 } from "@tanstack/react-query";
4912
4895
  var useParsePreview = () => {
4913
- return useMutation17({
4896
+ return useMutation16({
4914
4897
  mutationFn: ({
4915
4898
  id,
4916
4899
  selectedSheet,
@@ -4927,9 +4910,9 @@ var useParsePreview = () => {
4927
4910
  var use_parse_preview_default = useParsePreview;
4928
4911
 
4929
4912
  // src/hooks/excel/use-upload-file.ts
4930
- import { useMutation as useMutation18 } from "@tanstack/react-query";
4913
+ import { useMutation as useMutation17 } from "@tanstack/react-query";
4931
4914
  var useUploadFile = () => {
4932
- return useMutation18({
4915
+ return useMutation17({
4933
4916
  mutationFn: ({ formData }) => excel_service_default.uploadFile({
4934
4917
  formData
4935
4918
  })
@@ -4938,9 +4921,9 @@ var useUploadFile = () => {
4938
4921
  var use_upload_file_default = useUploadFile;
4939
4922
 
4940
4923
  // src/hooks/excel/use-upload-id-file.ts
4941
- import { useMutation as useMutation19 } from "@tanstack/react-query";
4924
+ import { useMutation as useMutation18 } from "@tanstack/react-query";
4942
4925
  var useUploadIdFile = () => {
4943
- return useMutation19({
4926
+ return useMutation18({
4944
4927
  mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
4945
4928
  formData
4946
4929
  })
@@ -4949,9 +4932,9 @@ var useUploadIdFile = () => {
4949
4932
  var use_upload_id_file_default = useUploadIdFile;
4950
4933
 
4951
4934
  // src/hooks/excel/uss-execute-import.ts
4952
- import { useMutation as useMutation20 } from "@tanstack/react-query";
4935
+ import { useMutation as useMutation19 } from "@tanstack/react-query";
4953
4936
  var useExecuteImport = () => {
4954
- return useMutation20({
4937
+ return useMutation19({
4955
4938
  mutationFn: ({
4956
4939
  fields,
4957
4940
  columns,
@@ -4972,9 +4955,9 @@ var useExecuteImport = () => {
4972
4955
  var uss_execute_import_default = useExecuteImport;
4973
4956
 
4974
4957
  // src/hooks/form/use-change-status.ts
4975
- import { useMutation as useMutation21 } from "@tanstack/react-query";
4958
+ import { useMutation as useMutation20 } from "@tanstack/react-query";
4976
4959
  var useChangeStatus = () => {
4977
- return useMutation21({
4960
+ return useMutation20({
4978
4961
  mutationFn: ({ data }) => {
4979
4962
  return form_service_default.changeStatus({
4980
4963
  data
@@ -4985,9 +4968,9 @@ var useChangeStatus = () => {
4985
4968
  var use_change_status_default = useChangeStatus;
4986
4969
 
4987
4970
  // src/hooks/form/use-delete-comment.ts
4988
- import { useMutation as useMutation22 } from "@tanstack/react-query";
4971
+ import { useMutation as useMutation21 } from "@tanstack/react-query";
4989
4972
  var useDeleteComment = () => {
4990
- return useMutation22({
4973
+ return useMutation21({
4991
4974
  mutationFn: ({ data }) => form_service_default.deleteComment({
4992
4975
  data
4993
4976
  })
@@ -5052,9 +5035,9 @@ var useGetImage = ({
5052
5035
  var use_get_image_default = useGetImage;
5053
5036
 
5054
5037
  // src/hooks/form/use-send-comment.ts
5055
- import { useMutation as useMutation23 } from "@tanstack/react-query";
5038
+ import { useMutation as useMutation22 } from "@tanstack/react-query";
5056
5039
  var useSendComment = () => {
5057
- return useMutation23({
5040
+ return useMutation22({
5058
5041
  mutationFn: ({ data }) => form_service_default.sentComment({
5059
5042
  data
5060
5043
  })
@@ -5063,9 +5046,9 @@ var useSendComment = () => {
5063
5046
  var use_send_comment_default = useSendComment;
5064
5047
 
5065
5048
  // src/hooks/form/use-upload-image.ts
5066
- import { useMutation as useMutation24 } from "@tanstack/react-query";
5049
+ import { useMutation as useMutation23 } from "@tanstack/react-query";
5067
5050
  var useUploadImage = () => {
5068
- return useMutation24({
5051
+ return useMutation23({
5069
5052
  mutationFn: ({ data }) => form_service_default.uploadImage({
5070
5053
  data
5071
5054
  })
@@ -5074,9 +5057,9 @@ var useUploadImage = () => {
5074
5057
  var use_upload_image_default = useUploadImage;
5075
5058
 
5076
5059
  // src/hooks/model/use-delete.ts
5077
- import { useMutation as useMutation25 } from "@tanstack/react-query";
5060
+ import { useMutation as useMutation24 } from "@tanstack/react-query";
5078
5061
  var useDelete = () => {
5079
- return useMutation25({
5062
+ return useMutation24({
5080
5063
  mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
5081
5064
  });
5082
5065
  };
@@ -5130,9 +5113,9 @@ var useGetCurrency = () => {
5130
5113
  var use_get_currency_default = useGetCurrency;
5131
5114
 
5132
5115
  // src/hooks/model/use-get-detail.ts
5133
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5116
+ import { useMutation as useMutation25 } from "@tanstack/react-query";
5134
5117
  var useGetDetail = () => {
5135
- return useMutation26({
5118
+ return useMutation25({
5136
5119
  mutationFn: ({
5137
5120
  model,
5138
5121
  ids,
@@ -5325,9 +5308,9 @@ var useOdooDataTransform = () => {
5325
5308
  var use_odoo_data_transform_default = useOdooDataTransform;
5326
5309
 
5327
5310
  // src/hooks/model/use-onchange-form.ts
5328
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5311
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
5329
5312
  var useOnChangeForm = () => {
5330
- return useMutation27({
5313
+ return useMutation26({
5331
5314
  mutationFn: ({
5332
5315
  ids,
5333
5316
  model,
@@ -5348,9 +5331,9 @@ var useOnChangeForm = () => {
5348
5331
  var use_onchange_form_default = useOnChangeForm;
5349
5332
 
5350
5333
  // src/hooks/model/use-save.ts
5351
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5334
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
5352
5335
  var useSave = () => {
5353
- return useMutation28({
5336
+ return useMutation27({
5354
5337
  mutationFn: ({
5355
5338
  ids,
5356
5339
  model,
@@ -5364,18 +5347,18 @@ var useSave = () => {
5364
5347
  var use_save_default = useSave;
5365
5348
 
5366
5349
  // src/hooks/user/use-get-profile.ts
5367
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5350
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
5368
5351
  var useGetProfile = (path) => {
5369
- return useMutation29({
5352
+ return useMutation28({
5370
5353
  mutationFn: () => user_service_default.getProfile(path)
5371
5354
  });
5372
5355
  };
5373
5356
  var use_get_profile_default = useGetProfile;
5374
5357
 
5375
5358
  // src/hooks/user/use-get-user.ts
5376
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5359
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
5377
5360
  var useGetUser = () => {
5378
- return useMutation30({
5361
+ return useMutation29({
5379
5362
  mutationFn: ({ id, context }) => user_service_default.getUser({
5380
5363
  id,
5381
5364
  context
@@ -5385,9 +5368,9 @@ var useGetUser = () => {
5385
5368
  var use_get_user_default = useGetUser;
5386
5369
 
5387
5370
  // src/hooks/user/use-switch-locale.ts
5388
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5371
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
5389
5372
  var useSwitchLocale = () => {
5390
- return useMutation31({
5373
+ return useMutation30({
5391
5374
  mutationFn: ({ data }) => {
5392
5375
  return user_service_default.switchUserLocale({
5393
5376
  id: data.id,
@@ -5399,9 +5382,9 @@ var useSwitchLocale = () => {
5399
5382
  var use_switch_locale_default = useSwitchLocale;
5400
5383
 
5401
5384
  // src/hooks/view/use-button.ts
5402
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5385
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
5403
5386
  var useButton = () => {
5404
- return useMutation32({
5387
+ return useMutation31({
5405
5388
  mutationFn: ({
5406
5389
  model,
5407
5390
  ids,
@@ -5421,9 +5404,9 @@ var useButton = () => {
5421
5404
  var use_button_default = useButton;
5422
5405
 
5423
5406
  // src/hooks/view/use-duplicate-record.ts
5424
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5407
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
5425
5408
  var useDuplicateRecord = () => {
5426
- return useMutation33({
5409
+ return useMutation32({
5427
5410
  mutationFn: ({
5428
5411
  id,
5429
5412
  model,
@@ -5549,9 +5532,9 @@ var useGetMenu = (context, enabled) => {
5549
5532
  var use_get_menu_default = useGetMenu;
5550
5533
 
5551
5534
  // src/hooks/view/use-get-print-report.ts
5552
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5535
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
5553
5536
  var useGetPrintReport = () => {
5554
- return useMutation34({
5537
+ return useMutation33({
5555
5538
  mutationFn: ({ id }) => action_service_default.getPrintReportName({
5556
5539
  id
5557
5540
  })
@@ -5615,9 +5598,9 @@ var useGetView = (viewParams, actData) => {
5615
5598
  var use_get_view_default = useGetView;
5616
5599
 
5617
5600
  // src/hooks/view/use-load-action.ts
5618
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5601
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
5619
5602
  var useLoadAction = () => {
5620
- return useMutation35({
5603
+ return useMutation34({
5621
5604
  mutationFn: ({
5622
5605
  idAction,
5623
5606
  context
@@ -5643,9 +5626,9 @@ var useLoadMessage = () => {
5643
5626
  var use_load_message_default = useLoadMessage;
5644
5627
 
5645
5628
  // src/hooks/view/use-print.ts
5646
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5629
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
5647
5630
  var usePrint = () => {
5648
- return useMutation36({
5631
+ return useMutation35({
5649
5632
  mutationFn: ({ id, report, db }) => action_service_default.print({
5650
5633
  id,
5651
5634
  report,
@@ -5656,9 +5639,9 @@ var usePrint = () => {
5656
5639
  var use_print_default = usePrint;
5657
5640
 
5658
5641
  // src/hooks/view/use-remove-row.ts
5659
- import { useMutation as useMutation37 } from "@tanstack/react-query";
5642
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
5660
5643
  var useRemoveRow = () => {
5661
- return useMutation37({
5644
+ return useMutation36({
5662
5645
  mutationFn: ({
5663
5646
  model,
5664
5647
  ids,
@@ -5690,9 +5673,9 @@ var useGetResequence = (model, resIds, context, offset) => {
5690
5673
  var use_resequence_default = useGetResequence;
5691
5674
 
5692
5675
  // src/hooks/view/use-run-action.ts
5693
- import { useMutation as useMutation38 } from "@tanstack/react-query";
5676
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
5694
5677
  var useRunAction = () => {
5695
- return useMutation38({
5678
+ return useMutation37({
5696
5679
  mutationFn: ({
5697
5680
  idAction,
5698
5681
  context
@@ -5705,9 +5688,9 @@ var useRunAction = () => {
5705
5688
  var use_run_action_default = useRunAction;
5706
5689
 
5707
5690
  // src/hooks/view/use-signin-sso.ts
5708
- import { useMutation as useMutation39 } from "@tanstack/react-query";
5691
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
5709
5692
  var useSignInSSO = () => {
5710
- return useMutation39({
5693
+ return useMutation38({
5711
5694
  mutationFn: ({
5712
5695
  redirect_uri,
5713
5696
  state,
@@ -5728,9 +5711,9 @@ var useSignInSSO = () => {
5728
5711
  var use_signin_sso_default = useSignInSSO;
5729
5712
 
5730
5713
  // src/hooks/view/use-verify-2FA.ts
5731
- import { useMutation as useMutation40 } from "@tanstack/react-query";
5714
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
5732
5715
  var useVerify2FA = () => {
5733
- return useMutation40({
5716
+ return useMutation39({
5734
5717
  mutationFn: ({
5735
5718
  method,
5736
5719
  with_context,
@@ -5751,9 +5734,9 @@ var useVerify2FA = () => {
5751
5734
  var use_verify_2FA_default = useVerify2FA;
5752
5735
 
5753
5736
  // src/hooks/view/uset-get-2FA-method.ts
5754
- import { useMutation as useMutation41 } from "@tanstack/react-query";
5737
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
5755
5738
  var useGet2FAMethods = () => {
5756
- return useMutation41({
5739
+ return useMutation40({
5757
5740
  mutationFn: ({
5758
5741
  method,
5759
5742
  with_context
@@ -5768,9 +5751,9 @@ var useGet2FAMethods = () => {
5768
5751
  var uset_get_2FA_method_default = useGet2FAMethods;
5769
5752
 
5770
5753
  // src/hooks/view/use-get-fields-view-security.ts
5771
- import { useMutation as useMutation42 } from "@tanstack/react-query";
5754
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
5772
5755
  var useGetFieldsViewSecurity = () => {
5773
- return useMutation42({
5756
+ return useMutation41({
5774
5757
  mutationFn: ({
5775
5758
  method,
5776
5759
  token,
@@ -5787,9 +5770,9 @@ var useGetFieldsViewSecurity = () => {
5787
5770
  var use_get_fields_view_security_default = useGetFieldsViewSecurity;
5788
5771
 
5789
5772
  // src/hooks/view/use-grant-access.ts
5790
- import { useMutation as useMutation43 } from "@tanstack/react-query";
5773
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
5791
5774
  var useGrantAccess = () => {
5792
- return useMutation43({
5775
+ return useMutation42({
5793
5776
  mutationFn: ({
5794
5777
  redirect_uri,
5795
5778
  state,
@@ -5808,9 +5791,9 @@ var useGrantAccess = () => {
5808
5791
  var use_grant_access_default = useGrantAccess;
5809
5792
 
5810
5793
  // src/hooks/view/use-remove-totp-setup.ts
5811
- import { useMutation as useMutation44 } from "@tanstack/react-query";
5794
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
5812
5795
  var useRemoveTotpSetup = () => {
5813
- return useMutation44({
5796
+ return useMutation43({
5814
5797
  mutationFn: ({ method, token }) => {
5815
5798
  return view_service_default.removeTotpSetUp({
5816
5799
  method,
@@ -5822,9 +5805,9 @@ var useRemoveTotpSetup = () => {
5822
5805
  var use_remove_totp_setup_default = useRemoveTotpSetup;
5823
5806
 
5824
5807
  // src/hooks/view/use-request-setup-totp.ts
5825
- import { useMutation as useMutation45 } from "@tanstack/react-query";
5808
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
5826
5809
  var useRequestSetupTotp = () => {
5827
- return useMutation45({
5810
+ return useMutation44({
5828
5811
  mutationFn: ({ method, token }) => {
5829
5812
  return view_service_default.requestSetupTotp({
5830
5813
  method,
@@ -5836,9 +5819,9 @@ var useRequestSetupTotp = () => {
5836
5819
  var use_request_setup_totp_default = useRequestSetupTotp;
5837
5820
 
5838
5821
  // src/hooks/view/use-settings-web-read-2fa.ts
5839
- import { useMutation as useMutation46 } from "@tanstack/react-query";
5822
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
5840
5823
  var useSettingsWebRead2fa = () => {
5841
- return useMutation46({
5824
+ return useMutation45({
5842
5825
  mutationFn: ({
5843
5826
  method,
5844
5827
  token,
@@ -5857,9 +5840,9 @@ var useSettingsWebRead2fa = () => {
5857
5840
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
5858
5841
 
5859
5842
  // src/hooks/view/use-verify-totp.ts
5860
- import { useMutation as useMutation47 } from "@tanstack/react-query";
5843
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
5861
5844
  var useVerifyTotp = () => {
5862
- return useMutation47({
5845
+ return useMutation46({
5863
5846
  mutationFn: ({
5864
5847
  method,
5865
5848
  action_token,
@@ -5941,7 +5924,6 @@ export {
5941
5924
  use_upload_file_default as useUploadFile,
5942
5925
  use_upload_id_file_default as useUploadIdFile,
5943
5926
  use_upload_image_default as useUploadImage,
5944
- use_validate_action_token_default as useValidateActionToken,
5945
5927
  use_verify_2FA_default as useVerify2FA,
5946
5928
  use_verify_totp_default as useVerifyTotp
5947
5929
  };